ludic.zones: a player's radius never past no fog's 900 m
A 1 km fog gave a 1040 m zone, more of the world than no fog's 900 m (2405 MB and 1029 nav tiles against 2294 MB and 753 in the fog profile). zones_radius is min(max(fog + 40, 150), 900); the test holds 1 km and 860 m at 900. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
b2550ca58a
commit
509b5ef111
3 changed files with 7 additions and 4 deletions
|
|
@ -18,10 +18,11 @@ export state ZonesState {
|
|||
zn_cn: words = words(ZONES_MAX) # how many discs it holds
|
||||
}
|
||||
|
||||
# a player's radius from how far they see: fog_dist <= 0 is no fog
|
||||
# a player's radius from how far they see: fog_dist <= 0 is no fog; never past no fog's, so a far fog
|
||||
# never keeps more of the world than none does
|
||||
export function zones_radius(fog_dist: float) -> float {
|
||||
if fog_dist <= 0.0 { return ZONES_NO_FOG }
|
||||
return Math.max(fog_dist + ZONES_PAST_FOG, ZONES_LEAST)
|
||||
return Math.min(Math.max(fog_dist + ZONES_PAST_FOG, ZONES_LEAST), ZONES_NO_FOG)
|
||||
}
|
||||
|
||||
export function zones_set(zones_st: mut ZonesState, pid: int, x: float, z: float, r: float) -> void {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue