experimental patches for online coop#986
experimental patches for online coop#986Himanshu-01 wants to merge 2 commits intopnill:development-newfrom
Conversation
Himanshu-01
commented
Feb 19, 2026
- Can go ingame from coop lobby but has few bugs to be fixed (bsp/checkpoints - requires simulation_queue encoding/decoding)
- game will also desync randomly if it feels like it, <OUT OF SYNC, random seed differs> , something to do with weapons and projectiles , to be further investigated
networking and ui patches
this does not fix the desyncs
|
|
||
| /* private code */ | ||
|
|
||
| void __cdecl player_action_encode(c_bitstream* packet, struct player_action* action) |
There was a problem hiding this comment.
The 4 functions here aren't private, they're publicly accessible in simulation_encoding.h
| } | ||
|
|
||
|
|
||
| void __cdecl synchronous_update_encode(c_bitstream* packet, struct simulation_update* update) |
There was a problem hiding this comment.
name for this is simulation_update_encode
|
|
||
| int8 player_index = 0; | ||
| player_action* action = update->player_actions; | ||
| do |
| packet->write_bool("flush-gamestate", update->flush_gamestate); | ||
| packet->write_integer("verify-game-time", update->game_time_ticks, SIZEOF_BITS(update->game_time_ticks)); | ||
| packet->write_integer("verify-random", update->random_seed, SIZEOF_BITS(update->random_seed)); | ||
|
|
There was a problem hiding this comment.
get encoded size here and include fatal network event for update
| else | ||
| { | ||
| int32 update_itr = 0; | ||
| if (player_update_count > 0) |
There was a problem hiding this comment.
for loop here instead of the if followed by do while loop
|
|
||
| int8 player_index = 0; | ||
| player_action* action = update->player_actions; | ||
| do |
| @@ -16,5 +18,7 @@ struct simulation_machine_update | |||
| /* prototypes */ | |||
|
|
|||
| void __cdecl simulation_player_update_encode(c_bitstream* packet, const simulation_player_update* player_update); | |||
There was a problem hiding this comment.
place struct before simulation_player_update in both function prototypes here so we can get rid of #include "simulation_players.h"
|
|
||
| /* structures */ | ||
|
|
||
| struct simulation_update; |
There was a problem hiding this comment.
We don't need the forward declaration here
| WriteValue(Memory::GetAddress(0x41F6B1), 0); | ||
| } | ||
|
|
||
| if (options |
There was a problem hiding this comment.
Should probably add a comment before this explaining why we're calling the function here
| if (!game_is_playback() && simulation_reset_in_progress())// // make sure simulation is still in resetting | ||
| { | ||
| sim_globals->world->send_player_acknowledgements(true); | ||
| if (sim_globals->world->exists() && !sim_globals->world->is_authority()) |
There was a problem hiding this comment.
There should be an assert here to make sure simulation_globals.simulation_reset_in_progress is true. Should we leave the conditions as is and include the assert or is there some other code that's calling this that shouldn't be?
|
|
||
| // increase the network heap size | ||
| WriteValue<int32>(Memory::GetAddress(0x1ACCC8, 0x1ACE96) + 6, k_network_heap_size); | ||
| WriteValue<int32>(Memory::GetAddress(0x1ACCE0) + 6, k_network_heap_size); //increase network heap for campaign |
There was a problem hiding this comment.
I think we should fix the function call at 0x1ACCB7 and make it use map_memory_configuration_is_campaign_offline rather than map_memory_configuration_is_campaign