QuakeServer.Physics (quake_server v0.1.0)

Copy Markdown View Source

One physics frame of a level, as FTE's server runs it (sv_phys.c): the program's StartFrame, then every entity by its move type (WPhys_RunEntity), then EndFrame, and the clock moved on by the frame.

server = QuakeServer.Physics.frame(server)

The program's time is the frame's start for everything run in it, and its end for EndFrame. An entity whose customphysics holds a function has that run instead of its move type. A player whose commands the program runs itself (QuakeServer.Physics.Command) is left out: its commands move it. Any other player runs its command (QuakeServer.Player), then PlayerPreThink, its move, and PlayerPostThink. After each entity, the missile it may have spawned (newmis) runs at once, for a twentieth of a second.

Summary

Functions

Bound entity's velocity to the length sv_maxvelocity (WPhys_CheckVelocity).

Run server's entities for one frame of server.frametime seconds and move its clock on.

Run the touches of two entities that have met, from trace.

Mark player entity as running its own commands.

Whether player entity runs its own commands (QuakeServer.Physics.Command), so a frame leaves it out.

Run entity for the frame by its move type (WPhys_RunEntity).

Run the missile the program last spawned (newmis), for a twentieth of a second, and clear newmis.

The height of a step, FTE's movevars.stepheight: the cvar pm_stepheight, or 18 while it is empty.

Run entity's think if it is due before the frame ends, at the time it was due (the frame's start when that has passed), again while it sets a later nextthink still due this frame and the cvar sv_gameplayfix_multiplethinks is on (WPhys_RunThink). Returns {server, still_there?}.

Functions

check_velocity(server, entity)

Bound entity's velocity to the length sv_maxvelocity (WPhys_CheckVelocity).

frame(server)

Run server's entities for one frame of server.frametime seconds and move its clock on.

impact(server, entity, trace)

Run the touches of two entities that have met, from trace.

independent(server, entity)

Mark player entity as running its own commands.

independent?(server, entity)

@spec independent?(QuakeServer.Server.t(), non_neg_integer()) :: boolean()

Whether player entity runs its own commands (QuakeServer.Physics.Command), so a frame leaves it out.

run_entity(server, entity)

Run entity for the frame by its move type (WPhys_RunEntity).

run_newmis(server)

@spec run_newmis(QuakeServer.Server.t()) :: QuakeServer.Server.t()

Run the missile the program last spawned (newmis), for a twentieth of a second, and clear newmis.

step_size(server)

@spec step_size(QuakeServer.Server.t()) :: float()

The height of a step, FTE's movevars.stepheight: the cvar pm_stepheight, or 18 while it is empty.

think(server, entity)

Run entity's think if it is due before the frame ends, at the time it was due (the frame's start when that has passed), again while it sets a later nextthink still due this frame and the cvar sv_gameplayfix_multiplethinks is on (WPhys_RunThink). Returns {server, still_there?}.