Flatline
|
The Flatline Project is the most recent attempt at Multiplayer for Oni. It will combine the knowledge gleaned from projects such as OniPlayer and Neo's engine hacking with new techniques of controlling AI characters to create the first working Multiplayer since the early days of Oni's development.
Status: Currently in winter hibernation. Most of the pointers have been found, and rossy has done up some sort of multithreaded server. A private sort of demo is avaliable, just ask Gumby. It all needs integrated together in C, and that will have to wait until Spring when rossy has more time and Gumby has more knowledge.
Player to Player Communication
Scores
Console write, functionality already in Daodan.
Chat
Chat will probably be handled through an popup input through the daodan.
Internal Communication
Player to Server
- Key bitset
- Mouse X\Y
Server to Player
- Bitsets+XY for all other players
- XYZ location
- Rotation
Dev Mode+Cheats
Only the server itself would have dev mode enabled. Admins would be able to send commands to the server through chat. All players have cheats disabled. (Enforceable through Daodan etc.)
Packets
- Warning, this isn't the most thought out of sections.
PPPPYYZZZZ…
PPPP = Destination players. Hex =>Binary etc If player limit was kept at 6, only one byte would be needed. Any more than that requires one more byte. Player => Server communication uses 0000 Server=> All players uses FFFF
YY =.Datatype
- 01 = Dev console command
- 02 = Keyboard bitset+XY
- 03 = XYZ position
- 04 = etc.
ZZZZ… = Data used with YY.
Example:
FFFF 01 646D7367282248656C6C6f20576f726C642229
Server is sending to all players to execute the Dev console command “dmsg("Hello World")”
Cycling
Class Changing
As dev mode is disabled (along with all cheats), we can use the Daodan to detect F8 being pressed, and not worry about the game also using that input.
At connection, the server would send a list of available characters. Pressing F8 in game (if allowed by server) sends out a dev mode command to all players to “chr_set_class player nextmodel”. Player being the player name or number, and nextmodel being pulled from the list.
Gun Cycling
If available (and implemented) gun cycling would work much like the above.
Maps
Probably done through level plugins that use levels 64-127. This has the advantage of being hidden on the level list. These maps would have specialized CHAR\PART\whatever tailored to MP gameplay. Of course a console map change command would need to be implemented. (win\lose level, and change current level number, through hex overwriting)
Lag Compensation
Quick and dirty lag compensation might come from "fast-forwarding" a frame for every 17 ms of lag or so. ( 17ms = 1 frame...damn that's short :( ) Compensating for rotation\movement differences will be a bit harder, and require a bit more calculation.