VoxaEngine - C++ 2D Game Engine

VoxaEngine - C++ 2D Game Engine

35 devlogs
138h 54m
•  Ship certified
Created by Hat Dealer

Voxel based game engine capable of sand falling style simulation, heat and pressure calculations, fire spreading, physics and much more!

I know this doesnt 100% follow the definition of a "voxel" but pixels would be wrong too and calling them squares would be just sad

A lot more info in github README! <3

Timeline

Earned sticker

I added the ability to have multiple scenes at once. You can freely swap between them and they each have some extra info attached to them. Idk how much time will I have for more devlogs but I think I can pull a few before the end of SoM :D

Update attachment
Earned sticker

Worked some more on the editor. You can now draw in color and expand the drawing area indefinately. Also added brush size and made a lot of changes to the engine to be more versitile. Btw this editor will be later used to generate files and objects for any game made for the engine to make thing simpler thats like the main goal of the editor

Update attachment
Earned sticker

I started working on a basic prototype of an editor for the engine to make editing some objects etc much more easier. This is a very basic program rn but its another app running off the same engine!

Update attachment
Youssef Youssef 4 days ago

chara!!!!!!

Ship 3

This ship is currently being voted on by the community. Check back later!

Hat Dealer

6 days ago

Hat Dealer Covers 11 devlogs and 50h 3m
Earned sticker

Made some changes to the compilation steps and CMakeLists. Also changed how voxels and objects work so that they are now more dynamic when using the engine and did some changes to the engine to be more versitile

Update attachment
Earned sticker

I added small docs for VoxelObjects and PhysicsObjects. Took some images and gifs for it too! Its just a really small update

Update attachment
ingobeans ingobeans 6 days ago

looks dope!

Earned sticker

A small rework of how particles work. They are now easier to create and manage.
I also made a docs for particles and registries. I think they look kinda nice (.md files inside the docs/ folder)

Update attachment

Worked somewhat on the documentation in the docs/ folder. Also generally made the engine better since I saw a lot of things that needed changing while documenting it all. Next ship might be a bit more technical but I am not sure yet

Update attachment

Finished the work on optimizing OpenGL shaders and buffers. All the shader calculations take ~3-4ms which is a huge upgrade compared to the 9ms it was previously. I am gonna start working on the docs soon and continue adding stuff here and there.
Gif is unrelated but I wanted to make a waterfall and I think it looks nice lmao

Update attachment
Hat Dealer Hat Dealer 24 days ago
I dont know why the GIF looks so wierd, It looks good anywhere but on the devlog. Idk if its just me but there are some wierd colors visible but they do go away when you click on the gif to full screen it

Made another wrapper for OpenGL buffers which took a LOT of debugging over the few days which was very painfull. Now I just need to optimize the copy from GPU to CPU so that it doesnt copy almost 4MB each frame (thats like insanely big for each frame).
Also I am planning to start working on docs for the engine so the devlogs might mix and match between docs updates and code updates or I might just make a single devlog with both once in a while idk yet.

Update attachment

Optimized the data sent to the GPU. While on a standard monitor you load around ~~50 chunks when in full screen I was testing above 1000 chunks loaded at once. Previously the engine ran at ~~4fps, now it runs at ~11fps which is more than double the performance
I also tried to fix VoxelObjects entering the simulation via the GPU but I couldnt get it to work so I scrapped that, in the next update I am gonna do that on the CPU which will be less efficient but will also work
The image is from the new stresstest. The important values are the FPS and chunks loaded

Update attachment

Made a some changes and couldn't make a devlog sooner since SoM was having a few problems so here is a list of what I did:
- Added texture mapping for the world materials (the thing in the image). The effect is originally kinda subtle so I made the grass and dirt texture really agressive just for this showcase. The texture can be randomly rotated etc. The stone and sand has the subtle effect but I have no idea if its even noticable in the PNG
- Added a GLBuffer and GLVertexArray objects for better manipulation with the OpenGL API. This also fixed some errors that were sometimes popping up
- Added some comments to my code because why not. I want this engine to be actually usable if somebody else decides to maybe try to build something with it lol

Update attachment
Hat Dealer Hat Dealer about 1 month ago
BTW! with this update this project has reached over 100h (during SoM) and also reached 10 000 lines of code a while back!

Added some basic cave generation because why not

Update attachment

Did a little work on chunk generation but the main thing is that I finally changed the sand color to be less agressive!
Finally sandier sand

Update attachment

Did a big engine rewrite. Separated the engine and the game into two separate projects. The engine compiles into a library that the game then uses just like SDL2 or Box2D. This now technically allows anyone to make a game with my engine easily.
This is a pretty big update and might bring some unstability but its a step in a good direction. Next devblogs will most likely have more showcase-able features

Update attachment

Ship 2

1 payout of shell 676.0 shells

Hat Dealer

about 1 month ago

Hat Dealer Covers 6 devlogs and 27h 5m

Made bunch of optimizations, added shader preprocessor, better error handling etc.
Also made ImGui slightly better and since I have nothing to show off graphically enjoy this feature that took less than 15 minutes from the whole devlog

Update attachment
Hat Dealer Hat Dealer about 1 month ago
Yoo I also changed up the density of objects, added overrides for that etc so physics should be more accurate I forgor about that

Added chemical reactions. The reactions are done on the GPU for very little performance impact. Right now there are only chemical reactions connected with oxidising but its very easy to add any new ones later. (GIF at 100x speed)
Also made some bugfixed etc as usual

Update attachment

Compute shader rework, the code is now much more readable, stable and expandable.
A lot of bugfixes and QoL features like being able to scroll to adjust material placement size

Update attachment

Made a custom cursor that can change size based on placement size, if the player has a gun equipped etc.
Also reworked shader logic to be separated into multiple files with .vert and .frag extensions

Update attachment

Long time since the last devlog lol, been busy with work and stuff. Updates should be now more frequent.
Reworked player movement to be physics based instead of just moving the player manually, this enables me to easily push and get pushed by objects and for the player to be affected by explosions and much more
Temporarily removed particles from explosions since it could sometimes cause crashes. I will probably fix this in the next update

Update attachment
Hat Dealer Hat Dealer about 2 months ago
This will be reworked later since the game thinks that the barrels and the player weigh like 100 tonnes so the forces arent really accurate 💀
Youssef Youssef about 2 months ago
SOnic speed lmao

Added buoyancy, voxel objects can now share heat with their enviroment, melt in hot enviroments etc. Started working on the player being a physics object for more dynamic control (probably gonna be the next update)

Update attachment
Youssef Youssef about 2 months ago
nice, also should the center of the grarivty stay in the border top of the water :nerd: , lol jk its good

Ship 1

1 payout of shell 1278.0 shells

Hat Dealer

2 months ago

Hat Dealer Covers 15 devlogs and 53h 40m

Fixed rendering of non-physics sprites, added a debug crate because why not

Update attachment

Voxel objects can be split up into smaller parts. Bullets should be now 100% accurate and added vcpkg support

Voxel objects are now affected by explosions. They can be partially destroyed, fully removed and thrown around with explosions. It is also now very easy for the simulation to interact with the objects. Made some effects for explosions to look better

Made the game objects consist out of actual materials. this means that for example the barrels in this video are made out of metal squares so it could be partially destroyed, melted, rusted or anything else when I decide to add those interactions.

Previously the objects were just a sprite but now its dynamically generated from those squares. the mesh is also dynamic. You could easily modify the object at runtime like cutting it and it will modify everything by itself correctly.

also added a object registry and such for easy and fast generation of objects

Added WIP physics! A lot of stuff is still missing but the basic concept is working.
Next I will have to rework how game objects work almost entirely and generate a dynamic mesh the same as I do for the ground

Had to rewrite a large chunk of the previous code but mesh triangulation now fully works and will soon be used for physics! Took a lot of debugging lol

Made a system to generate outline meshes for chunks using flood fill, marching squares, douglas peucker algorithm and much more. Also refactored some older code. The mesh will be later used for physics objects

Added a special shader to showcase heat. Really hot objects will now give away a faint glow and you can toggle a button to show heat around the cursor more clearly. Also merged the beta branch to main branch since all the features have been successfully ported to OpenGL

Added sprite rendering + updated player behaviour. Also fixed some bugs and everything should be more stable

Added text rendering using OpenGL and FreeType. Text can be aligned with the world voxels or displayed statically on screen.

It took me so long to debug the font textures not being avalible on the GPU but after several hours it finally works. My brain has turned into a mush from so much debugging

Added a shape rendering shaders to help me debug some stuff. I can now trigger a debug renderer to see extra stuff and gonna expand it soon to show text an much more which will be a bit difficult since OpenGL doesnt have just a build-in function to render text

Fixed fire rendering and made fire just a bit better

Update attachment

Updated the README 'n stuff

Hat Dealer Hat Dealer 3 months ago

The new readme is currently only in the beta branch btw!

Added rendering for particles like the laser and the flying pieces of voxels. Optimized OpenGL rendering even more and I can now get around 6400fps on avarage (with SDL2 renderer it was more around 120fps)

Hat Dealer Hat Dealer 3 months ago

Yess, It’s mainly thanks to the sand falling simulation running on another thread!

Oasis Oasis 3 months ago

6400 fps is a lot :)

Started remaking the engine renderer with OpenGL vertex and fragment shaders instead of the build in SDL2 renderer.

Since there isn't any voxel based renderer I can use I have to make everything myself to get preffered performance

With the new renderer I can run the simulation with the rendering at around 1300fps on my computer instead of the previous 120fps

The next few updates will consist of optimalizing the renderer even more and adding text, object and player rendering