Jump to content
  • Advertisement
Sign in to follow this  
Alezunde

For a 2D game project, which language would be most suitable?

This topic is 4768 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

My partner and I are creating a 2-Dimensional, isometric, multiplayer game. Currently I am considering C++, DirectX, and the Torque 2D engine as possible ways to acomplish this project. I would like some input concerning each of these languages/engines. The engine must be able to quickly handle 2-Dimensional graphics, including transparencies and alpha transparencies. The engine must be fast -- if this project can be run on lower-end machines at the time of completion, that would be great. Multiplayer capabilities is a must. Any input on this subject would be greatly appreciated. Also, if anyone has better ideas for a language/engine, please let me know. Knowing the pros and cons of each option would be extremely helpful. Thanks, -Alezunde

Share this post


Link to post
Share on other sites
Advertisement
Oof! That's a long way to go for a 2D game. Forget all of the more complicated APIs, the most sensible paths for you to take would be either of the two big-name 2D APIs, namedly SDL and Allegro. I use Allegro because they have great community and there are alot of tutorials that would get you started making any sort of 2D game. I hear alot of great things about SDL, however, and it seems to be catching on. Look into those, and if you have trouble finding resources, just reply again and I'll point you in the direction of some good websites.

-IV

Share this post


Link to post
Share on other sites
Allegro and SDL are both very slow compared to Direct3D, which is not difficult to use for 2D at all. Honestly, why does everyone act like Direct3D is so complicated? If all you want are sprites, Direct3D is as easy to use as anything else, and it is faster than most. Also consider OpenGL; it is every bit as fast as Direct3D, and I don't believe it is any harder to do 2D with; maybe even easier. I've never used any of the Torque engines, but I've heard only good things about them, so Torque 2D is probably a reasonable choice as well. And whatever you do, don't use DirectDraw!

C++ with DirectX for input and graphics and WinSock for networking will give you the speed you want; that is about the fastest combination you can find (though there are others as fast), to be honest (assuming you program it right, of course; a lot depends on you). That said, the learning curve is steep and development is slow for C++, so if you are talking about learning a new language you might want to use Python, C#, or Java, any of which would provide only adequate speed, but a significantly shorter development time. If you already know C++, just stick with that.

Share this post


Link to post
Share on other sites
Allegro and SDL are not slower under every circumstance. In some cases they will do better.

SDL is a great beginning language for 2D cross-platform games. Can't speak for Allegro, I didn't much like the API when I looked at it, but I really should give it a try.

Languages - Basically C, C++, Java, C#, and Python depending on your needs

If you will be doing lots of alpha blending, then hardware acceleration is a must. The above-mentioned libraries can do full transparency quickly and accurately.

And you need to specify what you mean by lower-end machines.

Share this post


Link to post
Share on other sites
If you are intersted in using Python, check out PyGame. It is a Python wrapper for SDL. I love Python but the biggest drawback is the lack of a great IDE. After 30 or so classes it gets too complicated for just a text editor!

My advice is that c++/[directx|opengl] is the best combination but also the hardest, most time consuming, and difficult to get right. If you arent a c++ guru and want a realistic chance of making a game try Java (there are opengl bindings available). If you are a c++ guru then have fun.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
i would strongly suggest Direct3D,

its so easy to just setup the directx then use the sprite template or just make
textured quads

Share this post


Link to post
Share on other sites
Quote:
Original post by first_log
My advice is that c++/[directx|opengl] is the best combination but also the hardest, most time consuming, and difficult to get right.

That is because of C++, not DirectX. For 2D, the only thing that is a pain in the butt with DirectX is setting up the device, but everyone has to do that so there is more example code for that out there than anyone would know what to do with.

Quote:
Original post by an anonymous poster
i would strongly suggest Direct3D,

its so easy to just setup the directx then use the sprite template or just make
textured quads

D3DXSprite is not a template, but aside from that the AP is right. Also, text with D3DXFont (I think that was what it was called...) gives good results (aside from less than optimal speed) with a minimum of effort, whereas you will be forced to write your own text-drawing system in SDL or OpenGL (I don't know about Allegro).

Quote:
Allegro and SDL are not slower under every circumstance. In some cases they will do better.

Umm . . . I seriously doubt that they are ever faster than OpenGL, since from what I know about them, they are basically wrappers on top of OpenGL, mixed with some software rednering techniques. Thus, the best they could aspire to would be to be as fast as OpenGL, but every example of SDL in use that I have ever seen was several times slower than its equivalent in Direct3D/OpenGL would be. The speed of SDL or Allegro is often acceptable, but they don't make full use of hardware acceleration, so they are slower than they have to be. Everything I've ever seen also indicates that Direct3D and OpenGL are pretty much the same speed in general, although there might be minor speed differences for specific tasks. Of course Direct3D or OpenGL will be slow if it is programmed badly; improperly batching calls, leaving lighting on unnecessarily, etc. can slow things down, sometimes to the point where SDL or Allegro would be faster (although that is pretty hard to achieve under normal circumstances), but with 2D, the amount of code needed is pretty small for the renderer, so it is easy to find and remove major bottlenecks. Once that is done, Direct3D/OpenGL is much, much faster than SDL/Allegro in most cases. I would love to be proven wrong on this, since I know a lot of people really like SDL or Allegro, but I doubt you can find a specific rendering task that is not as fast or faster in Direct3D/OpenGL.

Share this post


Link to post
Share on other sites
From what I'm hearing, DirectX/Direct3D or OpenGL will give me the best results.

With this in mind, where are some good places to take a look at some beginning resources?

By low-end machines I mean this -- if the machine can run Starcraft, it should be able to run the program.

However, would Allegro or SDL be a good choice since I'm not trying anything over-the-top?

-Alezunde

[Edited by - Alezunde on July 29, 2005 4:22:22 PM]

Share this post


Link to post
Share on other sites
Okay, once again. SDL and Allegro are not "slow". They simply do not use any special video hardware.

OpenGL and DirectX are not intrinsically "fast". If you have a good video card, they will do all sorts of things much faster than SDL or Allegro. If you do not, they will be nigh-useless (or at least not terribly good).

If you're doing simple 2D blitting and so on, SDL and Allegro work just fine. If you're doing fancier 3D stuff, dynamic lighting effects, or alpha blending, OpenGL and DirectX work better because they use the hardware to do this stuff fast. But you can use OpenGL for simple 2D stuff if you want. Use whatever you like better.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!