Jump to content
  • Advertisement
Sign in to follow this  
davidsiaw

Making a game framework. educational or waste of time?

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

Being an student and having a programming as a hobby, I am starting to feel attracted to the concept of programming games. However, being new to games programming, I don't have much idea of what the go-abouts of developing games are. I've had a look at various game libraries and tried them one by one, like allegro, pygame, ogre3d etc.. and I had decided to start off with SDL and its sister libraries SDL_mixer, SDL_ttf, SDL_image and SDL_net to perform my media functions since its just so easy to get running. In order to get a feel of what game programming really involves, and to understand better the libraries used for programming games like ParaGUI, GUIchan and many other wrappers for low-level libs like SDL and directX, I've started working on a project to build a C++ framework that allows me to abstract all the nitty-gritty details on handling the surfaces, setting sound settings, graphic settings, nonblocking routines, and allow me to get on the real game building concepts (yeah I'm still learning python. once I'm finished I'll try out pygame again). I was also thinking of adding a simple GUI system that can be derived easily to create user interfaces for games, and allow the event handlers to recieve events from the network and other parallel threads. I'm not very far into this project yet but i've done a few things like playing sounds and drawing things and handling events from devices. I'd just like to know if it is a good idea to build something like this from scratch. (i know there are libs out there that can do the trick, but learning to use them given sparse documentation hasn't gotten me very far. One notable one is ParaGUI. Lots of references, lack of examples) But perhaps if I used the excuse of it being educational, so once I know the problems involved i'll be able to understand other libs by looking for how they solve it blablabla Anyway, I'd like to know more about what you guys think. I'm no beginner in C or C++ but am I wasting my time doing this? or is it better so I know whats involved and allows me to jump in quicker?

Share this post


Link to post
Share on other sites
Advertisement
It depends on what you mean 'waste of time'. It will be educational, so it can't be a 'waste'. But if making a game is your goal, then yes it will slow you down significantly(that doesn't mean you won't finish it). I've been down the path of 'make everything from scratch' and done some interesting things but I came to realize that those libraries you mention have dedicated persons,teams,or whole communities that build,debug,test and expand them for years. It would be very difficult to build a similar engine like,say, OGRE(which is huge) *and* make a (fairly complex) game at the same time, and all that on my own between school,job and other activities. Even using Python+pyOGRE leaves me with a lot of programming to do if I want to come up with something good. But the years that I spent coding on a more low-level base gave me a better understanding of those libraries that I'm using today, so like I said it's never a waste. It's your call. Btw, python+pygame is a fairly easy and powerful combination that can produce decent 2d games in short time.

Share this post


Link to post
Share on other sites
no knowledge is bad knowledge, i say. making a game framework can give valuable experience that may be useful one day. if you can learn it, why not? couldnt hurt to have some extra experience under your belt.

Share this post


Link to post
Share on other sites
personally have found that making an engine, of any kind, is downright invaluable. Not to actually USE the engine, since others have likely done better and more, but to learn how to tame the size of a project with that kind of scale.

Share this post


Link to post
Share on other sites
Sorry, but I'm gonna disagree - if you're "new to games programming" then making a framework is likely to be pointless. I think it's far more fruitful to actually make a game and then extract the framework from there. How will you know if it's actually a useful framework or if it does what is needed if you've never made a full game with it?

Share this post


Link to post
Share on other sites
I will agree with Kylotan. Trying to make an even slightly generic tool (that's what an engine or a framework is, really) without at least moderate experience in the domain of application for the tool is futile. You don't know enough about the domain to address the issues.

Also, your early efforts are likely to be frustratingly difficult because there won't be much interesting to show for it, only the vague notion that your framework or engine might be usable... and when you discover that it isn't, in fact, usable, you will get discouraged.

Make a game. Make another one. Rinse and repeat. And you do so, a framework will evolve out of the process naturally -- bits and pieces of code you reuse often, et cetera. This will solve, to some extent at least, the above issues -- you will be acquiring experience in the problem domain and will thus have a better idea of the needs you need to satisfy, and you will have some interesting things to show for your efforts. And the framework you develop as a result will actually be useful to at least somebody.

Share this post


Link to post
Share on other sites
In my experience, setting out to make an engine is huge mistake. I've been working on "engines" for 3-4 years and every single time I've run into problems later on that my design wasn't flexible enough to handle because I didn't have the knowledge to anticipate the requirements. So, I'd scrap the design and start over (but not before taking a month or two off to deal with the frustration) to include the missing functionality and eventually run into the exact same kind of problem.

My current approach is to take everything I've learned, make a solid foundation as best I can, and then HACK HACK HACK my way to a finished game. I'm almost embarassed to admit, but I've done only finished one game: My very first game, using Direct Draw and some disgusting C code, 5 years ago. Since then I've been way too bogged down in the software engineering aspects of game development.

My advice to you or anyone else is to just make a game. Don't worry about reusability, genericity, design patterns, or purist OO methodology. As you're making your game you'll discover objects and functionality that you can abstract out to make your life easier. After a few completed games you'll probably end up with the knowledge you need to be able to start thinking about a more complete framework/library/engine.

Share this post


Link to post
Share on other sites
It seems everyone's got a different point of view here. Its good to hear what everyone has to say about creating a framework. Yeah I was actually worried it was a waste of time.

So far I've implemented some basic widgets such as text with unicode, images, and containers. Its pretty cool. I ported it to linux and it works just as well. Also got a nice timer working that allowed me to move my widgets around with time with my lovely event loop. I'm guessing that since I started it I might as well see it through. I was also looking into making it capable of video playback using ffmpeg after I am done with the interactive widgets like textboxes and buttons.

Meanwhile, I was actually looking into building a game like tetris like some people have done, but just from the ground up starting with a few libraries like SDL. It would be cool to see how it comes out.

Share this post


Link to post
Share on other sites
Take the middle ground approach. Use an existing library, but as you start finding yourself doing stuff over and over, move that code over into a framework. Its good practice learning how to properly organize your code, and if done this way it really isnt that much more work. When you are starting out, you will find many things repetative. Having a library of routines you can drop into a new project is invaluable, plus like I said, teaches you good code layout skills, something few books teach.

But trying to create all the nuts and bolts stuff from day one... thats a waste of time.

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!