Tuesday 1 March 2022

My First Practice Project

 So you wanna make games... well, where do you begin?

I spent a little time learning about what goes into a finalised game, and first things first... how do you build it?

Do you code an engine from scratch? If so, what language? 

Do you use an engine? What one do you use?

So many questions, with no universal answers. At first I considered building my own engines with C++ or C#, so the research began. I knew very little of programming, at this point I had mostly learned in BASIC and Python. Yes, BASIC!

Python is very versatile, with a million and more libraries to handle any situation with relative ease, but it seems not the common choice for game dev, so I looked into C. Now there is a big difference in a loose language like Python and C, and to be honest, it was overwhelming. I stuck with it, but it seemed like there was a large amount of work just to get an image on screen, let alone move it. So I looked into libraries for C to expediate the game development process, but there was so much to learn, about architecture, filesystems, etc. Progress was just too slow. I thought it was time to explore a prebuilt game development engine.

Unity and unreal are the most known contenders, but as I looked into the pros and cons of using either, I was frequently recommended Godot. Open source, MIT license, beginner friendly, and a very Python like scripting language. The door had been opened, and before me was for the first time, a clear, paved path.

Maybe it's like training wheels, but this was a god-send. It reminded me of my teen years fooling around with Game Maker (before Studio!), it let me jump right into testing ideas, and seeing games come to life within minutes, not hours or days. Not to mention there was no cost involved, other than time.

And so I began to learn, reading and watching tutorials, following along and tinkering with the results. Then came what I call a practice project. The goal was to explore how to implement various ideas, how to use the engine. My children are very much into the children's show Bluey, so as a way to have them interested in what I was doing I decided to start building a Bluey themed platformer.

I made sprites out of animated gifs from the show, I clipped audio from streams, and I gathered a handful of free assets from around the internet and got to work.

It was a messy, convoluted process, but I had a workable state machine, got practice with the engine's physics, handled collisions, tried out particle systems, got a decent HUD going. There was no emphasis on level design, or even game design as a whole, just taking what I had seen elsewhere and trying my hand at them.

I was particularly proud of the way I handled the health display, the usual bar of hearts you've seen in the likes of every Zelda game. Could have it been done better? Definitely, but now I know that, and probably wouldn't if I hadn't tried.

 
A simpler approach that my usual over-complication.

I also enjoyed what I did with the enemies, even if they didn't really meet my initial expectations. There are slimes, blue and red. Blue were simple, move left, move right, don't move, don't fall off an edge, jiggle. Red did just a little more, sometimes it would cast a series of rays, along the full trajectory of a jump, giving horizontal speed, initial jump power and gravity. A messy series of IF/ELSES would decide on how good of a jump it was, and if it wasn't good enough, try again with different initial values. My years of highschool physics came in handy there. I even allowed for a sliding landing. Again it could have been done much better, but I learned so much in just trying it out. The end results were pretty satisfying to watch, a jiggly little blob make a graceful jump from one platform to another.

Very messy, and it only got worse just outside this picture, but it worked as intended.
Raycasts in red.

I'd be a fool not to reflect on what I didn't like about what I had created. Immediately, the quality of the sprites I had made. They change in size and position from one frame to the next and they're cropped poorly. I had saved gifs from the internet, and resized and touched them up frame by frame, the end result being jittery and pulsating, and took far, far longer than was warranted, but to be fair on myself, it doesn't look half bad. Also, the background was supposed to be giant grass, though what I ended up with was giant seaweed.

I also struggled a lot with how to handle collisions, especially between rigidbodies and kinematic bodies, and the sounds of constantly colliding cardboard boxes are heard throughout each level.

The single thing I'm most proud of with this creation is this:

A humble, tattered cardboard box, but I one I crafted myself, pixel by pixel.

Another hand-crafted creation are the coins that explode out of aforementioned cardboard boxes.


Not my best work, but I do like them. Feel free to use these coins in your own creations.

In total I probably spent about 2 months on this practice project, and it taught me so much about the engine, about programming conventions and game design in general. A very positive experience, that left me hopeful for my future career as "Most Amazing Game Dev to Ever Live".

Now that wasn't the end of my practice, but I'll save that for future projects, for now, I'll leave you, good reader with a video of the masterpiece in action.


No comments:

Post a Comment