Project Raygine #14
A little status update to keep track of what I achieved the last days.
I have deviated a bit from my origianl plan to embed all game data in the exe. I couldn't find information if this procedure is actually save to do; I don't want to risk that the exe is blocked by the OS or something. So I am now using a separate file for the game data. The format is super simple: It's just a list of files with their size and offset in the file. Raylib offers setting a loader callback that allows to map load requests to a custom function. Due to this, loading data from the package was super easy to implement. I only needed to modify a couple of Lua scripts of mine to utilize the loader and it worked.
This is how it looks:
Making builds is an essential feature I want to have with high priority. Technically I can now make desktop Windows builds. At least the runtime should support it - but I'd need to make a build menu with options, the procedure to package the content, and so on. That's quite some amount of work. Besides, the desktop target is only one of 3 targets I want to support (the other two being Android and HTML5).
I briefly looked at web builds - and oh boy, that'll be fun. It doesn't look like LuaJIT is supported by Emscripten, so I'll have to use the regular Lua interpreter. Also, I think it'll be cleaner to do this in a dedicated project, apart from the editor; starting with a working Emscripten build and then adding the features I need until it's compatible with the editor version.
But that's a quite fairly large project in itself, so I want to proceed with other things first.
I did a number of improvements to the editor, specifically creating scripts. Here's how it looks like now:
However, the editor itself is another huge and messy construction site. There are way too many essential functions missing. I am working not with a list here though and just am working on things as I notice them - though I should still set out some basic features that I should prioritize.
- Project directory
- I started with loading a project directory that isn't part of the editor directory. It kinda works now, but playmode is still broken.
- Lua script handling
- Creating scripts is now easier and more-bug-free™️. I have different templates to chose from when creating a file and the project view creates an input text field now when creating a new file to chose a file name.
- When an asset is changed or deleted, the editor will trigger a reload upon gaining focus. Not the neatest solution, but it works for now. Since editor reloads are done within less than a split second, it's not an issue for now.
- I am craving for a text editor inside the editor. But that has to wait, it doesn't add much value right now.
- Scene editing
- I can duplicate entities now and have a crude system for allowing reordering components
- The camera allows orbiting, but that's it. I need to be able to move it, focus on the selected element, etc.
- I currently can't see, which element is selected. I need some kind of indicator for that. I guess that visual elements like mesh renderers and sprites need to provide a function for this. I could also figure out when drawing the entity what its selection state is, and draw it into the stencil buffer or something. I'll have to think about this.
- I need to be able to move entities around. I need a gizmo for transformation operations.
- Moreover, I should implement a system to allow working with all kinds of handles in view space. I think the most sensible approach would be to provide an immediate GUI API for view gizmos.
- Plugins and type definitions may provide handlers for allowing different types of user interactions.
- I think a good testing ground is a tile editor. I have prepared a few model tiles for this.
- I noticed that the automatically loaded textures of models use point filtering. I need to be able to configure this. That means that I need to add texture objects to the model asset to provide configuration values.
- I should start using the status bar for information like providing information on how to navigate the camera in the scene view, selection status, last error messages, etc.
I have worked for 6 weeks on this project now. Typically I lose interest around that time and ditch it. Hopefully not this time. There are still many interesting things to do. Scene editing improvements is certainly high in priority. But testing the editor to make game features is also important to get an understanding where I'm standing. So I'll keep winging it for now.