Absolute control over units
Moderators: hoijui, Moderators
-
- Posts: 51
- Joined: 14 Aug 2008, 21:54
Absolute control over units
Question (I know I have a lot).....I intend to have a pretty tight reign on my units (right down to tracking which direction they are facing) and using minuscule movements to facilitate in-place rotations.
If another unit comes around (enemy or ally) and attempts to move 'through' the space of my unit, the internal engine AI won't take over and 'move' my unit out of the way, will it?
That would suck.
(It's not in any way based on the 'move state' is it?)
If another unit comes around (enemy or ally) and attempts to move 'through' the space of my unit, the internal engine AI won't take over and 'move' my unit out of the way, will it?
That would suck.
(It's not in any way based on the 'move state' is it?)
Re: Absolute control over units
Yes, it will for allied units, regardless of the move state.
-
- Posts: 51
- Joined: 14 Aug 2008, 21:54
Re: Absolute control over units
Hmmm...means I have to constantly check the position of my units to see if it has changed outside of my control?
That kinda stinks. I guess I better not support allies playing with my ai-bot. :)
I wish that the movement command of the unit that tried to move 'through' my unit would simply fail or time out.
*grumble*
That kinda stinks. I guess I better not support allies playing with my ai-bot. :)
I wish that the movement command of the unit that tried to move 'through' my unit would simply fail or time out.
*grumble*
- thesleepless
- Posts: 417
- Joined: 24 Oct 2007, 04:49
Re: Absolute control over units
maybe if there was a way to manually respond to a BuggerOff command, you can either do your own action and return true, or just return false to get default behaviour?
Re: Absolute control over units
hmmm I remember making a big deal over sub AI and being able to turn it off and was totally dismissed because no AI currently needed that level of control....
Re: Absolute control over units
Aren't Command AIs in the synced part of Spring code?
That means disabling them will cause desync in multiplayer games.
Imho units that are set to "Hold position" shouldn't move, no matter what, even if they block the only way to the other part of the map.
That means disabling them will cause desync in multiplayer games.
Imho units that are set to "Hold position" shouldn't move, no matter what, even if they block the only way to the other part of the map.
Re: Absolute control over units
I see one problem there, and that is the new 'reverse' moving code (that was added in 0.80). AFAIK currently only S44 uses it (I'm very probably wrong considering I don't play any other Spring mod/game). That is, on very short move distances you can never be sure if the unit will turn and move with its front towards the goal OR it will reverse and backpedal there (resulting in exactly opposite facing to the one you expect), unless you recreate the same logic in your AI so it can predict which way the unit will take.casperjeff wrote:I intend to have a pretty tight reign on my units (right down to tracking which direction they are facing) and using minuscule movements to facilitate in-place rotations.
This only matters if the game in question makes use of the feature (S44 does and BA doesn't as far as I know for ex.), but I'd expect more and more games to start using features like that.
Re: Absolute control over units
Not understanding your AI I could be talking shit but... don't you think locking the exact position and facing of every unit is kinda overkill? Aren't you likely to stress the CPU by trying to do things the engine is optimised to do better?
Anyway, on a practical note you may have some luck polling your units every 5 seconds or so and giving them a temporary move+rotate if they've strayed from your expected position. This allows the engine to do what it needs to do to allow units to move through blockages.
The only practical use of absolute control I can think of is the case where you want units to line up exactly along the perimeter of an enemy turrets range, without units at the back pushing them into range. Whether that happens enough to affect the outcome of the game is a bit questionable.
Maybe your case would be stronger if you provided an example of why such accurate unit placement is worth the time it would take to develop.
Anyway, on a practical note you may have some luck polling your units every 5 seconds or so and giving them a temporary move+rotate if they've strayed from your expected position. This allows the engine to do what it needs to do to allow units to move through blockages.
The only practical use of absolute control I can think of is the case where you want units to line up exactly along the perimeter of an enemy turrets range, without units at the back pushing them into range. Whether that happens enough to affect the outcome of the game is a bit questionable.
Maybe your case would be stronger if you provided an example of why such accurate unit placement is worth the time it would take to develop.
-
- Posts: 51
- Joined: 14 Aug 2008, 21:54
Re: Absolute control over units
Probably. But....as an ex military guy (mechanized), I really want my 'squad' units to do the right thing when they stop movement...like forming up in a herringbone or a coil (crucial for proper security). Same thing with the concept of funneling the enemy and having units waiting in 'ambush'. Now in spring (more specifically BA or 1944), that is probably more an aesthetic issue than a strategic one as the LOS for each unit is probably 360 (unrelated to which way the unit is facing). The only real reason is speed to bring weapon to bear if they are limited in rotation angles.don't you think locking the exact position and facing of every unit is kinda overkill?
To your point, it's probably not that big of a deal in the overall scheme of things....just wanted to know how the engine worked and what I had to account for.
I will probably end up doing something like this. The combination programmer/general in me just has a mental issue with telling a unit to do something or be somewhere and them NOT doing/being where I expected. :)you may have some luck polling your units every 5 seconds or so and giving them a temporary move+rotate if they've strayed from your expected position. This allows the engine to do what it needs to do to allow units to move through blockages.
Re: Absolute control over units
LoS is always circular in Spring, I don't know of any 'conventional' mods (so excluding things like Fibre) implementing custom LoS modes.
Factors other than LoS that depend on unit facing: restricted-arc weapons, directional armor (there is a system for that built into the engine even, plus some games have their own implementations), time needed to start moving in that direction. First two are important enough to use when they matter, but they don't matter all that much in *A mods. Last one matters in most any game/mod.
Factors other than LoS that depend on unit facing: restricted-arc weapons, directional armor (there is a system for that built into the engine even, plus some games have their own implementations), time needed to start moving in that direction. First two are important enough to use when they matter, but they don't matter all that much in *A mods. Last one matters in most any game/mod.
-
- Posts: 51
- Joined: 14 Aug 2008, 21:54
Re: Absolute control over units
Meaning like the Long Range Plasma Cannon or like mobile artillery units?Factors other than LoS that depend on unit facing: restricted-arc weapons
Not sure if you meant up and down arc or left-right arc.
Re: Absolute control over units
Spring weapons are in fact restricted to cones (WeaponMainDir and MaxAngleDif), so usually horizontal and vertical restrictions will be the same (not always, the cone can be directed at any angle incl. not parallel to the ground). Examples are all the turretless units in S44. I don't quite remember if BA mobile arty units have similar restrictions or not, LRPC's are 360 degree fire arc IIRC.
-
- Posts: 51
- Joined: 14 Aug 2008, 21:54
Re: Absolute control over units
If another unit comes around (enemy or ally) and attempts to move 'through' the space of my unit, the internal engine AI won't take over and 'move' my unit out of the way, will it
This has effected my ability to create neat formations in that sometimes one unit will cross the path of others en route to his place in the formation and will move them out of position.Yes, it will for allied units, regardless of the move state.
Do I get any kind of event notification on these engine based moves? (either when started or completed or anything?)
Re: Absolute control over units
Nope; at best you will get a UnitIdle event when the unit stops moving again. Spring may be an RTS engine, but you won't find any military discipline inside of it.
Re: Absolute control over units
casperjeff, i dont know.. i dont think that the stuff you want to do fits into an AI. it is more stuff for making a show, animation wiht spring, and would probably be better done with a Lua AI or genreal gadget, as you can have more fine controll there. I can not imagine you gonna get good performance with your AI, both CPU and game achievement wise. eg.. using many move commands just ot keep units in place .. is bound to be slow, if not in general, then at least when playing online with it. formations on the battlefield are not gonna work out (thinking on the regular army musqueteers in the patriot movie).
what is your goal in general?
what is your goal in general?
-
- Posts: 51
- Joined: 14 Aug 2008, 21:54
Re: Absolute control over units
My goal is to have disciplined units that follow orders of their commanders. My AI is based upon the chain of command concept (hence the COCAI name) including a robust implementation of a military TO&E and overall strategic plans managed by an S3 that can actually plan attacks, defenses and react to changing battlefield conditions.what is your goal in general?
Please note that I am not 'unhappy' with what is provided to the AI layer by the Spring engine...just want to make sure I understand all the capabilities that I have so I can steer around the potholes.
What I'll probably do is treat this not unlike any situation where a unit is 'forced' to do something outside the orders given to them from upline because of changing battlefield conditions. As long as this info passes upline, the commander can adjust. If a unit is out of position, the commander can just issue an order to bring him in line again.