FreeOrion

Forums for the FreeOrion project
It is currently Fri May 24, 2013 4:12 am

All times are UTC




Post new topic Reply to topic  [ 16 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Tech Tree Revision: Economics
PostPosted: Sun Sep 06, 2009 10:43 pm 
Offline
Designer and Programmer
User avatar

Joined: Tue Aug 14, 2007 6:33 pm
Posts: 1772
Location: Orion
Edit: Here is a link to the most recent content updates. /edit

"Why did he revise the Economics tree?" you're thinking. "Nothing happens when you run out of trade, so the resource essentially doesn't do anything," you're thinking.

It does now, baby!

Not only will all buildings with non-trade related effects groups shut down if your trade stockpile goes below 0, but buildings that are maintained with food and minerals also shut down if the stockpile of said resource drops below the value they require to function. The only buildings like that right now are the Paradise Planet and The Looking Glass, and both of them (as well as Enclave of the Void, since it also has disastrous effects) can be turned off by setting planet foci.

Now for some bad news: I am fully aware that I am creating too many buildings. It is highly likely that many of these buildings will be reduced to refinements of other buildings, or just plain application techs. For now though, the buildings are there, and I probably won't be paring them down any time soon. This also means, artists, that I highly recommend not working on building icons for the time being. There are plenty of techs I've added that probably will stay. I'll eventually post a list of all the techs I've added in the graphics forums. I'm also going to try to give buildings more interesting effects in the future, but the effects system needs a few improvements before I can do that. Speaking of which:

We really need an "Allows" effect with a corresponding "Allowed" condition.

Try as I might, I couldn't get rid of the fact that you can still use your Neutronium Processors even when the Neutronium Extractors were gone... Plus, for some strange reason, whenever I starve a planet with Neutronium Extractors, the freeoriond executable shuts down. The problem appears to be the effects group that unlocks Neutronium Processing, but when I tried using a similar effects group on a different tech, there was no problem. Whatever the cause, eliminating the need to use the intermediary tech with an "Allowed" condition for build location would fix the problem. Furthermore, this would allow the condition of only one moon-based building per moon without having to destroy the moon.

Also, the ability for an effects group to change the stats of a ship part will be extremely useful when adding refinements to the ships tree. Alternatively, making ship stats dependent on effects groups within the ship part parameters might also work.

There also needs to be a way to make buildings use something other than Trade for maintenance. I can do it now with effects, but the change isn't included in the brackets on the resource bar, so the player will have to keep track of all his buildings that consume something other than Trade and do the arithmetic in his head. This isn't a big problem for now, since only two such buildings exist presently, but it will certainly be a problem later on. I believe it has also been mentioned before that something should be added to the UI to set targets and for activation and deactivation.

Being able to use another empire owning a tech or building as a condition would also be nice (being able to use one's own empire having a building as a condition would be nice, for that matter), and being able to set only a lower or upper limit on values such as empire stockpile, and being able to put effects into more than one stacking group would be useful. I'm also hoping for the ability to remove resources from another empire's stockpile and add them to one's own (will be useful when we get into diplomacy as well).

So for now, here are the things I've done that aren't economics related and that I haven't mentioned already:

Fixed Monument to Exodus Effects

Altered and enabled Enclave of the Void description

Added strings for mineral and food stockpiles (wasn't sure if ST_[resource] were in use somewhere, so I didn't replace them)

Fixed the Empire Growth Phase string (now has ... at the end instead of ..)

Eliminated effects descriptions that no longer apply.

Gave all non-trade boosting buildings with a maintenance cost of 1 or 0 an arbitrary, unbalanced maintenance cost and updated building descriptions to include maintenance costs. Also, buildings that I consider to be Terraforming type buildings do not have maintenance costs.


So there it is. You'll need the planet specials file I uploaded before, if you don't already have it, and I recommend downloading the ship parts file, too.


Attachments:
eng_stringtable.txt [140.9 KiB]
Downloaded 45 times
techs.txt [79.75 KiB]
Downloaded 43 times
buildings.txt [46.08 KiB]
Downloaded 38 times

_________________
Warning: Antarans in dimensional portal are closer than they appear.


Last edited by Bigjoe5 on Wed Dec 23, 2009 3:01 pm, edited 1 time in total.
Top
 Profile  
 
 Post subject: Re: Tech Tree Revision: Economics
PostPosted: Mon Sep 07, 2009 12:03 am 
Offline
Programming, Design, and De Facto Lead
User avatar

Joined: Wed Oct 08, 2003 1:33 am
Posts: 7893
Location: Vancouver, BC
Bigjoe5 wrote:
We really need an "Allows" effect with a corresponding "Allowed" condition.

Could you describe what this effects would do, with some examples?

Also, are you aware of the Number and NumberOf conditions? These might be what you want.

Quote:
Try as I might, I couldn't get rid of the fact that you can still use your Neutronium Processors even when the Neutronium Extractors were gone...

The processors' activation condition could be something like
Code:
Number low = 1 high = 999 condition =
    And [
        Building name = "BLD_NEUTRONIUM_PROCESSOR"
        OwnedBy affiliation = TheEmpire empire = Source.Owner
    ]

which matches any object, if there also exists at least one object (the same or different from the matched object) that is a neutronium processor owned by by the source object's owner, which for a tech would be the empire that researched the tech, or for a building would be the owner of the building. So if this was an building's effectsgroup activation condition, the building would function if the building's owner also owned at least one neutronium processor.

Quote:
Plus, for some strange reason, whenever I starve a planet with Neutronium Extractors, the freeoriond executable shuts down. The problem appears to be the effects group that unlocks Neutronium Processing, but when I tried using a similar effects group on a different tech, there was no problem.

Could you make a minimal techs.txt and buildings.txt that can demonstrate this? Just that building and the necessary techs that causes the crash, please.

Quote:
Also, the ability for an effects group to change the stats of a ship part will be extremely useful when adding refinements to the ships tree. Alternatively, making ship stats dependent on effects groups within the ship part parameters might also work.

For ship part effects that modify their ship's meters (health, stealth, fuel, shield, detection) you should be able to, but actually can't at the moment, make an effectsgroup in the part that adds +X to the relevant meter, with a scope activation of Source. This was possible, but tzlaine's partial rewrite of the way ship parts are scripted made it not possible. It will eventually be again. As a workaround, you can make the effects of the refinement tech be to give +X to the relevant meters of ships that have the part in question.

Giving bonuses to a specific part's other stats (ROF, range, capacity; missile speed and health; fighter speed, health, stealth) will hopefully be possible, but is presently not and will be a bit more complicated to add.

Quote:
There also needs to be a way to make buildings use something other than Trade for maintenance. I can do it now with effects, but the change isn't included in the brackets on the resource bar, so the player will have to keep track of all his buildings that consume something other than Trade and do the arithmetic in his head. This isn't a big problem for now, since only two such buildings exist presently, but it will certainly be a problem later on.

I'm more inclined to simply remove the concept of maintenance from the game. I don't think it adds anything other than annoyance and complication, particularly when deciding what happens when maintenance isn't paid. Just checking the stockpile amount isn't really good enough, since many planets won't have access to the stockpile anyway, so it shouldn't matter what level the stockpile is at for them.

Quote:
I believe it has also been mentioned before that something should be added to the UI to set targets and for activation and deactivation.

It has. No immediate plans for this, though. UI suggestions are welcome, though. Buildings and Ships could / should have a way to give them a (and probably just one) target, or cancel the target. Arguably, a fleet's target could be the system (or some other object?) that it's moving towards, and the UI could be modified similarly, in order to make things so move orders aren't given with the right mouse button, which I don't really like since right-click is not really used for any other similar function.

Quote:
Being able to use another empire owning a tech or building as a condition would also be nice (being able to use one's own empire having a building as a condition would be nice, for that matter),

See above, but change TheEmpire to Enemy.

Quote:
and being able to set only a lower or upper limit on values such as empire stockpile

Also on the wiki effects page:
Code:
OwnerFoodStockpile low = LOW high = HIGH
OwnerMineralStockpile low = LOW high = HIGH
OwnerTradeStockpile low = LOW high = HIGH

which match objects owned by empires that have the specified range of the relevant stockpiles.

Quote:
and being able to put effects into more than one stacking group would be useful.

Why is that needed?

Quote:
I'm also hoping for the ability to remove resources from another empire's stockpile and add them to one's own (will be useful when we get into diplomacy as well).

Code:
SetOwnerFoodStockpile value = VALUE
SetOwnerMineralStockpile value = VALUE
SetOwnerTradeStockpile value = VALUE


These can be easily used to set the stockpiles to a fixed value, but I'm not sure if they can be used to increment or decrement the stockpile. There are some object attributes listed in the effects page about trade, mineral and food stockpiles, but I'm not sure how they work. It might work to do
Code:
SetOwnerFoodStockpile Target.TradeStockpile + 5

but I'm not sure, so you'll have to try it and see. To transfer from one empire to another, have two effectsgroups, one of which has a scope condition to select one empire (affiliation enemy) and another which select the source object. One gets the effect above, and the other gets
Code:
SetOwnerFoodStockpile Target.TradeStockpile - 5


Top
 Profile  
 
 Post subject: Re: Tech Tree Revision: Economics
PostPosted: Mon Sep 07, 2009 2:55 am 
Offline
Designer and Programmer
User avatar

Joined: Tue Aug 14, 2007 6:33 pm
Posts: 1772
Location: Orion
Geoff the Medio wrote:
Could you describe what this effects would do, with some examples?
I thought that they could add a kind of allowing property to a location in the same way stacking groups do to effects. As an example, I would put for Neutronium Extractors:
Code:
scope = OwnedExclusivelyBy TheEmpire Source.Owner
activation = Source
effects = Allow "NEUTRONIUM_PROCESSING_A"

And for Neutronium Processors,

Code:
scope = Contains Source
activation = Source
effects = Allow "NEUTRONIUM_PROCESSING_B"

And for the neutronium parts,

Code:
location = Allowed And [
    "NEUTRONIUM_PROCESSING_A"
    "NEUTRONIUM_PROCESSING_B"
]


Quote:
Also, are you aware of the Number and NumberOf conditions? These might be what you want.
These numbers conditions are incredible!!!! But... not omnipotent. I find that they don't work as location conditions, which in this case, means they don't solve my problem.

Quote:
The processors' activation condition could be something like
Code:
Number low = 1 high = 999 condition =
    And [
        Building name = "BLD_NEUTRONIUM_PROCESSOR"
        OwnedBy affiliation = TheEmpire empire = Source.Owner
    ]

which matches any object, if there also exists at least one object (the same or different from the matched object) that is a neutronium processor owned by by the source object's owner, which for a tech would be the empire that researched the tech, or for a building would be the owner of the building. So if this was an building's effectsgroup activation condition, the building would function if the building's owner also owned at least one neutronium processor.
That would be great...if the Neutronium Processor had an effects group... as it is, it's just part of the location parameters for the neutronium parts.

Quote:
Could you make a minimal techs.txt and buildings.txt that can demonstrate this? Just that building and the necessary techs that causes the crash, please.
I tried. I confirmed that the crash does occur. Then I transfered the specific tech and building to an unaltered default document and used that to run FO: no crash. There are no references to any other techs or buildings in their parameters. Then I put them back in my current folder and ran FO with it: crash. I have no idea what's going on, but I'll enclose a file that contains both the tech and the building anyway. Maybe there will be some clues in there that I'm blind to.
Attachment:
notes.txt [1.12 KiB]
Downloaded 36 times



Quote:
Quote:
Also, the ability for an effects group to change the stats of a ship part will be extremely useful when adding refinements to the ships tree. Alternatively, making ship stats dependent on effects groups within the ship part parameters might also work.

For ship part effects that modify their ship's meters (health, stealth, fuel, shield, detection) you should be able to, but actually can't at the moment, make an effectsgroup in the part that adds +X to the relevant meter, with a scope activation of Source. This was possible, but tzlaine's partial rewrite of the way ship parts are scripted made it not possible. It will eventually be again. As a workaround, you can make the effects of the refinement tech be to give +X to the relevant meters of ships that have the part in question.

Giving bonuses to a specific part's other stats (ROF, range, capacity; missile speed and health; fighter speed, health, stealth) will hopefully be possible, but is presently not and will be a bit more complicated to add.
Since that's the case, there's not much to be done for ships refinements now, but that's fine I suppose.

Quote:
I'm more inclined to simply remove the concept of maintenance from the game. I don't think it adds anything other than annoyance and complication, particularly when deciding what happens when maintenance isn't paid. Just checking the stockpile amount isn't really good enough, since many planets won't have access to the stockpile anyway, so it shouldn't matter what level the stockpile is at for them.
Frankly, I agree. I was just working with what's there, though.


Quote:
Also on the wiki effects page:
Code:
OwnerFoodStockpile low = LOW high = HIGH
OwnerMineralStockpile low = LOW high = HIGH
OwnerTradeStockpile low = LOW high = HIGH

which match objects owned by empires that have the specified range of the relevant stockpiles.

I know you can use both; what I meant was the ability to use only one or the other so I don't have to specify low = 0 high = 999999999 for stockpiles.

Quote:
Quote:
and being able to put effects into more than one stacking group would be useful.

Why is that needed?
I was thinking that if a refinement to a non-building tech was a building they would have different stacking groups so that the dominant building bonus would be certain to be active. If this were the case, a mutually exclusive tech would have the stacking groups of both techs. However, using the number condition as an activation for a secondary effects group of the first tech makes this unnecessary.

Quote:
Code:
SetOwnerFoodStockpile value = VALUE
SetOwnerMineralStockpile value = VALUE
SetOwnerTradeStockpile value = VALUE


These can be easily used to set the stockpiles to a fixed value, but I'm not sure if they can be used to increment or decrement the stockpile. There are some object attributes listed in the effects page about trade, mineral and food stockpiles, but I'm not sure how they work. It might work to do
Code:
SetOwnerFoodStockpile Target.TradeStockpile + 5

but I'm not sure, so you'll have to try it and see. To transfer from one empire to another, have two effectsgroups, one of which has a scope condition to select one empire (affiliation enemy) and another which select the source object. One gets the effect above, and the other gets
Code:
SetOwnerFoodStockpile Target.TradeStockpile - 5
Increments and decrements are possible. In fact, it's what I used to implement mineral and food based maintenance. What I was referring to was the ability to specifically transfer resources, rather than having two separate effects act at the same time, one to add and one to subtract. This may not be actually necessary, but could prevent stealing more resources from an empire than that empire actually has.

_________________
Warning: Antarans in dimensional portal are closer than they appear.


Top
 Profile  
 
 Post subject: Re: Tech Tree Revision: Economics
PostPosted: Mon Sep 07, 2009 5:40 am 
Offline
Programming, Design, and De Facto Lead
User avatar

Joined: Wed Oct 08, 2003 1:33 am
Posts: 7893
Location: Vancouver, BC
Bigjoe5 wrote:
Quote:
Also, are you aware of the Number and NumberOf conditions? These might be what you want.
These numbers conditions are incredible!!!! But... not omnipotent. I find that they don't work as location conditions, which in this case, means they don't solve my problem.

In what way don't they work as location conditions?

There are numerous bugs with conditions in v0.3.13 that I'm presently fixing, so issues you're having might be related to those...

Quote:
That would be great...if the Neutronium Processor had an effects group... as it is, it's just part of the location parameters for the neutronium parts.

I haven't looked through your modifications in detail, but adapt the idea of my example to what you want to do.

Quote:
I tried. I confirmed that the crash does occur. Then I transfered the specific tech and building to an unaltered default document and used that to run FO: no crash. There are no references to any other techs or buildings in their parameters. Then I put them back in my current folder and ran FO with it: crash. I have no idea what's going on, but I'll enclose a file that contains both the tech and the building anyway. Maybe there will be some clues in there that I'm blind to.

The problem might be related to the GiveTechToOwner effect. If it's trying to give a tech to the owner of a no-population planet, then there is no owner, and it might be crashing when trying to assign a tech to no empire. Try adding an OwnedBy Source.Owner condition to the scope, and/or a minimum population condition.

Quote:
Quote:
Also on the wiki effects page:
Code:
OwnerFoodStockpile low = LOW high = HIGH
OwnerMineralStockpile low = LOW high = HIGH
OwnerTradeStockpile low = LOW high = HIGH

which match objects owned by empires that have the specified range of the relevant stockpiles.

I know you can use both; what I meant was the ability to use only one or the other so I don't have to specify low = 0 high = 999999999 for stockpiles.

What's wrong with "low = 0 high = 999999" ?

Quote:
Quote:
Quote:
and being able to put effects into more than one stacking group would be useful.

Why is that needed?
I was thinking that if a refinement to a non-building tech was a building

?! I don't follow this hypothetical situation... How / why would a tech be a building, and why would a refinement of another tech (that's not a building?) be a building?


Quote:
What I was referring to was the ability to specifically transfer resources, rather than having two separate effects act at the same time, one to add and one to subtract. This may not be actually necessary, but could prevent stealing more resources from an empire than that empire actually has.

Have a scope condition that requires the target object's empire to have some minimum amount of a resource in order to take some. It's not foolproof, but you are trying to do things that aren't really intended yet...


Top
 Profile  
 
 Post subject: Re: Tech Tree Revision: Economics
PostPosted: Mon Sep 07, 2009 4:54 pm 
Offline
Designer and Programmer
User avatar

Joined: Tue Aug 14, 2007 6:33 pm
Posts: 1772
Location: Orion
Geoff the Medio wrote:
In what way don't they work as location conditions?

When I use numbers as location conditions for a Neutronium ship part, it acts as if I had not put them in at all.
Code:
location = And [
    OwnedExclusivelyBy TheEmpire Source.Owner
    Number low = 1 high = 999 condition = And [
        Building name = "NEUTRONIUM_EXTRACTOR"
        OwnedBy TheEmpire Source.Owner
    ]
]

works exactly the same as
Code:
location = OwnedExclusivelyBy TheEmpire Source.Owner


Quote:
I haven't looked through your modifications in detail, but adapt the idea of my example to what you want to do.
As far as I can tell, there is no way to do that. Part of the problem is that if I include
Code:
Number low = 1 high = 999 condition = And [
    OwnedBy TheEmpire Source.Owner
    Building name = "NEUTRONIUM_EXTRACTOR"
]

as part of the activation condition for a building or tech, it will not activate if it has already been built/researched and I cease to own a Neutronium Extractor. It will only activate if I already do not own the Neutronium Extractor when it is built/researched. I suspect this may be a more general problem with effects activation.

Quote:
The problem might be related to the GiveTechToOwner effect. If it's trying to give a tech to the owner of a no-population planet, then there is no owner, and it might be crashing when trying to assign a tech to no empire. Try adding an OwnedBy Source.Owner condition to the scope, and/or a minimum population condition.
That modification was successful. The game no longer crashes when my Neutronium Extractor planet is lost.

Quote:
What's wrong with "low = 0 high = 999999" ?
Well, unimportantly, it seems a little clumsy and adds unnecessary complication when the player is reading the effects groups. Even less importantly, there's a possibility that the stockpile will exceed that number at some point, in which case the effect would no longer be active (though I'm not really all that worried that an empire's stockpile will exceed a billion in a given game).

Quote:
?! I don't follow this hypothetical situation... How / why would a tech be a building, and why would a refinement of another tech (that's not a building?) be a building?
Sorry, perhaps that wasn't very clear.

If a tech (tech 1) does not unlock a building, but rather affects its target directly, and a refinement (tech 2) to tech 1 does unlock a building (see autolabs from my first modification), then the effect of the building and of tech 1 cannot be in the same stacking group because, unlike multiple effects in the same tech, I know of no way to ensure that the building would take effect instead of tech 1. Now, if I wanted to put a different tech (tech 3) in the same stacking group as tech 1, it would only cancel the initial effect of unrefined tech 1. The building, which would probably be giving most of the bonus, would still be active, and tech 3 would also still be active. If I were, however, to put the effects of tech 3 in both stacking groups - that of tech 1 and the building - then I could ensure that either only tech 1 and the building were active and tech 3 was inactive, or tech 3 was active and tech 1 and the building were inactive. As I mentioned however, putting a number condition in the effects group of tech one allows the building to affect the empire indirectly, therefore not have an effects group and the corresponding stacking group.


Quote:
Have a scope condition that requires the target object's empire to have some minimum amount of a resource in order to take some. It's not foolproof, but you are trying to do things that aren't really intended yet...
I see. I expect that to work, eventually, but right now, it seem that the AI empires aren't identified as enemies. As such, the EnemyOf affiliation condition doesn't actually do anything. Furthermore, the Target.TradeStockpile condition does not work.
Code:
SetOwnerTradeStockpile Target.TradeStockpile + 100
doesn't do anything. When I replace Target.TradeStockpile with Target.Food stockpile, it works perfectly: the trade stockpile always remains at the value of last turn's food stock pile, plus the trade income. On the other hand, if I use
Code:
SetOwnerFoodStockpile Target.FoodStockpile + 100
the food stockpile increases by 1300 every turn. The same phenomenon occurs with minerals, and the same multiplying factor is present at other values. Also, if I set it to subtract food or minerals in the same way, it subtracts two times the amount I specified, rather than 13 times. (This is why the effects groups of The Looking Glass and Paradise Planet contradict the maintenance cost statement which I included in the description.) So as it is, the stockpile effects are somewhat broken.

_________________
Warning: Antarans in dimensional portal are closer than they appear.


Top
 Profile  
 
 Post subject: Re: Tech Tree Revision: Economics
PostPosted: Mon Sep 07, 2009 7:10 pm 
Offline
Programming, Design, and De Facto Lead
User avatar

Joined: Wed Oct 08, 2003 1:33 am
Posts: 7893
Location: Vancouver, BC
Bigjoe5 wrote:
When I use numbers as location conditions for a Neutronium ship part, it acts as if I had not put them in at all.
Code:
location = And [
    OwnedExclusivelyBy TheEmpire Source.Owner
    Number low = 1 high = 999 condition = And [
        Building name = "NEUTRONIUM_EXTRACTOR"
        OwnedBy TheEmpire Source.Owner
    ]
]

works exactly the same as
Code:
location = OwnedExclusivelyBy TheEmpire Source.Owner

On my local build, this building works, requiring an imperial palace to have been built in order to enqueue the test building:
Code:
BuildingType
    name = "BLD_TEST"
    description = "BLD_IMPERIAL_PALACE_DESC"
    buildcost = 1
    buildtime = 1
    maintenancecost = 1
    location = And [
        OwnedExclusivelyBy TheEmpire Source.Owner
        Number low = 1 high = 999 condition = And [
            Building name = "BLD_IMPERIAL_PALACE"
            OwnedBy TheEmpire Source.Owner
        ]
    ]

but I have recently rewritten several conditions, including And and Number.

Quote:
Part of the problem is that if I include
Code:
Number low = 1 high = 999 condition = And [
    OwnedBy TheEmpire Source.Owner
    Building name = "NEUTRONIUM_EXTRACTOR"
]

as part of the activation condition for a building or tech, it will not activate if it has already been built/researched and I cease to own a Neutronium Extractor. It will only activate if I already do not own the Neutronium Extractor when it is built/researched. I suspect this may be a more general problem with effects activation.

This might be a problem with And or Number. Could you post a minimal set of test buildings for this issue so I can test with my rewritten versions?

Quote:
Quote:
The problem might be related to the GiveTechToOwner effect. If it's trying to give a tech to the owner of a no-population planet, then there is no owner, and it might be crashing when trying to assign a tech to no empire. Try adding an OwnedBy Source.Owner condition to the scope, and/or a minimum population condition.
That modification was successful. The game no longer crashes when my Neutronium Extractor planet is lost.

I'll probably modify the effect to do nothing if the target has no valid owner, instead of crashing.

Quote:
Quote:
What's wrong with "low = 0 high = 999999" ?
Well, unimportantly, it seems a little clumsy and adds unnecessary complication when the player is reading the effects groups. Even less importantly, there's a possibility that the stockpile will exceed that number at some point, in which case the effect would no longer be active (though I'm not really all that worried that an empire's stockpile will exceed a billion in a given game).

Effectsgroups shouldn't rely on autogenerated descriptions, if you're referring to those with the reading complication. Hand-written descriptions can be phrased more elegantly than the effect is written, and users shouldn't be reading the raw effect descriptions in the whatever.txt files.

Being a little clumsy is acceptable.

Quote:
Quote:
How / why would a tech be a building, and why would a refinement of another tech (that's not a building?) be a building?

If a tech (tech 1) does not unlock a building, but rather affects its target directly, and a refinement (tech 2) to tech 1 does unlock a building

That is not appropriate for a refinement. A refinement should slightly tweak what it's parent application does, not do something totally different (eg. direct effect vs. unlock building).

Make a separate application that has the first tech as a prereq, if so desired.

Quote:
...the effect of the building and of tech 1 cannot be in the same stacking group because, unlike multiple effects in the same tech, I know of no way to ensure that the building would take effect instead of tech 1. Now, if I wanted to put a different tech (tech 3) in the same stacking group as tech 1, it would only cancel the initial effect of unrefined tech 1. The building, which would probably be giving most of the bonus, would still be active, and tech 3 would also still be active. If I were, however, to put the effects of tech 3 in both stacking groups - that of tech 1 and the building - then I could ensure that either only tech 1 and the building were active and tech 3 was inactive, or tech 3 was active and tech 1 and the building were inactive. As I mentioned however, putting a number condition in the effects group of tech one allows the building to affect the empire indirectly, therefore not have an effects group and the corresponding stacking group.

Using number is probably a better idea. Or, just write things so that both applications' effects can act on anything in range. Since they're now going to be two different applications, there's no reason to have stacking mutual exclusivity, or to worry about the order of effect application under the exclusivity.

Quote:
...right now, it seem that the AI empires aren't identified as enemies. As such, the EnemyOf affiliation condition doesn't actually do anything.

Looking into the code,
Code:
    case AFFIL_ENEMY:
        // TODO
        break;

So, that EnemyOf doesn't work isn't surprising, since it hasn't been written yet in v0.3.13. I've written the code for it just now though.

Quote:
Code:
SetOwnerTradeStockpile Target.TradeStockpile + 100
doesn't do anything.

Strange...

Quote:
When I replace Target.TradeStockpile with Target.Food stockpile, it works perfectly: the trade stockpile always remains at the value of last turn's food stock pile, plus the trade income. On the other hand, if I use
Code:
SetOwnerFoodStockpile Target.FoodStockpile + 100
the food stockpile increases by 1300 every turn.

What's your scope condition? If the effect is hitting 13 objects owned by your empire each turn, that would explain those results.

Quote:
The same phenomenon occurs with minerals, and the same multiplying factor is present at other values.

And those.

Quote:
Also, if I set it to subtract food or minerals in the same way, it subtracts two times the amount I specified, rather than 13 times.

But not those.

I suppose I'll have to investigate this.


Top
 Profile  
 
 Post subject: Re: Tech Tree Revision: Economics
PostPosted: Mon Sep 07, 2009 10:10 pm 
Offline
Designer and Programmer
User avatar

Joined: Tue Aug 14, 2007 6:33 pm
Posts: 1772
Location: Orion
Geoff the Medio wrote:
On my local build, this building works, requiring an imperial palace to have been built in order to enqueue the test building:
Code:
BuildingType
    name = "BLD_TEST"
    description = "BLD_IMPERIAL_PALACE_DESC"
    buildcost = 1
    buildtime = 1
    maintenancecost = 1
    location = And [
        OwnedExclusivelyBy TheEmpire Source.Owner
        Number low = 1 high = 999 condition = And [
            Building name = "BLD_IMPERIAL_PALACE"
            OwnedBy TheEmpire Source.Owner
        ]
    ]

but I have recently rewritten several conditions, including And and Number.
That very same building definitely does not require an imperial palace to be built on mine.

Quote:
This might be a problem with And or Number. Could you post a minimal set of test buildings for this issue so I can test with my rewritten versions?
Here are the two buildings and the tech I used:

Attachment:
notes.txt [1.79 KiB]
Downloaded 36 times



Quote:
That is not appropriate for a refinement. A refinement should slightly tweak what it's parent application does, not do something totally different (eg. direct effect vs. unlock building).
I agree that refinements should do pretty much the same thing as their application in that the effects groups should modify the same meters. However, I don't think it would be outrageous from a conceptual or a gameplay perspective to suppose that a general effect could be enhanced by a localized object. There are currently two such refinements: Autolab Controls and Imperial Black Market Centralization, but I will refrain from adding any more, and may go back and get rid of those two, if you wish.

Quote:
Quote:
When I replace Target.TradeStockpile with Target.Food stockpile, it works perfectly: the trade stockpile always remains at the value of last turn's food stock pile, plus the trade income. On the other hand, if I use
Code:
SetOwnerFoodStockpile Target.FoodStockpile + 100
the food stockpile increases by 1300 every turn.

What's your scope condition? If the effect is hitting 13 objects owned by your empire each turn, that would explain those results.

Quote:
The same phenomenon occurs with minerals, and the same multiplying factor is present at other values.

And those.

Quote:
Also, if I set it to subtract food or minerals in the same way, it subtracts two times the amount I specified, rather than 13 times.

But not those.

I suppose I'll have to investigate this.
You're right; It's the scope. My observations for subtracting food and minerals were based on a different building with a different scope. When I set it to Contains Source it went down to twice as much, and when I set it to Source, it worked as it should. Contains Source included the system as well as the planet, I believe, which was why the effect was hitting two targets. This, of course, still doesn't help me with Target.TradeStockpile.

_________________
Warning: Antarans in dimensional portal are closer than they appear.


Top
 Profile  
 
 Post subject: Re: Tech Tree Revision: Economics
PostPosted: Mon Sep 07, 2009 11:49 pm 
Offline
Programming, Design, and De Facto Lead
User avatar

Joined: Wed Oct 08, 2003 1:33 am
Posts: 7893
Location: Vancouver, BC
Bigjoe5 wrote:
Geoff the Medio wrote:
Bigjoe5 wrote:
Part of the problem is that if I include
Code:
Number low = 1 high = 999 condition = And [
    OwnedBy TheEmpire Source.Owner
    Building name = "NEUTRONIUM_EXTRACTOR"
]

as part of the activation condition for a building or tech, it will not activate if it has already been built/researched and I cease to own a Neutronium Extractor. It will only activate if I already do not own the Neutronium Extractor when it is built/researched. I suspect this may be a more general problem with effects activation.

This might be a problem with And or Number. Could you post a minimal set of test buildings for this issue so I can test with my rewritten versions?

Here are the two buildings and the tech I used:

I can't figure out what is supposed to happen and what is going wrong from your description or content definitions. You've got a weird coupled set of tech and buildings that both grant and revoke a tech, and some other effects, and an activation condition that appears to require there to be none of one building for another to function. The quoted description above of what happens in your game is also very hard to follow.

Can you make a clear / concise description of how to test, what should happen and what does happen, and remove as much unnecessary stuff from the test case as possible? Should these buildings be unlocked by default using preunlocked_items.txt, or do I need other techs as well to unlock them to run the test?


Top
 Profile  
 
 Post subject: Re: Tech Tree Revision: Economics
PostPosted: Tue Sep 08, 2009 12:41 am 
Offline
Designer and Programmer
User avatar

Joined: Tue Aug 14, 2007 6:33 pm
Posts: 1772
Location: Orion
This is what is supposed to happen:

The location condition for the Neutronium parts I made specify that the owner must have the tech PRO_NEUTRONIUM_PRO (Neutronium Processing), to be built. They also must be built at a Neutronium Processor. I didn't include them because that part works fine.

When a Neutronium Extractor is built, PRO_NEUTRONIUM_PRO should be unlocked. This means that when a Neutronium Processor is built, Neutronium Parts will be able to be built in that location. This also works fine; Neutronium parts cannot be built unless both the Neutronium Extractor and the Neutronium Processor have been built.

When ownership of a Neutronium Extractor is lost, the player should no longer be able to produce Neutronium parts. This means that the tech PRO_NEUTRONIUM_PRO should be revoked from the player when the Neutronium Extractor is lost. This is theoretically accomplished by having an effects group in the Neutronium Processor that revokes the tech, but is only active when there is no Neutronium Extractor. This is the part that doesn't work.

For testing this, you will find it useful to put both the processor and the extractor in the preunlocked items file and to set your universe tables to have an abundance of neutron stars with terran planets. Now, you may first want to run a test to make sure that the processor's revoking effect is working properly, so add PRO_NEUTRONIUM_PRO to the preunlocked items file as well, start a new game, and build a Neutronium Processor on your homeworld. You will find that one turn after is is built, you will no longer have the tech.

Now for the real test: Colonize a new planet on a neutron star and build the Neutronium Extractor. You will find that one turn after it is built you will have ownership of the tech PRO_NEUTRONIUM_PRO. Now build a Neutronium Processor on your homeworld. You will not lose the tech PRO_NEUTRONIUM_PRO. Now, eliminate the population on the planet on which you built the Neutronium Extractor (this may help).
Code:
BuildingType
    name = "BLD_CONC_CAMP"
    description = "BLD_CONC_CAMP_DESC"
    buildcost = 1
    buildtime = 1
    maintenancecost = 0
    location = And [
        OwnedExclusivelyBy TheEmpire Source.Owner
    ]
    effectsgroups =
        EffectsGroup
            scope = Contains Source
            activation = Source
            effects = [
                SetCurrentPopulation Target.CurrentPopulation - 1
                SetMaxIndustry Target.MaxIndustry + 30
                SetCurrentIndustry Target.MaxIndustry
            ]
    graphic = ""

Once that is accomplished, one would expect to find that one turn later, the effects group of the Neutronium Processor have activated and ownership of the PRO_NEUTRONIUM_PRO tech has been lost. This is not the case. The tech will stay forever. Furthermore, even if you build the Neutronium Processor after the Extractor is gone, the tech will still not be revoked. This is clearly a problem, perhaps with the GiveTechToOwner effect, or with the processor's activation.

_________________
Warning: Antarans in dimensional portal are closer than they appear.


Top
 Profile  
 
 Post subject: Re: Tech Tree Revision: Economics
PostPosted: Tue Sep 08, 2009 1:01 am 
Offline
Designer and Programmer
User avatar

Joined: Tue Aug 14, 2007 6:33 pm
Posts: 1772
Location: Orion
Also, I would find it very useful if more people were giving feedback on my content. Something on the Announcements board requesting our members to review these revisions would be appreciated.

_________________
Warning: Antarans in dimensional portal are closer than they appear.


Top
 Profile  
 
 Post subject: Re: Tech Tree Revision: Economics
PostPosted: Tue Sep 08, 2009 1:32 am 
Offline
Programming, Design, and De Facto Lead
User avatar

Joined: Wed Oct 08, 2003 1:33 am
Posts: 7893
Location: Vancouver, BC
Bigjoe5 wrote:
Also, I would find it very useful if more people were giving feedback on my content. Something on the Announcements board requesting our members to review these revisions would be appreciated.

That's not the purpose of the annoucnements board. People who are interested will see this and comment, but not a lot of people are interested in the gory details of content creation, which is why its not gotten much attention for so long.

Edit: Regarding your effect / condition problem, what might be happening is that the building on the starved planet is still considered to be owned by your empire, even though you don't own the planet. Does the building show up on the now-uncolonized planet on the sidepanel, and does it show up if you recolonize the planet? Would the results you're seeing be consisten with your empire owning a hidden / invisible building on the starved planet? /Edit


Top
 Profile  
 
 Post subject: Re: Tech Tree Revision: Economics
PostPosted: Tue Sep 08, 2009 2:17 pm 
Offline
Designer and Programmer
User avatar

Joined: Tue Aug 14, 2007 6:33 pm
Posts: 1772
Location: Orion
Geoff the Medio wrote:
That's not the purpose of the annoucnements board. People who are interested will see this and comment, but not a lot of people are interested in the gory details of content creation, which is why its not gotten much attention for so long.
I understand.

Quote:
Edit: Regarding your effect / condition problem, what might be happening is that the building on the starved planet is still considered to be owned by your empire, even though you don't own the planet. Does the building show up on the now-uncolonized planet on the sidepanel, and does it show up if you recolonize the planet? Would the results you're seeing be consisten with your empire owning a hidden / invisible building on the starved planet? /Edit
You're right. Even though it does not appear in the sidepanel of the uncolonized system, and even though it doesn't reappear on the sidepanel when I recolonize the planet, it is still mine. I gave it an effects group to destroy itself immediately. Once that happened, the Neutronium Processor was able to revoke the tech. By changing the activation of Neutronium Processors so that there must not be a Neutronium Extractor contained by an object belonging the source owner rather than the Extractor belonging to the source owner itself, Neutronium now works the way I want it to.

_________________
Warning: Antarans in dimensional portal are closer than they appear.


Top
 Profile  
 
 Post subject: Re: Tech Tree Revision: Economics
PostPosted: Tue Sep 08, 2009 3:42 pm 
Offline
Designer and Programmer
User avatar

Joined: Tue Aug 14, 2007 6:33 pm
Posts: 1772
Location: Orion
Also, I notice you've made several relevant commits to SourceForge. Is there any way for me to have access to these additions besides downloading each file individually and putting them in the right folders?

_________________
Warning: Antarans in dimensional portal are closer than they appear.


Top
 Profile  
 
 Post subject: Re: Tech Tree Revision: Economics
PostPosted: Tue Sep 08, 2009 5:22 pm 
Offline
Programming, Design, and De Facto Lead
User avatar

Joined: Wed Oct 08, 2003 1:33 am
Posts: 7893
Location: Vancouver, BC
Bigjoe5 wrote:
Even though it does not appear in the sidepanel of the uncolonized system, and even though it doesn't reappear on the sidepanel when I recolonize the planet, it is still mine.

That's several bugs then... It should still appear on the sidepanel, even if you don't own the system, and it should *definitely* reappear after recolonization. It should also not stay owned by your empire if you don't own the planet.

Edit: these are fixed in svn /Edit

Edit2:
BigJoe5 wrote:
Code:
SetOwnerTradeStockpile Target.TradeStockpile + 100
doesn't do anything.

This is also fixed in svn
/Edit

Quote:
Also, I notice you've made several relevant commits to SourceForge. Is there any way for me to have access to these additions besides downloading each file individually and putting them in the right folders?

Use a subversion client. This is discussed a bit on the compile wiki page: http://freeorion.org/index.php/Compile#Subversion

You need to do more than just download the source files, though. Compiling FreeOrion on Windows isn't very difficult, and I strongly suggest you set yourself up to do so. Peruse the main compile wiki page and the windows-specific one for details.


Top
 Profile  
 
 Post subject: Re: Tech Tree Revision: Economics
PostPosted: Thu Sep 10, 2009 9:36 pm 
Offline
Designer and Programmer
User avatar

Joined: Tue Aug 14, 2007 6:33 pm
Posts: 1772
Location: Orion
I should be able to set myself up for that soon, though not immediately. (I'm also using Mac OSX, not Windows, which I surmise from your statement will make it less easy?)

On a different note, I am having trouble with the CreateBuilding effect. The following test building does nothing:
Code:
BuildingType
    name = "BLD_TEST"
    description = "BLD_TEST_DESC"
    buildcost = 1
    buildtime = 1
    maintenancecost = 0
    location = OwnedExclusivelyBy TheEmpire Source.Owner
    effectsgroups =
        EffectsGroup
            scope = Contains Source
            activation = Source
            effects = CreateBuilding name = "BLD_IMPERIAL_PALACE"
    graphic = ""


Am I doing it wrong, or is this a problem with the CreateBuilding effect?

Also, the game seems to crash whenever I try to destroy a planet.

_________________
Warning: Antarans in dimensional portal are closer than they appear.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 16 posts ]  Go to page 1, 2  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