Hammerite 2.0
Hammerite 2.0 is out. Everything that was GDScript is now C++, in one library: the compiler, the lightmapper, sound, navigation and the editor itself. Levels compile faster, navigation builds faster, and your game no longer compiles any of Hammerite's scripts when it starts.
One native library
Until now Hammerite was GDScript, with an optional native kernel for the heaviest geometry work. In 2.0 I moved every class into one GDExtension library, with the same names and the same behaviour. Before deleting a script I checked the native class against it call for call, and the fingerprints a 1.x map was baked against come out the same, to the bit.
Only the plugins and the autoloads are still scripts, and two of those are a single line on top of a native class.
Performance
| 1.x | 2.0 | |
|---|---|---|
| Compiling 256 rooms | 626 ms | 303 ms |
| Recompiling after a one-brush edit | 42 ms | 25 ms |
| Loading the largest test map | 220 ms | 113 ms |
| Building navigation for a large stealth level | 5.7 s | 2.8 s |
| Building navigation for a smaller level | 1.5 s | 0.56 s |
Also, no Hammerite scripts are compiled any more. On an M-series Mac that was 1.2 s of every launch for the core addon alone, and another 1.4 s the first time the editor was opened.
Two packages
A release now comes in two packages. Full has everything. Runtime has core, audio and navigation without the editor, for games where the players never open it. The library is built for macOS (Apple silicon and Intel), and Windows and Linux on x86-64, for Godot 4.7. There is no web export.
Upgrading from 1.x
Maps open as they did, but a few things need to be done once:
- Migrate your resources. Scenes and resources saved with 1.x refer to
script classes that no longer exist, so they have to be rewritten to use the native classes
before 2.0 can open them. Use File → Migrate 1.x Resources… in the map editor,
Project → Tools → Migrate Hammerite 1.x Resources… in the Godot editor, or
tools/migrate_to_2.sh. - Update your own entities and tools. The API changed where a native class
cannot do what a script could: overridden methods are now underscore virtuals, and constructors
that took arguments are now
create(). The migration guide has every change as a before and after. - Bake maps with a sky again. They report their lighting as out of date the first time.
- Open and save each map, or run your game's own cache tool, so the saved rooms and navigation are written again.
Versioned docs
The docs now keep every release. 2.0 is the current one, 1.0 stays as it was, and latest follows what is being worked on. Every page has a version switcher.
- Elli