Stan` Posted January 27, 2019 Report Share Posted January 27, 2019 I started working on a feature that allows sheep to gain more food over time, and make animal's food decay over time, when being left out (rotting) I was wondering if that's something you guys would like to see in the game which would have a positive impact, or if you think that's better for a mod. @borg- @wowgetoffyourcellphone @Nescio @Hannibal_Barca https://code.wildfiregames.com/D1718 9 5 Quote Link to comment Share on other sites More sharing options...
borg- Posted January 27, 2019 Report Share Posted January 27, 2019 7 minutes ago, stanislas69 said: I started working on a feature that allows sheep to gain more food over time, and make animal's food decay over time, when being left out (rotting) I was wondering if that's something you guys would like to see in the game which would have a positive impact, or if you think that's better for a mod. @borg- @wowgetoffyourcellphone @Nescio @Hannibal_Barca https://code.wildfiregames.com/D1718 I remember asking Elexis for this a long time ago. I really think it adds a bit more realism and depth to the game. I would like to see this part of the game. When you tell sheep, are you telling the animals created by stable? 3 Quote Link to comment Share on other sites More sharing options...
Alexandermb Posted January 27, 2019 Report Share Posted January 27, 2019 1 hour ago, stanislas69 said: I started working on a feature that allows sheep to gain more food over time, and make animal's food decay over time, when being left out (rotting) I was wondering if that's something you guys would like to see in the game which would have a positive impact, or if you think that's better for a mod. @borg- @wowgetoffyourcellphone @Nescio @Hannibal_Barca https://code.wildfiregames.com/D1718 Would apply for farms too ? 1 Quote Link to comment Share on other sites More sharing options...
Stan` Posted January 27, 2019 Author Report Share Posted January 27, 2019 29 minutes ago, borg- said: When you tell sheep, are you telling the animals created by stable? Anything, for now just sheep cause I'm testing it but it could apply to literally anything. 3 minutes ago, Alexandermb said: Would apply for farms too ? Could work, What do you have in mind. Quote Link to comment Share on other sites More sharing options...
Nescio Posted January 27, 2019 Report Share Posted January 27, 2019 1 hour ago, stanislas69 said: https://code.wildfiregames.com/D1718 Basically, fauna starts at 0 food, gradually fattens to max when alive, and decays back to 0 after it's killed? Yes, that's something I like to see, not just in mods, but in 0 A.D.'s default distribution, for all fauna. While at it, could you also implement the following? Right now resource suppliers always start at the max by default; so each metal mine contains exactly 5000. Instead, I think the game would be far more interesting if such entities would simply be spawned with a random amount between max and min (e.g. a sheep starts with between 10 and 100 food, a stone quarry with between 3000 and 6000 stone). Quote Link to comment Share on other sites More sharing options...
wowgetoffyourcellphone Posted January 27, 2019 Report Share Posted January 27, 2019 1 hour ago, stanislas69 said: I started working on a feature that allows sheep to gain more food over time, and make animal's food decay over time, when being left out (rotting) I was wondering if that's something you guys would like to see in the game which would have a positive impact, or if you think that's better for a mod. @borg- @wowgetoffyourcellphone @Nescio @Hannibal_Barca https://code.wildfiregames.com/D1718 I think it's a little detail that Age players would like, indeed. How does the template schema look for this in your patch? Quote Link to comment Share on other sites More sharing options...
Stan` Posted January 27, 2019 Author Report Share Posted January 27, 2019 21 minutes ago, Nescio said: Basically, fauna starts at 0 food, gradually fattens to max when alive, and decays back to 0 after it's killed? Yes, that's something I like to see, not just in mods, but in 0 A.D.'s default distribution, for all fauna. You could do that with that patch. For now I was thinking making it start at one third or half, so you can hunt a bit at the begginning of the games. Quote While at it, could you also implement the following? Right now resource suppliers always start at the max by default; so each metal mine contains exactly 5000. Instead, I think the game would be far more interesting if such entities would simply be spawned with a random amount between max and min (e.g. a sheep starts with between 10 and 100 food, a stone quarry with between 3000 and 6000 stone). Could be done in a separate patch Pretty easy to do. 16 minutes ago, wowgetoffyourcellphone said: I think it's a little detail that Age players would like, indeed. How does the template schema look for this in your patch? I might not have thought of all the cases so it might break But currently <a:example> <Amount>1000</Amount> <Type>food.meat</Type> <KillBeforeGather>false</KillBeforeGather> <MaxGatherers>25</MaxGatherers> <DiminishingReturns>0.8</DiminishingReturns> <Regeneration> <Fattening> <GrowsWhenAliveOnly /> <Rate>0.5</Rate> <MaxAmount>500</MaxAmount> </Fattening> <Decaying> <DecaysWhenDeadOnly /> <Rate>0.5</Rate> </Decaying> <RegenInterval>500</RegenInterval> </Regeneration> </a:example> Quote Link to comment Share on other sites More sharing options...
wowgetoffyourcellphone Posted January 27, 2019 Report Share Posted January 27, 2019 So is <Amount> the starting amount when the unit is trained and <MaxAmount> is the maximum amount of food added to <Amount>? And with <Rate> and <RegenInterval> you'rer looking at precisely 1 Food per second of fattening? Quote Link to comment Share on other sites More sharing options...
Stan` Posted January 27, 2019 Author Report Share Posted January 27, 2019 7 minutes ago, wowgetoffyourcellphone said: So is <Amount> the starting amount when the unit is trained and <MaxAmount> is the maximum amount of food added to <Amount>? And with <Rate> and <RegenInterval> you'rer looking at precisely 1 Food per second of fattening? Right ! Quote Link to comment Share on other sites More sharing options...
wowgetoffyourcellphone Posted January 27, 2019 Report Share Posted January 27, 2019 1 minute ago, stanislas69 said: Right ! I probs would have just set the RegenInterval to 1000 and Rate to 1, but hey. Quote Link to comment Share on other sites More sharing options...
Stan` Posted January 27, 2019 Author Report Share Posted January 27, 2019 Yeah I fought a bug for a while and didn't remember to change it XD Quote Link to comment Share on other sites More sharing options...
Nescio Posted January 27, 2019 Report Share Posted January 27, 2019 1 hour ago, stanislas69 said: But currently Seems unnecessarily complicated. How about the following? <ResourceSupply> <KillBeforeGather>false</KillBeforeGather> <Amount>200</Amount> <Max>300</Max> <Type>food.fruit</Type> <MaxGatherers>8</MaxGatherers> <Growth> <Interval>1000</Interval> <Rate>1.0</Rate> </Growth> <Decay> <Interval>1000</Interval> <Rate>0.5</Rate> </Decay> </ResourceSupply> With growth active when the entity (animal, tree, something else) is “alive” and decay when it's “dead”; both rates can be negative. Quote Link to comment Share on other sites More sharing options...
Alexandermb Posted January 27, 2019 Report Share Posted January 27, 2019 4 hours ago, stanislas69 said: Anything, for now just sheep cause I'm testing it but it could apply to literally anything. Could work, What do you have in mind. Growing farms like Black and White 2. would change how food is collected and use seeding properly. 1 Quote Link to comment Share on other sites More sharing options...
Guest Posted January 28, 2019 Report Share Posted January 28, 2019 6 hours ago, Nescio said: Seems unnecessarily complicated. How about the following? <ResourceSupply> <KillBeforeGather>false</KillBeforeGather> <Amount>200</Amount> <Max>300</Max> <Type>food.fruit</Type> <MaxGatherers>8</MaxGatherers> <Growth> <Interval>1000</Interval> <Rate>1.0</Rate> </Growth> <Decay> <Interval>1000</Interval> <Rate>0.5</Rate> </Decay> </ResourceSupply> With growth active when the entity (animal, tree, something else) is “alive” and decay when it's “dead”; both rates can be negative. See the first iteration of the patch. I recall doing it like this. Quote Link to comment Share on other sites More sharing options...
Stan` Posted January 28, 2019 Author Report Share Posted January 28, 2019 8 hours ago, Nescio said: Seems unnecessarily complicated. How about the following? <ResourceSupply> <KillBeforeGather>false</KillBeforeGather> <Amount>200</Amount> <Max>300</Max> <Type>food.fruit</Type> <MaxGatherers>8</MaxGatherers> <Growth> <Interval>1000</Interval> <Rate>1.0</Rate> </Growth> <Decay> <Interval>1000</Interval> <Rate>0.5</Rate> </Decay> </ResourceSupply> With growth active when the entity (animal, tree, something else) is “alive” and decay when it's “dead”; both rates can be negative. Could work as well. I just didn't want to have two timers. Also trees are not alive. Their health bar is the resource bar. Quote Link to comment Share on other sites More sharing options...
Nescio Posted January 28, 2019 Report Share Posted January 28, 2019 5 hours ago, (-_-) said: See the first iteration of the patch. I recall doing it like this. Then why was it changed? 2 hours ago, stanislas69 said: I just didn't want to have two timers. Why not? Different attack types also work at different intervals. I'd say give maximum flexibility. 2 hours ago, stanislas69 said: Also trees are not alive. One might as well say they are always alive and cannot be dead; I suppose it depends on how one interpretes <KillBeforeGather>false</KillBeforeGather>. Anyway, I think this feature would be useful not only for ordinary meat animals, but also for fish and for fruit trees and bushes. Quote Link to comment Share on other sites More sharing options...
Guest Posted January 28, 2019 Report Share Posted January 28, 2019 1 minute ago, Nescio said: Then why was it changed? IDK. That’s how it looked when I abandoned it. Quote Link to comment Share on other sites More sharing options...
Stan` Posted January 28, 2019 Author Report Share Posted January 28, 2019 1 hour ago, Nescio said: Why not? Different attack types also work at different intervals. I'd say give maximum flexibility. Yeah, but that means more things running in the background, and so potentially more lag if there are a lot of units abusing it I'll update the diff when I have some time. Also I like to avoid memory access collision, two timers writing in the same variable at the same time might cause issues. 1 hour ago, Nescio said: One might as well say they are always alive and cannot be dead; I suppose it depends on how one interpretes <KillBeforeGather>false</KillBeforeGather>. Anyway, I think this feature would be useful not only for ordinary meat animals, but also for fish and for fruit trees and bushes. I meant on a code standpoint if you print the health on the deer while it's alive: var cmpHealth = Engine.QueryInterface(this.entity, IID_HEALTH); if (cmpHealth) warn(cmpHealth.GetHitpoints) // will print 50 (Current Deer Health) While it's dead var cmpHealth = Engine.QueryInterface(this.entity, IID_HEALTH); if (cmpHealth) warn(cmpHealth.GetHitpoints) // will print 100 (Current Deer food amount inherited from the Hunt template) Quote Link to comment Share on other sites More sharing options...
Guest Posted January 28, 2019 Report Share Posted January 28, 2019 Re: timer An additional timer is just an additional entry in the list of timers which gets updated per turn IIRC. Which means there would be no collisions. At least I think thats how it worked. Quote Link to comment Share on other sites More sharing options...
Stan` Posted January 28, 2019 Author Report Share Posted January 28, 2019 Ah yes you are right. Quote Link to comment Share on other sites More sharing options...
Stan` Posted January 28, 2019 Author Report Share Posted January 28, 2019 Updated https://code.wildfiregames.com/D1718 <ResourceSupply> <MaxAmount>200</MaxAmount> <Growth> <GrowsWhenAliveOnly/> <Rate>2</Rate> <Interval>1000</Interval> </Growth> <Decay> <DecaysWhenDeadOnly/> <Rate>1</Rate> <Interval>1000</Interval> </Decay> </ResourceSupply> 1 Quote Link to comment Share on other sites More sharing options...
Stan` Posted February 2, 2019 Author Report Share Posted February 2, 2019 Update. This should fix the bug of units not decaying again. The schema changed a little bit to allow for less duplication. <a:example> <Amount>1000</Amount> <MaxAmount>1500</MaxAmount> <Type>food.meat</Type> <KillBeforeGather>false</KillBeforeGather> <MaxGatherers>25</MaxGatherers> <DiminishingReturns>0.8</DiminishingReturns> <RegenBonus> <Growth> <Constraint>Alive</Constraint> <Rate>2</Rate> <Interval>1000</Interval> </Growth> <Decay> <Constraint>Dead</Constraint> <Rate>-1</Rate> <Interval>1000</Interval> </Decay> </RegenBonus> </a:example> Constraints 'Dead', 'Alive', 'Both', none (just don't add the line) The tag name defines the technology that will be able to affect the decay regen etc. When this is accepted, I will need to add an example tech. 2 Quote Link to comment Share on other sites More sharing options...
borg- Posted February 2, 2019 Report Share Posted February 2, 2019 (edited) I get lots of errors on trees apparently : https://imgur.com/a/3wtC4rN Edited February 2, 2019 by borg- Quote Link to comment Share on other sites More sharing options...
Stan` Posted February 2, 2019 Author Report Share Posted February 2, 2019 Thanks for testing, should be fixed now. 1 Quote Link to comment Share on other sites More sharing options...
borg- Posted February 3, 2019 Report Share Posted February 3, 2019 17 hours ago, stanislas69 said: Thanks for testing, should be fixed now. I do not know if you updated, but I still have the same problem. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.