top of page

SuperMarioGL

  • Release Date: 7/29/18

  • Platforms: PC, Android

  • Game Engine: MEngine

  • Programming Language(s): C++

  • APIs: OpenGL/OpenGLES, PortAudio, OpenSL

  • Assets: Ripped from Super Mario Bros. (NES)

What is MEngine?

  • MEngine is a closed-source, cross-platform 2D/3D game engine that I developed in order to gain an understanding of how games work behind the scenes, and also to develop an understand of graphical concepts. The engine itself is written in C++, and utilizes the OpenGL/OpenGLES API for the PC and Android versions. The goal of the engine is the ability for me to develop games for multiple platforms with very little modifications to the game's code, with all of my games being being playable on any device I port the engine to, such as the Nintendo 3DS, Playstation Vita, etc. As I learn of more methods of optimization, the engine will perform increasingly better on mobile devices.

SuperMarioGL1.jpg

This application is an incomplete recreation of the original Super Mario Bros. for the NES. It obviously isn't 1:1, but I tried to make it as close as possible, with even the secrets all functioning as you'd expect. Files are loaded from .tmx files created with Tiled, so making custom stages is possible, I didn't really focus on that, however. I only created stages 1-1 and 1-2, although I don't remember reaching a conclusive stopping point, so if something doesn't work as expected, odds are I didn't get to it yet.

Details

Video

Usage

  • In order to run the desktop application, extract the zip file. This will reveal a folder containing all of the files, along with the executable and the .dll files needed to run the application.  To run it, double-click the executable.

  • All of the files are packed inside of the apk, so launching the application is as easy as installing the apk and launching the application. However, all MEngine games read and write general game settings and custom key bindings to the file "config.cfg". By default, this file will default to being written to external storage. On Pre-KitKat Android devices, this is on the root of the SD Card. On KitKat and higher, this is the /Android/data/com.imackshun.games.supermariogl/files/ directory. Should external storage be inaccessible, it will fall back to internal storage. As such, permissions are required to run the application, as failure to do so will result in a "Permission denied" crash. It is important that this file is written to external storage, in the case you need to modify the file manually for a particular controller, or manually adjust settings. 

Supported Controllers

  • PC: Only supports XInput controls. If you don't have one, there are plenty of ways that you can remap your controller to XInput.

  • Android: Supports Keyboards, although I wouldn't recommend. Supports DS3 and DS4, whether that be with the Sixaxis Controller App, Bluetooth, or OTG. Xbox One controllers are also supported via Bluetooth. Built in controllers, such as those in the Xperia Play or Nvidia Shield Portable are also supported. The Nvidia Shield Controller (2015) is also supported, and so are Joy Cons when used via bluetooth. Any other controllers can be configured manually. The type of controller won't be detected manually. You must access the controller menu and then set the controller that you are using.

  • 3DS: Only supports built-in 3DS controls.

Using Controllers on Android

  • This game requires a controller to play. The game naturally supports DS3, DS4, Xbox One, Xperia Play, and Nvidia Shield Controllers, whether that be via OTG or Bluetooth. Controllers connected via OTG cables tend to work best due to the input delay associated with bluetooth among many Android devices. In the case you would like to use another controller, do the following:

  • 1. Bring up the configuration menu. This can be done at anytime while the application is running by either touching down on the screen for approximately 3 seconds or in the case you are using an Android TV device, holding the Pause/Play(Keycode 85: KEYCODE_MEDIA_PLAY_PAUSE) button on the remote control for roughly a second. In the case your remote controller doesn't have this button on it, you can use the Android TV Remote application to have access to it.

  • 2.Once the menu has been activated, you will be able to see all of the controllers you have connected, and modify what they are being interpreted as. The bottom bar displays all of the controllers that have been recognized. A controller is recognized by pressing any key on the controller. The numbers are grey if no controller occupies that slot. If the controller slot is highlighted, that means that it is the active controller to be configured. All of the squares in the center of the screen control what the the game interprets the active controller as. This is indicated as a green square. You can tap onto any square to change the configuration of the controller, or use the DPAD on your remote control. If the controller you are using isn't on the list, you will have to configure it as a custom controller. If you would like to change the active controller, either tap the controller slot you would like to make active or hold the left or right on the DPAD on your remote controller to slide to the adjacent controller.

  • 3. In order to configure a custom controller, either use the DPAD to navigate to the custom button or touch the button. Once you do this, a dialog box will pop up, commanding you to press the corresponding key on your controller. For each key, press the button on your controller that you would like to bind it to. If the key doesn't apply to your controller, tap on the skip button, or press the Pause/Play(Keycode 85: KEYCODE_MEDIA_PLAY_PAUSE) button on the remote control to skip to the next input. If you would like to start over, press the clear button or hold the Pause/Play(Keycode 85: KEYCODE_MEDIA_PLAY_PAUSE) button on the remote control.

  • 4. Once you have assigned all of the inputs, your controller is ready to use and you will return to the main configuration menu. Press the cross button in the upper left to close the menu, or hold the Pause/Play(Keycode 85: KEYCODE_MEDIA_PLAY_PAUSE) button on the remote control. Also, you can press the cross button in the bottom left to disconnect all of the controllers.

  • 5. The button inputs are stored in a file labeled config.cfg. This file is stored within the application's directory on your device's external storage. Should you have any issues binding the keys of your controller, you can manually insert the keycodes in that file, and modify the array of input codes at the end of the file to 10(The Input Code for Custom Controllers.) Here is a list of input codes:

  • 0 = Keyboard, 1 = DS3 OTG, 2 = DS3 Sixaxis 3 = DS4 OTG, 4 = DS4 Sixaxis, 5 = Xperia Play, 6 = Xbox One Bluetooth, 7 = DS4 Bluetooth, 8 = Nvidia Shield Portable, 9 = Shield Controller (2015), 10 = Joycon(L), 11 = Joycon(R), 12 = Custom Controller

Controls

  • Keyboard Controls(Mostly Used for Debugging): Arrow Keys = DPAD, Z = A, X = B, S = Y, A = X, Q = L1, W = R1, Enter = Start, RDFG = Left Stick, IJKL = Right Stick

​​​

  • Controller(Based on Xbox Controls)

  • (Menu)

  • DPAD = Menu Navigation

  • Start = (Select Option)

  • (Ingame)

  • DPAD - Move

  • A Button - Jump

  • B Button = Run, Throw Fireball

  • Start = Pause

Features

  • NES Super Mario Bros. Gameplay

  • All Secrets are Available

  • TMX Format Parsing for Stage

Bugs

  • Random Crashes

  • Sometimes, Mario slides through tiles. My collision system is buggy.

  • Mario can't jump sometimes. Also collision related.

  • On Android, if the window becomes inactive in any way, the game is likely to crash due to lack of resource management. Will fix soon.

  • Stars don't do anything.

Download Links

TO DO

  • Fix crashes.

  • Implement 2-Player Mode.

  • Implement platforms.

  • Fix collision issues.

  • Add star invincibility.

bottom of page