Logo Platform
logo amplifiers simplified

Per Pop - how to do it?

Reply
Copied to clipboard!
12 years ago
Aug 6, 2012, 9:25:42 PM
Gun and Roses - Civil War - indeed, good music



I've since tried adding the ability to structures and again no joy. I have no idea why, since the coding works for alien esteem tech.
0Send private message
12 years ago
Aug 2, 2012, 3:31:13 PM
I don't know if it is correct but the way I understood bindonsource was that by default it was always on and always true. It adds a property to that specific object when true (which is default) ie the issue I was having with giving a hero a +approval rating base on population is that a hero doesn't have a pop and there while it would display correctly in the description, it wont have any effect. Therefore when I added the false modifier, it then checked for pop base on the object it was assigned to - the planet. Additionally, I sortof confirmed this when I added the same modifiers to supermarket building without the false modifier (I'll double check that when I get home tonight)
0Send private message
12 years ago
Aug 2, 2012, 3:53:52 PM
I don't think that is correct. The difference between the two examples is that the first one uses wit and the second one uses food. They both store their effect into the same place (system). I guess bindonsource=true means to get the value (food) from the destination object (system) rather than the object on which the modifier appears (hero). So without bindonsource=true, it will get the value (food) from the object on which the modifier appears (hero), which results in zero.
0Send private message
12 years ago
Aug 3, 2012, 7:48:41 AM
Yes you're right davea. And by default the behavior is "BindOnSource=true"



At the very beginging of the dev, we create the whole simulation architecture and think that we need to use the "source properties" to resolve the "Value" part of the modifier. Example : The hero add his wit property to the system food.

But in the late development we start getting some request from the designers to add a way to use the "Destination properties" to resolve the "Value" in defined situation... Example : The hero has a ability which add the food of the system in the industry of the system.



So we create the "BindOnSource" attribute and set its default at "true" to avoid modifying all our already build modifiers...



[Code]











[/Code]



BindOnSource = true -> Find the "Value" property on the source object of the modifier (in the example Hero) (This is the default behavior. When you do not add the attribute "BindOnSource", we use as if you set it to "true".)

BindOnSource = false -> Find the "Value" property on the destination object of the modifier (in the example StarSystem, which won't work because star system does not have a "Wit" property.)



Is it clearer?
0Send private message
12 years ago
Aug 3, 2012, 1:43:00 PM
Yes, it is clear now. Use bindonsource=false to get the property from the destination object. Otherwise the property comes from the source object.
0Send private message
12 years ago
Aug 6, 2012, 12:45:34 AM
[CODE]







[/CODE]



Any ideas why the above isn't working? It displays correctly in the tooltip, but the effect is never applied. I've tried a variation of paths and with and without bindonsource
0Send private message
12 years ago
Aug 6, 2012, 4:04:03 AM
iblise wrote:
[CODE]







[/CODE]



Any ideas why the above isn't working? It displays correctly in the tooltip, but the effect is never applied. I've tried a variation of paths and with and without bindonsource




Uhm, I would recommend trying following things:

Try what happens if path points to entire empire, if it works you know that problem is that in solarsystem level calling function NumberofWars isn't possible.



Basically if I read what you try correctly your HeroAbilityAdminstrator04 tries to calculate number of wars in solarsystem level (you know with or without bindonsource it still should checks in this case solarsystem) and then calculates that number by 5.



My quess is that War is something what affects to empire and solarsystems just doesn't understand it. Only way to check whether I am correct or not is to do that check what I suggested.
0Send private message
12 years ago
Aug 6, 2012, 4:39:01 AM
Nope, do not collect 200, do not pass go, go directly to jail.



Classempire still results in no effect, it is so frustrating, the coding works perfectly in alien estem (deep dipolmacy tree tech) but yet refuse to work on a hero...
0Send private message
12 years ago
Aug 6, 2012, 9:36:33 AM
iblise wrote:
Nope, do not collect 200, do not pass go, go directly to jail.



Classempire still results in no effect, it is so frustrating, the coding works perfectly in alien estem (deep dipolmacy tree tech) but yet refuse to work on a hero...




What we have here is (you know that you have listened too much good music when you are about to write: failure to communicate) prime example of hardcoded stuff.



I wanted you to check that thing just because IF it works game recognizes factor called number of wars atleast in empire level.

Sadly it doesn't which means that a) there is other things what affects to it and it's not that easy or b) it's really hard to do via simple xml coding.
0Send private message
12 years ago
Aug 2, 2012, 2:18:14 PM
I still don't understand BindOnSource. In your two examples above, can you describe what would happen differently for each example if I reversed the setting?
0Send private message
12 years ago
Aug 13, 2012, 8:52:26 PM
ThorTillas wrote:


To add any properties, you will need to create or modify a descriptor declaration. You can find several example by searching for Type="ClassType". All Class descriptor define some properties. There is some other descriptor which do it, but more difficult to find.



So create a descriptor declaration or choose one to edit.

When not already define, add the descriptor section "SimulationObjectPropertyDescriptors" and fill it with all the property you need.



Name: Property name. Must be unique.

Value: Base value or initial value.

IsCompound: Define if the property must sum his children properties. (star system food must sum all planet food property before anything else)

IsCompoundMin: Define if the property must choose the minimal children properties value as initial value.

IsCompoundMax: Define if the property must choose the maximal children properties value as initial value.

IsOutput: Define if the property is a FIMS

MinValue: Define the minimal value for the property. When negative value are allowed, please set it to "Negative".

MaxValue: Define the maximal value for the property.



Then, create or edit the section "SimulationObjectPropertyModifierDescriptors" of the descriptor to use your new property.



Apparently I'm doing something wrong here.



I wanted to add two properties to "ClassStarSystemImprovement".



So i wrote this:



















Now I was thinking this is like a class-definition in C++ and that all the Improvements are Child-Classes of it.



So without modifying this value yet I thought that using

$(ClassStarSystemImprovement:BuildTime) lt 2

should fail and thus the building not be built since 5 is not less than 2.



Now what's even more strange to me is that I tried to access this value for some kind of debug-information.



I did this:





























and was hoping to see my value instead of the "1" that normally stands there.

But it actually showed me the String "ClassStarSystemImprovement:BuiltTime" when I mouseovered the Improvement. This was also true when I used other Values like $(ClassStarSystem:Industry) for instance. But since this one works correctly as , I figured this must be a different issue.



I've tried so much stuff and yet I'm not even a single step further. I mean I know exactly what I want to do but I can't because I just don't seem to understand that interface. smiley: frown
0Send private message
12 years ago
Aug 13, 2012, 10:59:59 PM
eh I think when you see String "ClassStarSystemImprovement:BuiltTime" or similar stuff, it just means the game is confused (or in some case you strung together a complicated formula and the game can't handle the tooltip display)
0Send private message
12 years ago
Aug 13, 2012, 11:56:27 PM
I don't think it was confused. I just wanted to see what value that variable has and so I replaced something that I know where to see in the game with it. But for some reason it does not display the value of the variable but the name.

It probably does not recognize that this is a variable and thinks it's plain-text.



Or what I think is pretty likely: you cannot access Variables in Description-files anyways.



But that still does not explain why I can't seem to access it the same way I can with $(ClassStarSystem:Industry) gt 50.
0Send private message
12 years ago
Aug 14, 2012, 1:18:20 AM
Yeah, by confused I meant that the game doesn't realize that it is a valid variable (I knew what I meant, honest!) variables seem to be defined in hardcoded files with specific hooks that we don't have access to. I spent rather a while trying to get $(NumberOfMoons) to work with nothing to show for it
0Send private message
12 years ago
Aug 14, 2012, 5:13:38 AM
I wonder, if you add:



[code]







[/code]



later add:



[code]




[/code]



notice this is bad example and doed exactly what Iblise doesn't want... in this examples it multiplies amounts of StarSystems with knowledge whether Moon is explored (and causes hilarious problems) which causes anything but wanted effect.
0Send private message
12 years ago
Aug 14, 2012, 9:56:33 AM
Now can someone confirm or deny that self-added properties can be accessed in the same way e.g. $(ClassEmpire:NumerofMoons) as the ones already existing?



I know I can define them, I know I can do math with them and add them to other values. At least the game does not complain when I try to do it.



But to me it looks like I cannot access them the same way I can with the predefined variables.

I used "Upkeep" which is a predefined in the same class as I intend my "BuildTime" to be in and when I used $(ClassStarSystemImprovement:Upkeep) eq -3 it just worked.

Whereas when I try the same thing with my BuildTime it won't.



So in order to still do what I want I might have to consider misusing one of the existing predefined properties of something else. oO
0Send private message
12 years ago
Aug 14, 2012, 1:00:23 PM
So in order to still do what I want I might have to consider misusing one of the existing predefined properties of something else. oO




mmmm, misuse *starts to drool*
0Send private message
12 years ago
Aug 14, 2012, 1:40:58 PM
When I fleshed out that post, I was kinda craving for someone like you, who has the experience and stamina of penetrating the matter of modding very deeply to come up and let his pent-up knowledge pour out on me.



I hope I managed to avoid drool-impairing ambiguities better this time!
0Send private message
12 years ago
Jul 31, 2012, 4:14:11 PM
Yeah, "simply" was perhaps a little too much ^^



To add any properties, you will need to create or modify a descriptor declaration. You can find several example by searching for Type="ClassType". All Class descriptor define some properties. There is some other descriptor which do it, but more difficult to find.



So create a descriptor declaration or choose one to edit.

When not already define, add the descriptor section "SimulationObjectPropertyDescriptors" and fill it with all the property you need.



Name: Property name. Must be unique.

Value: Base value or initial value.

IsCompound: Define if the property must sum his children properties. (star system food must sum all planet food property before anything else)

IsCompoundMin: Define if the property must choose the minimal children properties value as initial value.

IsCompoundMax: Define if the property must choose the maximal children properties value as initial value.

IsOutput: Define if the property is a FIMS

MinValue: Define the minimal value for the property. When negative value are allowed, please set it to "Negative".

MaxValue: Define the maximal value for the property.



Then, create or edit the section "SimulationObjectPropertyModifierDescriptors" of the descriptor to use your new property.



For now, I have no "out of my mind" idea to add a descriptor on every StarSystem without doing some strange stuff... At least you will be able to edit the "ClassStarSystem" descriptor to add some information in there.



But for the "cap" property, I think you can bypass it by using the build in properties.

MaxSystemPopulation: Define the current colonized max population.

MaxPopulation: Define the theoretical max population with all planet colonized.

Population: Define the current population.

-> Add a rule on all food improvement which say "When population is greater or equals to MaxPopulation * 0.6, then don't build them" for example...



I do not know if it answer to your question or not...



Thanks for reading !

Cheers,

Flo
0Send private message
12 years ago
Jul 29, 2012, 6:59:45 PM
General advice: find another ability which works in a similar way, and see how they did it.

Specific answer: For example,

[code]


OperationType="Addition"

BinaryOperationType="Multiplication"

Right="$(Population)"

Left="12"

Path="ClassEmpire/ClassStarSystem"

BindOnSource="false"/>

[/code]

Adds 12 to system defense per population in system.
0Send private message
12 years ago
Jul 29, 2012, 7:06:28 PM
So would you need two object modifiers then to do the FIDS per pop? One that multiplies by FIDS, then the next one that divides by pop?



[CODE]


OperationType="Division"

BinaryOperationType="Multiplication"

Right="$(LuxuryFIDSBonusMultiplier)"

Left="$(Population)"

Path="ClassStarSystem"/>[/CODE]





I just tried out a flat +10 approval per pop as a hero ability and while the trait changed correctly, it doesn't look like that game actually applied the bonus modifier to my system...
0Send private message
12 years ago
Jul 30, 2012, 12:08:53 AM
BindOnSource="false"



FML - hero now applies the effect per pop perfectly with that one line



oh and not adding a '/' before a '>' breaks the game horribly but still lets it load up...





[code]









[/code]



Now does anyone know if there is some value used to measure total FIDS a system produces? I need a value that represents the total industry/science/food(money?) that a system produces...



LuxuryFIDS - any idea what this is?
0Send private message
12 years ago
Jul 31, 2012, 6:14:32 AM
*sigh*

how did that chinese phrase went: "1 stupid person asks more than 10 wise persons can answer"



Lets start with your original question:

Why does cloning use an extra seven lines? Couldn't it have been simplied down to...


Because it doesn't affect to Terran, Jungle or Ocean planets.



Enterpreneurs affects to every planet

Minister of Propaganda affects to system.



LuxuryFIDS - any idea what this is?




It's apperantly factor used to calculate how many luxury items you have which affects to your FIDS production. I wondered week about whether it's worthy to play with that and sadly it's not.



Basically how game counts those are:



But still you have to make similar task for each FIDS like you would have to do without that.

Basically it's valuable if you want to add more luxury resources later.
0Send private message
12 years ago
Jul 31, 2012, 6:29:30 AM
Hupailija wrote:
*sigh*

how did that chinese phrase went: "1 stupid person asks more than 10 wise persons can answer"




I know you probably didn't mean it the way you made it seem, I wouldn't call someone stupid and refer to yourself as the wiser when attempting to help... just saying.
0Send private message
12 years ago
Jul 31, 2012, 1:16:15 PM
I went looking for the quote, but found this instead



He who asks is a fool for five minutes
, but he who does not ask remains a fool forever. Chinese Proverb



But yup I figured out the cloning question, the more I look at the code the more sense it makes, still frustrating when I don't know what to look for. So Hupailija, you're not aware of anything that combines Industry, Food, Science and Money into one value? ie Industry 20000, Food 18000, Science 12000 and Money 500 for a FIDS of 50500
0Send private message
12 years ago
Jul 31, 2012, 3:43:44 PM
I am ^^



and there is no build in property that will give you the sum of the FIMS. As we have not use of this, we have not implemented it ^^



But you can do it by simply add a property on the "ClassStarSystemDescriptor" and the upcoming modifiers to add each FIMS.



Do not forget to check whenever you need the "brut" income or the "net" income (with or without the upkeep or food consumption).



I hope this post will answer your question !



Cheers,

Flo
0Send private message
12 years ago
Jul 31, 2012, 3:52:44 PM
ThorTillas wrote:
But you can do it by simply add a property on the "ClassStarSystemDescriptor" and the upcoming modifiers to add each FIMS.




Um, "simply"? Can you give an example of adding a new property? What sorts of information can be used to add a property? For example, can we setup a property which tells the population cap of a system, so we know whether farm buildings are needed?
0Send private message
12 years ago
Jul 29, 2012, 6:53:58 PM
I'm wanting to apply a bonus / deficit effect based on FIDS divided by population of system. For Example approval rating bonus depends on FIDS per population



Cloning + 1 food per population.



[CODE]























[/CODE]



Entrepreneurs + 1 Dust per population.



[CODE]











[/CODE]





Minister of Propaganda



[code]











[/code]









Why does cloning use an extra seven lines? Couldn't it have been simplied down to...






GDI - I understand now, I just fired it up in game and Cloning differs per rank you get...
0Send private message
12 years ago
Jul 31, 2012, 4:40:15 PM
How often are the properties updated? For example, in #4 above, "BindOnSource="false" turns out to be very critical. Which properties are computed once at game load? Which properties are updated dynamically? What happens if I accidentally build a loop out of two variables, such as "a = b * c" and "b = a * d"?



Is there a list of the built-in properties? I would love to have one which says "if system is under invasion" so I would know to build defenses, and one which says "if system is on front line" (any string path leaving the system goes to neutral/enemy system) so I would know to build sensor/influence range buildings.
0Send private message
12 years ago
Jul 31, 2012, 7:11:53 PM
I'm rather pumped about all this dev activity on the modding forums, hope you guys keep lurking cause I have lots of more ideas that I'll be attempting as time permits. Can't wait for loose file support, this character counting is really killing my modding inspiration. I'll attempt what you described when I arrive home tonight



Thank you
0Send private message
12 years ago
Jul 31, 2012, 9:12:49 PM
iblise wrote:
I'm rather pumped about all this rev activity on the modding forums, hope you guys keep lurking cause I have lots of more ideas that I'll be attempting as time permits. Can't wait for loos file support, this character counting is really killing my modding inspiration. I'll attempt what you described when I arrive home tonight



Thank you




Oh hey Iblise is the loos files support going to be implemented? I'm a little on again off again myself. I get bursts of motivation and then get deflated when I forget a space.
0Send private message
12 years ago
Jul 31, 2012, 10:24:05 PM
Haha, idk about 'loos' file support, but supposedly there is talk about 'loose' file support. No word when though unfortunately. Problem with posting on my phone is that spelling errors sneak through all too easily.
0Send private message
12 years ago
Jul 31, 2012, 10:26:38 PM
iblise wrote:
Haha, idk about 'loos' file support, but supposedly there is talk about 'loose' file support. No word when though unfortunately. Problem with posting on my phone is that spelling errors sneak through all too easily.




Haha well i'm at work I guess that's my mistake as I made the same error... Thanks for the follow up.
0Send private message
12 years ago
Aug 1, 2012, 8:22:40 AM
davea wrote:
How often are the properties updated? For example, in #4 above, "BindOnSource="false" turns out to be very critical. Which properties are computed once at game load? Which properties are updated dynamically? What happens if I accidentally build a loop out of two variables, such as "a = b * c" and "b = a * d"?



Is there a list of the built-in properties? I would love to have one which says "if system is under invasion" so I would know to build defenses, and one which says "if system is on front line" (any string path leaving the system goes to neutral/enemy system) so I would know to build sensor/influence range buildings.




All properties are updated many times per turns.

In fact, when you change your empire approval for example, we will update the whole empire. This is why this can lag a little at that time.



You must be careful with cyclic reference between properties. I have implemented (far far ago) a protection again this kind of "infinite loop" which don't apply the last instruction.

So your second instruction will not be applied normally... but I never warn you about... so you won't be aware of it...



The BindOnSource attribute must be set to "true" when you have a descriptor applied on the hero which target a star system property and use star system property.



Example :



BindOnSource=false : an hero ability add "Hero wit property value" on "star system science". ->

[CODE][/CODE]

BindOnSource=true : an hero ability add "star system food" on "star system industry". -> [CODE][/CODE]





There is no list of properties for the moment.

Plus, the system or empire or any object state could be represented by descriptors or properties.

For example, the "Is system under blocus" is represented by a "StarSystemStatusBlocus" descriptor.

You will be able to check it in the "star system improvement ai Prerequiste" with this line :

[CODE]

$(ClassStarSystem, StarSystemStatusBlocus)

[/CODE]



There is no property nor descriptor to describe the invasion status nor the front line proximity... for now at least.
0Send private message
12 years ago
Aug 1, 2012, 2:58:15 PM
ThorTillas wrote:
The BindOnSource attribute must be set to "true" when you have a descriptor applied on the hero which target a star system property and use star system property.


I don't understand. Are you saying that BindOnSource=false is used "if and only if" the descriptor refers to a hero stat?



There is no list of properties for the moment. ... For example, the "Is system under blocus" is represented by a "StarSystemStatusBlocus" descriptor.


Thanks for the info. I suppose we will have to ask these questions at random until we "strike gold" like this. It will save time for both of us if you can create a list of the properties.
0Send private message
12 years ago
Aug 2, 2012, 7:59:49 AM
davea wrote:
I don't understand. Are you saying that BindOnSource=false is used "if and only if" the descriptor refers to a hero stat?




Nope, I just taken the hero as an example. You can use the BindOnSource on every modifiers.

We have create this attribute because, by default, a modifier will use the source properties in the "Value" and sometimes you want to modify the target object property with some of his properties.

Like in the example where your hero want to modify the Star System industry with a part of the food.



davea wrote:
Thanks for the info. I suppose we will have to ask these questions at random until we "strike gold" like this. It will save time for both of us if you can create a list of the properties.




Yes I agree... I will try to see with Loic if he will have some time to spend in that...

We try to create some "user friendly" name but, yeah, we are french guys and ... not always easy to find a short and understandable name when your designer change his mind every two days ^^



Perhaps we need to start a thread which will resume all "objects", "properties", "descriptors", etc... this can be useful for both you and our designer guys ^^...
0Send private message
?

Click here to login

Reply
Comment