Skip to content

Commit

Permalink
Expose Mix variable, for probability of explored in border land
Browse files Browse the repository at this point in the history
  • Loading branch information
impaktor committed Oct 28, 2024
1 parent deeb285 commit 0e20c86
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/GalaxyConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ GalaxyConfig::GalaxyConfig()
std::map<std::string, std::string> &map = m_map[""];
map["GalaxyExploredMax"] = "90";
map["GalaxyExploredMin"] = "65";
map["GalaxyExploredMix"] = "40";

Read(FileSystem::userFiles, "galaxy.ini");

Expand Down
6 changes: 4 additions & 2 deletions src/galaxy/SectorGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,13 @@ bool SectorCustomSystemsGenerator::Apply(Random &rng, RefCountedPtr<Galaxy> gala

int GalaxyExploredMax = (SectorCustomSystemsGenerator::galaxyConfig->Int("GalaxyExploredMax"));
int GalaxyExploredMin = (SectorCustomSystemsGenerator::galaxyConfig->Int("GalaxyExploredMin"));
int GalaxyExploredMix = (SectorCustomSystemsGenerator::galaxyConfig->Int("GalaxyExploredMix"));
/*
* 0 - ~500ly from sol: explored
* ~500ly - ~700ly (65-90 sectors): gradual
* ~700ly+: unexplored
*/
if (((dist <= Square(GalaxyExploredMax)) && (dist <= Square(GalaxyExploredMin) || rng.Int32(dist) <= Square(40))) || galaxy->GetFactions()->IsHomeSystem(SystemPath(sx, sy, sz, sysIdx)))
if (((dist <= Square(GalaxyExploredMax)) && (dist <= Square(GalaxyExploredMin) || rng.Int32(dist) <= Square(GalaxyExploredMix))) || galaxy->GetFactions()->IsHomeSystem(SystemPath(sx, sy, sz, sysIdx)))
s.m_explored = StarSystem::eEXPLORED_AT_START;
else
s.m_explored = StarSystem::eUNEXPLORED;
Expand Down Expand Up @@ -174,13 +175,14 @@ bool SectorRandomSystemsGenerator::Apply(Random &rng, RefCountedPtr<Galaxy> gala

int GalaxyExploredMax = (SectorRandomSystemsGenerator::galaxyConfig->Int("GalaxyExploredMax"));
int GalaxyExploredMin = (SectorRandomSystemsGenerator::galaxyConfig->Int("GalaxyExploredMin"));
int GalaxyExploredMix = (SectorRandomSystemsGenerator::galaxyConfig->Int("GalaxyExploredMix"));

/*
* 0 - ~500ly from sol: explored
* ~500ly - ~700ly (65-90 sectors): gradual
* ~700ly+: unexplored
*/
if (((dist <= Square(90)) && (dist <= Square(65) || rng.Int32(dist) <= Square(40))) || galaxy->GetFactions()->IsHomeSystem(SystemPath(sx, sy, sz, customCount + i)))
if (((dist <= Square(GalaxyExploredMax)) && (dist <= Square(GalaxyExploredMin) || rng.Int32(dist) <= Square(GalaxyExploredMix))) || galaxy->GetFactions()->IsHomeSystem(SystemPath(sx, sy, sz, customCount + i)))
s.m_explored = StarSystem::eEXPLORED_AT_START;
else
s.m_explored = StarSystem::eUNEXPLORED;
Expand Down

0 comments on commit 0e20c86

Please sign in to comment.