Skip to content

Commit

Permalink
More penalty tweaks smh.
Browse files Browse the repository at this point in the history
  • Loading branch information
awgil committed Feb 24, 2024
1 parent 36ea9fc commit d8e37f2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion vnavmesh/NavVolume/VoxelSearch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@ public static int FindNearestEmptyVoxel(VoxelMap volume, Vector3 center, int hal
if (!volume[x, y, z])
{
var dist = (center - volume.VoxelToWorld(x, y, z)).Length();
if (x != cv.x || z != cv.z)
dist += volume.CellSize.Y; // penalty for moving sideways vs up - TODO reconsider...
if (y < cv.y)
dist += 2 * volume.CellSize.Y; // penalty for lower voxels to reduce chance of it being underground - todo reconsider..
dist += 2 * volume.CellSize.Y; // penalty for lower voxels to reduce chance of it being underground - TODO reconsider...
//Service.Log.Debug($"Considering {x}x{y}x{z}: {dist}, min so far {minDist}");
if (dist < minDist)
{
Expand Down

0 comments on commit d8e37f2

Please sign in to comment.