Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Finished my first game

A topic by danqua created Nov 04, 2021 Views: 283 Replies: 6
Viewing posts 1 to 3

Hi everyone,

I finally finished my first game!!

As everyone, I had big plans with a quake-like 3D first person shooter in the beginning. I basically built my own 3D engine in C++ and OpenGL. But  after realizing 3D physics are extremely hard , I hat to take multiple steps back and I needed something much simpler, more easier to finish. A 2D puzzle game seemed feasible! MiniGolf was born.

As soon as the main game mechanics were done I thought. I finally made a game with multiple levels, sound and editable maps (paint is the editor of choice here :D ). After I realized that a game without a title screen and a score is not really much a game, I kind of hacked this things in the code. Good enough for my very first game I thought.  I always read in blogs that you need to release a game, so here I am!

Have fun playing it, it get's funnier when you design your own maps and see how many shots you need to finish the game.

https://danqua.itch.io/minigolf

Cheers, danqua

Nice work!

I like how you used SDL and OpenGL, how the game is tiny (just 200kb without the libs!), and how editing maps is easy.

Minor things:

-the game window is a bit too tall for my small laptop screen, although it's just playable.

-the sounds are a bit harsh. Some low pass filtering or reverb might help. How did you make those? (bfxr/sfxr?)

My main criticism:

The physics is buggy, especially for high speed shots. There's tunneling (the ball moves through walls) and collisions being resolved in the wrong direction (wrong velocity reflection).

How did you implement it?

I think the best way to do it is to implement continuous collision detection and resolve between a circle and a rectangle, where the rectangle consists of four line segments and four circles with radius zero (the corner points). Continuous circle/line segment collision detection and resolve is easy enough, especially if all line segments are horizontal and vertical, like in your case. Perfect continuous circle/circle collision is a bit harder: that actually requires writing down a quadratic equation (for the distance between the circle centers, parameterized by time) and solving it with the abc formula. But that is what's necessary for perfectly resolving high speed collisions for a ball that bounces on a square corner...

(+1)

Thanks for your constructive criticism!

The window size is actually 4 times the framebuffer size; 3/4 of the current size should work fine.

Yes, the sound effects are actually generated on sfxr, I didn't actually played around much, after I had found some sounds that were good enough. I can change that, I get your point :)

And with the collision detection: I actually use a discrete approach. So yeah, tunneling is an issue which I could fix by just restricting the maximum velocity the ball can move. My approach is that I first check if a collision occurs and if it does, I handle both axis separately to resolve the collision. I might have a clue why collisions are resolved in the wrong direction. I will have a look at that. After all, I will have a look on continuous collision detection, that's something I want to learn about anyway.

I'm a software engineer with a strong focus on computer graphics, but actually never got my hands dirty on game programming, which is a hole different beast. I used an data oriented approach instead of a "classical" object oriented approach. This way I didn't end up with overengineering things, like I tend to do with my never ending side project of a 3D game engine (which is actually more a 3D rendering framework, but who knows the difference nowadays, right? :)

I didn't really care about the size. 200kb is actually pretty much for such a small game. BMP/WAV for ease of use isn't the go to decision when you aim for compression haha. 

I fixed the issues @PaulsGames mentioned.

That's fast! Nice. The collisions seem to work well now, even on corners. How did you implement it: continuous collision detection, or discrete with maximum velocity? (I guess the latter.) One more thing: when I finished the game, and then wanted to start again, it bugged out somehow...

(1 edit)

it's actually continuous collision detection :) I kind of cheated and now use box2d (fastest and easiest solution).

Thanks for the note on the bug, that has been fixed.

That works too of course :-D