Engine Development - Day 11

Hello! After a day of hard work, scene saving/loading is finally working! Well, sort of.

First, I had to decide how to serialize all the data contained in a scene. As it turns out, this is a difficult task as I don't always know what I'm serializing. The user can make custom components that have all sorts of data that isn't known by the engine. So, I have to find all that at runtime.

I've heard about reflection in the past, but I've never really used it. Well, until now anyway. It's a really cool concept that lets you tamper with the program's internal structure at runtime. I used it to find all relevant fields/properties of objects and put them in a large, human readable file.

I used a recursive function to find all relevant objects, and then simple string manipulation to compose the scene file.

I can't really show you a gif or video of saving and loading scenes, but here's a picture of a part of a scene file.

day11-scenesaving.png

That's it for today. Tomorrow I'll polish some aspects of scene saving/loading and implement some missing features. After I'm happy with it, I can move on to creating a level editor! Cheers!