Skip to content

Fog Of War

se5a edited this page Apr 19, 2018 · 3 revisions

A player should only be able to see what the player should know about, I guess this goes without saying, however clients should only get sent the data that the player should know about, and the ui views should only have access to data that the player should know about.

technically, viewmodels should only get and only make public the legal data, this is a little less important than clients, since if the player really wanted to, they could get access to the data anyway. however, more importantly, viewmodels should attempt to work only with the legal data since the same viewmodels will be used as a client, so they need to be able to handle not having illegal data.

Currently, when an entity gets detected by sensors, the faction gets a partial clone of the entity that got detected. clients get sent a copy of everything that is owned by the faction. if viewmodels stick to dealing with this data, then the same viewmodels (and views) will work on the client as well as the host without any changes.

see also the Sensors and Detection wiki pages for details on entites are detected.

One problem with how things currently work, is that we're going to have a bunch of datablobs that get the exact same calculation, ie there's going to be an OrbitDB for every body for every faction, so if number of OrbitDB = bodies * factions. One way to fix this, might be to have two different OrbitDB that inherit from a common interface: IOrbitDB OrbitDBActual - much the same as it is now, gets processed normaly. OrbitDBSensor - fields and properties point up to OrbitDBActual. Doesn't get processed at all, but can be "read" from.

a remote client might have to create an OrbitDBActual for itself, so it can process the orbits. but on the server, the real entity would have the OrbitDBActual, and 'sensor' entities (ie for a planet, this is an entity with everything that the player has detected - might have a position and orbit, but not a list of minerals.) this would allow for a lot of flexability, an OrbitDBActual could be swapped in an out for OrbitDBSensor in the case where a sensor contact is not fully known. ie the sensor entity could have an OrbitDBActual if the sensor reading gives a different result than the Actual entity.

Clone this wiki locally