Skip to content

LightGreen 0.4.0

Latest

Choose a tag to compare

@lmkHenlo lmkHenlo released this 27 Nov 05:34

Added

  • A moon at night. The sky draws its moon with its sun disc (as the game's own night skies do), but LightGreen left the disc pointing at the sun below the horizon, so LightGreen's nights had moonlight and no moon. After sunset the disc now goes where the moonlight comes from, drawn as the game's own night sky draws its moon (its size, phase and faint glow), growing in over the first degrees below the horizon. The presets' moonPhase is no longer used.
  • Effects.Stars (default 2): brighter stars at night, up to 4; higher also brings out fainter ones. They come out late at dusk, and rain, snow and cartoon rain's cloud hides them. Holes the game sets at night get theirs scaled the same way.
  • Thicker cloud in rain and snow (half as much under cartoon rain's mist), from the sky's own clouds.
  • City holes at night: a faint warm glow on the horizon from the streets, with Effects.CityNight.
  • Size limits: .cube files over 96 MB, and presets or filters files over 4 MB, are refused with their size in the log.
  • build.ps1 -Test runs offline checks (tests/Tests.cs) for the parts that work without the game: the .cube reader, the filter maths, the presets and filters files and the 27 built-in filters, the preset lookup, LightGreen's file handling (size limits, whole-file writes), the HUD maths, the weather art and pixels, LightGreen's random numbers and the material copy lookup. The build stops if one fails.
  • General.TimingLog also counts the garbage collections in each 10 s (Mono's collector stops the whole game while it runs), says when one fell in the worst or the longest frame, and gives the managed heap's size. The worst frame's line splits Time of day and Materials into steps ([steps: Time of day: capture …, Materials: tune …]), to find what a one-frame cost is made of.

Changed

  • If a game update breaks one of LightGreen's hooks while it runs, the hook now logs the error once and stands down, instead of throwing inside the game's own code every frame (the HUD markers, name tags and pop-up words, the grass, footprint, effect and lightning hooks). A renamed field the HUD markers read now leaves them at the game's size, with a line in the log.
  • The presets and filters files are written to a temporary file first, which then replaces the old one, so a crash or power cut while writing can't leave a cut-off file. A JSON file nested more than 64 levels deep is refused instead of closing the game.
  • Failures LightGreen used to pass over in silence (the camera mode, the course's own grading, the pipeline's colour table size, the .cube folder check) are logged once, with the error, so a game update that breaks one shows in the log. Errors are logged in full where only their message was.
  • A key in [Keys] the keyboard doesn't have is reported once in the log, instead of failing quietly every frame.
  • Less work and garbage every frame: the presets are looked up once per load instead of by name three times a frame, the time-of-day blend reuses one preset, lights are ranked once before they're sorted, and name matching is ordinal. Footprint fades now reach every particle of a print, however many it has.
  • The search for City lampposts now runs a little each frame (at most 0.5 ms), like the search for glowing windows, instead of looking at every object on the map in one frame at the start of a night City hole. Until it's done, the lamps of the hole before stay lit.
  • LightGreen's lightning flicker and rain splashes take their random numbers from LightGreen's own generator, so they no longer move the game's.
  • .cube filters are read on a worker thread: picking a big one (F11) no longer stops the game while it's read (a 65-point cube took about a tenth of a second or more). The filter before stays on screen until the new one is ready, a frame or two later. Every filter's colour table is worked out there too: picking any filter took 6.7-7.6 ms in its frame. Stepping past filters quickly skips working out the ones passed. Reading a .cube file makes about 3 MB of garbage instead of 24 MB for a 65-point cube (a string for each of its 274,625 lines), which brought on garbage collections, 16-18 per 10 s while stepping through filters.
  • Inside: the weather's sky, the sky and ambient light, the three weathers' shared frame logic, the one-weather rule and the JSON and texture helpers are each one class (WeatherSky, SkyLook, FallingWeather, Weather, JsonFile, TextureArt), and features hear about map and hole changes from the feature host (IMapAware).
  • The READMEs now say that Quality.SunShadowResolution and Quality.SunShadowDistance never go below the game's own values (to lower the shadow cost, set them to 0 and lower the game's own Shadow quality), cover the night sky, the .cube background read and the file size limits, and name Super Battle Golf 1.4.1-823, the version tested. The log's warning about a different Unity version names it too.
  • The timing log measures each frame's length with LightGreen's own clock. The game's frame time didn't match the work timed in that frame around loads ("21.5 ms … in a 2.8 ms frame").
  • Ball glow finds the balls from a list the game's own GolfBall.Awake adds to, instead of looking through the whole scene once a second (2.2-3.8 ms each time on City maps). A new ball glows from its first frame instead of within a second. If the hook doesn't fit a game update, the search once a second is used, as before.
  • The HUD's later looks after a load (at 1, 3 and 6 s) are skipped when the HUD hasn't changed since the first: the same canvases, with as many objects under each. A look went through all of the HUD's components, 2.7-13 ms.
  • F8, F9, F10 and F11 change their setting at once, but the config file is written once, half a second after the last key press (and when the game quits), instead of on each press: BepInEx rewrites the whole file each time, 1.9-5.1 ms an F11 press while stepping through filters. A config edit isn't reloaded while such a save waits.

Fixed

  • A .cube file with NaN or Infinity in it was refused with "N entries, but size needs M" instead of naming the line; it now names the line and the value. A NaN in DOMAIN_MIN or DOMAIN_MAX, or a number too big for a float, was read, and broke the filter when it was picked; those files are now refused too. A broken value from the filter maths can no longer reach the colour table either.
  • HUD name tags (HUD.NameTags) would stop working after a game update: the hook named the game's function with the number the compiler gave it, which changes when the game adds a method. The function is now found by its name alone.
  • Footprints in snow: after more than 4,096 prints were given the snow look in one session, LightGreen forgot which ones to put back, so a print reused off snow could keep the snow look. Only the prints the game has destroyed are forgotten now.
  • Ball glow: a ball's renderer without a property block of its own had any block taken off when the glow ended, so one the game put on it during the glow would be lost. The block is only taken off when it's still the glow's.
  • Materials: when nothing had been tuned, putting the materials back (at a map change, with F8, or off a hole) kept hold of the materials already looked at, and a look for materials cut short didn't start again until the next timed one, up to 10 s later.
  • Materials the game copies from a tuned one ("… (Instance)") are now given the original's stock values by name. They were matched by value alone, and two materials tuned to the same value but with different stock values could give a copy the wrong one after F8 or a map change.
  • Ambient occlusion without the grass: the grass-free depth was kept for the rest of the frame, so a camera rendered twice in one frame would have reused a texture from its first render. It's now drawn again for each render.
  • The City's street lamps, lit windows and night bloom, and ball glow, came on by day in rain, snow or cartoon rain; they now come on at night only. The weather dims the sun, and LightGreen counted that as dusk: with rain on a sunny hole, the lamps and glow came on part way (about a third). Day and night brightness, and the weather's own colours, still follow how dark the weather makes the scene, as before.
  • A .cube file with a space at either end of its name ("Omega Derry .cube") couldn't be picked: it was "not in the folder", and the next F11 went back to the first filter. Its filter is now named without the space. Two files whose names differ only by those spaces make one filter, with a line in the log.

Removed

  • An unused hook on the game's camera mode, and an unused time-of-day label.

Upgrading

Nothing to do. Effects.Stars is added to BepInEx/config/com.lightgreen.cfg, at 2. The presets' moonPhase is no longer read; it can stay in LightGreen.presets.json. .cube files over 96 MB, and presets or filters files over 4 MB, are now refused with their size in the log.

Install

With r2modman or the Thunderstore Mod Manager: https://thunderstore.io/c/super-battle-golf/p/lmkHenlo/LightGreen/

By hand: install BepInEx 5, then put LightGreen.dll from lmkHenlo-LightGreen-0.4.0.zip (below) in BepInEx/plugins.