1#ifndef SCUBYWASM_AGENT_H
2#define SCUBYWASM_AGENT_H
272init_agent(uint32_t n_agents, uint32_t agent_multiplicity, uint32_t seed);
358void update_score(
struct Context *ctx, uint32_t agent_id, int32_t score);
void free_context(struct Context *ctx)
Destroy an agent context created by init_agent().
void update_score(struct Context *ctx, uint32_t agent_id, int32_t score)
Provide the current score for one agent.
void update_shot(struct Context *ctx, uint32_t agent_id, int32_t lifetime, float x, float y, float heading)
Provide the current state of a shot.
struct Context * init_agent(uint32_t n_agents, uint32_t agent_multiplicity, uint32_t seed)
Create a new per-round agent context.
ConfigParameter
Engine configuration parameters.
Definition scubywasm_agent.h:208
@ CFG_SHIP_HIT_RADIUS
Ship hit radius (in torus-units).
Definition scubywasm_agent.h:231
@ CFG_SHOT_LIFETIME
Shot lifetime / end-of-life (in ticks).
Definition scubywasm_agent.h:246
@ CFG_SHOT_VELOCITY
Shot velocity (in torus-units per tick).
Definition scubywasm_agent.h:239
@ CFG_SHIP_MAX_TURN_RATE
Ship turn rate per tick (in degrees per tick).
Definition scubywasm_agent.h:215
@ CFG_SHIP_MAX_VELOCITY
Ship speed when thrust is enabled (in torus-units per tick).
Definition scubywasm_agent.h:223
ActionFlags
Action bitmask.
Definition scubywasm_agent.h:153
@ ACTION_TURN_LEFT
Turn left for this tick.
Definition scubywasm_agent.h:174
@ ACTION_THRUST
Enable thrust for this tick.
Definition scubywasm_agent.h:165
@ ACTION_TURN_RIGHT
Turn right for this tick.
Definition scubywasm_agent.h:183
@ ACTION_NONE
Do nothing this tick.
Definition scubywasm_agent.h:155
@ ACTION_FIRE
Fire a shot.
Definition scubywasm_agent.h:192
void update_ship(struct Context *ctx, uint32_t agent_id, int32_t hp, float x, float y, float heading)
Provide the current state of a ship.
uint32_t make_action(struct Context *ctx, uint32_t agent_id, uint32_t tick)
Compute the action for one controlled team member.
void clear_world_state(struct Context *ctx)
Clear all observations for the next tick.
void set_config_parameter(struct Context *ctx, enum ConfigParameter param, float value)
Set an immutable configuration parameter.
uint32_t tick(struct Context *ctx, uint32_t n_times)
Advance the simulation by one or more ticks.