• Stars
    star
    232
  • Rank 172,847 (Top 4 %)
  • Language
    C++
  • License
    GNU General Publi...
  • Created almost 5 years ago
  • Updated 11 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

The full port of the SMBX engine from VB6 into C++ and SDL2, FreeImage and MixerX

TheXTech

TheXTech

SMBX engine, rewritten into C++ from VisualBasic 6.

Frequently Asked Questions

What is this?

It's a port of an old VB6 engine, purely written in C++. It completely reproduces the old SMBX 1.3 engine (aside from it's Editor), includes many of its logical bugs (critical bugs that lead the game to crash or freeze got fixed).

Why did you make it?

I have several purposes for making it:

  • It's a very convenient research model I want to use in developent of the Moondust Engine.
  • To provide a fully-compatible replica of the old engine for modern platforms, allowing to play old levels and episodes with the same feeling as if they were played on the original VB6-based SMBX game.
  • To make it work without the necessity to use Wine on non-Windows platforms and making it available on non-x86/x64 platforms.
  • Optimizing it to use fewer hardware resources than the original VB6-based game.

You have Moondust Engine, why you have spent over a month to craft this thing?

I need it for Moondust Engine development directly, it's much easier to hack and inspect than an old, inconvenient VB6 environment.

What's the future of Moondust Engine now that TheXTech exists?

I'll continue developing the Moondust Engine as I have yet to reach the second goal of the project. Since it's foundation, the Moondust Project had two goals: 1) save SMBX; 2) give a flexible toolkit for new platform games. The opening of SMBX's source-code and introducing TheXTech has solved the first goal: SMBX has been saved and now it's free/opensource cross-platform software. Moondust Engine will be used for the second goal - giving a toolkit for new games. Unlike TheXTech, Moondust Engine gives a high degree of flexibility that allows anyone to build something new from scratch without inheriting an old game base. However, TheXTech is needed for Moondust Engine as a working research model to develop the new engine. It will be similar to GZDoom and Chocolate Doom ports of the Doom game: GZDoom is a powerful and functional engine, the best choice for modders; Chocolate Doom is an accurate port of the original game to a modern platform with the purpose to represent the original game including even bugs. The Moondust Engine intends to be like GZDoom while TheXTech is an analog of Chocolate Doom to represent an original game on modern platforms.

Can levels and episodes with LunaDLL Autocode work on this?

Yes, can. Since the TheXTech version 1.3.6, there is a built-in implementation of the LunaDLL Autocode language, called LunaScript. This system allows the running of LunaDLL-episodes on any hardware including non-x86 processor architectures.

Can LunaLua work on this?

No, LunaLua won't work: this project is binary-incompatible with LunaLua. This also means that SMBX2 content is incompatible. The planned lua-based scripting system won't guarantee compatibility. Therefore, after the possible appearance of the Lua scripts support, it will be reasonable to port, or create new from the ground up and target to TheXTech exclusively.

Why is the code here so bad?

The original author wrote most of the code in the "src" folder in VB6. I did a whole conversion of the code with an effort to accurate reproduction. So, a lot of the code is identical to what was written in VB6 originally. The VB6 platform had a lot of challenges and limitations such as:

  • All variables are global and accessible from every module and form by default without any includes or imports. The reason why "globals.h" exists: it has a full list of globally available variables.
  • Limited and inconvenient support for classes, therefore the code tends to abuse a ton of global variables and arrays (also an initial lack of experience of the original author was an another factor that lead to this mess).
  • All functions in all modules are global and can be called from each module directly. Except calls marked as "private". Therefore I had an additional work to provide inclusions into files where these calls are requested.
  • Why so much if-elseif-elseif-elseif-elseif-....? Yes, here probably will be correct to use switch() (in VB6 the Select Case analogue) operator. Another factor that shows the original author had a low amount of experience when he coded this project.
  • Why the if() { if {} if { .... } } lasagna? Two reasons: 1) inexperience of original author, 2) workaround to not check all conditions of expression which may cause a crash. In C++ with multiple conditions splitted by && operator, never executing when one of them gets a false result. In VB6, ALL conditions in expression getting be always executed. This difference caused the next situation: in VB6, an expression if A < 5 And Array(A) = 1 Then will cause a crash when A is more than 5. In C++ the same if(A < 5 && Array[A] == 1) expression will never crash because a second check gets be never executed if a first check gave a false result.
  • Why so long expressions like if(id == 1 || id == 3 || id == 4 || ... id == N)? Rather making a ton of conditions like this, it's would be better to use classes with a polymorphism and separate the logic of every object between different classes. Also should be solvable with having to use of function pointers (which aren't possible in VB6 without workaronds, but possible in C++). But, again, the original author's inexperience combined with a bunch of VB6 limits caused these constructions.

How to use this?

Here are many ways to play games with it:

  • There are some ready-to-use packages, just download them, unpack and run them as you did it with SMBX, absolutely same.
  • [macOS users, skip this]: Mix the game with existing assets directory: put an executable file into the game root folder with an "thextech.ini" that contains next text:
[Main]
force-portable = true

, music.ini, sounds.ini and additional "graphics/ui" folder. An important note: all default graphics must be converted into PNG, use GIFs2PNG tool from Moondust Project over your "graphics" folder with a "-d" switch. Don't use "-r" switch to keep original GIFs together with new-made PNGs if you plan to continue the use of original VB6-written SMBX.

  • Use it for debug mode: in your home directory, create the ".PGE_Project/thextech" folder (on macOS the "~/TheXTech Games/Debug Assets/") where you should put a full set of game resources and worlds stuff, this folder will work like a game root in the original game. This mode allows you to run an executable file from any folder location of your computer and use the same location of resources for all builds (except these are marked as portable by an INI file).

How to add custom episodes for the macOS version?

If you have a bundled build of TheXTech, all default resources are inside your .app: "Content/Resources/assets/". You can modify the content, but it's not recommended! Instead, after the first run of a game, in your home directory will appear the next directory:

   ~/TheXTech Games/<game name>/

In this directory, you will find an empty "battle" and "worlds" folder to put your custom stuff. At the "settings" sub-directory the game settings and game saves will be stored. At the "~/Library/Application Support/PGE Project/thextech/logs/" path logs will be stored. If you want to replace default assets with your own, you can modify the content of the app bundle or compile a new build with giving of the necessary CMake arguments which needed to pack your custom assets root and icon into the new bundle or make the assets-less build (if you give no arguments, the assets-less build will result). Therefore, you need to put the full content of the game root into the "~/TheXTech Games/Debug Assets/" folder, include default assets (graphics, music, sounds, intro and outro levels, default battle and worlds folders).

What is different with this thing in comparison to the original VB6 build?

  • First off, it's written in C++ while original (as we already know) is written in VB6.
  • Doesn't have an Editor. Instead, in has a deep integration with Moondust Editor that allows to use it with the same functionality as in original editor (the "magic hand" functionality was kept to allow real-time editing of the level while testing, it's needed to use IPC communication with Moondust Editor to get the ability to use it better).
  • Full support of UTF-8 in filename paths and internal text data (original game had the only 8bit ANSI support).
  • For graphics and controlling, it uses an SDL2 library while original game have used WinAPI calls and GDI library.
  • It uses PGE-FL library that has better file formats support.
  • A support for WLDX world maps are allowing unlimited credits lines and custom music without it being necessary to use a music.ini for music replacements.
  • Some LVLX exclusive features now working: vertical section wrap, two-way warps, custom "star needed" message, warp enter event, ability to disable stars printing in HUB episodes for specific doors, ability to disable interscene showing when going to another level through a warp.
  • Built-in support for episode and level wide music.ini and sounds.ini to override default music and sounds assets.
  • World maps now supports a custom directory to store any specific resources like custom tiles/scenes/paths/levels and not spam the episode root folder with world map resources anymore.
  • Default config format is INI, old config.dat format is no longer supported, mainly because of incompatible key code values (SDL_Scancode versus VirtualKeys enum of Windows API).
  • Game saves now using the SAVX format instead of a classic SAV. However, if you already have an old gamesave, you still can resume your game by using a new engine now (next gamesave attempt will result a SAVX file, old gamesave in SAV format will be kept untouched).
  • Built-in PNG support for custom and default graphics. Masked GIFs are still supported for backward compatibility, however, without making an unexpected auto-conversion like SMBX-38A does.
  • Checkpoints now have multi-points! You can use them in your levels multiple times without limits!
  • It does use of lazy-decompress algorithm to speed-up the loading of a game and reduce the memory usage.
  • For music and SFX, the MixerX library is used to give a support for a wide amount of sound and music formats!
  • It doesn't embeds any graphics: there are NO trurely hardcoded graphics, everything is now represented by external graphics!
  • Some internal limits have been expanded.
  • Built-in GIF recorder by F11 key (F10 on macOS, F11 is reserved by system UI for a "show desktop" action)
  • It starts faster: the loading of the game is almost instant (depend on a computer and it's HDD/SSD performance).
  • It uses less RAM (80...150 MB instead of 600...800 MB like usually), and it's free from memory leaks given by the MCI interface used by VB6 SMBX originally.
  • it doesn't overload CPU (the reason was a bad way to process infinite loops, I did the fix of VB6 build too at my "smbx-experiments" branch)
  • it able to work on "toaster" (a weak computer) while VB6-SMBX won't work.
  • it's fully cross-platform and doesn't depend on Windows, and it no longer depends on x86 processor: it can work on ARM and MIPS processors too (VB6-SMBX won't work on ARM at all, with x86 emulator it will 20x times slower than usual).

How to build it?

You can read a guide how to build this project from source here: https://github.com/Wohlstand/TheXTech/wiki/Building-the-game

To build it, you need to have the following things:

  • CMake
  • Ninja optionally (to speed-up the build process)
  • Compatible C/C++ compiler (GCC, Clang, MinGW, MSVC 2017 and 2019, possibly will build also on 2015, but wasn't tested)
  • Git (required to pull submodules and clone source of dependent libraries to build them in place)
  • Mercurial (required to clone an official SDL2 repository to build it in place here)
  • Optionally: system-wide installed dependencies: SDL2, libFreeImageLite (a modded implementation of the FreeImage), MixerX sound library, AudioCodecs collection of libraries. Having them be installed in a system gives a major build speed up. However, it's possible to build all these dependencies in place here with a cost of extra build time being added.

Localization

Some parts of TheXTech (such as Android launcher) can be localized into many languages, you may help to translate them using WebLate platform: https://hosted.weblate.org/projects/thextech/

Used software

  • GCC, MinGW ΠΈ Clang - main compilers used during the development of the game. The MSVC is used sometimes which is used for Windows builds for ARM64 processors.
  • Qt Creator - IDE from the Qt toolkit, mainly used during the development.
  • JetBrans CLion - Intelliji Idea based C/C++ IDE, free for the Open Source development.
  • PVS-Studio - static analyzer for C, C++, C#, and Java code. Is used for periodical checking of the code for possible bugs. It's free for the Open Source development.

More Repositories

1

libADLMIDI

A Software MIDI Synthesizer library with OPL3 (YMF262) emulator
C++
174
star
2

OPL3BankEditor

A small cross-platform editor of the OPL3 FM banks of different formats (Downloads in README below)
C++
127
star
3

libOPNMIDI

A Software MIDI Synthesizer library with OPN2 (YM2612) emulator
C
92
star
4

OPN2BankEditor

A small cross-platform editor of the OPN2 FM banks of different formats (Downloads in README below)
C++
37
star
5

ADLMIDI-Player-Java

Simple MIDI-player for Android based on libADLMIDI library
C++
27
star
6

BW_Midi_Sequencer

Header-only MIDI Sequencer code which can play MIDI, XMI and MUS files
C++
16
star
7

OPNMIDI-Player-Java

Simple MIDI-player for Android based on libOPNMIDI library
C
11
star
8

libEDMIDI

Emu De Midi as the library
C++
10
star
9

MyMusic

A collection of my MIDI music that I made
8
star
10

SOSPLAY

SOSPLAY - A simple HMI MIDI player for DOS, a little sandbox over a copy of HMI Sound Operating System, taken from a Corridor 8 source code repository.
C
7
star
11

LuaJIT-Example-Android

Simplest example on how to run LuaJIT on android
CMake
6
star
12

PHP-SMTP-Mail-Sender

SMTP Mail Sender - a simple script to send email letters via SMTP server
PHP
5
star
13

TinyScreenshoter

Tiny and super-simple screen capture tool made on a quick hand for Windows 98 and Qt 4.4.3. Works well on Qt 5+ as-is and on any other platforms include Linux and macOS!
C++
4
star
14

UTF8-fopen

A quick test of fopen on Windows and other platforms (path forced be UTF-8)
C
3
star
15

ail32-sandbox

A tweaked/updated original Audio Interfaces Library 32bit version by Miles. An experimental sandbox.
Assembly
3
star
16

libpxtone

Library made from PXTONE, based on the version 220910a
C++
3
star
17

scc

Emu De MIDI synthesizer. Deprecated in favour of https://github.com/Wohlstand/libEDMIDI
C
3
star
18

TheXTech-SDK

The special configuration package for Moondust Devkit intended to develop projects for TheXTech engine
Lua
3
star
19

qt-4-4-3-fixed

Qt 4.4.3 with build fixes. This toolchain is mainly used to make software for legacy platforms such as Windows 98 or Mac OS X 10.4.
C++
2
star
20

wheel-maker-tool

A command-line tool to make a GIF with a spinning wheel using any static image as a cover. Made for jokes.
C++
2
star
21

MIDI-Output-Setup-CPL

A MIDI Output Control Panel applet for Windows Vista/7/8/8.1/10+ to change the default MIDI output synthesizer
C
2
star
22

DWSPP

[WIP] Destroy Windows Spying, ported to pure C/C++. Will begin versioing from 3.0.
C++
2
star
23

SendFileTool

A small tool which uploads a file into public HTTP server and automaticallly copyng URL into clipboard
C++
2
star
24

MiniGallery

A small and simple PHP Script which generates photo gallery from a folder
JavaScript
2
star
25

imf2mid

A small utility which converts IMF (Id-Software Music File) into MIDI file
C
2
star
26

ail2-sandbox

A sandbox over Audio Interfaces Library 2 for DOS16 by Miles
C++
2
star
27

ADLMIDI-old

Re-Attached as "forked": https://github.com/Wohlstand/ADLMIDI
C++
2
star
28

TheXTech-VanillaFixes

1
star
29

ADLMIDI-Player-QML

Implementation of ADLMIFI based MIDI-player on QML (Especially for Android). Outdated, use this: https://github.com/Wohlstand/ADLMIDI-Player-Java
C++
1
star
30

brstm2ogg

Very simple Python script to convert VGMStream formats into OGG Vorbis with looping tags kept
Python
1
star
31

Fer.al-Linux-Launcher

[Archived] The Unofficial launcher for the closed Fer.al online game for the Linux-based operating systems. Kept for historical purposes.
Python
1
star
32

echidnabot

A knuckles the Echidna chatbot for Discord.
JavaScript
1
star
33

SDL2-Android-Example

A very simple Android application example with using of SDL2. Also can be built as desktop application on Linux.
C
1
star
34

msvc-wine-wrapper

Turning Wine-installed MSVC into cross compiler for CMake
Shell
1
star
35

tinyfiledialogs

Imported repository for TheXTech needs
C
1
star
36

IMF-Freq-Conv

A tiny tool which converts a chunk delays in the IMF (id Software Music Format) between 280Hz, 560hz and 700Hz tempo speeds.
C
1
star
37

DWS

DWS
C++
1
star
38

FoxyBot

FoxyBot 🦊 A funny and functional chat bot for Discord service
JavaScript
1
star
39

thextech-discord-rpc

The minified Discord RPC build for needs of TheXTech project.
C++
1
star
40

SDL2-DevkitPro

SDL2 fork for Devkit Pro
C
1
star
41

bastionbot-js

A recreation of @Hoeloe's BastionBot chatbot in discord.js
JavaScript
1
star
42

QuickAppUpdater

Very minimalistic tool that has only goal to download and install the same APK by URL for purpose of quick updates for testers
Java
1
star
43

smpeg

Archived version of the SMPEG library: SDL MPEG library, no longer supported and maintained by its original developers. Kept for archive purposes.
C++
1
star