FreeOrion

Forums for the FreeOrion project
It is currently Tue Jun 18, 2013 7:36 am

All times are UTC




Post new topic Reply to topic  [ 71 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next
Author Message
 Post subject:
PostPosted: Thu Dec 16, 2004 2:12 am 
Offline
Programming Lead Emeritus
User avatar

Joined: Thu Jun 26, 2003 1:33 pm
Posts: 1092
Geoff the Medio wrote:
tzlaine wrote:
Consider it done. The EffectsGroup documentation has been updated to reflect this.

Are we limited to one <stacking_group> tag per effects group?


Yes.

Quote:
eg. I want multiple copies of building A to not stack, and I want multiple copies of building B to not stack, and building C does the job of both A and B, so shouldn't stack with A's, B's or C's, but A's and B's should stack with eachother, as they do different things.


It's true that this can't be done with one group, but frankly liniting things to one group makes my life substantially easier. If this becomes a real pain as people write EffectsGroups, we can add support for multiple groups.

Quote:
Also, thanks for being so quick with these changes / additions.


Documentation changes are always fast; its the code changes that take so long. :)


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 16, 2004 2:26 am 
Offline
Vacuum Dragon
User avatar

Joined: Fri Jun 27, 2003 12:37 am
Posts: 2159
Location: Auckland, New Zealand
Is there a way to make a building affect max meter values for all planets in the system local to the building? Or is this only possible by using the conditions: WithinDistance and WithinStarlaneJumps.

If we can only use WithinDistance and WithinStarlaneJumps for this, then this could be a problem, because of the slow down you mention in the effects doc.

I imagine that buildings who affect objects within a radius of the building could be quite common, for intance a larger radius but +1 increase in meter values or a smaller radius but +3 increase in meter values.


Also, is it possible to have a limit on how many of a certain building can be built, eg I might want only one robot scientist buildable for the entire empire or maybe one per system. I guess it would be treated as a wonder perhaps, although I don't know if there is code for wonders yet.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 16, 2004 4:14 am 
Offline
Designer Emeritus

Joined: Thu Jun 26, 2003 8:07 am
Posts: 935
utilae wrote:
Is there a way to make a building affect max meter values for all planets in the system local to the building? Or is this only possible by using the conditions: WithinDistance and WithinStarlaneJumps.


Those are the conditions to use, ANDed with empireafflition (unless you want to effect planets from all empires.)

Quote:
If we can only use WithinDistance and WithinStarlaneJumps for this, then this could be a problem, because of the slow down you mention in the effects doc.


tz indicated in a earlier post that the this is fine. the slow down occurs when the conditition imbeded within the Within(X) is set to something other than <condintion::self/>.

See my example building, I believe it's well formed.


Quote:
Also, is it possible to have a limit on how many of a certain building can be built, eg I might want only one robot scientist buildable for the entire empire or maybe one per system. I guess it would be treated as a wonder perhaps, although I don't know if there is code for wonders yet.


Good question, I don't know the answer.

One thing you can do right now is make the effect scope the entire empire, and the entire effect non-stackable. So the player might have two wonders in his empire, but will only see the benefits of one. (this is helpful for when/if the player caputures a second wonder from another player as well.)


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 16, 2004 4:34 am 
Online
Programming, Design, and De Facto Lead
User avatar

Joined: Wed Oct 08, 2003 1:33 am
Posts: 8051
Location: Vancouver, BC
drek wrote:
Quote:
Also, is it possible to have a limit on how many of a certain building can be built, eg I might want only one robot scientist buildable for the entire empire or maybe one per system. I guess it would be treated as a wonder perhaps, although I don't know if there is code for wonders yet.

Good question, I don't know the answer.

We didn't really design the whole buildings model yet, so tzlaine has only really implemented the effects parts of them, and the basics like name, cost, build time, and maintainance. I think I whined about this at one point, but it never got done really.

There's actually a fair bit more we need to add to the buildings model from what's there now... such as:
:arrow: Prerequisites for buildings (other than techs), such as presence of a special on/in Planet/System/Empire/Galaxy (or a more complicated resources-access system, which would be later extended to include resource trading), various properties of P/S/E/G in which building can be built (environment type, star colour, population, meters...)
:arrow: Limits on number of buildings of given "building stacking group" in certain range or by number in P/S/E/G
:arrow: How do deal with unpaid maintaiance or various other unmet-after-being-built prerequisites or conditions, perhaps with some property that effect conditions can acces to turn themselves on/off appropriately, like whether a building is "Enabled" or "Active"
:arrow: Some form of obsolescence? tzlaine's forthcoming effects to alter building descriptions might do this


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 16, 2004 5:19 pm 
Offline
Designer Emeritus

Joined: Thu Jun 26, 2003 8:07 am
Posts: 935
couple of new effects related wiki pages:

Geoff's Hall of Examples:
http://www.freeorion.org/wiki/index.php ... n_Examples

My Crappy Tutorial:
http://www.freeorion.org/wiki/index.php/EffectsTutorial

The old cliff notes page might also be useful:
http://www.freeorion.org/wiki/index.php/V3_ScratchPad

If you see a mistake in the tutorial, correct at will.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 16, 2004 8:50 pm 
Offline
Vacuum Dragon
User avatar

Joined: Fri Jun 27, 2003 12:37 am
Posts: 2159
Location: Auckland, New Zealand
drek wrote:
My Crappy Tutorial:

Your tutorials good.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 16, 2004 9:29 pm 
Offline
Space Kraken
User avatar

Joined: Fri Jun 04, 2004 9:20 pm
Posts: 154
Location: Poland, Europe, Earth, Sol
drek wrote:


Yes! That's exactly what was needed! Tnx a lot! With this we can finally have the ball rolling. And its finally answers most of the questions I have been asking for several weeks now :>

Great job guys!

_________________
Image


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 16, 2004 9:50 pm 
Offline
Vacuum Dragon
User avatar

Joined: Fri Jun 27, 2003 12:37 am
Posts: 2159
Location: Auckland, New Zealand
Edit old tech posts into xml before adding new ones. Also you should make it tidy by presenting the tech with bold heading, description, effects in human language. Then do xml below in code form. Then do english language file stuff in code as well. Look at mine(learning page 2) or dreks as examples for presentation, etc.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Dec 18, 2004 7:59 pm 
Offline
Programming Lead Emeritus
User avatar

Joined: Thu Jun 26, 2003 1:33 pm
Posts: 1092
Tech-check is now available. This is a utility app that checks your techs.xml file for correctness. You can download it at http://freeorion.sourceforge.net/designer-tools.zip . It has a very instructive README file, and I expect you to RTFM before asking a bunch of questions. I have placed an example techs.xml file here: http://cvs.sourceforge.net/viewcvs.py/* ... /techs.xml , and the latest eng_stringtable.txt file is as before here: http://cvs.sourceforge.net/viewcvs.py/* ... gtable.txt , so you can see what it looks like when it's working, if you're having some trouble with your own tech tree file. Enjoy.


Last edited by tzlaine on Sat Jan 15, 2005 4:24 am, edited 2 times in total.

Top
 Profile  
 
 Post subject:
PostPosted: Sun Dec 19, 2004 5:13 am 
Online
Programming, Design, and De Facto Lead
User avatar

Joined: Wed Oct 08, 2003 1:33 am
Posts: 8051
Location: Vancouver, BC
Are there supposed to be errors in the example file?

For Con1d_AquaticDomes, you have:
Code:
              <Condition::PlanetType>
                 <PlanetType>PT_OCEAN</PlanetType>
                 <PlanetType>PT_SWAMP</PlanetType>
                 <PlanetType>PT_TERRAN</PlanetType>
                 <PlanetType>PT_GAIA</PlanetType>
              </Condition::Type>

Reading this file in Firefox gives an error, but tech-check doesn't seem to notice...?

Also, the newest eng_stringtable.txt doesn't have any of the techs from the example techs.xml you provide... Is this intended? (Why did I download a new eng_stringtable.txt ...?)

Edit: running tech-check on the provided techs.xml gives the following:
Code:
C:\FreeOrion>tech-check
Loading tech tree file "default/techs.xml" ...
Tech tree loaded.  Techs are:


******************************************************************************
ERROR: Con1_Architecture
[ERROR: TT_THEORY tech]
ERROR: Con1_Architecture_Desc
ERROR: CONSTRUCTION_CATEGORY
10 RP / 5 turns

[No prerequisites.]

[No unlocked items.]

[No effects.]


******************************************************************************
ERROR: Con1a_BuildingTechniques
[ERROR: TT_APPLICATION tech]
ERROR: Con1a_BuildingTechniques_Desc
ERROR: CONSTRUCTION_CATEGORY
10 RP / 3 turns

Prerequisites:
    ERROR: Con1_Architecture

[No unlocked items.]

Effect 1:
main() caught exception(std::exception): boost::too_many_args: format-string ref
ered to less arguments than were passed
C:\FreeOrion>

Running on this file: http://home.cogeco.ca/~toppingwebspace4/FO/techs.xml
gives:
Code:
C:\FreeOrion>tech-check
Loading tech tree file "default/techs.xml" ...
main() caught unknown exception.
C:\FreeOrion>


Top
 Profile  
 
 Post subject:
PostPosted: Sun Dec 19, 2004 5:41 pm 
Offline
Programming Lead Emeritus
User avatar

Joined: Thu Jun 26, 2003 1:33 pm
Posts: 1092
Geoff the Medio wrote:
Are there supposed to be errors in the example file?

For Con1d_AquaticDomes, you have:
Code:
              <Condition::PlanetType>
                 <PlanetType>PT_OCEAN</PlanetType>
                 <PlanetType>PT_SWAMP</PlanetType>
                 <PlanetType>PT_TERRAN</PlanetType>
                 <PlanetType>PT_GAIA</PlanetType>
              </Condition::Type>

Reading this file in Firefox gives an error, but tech-check doesn't seem to notice...?


The XML format I use is not strictly XML-compliant. The '::' substring is illegal XML syntax. So don't worry about it being incorrect, because my code expects such substrings.

Quote:
Also, the newest eng_stringtable.txt doesn't have any of the techs from the example techs.xml you provide... Is this intended? (Why did I download a new eng_stringtable.txt ...?)


I don't have those tech strings, because Drek didn't supply them. The new eng_stringtable.txt is however needed for the condition text to come out right.

Quote:
Edit: running tech-check on the provided techs.xml gives the following:
Code:
C:\FreeOrion>tech-check
Loading tech tree file "default/techs.xml" ...
Tech tree loaded.  Techs are:


******************************************************************************
ERROR: Con1_Architecture
[ERROR: TT_THEORY tech]
ERROR: Con1_Architecture_Desc
ERROR: CONSTRUCTION_CATEGORY
10 RP / 5 turns

[No prerequisites.]

[No unlocked items.]

[No effects.]


******************************************************************************
ERROR: Con1a_BuildingTechniques
[ERROR: TT_APPLICATION tech]
ERROR: Con1a_BuildingTechniques_Desc
ERROR: CONSTRUCTION_CATEGORY
10 RP / 3 turns

Prerequisites:
    ERROR: Con1_Architecture

[No unlocked items.]

Effect 1:
main() caught exception(std::exception): boost::too_many_args: format-string ref
ered to less arguments than were passed
C:\FreeOrion>


Sorry about that; I forgot that there is a 24 hour delay in the public availability of files that I change on that site. Download eng_stringtable.txt again. It's now the correct version.

Quote:
Running on this file: http://home.cogeco.ca/~toppingwebspace4/FO/techs.xml
gives:
Code:
C:\FreeOrion>tech-check
Loading tech tree file "default/techs.xml" ...
main() caught unknown exception.
C:\FreeOrion>


When I run that file, I get this:
Code:
$ ./tech-check --settings-dir .
Loading tech tree file "./techs.xml" ...
main() caught exception(std::runtime_error): ERROR: "XMLElement::Child(): This XMLElement contains no child "prerequisites"." encountered when loading this Tech XML code:
<Tech>
  <name>LRN_AI_THEORY</name>
  <type>TT_THEORY</type>
  <description>LRN_AI_THEORY_DESC</description>
  <category>LEARNING_CATEGORY</category>
  <research_cost>200</research_cost>
  <research_turns>15</research_turns>
</Tech>
$


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 20, 2004 3:18 am 
Online
Programming, Design, and De Facto Lead
User avatar

Joined: Wed Oct 08, 2003 1:33 am
Posts: 8051
Location: Vancouver, BC
tzlaine wrote:
The XML format I use is not strictly XML-compliant. The '::' substring is illegal XML syntax. So don't worry about it being incorrect, because my code expects such substrings.

It's not the :: that are the problem... Firefox doesn't even mention them when viewing my own techs in an XML file. The problem is the mismatched Type and PlanetType opening and closing tags in the example.

Otherwise, with the new eng_stringtable.txt, it seems to be working, other than all the "ERROR: Techname"-type stuff, which is expected, I gather.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 04, 2005 10:15 pm 
Offline
Vacuum Dragon
User avatar

Joined: Fri Jun 27, 2003 12:37 am
Posts: 2159
Location: Auckland, New Zealand
tzlaine wrote:
Download eng_stringtable.txt again. It's now the correct version.

Where do I get the eng_stringtable.txt file from. Can you provide a link.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 04, 2005 11:12 pm 
Offline
Graphics Lead Emeritus
User avatar

Joined: Mon Mar 08, 2004 6:17 pm
Posts: 1933
Location: 52°16'N 10°31'E
http://cvs.sourceforge.net/viewcvs.py/* ... gtable.txt


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 04, 2005 11:13 pm 
Offline
FreeOrion Lead Emeritus
User avatar

Joined: Thu Jun 26, 2003 6:23 am
Posts: 883
Location: Australia
You can download it here:
http://cvs.sourceforge.net/viewcvs.py/* ... gtable.txt

And browse all the files here:
http://cvs.sourceforge.net/viewcvs.py/freeorion/


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 71 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group