Units do not turn to fire their Arc-ed weapons
Moderator: Moderators
Units do not turn to fire their Arc-ed weapons
This thread doesn't seem to be getting any attention in general discussion, so here's a link. Devs please consider...
http://taspring.clan-sy.com/phpbb/viewtopic.php?t=5037
http://taspring.clan-sy.com/phpbb/viewtopic.php?t=5037
Again, I think this needs to be put to AF or Krogothe, not to to the Spring core developers. I really feel we need to convince them to make the core AI subroutines of Spring much more robust and flexible, period, with more controllable sub-behaviors available via TDF tags. It'd make AI development easier, too, if AI developers didn't have to code battle micromanagement into their software, because Spring's own battle micromanagement was adequate.
That, and I'm hoping AF will get to his pathfinding routines he's been talking about for awhile now soon
That, and I'm hoping AF will get to his pathfinding routines he's been talking about for awhile now soon

I'd be wary of including too much AI in the units, we don't want this to become MOO3 or Populous, where your units decide their actions in their own inscrutable ways. I just want the obvious functionality to work (Yes, I know your weapon is point blank, but could you be so kind as to attack the peewee that's shooting my fusion reactor that's 4 feet from you?)Argh wrote:Again, I think this needs to be put to AF or Krogothe, not to to the Spring core developers. I really feel we need to convince them to make the core AI subroutines of Spring much more robust and flexible, period, with more controllable sub-behaviors available via TDF tags. It'd make AI development easier, too, if AI developers didn't have to code battle micromanagement into their software, because Spring's own battle micromanagement was adequate.
That, and I'm hoping AF will get to his pathfinding routines he's been talking about for awhile now soon
I'm looking into fixing this. Three options however.
1. The unit turns so that forward is facing the enemy
2. The unit turns so that weapon[0]'s firing arc includes the enemy
3. The unit turns so that weapon[0]'s firing arc is centered on the enemy.
Which is best?
This also assumes that weapon[0] is the primary weapon. I can't think of a better way to determine the primary weapon.
1. The unit turns so that forward is facing the enemy
2. The unit turns so that weapon[0]'s firing arc includes the enemy
3. The unit turns so that weapon[0]'s firing arc is centered on the enemy.
Which is best?
This also assumes that weapon[0] is the primary weapon. I can't think of a better way to determine the primary weapon.
-
- Posts: 578
- Joined: 19 Aug 2004, 17:38
What about units that have no clear "primary" weapon? Like some support ships in Homeworld, they have only point defences. I'd suggest something like an "attackDirection" tag, telling which way the unit should attempt to face when attacking. Defaults to "0 0 1", forward. For the Broadside cruiser of the FF mod, it would be "1 0 0" or "-1 0 0". For bombers it could be an approximation, something like "0 -1 1", forward/down, or just forward.
I'm modifying class CGroundMoveType:public CMoveType, so that KeepPointingTo() actually does something. The other two possibilities are CAirMoveType, which also uses an empty KeepPointingTo(), and CTAirMoveType, which implements KeepPointingTo(). I do not know which units use which class.
Also, as I was looking at the code, another thought came up. Currently a unit will stop as soon as any of it's weapons can hit a target. Should this be changed so that it stops once it's primary weapon is in range, but not necessarily able to hit the target, and then rotate?
If one change is made and not the other, I can see a situation in which a unit with a long range frontal secondary weapon and a shorter ranged side facing primary weapon will "wiggle." Once in range of its secondary, it rotates its primary in and secondary weapon away, then decides it needs to move closer to the target because the secondary is out of arc and the primary doesn't have the range. Moving closer would cause the secondary weapon to be in range again, however, causing it to stop and try to rotate for its primary.
Also, as I was looking at the code, another thought came up. Currently a unit will stop as soon as any of it's weapons can hit a target. Should this be changed so that it stops once it's primary weapon is in range, but not necessarily able to hit the target, and then rotate?
If one change is made and not the other, I can see a situation in which a unit with a long range frontal secondary weapon and a shorter ranged side facing primary weapon will "wiggle." Once in range of its secondary, it rotates its primary in and secondary weapon away, then decides it needs to move closer to the target because the secondary is out of arc and the primary doesn't have the range. Moving closer would cause the secondary weapon to be in range again, however, causing it to stop and try to rotate for its primary.
-
- Posts: 578
- Joined: 19 Aug 2004, 17:38
Ideally, a unit set to "roam" should never stop when attacking, and a unit set to "manuever" should stop as soon as it is no longer being hit by enemy weapons. A unit set to "hold position" should stop once the target is in the range of at least half of its weapons, but ideally, there should be a tag defining preferred attack distance for the unit. And if not present, that tag should default to "longest range for 1- and 2-weapon, second longest for multi-weapon units". That presumes that a tank with a secondary gun shouldn't close in, but fire its main gun, yet a bigger unit might want to close in so more of its weapons can hit the target.
- Felix the Cat
- Posts: 2383
- Joined: 15 Jun 2005, 17:30
A turretless flamethrower vehicle (arced to the front) with a machinegun mounted facing sideways, so that the two arcs intercept? Only thing I can think of at the moment.
edit. What would be really really REALLY neat is if a mod maker could implement his own unit AI routine in a DLL that Spring would use instead of the standard one. Correct me if I'm wrong, but for modders who have a working knowledge of C++, this would be a far superior way of generating unit behavior than scripting? Of course animations etc. would probably still be better off done via script.
edit. What would be really really REALLY neat is if a mod maker could implement his own unit AI routine in a DLL that Spring would use instead of the standard one. Correct me if I'm wrong, but for modders who have a working knowledge of C++, this would be a far superior way of generating unit behavior than scripting? Of course animations etc. would probably still be better off done via script.
- Felix the Cat
- Posts: 2383
- Joined: 15 Jun 2005, 17:30
- Felix the Cat
- Posts: 2383
- Joined: 15 Jun 2005, 17:30
Well then I guess I didn't communicate well enough.ILMTitan wrote:GroupAI's iirc can only give commands, much like a human, and thus are able to manipulate the core unit behavior, but not override it completely.
I want modders to be able to override the core unit behavior. edit. with full, unrestricted access to every piece of information that the Spring engine can possibly make available to the core unit behavior DLL.