need help, how to make a 2d Game Engine in theory?

Started by
5 comments, last by ozwizm 10 years, 4 months ago

Hey everyone, I'm new here and also not even close to a professional game programmer (yet, hopefully i will be eventually). I've been really wanting to learn how to build a simple 2d game engine from scratch recently, but I just cant figure out how to go about doing it. All I want to know from this post is what components I should put into the game engine, and how I should go about doing that (meaning what order to program the components in). I want to make this really simple at first, maybe just enough so that I could make a pong game or something, and then from there build it up until I can make a 2d tiled rpg.

Thanks in advance for taking the time to read this and hopefully reply!

Advertisement

http://scientificninja.com/blog/write-games-not-engines

You should not aim to write an engine but write games.

An engine is just a collection of reusable components. The best way to develop these components and to create something that is actually worth using is to have the features develop organically over the course of using them in an actual game.

So create a game and factor out the parts that are generic enough to be reused (it may not be much at once), and then repeat for many games. Eventually you will have a set of components that can be used for other games.


You should not aim to write an engine but write games.

Ok, that seems like pretty good advice, thanks for replying, but if that's the case then where should I start? My ultimate goal in the end is a 2D rpg in the style of Secret of Mana, or Legend of Zelda, or something along those lines. But what kind of game should I make first, that I can later reuse some of the code to make something more advance and then continue until I reach my goal?

To answer this question it would be useful to know what kind of experience you have. What kind of experience do you have programming wise? What programming languages have you worked with (if any) and what do you plan to use for this game? Have you made any games at all before?


You should not aim to write an engine but write games.

Ok, that seems like pretty good advice, thanks for replying, but if that's the case then where should I start? My ultimate goal in the end is a 2D rpg in the style of Secret of Mana, or Legend of Zelda, or something along those lines. But what kind of game should I make first, that I can later reuse some of the code to make something more advance and then continue until I reach my goal?

The most frequent advice is to start with pong. With pong you prove that you can draw images to the screen, move images according to player input, play music and sound fx (optional but recommended), and maybe even do scene management.

Then you could move on to breakout or tetris. What functionalities can you reuse from your pong game? Well probably the code for creating a window, creating a sprite, playing sound effects, ect... but you probably will have to do some cleanup of it to make it more reusable.

After that you could make a side scroller like Mario. That will involve creating a tile engine, loading some sort of level format, and will get you thinking about scrolling.

The above is by no means the only way to start making your game, but it is a potential way.

It is all about breaking the problems down into small chunks.

By the sound of your post, it seem like you have made betweeen 0 and 1 game. if thats the case. then you should start writing games instead of engines.

If im wrong on the other hand you could pick up some reading, I have read this one

http://www.amazon.co.uk/Advanced-Game-Development-Jonathan-Harbour/dp/1598633422/ref=sr_1_1?ie=UTF8&qid=1385805770&sr=8-1&keywords=advanced+2d+engine+programming

it's directx and c++. but no mather what language you use, there are some good points in the book, and gives some idea of what a simple 2d engine requires. and even though it says advanced, its actually not.

www.mojostudios.dk

New Relealse - Rainbow Run (IOS, Android)

Get it on Play store

Get it on App store

Hey, thanks everyone for replying.

To answer this question it would be useful to know what kind of experience you have. What kind of experience do you have programming wise? What programming languages have you worked with (if any) and what do you plan to use for this game? Have you made any games at all before?

I have been attempting to learn how to program since 7th grade in middle school, (I'm a senior in high school now). So I have some experience. I've made pong by myself in c++ with SDL last year without any tutorials, I've made a few games with flash and actionscript before, I've made a bunch of text-based console window games in C++, and now I've switched over to Java because I find it a bit easier to set up.

I found a tutorial series on youtube last night for making a very simple version of a top-down shoot 'em up game. I decided to give that a try, but to also take the advice I heard somewhere else, which is to make the game as fully as possible and very polished before moving on to the next game. So I plan to take the game I get out of that tutorial series and improve it until I get something hopefully as cool as those Japanese vertical scrolling shmups.

This topic is closed to new replies.

Advertisement