• Advertisement
Sign in to follow this  

Build my own 2D engine, or use someone else's?

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

Before I begin, I'm sorry if I picked the wrong forum for this one, as it's a bit unclear whether this is "game programming", "graphics programming" or "alternative game libraries". I've got a question about engine choice that I'd like some advice on. At the moment I'm working on a simple 2D space shooter as my first real game for some time. I'm planning on working through a couple of small games, gradually ramping up the developmental difficulty until I get to games of sufficient quality to be sellable as an indie. For this first project, by building a simple game I'll be working on reviving my once adequate C programming skills (or working towards C++), since I haven't written anything complex for a couple of years. However, I'm not sure on the best approach towards the design of the engine. The programmer in me would like to design and write my own 2D engine. However, thinking about this from the perspective of an indie, it might make better sense to use an existing 2D engine that's tested and true. If this was a 3D game, this is a no brainer; it just makes sense to use an existing 3D engine because building something competitive by yourself is too time-consuming these days (unless building engines is your goal, of course). But a 2D game engine doesn't seem that hard; I've written simple ones before in a couple of weeks. Of course, I could be wrong as I'm no expert, which is why I'd like to ask people's opinion about which is best, if you were aiming to make commercial quality 2D games, since I know some of you have already been down this path. Should I start off by researching how to build a solid 2D engine and building my own, or should I start researching what existing 2D engines are out there and which one is best?
Here's what I think are the pros and cons of both methods: Write my own 2D engine Pros:
  • Get practice in writing C or C++, using SDL, engine design
  • Will understand the underlying mechanics better
  • Easier to integrate new features
  • No licensing issues (except for SDL's LGPL, of course)
  • I can ensure that it is properly cross-platform myself
Cons:
  • Takes time to learn the appropriate knowledge and to write the engine
  • I'm inexperienced in engine design, will take a couple of iterations to get right (however this is planned for; I'll be making a series of 2D games)
  • Will have to debug and test extensively
  • Will not start off with as many features as a mature engine
  • I might easily overlook something important when designing my engines, due to inexperience.
Use someone else's cross-platform 2D engine Pros:
  • Will start with a full 2D engine; no development time
  • Little need to test and debug the engine itself
  • Access to support
Cons:
  • May not have all the features that I need
  • Harder to extend
  • Harder to track down and fix any specific problems
  • I won't learn how to build a proper 2D engine
  • Underlying mechanics of game engine will be unclear
  • Licensing issues
  • Good chance the engine will be poorly commented and coded confusingly (this seems to be the case with most source code I've downloaded; doesn't anyone comment their code?!)

Any advice? Also, if you think I should make my own 2D engine, I'd welcome any tips or tutorials on how to design a good one (i.e. not just one that works, but one that is solid from a software engineering perspective). Or if you think I should use an existing 2D engine, I'd welcome recommendations about which ones are best. Thanks in advance!

Share this post


Link to post
Share on other sites
Advertisement
Use an existing 2D engine, but make sure it's one that you have source for, and dispel the notion that you'll require no development time to get up to speed with it. First, you'll have to learn what the engine can do, and how best to do them. Second, you'll have to learn what the engine can't do, and decide whether to enhance it. Third, you'll have to figure out how to enhance it, and then figure out how to build your game on top of it.

Even with all that, there's the very high possibility that it amounts to less time than writing your own engine from scratch, especially when you account for refactoring your evolving design. Publicly available engines that have reached maturity and been used by other games will have been influenced by the variety of games built on top of them, and consequently will have ironed out a number of kinks you likely won't forsee.

Good luck with your game.

Share this post


Link to post
Share on other sites
It seems your goal is to get practice writing games, so it makes sense to use a third-party engine for it instead of spending potentially a few weeks to a month writing your own (possibly longer depending on how detailed you want it to be and how much you do on your own).

If you do use a third-party library, (note I have not by any means used all of the engines out there) I do recommend from my experiences ClanLib. It's a very broad library, with utilities across the spectrum of input, sound, graphics, etc. As far as features go, I doubt you'll be dissapointed. You can learn more details at its respective website here.

If you're serious enough about this and are willing to spend some money, I don't think you could go wrong with Torque 2D.

Either way, good luck.

Share this post


Link to post
Share on other sites
I am currently working on one: JEngine SSE. In the next couple of days I am going to release build 0.30 which is quite powerfull already and is crossplatform, open source and contains a client/server network layer (still under development).

I am currently writting a game with it. The complete game logic is written in Lua script. Adding functionality to the engine is very easy, and there is a lot of comments in there.

See my website for more information: http://jengine.homedns.org

Share this post


Link to post
Share on other sites
Quote:
Original post by blankdev
Anyone know any OpenGL 2D engines that are free?


ClanLib is written on top of OpenGL, and is completely cross-platform. You can easily use both ClanLib and OpenGL simultaneously.

Share this post


Link to post
Share on other sites
Thanks for the replies from everyone!

Quote:
Original post by Oluseyi
Use an existing 2D engine, but make sure it's one that you have source for, and dispel the notion that you'll require no development time to get up to speed with it. First, you'll have to learn what the engine can do, and how best to do them. Second, you'll have to learn what the engine can't do, and decide whether to enhance it. Third, you'll have to figure out how to enhance it, and then figure out how to build your game on top of it.


That's true. After thinking about it for a bit, I think it might be best to start off my building the interface to an engine, but just coding that up as a wrapper to an existing 2D engine. That way I can add my own functionality or swap out to another engine in the future.

Quote:
Original post by nilkn
If you do use a third-party library, (note I have not by any means used all of the engines out there) I do recommend from my experiences ClanLib. It's a very broad library, with utilities across the spectrum of input, sound, graphics, etc. As far as features go, I doubt you'll be dissapointed. You can learn more details at its respective website here.

If you're serious enough about this and are willing to spend some money, I don't think you could go wrong with Torque 2D.


I've had a look at the documentation to ClanLib, and it does seem to cover many of the areas that I think it would be troublesome to implement (such as the resource manager), so it's currently my front runner for starting engine to try out.

I've heard about Torque 2D and read a bit about it, but I'm not sure if it compatible with compilers other than Microsoft Visual C++. At the moment I'm thinking about using Dev-C++ as my compiler, but I'm still not sure; I remember Visual C++ being pretty good when I used it a couple of years back. Torque 2D does look pretty good though, and $US100 dollars is not a large amount of money for what it seems to do. Has anyone tried it out, and can tell me how good it is?

Edit: By the way, the reason why I'm picking Dev-C++ is mainly because its free, and so far it seems to do what I want it do for the simple demos I've tried out. I used to use Watcom's compiler years ago, but that's now very obsolete. Microsoft's Visual C++ seems a bit pricey for the full commercial edition, but it might have a lot of useful features that I don't know about. Is it worth the cost? If I spend a few hundred bucks now on a new compiler and Torque 2D would I save a huge amount of time?

Although I'm not sure in that case whether it wouldn't be better to just get the full Torque 3D engine, and just use it in 2D to start with. I'm starting to get a bit confused by all the available options!

[Edited by - Trapper Zoid on October 10, 2005 12:18:34 AM]

Share this post


Link to post
Share on other sites
Hey buddy, as a professional compiler converter myself, I can convince you to get visual studio. IT saves you so much time programming, it has autofill feautures where you type the classname and a dot (to access a member/function, and it gives you a drop down list so you could just type the first letter and press TAB and it types it for you, it's hard to explain and might not seem like much but it's really helpful, also the debugger is nice, as well as the error handling, It gives you millions of things you can configure (I've never done so myself), if you have any more questions let me know. And yeah I think torque 2D is really good, and let alone if you get MSVC, the engine comes with project files for it, so it would be very...very easy for you to use it.

Share this post


Link to post
Share on other sites
Quote:
Original post by blankdev
Hey buddy, as a professional compiler converter myself


What the hell is a professional compiler converter...

I don't really agree with any of this advice. Roll your own. You will gain valuable experience from the utter frustration.

And than use someone elses to do a real game.

Share this post


Link to post
Share on other sites
lol I was playing I ment that I converted everyone to use visual studio, but yeah what the guy above me said, it's up to you, but in my opinion, visual studio is great.

Share this post


Link to post
Share on other sites
Hate to be pedantic, but Dev-C++ isn't a compiler. Code completion and IntelliSense aren't compiler features, either. You're talking about IDEs.

If you want free Windows development tools, I'd recommend the MSVC Toolkit 2003, a command-line optimizing compiler that's free, coupled with either Code::Blocks (I've heard good things about it) or Eclipse. I think Eclipse sucks, and, being written in Java, I've never had a machine powerful enough to run it reasonably, but if you do then you should give it a shot.

Personally, I'd rather spend the odd $100 for an academic license of MSVC Pro. Heck, these days you'll get Visual Studio Pro Academic for that price.

Share this post


Link to post
Share on other sites
Quote:
Original post by Oluseyi
Hate to be pedantic, but Dev-C++ isn't a compiler. Code completion and IntelliSense aren't compiler features, either. You're talking about IDEs.


It's good to be pedantic about things like that [smile]. You're right; it's an IDE that uses MinGW for its compiler (by default), I think.

Quote:
If you want free Windows development tools, I'd recommend the MSVC Toolkit 2003, a command-line optimizing compiler that's free, coupled with either Code::Blocks (I've heard good things about it) or Eclipse. I think Eclipse sucks, and, being written in Java, I've never had a machine powerful enough to run it reasonably, but if you do then you should give it a shot.


I hadn't heard abut Code::Blocks or Eclipse before, so I'll look them up. However, if you've never had a machine powerful enough to run Eclipse properly, I doubt mine will be either.

Quote:
Personally, I'd rather spend the odd $100 for an academic license of MSVC Pro. Heck, these days you'll get Visual Studio Pro Academic for that price.


Luckilly I still qualify for the academic license, but won't things get a bit legally tricky if I plan on releasing stuff? I'm not entirely sure on the licensing for the academic version, but they usually have something like a "non-commercial" clause in there. It's probably okay for me to release small demos with that license, but it's a bit of a grey area if I start using those demos as advertising for commercial products.

The other thing I'm not sure about is the additional features provided, especially the debugger. I haven't yet created a project big enough in Dev-C++ to test its suitability as an IDE, so I'm not certain if its debugging features are comparable. From what I dimly remember when I tried out Visual C++ ages ago, the debugger was extremely impressive.

Also, since a lot of you seem to be using Visual C++, how easy is it to create portable code?

To briefly touch upon the original point of the thread, at the moment I'm leaning strongly towards using ClanLib for the first project; it seems to cover all the annoying low level features that I'd hate to code up, but there's still enough work to be done to revise a bit of programming skill. I'm sure I could do a lot worse than choose ClanLib.

Share this post


Link to post
Share on other sites
It's hard to compete with the future, because the future is always perfect.

However, after a while, you learn that starting in the present (i e, a pre-made engine) will almost always be more efficient than waiting for the future. Chances are, the 2D engine in question has debugged a lot of bugs that you'd have yourself in your own engine, so you don't have to do that. It's also likely that you'll learn better 2D engine design from seeing how it's done elsewhere, than coming up with your own from scratch.

Last, make sure you get source with the engine. That means that you can learn the internal details you need by reading the source / stepping through it MUCH FASTER than you'd create the details of your own engine; again, because all the dumb bugs that take nights to find are already worked out.

Share this post


Link to post
Share on other sites
Quote:
Original post by Trapper Zoid
Luckilly I still qualify for the academic license, but won't things get a bit legally tricky if I plan on releasing stuff? I'm not entirely sure on the licensing for the academic version, but they usually have something like a "non-commercial" clause in there. It's probably okay for me to release small demos with that license, but it's a bit of a grey area if I start using those demos as advertising for commercial products.

It shouldn't. The compiler itself is free, and can be used pretty much however you want. And since they don't limit how you use the IDE, you're pretty well in the clear. Of course, if your conscience pangs, you can always just buy a copy of VC Standard just before your commercial release, which is about the same price as VS Academic anyhow.

CM

Share this post


Link to post
Share on other sites
Quote:
Original post by Conner McCloud
It shouldn't. The compiler itself is free, and can be used pretty much however you want. And since they don't limit how you use the IDE, you're pretty well in the clear. Of course, if your conscience pangs, you can always just buy a copy of VC Standard just before your commercial release, which is about the same price as VS Academic anyhow.

I'm pretty sure that the academic license is for non-commercial work only. I've seen the display case of software at my local university bookstore, and there's pretty big stickers advertising that on the academic versions. However, if the prices are the same for Visual C++ as Visual Basic and C#, it should be under A$100 for Visual C++ Standard, which isn't too bad a deal.

I'm fairly sure I can get by with just the free IDEs and compilers for my first project. This space shmup is really just a simple game I'm planning in order to get some practice in programming, and so that I can finally get around to making a game. Since it's a learning experience, at the end of the week I'll pick whichever engine seems the nicest and try it out with this game, and if it's not appropriate I'll pick something else for my second game. I just have to make sure I don't try and get this first game totally perfect on my first try, because the last time I tried that I spent months in planning and never got anything done.

I guess I'm just rambling now, but my point is that I've decided it's far more important for my first game to get it finished, even if it's not particuarly brilliant coding, so I'll go with a 2D engine for sure. I just have to pick the right one...



Share this post


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

  • Advertisement