{"_id":"@ashnazg/chaos","_rev":"1-c166c1bda2eaf51db3ed7ea16cc876da","name":"@ashnazg/chaos","dist-tags":{"latest":"0.0.1"},"versions":{"0.0.1":{"name":"@ashnazg/chaos","version":"0.0.1","description":"a websocket-centric node.js game engine or state sync protocol","main":"server.js","author":{"name":"Alexander Mathews xander@ashnazg.com"},"license":"MIT","dependencies":{"@ashnazg/async-walk":"^1.0.0","@ashnazg/dumbfile":"^1.1.0","@ashnazg/yog":"^0.0.9","q":"^1.5.1"},"scripts":{"start":"node server.js"},"_id":"@ashnazg/chaos@0.0.1","dist":{"shasum":"6eedb93ba5e178da107a1d86e361827e6fd51ecf","integrity":"sha512-1a4/+rQlCmPmy1nrF7YZVYwKrWRBJditlUnxcyE8wU0r0sf6RZlsRqSgKAeopYq5yLOUlgeJfL7o0baR08vo3w==","tarball":"https://registry.npmjs.org/@ashnazg/chaos/-/chaos-0.0.1.tgz","fileCount":14,"unpackedSize":16400,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe0b1PCRA9TVsSAnZWagAAk1gP+wcpJRcs0BmU/1LD/7FW\nDesGg8QX9Wa00jTG1HlJMNnqze9uKKsnRQfxeMQjhbFR1t+VZjX4seohLl2n\ndhk5S6JQlErS4Lx+nJzexhCauLvdCImyg+sj2pq9ikg+Bv/BA/O0becIsitF\nwmwwMmTakFb3SYIreILYvxLK1YaA+RTi4HvTF8SrkOZYjJAVA2pmAM+raPDF\nedlAA8HhSNn2G4DY2Rvz8jqns1VoBETYUEY+gBhl4DqVZP+XY2jtFWyyz+bD\nukNro+t0VwvDzIqSK7Fpn+feMAzSNiKK2rsbI2CcjlZURBZe8VzOiD1QY6H0\naJfaqDIKWEbRGM6tOKIU8Bqi8GMeALBiWiu3vdQLDjY0033T9Ft4HsbTvGW4\n3LSytGsi+L08DUE0k8hACcB7tkxKdIhqL8h7TjXx3SXZIwboAGl9+NLpGOQy\nrGInQLh6nKIwsLJntvPRbC6aICqm8QliaHgnZYSXcqmxyXXa7P63AsALmRAd\nykYzMm2oXxQm5I5qmwsxtIHbsjMNmdOb8ZdLCtC32ll7Ww6Mw2caWtUL6/jK\niXT6yCb/65eFyV3EeuefXyNGif19mobXpKRb/x7B1UwYfhKGTp5pcBqmwZIY\nw4e6QLXXUyonLLt9Yab6l8IU65E0vDZNeBWF216AyJh/pL8ownRpLp9oRcr9\nNWej\r\n=hBJs\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCXWP6AOMNrx5BUTFpRkCgs6Y9vgxZHWXwIvUV6998S4gIhAPiBkDcJ6iH3Rk4Aamz+YpYuST95Y+zZjGoANLOZlz6q"}]},"maintainers":[{"name":"xander","email":"xander@ashnazg.com"}],"_npmUser":{"name":"xander","email":"xander@ashnazg.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/chaos_0.0.1_1590803790534_0.8284068421548663"},"_hasShrinkwrap":false}},"time":{"created":"2020-05-30T01:56:30.379Z","0.0.1":"2020-05-30T01:56:30.682Z","modified":"2022-04-04T15:45:50.848Z"},"maintainers":[{"name":"xander","email":"xander@ashnazg.com"}],"description":"a websocket-centric node.js game engine or state sync protocol","author":{"name":"Alexander Mathews xander@ashnazg.com"},"license":"MIT","readme":"---\ntitle: @ashnazg/chaos\nsidebar_label: chaos\n---\n<!--\n~/projects/ashnazg-npm/chaos/actor.js\n~/projects/ashnazg-npm/chaos/arena.js\n~/projects/ashnazg-npm/chaos/client.js\n~/projects/ashnazg-npm/chaos/clock.js\n~/projects/ashnazg-npm/chaos/server.js\n~/projects/ashnazg-npm/chaos/world.js\n~/projects/ashnazg-npm/chaos/state.js\n~/projects/ashnazg-npm/chaos/test.js\n-->\n\n**Terminology:** everything on your server is in a world; arenas are spaces/rooms/planets that people can interact in; actors are things that change and interact with each other.\n\nA server is an authoritative owner of a world; a client will simulate a world's events progressing but must recalibrate as server events come in.\n\nScaling horizontally: while a single server _can_ run all the arenas of your game, an underloaded server can take over an arena from an overloaded one; the new server acts like a client long enough to get\nall the state and actors over, and get clients of that arena reconnected repointed to the mirror. Once the old server sees that everything's ready it sends a promote{arena:42} message to the mirror to\nlet it know that it can disconnect and be the authority.\n\nStopgap mode:\n1. for now, build it in single-server mode.\n2. then for 2.0, make it so that the two servers pause while the transfer is handled.\n\n## actor\nAn actor is often an arena as well -- a ship on the space map is an actor, but is an arena to the gear and people inside.\n\n* An actor has an ID. (for the server's root, that's zero) (there's no IDs on disk; these are runtime only ephemera.)\n* an actor has two lists of children active and passive (active ones get tick events)\n\n## arena\nMaybe I don't need \"world\" as arenas can\n## client\n## server\n## world\n## clock\nIs API compatible with [my client one](mischievous#clock) so that a chaos client can reuse their graphics-driving clock here.\n\n(But serves side there's no need for animation frames, so the innards of chaos:clock are much simpler.)\n","readmeFilename":"README.md"}