A remake of the classic Wizardry video games
Copyright Eric Pietrocupo
E-Mail: ericp@lariennalibrary.com
Wizardry Legacy
WL Adventures
Filed in: Development.DVmazedata · Modified on : March 17, 2018, at 01:43 AM - Visits 2778
The data structure of the maze in wizardry is pretty ingenious. The structure currently used will probably be changed in later version of the programm to be able to handle more features. Surprisingly, my engine is has much more stronger capabilities than the NES and SNES ports.
Wizardry use a map system that allow to create thin walls. It took me a lot of time to know how to program these kind of walls. The first thing people are thinking about is to use a grid in indicate which square is solid or not, but that does not allow to have thin walls. The way to do it is to keep the information about the surrounding wall within the square.
So each square of the grid will record which sides are walled if the player was located in the middle of the square. This has the advantage of creating thin walls, but also have the disadvantage of creating 1 sided wall bugs. Still, Wizardry made it a feature rather than a bug.
The 1 sided wall or door bug is created if 2 adjacent square does not hold the same information about wall positions. For example, the left square could say that there is a wall to the right, but the right square could say that there is no wall to the left, allowing a player to move from right to left, but not other wise
This is a proposed structure for the new maze system in order to support more features and possibilities in how to display the maze. The main changes is that the maze can support up to 16 different texture palettes which should been sections or areas of the maze. Each palette would have a shorter set of masked texture for example that would require less bits in the tile to be able to reference them.
7-6 | 5-4 | 3-2 | 1-0 |
---|---|---|---|
North | East | South | West |
The first byte is divided in 4 sections of 2 bits. Each section represent one of the 4 walls. With 2 bits, there are 4 possible values
Wall encoding
Bits | Meaning |
---|---|
0-0 | Nothing |
0-1 | Wall |
1-0 | Grid |
1-1 | Door |
Used to keep track of special events in the maze. Contains the key of the event. If more than 256 events are required for the whole adventure, I could make it palette or floor specific giving me 256*16 or 256*20 events. Or I could use less bits and use the extra bits for other event purposes.
This will work almost as the original except the size will be different. There would now be 4 bits for the filling, where darkness is actually a filling.
7 | 6 | 5 | 4 | 3-0 |
---|---|---|---|---|
Undefined | Light | Solid | Magic Bounce | Room Filling |
The room filling goes as follow. New filling could be added or
Room Filling table
Value | Meaning |
---|---|
0 | Nothing |
1 | Water |
2 | Fizzle Field |
3 | Fog |
4 | Poison Gas |
9 | Darkness |
Each tile can now have a different Floor, Ceiling and Wall object. Each texture palette can hold up to 16 different object pictures for floors, Ceiling and floor objects requiring only the use of 4 bits to reference them.
7-4 | 3-0 |
---|---|
Floor Object | Ceiling Object |
The palette ID is used to identify which one of the 32 texture palette is going to be used. Wall objects are all thin objects like torches and chains that can be drawn above the wall from any direction and still look good (because objects are always facing the player).
7-5 | 4-0 |
---|---|
Wall Objects | Palette ID |
Objects can be placed in various positions on the ceiling and the walls, this byte is used to keep track of these positions. Individual Objects can have 9 different position arranged as a 3x3 grid.
7-6 | 5-4 | 3-0 |
---|---|---|
Wall Object | Ceiling Object | Floor Objects |
Wall Object placement
Value | Placement |
---|---|
0 | None |
1 | Center |
2 | Pair top of wall |
3 | Pair center of wall (or bottom) |
Ceiling Object placement
Value | Placement |
---|---|
0 | None |
1 | Center |
2 | 4 corners |
3 | 4 sides |
Floor Object placement
Value | Placement |
---|---|
0 | None |
1 | Center |
2 | North |
3 | East |
4 | South |
5 | West |
6 | Pair on north |
7 | Pair on east |
8 | Pair on south |
9 | Pair on west |
10 | 4 corners |
11 | 4 sides |
12 | Square |
13 | Undefined |
14 | Undefined |
15 | Undefined |
Masked texture are special textures added over the regular wall texture to identify certain areas as different from the others (for example stairs down). Each palette has a selection of 16 textures for walls and for floor/ceiling that the player can use.
7-4 | 3-0 |
---|---|
Floor/Ceiling Texture ID | Wall Texture ID |
The first 2 bits are used to reference the grid textures. Each palette can have up to 4 different grid and these 2 bits are used to select the right grid to display. The other bits are flags that determine where the masked texture selected in the previous byte is going to be displayed.
7-6 | 5-4 | 3-0 |
---|---|---|
Grid Texture ID | Floor/Ceiling | Wall |
Floor/Ceiling texture placement
Bits | Placement |
---|---|
0-0 | None |
0-1 | Floor |
1-0 | Ceiling |
1-1 | Both |
Wall texture placement
Bit | Placement |
---|---|
0 | North |
1 | East |
2 | South |
3 | West |
The structures above are not the only place where information about the maze are stored. There are data structure for each floor, the new structure will contain data for the texture palette and the database contains a list of events that can be triggered inside the maze.
The importance of having a compact tile structure is because it gets repeated thousands of time. It is important to be able to fit the most information possible in the least amount of space. This is why each bit must be used to it maximum capacity.
The maze size can be estimated the following way:
Width (100) x Length (100) x Depth (20 levels) x Tile Size (8 byte ) = 1600000 bytes.
1600000 / 1024 = 1562.5 K / 1024 = 1.52 Meg
This means that each adventure will have a minimum size of 1.5 Meg. Then you add the pictures, the database and the text to get the final adventure size.
<< Discussion Threads | Table of contents | Maze Events system >>
Powered by PmWiki and the Green skin