Vrayer Posted Sunday at 19:16 Share Posted Sunday at 19:16 I need the CAV to be able to switch to different animals. For example, if you set them to hunt deer and there are sheep nearby, they won't switch to the sheep afterward. That's really annoying, especially when you're trying to build up your economy with Corrals. Link to comment Share on other sites More sharing options...
Gurken Khan Posted Sunday at 20:11 Share Posted Sunday at 20:11 You can cue that switch with shift+right click. 1 Link to comment Share on other sites More sharing options...
Vrayer Posted 16 hours ago Author Share Posted 16 hours ago Yes, but it doesn't solve what I have in mind. If my cavalry are farming goats near the corrals and I start producing pigs, I don't want to have to queue 15 goats and wait for the pigs to spawn before I can add them to the queue. Link to comment Share on other sites More sharing options...
Thalatta Posted 15 hours ago Share Posted 15 hours ago (edited) 13 hours ago, Gurken Khan said: You can cue that switch with shift+right click. But, if I'm not wrong, you would be tasking the hunt of individuals, and not whole (nearby) species. I see some use for things to be the way they are, that is, not to switch to an aggressive species, but I've also noticed the additional micro @Vrayer is referring to. Something I thought could be useful would be an "Target in Area" button, where after pressing it one would adjust the area of a target circle, and all attackable (Gaia and enemy for example) units inside it would be queued to be attacked. This would be useful for hunts and fights, not having to precisely pinpoint some target. It would also avoid a weird issue I usually have, which is that after the target unit is killed, the attackers retreat to their previous position instead of keep killing enemies they have just beside them, although maybe this is related to their stance. Edited 15 hours ago by Thalatta 1 Link to comment Share on other sites More sharing options...
Atrik Posted 14 hours ago Share Posted 14 hours ago To do this, you would just need to remove this line: https://gitea.wildfiregames.com/0ad/0ad/src/commit/9598c6c2e1f4cc58f92d4fd6a54fda39ad195bf9/binaries/data/mods/public/simulation/components/UnitAI.js#L2755 But beware this line was obviously here for a reason. For example, if you are slaughtering a bunch of sheeps but an elephant comes by, then your units will attack this elephant. Link to comment Share on other sites More sharing options...
Atrik Posted 14 hours ago Share Posted 14 hours ago (edited) @Vrayer If you want to could add a poll to this thread (maybe also change the title) and if people think units should continue to hunt other animals it could be done for next release. It could also be possible to do it depending on animal "stance" for example units would keep hunting any other non-aggressive animals or any animals basically in the same stance that your initial order was. Edited 14 hours ago by Atrik 2 1 Link to comment Share on other sites More sharing options...
Vrayer Posted 12 hours ago Author Share Posted 12 hours ago 2 hours ago, Thalatta said: But, if I'm not wrong, you would be tasking the hunt of individuals, and not whole (nearby) species. I see some use for things to be the way they are, that is, not to switch to an aggressive species, but I've also noticed the additional micro @Vrayer is referring to. Something I thought could be useful would be an "Target in Area" button, where after pressing it one would adjust the area of a target circle, and all attackable (Gaia and enemy for example) units inside it would be queued to be attacked. This would be useful for hunts and fights, not having to precisely pinpoint some target. It would also avoid a weird issue I usually have, which is that after the target unit is killed, the attackers retreat to their previous position instead of keep killing enemies they have just beside them, although maybe this is related to their stance. I use ctrl or ctrl +A to attack in an area Link to comment Share on other sites More sharing options...
Thalatta Posted 12 hours ago Share Posted 12 hours ago 8 minutes ago, Vrayer said: I use ctrl or ctrl +A to attack in an area CTRL has its uses, but wouldn't do the hunt thing. CTRL+A rotates the view for me (I think I didn't define that). Link to comment Share on other sites More sharing options...
Gurken Khan Posted 11 hours ago Share Posted 11 hours ago 4 hours ago, Thalatta said: But, if I'm not wrong, you would be tasking the hunt of individuals, and not whole (nearby) species. Yes, but actually no, because the hunter would then continue with the species of the queued individual animal. (I'm pretty sure that's how it works.) Link to comment Share on other sites More sharing options...
Thalatta Posted 11 hours ago Share Posted 11 hours ago 10 minutes ago, Gurken Khan said: Yes, but actually no, because the hunter would then continue with the species of the queued individual animal. (I'm pretty sure that's how it works.) It doesn't work like that, I just tested it with the Corral. They do continue with the species of the last queued animal, as would be expected, but the animals neither specifically queued nor belonging to the species of the last queued animal are left alone. Link to comment Share on other sites More sharing options...
Gurken Khan Posted 11 hours ago Share Posted 11 hours ago 5 minutes ago, Thalatta said: They do continue with the species of the last queued animal, as would be expected, but the animals neither specifically queued nor belonging to the species of the last queued animal are left alone. So... Just as I described it? Say a cav is at the last sheep and I tell him to hunt a gazelle afterwards, then he continues to hunt gazelles? Link to comment Share on other sites More sharing options...
Vrayer Posted 10 hours ago Author Share Posted 10 hours ago Hey, thanks to @Atrik for pointing me in the right direction. I spent some time with ChatGPT and managed to create a small mod that seems to work. If you want to try it out: Installation: Download and extract the zip file into: Linux: ~/.local/share/0ad/mods/ Windows: %appdata%\0ad\mods\ Launch 0 A.D., go to Settings → Mod Selection, and enable Better Hunting. Restart 0 A.D. if required. What it does: Hunters can switch automatically between different meat animals. Other resource gathering behavior remains unchanged. better_hunting.zip 1 Link to comment Share on other sites More sharing options...
Thalatta Posted 10 hours ago Share Posted 10 hours ago 35 minutes ago, Gurken Khan said: So... Just as I described it? Say a cav is at the last sheep and I tell him to hunt a gazelle afterwards, then he continues to hunt gazelles? But the hunter has to be at the last of the previous species already, by "would then continue with the species of the queued individual animal", I would understand the species of each queued individual animal, that is, if you queue a sheep, a goat, and a gazelle, the hunter would hunt all sheep, goats and gazelles nearby, which is not what happens, and is what @Vrayer seems to want from his first post (what you say is the present behaviour, and he wouldn't be posting anything to begin with), and I understand his concern, but it's some micro that apparently has not really bothered players much. I've come across this kind of issue in the past when, for example, a few trees in a patch remain, and I'd like that, when workers are finished, for them to go mining, but if I try to queue this I have to click on each tree, otherwise they'll go mining after finishing the individual tree they are chopping right then. If others are up to reduce micro in this case, the "Target Area" button I mentioned could be considered, also including the possibility of targeting resources in that area. It would be just like expanding the pointer to an adjustable circular area for gathering, hunting, combat, and maybe other things like multiple garrisoning and ship boarding, for which units could automatically redistribute properly (right now I guess one would just queue orders and units would iterate among those until finding a spot). Link to comment Share on other sites More sharing options...
Atrik Posted 8 hours ago Share Posted 8 hours ago @Vrayer, congratulation on making your first mod! I have to warn you however that changes like theses will cause oos if you play with players that wouldn't have the mod. For the mod you posted, you should keep the compatibility check enabled in the mod.json to avoid problems. If you really want to create a compatible mod that does this without compatibility issues (that will not oos), you would need a different approach where the UnitAI behavior stay unmodified but triggers re-issuing a command, for other clients to serialize the same behavior as you want. That's tiny slightly more complicated to do but very feasible. 1 Link to comment Share on other sites More sharing options...
Thalatta Posted 8 hours ago Share Posted 8 hours ago 5 hours ago, Atrik said: It could also be possible to do it depending on animal "stance" for example units would keep hunting any other non-aggressive animals or any animals basically in the same stance that your initial order was. A couple of different possibilities inspired by that, which might need refinement to condense on one useful thing: -Target types: if one queues this with a sheep and a gazelle, the hunter would hunt all sheep and gazelles he has around. This could be also used for chopping all trees, garrisoning certain buildings, and boarding certain ships, as long as they are nearby. In case of troops, maybe it could work as cavalry targeting archers, while pikemen cavalry, and so on. -Action stances: similar as before, but the target doesn't really need to be specified. One could hunt all non-aggressive animals (or also aggressive ones if that was selected) as mentioned, but could also work with things like "repair all", "board all", etc, as long as they are nearby. 1 Link to comment Share on other sites More sharing options...
Atrik Posted 4 hours ago Share Posted 4 hours ago 11 hours ago, Thalatta said: Something I thought could be useful would be an "Target in Area" button, where after pressing it one would adjust the area of a target circle, and all attackable (Gaia and enemy for example) units inside it would be queued to be attacked. This would be useful for hunts and fights, not having to precisely pinpoint some target. It would also avoid a weird issue I usually have, which is that after the target unit is killed, the attackers retreat to their previous position instead of keep killing enemies they have just beside them, although maybe this is related to their stance. You post so many ideas that I'm getting the reflex to skip your posts, just so you know you might want to be more concise. What you are describing here will be implemented next release : https://gitea.wildfiregames.com/0ad/0ad/pulls/8525 Link to comment Share on other sites More sharing options...
Thalatta Posted 2 hours ago Share Posted 2 hours ago 1 hour ago, Atrik said: You post so many ideas that I'm getting the reflex to skip your posts, just so you know you might want to be more concise. What you are describing here will be implemented next release : https://gitea.wildfiregames.com/0ad/0ad/pulls/8525 When I'm concise, I'm misinterpreted, so I have to end writing more… The last couple of ideas were just alternatives for if people prefer them. Personally, I think I prefer the Target Area idea, which is what is described in your link, but only for fighting. My proposal generalises that idea to resource gathering (including hunting), garrisoning, boarding, and even repair, along whatever I can't think of right now. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now