Idiotic spring attack behavior

Idiotic spring attack behavior

Discuss game development here, from a distinct game project to an accessible third-party mutator, down to the interaction and design of individual units if you like.

Moderator: Moderators

User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Idiotic spring attack behavior

Post by Forboding Angel »

Did anyone ever fix the stupid attack behavior changes via a gadget?

Like units attacking anything en route to their target even if they have a manual attack order?

This stupid behavior was introduced in spring 92, where it was terribad, then got less idiotic, but still super bad in 94.1.

Edit:
^^ this is horseshit, I mixed and matched bugs/behaviors ^^
My apologies
Last edited by Forboding Angel on 16 Nov 2013, 05:08, edited 1 time in total.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Idiotic spring attack behavior

Post by smoth »

Maybe make a video like this one showing before and after?

http://www.youtube.com/watch?v=UHIpB1w95xU

it would help to cleanly illustrate the differences.
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: Idiotic spring attack behavior

Post by Forboding Angel »

The difference is that pre-92, if you gave a unit a manual attack order, it would go and ONLY attack whatever you manually targeted.

Post-92, you give a manual attack order and the unit will attack anything along it's path meaning that half the time when it reaches it's manual attack target, it is reloading.

The only way to semi unfuck this behavior, is to set the default firestate on certain units to hold fire. Which totally renders the fight command worthless.

I don't know which person decided that attack and fight should be merged, but it was a really bad idea.

THAT'S WHY WE HAVE A FIGHT COMMAND IN THE FIRST DAMN PLACE!
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: Idiotic spring attack behavior

Post by knorke »

pre-92, if you gave a unit a manual attack order, it would go and ONLY attack whatever you manually targeted.
just tested with 91 and XTA arm_peewee shot at near enemies while on way to its given target.
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: Idiotic spring attack behavior

Post by Forboding Angel »

When given a manual attack order (such as a-clicking on the ground)?

Cause if so, that's a bug. It should only do that if it has a fight command or is on a move order.

Perhaps it was introduced in spring 91 instead of 92. I can find out by going through evo commit logs.

Edit:
October of 2012

Though the unit in question, I had previously been using commandfire on (then that got changed), so perhaps unit behavior never actually acted correctly to begin with but was simply more manageable.
Last edited by Forboding Angel on 16 Nov 2013, 04:31, edited 1 time in total.
User avatar
Jools
XTA Developer
Posts: 2816
Joined: 23 Feb 2009, 16:29

Re: Idiotic spring attack behavior

Post by Jools »

I confirm this, it happens when you put some wombat to attack a target, target goes hiding behind a bush => they shoot other target within range. It destroys some surprise attacks.
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: Idiotic spring attack behavior

Post by Forboding Angel »

Is this something lua should control, or something that the engine should control?

It would be interesting to see attack, fight, patrol, etc behavior all put into luaz so that you could change how you wanted it to act on a per-project basis.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Idiotic spring attack behavior

Post by smoth »

Forboding Angel wrote:When given a manual attack order (such as a-clicking on the ground)?

Cause if so, that's a bug. It should only do that if it has a fight command or is on a move order.
attack order, move order etc yeah it would fire at the enemy otherwise, you would give it a HOLDFIRE ORDER to make sure you had the desired behavior
Forboding Angel wrote: Though the unit in question, I had previously been using commandfire on (then that got changed), so perhaps unit behavior never actually acted correctly to begin with but was simply more manageable.
Probably.. what happened with command fire?
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: Idiotic spring attack behavior

Post by Forboding Angel »

You clearly do not understand how this is supposed to work.

Attack commands are just that. They tell the unit, to and attack this unit or this location. Once the unit destroys the manually targeted unit, it would default to normal behavior, because that attack is then cleared.

If the attack command was given on a map location, the unit would then attack that spot indefinitely until told to do something else or stop.


Fight commands would work the same way they do now, which is, move to this location, and attack any and all enemies along your path.

Move would work the same way it does now. Move to this location, feel free to shoot at any enemy that gets in range.

At the moment, the attack command is some sort of weird ass melding of fight and move, and it sucks. Hold fire is not a good alternative.
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: Idiotic spring attack behavior

Post by knorke »

Oldest spring I had installed is 0.82.7.1, it is the same there.

If unit has manual target (a-attack on ground or just rightclick on unit) it will move towards target and once in range, shot at it.
If along its travel there are other units in range, it will shot them while passing by. It does not stop or chase after them though, which is the different to fight command.
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: Idiotic spring attack behavior

Post by Forboding Angel »

So it works like a move command with an attack order at the end. Fail.

Edit: In cast no one noticed, I had gotten the fail attacking ground thing that we went through with spring 92 mixed up with other stuff in my OP. My bad.
User avatar
CarRepairer
Cursed Zero-K Developer
Posts: 3359
Joined: 07 Nov 2007, 21:48

Re: Idiotic spring attack behavior

Post by CarRepairer »

knorke wrote:Oldest spring I had installed is 0.82.7.1, it is the same there.

If unit has manual target (a-attack on ground or just rightclick on unit) it will move towards target and once in range, shot at it.
If along its travel there are other units in range, it will shot them while passing by. It does not stop or chase after them though, which is the different to fight command.
What knorke describes is how I've always known spring to behave.
User avatar
Jools
XTA Developer
Posts: 2816
Joined: 23 Feb 2009, 16:29

Re: Idiotic spring attack behavior

Post by Jools »

In general there are many things like these that are not consistent. Would be nice to hire some mechanic turks to clean this stuff up.

There are tons of widgets that try to fix issues like these: hold fire fix (stops attack order on hold fire), make unit hold fire on cloak, etc...
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: Idiotic spring attack behavior

Post by Forboding Angel »

Jools wrote:Would be nice to hire some mechanic turks to clean this stuff up.
I resorted to doing that with evo, in the literal sense.

@car, read my edit (might have ended up being a ninja edit as you were prolly typing when I was editing)
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: Idiotic spring attack behavior

Post by knorke »

Ah.
Image
I want to solve:
How to make units with fight-command use fire-at-will but otherwise use hold-fire?
Next category wupgets for $400
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: Idiotic spring attack behavior

Post by Forboding Angel »

What? That isn't what I want at all...

I stated very clearly how the commands should work. I'll quote it:
Attack commands are just that. They should tell the unit, to and attack this unit or this location. Once the unit destroys the manually targeted unit, it would default to normal behavior, because that attack is then cleared.

If the attack command was given on a map location, the unit would then attack that spot indefinitely until told to do something else or stop.

Fight commands should work the same way they do now, which is, move to this location, and attack any and all enemies along your path.

Move commands should work the same way it does now. Move to this location, feel free to shoot at any enemy that gets in range.

At the moment, the attack command is some sort of weird melding of fight and move, and it sucks. Hold fire + attack is not a good alternative, for obvious reasons, such as, giving a unit a manual attack order, and it fires en route, and is reloading when it gets in range of the original target. That is one very small example, but it's a big deal.
Let me say again that my first post was premised upon total horseshit. I got a few things mixed up (mixed buggy behavior with normal behavior and proceeded to screw the pooch), so some of my replies will raise a few wtfs. Sorry about that.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Idiotic spring attack behavior

Post by smoth »

Forb wants:
An attack command that would lock weapons until the target is reached. At which point it would attack the target as regular. If the target dies/gets away/whatever it goes back to normal.

an attack command where the unit is on hold fire is undesirable because the unit attacking will NOT return to what it had on before.

altering the firestate is not really desirable.

So is it possible to make a custom attack command which sets the unit to holdfire(internally) until the target is lost/dead?
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: Idiotic spring attack behavior

Post by knorke »

an attack command where the unit is on hold fire is undesirable because the unit attacking will NOT return to what it had on before.
what does this mean?

Unit is given attack-command = it gets set to hold fire.
Unit is given move or fight command = it gets set to fire at will.

Code: Select all

function widget:UnitCommand(unitID, unitDefID, unitTeam, cmdID, cmdOpts, cmdParams, cmdTag)
	if (cmdID == CMD.ATTACK) then
		Spring.GiveOrderToUnit(unitID, CMD.FIRE_STATE, {0}, {})
	end
		if (cmdID == CMD.FIGHT) then
		Spring.GiveOrderToUnit(unitID, CMD.FIRE_STATE, {2}, {})
	end
		if (cmdID == CMD.MOVE) then
		Spring.GiveOrderToUnit(unitID, CMD.FIRE_STATE, {2}, {})
	end
end
Works but needs yadayada:
-Should reset to previous state instead of just move=fire-at-will etc.
-When up queuing commands it should set firestate according to currently active one, not to last queued one.
-When target of manually attack-command is destroyed (or lost LOS) should reset to previous firestate.
-...
Google_Frog
Moderator
Posts: 2464
Joined: 12 Oct 2007, 09:24

Re: Idiotic spring attack behavior

Post by Google_Frog »

I don't get it. The attack command has always been this way. For most units in most games there is no cost to them shooting extra units when they are unable to shoot at the unit that you told them to shoot at. So they try to get in range of the target unit but while doing so their weapon works freely.

Forb, your suggested behaviour would be annoying in many cases. If you want your units to attack something but attack things en route you would have to give a move command and then an attack command. Fight does not work because fight causes them to stop and fire at things while move does not interrupt movement.

The answer to your problem is Lua It. It is very easy to lua the behaviour which you want, simply give a hold-fire and unsettarget command when an attack command is issued.

The engine should have the current default behaviour because it would be very hard to lua this behaviour with your behaviour as a starting point. The Attack command would be almost useless, you'd have to insert a move command then an attack command and continually check ranges/occlusion in lua to make sure that the unit can fire at other things for as long as possible. The other way would involve rewriting the target acquisition logic entirely in lua.

So we have asymmetry in the ease of luaing various behaviours. In this case the engine should implement the behaviour from which it is easiest to lua other behaviours. It already does this.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Idiotic spring attack behavior

Post by smoth »

how do you know when the unit has destroyed/lost it's target, that is the part of the yadayada I don't know.
Post Reply

Return to “Game Development”