Translate
EnglishFrenchGermanItalianPortugueseRussianSpanish

The XL Engine is and will remain free, donations are purely optional but greatly appreciated.

Recent Comments

In the last post, I talked a little about how OpenGL support is going to work and about extending the support to include Fixed Function and even software rendering (though that will come online a little later). In this post I will start a little about the architecture of the XL Engine and how supporting different games has been implemented.

The main XL_Engine executable contains the core engine, it contains all the platform specific code, OpenGL and other core systems (sound system, scripting engine, networking layer, etc.).

The engine also contains an “Archive” system, which transparently allows file handling code to lookup and read files from many Archive file formats – such as GOB, LAB, BSA, ART and so on. Then for files that perform specific functions – say image/texture files or level/location/chunk data – the system can transparently load the appropriate data and have it converted internally to the correct format based on the current settings and type. For example, when using the Software renderer 8 bit images are kept in that format but are converted to 32 bit as needed, based on the current palette and color map, for the OpenGL renderer. Currently the file format data is all internal but it is also possible to write Dynamic Library based plugins, similar to the way different games are supported (DLL/so).

Game code is implemented as plugins,  each game consists of a game library (DLL/so), script files and any game specific assets (in the case of games like DaggerXL – these assets are things like icons, title screen, etc.). In addition there is a small text file that describes the game so that it can be added to the list of games in the launcher. The engine has a dynamic library handler that supports Windows, Linux and OS X – there is very little code difference between systems and it is all handled by the Plugin system built into the engine. So for game and plugin code, the engine is used to handle all the OS and engine work – including things like input, file handling, script engine and so forth – allowing the game code to be platform agnostic. Obviously the same is true for all the scripts written as well.

Game plugins register various callbacks with the engine – so that they can receive input, start up game flow and UI scripts, handle pre and post render events, update and handle other events. The game will setup console functions (and potentially variables) and script functions, create entities and register game specific “logics.” Logics are self-contained functional elements, written in code or script, that make objects do things. As an example, a “Door” logic will cause a door to open or close when it receives and activation message. An entity is controlled by one or more of these logics, which are either assigned by the game code itself, through scripts or from the level data. Entities are handled by the core engine but Logics allow them to be controlled from game code, scripts and even shared logics built into the engine.

Anyway, this description just scratches the surface – there is plenty more to talk about in future posts, such as threading model, resource loading, virtual processes allowing for multiple plugins to run simultaneously (such as the editor and one or more games), networking model, script based game flow, script based UI and more. Stay tuned for future posts. :)

9 Responses to “XL Engine Architecture, Part 1”

  • Michel Renier:

    Great to see the progress. And I still hope to see Arena, Battlespire and Ultima Underworld in some near future. Though I am asking too much.
    Thanks for news, Lucius.

    • Edward:

      Yup-Ultima Underworld, I really loved that game, too bad they go for 3D isometric view which I hate. Battlespire is a real pain to play under the DosBox – you can progress, but either run it slow or crash-choose your destiny :), however it seems the game is way too linear. Arena – I tried that a couple of times, but random monster respawn (even more creepy then the Daggerfall one) and poor graphic forced me back… well with improved graphic I would vote for the last one. But never mind that. I want to see finally finished product.

  • Damanslaya:

    So basically the OpenGL support will allow better functioning through using the “Archive” System to load and convert data that is stored in the archives making them have the ability to be properly adjusted for 32-bit data without having to rebuild the original 8-bit archives into 32-bit archives as well as being able to script logics such as opening doors without compiling them with other scripts?

    • Klasodeth:

      OpenGL support is mainly for compatibility with non-Windows devices, since that’s the only way to ensure that the XL engine can render video to the screen on Mac and Linux platforms. Since Windows also supports OpenGL, that means one single graphics API can be used for all supported platforms.

      The archive system is separate from OpenGL support. Every game has different archive formats for packaging game data, and each game also tends to store actual game in different file formats. The archive system provides a unified method for accessing and processing all those different formats, so that it’s not necessary to worry about each file format individually.

      • Damanslaya:

        So basically in other words: Universal OS compatibility and the processing all formats into one method. Thanks for clearing that up, Klasodeth.

  • Taiko Shinoji:

    Finally an updte! Thanks man I’ve been waiting so long.

  • I see additional earnings potential on your website, you can monetize
    every url click , easy money, for more info just search
    in google for – deayuda’s money making tips

  • I read a lot of interesting posts here. Probably you
    spend a lot of time writing, i know how to save you
    a lot of work, there is an online tool that creates high quality, SEO friendly posts in minutes, just type in google –
    laranitas free content source

Leave a Reply

The XL Engine is and will remain free, donations are purely optional but greatly appreciated.