-
Notifications
You must be signed in to change notification settings - Fork 6
Terminology
Events are are objects which are placed within a level. The name comes from the Rayman Designer editor, and although they're known as "obj" (objects) in the source code we've chosen to use events as the name since it's the most well-known term for it in the community.
Always events are a special type of events which need to get called in by either another event or some game function. For example, the Hunter event requires the bullet always-event in order to work (without it he won't fire anything). These events can be placed anywhere on the map as they're merely there to be stored in memory when loading the map. They're not visible on their own.
In the Mapper the always events have a slightly different structure to normal events due to the link index not being present. On GBA and DSi the link index is always 0xFFFF for always events. In the Rayman 2 prototype the always events are in a separate array with no x and y coordinated.
- Type: This is an indexed value based on the available event types in the game. It specifies how the event logic should be handled (this is hard-coded in the game executable).
- DES ("dessin", drawing in French): Specifies the sprite group to use for the event. On PC this is an index, while most other platforms use pointers for the specific data items in the DES data. In the Mapper it references them using their original file names, which are included with the data.
- ETA: The state group to use. On PC this is an index, while most other platforms use pointers. In the Mapper this once again references the original file name.
- Etat (state in French): The index for the primary event state within the ETA. Specifies things such as which animation to use, how the event logic should be handled etc.
- SubEtat: The sub-state index.
- Displayprio: The layer (1-7) the event is drawn on. Most of these values are ignored in favor of hard-coded ones.
- OffsetBX/BY: The event graphic offsets.
- FollowEnabled: Specifies if the event has collision (Rayman can stand on it).
- FollowSprite: Specifies which sprite has the collision.
- OffsetHY: Specifies the collision offset from the follow sprite on the y-axis.
- HitPoints: Specifies the hitpoints for an enemy or a special event-specific value (such as a flip flag, color flag etc.)
- HitSprite: If under 253, the sprite which has collision, if above 253, use type ZDC collision
In every platform, except Jaguar, the events are in blocks of around 100 bytes each in memory (in most versions they're stored like this in the files too, however some platforms like GBA convert it from a more standard format to avoid storing unnecessary data). The majority of these bytes are temporary values which get filled in during runtime. These are anything from pointers to temporary copies of values. The original event values are never modified since they need to be kept for when the event respawns.
Each event can have a set of commands which act as a sort of basic logic for the event. It consists of a command type followed by a specific number of parameters. While all values are bytes, some parameters are treated as signed bytes. Every version uses the same set of commands (except early demos), however there are two equivalent versions of a lot of commands, a local and a compiled version. The local version is what the developers wrote, and can be seen in the Mapper (and also on GBA/DSi), while the compiled form is more optimized (it uses pre-calculated label offsets for commands which require them).
Every version of Rayman 1 uses a limited number of palettes, but they're handled slightly differently between each version.
On PC every level has 3 palettes (1 in Designer) with 255 colors. The palette is split into sections (event colors, tile colors and background colors). In levels where the tiles require more than the available colors it will swap between the 3 palettes based on the palette changer event, which acts as a sort of trigger based on either the X or Y position of the player.
On PS1 there are multiple 256-color palettes available which the sprites and tiles can utilize from the V-Ram.
Similarly to PS1 there are multiple 256-color palettes to use.
Most of the data is raw image data, except for the sprites which use palettes. Each level has one 256-color palette. Although it has the same amount of colors in the palette as PC, it actually has more colors to chose between since the palettes don't require colors to be set aside for the tiles and vignette.
On GBA there are always 16 palettes with 16 colors each for the background and for the foreground. 6 of the background palettes are used for the background while the remaining 10 are for the tiles. All of the foreground palettes are used for the sprites.
(...)