Advertisement

Making a game engine. Looking for advice

Started by December 10, 2018 09:02 PM
6 comments, last by Entex 5 years, 11 months ago

printf("Hello %s", "follow game makers!");

I'm about to make a game engine, and looking for advice!

Background

I have a game engine project I've been thinking about A LOT lately. I know it's gonna be hard, in fact the most challanging programming challange i can think of. With that said, I'm willing to put down the time and effort.

I'm looking for some advice to keep the project up and running and I'm asking you, game makers! I've so much passion about this project. I've tried making a game engines before, but they have all halted. Some failed because of lack of focus, some failed because of unorganised structure, some failed because of lack of experiance, too big scope, unclear destination... you get the point.

Now I'm taking a different approach. I'm doing the boring part, pre-planning, researching, etc. That's partly why I'm here, asking you. I'll lay out my plan for you guys. 

Prerequisites

I'm gonna try to keep technical terms to a minimum.
So no spoiling what graphical API's or libraries I'm going to use, that's just asking for political warfare. This is more about the project management, avoiding pitfalls and such.

The engine is gonna be a 2D engine. When i feel finished (probably in a couple of years) I will expand to 3D, but that's for another time.

Because it's a game engine it should handle any type of 2D game, sidescrolling, top-down, hell even click-adventures!

Disclaimer

Sorry if my english is a bit wacky. Don't judge!
The Game list(You'll read about it soon.) is just for experience purpose. I don't wanna fall in any kind of legal action because i stole some idea and thus only for personal use. My own ÜBER-awesome-final-game, if ever completed, will be released to the public.

I first posted this on stackoverflow and was shutdown pretty hard because of too broad topic, understandable. Hoping this is the right forum, I'm just looking for some friendly advice. Kinda hard to get on this internet thingamabob...

The Plan

Start simple, work my way towards a more and more advanced game engine. In the end and my long term goal is my very own advanced 2D game(of course built on my engine). As a bonus, I might release the sourcecode of the game engine if I'm happy how it turned out.

I believe in short term goal too keep my motivation and the feel of progress. But also have major goals to strive for, too always keep myself challanged, get bits and pieces to be proud of and most important have something to look forward to.

Some of my older tries failed because i lost focus and stopped coding for a while. This time around i think it's best to atleast get a few lines of code every week. My "average goal" is to code for atleast a couple of hours every weekend. Just so i don't stop coding, the worst pitfall (i think).

My strategy is a list of games to make on my journey. Trying to always have the list as a unit testing tool (Surely I'll have to redo older games when my engine gets up to speed). The list looks a bit like this. 

Game list, Major hits

1. Pong
2. 1 Level platformer (Extremly restricted)
3. Extended 1 level platformer with screenscrolling, jumping, etc.
4. Same level with added Sprite/Animation.
5. Same level with Goomba-like enemies and a finish line.
6. Multiple levels!
7. Super Major. A complete, short, single player mario-like game, with different enemies, levels and of course a boss.
8. Top down 2D game. Bomberman-like
9. Bomberman-like multiplayer
10. ... This goes on for a while. Some smaller games, some Super Major^_^


Smaller technical milestones to start with (I know i said "no technical talk", but this is the extent of it)

101. Graphical window (Ok, it's not a game but i have to start somewhere right?)
102. Draw a triangle [Draw objects]
103. Pong, very hardcoded (No help from the game engine to make collision or so)

First game PONG :D

201. Textures
202. Simple physics (gravity, friction) collision
203. Player Controller
204. ...

First Platformer: Have a 1 Level platformer were i can jump onto objects and stuff. No enemies, no screenscrolling. Just a super simple platformer.

301. Animation
302. Add Screenscrolling
303. Static enemies
304. Super simple AI. (Move toward player)
305. ... Keep on adding so i can complete my list of games

This is of course not the full list, i just don't want to TL;DR.. If you are still here, you are the GREATEST!

Some concerns 


The more I complete games on my list, the longer it will take to complete the next one. The more powerful function, the longer it will take. Multiplayer for instance, is no easy task...

ADVICE

Am i on the right track?
Would you do something different?
What do you think will work, what is risky?
Have you tried making a game engine yourself? What kind of pitfalls did you encounter?

It’s not a bug, it’s an undocumented feature!

I'm not making an engine nor a game, more like experimenting with stuff in the general direction of being usable for some kind of game. With that said, the things you'll most likely end up having issues with is the general architecture of your engine, and scaling it up as needs grow. Making a pong clone doesn't require an engine at all. At most, it requires a FillRect function (my first ever game was also pong, and i did the entire thing using only the windows function FillRect, even the numbers). The smaller games need maybe a couple of functions for rendering, collision detection and that's it. That your engine.

My advice would be to not set yourself up in the mindset of "i wanna be a pirate make an engine", but rather, just make the small games with the least effort possible. If you start going all enterprise software on those simple games, making a bunch of infrastructure that you don't need for them, progress will seem slow, you'll lose motivation, and abandon another project.

The broad plan looks fine with games in sight, but just focus on building those games. Once you finish a game, start a completely new project, and copy over code that you can reuse to make the new game. Then when you finish the second game, start a completely new project, and copy over code that you can reuse from the second game. Rinse and repeat, and over time you'll just incidentally have grown an engine. And forget about multiplayer for the time being.That is a whole other ball game. Focus on making and being comfortable making single player games.

devstropo.blogspot.com - Random stuff about my gamedev hobby

Advertisement

Strewya has the right of this. Concentrate on making games, don't worry about making "an engine" for now; you will learn the skills to build an engine later - if that's still what you want to do - by making these games.

There was a similar kind of question some time ago in the Engines and Middelware Forum so you might read

https://www.gamedev.net/forums/topic/699905-writing-a-game-engine-need-beginner-ish-structure-advice/

and take a look what people gave advice for. It is mostly about the project and how to do the architecture arround it. You might have already seen those open source engines Urho3D, Unreal Engine and/or Cry Engine. They come along with a lot and I mean A LOT of tools and config arround their products to keep the code clean and maintainable

I have a piece of advice for you: don't call what you are doing "making a game engine". Instead, call it "making games without using an existing game engine". You will get better advice that way, with none of the "why you shouldn't make an engine" talk.

Other than that, I think that your approach of "make something small, then reuse code from it to make something less small, and so on" is a good one. Just make sure that the "small things" are small enough. Your current list looks good.

It's tough to make a game engine.
Since you're already hell-bent on this, my advice is:

  • Think of one basic game that you'd like to use on the engine, aim for that.
  • Implement the game, then generalize all the components, tear away the game-specific stuff.
  • Use your general components to implement a more complex version of the game, incorporate scripts etc outside the engine itself.
  • Don't focus on the rendering part until last (I personally get distracted and play around with physics and lighting for months, when I should be doing other, more fundamental things)
Advertisement

Thank you all for very helpful tips. In the past I've been making games "without a game engine". Even multiplayer once with custom protocols and fancy stuff. Now when i look back at it I did lot of things wrong, but I think I've learned from them.. Still a long way to go.

You'll are saying something that I really havn't thought of. I've always found that it's hard to reuse old code because it was too specific for that game. I have a tendency to clump things together. Guess I really should hammer in some principles in my head... 

SOLID
KISS
GRASP
DRY

So, I think I'm gonna do as you say. Make some games, save some functions in a collection that might someday turn in to something that's similar to a game engine.

It’s not a bug, it’s an undocumented feature!

This topic is closed to new replies.

Advertisement