From dc4ad8590f0e9798a6db85e0ab424914e0617938 Mon Sep 17 00:00:00 2001 From: Desour Date: Fri, 9 Feb 2024 19:18:57 +0100 Subject: [PATCH 1/2] Remove `active_block_range` and `active_object_send_range_blocks` from minetest.conf High values cause massive server lag ever few steps. I don't know why in this game the players would need to have a high active block range. --- minetest.conf | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/minetest.conf b/minetest.conf index 0d2ca04..68d3404 100644 --- a/minetest.conf +++ b/minetest.conf @@ -1,9 +1,7 @@ #time_speed = 4 dedicated_server_step = 0.03 item_entity_ttl = 1 -active_object_send_range_blocks = 32 -active_block_range = 32 ask_reconnect_on_crash = true player_transfer_distance = 0 max_objects_per_block = 1024 -max_packets_per_iteration = 2048 \ No newline at end of file +max_packets_per_iteration = 2048 From f5d7b9e10602dc216ff41b6d1757164a5e52442c Mon Sep 17 00:00:00 2001 From: Desour Date: Fri, 9 Feb 2024 19:33:37 +0100 Subject: [PATCH 2/2] Make find_nodes_in_area area in ai.lua flatter The track is flat after all. No need to waste >1ms here. --- mods/invector/ai.lua | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/mods/invector/ai.lua b/mods/invector/ai.lua index 4165d0a..5e2374b 100644 --- a/mods/invector/ai.lua +++ b/mods/invector/ai.lua @@ -55,8 +55,8 @@ function invector.ai.think(self) -- by lack of the node group. local cross = 0 local function preferential_waypoints(pos, target_pos) - local area_min = vector.new(node_pos.x-32, node_pos.y-32, node_pos.z-32) - local area_max = vector.new(node_pos.x+32, node_pos.y+32, node_pos.z+32) + local area_min = vector.new(node_pos.x-32, node_pos.y-2, node_pos.z-32) + local area_max = vector.new(node_pos.x+32, node_pos.y+2, node_pos.z+32) local node_target -- Scan for the start/finish line first if it's up next if invector.tracks[invector.current_track] == nil then @@ -96,18 +96,18 @@ function invector.ai.think(self) best_pos = k end end - + --local test_pos = node_targets[best_pos] --node_targets[math.random(1, #node_targets)] local test_pos = node_targets[best_pos] local x, z = solarsail.util.functions.yaw_to_vec(kart_yaw, 1) local kart_forwards = vector.new(x, 0, z) - local cross + local cross if test_pos == nil then else local delta = vector.normalize(vector.subtract(test_pos, kart_pos)) cross = vector.cross(delta, kart_forwards) - + --[[ minetest.add_particle({ pos = test_pos, @@ -187,7 +187,7 @@ function invector.ai.think(self) local look_vec = vector.new(lookx, 0, lookz) local kart_pos_new = table.copy(kart_pos) kart_pos_new.y = kart_pos_new.y + 0.25 - local center_look = + local center_look = Raycast(kart_pos_new, vector.add(kart_pos_new, vector.multiply(look_vec, 1.25)), false, false) local node_pos, node, node_def @@ -334,4 +334,4 @@ function invector.ai.think(self) end return controls, thonk_timer_new -end \ No newline at end of file +end