From cf1522d30335f656ac6c55f6024869e46ba24774 Mon Sep 17 00:00:00 2001 From: Tenari Date: Fri, 3 Apr 2026 08:40:19 -0500 Subject: [PATCH] tweaking balance a bit --- src/client.c | 4 ++++ src/server.c | 19 ++++++++++++++++--- src/shared.h | 4 ++-- 3 files changed, 22 insertions(+), 5 deletions(-) diff --git a/src/client.c b/src/client.c index db272fb..5bf796b 100644 --- a/src/client.c +++ b/src/client.c @@ -1094,6 +1094,10 @@ fn bool updateAndRender(TuiState* tui, void* s, u8* input_buffer, u64 loop_count } renderStrToBuffer(tui->frame_buffer, x_off, y_off++, sbuf, screen_dimensions); + MemoryZero(sbuf, SBUFLEN); + sprintf(sbuf, "(%d, %d)", state->pos.x, state->pos.y); + renderStrToBuffer(tui->frame_buffer, x_off, y_off++, sbuf, screen_dimensions); + if (user_pressed_enter) { for (u32 i = 0; i < STAR_SYSTEM_COUNT; i++) { if (state->pos.x == state->map[i].x && state->pos.y == state->map[i].y) { diff --git a/src/server.c b/src/server.c index e781789..b455846 100644 --- a/src/server.c +++ b/src/server.c @@ -1467,12 +1467,25 @@ i32 main(i32 argc, ptr argv[]) { // GAME LOGIC SETUP // set position of all star systems + state.map[0].x = 3; + state.map[0].y = 4; + state.map[1].x = 13; + state.map[1].y = 2; + state.map[2].x = 22; + state.map[2].y = 3; + state.map[3].x = 25; + state.map[3].y = 8; + state.map[4].x = 17; + state.map[4].y = 9; + state.map[5].x = 6; + state.map[5].y = 7; for (u32 i = 0; i < STAR_SYSTEM_COUNT; i++) { state.map[i].idx = i; state.map[i].name = STAR_NAMES[i]; - state.map[i].crime = rand() % 100; - state.map[i].x = rand() % MAP_WIDTH; - state.map[i].y = rand() % MAP_HEIGHT; + if (state.map[i].x == 0 && state.map[i].y == 0) { + state.map[i].x = rand() % MAP_WIDTH; + state.map[i].y = rand() % MAP_HEIGHT; + } // ensure all the star systems are "spaced out" a bit bool conflicting_pos = false; for (u32 ii = 0; ii < i; ii++) { diff --git a/src/shared.h b/src/shared.h index 92e19f0..2e7503c 100644 --- a/src/shared.h +++ b/src/shared.h @@ -71,7 +71,7 @@ global ShipTemplate SHIPS[] = { .vacuum_cargo_slots = 30, .climate_cargo_slots = 0, .passenger_berths = 0, .passenger_amenities_flags = 0, .smugglers_hold_cu_m = 0, .base_cost = 275000, - .cu_m_fuel = 2500, .cu_m_o2 = 800, + .cu_m_fuel = 2500, .cu_m_o2 = 700, }, { .type = ShipNX400, .drive_efficiency = 6, .life_support_efficiency = 5, @@ -434,7 +434,7 @@ static const char* MESSAGE_STRINGS[] = { fn u32 fuelCostForTravel(u32 drive_efficiency, Pos2 current, Pos2 dest) { u32 x_distance = Max(current.x, dest.x) - Min(current.x, dest.x); u32 y_distance = Max(current.y, dest.y) - Min(current.y, dest.y); - u32 fuel_per_dist = 100 - drive_efficiency*5; + u32 fuel_per_dist = 100 - drive_efficiency*6; return (x_distance + y_distance) * fuel_per_dist; }