# 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.

## Recommended Posts

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:
• Little need to test and debug the engine itself
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 on other sites
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.

##### 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 on other sites
Anyone know any OpenGL 2D engines that are free?

##### 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.

##### Share on other sites
Quote:
 Original post by blankdevAnyone 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 on other sites
Thanks for the replies from everyone!

Quote:
 Original post by OluseyiUse 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 nilknIf 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.

##### Share on other sites
Quote:
 Original post by OluseyiHate 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 ZoidLuckilly 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 McCloudIt 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...