hand

Spawn Order


On Duke3D, respawns spots are random (except in COOP), but the first spawns spots are not! They follow a specific order, and that order is an integral part of the map's balance. Just think about the most famous map for 1v1 of all time: Hollywood Holocaust - the balance of it wouldn't be the same if P2 spawned in some other place other than the bathroom... Because of that, P2 ends up having the Medkit and Steroids advantage, since P1 has to spend his Steroids in order to secure his Jetpack, while P2 can take his own without having to spend his Steroids. As you should know, P1's spawn point will be on the "arrow", with the other player's spawn points being APLAYER sprites (DM -> lotag = 0, COOP -> lotag = 1)... But how does the spawn order is defined by the game? Well, the higher the ID of the APLAYER sprite, then sooner it will be picked. Meaning the last APLAYER sprite to be put on the map will be the first one to be used. This means that if you want to be specific with the first spawn order, you have to put all the APLAYER sprites on reverse order, or you'll have to switch them around later. Now, it should be obvious that when doing CTF maps or FORTS maps each team will have their own base, and assuming the bases are equal, the spawn order should also be equal. That means that it's not enough for the APLAYER sprites positions to be symmetrical, actually both sides of the map should have equal spawning orders as well, so the first spawn follows the same order. Not only that, but if the Netflag
[TEAMS] Mixed Team Spawn Points
is being used, then the spawning order must be interleaved (e.g. P1 Blue, P1 Red, P2 Blue, P2 Red, etc), otherwise one side may have more starting players than the other. To do all these adjustments by hand would be quite annoying and time consuming, so, to help with that task, we implemented a few routines on the
produke.m32
script to help you with the proccess of ordering the APLAYER sprites.
Assuming you follwed all the steps on the Getting Started, section, the
produke.m32
script is already being included automatically. So, to use the helper routines from it, all you have to do is to open the Mapster32 console (usually via the key `) and then type the command
do ROUTINE_NAME
. Below there's a list of all helper routines available:
Routine name Description
po_get Sets the
extra
of every APLAYER sprite with the current sprite order (starting at 1).
It correctly separates the APLAYER sprites in distinct groups (COOP / DM / Blue-Team / Red-Team / Green-Team / Brown-Team).
po_set Reorders the APLAYER sprites based on their
extra
(first call po_get to fill them for you, do your adjustments, and then run po_set).
When reordering TEAM spawn points, it will apropriatelly interleave across teams, so if playing with
[TEAMS] Mixed Team Spawn Points
, the initial spawn will still be symmetric.
po_clear Clears the
extra
of the APLAYER sprites. Not extremelly needed, but recommended to do before releasing the map publicly.
cam_get Similar to po_get, but for the CAMERA1 sprites, since they follow the same logic (i.e. ID ordered).
cam_set Similar to po_set, but for the CAMERA1 sprites.
cam_clear Similar to po_clear, but for the CAMERA1 sprites.
ang_fix Adjusts the angle of certain effect sprites when the angle have meaning, so when doing a X+Y flip on the whole map the effects will have their behavior preserved.
bump_tags Bumps the non-zero channel tags of every sprite/wall/sector by 5000.
actor_fix Sets actors sprites size & cstat to how they are in game.
It's not the objective now to go over every routine above. What we'll take a look at now are
po_get
and
po_set
. So, as explained above,
po_get
will set the extra of every APLAYER sprite to their current order. If you run
po_get
(by openning the console and typing
do po_get
) on E1L1.map for example, it will set the extra of the APLAYER sprite from the bathroom to 1 (since that's P2's start point), the one on the exit to 2 (since that's P3 start point), and so on... The idea is to get the extra of every APLAYER sprite to a value that you choose (first by calling
po_get
and after that editing each one individually when needed by the
ALT + M
hotkey), and then run
po_set
to reorder them based on the values you choose.