This is the first unit in our tutorial series thats going to show you the REVER3D fundamentals. We will start today by just giving you a brief overview about it. Since work is still in progress, some of the things described may change in the future. We will try the best to keep it up-to-date.
What is REVERT3D?
REVERT3D (or short "R3D"), is a graphics/game engine intended to create oldschool 3D games. The project was mainly inspired by the Ultima Underworld / System Shock engine (1994). R3D is an approach to create a modern tech engine featuring similiar capabilities. It is NOT going to become a System Shock rebuild neither a 100% rebuild of its engine.
Why one would focus on oldschool games
- We like the old stuff! In our own opinion, blocky graphics and simple effects leave more space for the players imagination. We feel that theres some kind of a special spirit to the 3D games of the 90s thats worth taking it to the future at the cost of heavy work.
- Creating a state-of-the-art 3D game is much more complicated than doing it the oldschool way - especially if you have modern tools to create them and especially if you're on your own.
- Its a good start to get into 3D graphics programming, since its not that hard to understand compared to modern graphics code.
Which additional tools are needed
For the most basic game implementation you would need rarely more than a program to create your graphics and sounds. REVERT3D contains most of the tools like map/object/script editors out of the box. It also features a standard game implementation. This enables you to create R3D games without the need of "hard" Visual C++ code. Of course, linking R3D to a C++ project offers much more possibilites, while the game implementation is limited to its standard set of functions and the scripting API.
A REVERT3D scene is made of three main elements:
- The map (The level geometry like the rooms, corridors or buildings your world is made of)
- Tiles (Block-like units the map is made of)
- Objects ("Things" with various properties which may be placed on your map)
The tile map
The R3D map structure looks like a two-dimensional floor plan, divided by a grid into blocks of the same size (Pic 1, Pic 2) / We often reference these blocks as "tiles".
Tiles can be of different type like solid (P1/B), open (P1/C), diagonal walls (P1/A) or simply empty space (P1/D). Imagine open tiles to be a solid cube split in half so you could move the upper half up and the lower part down, thus creating a space with a floor and ceiling between them. This is the way environments are created / thats where the player moves through and the action takes place. '
The "2D floor plan" architecture is easy to understand and quite easy to work with, compared to full 3D editing - But it also has its limitations:
- The smallest unit which can be modified is a tile, so there is no such thing like drawing the outline of your map by freehand. A map is assembled out of single tiles.
- Because of its "2D nature", the "floor plan" is flat! Tiles may have variable floor and ceiling height, which may generate a good three-dimensional feeling, but its never possible to build rooms over rooms or anything like that. However, there are some tricks to "simulate" environments like that!
While solid tiles are just "walls" from the ceiling to the floor, open and diagonal tiles may have a variable floor and ceiling height for every corner, thus allowing to create slopes / ramps, stairs or just rooms at different height (Pic 3) Each face / side may also have a unique texture or be completely invisible to show a skybox instead.
Many variations of objects are available, like flat sprites, billboards and static 3d models (3DS). They can be animated, support directional textures and different object states (Pic 4) Directional textures can be used to make a 2D object look more three-dimensional (The texture changes depending on the cameras viewing angle). Object states become handy for defining a specific object state and changing its visuals at the same time. For example, you could create an enemy sprite with the states "moving", "attacking", "destroyed" featuring the corresponding animations and textures. This allows clear structuring of every object for any situation. Its also possible to assign user-defined properties to any object - This would allow to give your enemy sprite a "health" value which can be changed at runtime.
Bringing the scene to life
While the scene and object editors offer pretty much everything you need to design your environments and the engine handles most of the core tasks in the background (rendering, physics, objects/scene/memory management), everything that moves and changes within the scene / the stuff that makes a game, can be scripted using the integrated lightweight scripting interface. Scripts are tiny programs which run inside an own system environment of the engine. This Lua based system is divided into separate modules for graphics, scene/object management, system level operations, geo/mathematical/tool functions and sounds. The script functions are directly mapped to the REVERT3D API, which will be delivered as a static lib for use within Visual C++
While the C++ implementation is very much "open" in the way that it allows you to execute scripts virtually anytime/anywhere, the standard game implementation focuses on specific events and tasks. It also allows custom script calls with some additional work, anyway.
The process to create interactive environments using REVERT3D should look like this:
Build your maps and objects using the integrated editor tools, implement the interactive components using the scripting interface. To test your environments, theres a feature to switch near seamless between the editing tools and the gamelogic, allowing rapid developement without the need to restart the whole engine each time. Design your worlds, test it, switch back and continue.