TLSA Engine (Visual Basic 6.0 version)

Custom game engine and tools, designed to intend develop a 2D cinematic platformer game (Prince of Persia or Flashback like) developed in Visual Basic 6.0 with dx_lib32.


Date Start 14 November 2002
Date End 29 July 2010
Role Programmer, Engine Programmer, Tool Programmer
Technologies Visual Basic 6.0, dx_lib32 Project, Microsoft Script Control, DirectX, DirectX 7, DirectX 8.1, OGG Vorbis, XInput, Win32 API, INI, CSV
Platforms Windows
Genre 2D, Game Engine, SDK, Platformer

If a project can define my trajectory as developer, as a solid motivation to learn and improve my coding skills everyday, definitely is the TLSA Project. Born as space opera point & click graphic adventure, and later transformed from scratch to a sci-fy cinematic action platform game deeply influenced by games like Prince of Persia, Another World and Flashback (my Holy Trinity of 2D cinematic platform games). Basicaly dx_lib32 Project existed to develop this project, but it was only the base.

TLSA Engine was a game engine project that I worked since 2002, started with the first versions in Visual Basic 6.0 with dx_lib32 Project, until later 2010; a little attemp in .NET Framework 3.5 and C# in 2008 (based on dx_lib32 Project too via a Visual Basic .NET wrapper) that was the engine used in CP2K8 Aquanoid gamejam project; a XNA 4.0 version used to develop Grey Infection, for XBox Live Indie Games on XBox 360 in 2010, and Pulpetes 4ever gamejam project in 2011 (including unfinished Windows Phone 7 version); and since 2022, I’ve started a new attempt, working on it during my spare time, developed in ANSI C-89 for MS-DOS based as DLL extensions over DIV Games Studio 2 runtime as a retro project challenge.

Visual Basic 6.0 iterations

Focused on the Visual Basic 6.0 versions (2002-2010): TLSA Engine by design was a 2D engine to develop a cinematic game based on the stricted mechanics of Prince of Persia and Flash Back, tile based, by static rooms instead of smooth scrolling.

First iteration (2002)

Started in 2002 using a prototype of the dx_lib32 Project based in DirectDraw7, the first iteration, called 2049 Engine, was focused totally to replicate the Prince of Persia level structure. I not reached the goal to implement any kind of game mechanic, only a loader of test levels.

Second iteration (2004-2006)

After published dx_lib32 1.3 in 2004, I’ve started the new iteration of the project, most focused on the tools, working in develop a built-in Quake-style debug console to ease run parametrized tests in runtime using scripts in Visual Basic Script syntax and executing via Microsoft Script Control 1.0 ActiveX; an asset content pipeline, following too the Quake engine pipeline based on the PAK virtual file system; and a level editor. The most of the work was focused on the level editor and the level system, again, following the Prince of Persia level architecture. The scripting system was abandoned in early compilations due complications defining a simple and stable scripting workflow with the engine features and the dificult to debug it.

Third iteration (2009-2010)

With the new dx_lib32 2.2.0 on mid 2009, taking advantages of the new features and bugfixes on the most stable and tested version of dx_lib32, I’ve started the last iteration of the engine from scratch. This time, I’ve working on more areas than the tools or the level architecture:

  • New architecture based on separated specialized libraries: to ease decouple areas like graphics, audio, input, physics or shared common code. This allow to make changes easily without requiring recompile the entire solution.

  • A simple but powerful scene renderer: Implemented as stacked layered canvas system, the renderer allowed to apply effects and transformations to the entire scene, or part of it, like to do with the sprites. You can perform stack postprocess effects like transparencies with the last render pass, apply a tint color or specular values to canvas vertex, a mirror effect, or rotate the entire screen easily. All effects setup was by coding, not effect file format implemented. The renderer also implemented a simple camera system, allowed to define multiples cameras in scene but only renderer one at time. The engine renderer implements a sprite object with the all related parameters: position, angle, color, effects, etc…; a key-named control point system, like in DIV Games Studio, that allow to define the center of the sprite for position, scale and rotation, and additional control points to define transformable position references to place another objects in scene; and also implements a simple animation sequence system to play frame-based animations with variable frame speed.

  • A basic physics engine: a little engine to manage the all physic interactions between the scene and the entities, with a basic multidirectional gravity simulation, box collision, and a ray caster. The box collision system works using a sub-collider implementation, where a sub-collider setup the response behaviour (e.g.: a sub-collider type to detect collision to a left-side wall applied a main collider position correction, the same for right-side walls, floors, ceilings, etc…). The idea behind this system is to simplied the collision calculations to perform cheap relocation of colliders, but this implied to take in count the colliders of the scenes to define what is a floor, a ceiling, a left-side wall, a right-side wall. Using this feature, the engine implements the ability to move entities through stairs out the box. Also the engine implements a force effectors to allow implements explosion areas or even gravity wells.

  • Axis-action based input manager: A single-player hybrid DirectInput-XInput input manager that are based on axis-action maps, that ease the remaping the input associated to determinated action or axis, supporting keyboard, mouse and joystick/gamepad devices. The manager implements a Force Feedback feature (outside the dx_lib32 Project) based on DirectInput8 for generic gamepad/joysticks, and XInput (via C++ wrapper because XInput API is incompatible with Visual Basic 6.0 DLL calling interface) to support the XBox 360 Game Controller, input and vibration features. The manager includes a little tool to create input maps that can be imported by the engine.

  • A spatial 2D audio engine: The audio system is implemented via an simple mixer that can be control the volume of a group of channels (master volume, main audio samples, voices for narrations, music background, etc…). The mixer also take advantage of the basic effect filters from dx_lib32 dx_Sound class, and implements a feature to simulate the source position of the audio channel, only in stereo space, left to right, using the panning parameter, calculating the value respect the radius value and the player position.

  • More flexible level architecture: In this iteration I decided to implement a more flexible level architecture, allowing pieces of different sizes and position, less restrictive than the original Prince of Persia or Flashback level structure and near to be more flexible like Another World level structure, this include the support, by default, the full multidirectional scrolling.

  • An integrated WYSIWYG level editor: The new level editor was implemented as an extension of the main window engine, deploying satellital tool windows with the each tool to add the physics, tiles and entities, and also to manage the game flow in a similar way like Unity editor do.

  • Tile Studio: A tool to ease define tilesets that can be imported in the engine to draw tiles or sprites, with support to define control points, key names, etc… and animation sequences, with built-in preview support.

The engine tried to uses an entity oriented architecture but in fact is more near to a component architecture like Unity or XNA (it was more influenced by the last one). The engine used CSV format to serialize the data of tilesets, animations and other data, and INI files to configuration files (a built-in support by dx_lib32 Project).

This version of the engine was abandoned after a several failure in middle the Campus Party Valencia 2010 gamejam developing the first attempt of White & World (showed in the last captures of the gallery) due a critical bug on Visual Basic 6.0 compiler that can’t compile the code to generate the binaries because a complex reference issue that, following Microsoft documentation then, has not fix available to solve it, making inviable to continue with the project. This was my last active project in Visual Basic 6.0 and with dx_lib32 Project.