Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Quantum phenomena as emergent property in networked computer simulation?

  1. Jul 6, 2011 #1
    I'm not physicist, but a software developer. Please don’t hang up.:smile: I am building massive multiplayer online game server, and I started building it from scratch. I found that some programming issues emerged from it which had striking resemblance to quantum quirkiness, so I just wanted to share and find out what you all think about it. Possibly even inspire your thinking. Maybe. I will try to make as many analogies as I can, and not all might be most happy ones.

    Few words about our game simulator itself. It is a common server centric system, even though I think it might as well have been peer to peer simulation. Idea is that each player has his own client which is used to interact to the virtual world. Every client is connected to the same server. In essence, client takes any inputs from player, sends them to server, receives world updates, and renders the world to the player. Communication is naturally done by sending messages back and forth, with finite speeds.

    So already we can dare to think about words such as reality, realities, observers, messenger particles, interactions and so forth.

    Now, even though client should be capable of calculating game physics and thus predicting users input impact on the world, client can’t never really be trusted to do so. Other players may have interacted with the world already, or clients can even be corrupted, or clients just don’t have that computing power. Or some players are just cheats and want to be invincible or steal all your clients credit card data. :) So all real authoritative physics is done on single server where all players interactions and conflicts are actually solved.

    Let’s talk bandwidth. It costs and it’s scarce. Sending complete description of the world to each client all the time is completely out of the question, if possible at all. It is just too much data to be sent, and most of it is completely redundant. We do our best to use just the minimum amount possible. Not sure if it is analogous to minimum energy principle, but that is how it is done. So only what is needed for the player to know (see) is sent back to him. We literally use regions and entanglement lists for each client to do this. If player is not looking at the moon, we do not send moon’s data (e.g. position update) to him. For him it’s really just not there. As soon as he looks to it, server will deliver most up to date data of it and all will be well. So photons bouncing from the moon’s surface, would be a clear sign of entanglement, and server delivers. Crucial point I guess would be that entanglement comes from some minimum information principle? Not sure if it makes sense, either way, moving on.

    Let’s talk lag. Every network has it. It’s time needed for messages to reach clients. It is always finite. While network message speed limit certainly has the same relativistic limit, it is of course much lower. So player actually sees old picture of the world, just as in reality we see a tiny bit older moon. Not that lag itself is quantum phenomena of course, It’s just analogous.

    To reduce costs even more, we had to reduce the bandwidth even more. But when we reduced more bandwidth picture of reality for each player would start to look really ugly and illusion of the virtual world would just fall apart. By ugly I mean jerky, twitchy, inconsistent, chaotic, as if no physical rules applied at all. As if someone was showing slideshow of photos of traffic taken hours apart.

    There is of course solution to this, which is well known and used in almost every simulator there is. As it turns out bandwidth can be reduced tenfold by allowing clients to do some tiny physics on their own. By allowing clients some temporary, non-authoritative, minimalistic physics calculations we could decimate bandwidth needed and keep players unaware and still completely immersed in the simulation.

    Idea is to allow client to un-authoritatively take care of world changes in between authoritative messages received. It works like a charm, and sure enough, that seems to be the best way to build networked simulations for as long as they are built, which is not really that long. It even resolves a lot of issues caused by uneven and unpredictable network lag across the network. Of course there was some small inconsistency in clients here and there, but none could really be easily noticed, if at all. But lower the bandwidth we used, more common and obvious quirks were. Not that we needed to lower the bandwidth anymore, but funny things emerged when we started to cut the messages to almost a halt, effectively isolating the client from the server, leaving it in much, yes, de-coherent and delicate state. If and when single message came through all ambiguities collapsed and everything was suddenly well defined and apparently in best order. Well, just about everything.

    So what were the most common quirks? Objects walking through walls. Objects existing at more than one position. Objects interfering with itself. Objects being dead and alive at same time.

    So what is actually going on? Ship is sailing in the sea. Every now and then message arrives from server of ships correct position and speed vector. In between messages client updates the ship position with last known vector for each frame. All is well and coherent. Messages are frequent, and even if they are not, it does not really matter. Both client and server do the same physics and come with same results. Now stuff outside of our particular client reality tries to enter it. It’s can be a wall in our path, another ship, or incoming torpedo. As long as there are no new messages come from server, our ship is sailing “dead reckoning”. (Pun intended, that is the actual name of the this programming technique). In authoritative reality, we are stopped by the wall, or bounced to another direction by other ship or dead by the torpedo explosion. In client’s world we are still happily sailing past that point. So where are we really? Are we alive or not?

    Authoritative message finally arrives to client. Time to collapse to one reality. Not an easy thing to do coding wise. Do we just jump to new reality? Maybe some smoothing, transitioning and fancy animation. That is common solution in gaming. I suppose we can identify ourselves at another place an avoid further self-interference. But, oh look, ship trails in the sea are still rendered there where ship never really was. Let’s say that is also fixable, we bluntly remove them. But what if some client messages were already sent from that alternative reality position to server? Or maybe to other clients in peer to peer communication network? Some irreparable damage has certainly been done to user experience at that point, and there is no way around it. We can just let him call it strange and believe whatever he wants. :smile:

    I don’t really know where to go from here. I understand that this is nothing more really than “many worlds” going their own way until collapsing into one, I just didn’t expect to see quantum like effects to be so easily recreated, recognized and displayed in clear and plain fashion on my own screen. And I know it’s really far-fetched thinking our reality is just some imperfect implementation of rendering of multiple but interactively connected realities. But that is exactly how quantum weirdness makes most sense to me from now on.

    I’m probably not the first one to come up with something like this and I know I probably should have done better online research first, so I will gladly follow any interesting and related links you may have for me. Thanks for reading, waiting for your thoughts.


    Last edited: Jul 6, 2011
  2. jcsd
  3. Jul 6, 2011 #2


    User Avatar
    Science Advisor

    Hi Luka .. that is a very interesting post! I don't have time for a full response right now, but I can summarize my initial thoughts as follows. I wouldn't call what you are observing quantum phenomena per se, because the set of rules from which they emerge is completely different from the physics of quantum mechanics. However, what you seem to have captured an interesting analogy for how quantum systems evolve when they are not being measured, at least according to the Copenhagen interpretation. I think the relevance of "information restriction" in the two cases is also interesting ... I'll have to think more about it's significance.

    One last point .. I am not sure you really have full homology with the quantum case, because unless I have misunderstood you, in your case, there is always a "right answer" which the server knows, so the state into which the client will "collapse" is always known. In the quantum case, it is fundamentally impossible for anyone to predict which state a superposition will "collapse" into when measured.
  4. Jul 6, 2011 #3
    I agree with notion that there should be no central, authoritative "right answer".

    Centralized servers are so 1990. :smile:

    Let's change "central server" to "peers".

    I find it more beautiful in design, and certainly feels more natural. Also, more secure and harder to turn off! :smile:

    Suppose we are doing p2p game networking. This is how it can be done. Basically just clients, each in authority for their own object (ship), communicating with each other. On every communication they sync their realities and in meanwhile they do their best to carry on without each other.
    Excommunicating one peer will create alternate reality for it and all others will have to do their own math best they know how. Since there is no authority information on that excommunicated ship, each peer will take on itself further non-authoritative physics for that excommunicated ship and all its interactions with objects in own authority. Those authoritatively own (but non authoritatively impacted), physics will be then sent as authoritative data of own ship and at the same time receive authoritative (but non authoritatively impacted) data for other ships that interacted with each its own version of excommunicated ship. Pretty soon each reality will have that missing ship at different place causing different "authorized" implications to be communicated further.

    Communication reestablished. Loose ship immediately collapses to newly connected authoritative peer calculated position which was completely unpredictable. All that is left are trails, bounces, damages, impacts of every other peers own physics, seemingly as if the ship was everywhere possible, with correct probability distribution.

    Is quirkiness, then, emerging from simple lack of sufficient realities communication?

    Let's try it this way:
    Suppose the peer messaging is extremely fast and frequent. It's just pouring excessive and redundant data at much faster rate than clients are ticking. We can presume then that all clients are enjoying same reality. No glitches or quirks what so ever. They hardly do any physics at all. Even better, let's just say that it is instant and all peers are absolutely synced at any time.

    Now suppose that there is no communication at all, or it is very rare. Each client has its own reality to deal with. Or here and there some objects gets their position synced on two peers. Islands of small realities.

    Somewhere in between, closer to extremely fast though, I suspect our reality with quantum quirks and weirdness exists. One where one peer can be singled out, and just depraved of any communication for long enough to create its own reality best it knows how, leaving others to cope with it. As long as no peer asks for it, reality for that ship is unknown, while implications of its existence are realized as if this ship went all possible paths.

    I am definitely way over my head here. Good luck explaining double slit with this. For one, obviously I don’t worry too much about conservation of energy, missing ship seems to deliver many time more energy than it has. My game engine does not really need to worry about that. I might just try and write a simulation and play with it. :smile:
  5. Jul 6, 2011 #4
    I think this is potentially fascinating, but I would agree with SpectraCat that the main deficiency is that objects exist in your network even when no one looks at them.

    A superior method might be to use true quantum random number cards on each networked peer to seed the algorithm code on each machine. Now there's no way for any one peer to know the state of any other peer without 'looking'.

    And then how about a neural network bot or genetic algorithm runs on one of the machines and tries to optimise it's strategy - I bet it won't beat the Born rule in terms of guessing :smile:
  6. Jul 7, 2011 #5
    In fact you only need the quantum random number generator on the server, which is essentially "god"/"the universe" for your game environment.

    You can get a usb stick for ~1000 euros http://www.idquantique.com/ordering/shop.html [Broken] (http://www.idquantique.com/true-random-number-generator/products-overview.html [Broken])
    Last edited by a moderator: May 5, 2017
  7. Jul 7, 2011 #6


    User Avatar
    Gold Member

    If you don’t need the high 16Mbps bite rate, you can save €1000 by using http://www.random.org/" [Broken] (atmospheric noise). It’s free.
    Last edited by a moderator: May 5, 2017
  8. Jul 7, 2011 #7
    But I think that's still classical randomness, in the idquantique adapters the random bits are generated by a pure quantum process (photons passing through a semi transparent mirror).

    I realise looka is trying to argue that quantum type phenomena might emerge from a purely deterministic game algorithm (due to complexities involved in peer-peer peer-server communication), but such a model for reality has been ruled out unless some explicit non-locality exists (maybe the game algorithm can incorporate some kind of non-locality equivalent? )

    In any case, I think it would be very interesting to investigate such quantum random number driven game algorithms, just to see if something like the Born rule might emerge in some kind of optimal strategy adopted by a neural network bot or genetic algorithm

    (if the random number generator was C rand() function for example, you might get a 100% efficient bot if it could guess the seed, with QM random number generator you should never be able to beat the Born rule probabilistically)
    Last edited by a moderator: May 5, 2017
  9. Jul 7, 2011 #8


    User Avatar
    Gold Member

    Yes, you’re right, however atmospheric noise will probably qualify for ultimate "deterministic chaos" = impossible to predict.

    (... look at the guys struggling with weather prognoses ... :wink:)

    I think this is interesting; however simulations are always simulations and digital computers will always be digital, and it might be too 'optimistic' to expect ("self-generating") quantum phenomena out of game algorithms, no matter how complex – unless this was the main goal from start... (maybe it was??)

    I agree that non-locality and entanglement would be hardest to fix. True randomness is always available in some form. Numerical solution and code for the Schrödinger equation is available for free. But entanglement/non-locality, how does one fix that in a computer/network??? :uhh:

    Besides raw computational power, I don’t think P2P would bring anything extra 'to the table'. You could just use parallel instances, or (multi)threading, which gives you total control (master of universe :approve:). Maybe, if you run it on a single computer, you could fake 'entanglement' by simulating two entangled particles by executing two parallel threads. The main thread ('parent') would then be the "shared wavefunction"... 'taking care' of decoherence/correlations...

    The best to use would probably be OOP, to create classes and instances that would represent particles, wavefunctions, etc, consisting of public/protected properties & functions.

    I don’t know... maybe "Mission Impossible"...

    It would probably be quite "messy": How do you 'synchronize' events/decoherence?? What to do with HUP?? And how would you handle RoS?? :bugeye:

    I don’t know... A LOT to think about...

Share this great discussion with others via Reddit, Google+, Twitter, or Facebook