avaraline / Avara

Port of the original 1996 game from Ambrosia Software.
MIT License
122 stars 19 forks source link

deploy scout when a player incarnates #422

Open assertivist opened 2 months ago

assertivist commented 2 months ago

Many (but not all) multiplayer levels are set up so that the incarnators are high in the air, and the player falls down to the starting point. I think that part of this informal tradition has to do with reacting to spawning players, but it also has the side effect of allowing players to press the Look Forward + Scout Control buttons (henceforth referred to as the default "2") at a very high point in the level, which sets the scout target to be high in the air, and provides a bird's eye view of the player.

Rather than teach new players to "Always press 2 when the game starts" this patch deploys the scout on frame one by default. The target location for the scout will be at its earliest possible point, calculated from the player's position when the incarnation sound plays, regardless if "2" is pressed. This only triggers if the scout is not already deployed (IE not under other orders, like follow behind).

tra commented 2 months ago

Are there levels you wouldn't want your scout released?

What about spectators? I think this might release a scout for each spectator too so maybe want to add a check for that.

assertivist commented 2 months ago

There are levels that automatically try to destroy scouts, but this should actually make it easier for that to happen.

I tested it with single player levels, most of them have floor level incarnators, but the scout target is above the hector instead of exactly where it is, so it seems OK.

Missed the bit about spectators/inactive folks though, added a check for kzAvailable that should take care of it.

I had to adjust the Max Z value of the missile test because the path changed from the scout coming out on frame one. Also, the grenade test was adjusted to account for the scout's presence.