In Wrectified I am using a control proxy to control actors or vehicles etc.
A ‘Controller’ converts joystick or keyboard presses into generic commands
example joystick up, dpad up, and keyboard arrow up, and w could all send ‘Forward’ command.
A list of these keypress commands is generated each frame per controller and piped to a targeted actor or vehicle.
this does a number of things.
- Distributed complexity and organisation.
- Actor control logic uses common input to have unique behaviors.
- AI systems may send these low level commands (‘forward’ etc) to target actors
- Actors/vehicles can be added in the future without recoding any control logic.(even shared between projects)
- Easy keymapping
- Easily have multiple players on 1 pc
- Potentially a ‘master server’ type multiplayer host server for games
Currently my next ‘level up’ for the design is to use a dictionary and call a function based on the input inside the actor, removing my old nested elif statments.
so in a car ‘Forward’ can be a accelerator but for a player it means walk forward,
and all the control logic is then isolated into nice little independent functions.
Problems = if people don’t understand a system they won’t use it, so the system adds ‘intellectual overhead’
can anyone think of ways of improving this idea?
controller(generate list/lists of keypresses)—(actor calls function based on state and lists)
actors also use a common method to interact with props (weapons etc)