Repository navigation
Portable Projects and Save Games
Since 2.7, every Heaven3D project is portable: you can zip the project folder and open it on any PC, on Windows, Linux or macOS. And games can save the player's progress with two calls.
Heaven3D does this every time you save:
- Every model, texture and sound path is stored relative to the project (
assets/...) with/separators, which work on every OS. - Anything imported from outside the project (Downloads, Desktop, another drive) is copied into
assets/imported/together with its side files:-
.gltf→ its.binbuffers and textures -
.obj→ its.mtland textures -
.blend→ its external images
-
- File names are made safe for Windows and Linux.
- The previous save is kept as
main.heaven3d.bak.
When loading, Heaven3D finds files even when:
- the path uses either slash style
- the letter case changed (Linux is case-sensitive, Windows isn't)
- the path is home-relative or absolute from another machine
- it points at FILE BURNER
media/output from older projects
💡 Put your assets in the project's
assets/folder before importing them and nothing needs copying at all.
FILEBURNER.py is the stand-alone tool that made projects portable before 2.7. It reads .heaven3d files, copies every referenced mesh, image and sound into a media/ folder and writes a new *_portable.heaven3d with retargeted paths (originals are never modified). It has a small Tk GUI:
python FILEBURNER.pyYou don't need it for 2.7+ projects; it remains for converting old ones.
path = self.engine.asset_path("assets/music/theme.ogg")asset_path resolves a project path wherever the project (or exported game) now lives. engine.audio and model loading already do this for you.
self.engine.save_game("slot1", {"coins": 7, "level": 2})
progress = self.engine.load_game("slot1", default={})-
slotis a name ("save"by default);datamust be JSON-serialisable. - Writes are atomic — a crash can never leave a half-written save.
- The previous save is kept as
<slot>.json.bakand used automatically if the main file is damaged. -
load_gamereturnsdefaultwhen there is no save yet.
| Situation | Folder |
|---|---|
| Exported Windows / Linux game | the game's own saves/ folder (moves with the game) |
| …if that folder isn't writable |
%APPDATA%\Heaven3D\<Game> (Windows) or ~/.local/share/heaven3d/<Game> (Linux) |
| Exported macOS game | always ~/Library/Application Support/Heaven3D/<Game> (an app never writes inside itself) |
| Playing from the editor / Hub | <project>/saves/ |
The log prints Game saves folder: … at start-up so you can find it.
@blueprint
class Timer(Blueprint):
def on_begin_play(self):
self.best = (self.engine.load_game("best", default={}) or {}).get("seconds")
self.t = 0.0
def on_tick(self, dt):
self.t += dt
def on_message(self, event, data):
if event == "level_won" and (self.best is None or self.t < self.best):
self.best = self.t
self.engine.save_game("best", {"seconds": round(self.t, 2)})The Coin Collector template and the Car Race Kit both use this pattern.
☁️ Heaven3D · Repository · Report a bug · Apache License 2.0
☁️ Heaven3D
Getting started
Using the editor
Making games
Packages
- Packages
- Writing Packages
- MakeHuman Characters
- Tropical Islands
- HQ FPS Weapons
- Car Race Kit and Spline Roads
- Physics Plus and Light Theme
Shipping
Reference