Opened 9 years ago
Last modified 3 years ago
#3444 new defect
[PATCH] Lions / Lionesses don't run when attacked
Reported by: | Koufalex | Owned by: | erraunt |
---|---|---|---|
Priority: | Should Have | Milestone: | Work In Progress |
Component: | Simulation | Keywords: | patch rfc |
Cc: | knight.erraunt@… | Patch: |
Description (last modified by )
Lions / lionesses when attacked cruise slowly towards the attacker. It would be expected when lions are attacked to run towards the attacker as other animals run away, instead they just walk slowly while dying by javelins.
I believe animals, or maybe every unit, has walking and running speed, it seems like lions' running speed is either very low or they don't run.
Also this is my first bug report, so feel free to correct me or leave any feedback.
Attachments (6)
Change History (26)
comment:1 by , 9 years ago
Component: | AI → Core engine |
---|---|
Keywords: | pathfinding added; lions running speed removed |
follow-up: 3 comment:2 by , 9 years ago
Hello, I'm playing with the Alpha 18. Specifically it says "Build: Mar 3, 2015 (16404)". I see you changed Component from AI to Core Engine would you mind to explain, because it's fuzzy to me? Thank you for answering! :D
comment:3 by , 9 years ago
Replying to Koufalex:
I see you changed Component from AI to Core Engine would you mind to explain, because it's fuzzy to me?
Only things that relate to the Petra Bot should be listed under AI. It seems to be caused by the pathfinder, otherwise he wouldn't have added that keyword and those bugs are part of the core-engine.
You can find lions on the skirmish map Gold Oasis (2). In the templates you will see that their walk speed is quite slow, so everything works the way it should.
We could easily increase it to 30 walk and 40 run, since they should be able to walk/run faster than horses, right?
But I think this would not be an ideal change, since then they would always use this very fast walk speed, even when roaming. The animation used for walking also is not adequate for running. Also lions only run for short distances I think.
So ideally we would not increase their walk speed but make them run for some seconds when attacked and force some walking after that (before potentially running again) (in my opinion).
comment:4 by , 9 years ago
Lions can also be found on the map Savvana River (2). After a search I did on the internet I found that indeed lions sprint for sort distances when hunting and with speed larger than an average horse along with a rider. According to wikipedia an average galloping horse runs at speed of 40 - 48 km/h. And the max speed of a lion is around 80 km/h.
elexis idea: "So ideally we would not increase their walk speed but make them run for some seconds when attacked and force some walking after that" Sounds great.
by , 8 years ago
Attachment: | my_patch.diff added |
---|
A simple dirty fix which seems to do what is asked in this issue.
comment:5 by , 8 years ago
I have created a simple patch which makes animals APPROACH in runSpeed and CHASE in runSpeed even when the enemy is not FLEEING (it was stupid when the lion did not chase you solidiers when you ordered them to go away). Tested on lions/lionness, crocodiles and elephants, seems to work resonably, the lions are the only ones seriously affected the crocodiles/elephants probably have similar walk and run speed. Concerning speeds - not sure whether you strive for playability or real world feeling, but I think it is strange that I can escape a lion on foot, and the lions don't even bother to chase cavalry, I mean, they do but leave it very fast after realizing they will not catch them. In my mind it should be scaled so that it is possible to escape with cavalry, to get a similar feeling like now with the infantry - what do you guys think? About the speeds and the patch.
Speeds (walk/run) FYI: Roman Cavalry spearman speed is 22/40 lion speed is 3/15 Infantry spearman speed is 8.5/15
by , 8 years ago
Attachment: | UnitAI_animal_behavior.diff added |
---|
Changed the diff format to the one suggested in the wiki.
comment:6 by , 8 years ago
Please read the page wiki:SubmittingPatches, and also wiki:Coding_Conventions :)
On top of that I suggest you add the this.IsAnimal
check in the leave
branch so the code stays consistent.
Thanks for working on the issue!
by , 8 years ago
Attachment: | UnitAI_animal_behavior_with_Itms_suggestion.diff added |
---|
comment:7 by , 8 years ago
Cc: | added |
---|---|
Keywords: | rfc patch added |
Summary: | Lions / Lionesses don't run when attacked → [PATCH] Lions / Lionesses don't run when attacked |
comment:9 by , 8 years ago
Removed the creation of temporary variable for speed, previously was inspired how it was done in CHASE.enter, don't know which is better, changed it everywhere though - so it is consistent.
comment:10 by , 8 years ago
Milestone: | Backlog → Alpha 21 |
---|
by , 8 years ago
Attachment: | UnitAI_animal_behavior_with_elexis_suggestion.diff added |
---|
comment:13 by , 8 years ago
Component: | Core engine → UI & Simulation |
---|---|
Keywords: | review added; pathfinding rfc removed |
The patch looks good and works well! Do you want your name added to the game credits? If so, please update the file ps/trunk/binaries/data/mods/public/gui/credits/texts/programming.json.
comment:14 by , 8 years ago
Keywords: | review removed |
---|
Sorry, I missed something big: if the animal manages to kill the attacker, it should go back to its normal speed, so your line 1718 is wrong, it should be the regular speed.
Your new line 1999 will also add this kind of problem, since I assume the call for going back to the regular speed works for valid targets. I'm not sure your change to the conditional is actually needed, but I agree with removing the temporary variable.
comment:15 by , 8 years ago
Milestone: | Alpha 21 → Alpha 22 |
---|
It were nice to have for next release, but if noone is going to patch it until then (deadline tomorrow night)...
comment:16 by , 8 years ago
Of course 1718 was wrong.
Removed the temporary variable and added a conditional in 2009 - we don't want non-animal units to change speed in case of health change. But don't know what more can be wrong with 1999.
Will be back at Monday so I guess it will have to wait for Alpha 22 (if anyone else want to take care of it feel free).
EDIT: the conditional in 1718 was unnecessary I reckon - was that the one you wanted to change? Hopefully.
by , 8 years ago
Attachment: | UnitAI.diff added |
---|
comment:17 by , 7 years ago
Keywords: | rfc added |
---|---|
Milestone: | Alpha 22 → Work In Progress |
Don't forget to add a name entry for programming.json
and add a review or rfc keyword if you want your old patch to receive attention (or even better moving it to code.wildfiregames.com as explained at wiki:SubmittingPatches)
comment:18 by , 5 years ago
Component: | UI & Simulation → Simulation |
---|
Move tickets to Simulation
as UI & Simulation
got some sub components.
comment:20 by , 3 years ago
Owner: | set to |
---|
Hi and thanks for the report! Are you playing with the development version or with Alpha 18? :)