Comments (10)
I'd like the game to be pretty deterministic, given a particular seed value. Otherwise, reliably reproducing bugs or other problems could become a nightmare.
To achieve determinism, we need to ensure that all events happen in the same order so that the random numbers related to those events are always the same. That means that we need at least two RNGs. One for generating random timer values and another one for generating the rest. The separate RNG for timers should guarantee that events happen in the same order (providing equal player input).
Related to determinism is the question of how the RNG seeds are handled by savegames. Repeatedly loading a savegame should always produce the same result (until the player input diverges). The easiest way to achieve that would be the following procedure when saving the game:
- Generate a new, random seed S
- Write S into the savegame
- Before resuming the game, reseed all RNGs based on S (obviously not with S itself, all RNGs need a different seed)
Loading essentially repeats step 3. A likely weak point of this approach is that the player could repeatedly save the game, each time generating a new S and potentially changing the outcome of the game.
from thrive.
I'm not sure i understand the need for two RNGs like that, could you do a quick case where a single RNG would fail to be deterministic?
And regarding save-games i would personally prefer as a player that games play out differently when i load, it's not a big deal in a pure singleplayer game. Your solution is nice, but has the problem you mentioned that i don't see a good solution to. Perhaps limiting how frequently you can save~
from thrive.
could you do a quick case where a single RNG would fail to be deterministic?
Of course... umhhh.... uhhhh... nevermind, one RNG is actually enough. For some reason, I thought that a single RNG plus randomized timer values would lead to different orders. Which I now realize is not the case.
And regarding save-games i would personally prefer as a player that games play out differently when i load
Depending on gameplay, non-deterministic savegames can be a tool for cheating. For example, the player found a thingamajig that will give him a random reward. The possible rewards range from useless to limited edition IWIN buttons. The player can save before gathering the reward, and repeatedly reload the game if it isn't good enough. (Here's where separate RNGs can be useful to prevent the player from manipulating the chances by changing up the input)
As I said, it is highly dependant on other design decisions whether this kind of "cheating" can actually become a concern. If we go with non-determinism, we definitely need to keep that in mind in the future.
Perhaps limiting how frequently you can save~
Maybe allow the players to save however often they want, but only generate a new seed if the last save is at least 10 seconds or so old.
from thrive.
But if you don't generate a new seed for a new save you would still get completely different result every time you load (unless you actually replay the last 10 seconds of gameplay to pull out the 'already-used random numbers)
from thrive.
In my opinion, quick saving and closing without saving is in itself a form of cheating (unless the game crashes or the computer loses power). While we shouldn't necessarily disallow the user from cheating in this way, we also should avoid planning around that. It's too much work for relatively little gain. If a player wants to cheat, let him cheat. The game is open-source, anyway.
In short, the question of whether to generate a new seed each time the game is loaded again should be based on which is more efficient or easier to do.
from thrive.
I agree with patowen about cheating, especially because i doubt there will be very much to gain by cheating this way. Sure you can try to use it for saving your lifeform/civilization but in that situation you would load a save anyway and play the game out differently.
Altough it i still think it is a good idea to generate new seeds every time the game is saved, to avoid some wierd behavior.
from thrive.
If a player wants to cheat, let him cheat.
That's actually a compelling argument. Point taken, no contortions to maintain determinism.
Altough it i still think it is a good idea to generate new seeds every time the game is saved, to avoid some wierd behavior.
Such as? I mean, generating a new seed is pretty much free compared to the heavy lifting of serializing all the components, but I'm curious what could go wrong when we don't generate a new seed.
Edit: By the way, what's the getRandom(vector)
function supposed to do?
from thrive.
Such as
I was thinking that you would have to re-seed the RNG when loading a game, but i realize that this is only necessary if you want replay functionality so nvm~
By the way, what's the getRandom(vector) function supposed to do?
Was just thinking it would be a function making it easier to get a random element from a vector. Obviously not necessary.
from thrive.
Places in code to update to use RNGManager once complete - Please comment if you know more:
AgentEmitter in agent.cpp- Microbe in microbe.lua using rng for distributing agents
- SpawnSystem (if done before this)
from thrive.
Closed with 7cea397
from thrive.
Related Issues (20)
- Try to avoid as many species clones in new auto-evo as it is the most memory allocation intensive part still left
- Find a way to avoid `Miche.DeepCopy` in new auto-evo
- Double check all auto-evo exploring tool settings and see if they are still used by the new auto-evo HOT 1
- Fix whatever causes the auto-evo prediction to show the player to predate on themselves
- Implement a metaball size slider for the macroscopic editor
- Tweak Photostudio light or other properties to other membrane types to look closer as they do in game
- Input actions with a modifier and an icon representing them in the inputs menu doesn't display the modifier at all HOT 3
- New auto-evo chunk food sources should use translated names for chunks in display HOT 1
- Remove Protoplasm Organelle on Next Save Compatibility Break HOT 1
- Make chunk visuals load through the VisualResourceIdentifier instead of exact paths HOT 2
- Process pausing (in the process panel) doesn't work when game is paused
- Auto-evo prediction population is now quite rarely very accurate now
- Add documentation on which auto-evo steps mess with the miche tree and are not re-usable
- Improve interaction of the player migration and fog of war map mode (reveal patches more easily) HOT 1
- Make text on the migration buttons more clear when there is an existing migration HOT 2
- Auto-evo ModifyExistingSpecies needs to be split into sub-steps as it takes too long to run otherwise
- Process toggle buttons sometimes don't match process state HOT 1
- Macroscopic editor top view camera preset angle doesn't show anything / doesn't work
- AI likes to stay stationary (and try to engulf) too much now HOT 3
- Improve species generation for microbe benchmark (or at least find a better seed)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from thrive.