. : 3D Engine : .

Brand / IP

Nintendo, Super Mario

Tech

JavaScript, C++, Haxe, Kha, WebGL, Bullet Physics, OGEX file format, Vulkan, SPIR-V, Shader Model 450

Span

1.5 Months

Live Demo

Jump up and down various slopes. Can you balance on the nose of a dolphin?

NOTE: errors or slow (clear your data)? Click here for fullscreen ↗

Controls (Refresh if you get stuck):

KEY(S) EVENTS
WASD to move
ARROWS ^^^^^^^^^^^^^^^^^^^^^^^
Q&E rotate camera
F1 toggle FPS
O Jump
SPACEBAR ^^^^^^^^^^^^^^^^^^^^^^^
NUMPAD9 ^^^^^^^^^^^^^^^^^^^^^^^
LeftClick enter fullscreen mode
Esc exit fullscreen mode
R respawn / restart

Gameplay:

Game screenshot: water shader with low-poly Italian city.

Pressure sensitive jump (hold key). Press 'R' to respawn / restart in the town (especially if you get caught in the mesh).

BUGS: falling through/getting stuck in the mesh due to outdated & experimental ammo.js physics.

Jump detection can sometimes be slightly off on slopes since it attempts to guess when the player model is on the ground by Y values alone. This can be particularly obvious when the player is sliding on a slope, causing the jump to fail to fire (the game logic thinks the player is still in the air).

If the player moves before jumping (which is often the case), the jump should correctly fire.

Edited assets from Models-Resource.com ↗

NOTE: This is a 3D Engine, not a game. Game-like features were added only to test assets.

Development:

Game screenshot: 3D platforming on rooftops. Hills & terrain with a sewer & docks.

Often building out from tutorials and existing code causes sluggish performance. This engine in particular would freeze every few minutes for unknown reasons. Usually that can be traced to memory leaks and repeated calls in critical areas of the graphics pipeline.

With some snapshots I locates\d the main bottleneck at a repeated pipeline call in RenderTexture. By returning on Init, the problem was solved.

However, this project is fun to tinker with. Optimizing here. Cleaning-up and commenting there. Now nearly every line has been modified, including the controls and jump physics.

Physics:

3D Game screenshot: Bullet Physics triangle collision mesh.

Bullet Physics ↗ allows for complex collision between meshes. The JavaScript version uses AmmoJS (a port of Bullet). This generates a proxy collision mesh for the stage (currently at run-time).

Effects:

3D Game screenshot:  Underwater opacity blend & screen fill.
  • ☑⁡⁡ Tint: when the camera goes below the water level.
  • ☑⁡⁡ Fast Z-fog: for various hazes (and possibly darkness) is in, but not ready for viewing in this version.

To-Do:

3D Game screenshot: Mario overlooking an optimized & camera culled city.
  • ☑⁡⁡ UI and key binding.
  • ☑⁡⁡ Use UI to swap assets (like player models and stages).
  • ☑⁡⁡ Integrate camera system.
  • ☑⁡⁡ Pre-generate collision meshes (faster load and improved collision).
  • ☑⁡ ⁡Local multiplayer.
  • ☑⁡⁡ Netplay.