After being disheartened at the end of last week facing a seemingly unfixable problem, I had a reasonably positive start, uninstalling, deleting and reinstalling things left-right-and-centre until finally I had it functional again. Unfortunately, the next day I ran in to the same issue and could not work out what it was that I had done that had fixed it. The first thing I tried was the last thing I had done before which involved reinstalling the JDK but that proved fruitless. I happened across the solution whilst procrastinating on twitter:
A totally random tweet from the lead technical writer at Improbable using the internal bugfix note for my bug as an example of something else entirely. This gave me what I needed to track down the cause and fix of the bug (which was technically improbable’s fault and not mine which made me feel a little relieved).
Now I could continue working properly on the project I linked the ui to the player entity which is spawned in when a client connects to the deployment. Values on the ui can be changed by the user and then when the reset button is pressed the simulation is restarted using the values on the ui. Pressing the reset button causes the player to send out a global SpatialOS query which returns all entities with an ‘Initialiser’ SpatialOS component. This map of entities is then used to send a command to each entity with the new simulation properties to be used. When the entities receive this command, their properties are updated according to the received values therefore restarting the simulation. This is tested locally and works as expected.