XML for engineering

The Extensible Markup Language (XML) can be used to store any given data. I am using it to design functions, interfaces, classes and other types for the second TigerHeart engine.

Besides pure XML files, which store names, parameters, result types, derivations and so on, there are also a schema (XSD) and transformation files (XSLT).
The first one defines basic types and valid elements, attributes, groups and sequences for the XML files. So their syntax is checked for mistakes. Both kind of files are free from programming language specifications like class or virtual for C++.
For that XSLT is available to assemble files that are usable for coding. The greatest benefit of the whole system is the convertibility of the XML files into various languages and even multiple files of the same language (e.g. .h[pp] and .c[pp] for C). It is also possible to automatically generate bindings of functions and variables for scripting languages and to build a documentation in HTML or whatever you want. For TigerHeart II C++ headers, source code files and Lua bindings are formed. Maybe there will be a time when XSLTs for C# are added but they are not currently planned.

XML: schema XML: sample XML: transformation XML: result

After the transformations I can add content to the created source code. If I have to change a type name or a definition later, then I only need to do it once in an XML file and not at every appearance in the code.

Category: Programming / Author: Lightrocker / Date: 2007-05-17 - Thursday / Comment(s): none

TigerHeart II: Objectives for the core

The first important step in the planning phase of a new software project is to set the objectives. Here are the ones that should be achieved for the second version of the “TigerHeart” engine core:

  1. Classes and interfaces: C++ classes are accessed externally via interfaces similar to COM. Furthermore methods can be called and attributes can be retrieved and modified using special functions (e.g. for script utilization).
  2. Derivation: It is possible to use existing classes as base for new ones. But those extensions should be accessed by non-derived interfaces.
  3. Object and library management: TigerHeart manages object creation from classes, which are provided by static and dynamic libraries.
  4. Data access and storage: Files from directories and archives are loaded and saved using wrappers. Data can be stored into memory and files with a standard interface and compression.
  5. Meta data: Every class is able to retain user-defined attributes.
  6. Design: Construction of functions, classes and interfaces happens in XML files, which are transformed into various header, source code, script files and what ever is needed. These files will be enhanced by own code.
    Maybe the handling is simplified by an editor later.
  7. Threads: There is a native support for processing on multiple cores.
  8. x86 / x64: Code has to be compilable to 32 and 64 bit executables for Microsoft Windows XP and Vista. Compatibility with other platforms is optional.

Category: TigerHeart II / Author: Lightrocker / Date: 2007-05-09 - Wednesday / Comment(s): none

TigerHeart

After my first game “FutureTrade” had been published I started to learn 3D programming, which was a wise decision because I needed it for my first commercial graphics engine some month later. It was developed for “BomberFun” and also used for a winter sports game called “Winterspiele 2002” and its successor “WinterSports Extreme“. But in the development time I began to realize that the design was not very good. Even it was object-orientated it was made up of one giant class for the game and one giant derivation for the editor. The engine was fast but inflexible especially using shaders and it was no real fun to program with it.

Early in 2002 I started the planning of a new engine. It should be really object-orientated, perform more common tasks than only graphics and be nice to use. The design was adopted from “Microsoft DirectX” because I love how the objects live up to their names. I started the implementation after “BomberFun” was finished and a new project was started in late summer and named the project “TigerHeart” because it is a good name for an engine.
The base of the system is the main engine, which is responsible for object management like COM but platform-independent, loading extension libraries like a plug-in and data storage and access. Meanwhile some extensions have gathered but the first and most important is the 3D engine using “Direct3D“. Different from the previous one there are a lot of classes for the various functions and attributes: renderers (frames, bodies, meshes), states (textures, materials, shaders), animation data (animations, sets, blenders) and some more. They are used to build a hierarchy, which can be processed or rendered with one command.
Next I created an extension for scripting and one derivation for “Lua” support. It is completely independent from the 3D engine but can be combined with it smoothly because of the “TigerHeart” design. There is the possibility to add support for another language, which is applicable immediately without the need for a change of the target program. But up to now there was no demand for it.

TigerHeart sample TigerHeart sample TigerHeart sample

For our bowling, card and air hockey games I implemented a compilation of class, which were based on the “TigerHeart” engine. But they were not flexible enough and not clearly separated from the games themselves. So I started to implement a game engine base as an extension library for the main engine at the beginning of 2005. It handles initialization, standard scene management, script access, multi-threaded loading, some user interface functions, console support for development, input processing and sound output.
The first use was for “Uli Stein – Summer Games” and later for “Balko”. We also developed our broadcast applications for the “Four Hills Tournament” 2005/06 and “tvVAT3D” as an add-on for it.

TigerHeart sample

Every now and then there a some design issues and some missing features, for which time was lacking. But we still currently use the “TigerHeart” engine and extensions for the development of a casual game selection. Anyway the planning phase of the second version has just begun and I will use this weblog to keep you informed. Maybe that would help you to design an engine or maybe there are times when you are able to help me in difficult situations.

Category: Programming / Author: Lightrocker / Date: 2007-05-08 - Tuesday / Comment(s): none

Next Entries »