Skip to content

Commit

Permalink
fix: trims off effect layers, makes rendering a bit more sane (#295)
Browse files Browse the repository at this point in the history
* Adds a wider span for layers without mixup with planes

The existing multiplier is lower then layer values encoraged by byond,
so it breaks easy. Hopefully a larger value will help here.

* let's lower that down to make INF less likely

* fuckoff big number

* offset strategy
  • Loading branch information
LemonInTheDark committed Jul 5, 2024
1 parent fa6be85 commit 47c9aa0
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions internal/app/render/bucket/level/chunk/unit/unit.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,21 @@ func countLayer(p *dmmprefab.Prefab) float32 {
plane, _ := p.Vars().Float("plane")
layer, _ := p.Vars().Float("layer")

// Layers can have essentially effect values added onto them
// We should clip them off to reduce the max possible layer to like 4999 (likely far lower)
const BACKGROUND_LAYER = 20_000
const TOPDOWN_LAYER = 10_000
const EFFECTS_LAYER = 5000
if layer > BACKGROUND_LAYER {
layer -= BACKGROUND_LAYER
}
if layer > TOPDOWN_LAYER {
layer -= TOPDOWN_LAYER
}
if layer > EFFECTS_LAYER {
layer -= EFFECTS_LAYER
}

Check failure on line 108 in internal/app/render/bucket/level/chunk/unit/unit.go

View workflow job for this annotation

GitHub Actions / Lint Source Code

File is not `gofmt`-ed with `-s` (gofmt)
layer = plane*10_000 + layer*1000

// When mobs are on the same Layer with object they are always rendered above them (BYOND specific stuff).
Expand Down

0 comments on commit 47c9aa0

Please sign in to comment.