doodle/pkg/uix
Noah Petherbridge 93623e4e8a Zipfiles as File Format for Levels and Doodads
Especially to further optimize memory for large levels, Levels and
Doodads can now read and write to a ZIP file format on disk with
chunks in external files within the zip.

Existing doodads and levels can still load as normal, and will be
converted into ZIP files on the next save:

* The Chunker.ChunkMap which used to hold ALL chunks in the main json/gz
  file, now becomes the cache of "hot chunks" loaded from ZIP. If there is
  a ZIP file, chunks not accessed recently are flushed from the ChunkMap
  to save on memory.
* During save, the ChunkMap is flushed to ZIP along with any non-loaded
  chunks from a previous zipfile. So legacy levels "just work" when
  saving, and levels loaded FROM Zip will manage their ChunkMap hot
  memory more carefully.

Memory savings observed on "Azulian Tag - Forest.level":

* Before: 1716 MB was loaded from the old level format into RAM along
  with a slow load screen.
* After: only 243 MB memory was used by the game and it loaded with
  a VERY FAST load screen.

Updates to the F3 Debug Overlay:

* "Chunks: 20 in 45 out 20 cached" shows the count of chunks inside the
  viewport (having bitmaps and textures loaded) vs. chunks outside which
  have their textures freed (but data kept), and the number of chunks
  currently hot cached in the ChunkMap.

The `doodad` tool has new commands to "touch" your existing levels
and doodads, to upgrade them to the new format (or you can simply
open and re-save them in-game):

    doodad edit-level --touch ./example.level
    doodad edit-doodad --touch ./example.doodad

The output from that and `doodad show` should say "File format: zipfile"
in the headers section.

To do:

* File attachments should also go in as ZIP files, e.g. wallpapers
2022-04-29 20:34:59 -07:00
..
magic-form Level Difficulty + UI Polish 2022-03-06 22:20:53 -08:00
actor_animation.go Switch JavaScript engine to goja 2022-01-16 20:09:27 -08:00
actor_collision.go Checkpoint Flag can Re-assign Player Character 2022-01-18 21:24:36 -08:00
actor_events.go Doodads: Use Key and Working Warp Doors 2021-01-03 15:19:21 -08:00
actor.go Invulnerable Anvil and other fixes 2022-02-20 11:48:36 -08:00
canvas_actors.go Optimize memory by freeing up SDL2 textures 2022-04-09 14:41:24 -07:00
canvas_cursor.go Change types int32 -> int per upstream render and ui library 2019-12-27 19:16:34 -08:00
canvas_editable.go Optimize memory by freeing up SDL2 textures 2022-04-09 14:41:24 -07:00
canvas_link_tool.go Doodads: Use Key and Working Warp Doors 2021-01-03 15:19:21 -08:00
canvas_memory.go Zipfiles as File Format for Levels and Doodads 2022-04-29 20:34:59 -07:00
canvas_present.go Remove MsgPack, Fix doodad display on top/left edges 2022-01-09 13:16:29 -08:00
canvas_scrolling.go Text Tool and Pan Tool 2022-03-05 15:34:20 -08:00
canvas_strokes.go Level Difficulty + UI Polish 2022-03-06 22:20:53 -08:00
canvas_wallpaper.go Stabilize Load Screen by Deferring SDL2 Calls 2021-07-19 17:14:00 -07:00
canvas_zoom.go Zoom And Edit 2021-09-11 17:02:01 -07:00
canvas.go Zipfiles as File Format for Levels and Doodads 2022-04-29 20:34:59 -07:00
crosshair.go Crosshair Option + Doodad Editor crash fix 2021-10-11 15:57:33 -07:00
scripting.go Reset Timer Doodad + Various Fixes 2022-03-27 11:51:14 -07:00