diff --git a/buildsettings.h b/buildsettings.h index 6a52a6b..835875f 100644 --- a/buildsettings.h +++ b/buildsettings.h @@ -26,8 +26,8 @@ #define DEBUG_TOOLS #define CHIPMUNK_INTEGRITY_CHECK // #define FAT_THRUSTERS -#define NO_GRAVITY -#define NO_SUNS +// #define NO_GRAVITY +// #define NO_SUNS #else diff --git a/gamestate.c b/gamestate.c index 91e379a..e9b2492 100644 --- a/gamestate.c +++ b/gamestate.c @@ -2367,9 +2367,9 @@ void create_initial_world(GameState *gs) { const double mass_multiplier = 10.0; EntityID suns[] = { - create_sun(gs, new_entity(gs), ((cpVect){800.0, 0.0}), ((cpVect){0.0, 0.0}), 1000000.0 * mass_multiplier, 30.0), - create_sun(gs, new_entity(gs), ((cpVect){800.0, 100.0}), ((cpVect){60.0, 0.0}), 10000.0 * mass_multiplier, 20.0), - create_sun(gs, new_entity(gs), ((cpVect){800.0, -100.0}), ((cpVect){-60.0, 0.0}), 10000.0 * mass_multiplier, 20.0), + create_sun(gs, new_entity(gs), ((cpVect){500.0, 0.0}), ((cpVect){0.0, 0.0}), 1000000.0 * mass_multiplier, 30.0), + create_sun(gs, new_entity(gs), ((cpVect){500.0, 100.0}), ((cpVect){30.0, 0.0}), 10000.0 * mass_multiplier, 20.0), + create_sun(gs, new_entity(gs), ((cpVect){500.0, -100.0}), ((cpVect){-30.0, 0.0}), 10000.0 * mass_multiplier, 20.0), create_sun(gs, new_entity(gs), ((cpVect){-7000.0, -50.0}), ((cpVect){0.0, 0.0}), 100000.0 * mass_multiplier, 20.0), }; @@ -2390,11 +2390,12 @@ void create_initial_world(GameState *gs) { ORB_AT(cpv(x, 0.0)); } - create_bomb_station(gs, (cpVect){800.0, 800.0}, BoxExplosive); - // create_hard_shell_station(gs, (cpVect){800.0, 400.0}, BoxGyroscope); - create_bomb_station(gs, (cpVect){800.0, -800.0}, BoxCloaking); - create_bomb_station(gs, (cpVect){1600.0, 800.0}, BoxMissileLauncher); - create_hard_shell_station(gs, (cpVect){-7000.0, 200.0}, BoxMerge); +#define SUN_POS(index) (entity_pos(get_entity(gs, suns[index]))) + create_bomb_station(gs, cpvadd(SUN_POS(0), cpv(0.0, 300.0)), BoxExplosive); + create_bomb_station(gs, cpvadd(SUN_POS(0), cpv(0.0, -300.0)), BoxCloaking); + create_bomb_station(gs, cpvadd(SUN_POS(0), cpv(300.0, 0.0)), BoxMissileLauncher); + create_bomb_station(gs, cpvadd(SUN_POS(3), cpv(0.0, 300.0)), BoxMerge); +#undef SUN_POS #else Log("Creating debug world\n"); @@ -3237,7 +3238,7 @@ void process(struct GameState *gs, double dt) double vect_length = cpvlength(rel_vect); if (vect_length > SCANNER_MIN_RANGE) { - if (vect_length > SCANNER_MAX_RANGE) + if (vect_length > SCANNER_MAX_VIEWPORT_RANGE) { rel_vect = cpvmult(cpvnormalize(rel_vect), SCANNER_MAX_RANGE); } @@ -3266,8 +3267,8 @@ void process(struct GameState *gs, double dt) } cur_box->scanner_points[i] = (struct ScannerPoint){ .kind = (char)kind, - .x = (char)((rel_vect.x / SCANNER_MAX_RANGE) * 128.0), - .y = (char)((rel_vect.y / SCANNER_MAX_RANGE) * 128.0), + .x = (char)((rel_vect.x / SCANNER_MAX_VIEWPORT_RANGE) * 128.0), + .y = (char)((rel_vect.y / SCANNER_MAX_VIEWPORT_RANGE) * 128.0), }; } } diff --git a/types.h b/types.h index d2b9b44..57823ed 100644 --- a/types.h +++ b/types.h @@ -47,7 +47,7 @@ #define ORB_HEAL_RATE 0.2 #define ORB_MAX_FORCE 200.0 -#define VISION_RADIUS 12.0f +#define VISION_RADIUS 20.0f #define MAX_HAND_REACH 1.0f #define GOLD_COLLECT_RADIUS 0.3f #define BUILD_BOX_SNAP_DIST_TO_SHIP 0.2f @@ -67,14 +67,15 @@ #define SCANNER_ENERGY_USE 0.05f #define SCANNER_SCAN_RATE 0.5f #define SCANNER_RADIUS 1.0f -#define SCANNER_MAX_RANGE 1500.0 +#define SCANNER_MAX_RANGE 2000.0 +#define SCANNER_MAX_VIEWPORT_RANGE 400.0 #define SCANNER_MIN_RANGE 1.0 #define SCANNER_MAX_POINTS 10 #define MAX_SERVER_TO_CLIENT 1024 * 512 // maximum size of serialized gamestate buffer #define MAX_CLIENT_TO_SERVER 1024 * 10 // maximum size of serialized inputs and mic data -#define GRAVITY_CONSTANT 0.05f -#define GRAVITY_SMALLEST 0.01f // used to determine when gravity is clamped to 0.0f +#define GRAVITY_CONSTANT 0.01f +#define GRAVITY_SMALLEST 0.05f // used to determine when gravity is clamped to 0.0f #define INSTANT_DEATH_DISTANCE_FROM_CENTER 10000.0f #define SOLAR_ENERGY_PER_SECOND 0.09f #define DAMAGE_TO_PLAYER_PER_BLOCK 0.1f