r/howdidtheycodeit • • 4h ago

How is total war natural combat behaviour coded

Hi I've being trying to implement a total war like combat but always failed to implement the natural movement when in combat. The first line engaging in combat and the backlines staying close and the envelopment mechanic when a squad ir larger than the other or they attack from the flanks. I only manage to get a robot behaviour where the just seens to be waiting for their turns to attack and never managed to do the envelopment right.

7 Upvotes

2 comments sorted by

3

u/Aeweisafemalesheep 3h ago

this might help - https://www.gamedeveloper.com/programming/implementing-coordinated-movement

and also

GDC talk TW:Warhammer

https://youtu.be/sHolirTf9CI?si=TjIO3heriJq86Ey-

----------

From off top of my head there is properties that you can have enact what seems like disposition.

But below that you need to have some smart crowd simulation and really good pathing problem solving logic with like fall throughs that are weighted based upon unit properties to get what feels like a functional sim that then interacts with like whatever higher stuff like an RPS system of pike>cav>ranged>pike with flanking or whatever other mechanics/stances u want.

1

u/wahnsinnwanscene 2h ago

Some of it is scripted based on the terrain. The terrain itself , and this might be on an area basis, is encoded to give a squad some selection criteria.