ECS
Currently refactoring my engine to align with the principles of Entity Component System architecture, as I was running into design and performance issues and thought there must be a better way.
I did have something similar, but after doing some reading and research I think I’ve got something much better now. There’s still a fair bit of work to do, but it’ll be worth it in the long run. It’s a good time to do it - I finished an MVP and polished up the core gameplay feel, and now I’m making sure the engine can support an entire game.
I’ve also finally set up my workspace to start building out characters and sets (with clay), which is going to be a fun challenge.
The main character models are around 20cm tall, which means the scenery models are going to have to be pretty big. It’s going to take a lot of work, and clay!
So much to do, so little time.
Edit: So after stripping it back and running some tests I was still hitting FPS issues with large numbers of textures on the screen. I played around with the benchmark on the Raylib site and couldn’t see how mine could be so much less efficient. Then I noticed that the image being used for the benchmark was 5000x smaller (filesize) than the one I was using… That’ll do it!
A Lull
Life has been busy yet again, so there hasn’t been enough real work done on the game. However, concept art is still coming through.
I was thinking earlier today about how I often scour the internet looking for games similar to what I’m making, with a fear of finding something. So much of the indie game scene looks the same, which is a bit boring, but good for people making something different.
No one is making the type of game that I want to play, so I’m making it myself. What better motivation is there? This is what makes me confident that my game will succeed - as long as I finish it.
Or maybe I’m just 25 years too late and nostalgia is clouding my vision and no one wants to make, let alone play, a wacky claymation classic platformer.
Na :)
Colliding With Collision Yet Again
So I tried to optimise collision for non-player objects, and the results weren’t really that different. I ended up reverting to what I already had and optimising it a bit.
I also added a draw and update zone within a certian proximity to the player. Anything outside the zone isn’t being drawn or updated. I was going to do this later on, but as I ran into performance issues when spawning hundreds of collidable objects with physics on each other, I thought it best to just do it now.
I’ve updated the editor so I can do basic edits to levels again. I think it’s a laugh that the level editor was one of the first things I added, but it hadn’t been touched for months while I worked on the platforming mechanics… The frustrating thing about the editor is needing a GUI for editing the properties of objects. Fortunately I already created the GUI framework, but it’s still a bit of a hassle.
There’s a Raylib GUI library but I haven’t really looked at it, and at this point I’ll stick with what I have as the UI will be quite customised, and made with clay like the rest of the game.
I’ve also added crouching in, finally.
Next up I’d like to add some dust animations behind the player when running, buttons/switches to trigger things, projectile firing enemies and hazards and climbable objects.
The concepts for the main characters are basically done, and a lot of fun. I’ll keep them under wraps for now, though.
20FPS is ok, right?
I’ve made it so hazards can be attached to objects, e.g. a moving platform, or even an enemy.
I’ve added “spawners” that can spawn different objects. Watching enemies popping out every few seconds is just funny.
However, I did start to see a drop from 60fps at around 80-100 collidable objects colliding. I’ll have to optimise my engine, as that’s not great at all. Although it’s not really affecting the CPU or memory much from what I can tell…
Right now every object uses the same collision checking as the player character, which is overkill. I’ll start with something more lightweight and iterate from there.
They’re also bouncing around a lot, which is funny to watch but not intended. This is when the foot position is too close to the edge of the thing it’s standing on (most objects just have collision points in a diamond shape at the moment). Got to fix that too.
Do enemies need collision with each other? It’s not really something you see in classic platformers. Although even if I turn that off, there’s the ground collision to check for, and when I upped it to over 300 enemies it wasn’t good. I thought about just using box collision for the enemies, but because of the uneven ground I can’t really do that. I’m going to have to experiment a bit.
I’ll only update/draw objects within a certain range of the player anyway, but I’d still really like to have good performance with this relatively small number of objects on the screen.
Hazards Ahead
Sporadic progress this week.
I’ve added “hazards”, with the basic one I’m testing with being some spikes. Touch the spikes, die. Pretty standard stuff.
I’ve fixed an issue that was causing jittering and screen tearing, especially in full screen. The game looks and feels smooth as butter now!
I also tweaked the camera movement so it can smooth out subtle movements, whereas before it was tracking every slight movement of the player.
The most exciting thing happening at the moment is working with a concept artist to come up with the look and feel of the game.
I can’t wait to see how it turns out!
Throwing weight around
So I saw a need to refactor my collision system, completely breaking it in the process. However, now it’s back and better than ever!
I’ve also fixed the annoying stepping behaviour when walking down a slope, which was something I was putting off for ages. Adding onto that, I made objects slide/roll down slopes, depending on the angle and the weight of the object.
I also had another happy accident with throwing doodads around, with them now colliding and moving each other. They can keep their momentum and bounce now too, depending on their weight.
As sick of my test level as I am, I’m adding new mechanics every day which keeps it fun.
Next up I need to revisit burrowing through platforms, and then I’ll implement environmental hazards and effects, like spiky floors, falling objects, air drafts and whatnot.
Might look into water/mud as well.