Skip to main content
GameDev.net gamedev.net
🔒 Locked

About 2D Engines

Started by elle_lawliet Jan 2, 2012 at 4:54 PM 9 replies 2.4k views
Original Post
elle_lawliet
elle_lawliet
Hi!

I want to make a 2D game and I can't completly understand the concept of "game engine". So, the questions are:

If I use a 2D game Engine

-Can I know if a character is in front of an item without a lot of programming?
-Can I know if a character in front of a hole (and can't keep walking)?
-Can I change a room ilumination?
-Can I know if a character has passed through a door and I have to change the scenario?

Basically, are those things something that an engine could resolve? Do I need to code them?

I want to learn more about game engines but I couldn't answer those questions with the info I found.


Also, please tell me if you know about a free 2D game engine with DirectX9 support and complete documentation.

Thanks for your time smile.png
Programming020195BRook
Programming020195BRook
Your question entirely depends on what "Engine" you're using. I look at an Engine as the barebone components from a given game, or a generic structure to form a given game. Which means you could have a "2D Plat-former Engine" which has all of the code setup for input, collision, jumping, ect...

There are a lot of 2D Engines, and tools out there; however you need to state which language you will be using.
Florian22222
Florian22222

Hi!

I want to make a 2D game and I can't completly understand the concept of "game engine". So, the questions are:

If I use a 2D game Engine

-Can I know if a character is in front of an item without a lot of programming?
-Can I know if a character in front of a hole (and can't keep walking)?
-Can I change a room ilumination?
-Can I know if a character has passed through a door and I have to change the scenario?

Basically, are those things something that an engine could resolve? Do I need to code them?

I want to learn more about game engines but I couldn't answer those questions with the info I found.


Also, please tell me if you know about a free 2D game engine with DirectX9 support and complete documentation.

Thanks for your time smile.png


1. You have to draw the character after all the other stuff.
Implementing an z-axis or a draw-order would help you.

2/4. Collisiondetection in 2d is mostly really simple. You only need to check the boxes for a collision. This is solved by nearly every engine.

3. Illumination is an advanced technique but, sure, there are some engines that support this.
elle_lawliet
elle_lawliet
Thanks for the answer!

I've found 2 or 3 useful engines, but they hadn't documentation.

I will use C++ with DirectX 9.0.

In the game you will have to solve puzzles in rooms (like Resident Evil 1, but the view is from above the character and it's not 3D) and it will not have any battle/combat.

Edit

@IceBreaker23

Thanks for the answer.
The problem with 2/4 is that I have lots of items in the same scenario. Do I need to check the x-y axis of all items in oder to know which one I am picking?
I do the colission detection with a DirectX function.
elle_lawliet
elle_lawliet
I'm studying Software Engineering and we always use C++ or Java, so I have a long time programming with C++, but we usually don't use it for game programming.
The only games I have done are simple games like a multiplayer tetris, and other games with bitmaps.

I want my game to be something like this (but obiously, different)

[media]
[/media]

Is the Irrlicht Engine good for that king of game?

I don't know if it's ok to post videos. If not, please let me know
Programming020195BRook
Programming020195BRook
Yes, it should do just fine. Your best bet is to just dabble in any selected engine and see if you like it. Heck, you could even make that game using GameMaker if you wanted. Tools are nothing more than tools. You could have all the best wood working tools in the world, but if you're unable to utilize them properly, it means nothing.

For a 2D game simliar to the one you showed, why not use SDL, Allegro, or SFML?
elle_lawliet
elle_lawliet
I'm using DirectX becouse I'm still learning about it and I want to practice it.

SDL seems easy to work with, I'll keep that in mind.
I made a simple game in Allegro about a year ago, but I forgot almost everything about the syntax so I just have to learn it again.

I'm going to start reading the tutorials of the engine you gave me, but also I want to discover if I can code the points 1 2 3 and 4 by my own (I think I will learn a lot if I do it).
Florian22222
Florian22222

@IceBreaker23

Thanks for the answer.
The problem with 2/4 is that I have lots of items in the same scenario. Do I need to check the x-y axis of all items in oder to know which one I am picking?
I do the colission detection with a DirectX function.


If you are testing 100 objects with one point you´ll need 100*4 int-compares(normally a bounding box does it). ( x1 >= x2 && y1 >= y2 && x1 <= x2+width && y1 <= y2+height)
But why would you want to make 100 objects on a single screen? Furthermore a modern pc will handle this, I think.

Keep in mind that you are only using 2D and this with c++, a really fast language. Modern 3D games do much more on the CPU in one frame.

Hope I could help you!
Burnt_Fyr
Burnt_Fyr

[quote name='elle_lawliet' timestamp='1325526098' post='4898994']
@IceBreaker23

Thanks for the answer.
The problem with 2/4 is that I have lots of items in the same scenario. Do I need to check the x-y axis of all items in oder to know which one I am picking?
I do the colission detection with a DirectX function.


If you are testing 100 objects with one point you´ll need 100*4 int-compares(normally a bounding box does it). ( x1 >= x2 && y1 >= y2 && x1 <= x2+width && y1 <= y2+height)
But why would you want to make 100 objects on a single screen? Furthermore a modern pc will handle this, I think.

Keep in mind that you are only using 2D and this with c++, a really fast language. Modern 3D games do much more on the CPU in one frame.

Hope I could help you!
[/quote]

This is also where specialized scene hierarchies, such as quadtrees can help. But again, modern computers are more than capable of handling a load like this.
elle_lawliet
elle_lawliet

[quote name='elle_lawliet' timestamp='1325526098' post='4898994']
@IceBreaker23

Thanks for the answer.
The problem with 2/4 is that I have lots of items in the same scenario. Do I need to check the x-y axis of all items in oder to know which one I am picking?
I do the colission detection with a DirectX function.


If you are testing 100 objects with one point you´ll need 100*4 int-compares(normally a bounding box does it). ( x1 >= x2 && y1 >= y2 && x1 <= x2+width && y1 <= y2+height)
But why would you want to make 100 objects on a single screen? Furthermore a modern pc will handle this, I think.

Keep in mind that you are only using 2D and this with c++, a really fast language. Modern 3D games do much more on the CPU in one frame.

Hope I could help you!
[/quote]

Yes, all the information was helpful.
Now I'm thinking to leave the engine for something more complex and to develop those functions by myself. However I'm going to download the engine, it will be useful in the future.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.