Friday, 11 December 2015

Off Grid Sprint Update 11.12.2015 - File transfers

Our last sprint was mainly about building the simulation of mobile and wireless networks, how devices connect to them, and converting all out existing data systems to send the data through these networks. But of course the goal wasn’t just for the existing things to work with the networks, there was a bigger reason why we needed to build that simulation…

Sending files

The plan has always been that the players should be able to select any data file, and then send it to any device in the level (based on the network connections available, of course). And that’s exactly what the last sprint’s network & device simulation allowed us to build. So, this time we concentrated on all the systems ad user interfaces needed for the players to use this feature.

So, the “Send to”-option in our File Manager UI is now finally doing something! Selecting it will display a popup list of all the devices on all networks the player is currently connected to, and also some background information about that device (MAC address, IP address, and the network through which that device is available). When the player selects the device to send data to, the system then picks the most secure network connection available for both devices and uses that to transfer the data.

What use is this feature, then? That’s what we’ll deal with in next sprint, but right away it already gives the players some useful options. For example, the player can get the exact location of any guard simply by sending any random piece of data to that guard’s phone, and then observing where in the level the new data point appears. Even more interesting is what you can do with the drones in our harbour level, as their patrol routes are defined purely by data points… Scan any of the data defining a drone’s route, and you can then send it to any device or guard in the level to create a new patrol point data at that location. Wait a bit, and sooner or later the drone will head towards that patrol point. Handy way to make sure the drone is out of your way, especially if you then delete any of the original patrol point data to make the drone won’t come back.

We also changed the Office level to be completed using this mechanic, so rather than just swiping your phone to transfer the documents to the Mesh node, you instead plant the node, connect to the Mesh network, and then send the files to HackerHQ device only visible through the Mesh connection.

The next task, and also the final piece of our data systems puzzle, is adding some form of payload to the data, something that the AI and the devices can react to in more complicated ways (without having to program a separate version of the NetDevices or AI components just to check for a specific data file and hardcode some form of reaction to it). Right now it seems like we’ll probably end using Lua scripts for this purpose, attaching an optional Lua file to a data is simple enough, and when receiving any data with such attachment the receiver NetDevice can then execute the script to decide if it should do anything special with that data. If the script instructs so, the device can then pass the Lua script to the AI or any other component in our characters and devices.

The benefit here would be that the Lua scripts would be easily editable outside of the game, avoiding having to hard-code any of this functionality on the game side. Rather than having a specific version of NetDevice on a vending machine, waiting for certain piece of data, or specific AI version on a character looking for some SMS message, we’ll have a piece of data that can be executed, and that can then check “was I sent to a vending machine?” or “was I sent to a character with a certain name, and what is he doing at the moment?”. This should make things much easier for us, but also for any future modding and level editing purposes.

User interface improvements

Getting the popup menu for sending data up and running required a fair bit of work on the UI side as well, and decided to improve a few other things at the same time.

We now have a generic popup menu system, rather than a separate pre-defined UI element for each different menu. Much less code and much easier to work with. So we immediately changed the old File options menu to use this, and also converted the developer options to a popup menu as well.
While at it, we also added icons support for the popup menu, with unique icons for each option in file options menu, network icons in the devices list popup, and check boxes for the settings that can be enabled and disabled in the Developer menu.

File manager and file viewer gained some extra device and network information, UI scrolling now works correctly and scrolls whatever menu is currently active, rather than always scrolling the main menu window.

…and finally we cleaned lots of the mess from the UI CSS theme, using more generic classes to make it easier to change the UI look and feel throughout the whole user interface with less changes on CSS side.

Small fixes & changes

The rest of the work was pretty much small fixes and little changes here and there:
  • NetDevices will now automatically generate their own MAC address if one isn’t defined in Unity editor

  • NetConnection automatically assigns IP address to devices.

  • Devices always refer most secure available connection, Mesh rather than WiFi, and WiFi instead of mobile connection.

  • Only one app used for manipulating data in the environment can be enabled at a time. Turning one app on will automatically switch off the others.

  • Data Save & Data Delete apps now correctly check for the player’s network connections and access level, and only allow interaction with data points the player is actually able to see at that moment.
That’s pretty much it for this time, we’ll likely end being pretty busy testing the Lua stuff for a while but expect to hear more in early January 2016!

No comments: