Changeset View
Standalone View
binaries/data/mods/public/simulation/templates/gaia/fauna_sheep.xml
Show All 13 Lines | <Health> | ||||
<Max>50</Max> | <Max>50</Max> | ||||
</Health> | </Health> | ||||
<Identity> | <Identity> | ||||
<GenericName>Sheep</GenericName> | <GenericName>Sheep</GenericName> | ||||
<SpecificName>Ovis aries</SpecificName> | <SpecificName>Ovis aries</SpecificName> | ||||
<Icon>gaia/fauna_sheep.png</Icon> | <Icon>gaia/fauna_sheep.png</Icon> | ||||
</Identity> | </Identity> | ||||
<ResourceSupply> | <ResourceSupply> | ||||
<Amount>100</Amount> | <Max>100</Max> | ||||
<MaxGatherers>3</MaxGatherers> | <MaxGatherers>3</MaxGatherers> | ||||
</ResourceSupply> | </ResourceSupply> | ||||
<Sound> | <Sound> | ||||
<SoundGroups> | <SoundGroups> | ||||
<select>actor/fauna/animal/sheep_select.xml</select> | <select>actor/fauna/animal/sheep_select.xml</select> | ||||
<order_walk>actor/fauna/animal/sheep_order.xml</order_walk> | <order_walk>actor/fauna/animal/sheep_order.xml</order_walk> | ||||
<death>actor/fauna/animal/sheep.xml</death> | <death>actor/fauna/animal/sheep.xml</death> | ||||
<trained>actor/fauna/animal/sheep_trained.xml</trained> | <trained>actor/fauna/animal/sheep_trained.xml</trained> | ||||
</SoundGroups> | </SoundGroups> | ||||
</Sound> | </Sound> | ||||
<StatusBars> | <StatusBars> | ||||
<HeightOffset>3.0</HeightOffset> | <HeightOffset>3.0</HeightOffset> | ||||
elexis: The two types could be unified by only using a `Generation` (or similar name) tag that allows… | |||||
Done Inline ActionsThen you wouldn't be able to have two different rates when alive and dead. Nescio wanted to have that. Stan: Then you wouldn't be able to have two different rates when alive and dead. Nescio wanted to… | |||||
Done Inline ActionsYou can have one, two, or more Generation instances that specify different values. elexis: You can have one, two, or more `Generation` instances that specify different values. | |||||
Done Inline ActionsCan you think of any case where it makes sense to have more than two ? I agree that the simplification would be nice, but I can't think of any good reason to add more. Also it would kind of prevent modifications, since you wouldn't really know on what they would apply to. Stan: Can you think of any case where it makes sense to have more than two ? I agree that the… | |||||
Done Inline ActionsThat the code of these two cases is duplicated is IMO sufficient reason to merge it. elexis: That the code of these two cases is duplicated is IMO sufficient reason to merge it.
That it… | |||||
Done Inline ActionsHow do you apply modifications for growth, and for decay only if you can't differentiate them, like if there is four or five ? Stan: How do you apply modifications for growth, and for decay only if you can't differentiate them… | |||||
Done Inline ActionsWhy not like this: <Generation> <HealthCondition>Alive</HealthCondition> <Rate>2</Rate> <Interval>1000</Interval> </Generation> <Generation> <HealthCondition>Dead</HealthCondition> <Rate>-1</Rate> <Interval>1000</Interval> </Generation> Hypothetically <Generation> <HealthCondition>Injured</HealthCondition> <Rate>-1</Rate> <Interval>2000</Interval> </Generation> (Point still being that most properties shared are of the same logic, have the same code, so we don't need to copy parsing of the properties) elexis: Why not like this:
```
<Generation>
<HealthCondition>Alive</HealthCondition>… | |||||
Done Inline ActionsWhat about constant decaying ? How do you target it ? If I want to make an aura tha reduces animal decaying or increase corral animals growth I can't target them because both are juste régénération variants What happens if you add a lot of Regen blocks ? Stan: What about constant decaying ? How do you target it ?
I agree the duplication is bad but I… | |||||
Done Inline Actions
By either having the HealthCondition optional or having it optional and setting it to Always.
Whatever the template defines. Mostly I'm annoyed by the code duplication, the properties are the same, so they require the same code, therefore the code called should not only be equal but identical. If the Schema is guided by the circumstances, to avoid stupid templates (multiple resource generations simultaneously) then why group it by sign of the rate, rather than by the condition? The latter would make it harder to specify such templates. One could even call the same functions to parse Growth and Decay to remove the code duplication, but why not make it simple? If people specify templates that contradict themselves, they will still be able to do so no matter how many checks we add. And the issue that this 'duplication for safety' prevents isn't very hard to discover from reading the template. elexis: > What about constant decaying
By either having the HealthCondition optional or having it… | |||||
</StatusBars> | </StatusBars> | ||||
<UnitMotion> | <UnitMotion> | ||||
<WalkSpeed op="mul">0.45</WalkSpeed> | <WalkSpeed op="mul">0.45</WalkSpeed> | ||||
</UnitMotion> | </UnitMotion> | ||||
<VisualActor> | <VisualActor> | ||||
<Actor>fauna/sheep3.xml</Actor> | <Actor>fauna/sheep3.xml</Actor> | ||||
</VisualActor> | </VisualActor> | ||||
</Entity> | </Entity> |
The two types could be unified by only using a Generation (or similar name) tag that allows Rate, Interval, Health { Always, Dead, Alive, ... }.
Also Rate sounds like being X per time, but it's only the divident X without the divisor time? (I didn't look into the code)
MaxAmount and MinAmount could also be part of the Generation tag or the one you currently have.