How to make a 2D Game engine ?

How to make a 2D Game engine ?

Page 1 of 1

14 Replies - 39220 Views - Last Post: 26 October 2008 - 01:52 AM

#1 Gebbo  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 1
  • Joined: 14-March 08

How to make a 2D Game engine ?

Post icon  Posted 14 March 2008 - 09:44 AM

Hello i was wondering how would you make a 2D Multiplayer game engine in Visual Basic or Visual C++.. It has to be able to support multiplayer, render particles, sounds, compiling, e.x.e files e.t.c Ive done some programming similar to visual C++ but different so i can grasp how to do it fairly well..

I need to know if you have any tutorials..

Tutorials..
Compilers
Examples
How to e.t.c
Is This A Good Question/Topic? 1

Replies To: How to make a 2D Game engine ?

#2 aj32  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 30
  • View blog
  • Posts: 577
  • Joined: 30-August 07

Re: How to make a 2D Game engine ?

Posted 14 March 2008 - 03:59 PM

You could try the "DarkGDK" for Visual Studio 2008, but I'm not quite sure if that's exactly what you need! :)
Was This Post Helpful? 0
  • +
  • -

#3 autodog  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 10
  • Joined: 24-May 08

Re: How to make a 2D Game engine ?

Posted 24 May 2008 - 09:11 PM

Or search for XNA Game Studio

This post has been edited by autodog: 24 May 2008 - 09:32 PM

Was This Post Helpful? 1

#4 yanom  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 70
  • Joined: 05-April 08

Re: How to make a 2D Game engine ?

Posted 25 May 2008 - 04:54 PM

You want to make a 2d mmorpg, don't you
Was This Post Helpful? 0
  • +
  • -

#5 autodog  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 10
  • Joined: 24-May 08

Re: How to make a 2D Game engine ?

Posted 28 May 2008 - 05:11 AM

View Postyanom, on 25 May, 2008 - 04:54 PM, said:

You want to make a 2d mmorpg, don't you

Does it really matter if he wants to create a 2d mmorpg or not? He/she will come to some kind of conclusion about his/hers idea
Was This Post Helpful? 1
  • +
  • -

#6 KYA  Icon User is offline

  • g++ jameson.cpp -o beverage
  • member icon

Reputation: 3105
  • View blog
  • Posts: 19,144
  • Joined: 14-September 07

Re: How to make a 2D Game engine ?

Posted 29 May 2008 - 03:15 AM

A whole is the sum of its parts. An engine, if broken down is really a bunch of code handling all possible needs of a video game. You need a game loop and each cycle takes care of sound, graphics, etc...
Was This Post Helpful? 0
  • +
  • -

#7 Tom9729  Icon User is offline

  • Segmentation fault
  • member icon

Reputation: 180
  • View blog
  • Posts: 2,641
  • Joined: 30-December 07

Re: How to make a 2D Game engine ?

Posted 29 May 2008 - 10:44 AM

If you have to ask, it's beyond your abilities. :)
Was This Post Helpful? 1
  • +
  • -

#8 mensahero  Icon User is offline

  • I Desire...
  • member icon

Reputation: 17
  • View blog
  • Posts: 678
  • Joined: 26-May 08

Re: How to make a 2D Game engine ?

Posted 01 June 2008 - 11:08 AM

View PostTom9729, on 29 May, 2008 - 10:44 AM, said:

If you have to ask, it's beyond your abilities. :)


hmm.. nice quote.. made me think a lot.. :rolleyes: good for sigz..
Was This Post Helpful? 0
  • +
  • -

#9 Tom9729  Icon User is offline

  • Segmentation fault
  • member icon

Reputation: 180
  • View blog
  • Posts: 2,641
  • Joined: 30-December 07

Re: How to make a 2D Game engine ?

Posted 01 June 2008 - 11:36 AM

View Postmensahero, on 1 Jun, 2008 - 11:08 AM, said:

View PostTom9729, on 29 May, 2008 - 10:44 AM, said:

If you have to ask, it's beyond your abilities. :)


hmm.. nice quote.. made me think a lot.. :rolleyes: good for sigz..

It sounds a little snobby I know, but you don't see Gabe Newell asking on internet forums how to write the engine for Half-Life 3 (just a hypothetical example). :)
Was This Post Helpful? 1
  • +
  • -

#10 Tom9729  Icon User is offline

  • Segmentation fault
  • member icon

Reputation: 180
  • View blog
  • Posts: 2,641
  • Joined: 30-December 07

Re: How to make a 2D Game engine ?

Posted 01 June 2008 - 11:44 AM

Edit: Oops, usually this forum concatenates two consecutive posts by the same user. Please read this as a continuation of my last post. :)

Something like writing a game engine just starts to make sense once you have (at least) some of the skills necessary. Most of the people asking how to write a MMORPG on this forum have little to no programming experience, and somehow think that just because something is graphical (as opposed to writing something like Checkers for the commandline) it'll be really easy.

The people who are writing games and game engines don't need to ask where to start. Not to say that they won't ever need help (man, Google and C reference books are helpful), but when they do it's usually for very specific problems.

This post has been edited by Tom9729: 01 June 2008 - 11:46 AM

Was This Post Helpful? 0
  • +
  • -

#11 Rickster0  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 16
  • View blog
  • Posts: 236
  • Joined: 08-July 08

Re: How to make a 2D Game engine ?

Posted 30 August 2008 - 03:37 PM

first things first

google vbGore this is EXACTLY what you are trying top achieve go on the forums and ask around...

i did it and they where very helpful
Was This Post Helpful? 0
  • +
  • -

#15 5thWall  Icon User is offline

  • Occasional Member

Reputation: 31
  • View blog
  • Posts: 530
  • Joined: 17-September 08

Re: How to make a 2D Game engine ?

Posted 19 September 2008 - 11:50 PM

I don't really know any API's unless you're willing to learn a new, little known, language. However I did take a game programming class last semester and know some of the basics. It sounds like you're at about the same point I was before I took the class.

Anyway the first thing you'll need is, as KYA said, a game loop. A method that get's called 60 or so times a second is good. Then just have that method update the objects in your game as needed. Though if you stop here and just do that you'll become overwhelmed quickly. So the next thing you should implement is...

A state machine. Think about what sort of states and sub-states your game will have. So like your title screen would be one state, the main menu would be another, actual gameplay would be another state (most likely with a handful of sub-states). Have something like an enumeration represent any possible state your game could have and then use a big case switch statement in your game loop to only update the objects needed in each state, including transitioning to another state.

One more thing I'd like to show you to make wrapping your head around everything that makes a game a little easier is the Model, View, Controller architecture. Basically what you want to do is divide the execution of your game into three roles.
  • The Model, which will hold most of your game objects, and the methods that govern their interactions.
  • The View, which will render a snapshot of the model at any given time. I recommend giving this it's own loop (draw loop) similar to the game loop I mentioned earlier.
  • The Controller, which should be the main part of your application. Have it hold both game and draw loops, as well as the current state of the game. All your UI should be dealt with by the controller.
Make each of these an object and only have them deal with their assigned roles.

That should get you started. You'll have to look for tutorials on how to implement each of these in your language of choice, but at least now you know what to start looking for. Once you have your MVC, state machine and loops set up work on one state and role at a time.

Good luck and happy programming. :)
Was This Post Helpful? 1

#16 Noldona  Icon User is offline

  • Addicted to DIC

Reputation: 5
  • View blog
  • Posts: 1,051
  • Joined: 02-July 02

Re: How to make a 2D Game engine ?

Posted 22 September 2008 - 09:36 AM

Like KYA and 5thWall said, use a main game loop and have it call functions that handle updating stuff like graphics, sound, get input, etc.

You will want to use some sort of library to make things easier. I suggest SDL or DirectX. DirectX is a very popular one for Windows based systems. SDL is a open-source, cross-platform library that does everything DirectX does, and seems a little simpler to understand to me. The only exception for SDL is it does not do 3D by itself. It works with OpenGL (another open-source, cross-platform library) to handle the 3D. SDL is written in such a way as to work with OpenGL making it easy to use too. Since you want a 2D game engine, you can just use the 2D stuff built into SDL without having to worry about OpenGL stuff or the 2D stuff in DirectX.

Both libraries have their good and bad points and both work equally well. It really is a matter of preference which one you use. As a supporter of open-source software, cross-platform software, and re-usability of code, I personally would go with SDL and write my game engine in such a way as to make it easy to upgrade to a 3D engine at a later date.
Was This Post Helpful? 1

#17 IngusJinx  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 01-October 08

Re: How to make a 2D Game engine ?

Posted 01 October 2008 - 02:53 PM

View Postyanom, on 25 May, 2008 - 04:54 PM, said:

You want to make a 2d mmorpg, don't you



I want to create one and evolve it into 3D, problem is i need somebody to help with coding and expert most likely and possibly a 3D artist of a good free program. I have good knowledge of how to use XNA and want to make an mmorpg or just an rpg can you help at all??
Was This Post Helpful? 0
  • +
  • -

#18 Rickster0  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 16
  • View blog
  • Posts: 236
  • Joined: 08-July 08

Re: How to make a 2D Game engine ?

Posted 26 October 2008 - 01:52 AM

http://vbgore.com/Main_Page

this is what you are looking for.. try and download the open source version where you can look at the coding yourself

that will give you a helping hand
Was This Post Helpful? 1
  • +
  • -

Page 1 of 1