Sign in to follow this  

Kernel?

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

Whats the best way to organize your title screen code from your, game code, from ur ui code, from your networking code? Is it some kind of game kernel? I haven't been overly excited about the kernel implementation. Doesn't feel right, multi threads awkwardly. Multi threading is big these days. i remember the big game loop if else if else haha. that didnt feel right either

Share this post


Link to post
Share on other sites
It really depends on your game.

For a beginners game (or even an intermediate skill homebrew game), I wouldn't worry about processing in separate threads. A single thread on a 2 GHz CPU is much more than most simple games require.

You'll almost certainly end up using state machines for some of it. One will be used for tracking what state your game is in so you know what to render and what to leave off, what input to handle and what to omit, what processing to run and what can be avoided.

You could easily end up using function pointers and swapable algorithms. With a collection of processing functions you can insert or remove elements that need to take place.

You will probably have transitions into and out of game modes, or mini games, or levels, or whatever sub-processing units you choose to use.

If rendering order is significant (it almost always is), you will probably have a rendering loop that draws elements in order. You may call a render function on a subsystem, or you may have multiple collections of renderables, or you may have a loop that renders everything directly, or you may do something entirely different.



I like to see classes for logical components, and those components further subdivided into a logical series of states, with collections of things to process. Then you can have a main loop that calls the components, and the components know what to do. If you later decide to extract a component or sub-component into a thread, it is fairly easy to extract it.

Share this post


Link to post
Share on other sites
I think im going to go very close to that. have graphics, background resource loader, networking, audio, input all seperated out to there own components and have some easily accomplishable way of pulling them out to seperate threads or maybe just

shooting for kinda low min spec but some things i know will require high powered cpu/gpu(swarmes of units)

this really gets complicated when you add to the fact render order and state management in the renderer, add alpha blending needing back to front and it becomes rubiks cube

Share this post


Link to post
Share on other sites

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