Sign in to follow this  

Different Game Modes

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

I was wondering how many games deal with switching between different modes. For instance, take games like Pokemon, Square RPGs, and Zelda. In one mode there's an intro screen or menu. In another mode you walk around the world. When you press "up" you move in that direction. If you press start it brings up a fullscreen menu and you're able to tweak things. When you get into a random encounter, the entire screen is different. When you press "up" it moves an arrow between option menus. When you press a button, you select an option instead of swinging your sword, etc. What are some ways that games handle this? Maybe the State design pattern would be good for this? I was also thinking about a system that uses config files to define different game modes. Each mode would have a set of commands it would accept and a seperate user preference file would map the various keys/buttons to each mode's commands. Am I on the (or at least a) right track?

Share this post


Link to post
Share on other sites
Hmm...I'm not very experienced with this subject, but if I had to do that I'd just set an int to something...

Example:
Loading: int GameMode = 0
Menu: int GameMode = 1
Map: int GameMode = 2
Battle: int GameMode = 3

Then another int to clarify
Loading-Gamefiles: int ModeType = 0
Loading-Savedgame: int ModeType = 1
Menu-MainMenu: int ModeType = 0
Menu-Settings: int ModeType = 1
Menu-SaveGame: int ModeType = 2
Menu-LoadGame: int ModeType = 3
Menu-Inventory: int ModeType = 4
Map-WorldMap: int ModeType = 0
Map-Level: int ModeType = 1
etc.

Maybe not the best system, but as one mode finishes(such as loading) it would set the next one, and so on and so forth. Perhaps someone else has a better idea of how commercial games do it though?

Share this post


Link to post
Share on other sites
Personally in my rpg everytime a child mode happens (like a fight), from within the main gameplay mode, a child is spawned, and a communication channel is opened (so it has access to neccessary variables like stats). The problem with this method is that there is 1 root mode (the movement mode).

Share this post


Link to post
Share on other sites
Hey, I was in the same situation as you a month or two back when I was implementing my first real game-state system.

I'll try and find the resources I used but you should check out this thread as it had some interesting and possible useful discussion on ways people have done it.

In the meantime, it might also be worth checking out some of these tutorials as they set up a basic state system switching between title screen, menus, the game etc.

I will try and find the other bits I used but hope those 2 are helpful, and good luck :)

Share this post


Link to post
Share on other sites
state machine, definitely. I am working on a game that supports 8 online multiplayer game modes, 2 single player game modes (co-op and campaign), and the 8 multiplayer game modes for split screen (4 players, and 2 players).

Now, imagine you have the possibility to change game modes mid-way through a game, that some entities are available only for given game modes, that you can quicksave-quickload the game at will, load new maps, go into tools, tweak the level, then go back into the game, all the scoring systems, the specific config for each game modes (score limit, time limit, pickups available, friendly fire, weapons available, ...). It's a shitloads of things that can go wrong, and it's quite a nightmare. I would have it no other way than using state machines. You'd have to be insane not to use them, and if aren't then you'll soon be if you don't use them.

Although for me game modes are pretty similar in their flow (like Deathmatch, Team Deathmatch, Sabotage, CTF, Flagball, ...), you can still think of them as game pluging-in into an 'engine', like a mod. So you have shared resources, like the progress in the game, and all the game modes that share a common interface (initialise, render, update, inputs, reset, shutdown...). The thing is, you have to be careful, because you'll end up deriving a lot of stuff, like the config strctures, score structures, the various front-ends and GUIs, ...

I am not doing it that way, but I should have had, really.

Share this post


Link to post
Share on other sites

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