Commit Graph

9 Commits (79996ccd346b)

Author SHA1 Message Date
Noah 03cd1d4ca0 Binary format for chunks in zipfiles 2023-02-18 12:45:36 -08:00
Noah c5353df211 LoadUnloadChunk for Memory Optimization
Instead of the loadscreen eager-loading ALL level chunks to Go Images, only
load the chunks within the "LoadingViewport" - which is the on-screen
Viewport plus a margin of chunks off the screen edges.

During gameplay, every few ticks, reevaluate which chunks are inside or
outside the LoadingViewport; for chunks outside, free their SDL2 textures
and free their cached bitmaps to keep overall memory usage down. The
AzulianTag-Forest level now stays under 200 Textures at any given time
and the loadscreen goes faster as it doesn't have to load every chunk's
images up front.

The LoadUnloadChunk feature can be turned on/off with feature flags. If
disabled the old behavior is restored: loadscreen loads all images and
the LoadUnloadChunks function is not run.

Other changes:

* loadscreen: do not free textures in the Hide() function as this runs on
  a different goroutine and may break. The 4 wallpaper textures are OK
  to keep in memory anyway, the loadscreen is reused often!
* Free more leaked textures: on the Inventory frame and when an actor
  calls Self.Destroy()
* Stop leaking goroutines in the PubSub feature of the doodad script
  engine; scripting.Supervisor.Teardown() sends a stop signal to all
  scripts to clean up neatly. Canvas.Destroy() tears down its scripting
  supervisor automatically.
2022-04-10 12:40:25 -07:00
Noah af6b8625d6 Flood Tool, Survival Mode for Azulian Tag
New features:
* Flood Tool for the editor. It replaces pixels of one color with another,
  contiguously. Has limits on how far from the original pixel it will color,
  to avoid infinite loops in case the user clicked on wide open void. The
  limit when clicking an existing color is 1200px or only a 600px limit if
  clicking into the void.
* Cheat code: 'master key' to play locked Story Mode levels.

Level GameRules feature added:
* A new tab in the Level Properties dialog
* Difficulty has been moved to this tab
* Survival Mode: for silver high score, longest time alive is better than
  fastest time, for Azulian Tag maps. Gold high score is still based on
  fastest time - find the hidden level exit without dying!

Tweaks to the Azulians' jump heights:
* Blue Azulian:  12 -> 14
* Red Azulian:   14 -> 18
* White Azulian: 16 -> 20

Bugs fixed:
* When editing your Palette to rename a color or add a new color, it wasn't
  possible to draw with that color until the editor was completely unloaded
  and reloaded; this is now fixed.
* Minor bugfix in Difficulty.String() for Peaceful (-1) difficulty to avoid
  a negative array index.
* Try and prevent user giving the same name to multiple swatches on their
  palette. Replacing the whole palette can let duplication through still.
2022-03-26 13:55:06 -07:00
Noah 0a8bce708e Actor Zoom + Experimental Settings GUI
Improvements to the Zoom feature:
* Actor position and size within your level scales up and down
  appropriately. The canvas size of the actor is scaled and its canvas
  is told the Zoom number of the parent so it will render its own
  graphic scaled correctly too.

Other features:
* "Experimental" tab added to the Settings window as a UI version of the
  --experimental CLI option. The option saves persistently to disk.
* The "Replace Palette" experimental feature now works better. Debating
  whether it's a useful feature to even have.
2021-09-11 21:18:22 -07:00
Noah d9bca2152a WIP Publish Dialog + UI Improvements
* File->Publish Level in the Level Editor opens the Publish window,
  where you can embed custom doodads into your level and export a
  portable .level file you can share with others.
* Currently does not actually export a level file yet.
* The dialog lists all unique doodad names in use in your level, and
  designates which are built-ins and which are custom (paginated).
* A checkbox would let the user embed built-in doodads into their level,
  as well, locking it in to those versions and not using updated
  versions from future game releases.

UI Improvements:
* Added styling for a "Primary" UI button, rendered in deep blue.
* Pop-up modals (Alert, Confirm) color their Ok button as Primary.
* The Enter key pressed during an Alert or Confirm modal will invoke its
  default button and close the modal, corresponding to its Primary
  button.
* The developer console is now opened with the tilde/grave key ` instead
  of the Enter key, so that the Enter key is free to click through
  modals.
* In the "Open/Edit Drawing" window, a "Browse..." button is added to
  the level and doodad sections, spawning a native File Open dialog to
  pick a .level or .doodad outside the config root.
2021-06-10 22:36:22 -07:00
Noah 640e75ba4d Custom Wallpapers for Levels
* You can now browse for a custom wallpaper image to use with your
  levels. A platform-native file picker dialog is used (no WASM support)
* In the New/Edit Level Properties dialog, the Wallpaper drop-down
  includes an option to browse for a custom map.
* When editing an existing level: the wallpaper takes effect immediately
  in your level once the file is picked. For NEW levels, the wallpaper
  will appear once the "Continue" button is pressed.
* All common image types supported: png, jpeg, gif.
* The wallpaper is embedded in the level using the filepath
  "assets/wallpapers/custom.b64img" as a Base64-encoded blob of the
  image data.
* The `doodad show` command will list the names and sizes of files
  embedded in levels. `doodad show --attachment <name>` will get an
  attachment and print it to the console window.
* To extract a wallpaper image from a level:
  `doodad show -a assets/wallpapers/custom.b64img | base64 -d > out.png`
2021-06-06 18:59:04 -07:00
Noah ba29f407cc SelectBoxes in Add/Edit Level Window
* Replace the radio buttons for Page Type and Wallpaper with the new
  SelectBox widgets from the UI toolkit.
* Choice of default palette also switched from a MenuButton to
  a SelectBox widget.
* Experimental "Browse..." option added to the Wallpaper drop-down when
  run in --experimental mode; not yet functional.
2021-06-06 14:32:52 -07:00
Noah 3d8eedce35 Choice of palette when creating a new level
* In the "New Level" dialog, a "Palette:" option shows a MenuButton
  drop-down with options: Default, Colored Pencil, and Blueprint. These
  control the set of colors the new level starts with.
2021-06-05 20:51:20 -07:00
Noah 6e40d58010 WIP Zoom Tool
* Added Feature Flag support, run doodle with --experimental to enable
  all flags. Eraser Tool is behind a feature flag now.
* + and - on the top row of keyboard keys will zoom the drawing in and
  out in Edit Mode. The wallpaper zooms nicely enough, but level
  chunkers need work.
* A View menu is added with Zoom in/out, reset zoom, and scroll to
  origin options. The whole menu is behind the Zoom feature flag.
* Update README with lots of details for fun debug mode options to play
  around with.
2020-11-19 20:09:15 -08:00