Nintendo DS code editor and scriptable game engine
5 days ago
- #Game Development
- #3D Rendering
- #Nintendo DS
- A scriptable 3D game engine for the Nintendo DS was developed, allowing users to write and run games directly on the console.
- The engine is written in C using libnds, compiles to a ~100KB .nds ROM, and runs at 60 FPS.
- Features include a touch-based code editor on the bottom screen and real-time 3D rendering on the top screen.
- Includes a default 3D pong game as a working example.
- The engine is inspired by nostalgic experiences of making games on a TI-82 graphing calculator.
- The engine is divided into three main parts: 3D rendering, a touch-based code editor, and a script interpreter.
- 3D rendering utilizes the DS's hardware to render colored cubes with controllable camera positions and angles.
- The touch-based code editor is custom-built with a pixel-by-pixel UI and features like syntax highlighting.
- The script interpreter executes one line per frame (~60 lines/sec) and supports variables, loops, and conditionals.
- Scripts are built from tokens with numeric parameters, executing instantly without parsing overhead.
- The engine ships with a playable pong game, demonstrating its capabilities with simple register math and conditionals.
- To use the engine, compile the ROM and run it on a Nintendo DS with a flashcart like R4, DSTT, or Acekard.
- The project can be tested in a Nintendo DS emulator like Desmond.