Sign in to follow this  

In need of some answers

This topic is 1995 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

[size=4]Before anything, my name is João, i'm 19 years old and i have been learning about game development by myself for some time. I was born and live in Brazil, so i ask that you forgive my innacurate english. Though i try to learn everything i can about all the roles involved in the process of the creation of a game, the role that interest me the most is the one of the programmer. For a year i have been buying books, trying to learn C++ and really get something going but some stuff remained unclear and i would appreciate if you guys helped me out and explained them to me:

1. After realizing that i have a good understanding of C++, which path would be better to chose in the attempt to develop a 2D game?
Direct X? OpenGL? Allegro? Which books would you recommend to someone that knows enough C++ to get a 2D game going?

2. In my understanding, 2D games are made of "images" rather than polygons. Is there a right way to create/draw these images for
a game? What i mean is, what are the advantages and disadvantages in using pure drawings as characters, objects, structures and
landscape? And what are the advantages and disadvantages in using tiles, pixel-like images as characters, objects, structures and land-
scape? Two more questions: how to create/draw these images in order for them to fit perfectly while designing the levels of the game,
be they the streets of a city, a frozen jungle or a spaceship? And how, with which software, create/draw these images in order for them
to appear pixel-like as the sprites used in old SNES games? Pixel Art is the only way to create these images?

3. Even though i still don't know enough C++ and all the stuff that you need to know to start developing games, i have a friend who is a
very good artist and he is very interested in creating art for games. Both of us love 2D graphics (old SNES RPGs, Baldur's Gate,
Grandia, Alundra), but we have a question about how these images are manipulated by the "game engine". Let's say my friend comes
and shows me this drawing of a dark alley (the drawing below is not my friend's):

[url="http://fc00.deviantart.net/fs45/f/2009/095/b/2/Dark_Alley_by_Hideyoshi.jpg"][img]http://fc00.deviantart.net/fs45/f/2009/095/b/2/Dark_Alley_by_Hideyoshi.jpg[/img][/url]

How to establish where the player would be able to walk and where he wouldn't? How to define with which objects the player would
be able to interact and with which they wouldn't? Similarly, if my friend made a character like this one (the character below is not
my friend's):

[img]http://cdn.wikimg.net/strategywiki/images/c/c0/EB_Insane_Cultist.gif[/img]

How to draw the character in order for him to remain proportional in all angles and positions? What's the right way (or better way) to
create/draw a 2D character in order for him to remain proportional in all angles, positions and poses?


Thanks to the community, in advance.[/size]

Share this post


Link to post
Share on other sites
I forgot to mention that i have already looked for this information in many books but most of them only deal with 3D graphics, modelling, texturing and stuff like that. I would go and try to learn Pixel Art if there were good Pixel Art books, but i have searched and didn't found any book seriously dealing with the subject, and the tutorials i have found are very vague and don't do a good job at really teaching it. Even if i tried to learn through these tutorials by my own, they are not focused in making art for games, therefore, they wouldn't teach me the technical aspects i mentioned above (proportion, sprites, tiles, backgrounds, size of the image, animation, and so on...).

Share this post


Link to post
Share on other sites
[quote]How to establish where the player would be able to walk and where he wouldn't? How to define with which objects the player would
be able to interact and with which they wouldn't?[/quote]
This is a difficult problem which involves pattern recognition. Without clear depth information you can only use heuristic algorithms to determine how far an object may be (for instance, looking at the color of two neighbouring pixels and determining the parallax delta to calculate the 3D "slope" at that point, and reconstructing depth from there). Usually - if I understand what you mean - these types of images are typically composited from multiple smaller images (for instance the image of the alley itself, which is "far away" and then the image of the dumpster is drawn on top of that, and is "closer").

[quote]How to draw the character in order for him to remain proportional in all angles and positions? What's the right way (or better way) to
create/draw a 2D character in order for him to remain proportional in all angles, positions and poses?[/quote]
I don't understand, do you mean in 3D? In two dimensions, rotation and translation preserves area. Can you describe what you are looking for?

Share this post


Link to post
Share on other sites
These things are pretty hard to explain, because these are not specific questions, and you have to have a level of abstraction to understand them.

Some of the more specific questions:

[quote name='Mijojo' timestamp='1340942624' post='4953828']
How to establish where the player would be able to walk and where he wouldn't? How to define with which objects the player would
be able to interact and with which they wouldn't?
[/quote]
Usually you have some kind of editor, with which you can edit levels. they are separate programs from the actual game, they can be 2D/3D, they can come with the engine you are using, they can be a separately programmed simple tool. Or you can even use notepad and type all the stuff in.
In an editor, you place objects, which have abstract properties that you, as the game programmer decide/choose. Levels are loaded from a file, and you can use whatever convention of coding to "read" the necessary things.

It's usual that defining "interaction" is somewhat different than defining the looks. Often you have simplified geometry that you use for interaction. This geometry is not visible.

(look into "collision detection" "collision geometry" "collision mesh")

The editor saves the data as a file. The format of the file is decided by the programmers/designers. There is a coding convention for the format, you save with this code, so you can decode it in the game.

[quote name='Mijojo' timestamp='1340942624' post='4953828']
Similarly, if my friend made a character like this one (the character below is not
my friend's):
How to draw the character in order for him to remain proportional in all angles and positions? What's the right way (or better way) to
create/draw a 2D character in order for him to remain proportional in all angles, positions and poses?
[/quote]

Well, that's not a programming question, that's an art question that depends on the skills of the artist. It requires practice, some learning of animation, anatomy, etc. There are tools for it, these are usually commercial ones, since a lot more people make art than games.
The artist can use whatever she wants to aid her work. she can use reference photos of a moving person, she can actually make these photographs herself. She can even do real sculpting of clay, so it's easier for her to make the images "remain proportional in all angles and positions". Or simple drafts with paper and pen.
She can then use these images as references, she can even manipulate the shit out of the images to produce the game art.



to sum it up: just do it, it's no magic. Practice. Edited by szecs

Share this post


Link to post
Share on other sites
After I've learned what I needed in C++, I moved on to allegro. It's a great library for 2D games.
My problem was that I later realized that I want to have some 3D aspects in my game and that it is very hard to achieve in allegro.

I've tried SDL after allegro, but it seemed too complicated for me. A too big of a jump, especially the win32 part was overwhelming.

It just happened that I found the right website where everything regarding win32 and DirectX was explained in detail.
So right now, I'm working with directX.

Share this post


Link to post
Share on other sites
Win32 programming seems overwhelming at first but it's really very simple when you get past that. It's because they typedef lots of stuff and use lots of structures to fill in that a hello world program has so many lines but after that you'd always use that same framework to build other programs. The main thing to understand is the message loop and callback function.

If they hadn't typedefed so much stuff then the way you can see winmain is that it returns an int and takes four ints as arguments. In assembler this is really what happens. Wndproc also takes a few ints and these are the messages that you dispatch to different cases in a giant switch statement.

Share this post


Link to post
Share on other sites
I suggest people look into using SFML for 2D game programming, It has a great interface, and all the 2D API's are available and are performed in HW, unlike SDL (SFML actually sits on top of OpenGL).

SFML also provides other API's to control every other part of a game: Input, Windows, Audio, and networking. So, check out [url="http://sfml-dev.org"]sfml-dev.org[/url] and see if it's what you are looking for.

Share this post


Link to post
Share on other sites
Bacterius:

[quote]
[left][background=rgb(250, 251, 252)]This is a difficult problem which involves pattern recognition. Without clear depth information you can only use heuristic algorithms to determine how far an object may be (for instance, looking at the color of two neighbouring pixels and determining the parallax delta to calculate the 3D "slope" at that point, and reconstructing depth from there). Usually - if I understand what you mean - these types of images are typically composited from multiple smaller images (for instance the image of the alley itself, which is "far away" and then the image of the dumpster is drawn on top of that, and is "closer").[/background][/left]
[/quote]

So you mean the way that is usually done is by placing images on top of each other and implementing each of them separately? If that's what you mean, i think it's a cool solution to the problem of, for instance, being able to open and examine things along the way. But what about the problem of the path? I mean, i don't understand how it is done, but would it be like creating the path in the code itself? Like "In this part of the image the character will be X size. As he moves away from the "camera", his size wil decrease. As he moves closer to the camera, his size will increase. In that part, and that part the character won't be able to walk since those are objects blocking the path." Another question: how to define which objects will be in front/behind the character and when?

[quote]
[left][color=#282828][font=helvetica, arial, verdana, tahoma, sans-serif][size=3][background=rgb(247, 247, 247)]How to draw the character in order for him to remain proportional in all angles and positions? What's the right way (or better way) to[/background][/size][/font][/color][/left]

[left][color=#282828][font=helvetica, arial, verdana, tahoma, sans-serif][size=3][background=rgb(247, 247, 247)]create/draw a 2D character in order for him to remain proportional in all angles, positions and poses?[/background][/size][/font][/color][/left]
[/quote]

What i really want to know is if there is any source (a book, or a website) that really takes 2D graphics seriously and explain the technical aspects of it, like "to make the sprites of you character proportional in all angles and poses, you have to follow this and that rule", things like that.

szecs:

[quote]
[left][color=#282828][font=helvetica, arial, verdana, tahoma, sans-serif][size=3][background=rgb(250, 251, 252)]Usually you have some kind of editor, with which you can edit levels. they are separate programs from the actual game, they can be 2D/3D, they can come with the engine you are using, they can be a separately programmed simple tool. Or you can even use notepad and type all the stuff in.[/background][/size][/font][/color][/left]

[left][color=#282828][font=helvetica, arial, verdana, tahoma, sans-serif][size=3][background=rgb(250, 251, 252)]In an editor, you place objects, which have abstract properties that you, as the game programmer decide/choose. Levels are loaded from a file, and you can use whatever convention of coding to "read" the necessary things.[/background][/size][/font][/color][/left]


[left][color=#282828][font=helvetica, arial, verdana, tahoma, sans-serif][size=3][background=rgb(250, 251, 252)]It's usual that defining "interaction" is somewhat different than defining the looks. Often you have simplified geometry that you use for interaction. This geometry is not visible.[/background][/size][/font][/color][/left]


[left][color=#282828][font=helvetica, arial, verdana, tahoma, sans-serif][size=3][background=rgb(250, 251, 252)](look into "collision detection" "collision geometry" "collision mesh")[/quote]

I'll look into it.[/background][/size][/font][/color][/left]

theo2005, Fredericvo, BeerNutts:

All of you suggested different API's or "engines", but what i really want to know is what are the advantages/disadvantages of them and which of them best suits my needs (a 2D game like Super Mario RPG).

Share this post


Link to post
Share on other sites
The win32 API isn't really an engine. It's relatively close to the metal. What you need depends on how far you want to adventure under the hood or how fast you want to get visible results on your screen. If it's the latter then you should go for unity. If you want to dig a bit deeper and closer to the metal but without feeling overwhelmed then maybe something like SDL. Are you very adventurous? DirectX/OpenGL.

Share this post


Link to post
Share on other sites
[quote name='BeerNutts' timestamp='1340997579' post='4954044']
I suggest people look into using SFML for 2D game programming, It has a great interface, and all the 2D API's are available and are performed in HW, unlike SDL (SFML actually sits on top of OpenGL).

SFML also provides other API's to control every other part of a game: Input, Windows, Audio, and networking. So, check out [url="http://sfml-dev.org"]sfml-dev.org[/url] and see if it's what you are looking for.
[/quote]

I'd put another vote in for SFML. It's amazing, and it's API is very intuitive. Just make sure you use the upcoming 2.0 version rather than the outdated 1.6 version.

Though as an extra, I'm pretty sure the latest SDL runs on the hardware a well. So their won't be much of a performance difference between the two. Though it looks like SDL implements a C-like interface, whereas SFML implements a very OOP C++ interface.

Share this post


Link to post
Share on other sites

This topic is 1995 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this