Map Lifecycle - Subject9x/battleMETAL GitHub Wiki
A little off the beaten path.
Quake's original map lifecyle is fairly simple.
- The game loads up a
.bspmap file. - client connects to game.
- the player spawns in at the
info_player_startentity. - they play through the map.
- any number of map-logic entities will call the
intermissionentity or thechangelevelentity.
battleMETAL adds a slight layer above this cycle to account for fun stuff like Objectives.
The new setup
-
game loads up a
.bspmap file. -
client connects to game.
-
CSQC loads
.msnfile after server sends client.factionvalue to that client. -
player spawns in at
info_player_starthowever, they are an 'observer'.- Observers do not collide with anything, cannot be targeted, and have
FL_FLYflag.
- Observers do not collide with anything, cannot be targeted, and have
-
CSQC for the player then brings up the CSQC menu system.
- player state is tracked via
client_state_events()being polled on every CSQC frame. CLIENT_player_stateandCLIENT_player_state_prevare compared to track state-transition events.
- player state is tracked via
-
even while the CSQC menu is active, the Server is running in realtime.
- this is important because it means that anything that spawns on map-start will immediately start doing whatever is they're setup to do.
- in vanilla battleMETAL I got around this by tying most enemies to when the player spawned into a
deploy_pointand used atrigger_onceentity.
-
After the player makes their mech choices, and chooses a
deploy_point, they are then teleported to that point when they click Launch. -
Maps end by triggering any
map_mission_endentity.- if you want normal end-of-mission stuff like the Debrief screen anyway.
-
the
map_mission_endentity has amapfield where you place the filename of the next map you'd like to load after ending the mission and showing the Debrief menu.
make sense?
formal battleMETAL maps need at least 1 map_mission_end entity with a valid map value pointing to another map file.
These maps also need at least 1 map_deploy_point of matching faction to the player so that the player can spawn into the map after selecting their mech.