#Pawns have some weird delay when choosing their target

1 messages · Page 1 of 1 (latest)

vague rain
#

Grunt and blitz choose target the moment it's in range, then start shootign after small delay. Pawn chooses it when it's already way inside the range and then have additional delay before shooting.
Imo there is something wrong with pawns

paper spade
#

Pawns appear to just be buggy with targeting

#

here's a little clip from a game of mine where a pawn just didn't attack a unit in range for like 3 solid seconds. stuff like this is relatively common

#

Who do we need to ping to get this looked at?

#

@merry bison idk who to ping about this but you seem like you might be able to at least delegate to someone who does know

merry bison
#

i think i see what may be wrong

#

tho i doubt that's it

#

there are three main diffrences:

  • pawn has a weapons ready animation,

this could maybe add a few frames of delay

  • pawn has a sleep for 32ms instead of 1ms, this shouldn't matter

should have no effect, both should be 1 sim frame

  • pawn returns if it is ready to fire on the aim instead of always true

i couldn't sleep last night so i don't have the energy to follow but this might be occasiaonally returning false instead?
nevermind, i can't figure it out

merry bison
#

dear @toxic spruce
i feel like this might be inline with some of the fixes and things you've done in animations in the psat
regrads,
feel free to delegate to someone else

toxic spruce
#

The second case is just because the blitz was running away and the pawn has plasma projectiles that take time to hit the target, so if it would fire sooner the plasma would just land behind the blitz.

#

Looking at the pawn script it looks.. complicated

#

The reason for the pawn picking the target slower seems to be the fact that it needs to set its arms from the running position to the firing position before it can start aiming

merry bison
#
  • marks its signal
  • stops arm waving from walking
  • checks if arms are up

i suspect this can cause an unwanted delay since setting weaponReady is deligated to a new thread

  • kill any other aim scripts

this should be fine, another reaim shouldn't happen till the arms check thread runs

  • complex function for smoothed aiming instead of flat rotation
  • restore after delay should run after this finishes
  • returns weaponReady

which may return before weapon ready runs forcing in at least 1 reaim to run before it can fire

toxic spruce
#

What would happen if we delete the waitforturns in drawweapon?

#

Since I think those cause the delay

merry bison
#

i assume spawned threads run after the function that spawned them, so that would still force it to wait for the next aim run

toxic spruce
#

Switch from startscript to callscript?

#

Iirc that one makes the current script wait until that one is done

#

Otherwise increasing their preaim range should also help

paper spade
gloomy grove
#

Could this be solved by giving them pre-aim? Isn't that already enabled by default?

merry bison