ID:2120007
 
Applies to:DM Language
Status: Open

Issue hasn't been assigned a status value.
I was wondering how feasible it would be to have a world variable or toggle which would effectively behave like the pause button in a standard single player game.

This would essentially be useful for single player projects or for administrators of multiplayer games and it would allow them to essentially stop any procedures or verbs from being called, as well as stopping things such as icon movies and animations from continuing until the game is unpaused.

In order to allow unpausing or menu operation in games, many of the built in operations will continue to function, and anything user defined can be flagged or have a variable switched on to allow it to function.

For example the variable to stop the world could be world.paused, and having a verb or procedure that ignores this would use something like set ignore_pause or something of the sort. A variable would also need to exist for atoms which would allow them to carry out all procedures and variables under their type to function. Say if I have a screen object being used for a menu, then setting the variable would allow me to click on it.

Some things may or may not ignore the pauses by default.
I could see a few uses for this, yes!
This would be awesome
I really doubt something like this is feasible as a generalized language feature. You'd probably be better off devising something specific to your game in soft-code.
This already exists in internal code, otherwise world.sleep_offline couldn't exist.

Should be doable in a limited fashion
What is feasible in regards to DM? Lol
Does sleep_offline even work as expected? I've never had much luck using it or the DD option to do similar. I have to wonder to what degree it actually does work.

As long as this was limited to single user worlds (which Bravo1 seems to want), I could see it MAYBE being possible, but outside of that, I really doubt it (that'd be a lot of nonsense to halt with a bunch of clients floating around), I imagine the only reason sleep_offline ever worked is because there'd never be clients around to see the results.
sleep_offline will make all sleeps/spawns/etc hang until a client connects.

ss13 uses it and it works rather well, our setup doesn't enable it until just before the "welcome to the in game lobby" message is displayed to the world, that message has no checks of it's own, and runs right after a sleep and it will always display right after connecting to a freshly started up world, even if you delay connecting to minutes or hours after starting up.
That's pretty cool, it's a shame it's only halting that, there's probably other stuff processing that it's not catching obviously.

I still imagine adding a client into that mix would add a whole world of new issues, a feature of this nature would be really cool, but I'm not sure if it's quite as trivial as we'd expect it to be (even with sleep_offline already there). The cost of development vs benefit might not add up, especially if it's only feasible for single-player worlds, considering in that environment the developer could probably swing it themselves with the right event scheduling setup (as they wouldn't be worried about more than one client).
in order for the world to be effectively paused, you need sleeps/spawns/etc to halt, and verbs/mouse/key events to be ignored. Pausing sleeps would ofcourse have to include certain internal sleeps, like that in walk_*

There is no reason to bother with pausing the sendmaps(); function that handles updating clients, and worst, you could just set world.fps/client.fps to an insanely low number like 1 or even 0.5 or even 0.1
and verbs/mouse/key events to be ignored.

Uh... How we unpause?
In response to Ter13
Ter13 wrote:
and verbs/mouse/key events to be ignored.

Uh... How we unpause?


Like dis
In order to allow unpausing or menu operation in games, many of the built in operations will continue to function, and anything user defined can be flagged or have a variable switched on to allow it to function.
ya, you just need a way to exempt something.
In response to MrStonedOne
/mob/verb/your_verb()
set pausable = FALSE
...stuff...
Using set is what I was thinking, yes.