obliberry
- 36 Devlogs
- 91 Total hours
Fallout inspired isometric game engine / renderer prototype (C++ w. OpenGL)
Fallout inspired isometric game engine / renderer prototype (C++ w. OpenGL)
added switch statements, foreach-loop, objects, modules (imports), and a standard library to the scripting language
I’m working down my todo-list for the scripting language (ObSL). Right now i’ve got arrays implemented!
i also made a method to define functions from the c++ source so that I can access c++ stuff
(like std::chrono functions that im using for testing right now from the test.obsl script),
and whatever other functions i want to have accessible,
this will be very useful later on as I to integrate the scripting language with the game engine, as now i have an easy way to call functions already defined in the engine source code from the scripting language by just calling interpreter.bind_native(args blah blah); and then I can call the function from the interpreted scripts.. very useful :D
the scripting language now has some more mathematical operators and functions !
The scripting language is now technically Turing complete, as i have added state environment (basically variables persist throughout the session), conditional branching via if / else statements
basic repetition via while & for loops
the screenshot below shows a fibonacci sequence &
an example of the conditional branching w. looping .
of course it’s not done yet though, i still have a lot of work ahead :)
still working on parsing and implementing new nodes :)
Working on trying to implement a scripting language for my game engine…
i’ve got a simple parser working,
it definitely went faster than i expected. Going back and reviewing an old parser i made in C# a while ago helped a lot in this :)
I’d like Entities to be scriptable in a future editor application / in general without having to edit c++ source files of the editor to implement new logic systems for one entity, so i’m planning on implementing a very basic scripting language, the way i plan on it working is that you attach a script to an entinty as a component, and it will hold the actual game logic in that script, im not great at explaining with words but what im doing now is starting on implementing lexical analysis for a simple interpreter just to test things out, while I have written small interpreters before, alot of this is still new to me so I am learning along the way. the idea is that its just a very basic scripting language to interact with entities and the current scene, with basic apis for interacting with the current scenes ECS registry,we will see how it goes :)
I’m working on a simple map lighting system, which seems to be working alright.
Also scene files now have background color information (which ends up getting wired into glClearColor), also implemented name field for entities because why not.
I’m also messing around a bit with the UI since im not super experienced with ImGui but I like trying things out…
I’ve been focusing mostly on my scene serialization lately.
First, I refactored the maps to remove the hardcoded TileTypes enum, which used to map 0 to grass and 1 to sand.
Instead, I implemented a system where this is defined in the grid section of the scene’s json file. The “id” property is now a generic unsigned integer for the tile type, and the “texture” property references a specific asset loaded in the scene.
I also added a “properties” section for the scene’s name and a “clear_color” array. This lets you dynamically change the window’s background color on the fly instead of always defaulting to a hardcoded black.
Writing the new methods and sorting out the custom serialization logic took a bit of work, but it is working great now.
also bumped the map file “version” to 2, even though the reading/writing of map files didn’t change at all, the usage of some bytes did kind of change (for the tiletype) so i felt it was fitting
i’ve been playing with loading in entities and meshes..
ignore the weird fps drops and generally low fps (compared to normally), screenshots and recordings loves messing with performance for some reason
i’ve implemented instanced draw calls alongside regular draw calls in my renderer, which currently im using instancing for drawing the map, I also implemented culling for the map depending on viewport and some other small optimizations, I also spent some time on fixing and improving my “Systems” and some general cleanup
Managed to fix the segfault..
Mesh::Upload was updating buffer data without binding its own VAO first, which polluted the global OpenGL state. When a new scene loaded, the driver tweaked out on the broken index bindings and crashed on the next draw call …
I’ve got saving scenes working fully now! ^-^,
but an issue ive run into is a segmentation fault on switching scenes, I theorize that it’s due to me not cleaning up / reassigning things when I load in new meshes etc from the scene, thus leaving old pointers in the render queue which don’t exist anymore. This i will work on fixing next..
But for now I am quite happy that i have scenes loading and saving to json :)
I’ve got loading in scenes working pretty well,
but I still have work todo before I can save them properly, im pretty tired already since i spent all day chasing a bug regarding render sorting and ended up refactoring a ton of stuff that i probably didnt have too as i was searching for the issue, but atleast the codebase is somewhat cleaner
running some tests.. messing around with funny map generation shapes too but i dont know how i feel about them
rather than using another custom file format i decided to just use json to serialize scenes which is coming along rather nicely …
I’ve been restructuring the and moving things to run actual game logic via “Systems”.
I’ve temporarily been testing this in a messy way directly in the scene class, but I’m planning on implementing maybe some sort of basic scripting language that can be used for game logic in entities as a Component w. accompanying systems ofc,
so game logic can be defined outside of engine source files and serialized into a scene’s registry from a given file rather than the things im messing around with now.
serialization of scenes is what im planning to implement next once im happy with how scenes are working, but i need to plan ahead alot.
So for now I’m still going to focus on making sure my Scene implementation is good enough before I focus on implementing serialization and scripting etc, and I have alot to think about regarding the design and architecture of this thing that seems to have evolved into a Game Engine :)
working on getting Scenes implemented
I completely refactored my ECS into an actual proper entity component system and added a lil fancy inspector for entities/components in the UI, everything works with the new system :)
Now that my ECS is properly implemented I’m going to start focusing on implementing proper Levels/Scenes rather than the mess I have right now in my “Game” class which I’ve been using for testing stuff
(ignore the weird framedrops my screen recorder was tweaking out)
i made a npc (the red super mutant) that just wanders around
I’ve been having a bit of fun with player sprites (currently som fallout 1 super-mutant sprites i found online) and the renderer sorting sorting code to avoid the player appearing under the ground
I implemented reading from the previously saved map file, with some tests ofc :D
please ignore the player flying away at the end.. as of the time of writing it was a sloppy bug which is already fixed
I’ve implemented saving the current grid to my own custom file format, and some tests to check that it’s working and all seems good.. but now, the real test is to see if I can load back in that file properly :)
I did a few things
in short im basically preparing myself to implement some sort of map file loader w. accompanying filetype?
I managed to setup a basic ImGui window to control map generation, I also tried to optimize my rendering by fixing a sloppy bug i had in my batching implementation and caching transformation matrices per transform (dirty flag pattern)
fps does seem stable :)
(please ignore the video artifacting)
I redid almost everything with what i’ve learnt from trying the first time
(ECS, ResourceManager & MeshFactory are basically the same though)
I managed to implement A* pathfinding for the player movement.
I got to render out the map with textures i made.
tried to recreate movement like Fallout has, where you move the mouse to pan and click to move to a tile with stepping.
The hex grid is reperesented via an odd-r offset layout.
Experimenting with camera stuff and input, now i can zoom with the scrollwheel and i’m trying to get an isometric perspective working better
im getting a simple resource manager implemented :)
It may not look like much, but I’ve been working on implementing a form of an ECS , rewriting some stuff too. I kind of broke some camera stuff in the process which I’m going to fix soon, and actually get this stuff to be the correct perspective and such….
i’ve been experimenting with some stuff back and forth, now im working on testing basic “Player” movement with WASD
I’ve implemented proper debug logging for OpenGL, optimized rendering with a queue that sorts RenderCommands to avoid unnecessarily binding & unbinding, a basic InputManager class, and very basic materials.
i’ve got a basic hex grid “map” rendering and working well
Implemented a basic camera which im messing around with a bit to rotate (around) my mesh
I now have textures working, and a basic “meshfactory”
I’ve gotten transforms and basic rendering implemented of objects implemented via a “Mesh” class that gets passed to Draw() in the Renderer Class :)
Setup basic GLFW Window boilerplate & CMake Project :)