ashoulson / railgunnet Goto Github PK
View Code? Open in Web Editor NEWA Client/Server Network State-Synchronization Layer for Games
License: Other
A Client/Server Network State-Synchronization Layer for Games
License: Other
Entities are a standard class.
Snapshots contain:
Frame #
Entity Bag
Events
Entity contains:
Id
Priority(?)
BoxHolders
Has a function T GetBox() casts and returns the appropriate box from the boxholders.
BoxHolders are always stored in order(how?). BoxHolders contain typed Boxes. Each Box is end-user defined, implements Encode/Decode taking a bitpacker and potentially a basis Box (just cast it). Entity loops over all boxes and delta-serializes them.
Use a bitfield to stop the server from resending them unnecessarily
Handling for entities to refer to other entities. If the other entity hasn't been received yet, add a callback registration system to be notified when it has.
Note: For entity arrival callbacks, handle entity removal (I.e. The entity never arrived before it was called to remove, so kill the pending callback)
Encode 7 bits with the 8th bit indicating if there's another byte
If we have been getting packets but have't heard anything about an entity, notify that entity to freeze or hide.
If we're doing a full encode, we can just grab the latest state and copy over the initialization only values. Or to be safe, save the very first state and use that. Also can add "created tick" as an initialization value since it may be different from the tick the first state was sent from.
Wrap these up in a struct. Useful for bookkeeping with respect to removal of entities.
Does this make sense to add? No replacing values with older ones.
I love what you've done here and can't wait to start using it, but with no documentation and no example it's extremely difficult to figure out where to even start.
How do I register message recieved callbacks? How do I initialise a railgun entity? etc.
There's a reference to a Unity project folder, but it's not in the latest commit. Appreciate everything you've done, would be great if you could sort this so we can use it.
Thanks again!
Decode the state against the first state received as a dummy and then discard the result. This lets us read the rest of the snapshot without a problem.
Also need to add a status flag to the state for whether or not it was delta encoded (or it may be implicit from the tick offset)
Entity looks at last acked tick and generates a StateDelta that contains flags and field updates. Client receives StateDelta and dejitters them according to packet tick. Every client update, the client just gets the latest delta in the dejitter buffer and applies it.
Server-side entities only create a new state when theirs changes. Can keep 50 in buffer that aren't necessarily the last 50 frames. Solves the blackboard entity problem.
Probably will need to redo prediction with this system though.
Hello,
Running the demo (server, Unity build + unity player) on one computer I experienced a very noticeable lag in the the demo.
Is this expected? If not, it it due to the UPD library, to the physics engine or to some test code?
Thanks.
Dynamic Entities:
Blackboard Entities:
Both should live in the state/entity stream and blackboards should occupy entity slots when filling packets.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.