Meet TheXTech: a full working cross-platform port of SMBX engine [1.3.7.1]

Description: General discussion regarding the current engine development.
Moderators: Moderators, Semi-moderatos

Wohlstand M
Topic author, Lead Developer
Lead Developer
Avatar
Wohlstand M
Topic author, Lead Developer
Lead Developer
Age: 33
Reputation: 499
Posts: 1902
Joined: 15 Feb 2014
English Pronouns: he/him
Location: Moscow, Russia
Website Youtube channel URL Skype Tencent QQ

Post #1by Wohlstand » 14 Mar 2020, 16:18

Hello everybody!

Image


Did you see that I have done little work in my public repositories during February and at the start of March 2020? So, I did a lot of work which I am going to present to you all: it's a full C++ port of the original SMBX engine which now works on multiple platforms (tested on Linux, Windows, macOS, Haiku, and Android), and it does accurately represent original gameplay with the rest of features and bugs!


Some screenshots
Image

Image

Image

Image

Image

Image

Image

Image

Image

Image

How I made it?
Since February 2, SMBX's original source code is now open. This fact gave me a lot of helpful material which will help me to make the Moondust Engine better and faster! However, dealing with the VB6 environment is not convenient, and at the same time, it's not stable on Linux (because of the graphical engine and risk of VB6 IDE's crash due to using external DLL libraries). So, to get it to work easier, I remembered my very old idea to port the whole SMBX code to C++. So, after a week of initial research, I began working. After a week and a half, I got a fully working (but buggy in some places) thing. Then, I spent time debugging it and making it usable by everyone. It's the full replica of SMBX 1.3 with the rest of its logical bugs (with some exceptions: I did fix several crash bugs that were a big annoyance while playing a game). It works on multiple platforms: it works on Windows both 32 and 64 bits, on Linux, on macOS, (also may work on Haiku and xBSD). Since version 1.3.5 has Android support!


Frequently Asking Questions
This paragraph contains a list of several questions you would to ask me, I'll give answers to most of them.
Frequently Asking Questions
What is this?
It's a port of an old VB6 engine, purely written in C++. It reproduces an old engine completely (except an Editor), and includes lots of its logical bugs (crashy bugs where they were found and then fixed).


Why did you make it?
Why? I have several purposes for why I made it:
  • It's a very convenient life model for research I want to use in PGE Engine development.
  • To make it work without it being necessary to use Wine on non-Windows platforms and allow it to run on any other than x86 platforms.
  • To be able to optimize it to make it use fewer hardware resources than the original VB6-based build of a game.


You have PGE Engine, why you have spent over one month crafting this thing?
I need it for PGE Engine development directly, it's much easier to hack and inspect rather than deal with the old and inconvenient VB6 environment.


What's the future of Moondust Engine as TheXTech now exists?
I'll continue the development of the Moondust Engine as I still have to pass the second goal of the Moondust Project.
Since the foundation, Moondust Project had two goals: 1) save SMBX; 2) give a flexible toolkit for new platform games. Opening of SMBX sources and introducing TheXTech has solved the first goal: SMBX has been saved and now it's free and open-source cross-platform software. Moondust Engine will be used to pass the second goal - giving a toolkit for new games. Unlike TheXTech, Moondust Engine gives full 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 a 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 of modders; a Chocolate Doom is an accurate port of the original game to a modern platform with a purpose to represent an original game including even bugs. The Moondust Engine intends to be like a GZDoom while TheXTech is an analog of Chocolate Doom to represent an original game on modern platforms.


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.


How to use this?
Here are many ways to play games with it:
- there are some ready-for-use packages, just take and use as you did it with SMBX.
- [macOS users, skip this]: use by the same way as an original game: put an executable file into the game root folder with a "thextech.ini" that contains the next text:

Code: Select all

[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 the GIFs2PNG tool from PGE Project over your "graphics" folder with a "-d" switch. Don't use the "-r" switch to keep original GIFs together with new-made PNGs if you plan to continue the use of the original VB6-written SMBX.
- use it for debug mode: in your home directory, create the ".PGE_Project/thextech" folder (on macOS the "~/Library/Application Support/PGE Project/thextech") where you should put a full set of game resources and worlds stuff, this folder will work as 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:

Code: Select all

~/TheXTech Episodes

In this directory, you will find an empty "battle" and "worlds" folder to put your custom stuff. At the "~/Library/Application Support/PGE Project/thextech" path logs, settings, and game saves 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 by giving the necessary CMake arguments 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 "~/Library/Application Support/PGE Project/thextech" folder, include default assets (graphics, music, sounds, intro and outro levels, default battle, and worlds folders).

How to develop episodes targeted to TheXTech?
This engine has full compatibility with almost all old episodes developed for SMBX 1.3 with some minor exceptions (if the certain level or episode do rely on the bug of the old game, you can add the "compat.ini" file at your level or episode to re-enable certain bugs which are required for level or episode to work normally).

You can use the same tools as you used to develop episodes for the original SMBX 1.3 (include the classic built-in editor of the old game). The engine doesn't include its own editor anymore, instead, you have two options to get the editor for this engine: do use the vanilla Editor and have all limits as SMBX 1.3, or do development in the modern Moondust Editor that will allow you to use brand-new features of the engine were inaccessible from the old editor.

You need to simply download the standalone Moondust (PGE Project) toolchain and take the latest "SMBX 1.3 Compatible" configuration package. Once you will start the PGE Editor, to get the direct level testing work, you should open (or create a new) any level file, open the Test->TheXTech menu, and choose the "Change path to TheXTech..." menu item. You should specify (or browse) the full path to the actual executable of the game, and press the Ok button. Once you set this properly, you can press the F5 key to start the level testing now.

You can save your level and world maps in LVLX and WLDX format, they are natively supported by TheXTech include the numerous unique features that came from Moondust and SMBX-38A standards, for example, the full ability to use the Z-Layer and Z-Offset, the warp enter the event, the custom "stars needed" message text, two-way warps, portal warps, vertical section wrap, support for more than 21 section, etc. On world maps, there are more than 5 credit lines available and the ability to set up the custom music file provided. The engine does the full support for PNG graphics and a lot of music and sound formats, customizable player hitbox calibration files (the same as for PGE Engine and SMBX2 being used).


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 nearest future, it will have deep integration with PGE Editor that will allow to use it with the same functionality as in the 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 PGE Editor to get the ability to use it better).
  • Full support of UTF-8 in filename paths and internal text data (original game had only 8bit ANSI support).
  • For graphics and controlling, it uses an SDL2 library while the original game has used WinAPI calls and GDI library.
  • It uses PGE-FL that has better file format support.
  • A support for WLDX world maps is 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 the 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 the episode and level wide music.ini and sounds.ini to override default music and sound assets.
  • World maps now support 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 game save, you still can resume your game by using a new engine now (the next gamesave attempt will result in a SAVX file, an 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 as SMBX-38A does.
  • Checkpoints now have multi-points! You can use them in your levels multiple times without limits!
  • It does use a lazy-decompress algorithm to speed up the loading of a game and reduce memory usage.
  • For music and SFX, the MixerX library is used to give support for a wide amount of sound and music formats!
  • It doesn't embed any graphics: there are NO truly 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)


How to build it?
You can read a guide on how to build this project from a source code which you can find here: https://github.com/TheXTech/TheXTech/wiki/Building-the-game

To build it, you need to have the next things:
  • CMake
  • Ninja optionally (to speeds-up the build process)
  • Compatible C/C++ compiler (GCC, Clang, MSVC haven't been tested yet)
  • 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 the cost of extra build time being added.

The official TheXTech documentation
Image
- https://github.com/TheXTech/TheXTech/wiki
Here you'll find a lot of guides and explanations for most of the TheXTech.


DOWNLOADS
Feel free to try it out in action now:
There are ready-for-use packages, equipped with original SMBX 1.3 assets and "The Invasion 2" episode.

Download the game:
All stable downloads were at the project's home page

If you are looking for fresh in-development versions, please see this page.

Needed more episodes?
If you are looking for more episodes, please visit the archive of preserved SMBX episodes (You can browse these directories where episodes will be compatible: SMBX 1.3, SMBX 1.0 - 1.2, and TheXTech. All other directories will contain incompatible episodes that will not properly work, see details here).

Also, you can find some episodes at SMBX Episodes section of WohlSoft Forum, or browse the episodes sub-section at SMBX forum where you still can find any compatible episodes (which was originally targeted to SMBX 1.3).



The full C++ source code repository:
Image
- https://github.com/TheXTech/TheXTech

If you have any questions, problem reports, or suggestions, feel free to write to me!


Yave Yu M
Count
Count
Avatar
Yave Yu M
Count
Count
Age: 29
Reputation: 54
Posts: 273
Joined: 25 Jan 2016

Post #161by Yave Yu » 29 Jan 2025, 18:51

Some weird issue:
World: Always visible doesn't really affect level, it still only visable when path connected it.
Level: Load some old 1.3 level may cause weird layer issue, such as my old episode Mega Luigi Final, details below.
Spoiler
Many weird layer issue happened on Mega Luigi Final's W* level with internal editor.
W1.lvl made rain layer into default.
W3.lvl made lava layer into default, cause level unplayable.
W4.lvl made ice block layer in default.
W5.lvl has same issue of W3.lvl.
…Forunately, Moondust works well, I can just use that instead of TheXTech's internal editor.
And sometimes I don't know why, press arrow key in editor can't move at all.
And internal editor can't set music's variable, such as switch subtune of NSF, GBS, etc. or set g=*.*,t=*.*.

Wohlstand M
Topic author, Lead Developer
Lead Developer
Avatar
Wohlstand M
Topic author, Lead Developer
Lead Developer
Age: 33
Reputation: 499
Posts: 1902
Joined: 15 Feb 2014
English Pronouns: he/him
Location: Moscow, Russia
Website Youtube channel URL Skype Tencent QQ

Post #162by Wohlstand » 30 Jan 2025, 3:31

Yave Yu, you probably need to clear up the gamesave and start a new game from the scratch if you trying to edit existing world.

Added after 51 seconds:
Yave Yu wrote:And internal editor can't set music's variable, such as switch subtune of NSF, GBS, etc. or set g=*.*,t=*.*.
For that I already added the task: https://github.com/TheXTech/TheXTech/issues/900

Added after 2 minutes 13 seconds:
Yave Yu wrote:…Forunately, Moondust works well, I can just use that instead of TheXTech's internal editor.
The Moondust Devkit with TheXTech SDK is primarily recommended to develop episodes seriously. Embedded editor is primarily targeted to work on mobiles and consoles, and on PC just for testing. :doge: So, thanks for reporting such bugs!
Also, if you report bugs regarding to specific files/episodes, maybe you would like to make an issue and submit the affected content? https://github.com/TheXTech/TheXTech/issues
Image

Yave Yu M
Count
Count
Avatar
Yave Yu M
Count
Count
Age: 29
Reputation: 54
Posts: 273
Joined: 25 Jan 2016

Post #163by Yave Yu » 30 Jan 2025, 4:25

Wohlstand wrote:Also, if you report bugs regarding to specific files/episodes, maybe you would like to make an issue and submit the affected content? https://github.com/TheXTech/TheXTech/issues
Visit GitHub is too painful in my region, so I post it here :doge:

Wohlstand M
Topic author, Lead Developer
Lead Developer
Avatar
Wohlstand M
Topic author, Lead Developer
Lead Developer
Age: 33
Reputation: 499
Posts: 1902
Joined: 15 Feb 2014
English Pronouns: he/him
Location: Moscow, Russia
Website Youtube channel URL Skype Tencent QQ

Post #164by Wohlstand » 30 Jan 2025, 4:28

Yave Yu wrote:
Wohlstand wrote:Also, if you report bugs regarding to specific files/episodes, maybe you would like to make an issue and submit the affected content? https://github.com/TheXTech/TheXTech/issues
Visit GitHub is too painful in my region, so I post it here :doge:
Does it works too slow?

Added after 1 hour 27 minutes:
Yave Yu, please make a new topic here viewforum.php?f=101
And attach your episode please (or send it by PM or via QQ if it's something private and you don't want to publish).
Image

Chanceux2
Our friend
Our friend
Chanceux2
Our friend
Our friend
Age: 40
Reputation: 8
Posts: 70
Joined: 10 Oct 2021

Post #165by Chanceux2 » 9 Feb 2025, 19:03

is it possible to revert the new path animation to the old one?
phpBB [youtube]

Original link: https://youtu.be/xBiQ-o4pTBM


Wohlstand M
Topic author, Lead Developer
Lead Developer
Avatar
Wohlstand M
Topic author, Lead Developer
Lead Developer
Age: 33
Reputation: 499
Posts: 1902
Joined: 15 Feb 2014
English Pronouns: he/him
Location: Moscow, Russia
Website Youtube channel URL Skype Tencent QQ

Post #166by Wohlstand » 10 Feb 2025, 12:33

Chanceux2 wrote:is it possible to revert the new path animation to the old one?
phpBB [youtube]

Original link: https://youtu.be/xBiQ-o4pTBM

If speak about speedrunning concern, this animation doesn't affects any timings, it was designed to fit existing time gaps that was originally set, and even more, you can move after the last cell will be open while camera moves back to the player's position.
Image

ds-sloth
Advanced Moderator
Advanced Moderator
ds-sloth
Advanced Moderator
Advanced Moderator
Reputation: 1
Posts: 8
Joined: 20 Feb 2022

Post #167by ds-sloth » 15 Feb 2025, 0:49

And, if you want to fully disable the new path animation, you can do so by turning off "Options -> Video -> Fade Transitions" (at the bottom of the Video page).

Wohlstand M
Topic author, Lead Developer
Lead Developer
Avatar
Wohlstand M
Topic author, Lead Developer
Lead Developer
Age: 33
Reputation: 499
Posts: 1902
Joined: 15 Feb 2014
English Pronouns: he/him
Location: Moscow, Russia
Website Youtube channel URL Skype Tencent QQ

TheXTech v1.3.7.1: A large pile of bugfixes with a taste of new features has arrived!

Post #168by Wohlstand » 13 Jul 2025, 3:35

This update features a lot of platform-related improvements and stabilisation. Since this update the exclusive full-screen modes on some platforms (such as retro computers) are supported to maintain the graphics performance which is impossible with the regular configuration and windowed mode.

Full changelog for 1.3.7.1
New features:

  • Video system
    • Implemented support for Power-of-Two only textures on some platforms via SDL Render (@Wohlstand)
    • Added exclusive full-screen mode support to maintain good performance on weak devices (@Wohlstand)
    • Add 3x scale mode (@ds-sloth, thanks to @Yave-Yu for the request)
  • Gameplay settings
    • Added compat flag "no-shell-grab-top" to disable grabbing shells while falling from above, for compatibility with pre-SMBX 1.3 content (@Wohlstand)
  • Behaviour changes
    • Advanced options are now applied only when hitting Select or returning to the previous screen. (@ds-sloth, thanks to @Wohlstand for the suggestion)
    • The mouse can now be used to click through message boxes in the main menu. (@ds-sloth, thanks to @Agatha for the suggestion)
    • Refine Magic Block handling of lava next to slopes (@ds-sloth, thanks to @ChristianSilvermoon for the report)
    • Adjusted the frame-skip behaviour to address the performance slowdown on some systems (@Wohlstand)
    • Windows: use SDL2 renderer on video cards without OpenGL acceleration (@ds-sloth)
    • Added an explicit indication that game is suspended when window is out of focus by showing the "Paused" label over the gray filter. (@Wohlstand)
    • Rapidly clicking on menu items no longer toggles fullscreen. (@ds-sloth, thanks to @Agatha for the suggestion)
    • On failures while using interprocess-based level testing, the explicit error messages will be shown (@Wohlstand)
  • Hardware support
    • Add GameCube controller support for Wii (@ds-sloth)
    • 3DS: fix bug where gameplay could slow down when audio performance is reduced (@ds-sloth)
    • Wii: fix bug where Wiimote could get stuck in Rumble state (@ds-sloth)
    • Fixed the viewport problem on non-SMBX resolutions at the PS Vita (@Wohlstand, @ds-sloth)
  • New vanilla bugfixes
    • Fix vanilla bug where chars 3 and 4 could clip downwards if they powered up while digging, guarded by "fix-player-grab-clip" [Classic Mode] (@ds-sloth)
    • Fix SMBX 1.3 crash caused by freezing a bubble when the NPC with index 3 is an ice ball (@ds-sloth)
    • Fix vanilla bug where the player could clip downwards when hurt or running into a block while on a platform, guarded by existing compat flag "fix-player-downward-clip" [Classic Mode] (affected Frozen Valley in Fallen Spirits and Mushroom Heights in Princess Cliche) (@ds-sloth, thanks to @Agatha for the report)
    • Fix vanilla editor peculiarity where the order of overlapping blocks might change. Note that overlapping blocks larger than 1 tile are still sorted according to SMBX rules. (@ds-sloth)
  • TheXTech bugfixes
    • Fix TheXTech 1.3.7 peculiarity where NPCs that hid themselves on activation would be shown before coming onscreen (@ds-sloth)
    • Fix TheXTech 1.3.7 peculiarity where player preview sprites in the main menu would not use the correct death effects (@ds-sloth)
    • Fix TheXTech 1.3.6.1 bug where a plant on a hidden moving layer would sometimes not appear after showing the layer (@ds-sloth, @Wohlstand)
    • Fixed a bug from the TheXTech 1.3.6 where music of a wrong section gets started when player enters level by a warp into section with no music (@Wohlstand)
    • Fix TheXTech 1.3.7 bug where rail platforms could get stuck below the current section (@ds-sloth, thanks to @Liebning for the report)
    • Fix TheXTech 1.3.5.3 visual bug where P2's screen fader was not reset when P1 gets a level exit (@ds-sloth)
    • Fix TheXTech 1.3.6.1 visual change in the width of spaces in the in-game message box (@ds-sloth)
    • Fix TheXTech 1.3.7 visual change in the line-breaking algorithm for the in-game message box (@ds-sloth)
    • Tune TheXTech v1.3.7 Modern/Classic Mode logic for when to activate NPCs shown by events to better match Vanilla. (@ds-sloth, thanks to @Liebning for the report)
    • Resolved the pool allocator memory overflow crash problem (Caused by LunaScript's render operations with frame skipping enabled on slow devices) (@Wohlstand)
    • Fix TheXTech 1.3.6.1 bug where setting width or height to 0 in npc.txt would prevent the NPC from spawning (this affected the boss of Hall of Masks in MM4) (@ds-sloth)
    • Fix TheXTech 1.3.6.1 bug where colored platform NPCs could mistakenly trigger activation events (this affected The Sinister Side in SRW) (@ds-sloth)
    • Fix TheXTech 1.3.1 inaccuracy where certain internal values were not rounded correctly (@ds-sloth)
    • Fix TheXTech 1.3.1 bug where characters 2 and 5 couldn't release all coins in a block if the block was in front of another sizable block (@ds-sloth)
    • Fix loading of custom resolution specified in thextech.ini (@ds-sloth)
    • Fix TheXTech 1.3.7 bug where medals were incorrectly tracked after using Coin Switch in Classic Mode (@ds-sloth, thanks to @Agatha for the report)
    • Fix TheXTech 1.3.7 editor bug where sizable block priority was not used when resizing sizable blocks (@ds-sloth, thanks to @ChristianSilvermoon for the report)
    • Fix TheXTech v1.3.7 change to the timing of events triggered by warp enter/exit events (@ds-sloth, thanks to @ChristianSilvermoon for the report)
    • Fix TheXTech v1.3.6.1 inaccuracy where generator NPCs with IDs 57, 60, 62, 64, and 66 could not be walked on in their generator state (@ds-sloth)
    • Fix TheXTech 1.3.7-beta bug which prevented the compat flag "fix-player-clip-wall-at-npc" from working as intended (@ds-sloth)
    • Fix TheXTech v1.3.7-beta visual bug in which the backdrop did not have proper borders in 4P split screen at 1440p. (@ds-sloth)
    • Fix TheXTech v1.3.7 bug in which input methods might get disconnected when switching between battle leves in 3/4-player mode. (@ds-sloth)
    • Fix TheXTech v1.3.7-beta bug in which bullet generators not facing the player could become inactive. (@ds-sloth, thanks to @Liebning for the report)
    • Fix critical TheXTech v1.3.6 editor bug where swapping the order of layers resulting in objects losing their layers. (@ds-sloth, thanks to @ChristianSilvermoon for the report)
    • Fix TheXTech v1.3.6 editor bug where world music tiles would move a tiny bit when the world was saved (@ds-sloth, thanks to @ChristianSilvermoon for the report)
    • Fixed the early interrupting of the level workflow when going to the inter-level warp on some platforms (@Wohlstand)
    • Fixed the visual glitch of the last screen fade out frame being frozen instead of complete going into darkness (@Wohlstand)
    • Fixed the bug that causes gamesave's fails counter not being copied or removed via game menu (@Wohlstand)
    • Fix TheXTech 1.3.7-beta editor bug where a player object could become deselected when closing the editor pane (@ds-sloth, thanks to @fbitninja for the report)
    • Fixed the incorrect work of the Java-coded INI parser on Android that led some properties being loaded incorrectly (for example, valid background picture fails to load) (@Wohlstand)


Known issues

Read full changelog at the "changelog.txt" file in the packages or in the source code archives.

All downloads at the official page of the project!

GitHub Release page: https://github.com/Wohlstand/TheXTech/releases/tag/v1.3.7.1

Tip: Please use the plain application package at if you want to quickly update your existing engine without taking any assets updates (for example, if you has the modded assets you made yourself and you don't want to re-apply all your patches again). However, in some cases assets should be updated to bring some of new features.

Also, you may visit the official TheXTech documentation to learn more about the TheXTech:
https://github.com/Wohlstand/TheXTech/wiki
Image


Return to “Engine Development”

Who is online (over the past 5 minutes)

Users browsing this forum: 12 guests