This is an old revision of the document!
The basic structure of the engine is described below. This includes how the engine handles its main game loop by executing the verbe from orders each frame.
The orders are the most important objects in the engine. Rather than having multiple nested game loops for the different areas of the game like the multi-platform engine this one has a single global game loop which sole purpose is to execute the orders, as long as the game is not paused. The orders are stored in a linked list where each order contains a pointer to the previous and next item.
An order mainly consists of a verbe, parameters, display and an absolute x and y position.
A verbe is a value describing what the order should do each frame. The value is used as an index in an array of functions and is what gets called each frame. The parameters in the order are stored as 16 16-bit values, but can be used differently depending on the verbe. Each verbe expects different parameters, ranging from pointers to different types of object data or functions and values describing its current state.
The following list of verbes comes from the earliest prototype:
03: vrb_plateforme1 06: vrb_anim_joystick 07: vrb_recaloum 10: vrb_deplace 15: vrb_movespr 17: vrb_follow_scroll 18: vrb_event 19: vrb_bandeX 20: vrb_main_scroll 21: vrb_sub_scroll 25: vrb_basic 26: gene_no_init 29: vrb_anim_simple 30: vrb_anim_custom 31: vrb_anim_bboss 34: vrb_recul 35: vrb_clignote 36: vrb_board 50: vrb_plateforme2 51: vrb_main_scroll
A display is an object containing a sprite or other type of graphics to be rendered to the screen. It also keeps track of its properties, such as position, collisions, display priority and more.
When a level is loaded by the game it gets created using commands in a “make-level loop”. In the later prototype and final game this was expanded to be used for loading worlds and fixed data as well.
Each command consists of the type of command as well as its parameters. The purpose of most commands is to transfer data from the ROM to the RAM. If the data is compressed, which is usually the case for graphics, the the unzip command is used. A special command is used for loading maps which has parameters for the tile and event maps.
Each level in the game consists of an event map. This map describes which events should trigger at what points in the level. Although this system appears to allow for different types of events it is only ever used to spawn in different types of multi-sprite objects when they should appear on screen.
A multi-sprite is a class of objects primarily triggered by events and used in the game's levels for things like enemies and platforms. There are different types of these with some being referred to as mega-sprite objects if they have additional data defined. Other multi-sprites are used for things like displaying the game's backgrounds. If so they are not triggered by events but rather created by an order or from the level creation commands.
These objects all commonly contain a value describing the number of displays it uses (this value may be 0 if the game dynamically handles this itself), an optional pointer to character data and a verbe. It also contains the parameters to be used for the verbe. When this is loaded, known as being inserted, an order gets created for it to ensure its verbe gets executed each frame.
The character object is used by multi-sprites to define common properties such as colliders, hit-points and display priority. Its usage sometimes differs depending on the verbe.
TODO: Describe how objects keep track and transition between states
TODO: Describe how it handles Atari Jaguar graphics objects