RTS Unit Organization Formation System

Started by
3 comments, last by AoS 11 years, 8 months ago
I am currently writing the code for the formation system in my RTS game. It utilizes the standard movement command to move all the units in a squad, or higher order unit grouping, to a specific offset from the leader. I have a few questions about preferences and implementation.
Currently in my idea you can define premade formations for a given leader unit type in XML. You assign the offets and name the formation and the unit type will have a button to organize your forces that way. I will ask some questions first and then some problems I have foreseen.
What is the best way to determine position? I could merely allow you to assign a series of offsets. The problem here is how to choose what unit goes where. Ideally ranged and support units would need to go towards the back. If you have one set of offsets and one button the player would have to add units in the proper order if you tried to specify special offsets for support.
My second plan was to assign special offset vectors for each unit class. So you would have one for melee and one for range. You could further subdivide, optionally of course, and have a first row, second row, and third row of melee, and then a row for archers and one for healers and mages or other support units.
I know that Kohan had some formation work, but it was quite hard coded. You always had the same formation layout and it never really went above the first level.
Now I really wanted the system to be customizable. There is no hard limit on the number of units in a squad, or the squads in a century and so forth for cohorts, legions, and finally hosts. So I have to figure out how to deal with people who put more than 10 units in a squad for instance. Most default formations will allow for the leader and 9 other units.
There are free form formations, basically a vector with up to a leader and 100 units in a squad, a leader plus 25 squads in the century and so forth. Basically the idea is that you have enough space in a group to go all the way up to the next level. After you get to 100 units in a squad you are at the level of a century. And when you have 25 squads in century you are up to a cohort so why keep overloading a century? And so forth down the line. At the host level its not really a vector of hosts so you have no cap. So you are pretty much free to organize your armies how you like.
But how do I get default formations to deal with overloaded squads? I guess you could have an overflow like if all your melee rows are full start stacking units on the outside of the first rows. Or stick them in a new automatic row in front of previous front rows.
The problem with the free form system is you have to assign the positions in game. Essentially put all units in there spot and then hit a button. And of course your unit can only remember a few specialty formations, well not technically but just the amount of time to set it up especially for larger selections of units.

So does anyone have opinions on the best way to set up the non-free form formations? Or any thoughts in general about units moving in formations? This thread is mostly about implementing formations, I will have probably have another one discussing the strategical and tactical implementations.
Advertisement
Tricky, tricky, tricky...

It WOULD be nice if the game sorts out the units per row stuff for you, setting up your army in a specific order seems prone to user errors. Also, what should happen when half of the melee fighter died? Should the formation be held with one side missing, or should it be reformed?

If you want the game to sort it, you have to find an other way to specify formations. Maybe you can order them more losely by quantities (The quantity of melee figher is always in front. After that a quantity of spear fighters and then a quantity of archers). And then you can put quantities in quantities, that cause the outside group to surround the inside group.
Project: Project
Setting fire to these damn cows one entry at a time!

Tricky, tricky, tricky...

It WOULD be nice if the game sorts out the units per row stuff for you, setting up your army in a specific order seems prone to user errors. Also, what should happen when half of the melee fighter died? Should the formation be held with one side missing, or should it be reformed?

If you want the game to sort it, you have to find an other way to specify formations. Maybe you can order them more losely by quantities (The quantity of melee figher is always in front. After that a quantity of spear fighters and then a quantity of archers). And then you can put quantities in quantities, that cause the outside group to surround the inside group.


Yeah, while I was waiting for responses I went ahead with the system where you indicate a specific area, like front line, ranged, and support and the unit fills in. I think it may be the best choice. Formations are actually used a bit by wargame designers and some I talked to said it was probably the best way. I would say that if you lost a unit it would decrease its squad's effectiveness. But probably a melee unit from another row would try to fill in.
Leader specific formations? In ancient times flags were used to signal the general of readiness and to confirm commands. These leaders knew the formations they were expected to use before combat because they knew who they lead these were ancient tactics.

The player assigns X number of units to that leader then creates/assigns formations to that leader. This means the player knows which leaders to use for which tactics.

oh missed the last post, nm

Leader specific formations? In ancient times flags were used to signal the general of readiness and to confirm commands. These leaders knew the formations they were expected to use before combat because they knew who they lead these were ancient tactics.

The player assigns X number of units to that leader then creates/assigns formations to that leader. This means the player knows which leaders to use for which tactics.

oh missed the last post, nm


Well you can still do that with the free form formations. The previous post was about the pre designed formations.

I really wanted people to have a lot of choice about how they played. So you can stick with the default formations but if you have the time off from other stuff you can do all your own formations and it should even be pretty quick.

This topic is closed to new replies.

Advertisement