Port a Unity Game to Your Own Engine: Part 19
A concrete look into a data-oriented approach to engine development.
Extract hero bullet data from Unity project into xlsx. Hero bullet format matches enemy bullets, so rename the common format source_bullets. Patch up references to enemy_bullets.
010 Editor Template (bt)
In addition to Kaitai (ksy) files, also generate templates for 010 Editor (bt). They’re basically equivalent here.
Prepare for schema map
Quick rename of source_bullets to bullets. Change sheet counts to be offset into data segment instead of directly in header. Which will allow for a mapped schema type to point to specific columns and along with the counts.
Add map to bin and ksy
Change export_bin to add any maps. Update ksy to inspect the data. Todo: update bt and c_header outputs.
First test for maps
Create the C header for maps and fix up issues with bin export. Maps are the first thing exported, so that all offsets are positive relative to a given map. First test case: Use bullet_source_instances instead of enemy_instances for bullets schema. This is the first step in removing dependency on enemy data in bullets update, so hero and enemy will use the same bullet system. Todo: Update export_bt, remove enemy_instances_update dependency.
Make values in schema types indirect. Patch up existing code. Now maps can also remap values. Add bullet_source_instances_update map to enemy_instances_update. Bullets no longer have any direct references to enemies.
Links to files below for paid subscribers.
AltDevArts is a reader-supported publication. To receive new posts and support my work, consider becoming a free or paid subscriber.