mirror of
https://github.com/IntQuant/noita_entangled_worlds.git
synced 2025-10-19 15:13:16 +00:00
turn down world sync time and enemy sync intervals,
This commit is contained in:
parent
090e02003b
commit
2d02856ef8
4 changed files with 17 additions and 13 deletions
|
@ -84,11 +84,11 @@ impl Default for GameSettings {
|
||||||
use_constant_seed: false,
|
use_constant_seed: false,
|
||||||
item_dedup: true,
|
item_dedup: true,
|
||||||
enemy_hp_mult: 1.0,
|
enemy_hp_mult: 1.0,
|
||||||
world_sync_interval: 2,
|
world_sync_interval: 3,
|
||||||
game_mode: GameMode::LocalHealth,
|
game_mode: GameMode::LocalHealth,
|
||||||
friendly_fire: false,
|
friendly_fire: false,
|
||||||
chunk_target: 32,
|
chunk_target: 32,
|
||||||
enemy_sync_interval: 2,
|
enemy_sync_interval: 3,
|
||||||
progress: Vec::new(),
|
progress: Vec::new(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -626,7 +626,7 @@ impl App {
|
||||||
ui.add_space(10.0);
|
ui.add_space(10.0);
|
||||||
ui.label("Amount of chunks host has loaded at once, synced enemies and physics objects need to be loaded in by host to be rendered by clients");
|
ui.label("Amount of chunks host has loaded at once, synced enemies and physics objects need to be loaded in by host to be rendered by clients");
|
||||||
ui.add(Slider::new(&mut game_settings.chunk_target, 1..=64));
|
ui.add(Slider::new(&mut game_settings.chunk_target, 1..=64));
|
||||||
if game_settings.world_sync_version == 2 {
|
/*if game_settings.world_sync_version == 2 {
|
||||||
ui.add_space(10.0);
|
ui.add_space(10.0);
|
||||||
ui.label(tr("World-will-be-synced-every-this-many-frames"));
|
ui.label(tr("World-will-be-synced-every-this-many-frames"));
|
||||||
ui.label(tr("Higher-values-result-in-less-performance-impact"));
|
ui.label(tr("Higher-values-result-in-less-performance-impact"));
|
||||||
|
@ -636,7 +636,7 @@ impl App {
|
||||||
ui.add_space(20.0);
|
ui.add_space(20.0);
|
||||||
|
|
||||||
ui.label("Enemy sync interval");
|
ui.label("Enemy sync interval");
|
||||||
ui.add(Slider::new(&mut game_settings.enemy_sync_interval, 1..=8));
|
ui.add(Slider::new(&mut game_settings.enemy_sync_interval, 1..=8));*/
|
||||||
|
|
||||||
ui.add_space(20.0);
|
ui.add_space(20.0);
|
||||||
ui.label(tr("connect_settings_player_tether_desc"));
|
ui.label(tr("connect_settings_player_tether_desc"));
|
||||||
|
|
|
@ -237,7 +237,7 @@ impl WorldManager {
|
||||||
let mut emit_queue = Vec::new();
|
let mut emit_queue = Vec::new();
|
||||||
|
|
||||||
// How many updates till we relinquish authority/stop listening.
|
// How many updates till we relinquish authority/stop listening.
|
||||||
let unload_limit = 36;
|
let unload_limit = 28;
|
||||||
|
|
||||||
for (&chunk, state) in self.chunk_state.iter_mut() {
|
for (&chunk, state) in self.chunk_state.iter_mut() {
|
||||||
let chunk_last_update = self
|
let chunk_last_update = self
|
||||||
|
|
|
@ -321,11 +321,14 @@ function enemy_sync.client_cleanup()
|
||||||
end
|
end
|
||||||
|
|
||||||
function enemy_sync.on_world_update_host()
|
function enemy_sync.on_world_update_host()
|
||||||
local num = 1
|
local int = 3 --ctx.proxy_opt.enemy_sync_interval
|
||||||
if ctx.proxy_opt.enemy_sync_interval == 1 then
|
local num = 2
|
||||||
|
if int == 1 then
|
||||||
num = 0
|
num = 0
|
||||||
|
elseif int == 2 then
|
||||||
|
num = 1
|
||||||
end
|
end
|
||||||
if GameGetFrameNum() % ctx.proxy_opt.enemy_sync_interval == num then
|
if GameGetFrameNum() % int == num then
|
||||||
enemy_sync.host_upload_entities()
|
enemy_sync.host_upload_entities()
|
||||||
end
|
end
|
||||||
if GameGetFrameNum() % 10 == 5 then
|
if GameGetFrameNum() % 10 == 5 then
|
||||||
|
|
|
@ -61,15 +61,15 @@ local function get_all_chunks(ocx, ocy, priority)
|
||||||
local grid_world = world_ffi.get_grid_world()
|
local grid_world = world_ffi.get_grid_world()
|
||||||
local chunk_map = grid_world.vtable.get_chunk_map(grid_world)
|
local chunk_map = grid_world.vtable.get_chunk_map(grid_world)
|
||||||
--local thread_impl = grid_world.mThreadImpl
|
--local thread_impl = grid_world.mThreadImpl
|
||||||
|
local int = 3 -- ctx.proxy_opt.world_sync_interval
|
||||||
if GameGetFrameNum() % ctx.proxy_opt.world_sync_interval == 0 then
|
if GameGetFrameNum() % int == 0 then
|
||||||
for cx = ocx - 1, ocx do
|
for cx = ocx - 1, ocx do
|
||||||
for cy = ocy - 1, ocy do
|
for cy = ocy - 1, ocy do
|
||||||
send_chunks(cx, cy, chunk_map)
|
send_chunks(cx, cy, chunk_map)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
net.proxy_bin_send(KEY_WORLD_END, string.char(priority))
|
net.proxy_bin_send(KEY_WORLD_END, string.char(priority))
|
||||||
elseif GameGetFrameNum() % (ctx.proxy_opt.world_sync_interval * 3) == 1 then
|
elseif GameGetFrameNum() % (int * 2) == 1 then
|
||||||
local nx = ocx
|
local nx = ocx
|
||||||
if iter_fast then
|
if iter_fast then
|
||||||
nx = nx - 2
|
nx = nx - 2
|
||||||
|
@ -83,7 +83,7 @@ local function get_all_chunks(ocx, ocy, priority)
|
||||||
end
|
end
|
||||||
net.proxy_bin_send(KEY_WORLD_END, string.char(priority + 1))
|
net.proxy_bin_send(KEY_WORLD_END, string.char(priority + 1))
|
||||||
iter_fast = not iter_fast
|
iter_fast = not iter_fast
|
||||||
elseif GameGetFrameNum() % (ctx.proxy_opt.world_sync_interval * 6) == 3 then
|
elseif GameGetFrameNum() % (int * 4) == 4 then
|
||||||
local nx = ocx
|
local nx = ocx
|
||||||
if iter_slow == 1 or iter_slow == 2 then
|
if iter_slow == 1 or iter_slow == 2 then
|
||||||
nx = nx - 3
|
nx = nx - 3
|
||||||
|
@ -124,7 +124,8 @@ function world_sync.on_world_update()
|
||||||
else
|
else
|
||||||
get_all_chunks(ocx, ocy, 16)
|
get_all_chunks(ocx, ocy, 16)
|
||||||
end
|
end
|
||||||
if GameGetFrameNum() % (ctx.proxy_opt.world_sync_interval * 6) == 3 then
|
local int = 3 -- ctx.proxy_opt.world_sync_interval
|
||||||
|
if GameGetFrameNum() % (int * 4) == 0 then
|
||||||
iter_cam = not iter_cam
|
iter_cam = not iter_cam
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue