(13.10.2022) Engine Rework


Holy...

this was a long one. I started reworking my engine 3 Months ago because it became harder and harder to add more functionality into my game.

1) I had the problem that my Game didn't know about the Renderer but the Renderer knew about the Game. This meant that I would loop over all Entities in the Game, update them, then loop over all Entities (again) in the Renderer and add draw calls.

2) The second big problem was, that everything was an "Entity". For example (Heroes, Enemies, Arrows, Fireballs, Beams, Trees, ...) and so in order to draw a "Projectile" for example, I had to create an "Entity", add a special "Component" to that "Entity" and then let the Renderer draw it. So If I just wanted to draw a damn "Quad", I had to create a damn "Entity" and THEN apply a Texture and Color.

3) I had a wired Bug that I could not figure out and solve. The previous Devlog talks about that one. Essentially it was just a big Quad drawn on Screen randomly for a split second before it would disappear again. I still don't know what on earth that was lul?

Wired Bug


4) Terrible performance when updating more than 500 Enemies. Since everything was an "Entity" updating an "Enemy" to find an attack target meant iterating over ALL entities. Let's say there are 10 Heroes, 500 Enemies, 300 Projectiles and 50 Trees + Bushes. Every Enemy would have to iterate over 10 + 500 + 300 + 50 "Entities" in order to find an attack target. And that would happen 500 times per frame...

5) I WANTED BETTER GRAPHICS!!! I put so much time and effort into my pixel art but it just looked terrible in game. I couldn't make it look good at all. It would always look flat and uninteresting compared to high quality games.

6) My asset pipeline was slow. The time it took for me to draw a pixel art Image to displaying it in the game took way too long and involved way too many steps. I wanted a pipeline in which I change the image and the texture in game updates as the game is running.

7) I HATE "Tiled", sorry to say but I just don't like working with the "Tiled" editor. So I wanted to have a way to create tiled backgrounds while also being able to change textures in real time. AND I DIDN'T WANT TO CLOSE THE GAME EVER TO SEE CHANGES!!

8) I wanted what people call "hot shader reloading". You change a shader while the game is running, save it, and then see the changes without having to close your game. 


I'm going to post a YouTube video on how I solved all of those problems while keeping it as simple as possible to understand. I'm sorry this update took so long. It has been the hardest 3 Months of my life but I'm happy I pushed through! The results are amazing and working in the Engine is a lot more enjoyable for me now. I'm also very proud of what I have achieved. I have essentially written my own Editor for my game and can finally start working on Gameplay again. Time to tackle those uninteresting Skills and Heroes, add items and more!!!

Files

Cakez TD.zip 42 MB
Oct 12, 2022
Cakez TD DEBUG VERSION.zip 47 MB
Oct 12, 2022

Get CakezTD Demo

Download NowName your own price

Leave a comment

Log in with itch.io to leave a comment.