   How to make a tactical pause
  I'm learning beginner level languages, like Game Maker scripts, Blitz Basic, etc, and can make a simple action game or control things with mouse. I can also make a pause menu. What i want to do instead, though, is to know how to make a "tactical pause". You know, when everything gets frozen, but instead of looking at the menu, you still can look around, give orders to units and stuff, click things to see their stats, that sort of thing. What would be the general way to go about it ? I mean, dont give me the code or anything, just explain to me the general theory behind it, if possible, so i could then dig in the right direction. How do i separate the code that needs to be executed at all times, and the code that will only be executed when the game is unpaused ?   
Quote:Originally posted by KarnotHow do i separate the code that needs to be executed at all times, and the code that will only be executed when the game is unpaused ?So, the way I'd do this would be to separate things out into three layers.The first layer is the user interface - rendering the game world through the camera, score bars, menus, etc. Code in this layer is always running - you will always be displaying /something/ on the screen, and (excepting loading screens) you will always be caring about /some/ kind of input.The second layer is the local player state. Imagine that your game is multiplayer; this layer contains all the stuff that is specific to a player, but that wouldn't be visible to the other players. So, this layer is things like the standing orders you've given to units, or the camera location, or which units are currently selected, and so on. Code in this layer is paused when you do a full pause - i.e. a drop to the in-game menu - but not when you do a tactical pause.The third layer is the simulation. This is where everything in the game world, as visible to any observer, actually 'lives.' Things like physics, unit AI, or gameplay logic all happen in this layer. This layer is halted for both kinds of pause.As far as how you actually /do/ the pause for each layer, the two neatest options are either to simply stop updating things in that layer - i.e. stop calling unit->ai.update() and physics->update() - or, to have a separate 'clock' for each layer, and freeze the clock for the layers you want to pause, such that you keep updating all the layers but one or more of them will claim that 0 milliseconds have elapsed since the last update. The clock approach is more complex, but can give you a particularly funky ability to do things like mess with the rate of time, so you can make the simulation run in slow-motion or fast-forward or whatever.   ;  Okay, you just would add a conditional check.  Add something such as a global "isTactPaused" for this.   ;  You're on the right track but you shouldn't use a global. Each "layer" would be a class or some sort of section of code (i.e. a .cpp file), so the variable would only be visible to that layer. Then when you want to do a "tactical pause", you would call a function that would set that variable.   