Port a Unity Game to Your Own Engine: Part 13
A concrete look into a data-oriented approach to engine development.
Preparing Bullet Data
Spawn position can be pre-transformed as relative position to enemy.
In order to use the bullet data, we will need to find the enemy instances that match the enemy type in order to spawn at correct relative location.
Take the opportunity to remove enemy type vs enemy variation type distinction. That extra bit of abstraction doesn’t buy us anything. Limit total enemy types to 64. It was bugging me anyway and I shouldn’t have added it in the first place.
Create a bit vector per wave which tells us if an enemy type is used in that wave or not. To use as broadphase check. Update exporter to save 64 bit value.
Next we’ll need to be able to lookup instance index by enemy type per wave.
Quick fix
I fixed the indexing for string input in the hex to 64bit output.
Next: Port a Unity Game to Your Own Engine: Part 14
Links to files below for paid subscribers.