Skip to content
This repository has been archived by the owner on Aug 20, 2024. It is now read-only.

Commit

Permalink
make some planets smaller (fever starting positions)
Browse files Browse the repository at this point in the history
  • Loading branch information
malytomas committed Jun 30, 2024
1 parent 9efaa53 commit 3087099
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
16 changes: 8 additions & 8 deletions sources/sdf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ namespace unnatural

Real sdfDisk(const Vec3 &pos)
{
return sdfCylinder(pos, 250, 1100) - 200;
return sdfCylinder(pos, 200, 600) - 100;
}

Real sdfBox(const Vec3 &pos)
Expand All @@ -44,17 +44,17 @@ namespace unnatural

Real sdfCube(const Vec3 &pos)
{
return sdfBox(pos, Vec3(650)) - 200;
return sdfBox(pos, Vec3(450)) - 100;
}

Real sdfTetrahedron(const Vec3 &pos)
{
return sdfTetrahedron(pos, 1000) - 200;
return sdfTetrahedron(pos, 600) - 100;
}

Real sdfOctahedron(const Vec3 &pos)
{
return sdfOctahedron(pos, 1400) - 200;
return sdfOctahedron(pos, 800) - 100;
}

namespace
Expand All @@ -70,12 +70,12 @@ namespace unnatural

Real sdfTriangularPrism(const Vec3 &pos)
{
return sdfTriangularPrismImpl(Vec3(pos[0], pos[2], pos[1]), 1700, 1000) - 200;
return sdfTriangularPrismImpl(Vec3(pos[0], pos[2], pos[1]), 300, 900) - 100;
}

Real sdfHexagonalPrism(const Vec3 &pos)
{
return sdfHexagonalPrism(Vec3(pos[0], pos[2], pos[1]), 900, 650) - 200;
return sdfHexagonalPrism(Vec3(pos[0], pos[2], pos[1]), 300, 400) - 100;
}

Real sdfTorus(const Vec3 &pos)
Expand Down Expand Up @@ -237,7 +237,7 @@ namespace unnatural
Vec3 p = Vec3(pos[0], pos[2], 0);
p = Quat(Rads(), Rads(), angle) * p;
p = Vec3(p[0], pos[1], p[1]);
return sdfHexagonalPrism(p);
return sdfHexagonalPrism(Vec3(p[0], p[2], p[1]), 900, 650) - 200;
}

namespace
Expand Down Expand Up @@ -327,7 +327,7 @@ namespace unnatural

Real sdfInsideCube(const Vec3 &p)
{
return -sdfCube(p);
return -(sdfBox(p, Vec3(1300)) - 200);
}

Real sdfAsteroid(const Vec3 &p)
Expand Down
6 changes: 3 additions & 3 deletions sources/startingPositions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ namespace unnatural
for (uint32 i : spatQuery->result())
if (tiles[i].buildable)
b++;
static constexpr uint32 Threshold = CAGE_DEBUG_BOOL ? 400 : 2000;
static constexpr uint32 Threshold = CAGE_DEBUG_BOOL ? 200 : 2000;
return b < Threshold;
});
}
Expand Down Expand Up @@ -142,7 +142,7 @@ namespace unnatural
if (!valid)
continue;
proposal.insert(p);
if (proposal.size() >= 10)
if (proposal.size() >= 20)
break;
}
return std::move(proposal.unsafeData());
Expand All @@ -162,7 +162,7 @@ namespace unnatural
for (uint32 attempt = 0; attempt < Limit; attempt++)
{
std::vector<uint32> proposal = proposeSolution(allCandidates);
if (proposal.size() < 3)
if (proposal.size() < 2)
continue;
if (proposal.size() < startingPositions.size())
continue;
Expand Down

0 comments on commit 3087099

Please sign in to comment.