Skip to content

Latest commit

 

History

23 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Blocksmith

A block-survival game for the Nintendo 3DS, written from scratch in C against libctru and citro3d.

Nothing here is borrowed. No Minecraft assets, no ported code, no third-party texture pack — every block texture, the font and the Home Menu art are generated by the scripts in tools/, and every system below was written for this project.

Install QR code for v0.1.0

Install

Scan the QR code above with FBI ("Scan QR Code" → install). It points at the .cia attached to the latest release, so FBI downloads and installs it directly.

Or download blocksmith0.1.0.cia by hand, put it on your SD card, and install it with FBI.

You need custom firmware (Luma3DS) to install a .cia. If you'd rather not install anything, blocksmith.3dsx runs from the Homebrew Launcher instead.

What's in it

  • An infinite world, generated from seeded value noise — grass, dirt, stone, sand, wood and leaves, with a biome pass, trees, and 3D-noise caves.
  • Break and place blocks anywhere, via a DDA voxel raycast with a highlight cage on the targeted face.
  • Worlds that persist. A region save format with CRC32 checksums and torn-write recovery, so a power cut during a write costs you that one region and nothing else.
  • Multiple worlds, created and picked from a title screen.
  • A touchscreen inventory, hotbar and a small crafting table (dirt → grass, stone → sand, leaves → dirt).
  • Options that stick — render distance, look sensitivity, inverted pitch, and every button rebindable, saved to sdmc:/blocksmith/options.ini.
  • A crash handler that dumps the fault to the SD card instead of hanging.

Controls

Input Does
D-pad Move
Circle pad Look
A Jump
X Break block
Y Place block
Touch screen Hotbar, inventory, crafting

Every button in that table is rebindable from Options → Controls.

Performance

All figures measured in Azahar, on the New 3DS profile unless stated. Azahar does not emulate GPU cost at all, so these are CPU-side numbers only.

Old 3DS New 3DS
Draw calls 17 34
Triangles 5,118 9,010
CPU per frame 0.33 ms 0.77 ms

App heap 0.26–0.49 MB of a 12.00 MB cap; the chunk vertex pool is 4.24 MB, held in three tiers of slab so a small chunk does not claim a large slab. No walking frame went over 25 ms on either profile.

Building

Requires devkitPro with devkitARM, libctru and citro3d. From a devkitPro MSYS2 shell:

make

To package it as an installable .cia afterwards (needs makerom and bannertool on PATH):

tools/make_cia.sh

Note — this does not build from a clean clone yet. source/main.c, source/scene/interact.c and source/world/world.c include net/networld.h for the multiplayer work that is still in progress and is not published here. The released .cia is a complete, working single-player build; only building from source is affected. The multiplayer server side lives at blocksmith-server.

Tests

The world, save format, options, world list, inventory, crafting and UI layout code is all plain C with no <3ds.h>, so it is tested on the host rather than through an emulator:

sh tools/run_host_tests.sh

Six binaries, currently 2694 + 82 + 46 + 171 + 148 + 1 checks. The last of those parses source/shaders/world.v.pica and asserts its uvScale constant still matches ATLAS_PX — a shader file cannot include a C header, and the two drifting apart once made the entire world render flat brown.

Status

Playable, and not yet tested on real hardware — every measurement above is from an emulator. See CHANGELOG.md for what landed in this release.

Licence

Original work. Not affiliated with Nintendo or Mojang.

About

Blocksmith - a from-scratch block-survival game for the Nintendo 3DS. libctru + citro3d, no borrowed code or assets.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages