Calamity Engine banner

Calamity Engine

8 devlogs
17h 40m 58s

A 2D modular cross-platform game engine built primarily for the Sony PSP using C++ and SDL3.

Loading README...

sl4shed

Calamity Engine devlog 8

extra fun edition

preface

you may have noticed that there hasn’t been a devlog for 4 days, and there are 2 reasons for that:

  1. I have been really busy with school
  2. psp glibc

logger library

my logger class is literally just a wrapper around spdlog which is a very neat logging library, i made it a wrapper to have a nice API exposed to the user and for future-proofing.

however

spdlog came with some… considerations, and i decided ultimately it would be nicer to package up fmt & spdlog for the PSP and push them to the psp-packages repository
I had to scratch my head a little while patching the source code but in the end it worked out and I have logging working on the psp too!

also

honestly I don’t remember anything else I added so here’s an image of logging working on PPSSPP.

ok bye

Attachment
0
sl4shed

Calamity Engine devlog 7

major changes!! big win

rotation fix

ok so remember last post where i was talking about how painful it is to use matrices? well i was kinda right but also i was kinda stupid. i’m wiser now. aka my smarter friend helped me fix it and now rotation works properly.

with big rotation comes big consequences

positive consequences that is, i added a camera component!
you can add this camera component to any node, pretend it has the height and width of the screen (technically, nodes cannot have a pixel width and height unless they have a sprite. Scale is a multiplier as a consequence to adding matrices, however as in most game engines the camera’s pixel width and height is the size of the screen!). The camera also has an origin point that is set to 0.5 by default as in most game engines, so have fun i guess?

with major changes come major changes

so the game engine is now SDL3 (yes it still compiles to the PSP)! sdl3 is a lot better and it wasnt really that hard to port it because i barely used SDL in the first place, it was only used in graphics.cpp.

one more thing

the engine builds to the web now with emscripten! very exciting as this means my usability rating will not be 2 stars…

attached is video evidence that i’m not lying

it uses the calamity mod sprite from terraria because my friend thought it would be funny, anyways in the video the camera is spinning and zooming out at the same time. I don’t really have a “game” yet since no input/audio/file library but that is to come.
Next on the list is probably logging and error handling since i desperately need that (the engine segmentation faults if it tries to load a texture that doesnt exist when built natively lol)

ok bye

2

Comments

iris
iris 6 days ago

woa! good job!!

sl4shed
sl4shed 5 days ago

thank you!

sl4shed

Calamity Engine devlog 6

pain edition

So… I thought if i made a 2D game engine I wouldn’t have to deal with matrices (transformation matrices), but here we are!!!
remember that bug from like the second devlog? where the node was spinning around wrong? well, turns out to fix it you have to have matrices in the transform because yeah i guess you just do.
If by some weird coincidence you’re going through the same headache as me here is a good resource: matrices and transformations (godot)

other changes

nothing really, I wanted to start work on the camera but that requires (you guessed it) transformation matrices!!!

so not a lot for now, expect this bug to be fixed maybe tommorow if i feel like it or this weekend

ok bye

Attachment
1

Comments

sl4shed
sl4shed 7 days ago

i have really been feeling mega unproductive

sl4shed

Calamity Engine Devlog 5

fun scripting edition

Technically attaching scripts to nodes isnt part of the framework, however, it is part of the project compiler (more on that later), so, I drafted up how the scripting system would look like!

how does it actually work

You have a folder called “scripts” where you have .hpp files that look like the image attached. Basically just like unity’s scripting API, so it should be pretty simple to get used to! These “scripts” are just classes that extend the Script component which contains all of the base functions like update, start, etc…. Then, you just attach the script like a regular component and it just works!
This way, once you’ve set up the node tree and attached scripts you basically never have to touch main.cpp ever.

node trees

Basically a fancy way of saying “serialize and deserialize loaded nodes along with their corresponding components”. Exporting a node tree would just take every node under the root node and serialize it into a JSON file.

file access

I’m currently working on a file access API used for loading and writing node trees when needed, that is, of course, cross platform (not sure about wasm yet though).

project compiler (the middleman)

I’ve finally decided how this would be structured. I will have a project structure format (fancy name for json serialized node tree + script collection) that you pass into a standalone project compiler program to turn it into a compilable calamity framework C++ project.

what about the companion app?

The companion app (aka the engine itself) would be an editor made for the project structure format. This way, this one big project is split up into more handleable chunks that I can work on individually. I still have to create the standard project template: something that would compile to all platforms with no extra tinkering required (by tinkering i mean cmake stuff)

ok bye

Attachment
2

Comments

iris
iris 11 days ago

woah! sick project , it seems very well though out! i love old handhelds

sl4shed
sl4shed 10 days ago

thank you!!!

sl4shed

Calamity Engine Devlog 4

The app compiles cross-platform! 🔥🔥🔥 Turns out it seg faults when it tries to load a texture file that doesn’t exist.

how about really cross platform?

I know nobody really bothers to install standalone apps when they vote for projects, so i will be attempting to make calamity engine compile with emscripten (which will be a big pain in the bum bum)

plans for companion app

I will probably have to build the companion app with calamity engine so it will kinda be engine-ception, “playing” the game will just mean loading the scene node tree (i still have to figure out how to tie scripts to specific nodes 😬, the solution im thinking of right now is “if current scene is this, run this if this node exists” and i hope there’s a better way to do it perhaps)

for now

Here it is running horribly on my phone through termux x11 (1 frame per sometimes)

ok bye

0
sl4shed

Calamity engine devlog 3

im figuring shit out

Ordering will be done in the way that godot does it, aka, root node -> render -> renders children in order

scenes/prefabs

I will implement a serializer & deserializer (optimally in JSON) to load node trees instantly, this would be used for scenes and prefabs

saves

This would be a bit harder to achieve cross platform (did i mention i want the engine to be cross platform?), still i think json would be a good option.

cross platform

I want to stray away from inbuilt kernel functions for the PSP as much as possible, since technically the engine can be compiled to PC since it only uses SDL2, however:

ok bye

Attachment
0
sl4shed

Calamity Engine Devlog 2

im tweaking bro

i have implemented a child-parent system where you can have a node be a child of another node and etc etc i think if you’re reading this you’ve used a game engine before.

Anyways my last devlog didn’t go into detail at all, so i’m going into detail in this one:

structure of the engine

I want this game engine to be kind of like unity: The engine has a component system (for example, you can have a node and have a sprite component to render a sprite, or maybe you want a camera component or an audiolistener component, etc…)

end goal

right now im working on the basic framework (i still have audio and input and physics to implement) but after I’m done with that i want to have a desktop app that lets you generate a project with a level/scene designer and an individual node script system (that will be a pain to setup, but oh well, if it’s auto generated it shouldn’t be that hard). I guess there will be a certain layer of abstraction inbetween what you have in-editor and what the final compiled version is like, so perhaps errors will be hard to figure out among other output, but that’s a problem for future me!

right now

have a video of realistic flappy bird 3d spinning along incorrectly with another flappy bird 3d

2

Comments

sl4shed
sl4shed 13 days ago

also i like how its telling me that having a devlog each 100 minutes is “okay”. i guess when i post a devlog i want to have some progress to show yk

sl4shed
sl4shed 13 days ago

also if anyone knows how to change my username or pfp please let me know im stuck with my gmail prefix that i made when i was 7

sl4shed

Calamity Engine Devlog 1

This is a project I’ve been wanting to make for a while, ever since I’ve purchased my PSP.
Basically, Calamity Engine is a 2D PSP game engine.
Here is the result of 2-ish hours of work 🔥🔥🔥:

Attachment
0