Sign in to follow this  
lajoseph

what do I need for 2D RPG programming?

Recommended Posts

First off, I'm familiar with programming games in c++ in Dos (text-based), and now I want to climb up that next step, 2D programming! Only thing is there's so much confusion about which languages to use on the net, I started off thinking I had to learn 8 programming languages!!! so far I've understood the best languages to use with C++ is DirectX grafics... but if you could help me on this topic that would be GREAT! so the question is really do I only need to learn C++ and DirectX grafics/Draw/3D? or do I need to learn about win32 too? Thank you!

Share this post


Link to post
Share on other sites
There wasn't really needing to use directx, for instance im playing and old 2d rpg (Castle winds) that use only icons and gdi graphics.

The trouble is not to learn directdraw (the part of directx that you will need it) but the graphics, even a simple 2d rpg need a lot of tiles and graphics.

Share this post


Link to post
Share on other sites
So I should learn myself some Direct Draw, and start freshening up my drawing skills? =P
and also, I don't need to worry about win32, do I? I just heard you indirectly learn win32 when you learn directX... anyways, I heard it wasn't nessecary.

gracias por la ayuda ;)

Share this post


Link to post
Share on other sites
Quote:
Original post by eng3d
The trouble is not to learn directdraw (the part of directx that you will need it)


Need? DirectDraw is deprecated. It's old. Direct3D is more than capable of 2D graphics and won't be harder to learn.

Yes, you do need to know Win32 to program with DirectX. However, you don't need to know a whole ton of it. I've not used DirectX myself, but IIRC, only creation of a window needs to be handled by Win32. The rest can be done with various parts of DirectX.

You can also use OpenGL. It's similar to Direct3D, but you'll have to use something like SDL (which I highly recommend) or Win32 for the non-graphics parts (eg: window creation, input, sound, ect.).

And the most important thing to have is patience and hard work. Sorry, there's no library for that. [smile]

Share this post


Link to post
Share on other sites
Thanks Ezbez & NerdInHisShoe.

But DirectX in comparison to SDL and those other languages is constant in relations with windows... or so I hear!
I've heard that you have to update your skills with a language for each time a new windows version comes out, but DirectX however I've heard doesn't change, thus you can forget about that hassle.

but so you reccomend me to learn Direct3D for 2D-programming? sounds strange =P
but I understand, haha.

so conclusion equals: to make a 2D-game with C++, you should learn enough win32 to open windows and make bars (file, edit, help...) and also learn Direct3D for the grafics-part.

does that sound like a winner?

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
There are a number of options available to you, and you certainly won't be worse off for learning a little bit about several of them. As has already been stated, several popular options are:

- DirectX - this has everything you'll need, but is Windows specific
- OpenGL - I would suggest using SDL, and probably OpenAL, along with this. OpenGL only performs graphics operations. SDL can be used for window creation (win32 can be a bit of pain if you've never used it), keyboard input, mouse input, event handling, and sound. Its pretty easy to get up and running. OpenAL is similar to OpenGL, but is for sound.
- SDL - SDL can also perform all of its own drawing functions, if you'd rather use them than OpenGL

A couple other options:
- Allegro - haven't really used this one, but it sounds like it has a cult following
- XNA - I don't know a whole lot about this, but its quickly becoming popular

Also, you don't necessarily need to use C++. C# can be used with DirectX, OpenGL, and SDL without any problems, and C# is easy to pick up if you've got a background in C++ or Java. It will also greatly speed up your development time.

Several scripting languages could also be used, considering a 2D RPG probably won't have massive performance requirements. Python, PyGame, and PyOpenGL are all excellent in this regard. I've also heard good things about Ruby and OCaml, and I believe both can use OpenGL.

Share this post


Link to post
Share on other sites
Thank you Anonymous Poster(,I'll just call you Joe)

by saying that DirectX is windows specific, does that mean that I can't make games for linux, apple, and so on..?
if so I'd probably want to learn OpenGL instead of DirectX? just to keep the possibilities open...
And by the way, I jumped straight on learning C++, people said I should learn C# to get "warmed up" for C++. but it worked out for me... but are you saying that programming with C# is faster than with C++??

Share this post


Link to post
Share on other sites
Guest Anonymous Poster

Quote:
Original post by lajoseph
by saying that DirectX is windows specific, does that mean that I can't make games for linux, apple, and so on..?

Correct. DirectX is only usable on Windows. However, if you only plan on ever using your programs on that platform, DirectX is probably the way to go. Otherwise, you'll need to use a cross platform API, like OpenGL and/or SDL.

Quote:
Original post by lajoseph
And by the way, I jumped straight on learning C++, people said I should learn C# to get "warmed up" for C++. but it worked out for me... but are you saying that programming with C# is faster than with C++??

I'm not saying C++ is a bad language, but there are a lot of C++ zealots who believe that it should be used for EVERY situation. C++ certainly has the power to do that, but that power means a lot of work is pushed off on to the programmer. Use the language that best fits the problem. I believe this to be one of the most important rules of programming.

C# removes a considerable amount of the lower level problems associated with C++, particularly memory management. Without needing to worry about these sort of things, not only do you have less work to do, but a rather large number of bugs will be immediately taken out of the potential 'bug pool'. C#'s performance is comparable to C++ in all but the most extreme cases.

Share this post


Link to post
Share on other sites
ok, great! thanks for your post, Joe!
in spite for C++'s infamous bug-pool, I think I'll go with C++. Because I'm planning on getting into the game-producing business, and I've heard most game-companies make them with C++.
And I've never, ever even touched a computer that runs with linux or apple =P
so for the sake of simplicity I'll go with DirectX, and if I find it necessary I'll learn OpenGL and OpenAL later...

Thanks for your help guys! it really made things more understandable!
but do you guys know about any good books for learning C++, DirectX, gameprogramming?
or even just mention which books you've read to be able to program... thanks!

And what kind of compiler programs do you guys use? I use VC++ 6.0, is that alittle old maybe? which is the best?

Share this post


Link to post
Share on other sites
I am staring to do exactly what you're doing. I found that I started using Haaf's Game Engine (http://hge.relishgames.com/) and within a few hours I was writing gameplay scripts for my RPG. But yeah, you're going to need a considerable amount of art. A great place to look for some is the open art people post. Make sure to check that they allow unlimited, unrestricted use of the art and all, but then you should be set.

Share this post


Link to post
Share on other sites
C++ suits you
Why? because I think you have in mind to make a game like "Age of Empires" or so
In those games, you'll need to write AI, and pathfinding algorithms. They need a lot of processor power (C++ is the fastest) and there is a lot of research.
Download Visual C++ Express 2005, Platform SDK and DirectX SDK for free.

Here are some links to cover the basics:

http://msdn.microsoft.com/vstudio/express/
http://msdn.microsoft.com/directx

Hope it helps
Dark Sylinc

[Edited by - Matias Goldberg on March 17, 2007 3:54:17 PM]

Share this post


Link to post
Share on other sites
Remember to keep things simple. You could use Direct3D for 2D graphics, but you still really need to know most of Direct3D to get that done. I would highly recommend using something that handles most of the "useless" details.

SDL would be my recommendation while you use C++.

C# is an option, it is a language that takes a lot of the tedium out of programming. But you will have to learn the new language before trying a game, so if that sounds good you should get to that first. If you do use C#, there are two good options: XNA is from Microsoft and will let your game run on Windows and XBox 360s, and SDL.Net which runs on at least Linux and Windows (maybe Macs too, not sure).

Share this post


Link to post
Share on other sites
Thanks Matias Goldberg!
I'll download "Visual C++ Express 2005" and use it.
but I'm not going to make a game like "Age of Empires", isn't that an RTS game?
I'm gonna make a game sorta like Pokémon, except for you're one person without those 150 monsters following you around =P

and chaospilot, could I have your e-mail-adresse? it'd be great to have a friend to share knowledge and techniques with about game-programming.

intrest86, thanks for the tip, but I'm planning on taking up 3D programming after a couple of 2D games. Doesn't SDL only support 2D grafics?
but thanks!

Share this post


Link to post
Share on other sites
Quote:
Original post by lajoseph
intrest86, thanks for the tip, but I'm planning on taking up 3D programming after a couple of 2D games. Doesn't SDL only support 2D grafics?
but thanks!


The SDL drawing operations are only 2D, but you can use OpenGL for any graphics you may need. Infact using OpenGL for 2D would probably be faster than relying on SDL for drawing.

Share this post


Link to post
Share on other sites
You really sound like you know the direction you want to take! Good on you.

A very good C++ book is by stroustroup who is the writer of the original language.

Share this post


Link to post
Share on other sites
yeah, I've heard of that book... "the C++ bible" or something like that =P
I just ordered it at amazon.com, I'm waiting for it... but the post-office system here in Norway sucks! haha

anybody know about any good DirectX/Direct3D books?

Share this post


Link to post
Share on other sites
I dont think i've seen any good DirectX/game programming books. Good C++ books are worth it, but once you know C++, i would recommend using google and the interweb as the best resource for gaming. Have you been to www.nvidia.com and seen all their tutorials, and GDC presentations, and white papers. There also a lot more up to date than any book. So good luck on your C++ book, but save yourself some dosh on a directX book :).

Share this post


Link to post
Share on other sites
Using C# for this project would not be ideal right now, from what I've read on XNA it still doesn't have a way of allowing other people to play your games besides with the source code unless things have changed. (Please provide proof if I'm wrong.) They will need .NET framework 2.0 and XNA framework plus Direct X 9 and their video card must meet a requirement for pixel shader and other things which is pointless for a 2D game that is simple. Going with C# will cut programming time but that means nothing if no one can play your game and needs a 3D Video Card. (Not everyone who likes Old School 2D RPG's had a 3D Video card that has pixel shader 2.x)

Stick with C++ and use D3D (Direct3D) to handle your 2D game, how this will work is you use D3D to set the camera so it's locked at an angle giving the same 2D look direct draw would give.

Share this post


Link to post
Share on other sites
Quote:
Using C# for this project would not be ideal right now, from what I've read on XNA it still doesn't have a way of allowing other people to play your games besides with the source code unless things have changed. (Please provide proof if I'm wrong.)


False, this is only true for Xbox360 deployment, you can still use XNA to create windows games that function just like any other .Net application.

Quote:
They will need .NET framework 2.0 and XNA framework


True, this is the overhead of XNA at the moment. Up to date windows pc's will have the former, but most likely not the latter. XNA Framework itself is rather small and can be bundled into your application's installer.

Quote:
their video card must meet a requirement for pixel shader and other things which is pointless for a 2D game that is simple. Going with C# will cut programming time but that means nothing if no one can play your game and needs a 3D Video Card. (Not everyone who likes Old School 2D RPG's had a 3D Video card that has pixel shader 2.x)


The only requirement is shader model 1.1, which is fairly old at this point. Your only other options are direct draw (which others have mentioned is deprecated), or your own implementation of 2D rendering using the fixed function pipeline in either D3D or OGL (I'm assuming this is what Jettoz is suggesting, since your implementation couldnt use shaders and be any better off than XNA in the hardware requirements).

I'd carefully consider your expected userbase and determine if they will still be running pre-shader model 1.1 cards when your ready to actually release your game. I've personally considered it for my current project and decided that the ease of XNA and C# far outweigh any lost users due to the requirements I'd place on them. It really does make that big of a difference.

Share this post


Link to post
Share on other sites
yes, I'll be using D3D, but I'm having troubles changing my settings to fit with DirectX!
I'm using Visual C++ 2005 express edition, and according to the tutorials I read I need to include #include<d3d9.h> to run directx functions, but when I try to build and run, I get an error for that include...
I read something about having to go deep into settings and properties to include some directx lib... but I can't find any help elsewhere!

does anybody know what I need to do with VC++ 2005 express to make this work?

Share this post


Link to post
Share on other sites
Install the SDK, then go and find the include and lib directories in the SDK dir.

Then in DevStudio, go to tools->options->directories, and put the include and library directories you found in the SDK dir. This is presuming, its the same in the express edition.

Share this post


Link to post
Share on other sites

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