Sign in to follow this  

Design question

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

Is this a good basic design. Game Engine --> Game State Manager --> Graphics Engine -->3D Scene Manager --> Terrain Engine, Sky Engine, Etc Basically I want to decouple as much as possible into it's own distinct units for plugabillity and manageability. But I have trouble figuring out things like, should I write a big state manager that resides in the main game loop or would the state manager also handle initialization and shutdown (non-main game loop functionality). By handle I don't mean perform but handle when it occurrs. Likewise, is it a good idea to separate a terrain engine from a sky engine and character engine? Or should all models be treated the same by an all emcompassing graphics engine? Thanks for any input, Will

Share this post


Link to post
Share on other sites
Maybe you should try top-down designing it instead? Write a prototype and decide after hand what you need to decouple. Sure, you'll have to rewrite large parts of the code when you what needs decoupling and redesigning, but you'd have to be a programmer extraodinare to be able to write a full game without any rewrites anyway. Also, the second time you write something, it'll both go faster and be more efficient. It will help your motivation to get something on the screen fast (it did for me anyway), then tweak it as you go along.

I found that I became more productive when using top-down designing, I whipped up a 2d tile engine in a few hours about a month ago, now I've spent the last weeks to decouple resource loading, rendering, client & server code, logic etc. If I had begun to design out the whole system from start, I doubt I would have gotten as far as I have.

Just a suggestion.

Share this post


Link to post
Share on other sites
If you are designing a game, the top-down is probably the best way to go. Get a good idea of the games code into the compiler, then split it up, optimizing meanwhile. Then some of the code will be reusable later. This is what I did and I have made a group of objects that take all the openGL stuff and turn it into one-liners, like window initialization,etc... I started first taking the NEHE code and getting it to work, then I moved the code to separate files and classes.

Share this post


Link to post
Share on other sites
Hmmm. I used to do that :)
But I have found it much more productive to design first and then code. A lot of the kinks get weeded out. I also find that the end result is generally a lot more coherent and managable than itw as back when I would write then form objects and libraries.

I am designing Top-Down but to code that way without a design on a larger project seems like shooting yourself in the foot. I already have a lot of code written for the UI, and a basic terrain engine. That's when I decided I needed to step back and design more fully because it was already getting more unmanageable.

I've also decided to test out C# for a while. I want to get some things running and perform some speed tests of my own. But first I want a stable design :)

Share this post


Link to post
Share on other sites
Well, to throw away my two cents:

I'm not the most experienced game programmer(cough 1 completed game, in BASIC, cough), but for me, designing it first for a little while, then coding it, then designing it for awhile works best. Right now I'm in the middle of writing an RTS with Irrlicht, and all is going well, as I design, then code, then design. In about four hours now(coding time, not design time) I have an object manager which ties into the Irrlicht scene graph, along with a mesh resource manager, along with my own odd way of handling how everything works(it's sort of like the kernel in enginuity, except more general(in a certain way)). In a couple more hours I'll have something up on the screen that displays meshes and moves them around smoothly(god willing) all in 3d. And it will include an object manager, resource manager(well for meshes at least, but that's something I'm going to recode to be more general), and a psuedo-kernel. Of course, in a couple days I'll realize something wasn't right, but then with the already divied up code, it won't be a *huge* problem rewriting it. Total time working on this since I started:15 hours.

Eh, then it will randomly stop working and I'll be back at the drawing board.

GAH,
Ryan

Share this post


Link to post
Share on other sites
Hehe. That does sound a bit like what I often end up doing because at times I just want to code something darn it!. This time however, i am determined to get a good overall design done before coding. I want to work out how all of the main objects (engines and libraries) will interact before I start. At that point I will probably put together my state manager since for now it seems like the stame manager is the real big picture that will need access to every other part of the code. From there I'll probably move on to the graphics side for a while and revisit my user interface. But for now I am taking a while (days - weeks) to just design as much as I can while I am in a designing mood :)

Webby

Share this post


Link to post
Share on other sites
Gee, we'd make a great team! You aren't perchance working on an RTS are you? ;) Things have been going smoothly design wise, since this is the fourth complete rewrite of the game, so I have many of the design ideas already down. Rewriting never hurt anyone.

Cheers

Share this post


Link to post
Share on other sites

This topic is 4749 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.

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