Skip to main content

Gameplay

NV2 Engine is a survival-sandbox loop: generate a procedural world, break and place blocks with tool-gated harvesting, gather resources, craft tools and furniture, and explore climate-driven biomes where an AI places vegetation.

Controls

InputAction
W A S DMove
SpaceJump (or ascend in flight mode)
ShiftSprint (with FOV kick)
FToggle flight mode
EOpen / close inventory
EscPause menu (or close inventory)
/Open the command prompt
Left mouseBreak block (hold to keep mining; tool-gated)
Right mousePlace block / use item
Mouse wheelSwitch hotbar slot
MouseLook around (captured while playing)

In menus: / (or W / S) navigate, Enter / Space confirm, N starts a new game, L loads from the main menu.


Block interaction (interaction.rs)

Targeting

DDA (Digital Differential Analyzer) voxel raycasting via world/raycast.rs projects from the camera through the crosshair to find the targeted block.

Mining

  • Left mouse starts breaking; holding continues with persistent break-progress state.
  • Harvesting is tool-gated: each block has a hardness value and a required tool tier; the held tool's power must meet or exceed the requirement.
  • Successful harvests consume tool durability.

Placement

  • Right mouse places the block from the active inventory stack.
  • Placement is blocked inside the player AABB (you cannot build inside yourself).

Special drop logic

CaseBehavior
GravelCan drop flint via deterministic seeded drop logic
Tree trunkDestroying a trunk harvests the connected trunk/leaves cluster, not just one block
LeavesCan additionally drop saplings and sticks with deterministic odds
NVCrafterBreaking it flushes stored contents into world drops before removal

Tool tiers & durability

TierPowerTools
Hand1Bare hands
Flint2Flint pickaxe
Stone3Stone pickaxe
Iron5Iron pickaxe
Diamond7Diamond pickaxe
Netherite8Netherite pickaxe

Every tool tracks max_durability; mining valid targets consumes durability. Tool power gates which blocks can be broken — a wooden tier cannot harvest stone-tier blocks.


Inventory & hotbar (inventory.rs)

  • 36-slot player inventory
  • 9-slot hotbar mapped to the tail of the inventory
  • Active hotbar selection with mouse-wheel scrolling
  • Stack merging and overflow handling
  • Tool durability tracking
  • Separation between placeable items and inventory-only items
  • Built-in 2×2 player crafting grid with output slot

Drag-and-drop stack management works across all GUI slot types (inventory, crafting inputs/output, NVCrafter).


Crafting (crafting.rs)

Two crafting surfaces:

SurfaceGridWhere
Player crafting2×2Always available in the inventory screen
NVCrafter3×3World-placed crafting station (has persistent state)

RecipeRegistry supports shaped recipes (pattern matching with offset support) and shapeless recipes (multiset matching). Recipes are also loadable from JSON (assets.rs). See the Crafting Reference for every recipe with exact patterns.


Movement & physics (renderer/camera.rs)

  • Walking, sprinting with FOV kick, jumping
  • Gravity with fall-speed limiting
  • Flight mode (F) — disables gravity, Space ascends
  • Water physics — water-specific gravity and sinking behavior
  • AABB collision against solid blocks
  • Movement mediums — standing in foliage applies a 0.55× movement speed multiplier (0.65× sprint, 0.35× fall), with sound dampening tracked for future audio

Commands (commands.rs)

Open the prompt with /:

CommandDescription
/locate <biome> [--tp]Find the nearest biome by sampling chunk rings outward from the player; --tp teleports there
/tp <x> <y> <z>Teleport to absolute coordinates (resolved safely)

Responses and errors appear both on stdout and in-engine as subtitle/command prompt messages. Teleports use World::safe_teleport_position(...) to avoid placing the player inside solid blocks.


Persistence

The world serializes to JSON at saves/world.json (next to the executable). Saved data:

  • World seed
  • Flattened chunk block data
  • Chunk water metadata
  • Persisted NVCrafter states

The pause menu offers Save and Save & Exit; the main menu offers Load/Save. Old saves remain fully compatible — AI vegetation only kicks in for newly generated chunks.


Day/night & atmosphere

The renderer drives day/night phase progression through elapsed_time, water animation timing, and climate/biome-driven fog and ambient color uniforms — each biome tints the scene (e.g. forest [0.50, 0.86, 0.42], dark forest [0.38, 0.72, 0.34]).