Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
enable ground units to move in reverse (requires defining a non-zero …
…maxReverseVelocity in a unit's definition file)
- Loading branch information
a5adf2f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i'm very afraid... i'd like to see what i've posted on the forums - that is, a CMD_MOVE_REVERSE. i see that it wouldn't be hard to do - just tell the movetype that next path should be taken entirely in reverse by forcing wantReverse appropriately. this also needs a toggle so that autoreversing can be disabled (as i said, i've been playing some dow2 and sometimes vehicle decisions are horrifying. your implementation compares ETAs so it's not going to be as bad by default... will test it.)
a5adf2f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i must admit that after a 30 min testing session my worries are mostly gone, it works much better than in dow2, probably because it doesn't try to make j-turns. the current ETAs don't work well in low acceleration, high turnrate scenarios, where you're better off just doing a 180 rather than braking and reversing at full speed, but this can be fixed, i guess - compare the 180 time with braking and accelerating to full speed and all will be fine.
i also noticed something odd with spawning track marks/decals when reversing, they spawn a bit in front of the unit (was testing BA flash), this might need some adjusting.
a5adf2f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried it on a tank in Spring: 1944 and it works epically good, very good job :-)
a5adf2f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, one thing I noticed in the code, but shouldn't it use the wanted max speed, instead of the UnitDef max speed, for the case where for example a fast unit with slow reverse and a slow unit are moved backwards in formation?
In this case possibly the fast unit can remain in reverse for much longer distance because it has to keep pace with the slow unit anyway.
(ie. the ctrl+click formation move/fight thing, which uses CMD_SET_WANTED_MAX_SPEED)
a5adf2f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe like this?
a5adf2f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May need to watch out for 0 wantedSpeed though.
a5adf2f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pushed something that i feel works better for me. it may be a bit overcomplicated, but only a little ^_^
a5adf2f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ouch.
btw a related idea: there's a need for a CMD_TURN_TOWARDS command now, since games like s44 with directional damage will need it. (charging a sherman backwards at a tiger? hell yeah!)