Game based on real-world time

Started by
5 comments, last by wodinoneeye 11 years, 6 months ago
Hej,

so I've been wondering how you do this properly:
I want to create a game very similar to the concept of a tamagotchi (I assume you're familiar with these creatures, if not scroll down for a breakdown*). This means you constantly have to track time and let your game character somehow react to it. While the game is running this seems to be no problem, but what happens if it's not?
My approach to this would be to simply note the current time when exiting and subtract it from the current time when starting again, then using this difference to re-simulate all the missed events.

As simple as this might sound I have some doubts about this being a professional (or at least practical) approach to this problem:

1) What happens if you don't start the game again for a really long time? Depending on the speed of the simulation and the machine it could result in a really long phase of re-simulating (is there a better word, btw?) and, in the worst case, appearing to be broken to the user.

2) The user could simply change the system time and provoke unwanted behaviour. How can you prevent this?

3) There would have to be a special method to re-simulate, since the usual simulation-method would play sounds and other events, that would be unwanted to be started multiple times when you race through the passed time. This could also result in other unwanted behaviour, or at least confusing the user.

What's your input on this matter? Is it the right approach? Is there another way? The requirements are as following:
- must not need internet access
- must be able to shut down completely

I'd be happy to read your thoughts and/or suggestions.

PS: Sorry for my first post being a question topic. ;)

* http://en.wikipedia....tchi#Life_Cycle
Advertisement
Many of this real-time games are server based. That is you have a server running the simulation all the time while the user can interact over a (web-)client with your game.

The problem of simulating the gap, when starting a new game, can be solved by introducing several simulation layers. I.e when dealing with a village and the players did not play for a whole year, you don't need to simulate every single step of your peasants for one year. Start with a hi-level simulation (fred the peasant died this year, larry has been born recently) and go down once you reach the end, i.e. start a physics simulation of every npcs for the last several minutes.


2) The user could simply change the system time and provoke unwanted behaviour. How can you prevent this?

Just ignore it, if you have a single player environment. If someone want to cheat, let him cheat. In a multiplayer environment use a server solution (see above).


3) There would have to be a special method to re-simulate, since the usual simulation-method would play sounds and other events, that would be unwanted to be started multiple times when you race through the passed time. This could also result in other unwanted behaviour, or at least confusing the user.

You need to seperate the simulation from the presentation and need to turn off everything which is only there to communicate the current state of your world to the player (audio,visuals).
I agree with ashaman; you cannot prevent anyone from cheating in a single-player game. At "best", you can make it more difficult to cheat. - But is it really our business to decide who can cheat, anyways?

A system time based approach is sadly really easy to cheat without involving the internet.
You can let the application sample the environment as much as its allowed, though.

When I was a teenager, I got this babe-based tamagotchi game called Lula, i think.
I fired it up, tried every "feature" of the game, closed it, set the time approx a month ahead
(IIRC that was the goal of the game, time wise), fired it back up and won.

It was boring, but the only one I cheated was myself. :)

I agree with ashaman; you cannot prevent anyone from cheating in a single-player game. At "best", you can make it more difficult to cheat. - But is it really our business to decide who can cheat, anyways?

Cheating in a single player game could be seen as modding, because the gamer modified his game experience to suit his expectation. tongue.png
I wouldn't think simulating something in-game will take so much time that the user thinks the game crashed. I am not talking about 3d graphics simulations etc, I am only talking about the decision AI for example in sims.

Your simulation method shouldn't play sounds or show any graphics. You need to seperate those things based on which type of simulation you are making. If you extract user interface like sounds and graphics from your simulation method, I doubt it will take any longer than an average load time to simulate years.
Thanks everyone for their answers. :)

Many of this real-time games are server based. That is you have a server running the simulation all the time while the user can interact over a (web-)client with your game.[/quote]
That's way out of scale regarding the simplicity of the game I want to create, though.

The problem of simulating the gap, when starting a new game, can be solved by introducing several simulation layers. I.e when dealing with a village and the players did not play for a whole year, you don't need to simulate every single step of your peasants for one year. Start with a hi-level simulation (fred the peasant died this year, larry has been born recently) and go down once you reach the end, i.e. start a physics simulation of every npcs for the last several minutes.[/quote]
That's quite an interesting thought, although it also sounds like a lot of work, or at least planning. I'll definitely be looking into it, so thanks for that input.

Just ignore it, if you have a single player environment. If someone want to cheat, let him cheat.[/quote]
Well, you're probably right about that. :D

You need to seperate the simulation from the presentation and need to turn off everything which is only there to communicate the current state of your world to the player (audio,visuals).[/quote]
You're of course right here. I shouldn't have put "sound" in there though, but explained what I meant with "events". I was thinking about choices the player could make if he was actually available on day X of the simulation, that would affect the simulation after day X. I'd either have to let these events trigger only when the game is actually running, or let an AI/randomly choose something for the player, I guess.
Even when the player stays in the game (for a large simulation game) there are problems of switching from an abstract mode (simpler to save processing) of behavior for NPCs running in a distant location in a huge world -- which then shifts to 'Real' mode (full detail) when the player gets close.

LOD - level of detail -- different modes of simulation based on proximity of the player from the involved objects

If its a highly detailed game you want all those NPCs to be in the middle of what they should be doing (which might be long complex sequences) and not simply resuming from where the froze in place when you last left them weeks ago "Re-simulating" (or maybe 'catching up' or 'pro-rating' activities has to be done to some extent to put the objects in the right state (and if its a community where the NPCs interact, then they all have to be adjusted together to be cohesive.

The abstract mode behavior has to generate be close enough .results so that if they are resumed (pro-rated to a real mode state) the game simulation is valid.

For a very detailed simulation with this LOD 'abstracting' mode (to save processing) a problem is if the 'community' of NPCs has complex interactions tehn a whoel related area has to be stepped up/activated at the same time -- the boudries of the areas activated like this can get complicated.

You can even have whole hierarchies (more than 2 levels) of simulation LOD detail level, with each one manipulating different levels of abstract/real details and areas of effect.


---

I had previously looked into systems like this when considering MMORPGs where the players have effects on the world and there would be abstract NPC factions that would shift and influence spawns and NPC reactions (at the local level) in different locations (And be more reactive to the players would requirethe Server to run more detailed simulations).

I can see why many games are completely devoid of anything like this.
--------------------------------------------[size="1"]Ratings are Opinion, not Fact

This topic is closed to new replies.

Advertisement