Permalink
Browse files

Update README. Add License

  • Loading branch information...
Austin Kettner
Austin Kettner committed Jun 19, 2015
1 parent d9ed1a7 commit 4d46de884348d3c3f94863af47f3e245ea4de66d
Showing with 54 additions and 9 deletions.
  1. +39 −0 LICENSE.txt
  2. +15 −9 README.md
View
@@ -0,0 +1,39 @@
+Copyright Inkhorn Games and other contributors, https://inkhorn.co/
+
+This software consists of voluntary contributions made by many
+individuals. For exact contribution history, see the revision history
+available at https://github.com/InkhornGames/lockstep.io
+
+The following license applies to all parts of this software except as
+documented below:
+
+====
+
+The MIT License (MIT)
+
+Copyright (c) [2015] [Inkhorn Games]
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
+====
+
+All files located in the node_modules and external directories are
+externally maintained libraries used by this software which have their
+own licenses; we recommend you read them, as their terms may differ from
+the terms above.
View
@@ -2,7 +2,7 @@
A drop in Unity and NodeJS, Socket.IO based "Lockstep" implementation to support rapid development of online games in Unity.
-**This open source project is still in very early alpha development and is by no means to be considered production ready despite it's current usability! Security, scalability and stability are less of a present development concern than the ease of use to the average game developer with little or no extra boilerplate involved.**
+**This open source project is still in very early alpha development and is by no means to be considered production ready despite its current usability! Security, scalability, and stability are less of a present development concern than the ease of use to the average game developer with little or no extra boilerplate involved.**
#### Quick Start: Connecting NodeJS and Unity
@@ -42,7 +42,7 @@ ws://127.0.0.1:80/socket.io/?EIO=4&transport=websocket
9. Click play and wait a moment for the `LockstepIOComponent` and `SocketIOComponent` to connect and synchronize Lockstep timing with the server. Both scripts come default to auto-connect and sync with a local server.
-10. Assuming everything is running correctly and no firewalls are blocking the network traffic, the `Lockstep Ready` flag will become checked within a few seconds to signal lockstep synchronization. The `LastLockstepReady` string will contain debug information about all clients connected to the server.
+10. Assuming everything is running correctly and no firewalls are blocking the network traffic, the `Lockstep Ready` flag will become checked within a few seconds to signal lockstep synchronization. The `LastLockstepReady` string will contain debug information about all clients connected to the server.
#### Quick Start: The Issue Execute Command Cycle
@@ -69,11 +69,11 @@ Adding networked commands is as easy as sending them through the network with Is
#### Technical Discussion: What is Lockstepping?
-Starcraft, Age of Empires and Warcraft 3 all use lockstepping - not this particular library, rather the same idea. Lockstepping forces all user input to be broadcast over the network to be executed roughly 200ms into the future; Literally when you click to move a unit, there will always be a 200ms delay before the unit responds to your input. This 200ms, known as the "latency window" provides enough time for that command to reach all other networked players, then for that command to execute in synch across everyone's simulation of the game.
+Starcraft, Age of Empires, and Warcraft 3 all use lockstepping - not this particular library, rather the same idea. Lockstepping forces all user input to be broadcast over the network and executed roughly 200ms into the future; when you click to move a unit, there will always be a 200ms delay before the unit responds to your input. This 200ms, known as the "latency window", provides enough time for that command to reach all other networked players, then for that command to execute in synch across everyone's simulation of the game.
#### Technical Discussion: What is Deterministic Lockstepping?
-Physics simulation in *most* games is a "fuzzy" science, where numbers don't always need to be dead accurate, just "close enough" to look realistic. Normally this isn't a problem and the speed trade off pays for itself, but when we need to run multiple identical simulations on different machines (ie. a multiplayer game), that "fuzziness" starts to become a serious issue:
+Physics simulation in *most* games is a "fuzzy" science, where numbers don't always need to be dead accurate, just "close enough" to look realistic. Normally this isn't a problem and the speed trade off pays for itself, but when we need to run multiple identical simulations on different machines (ie. a multiplayer game), that "fuzziness" starts to become a serious issue:
```
If in Player A's simulation the character just dodged the bullet in time, but in Player B's simulation the character didn't dodge that same bullet in time - strictly due to fuzziness - our two simulations are no longer in sync and we aren't sharing a game state any longer. We call this non-deterministic physics.
@@ -89,18 +89,24 @@ The random number generator in Unity can be made to be deterministic by shared s
Unity uses two physics engines internally, one for 2D and one for 3D - both of these engines run on floating point calculations; that is to say: they use floats to do their math. Floats are a great way to store numbers fairly accuratly up to a few decimal places, but unfortunately "fairly accurately" means different CPU hardware can use different algorithms for floating point calculations.
-If we tell two different computers to add `1.00000001 + 1.00000001`, one computer will likely tell us the answer is `2`, while the other computer tells us the answer is `2.00000002` or even something you wouldn't naturally expect like `2.0000145` (an artifact of low floating point accuracy).
+If we tell two different computers to add `1.00000001 + 1.00000001`, one computer will likely tell us the answer is `2`, while the other computer tells us the answer is `2.00000002` or even something you wouldn't naturally expect like `2.0000145` (an artifact of low floating point accuracy).
In game physics, a "close enough" answer is faster to calculate, and for almost all circumstances far more than enough accuracy! However, determinism says that these tiny floating point differences can't exist between machines or the state will almost immedately fall out of sync thatnks to the Chaos Effect, also known as the Butterfly Effect.
So as of writing this, no, Unity is not deterministic because of the floating point physics engine. This problem could be corrected with much slower deterministic virtualized floats (similar to what Java can do with special compiler flags), whereby floating point calculations happen at the slower software layer rather than at the much faster the hardware accellerated layer.
#### Technical Discussion: Is Unreal Deterministic?
-Unreal unfornationaly appears to suffer from the same problem as Unity, whereby physics are only "deterministic enough" to allow frame by frame synchronization of all game details with minimal "wobble". This works great for up to 16 game objects in realtime, but as that number of game objects grow the amount of data being transported quickly explodes out of control.
+Unreal unfortunately appears to suffer from the same problem as Unity, whereby physics are only "deterministic enough" to allow frame by frame synchronization of all game details with minimal "wobble". This works great for up to 16 game objects in realtime, but as that number of game objects grow the amount of data being transported quickly explodes out of control.
-For example: in a deterministic lockstep simulation, a unit could move across an entire map by sending a single packet "move unit X across the map". Because the simulation is deterministic and lockstep gaurantees execution time, each computer finds the exact same path for the unit across the map without communicating any further.
+For example: in a deterministic lockstep simulation, a unit could move across an entire map by sending a single packet "move unit X across the map". Because the simulation is deterministic and lockstep guarantees execution time, each computer finds the exact same path for the unit across the map without communicating any further.
-In a non deterministic lockstep simulation, a unit needs to send packets each frame declaring it's position on the "host" machine "unit X is at 21, 20", "unit x is at 21, 21", "unit x is at 21, 22", etc. Instead of one packet to move a single unit we could potentially need millions.
+In a non-deterministic lockstep simulation, a unit needs to send packets each frame declaring its position on the "host" machine "unit X is at 21, 20", "unit x is at 21, 21", "unit x is at 21, 22", etc. Instead of one packet to move a single unit we could potentially need millions.
-Most first person shooters don't require true determinism because they can handle realtime positioning of 8 or so units no problem, but real time strategies featuring more than 100 units on the map will absolutely require lockstep determinism to work on todays internet connections (even the fastest, or local connections choke out at 200 or less units).
+Most first person shooters don't require true determinism because they can handle realtime positioning of 8 or so units without problem, but real time strategies featuring more than 100 units on the map will absolutely require lockstep determinism to work on today's internet connections (even the fastest or local connections choke out at 200 or less units).
+
+## Brought to you by [Inkhorn Games](http://inkhorn.co)
+Developed for our upcoming title Battle Brigades ([subreddit](http://www.reddit.com/r/battlebrigades)).
+
+Connect with us:
+[Facebook](https://www.facebook.com/inkhorngames) | [Twitter](https://twitter.com/inkhorngames) | [Youtube](http://youtube.com/inkhorncompany)

0 comments on commit 4d46de8

Please sign in to comment.