github ZQuestClassic/ZQuestClassic nightly-2023-08-16-2
Nightly 2023-08-16 (2)

pre-release13 months ago

The following are the changes since nightly-2023-08-16:

Features

Editor

Build


The following are the changes since 2.55-alpha-116:

Features

  • Add 75 new 'Custom Counters' (26-100) c30c57aa6
  • Music and sound stuff galore!
     
    • Enhanced music using MP3 and OGG can now be given loop points and crossfade timings in the DMap editor. The music will then loop at those points and fade in and out with those timings.
    • Scripts have new ways to interact with enhanced music: GetMusicPos(), SetMusicPos(), SetMusicSpeed(), GetMusicLength(), and SetMusicLoop()
    • Scripts can also play music with crossfades using CrossfadeEnhancedMusic().
    • Scripts can play sounds with different, volume, pan, frequency, and looping with PlaySoundEx().
    // Turns a SFX into an instrument by playing it back at different frequencies
    ffc script Piano
    {
       void run()
       {
           // Frequency values and keys for different notes
           int hz[] =   {16350L, 17320L, 18350L, 19450L, 20600L, 21830L, 23120L, 24500L, 25960L, 27500L, 29140L, 30870L, 32700L};
           int keys[] = {KEY_Z,  KEY_S,  KEY_X,  KEY_D,  KEY_C,  KEY_V,  KEY_G,  KEY_B,  KEY_H,  KEY_N,  KEY_J,  KEY_M,  KEY_COMMA};
           int sz = SizeOfArray(hz);
           int sfx = Rand(60); // Pick a random SFX
           while(true)
           {
               for(int i=0; i<sz; ++i)
               {
                   if(Input->KeyPress[keys[i]])
                   {
                       int j = (hz[i]/hz[0]) * 22050L; // Multiply by the sample rate of most default SFX
                       Audio->PlaySoundEx(sfx, 100, 0, j);
                   }
               }
    
               Waitframe();
           }
       }
    }
    • Scripts can also adjust sounds mid playback with AdjustSound() and track their completion with GetSoundCompletion().
    ffc script AdjustSound
    {
       void run()
       {
           // Play the sound panned to the left at half volume
           Audio->PlaySoundEx(SFX_SECRET, 50, -128, -1, false);
           // Run until the sound has stopped playing
           while(Audio->GetSoundCompletion(SFX_SECRET)!=-1)
           {
               int pct = Audio->GetSoundCompletion(SFX_SECRET) / 100;
               // Pan the sound to the right while increasing in volume
               Audio->AdjustSound(SFX_SECRET, Lerp(50, 100, pct), Lerp(-128, 127, pct), -1, false);
               Waitframe();
           }
       }
    }
    • Scripts can set MusicRefresh to prevent music from resetting when changing screens
    Audio->PlayEnhancedMusic("ExampleSong.ogg", 0);
    Audio->MusicRefresh = MR_DMAP; // Music will refresh on changing DMap
    Audio->MusicRefreshFlags[MRF_REVERT] = true; // Music refresh with revert to default behavior afterwards
    • AdjustMusicVolume() and AdjustSFXVolume() have been reworked to be a multiplier capped at the user's volume settings, rather than overwriting those settings.

     
    Relevant changes:

    • feat: music looping and length functions for ogg and mp3 0d00efce4
    • feat: add enhanced music loops for dmap music 8c6f66142
    • feat: add enhanced music loops for dmap music 1bf93ebc3
    • feat: PlaySound with different volume, pan, and loop f7afa08a7
    • feat: added frequency param to PlaySound() 51931b91f
    • feat: added crossfading enhanced music d03c55c0d
    • feat: dmap editor crossfades 5e34b007c
    • feat: zscript access for dmap crossfades 435449e33
    • feat: MusicRefresh setting for ZScript 5df225ec7
    • feat(zscript): music seeking functions for ogg and mp3 463a6d1dc
    • feat(zscript): dmapdata music loop point access fc8fa9918
    • feat(zscript): GetSoundCompletion() a2df0883a
    • feat(zscript): Split MusicRefresh into MusicRefresh and MusicRefreshFlags[] 679b79c50
    • fix: changed how crossfades interact with F1/F4 9274b2990
    • fix: fademiddleframes in CrossfadeEnhancedMusic() 2fb00213c
    • fix(zq): missing mirrorDMap and loop points from dmap import and export b694fba13
    • fix(zscript): CrossfadeEnhancedMusic() now keeps playing old music on failure and returns a proper result 57c6aa58b
    • fix(zscript): rename expanded Audio->PlaySound() function to PlaySoundEx() e96efb263
    • fix(zscript): GetSoundCompletion() crash when the sound is not allocated edf58c67d
    • docs(zscript): docs for Crossfades and MusicRefresh 589df961c
    • docs(zscript): webdocs for new Audio features 93ec63eea
    • chore: attempt to fix ubuntu compile 0f17db7cc
    • chore: Merge branch 'main' into music-backup 8c3412b96
    • chore: merge main into music branch 11d792fb4
  • qr for mirror/prism combos working on all layers 5eb173a5d
  • 'Dive->','Dive-> (Sensitive)' trigger flags ceef20ab1
  • Lens can show/hide multiple different layers per screen, can include layer 0 1e603b650
  • Can now disable pushblock draw layer [QR Pushable Block Sprite Layer] dd365e844

Player

  • split saves into individual files b6b151149
     

    Each save slot created is now stored in a separate file, kept in the saves/ folder. This path is configurable with [zeldadx] save_folder.

    An existing zc.sav file is split into individual files, and the original is moved to saves/backup.

    The order of the save slots is maintained by saves/order.txt. You may freely rearrange the lines of this text file, though you must do so when the program is not open for it to have any effect.

    Any save file that gets deleted will simply be moved to saves/deleted. If you ever want it truly gone, you can delete the folder yourself. If you want to restore it, just move it back to saves/.

    Individual save files are only loaded into memory as needed, and only partially if only needed to display info on the title screen (like the name, icon, hearts, etc).

    The -standalone switch still works the same, but the save file is at saves/standalone.sav.

  • change save slot limit from 15 to ∞ 1e0794e25
  • copy save file to backup folder on every save bfa22af7b
  • support more than one qst file for -standalone mode 7ebfcf8d3
     

    Previously, standalone mode only worked for a single quest file at a time. For example, run -standalone game.qst once and game.qst becomes the only quest that will work with the save file generated. Now, each quest will use a save file derived from the name of the quest file.

    You can also provide a specific path if you like. It will be resolved relative to the save/ folder (you can also use an absolute path). Example usage: -standalone game.qst me.sav

Editor

  • Remember 'View Layer 2/3 as BG' setting e04aeaf47
  • add Shift+Minus/Plus for changing combo in combo editor f77eb091b
  • configure multiple init datas for test mode 44d7ecf90
     

    Test Mode now allows you to customize test-only init data. You can make multiple init datas. They are saved to your zquest.cfg. A basic name is auto-assigned, but you can set your own name by modifying your config.

    When you create a new test init data, your current quest's init data is used as the starting point. Later modifying the quest init data has no impact on your test init datas.

    You can also directly modify the init data values in the config, though the format is not documented anywhere.

  • save test init data per-quest c7a9d6a2c

ZScript Standard Library (std.zh)

  • add 'GetLevelSwitchState()'/'SetLevelSwitchState()' helper functions f7228536a

ZScript

  • special layer for non-overhead ffc draws d8d123b1a
  • Add special layer timings related to lens of truth 4799cb023
  • Add 'Game->TrigGroups[]' read-only array a6f5459d8

Visual Studio Code Extension

  • add "Always Include" setting, default ["std.zh"] 84cd984dd
     

    This takes an array of files to always '#include', so that you don't need to manually add the #include to every one of your files.

  • better working 'alwaysInclude', clean error messages for other-file errors 053e6bbc6
  • better CONST_ASSERT handling, setting to ignore CONST_ASSERT errors db0bc504b
  • use default options NO_ERROR_HALT, HEADER_GUARD for language server compiles a5a6483a5
  • add includepaths option 406f41d2b

Bug Fixes

  • cutscene combos being incompatible with replays b6e7680f8
  • set exe path string to empty if fail to get exe path 728d3ce03
  • changer ffc interactions, ffc timer interactions 9ad10b881
  • use ut8 encoding for config and filenames 134c2fd7a
     

    Config values can now carry non-ascii values. This required also configuring allegro to treat file paths as UTF8.

    Fonts have varying support for characters outside ASCII characters. Probably we currently have no fonts that adequately cover non-latin characters. While you may see gibberish in the file picker, files should still load just fine.

  • pushable blocks not respecting lens layer hiding/revealing c4f332289
  • support leading dot in file selector filter 9ffaa4cec
     

    This recently broke loading zplay files because the constant for the extension changed from zplay to .zplay, and the old file selector expect no leading dot, unlike every other file path API known to man.

  • dmap music with crossfades was not setting loop points ad0adaf62

Player

  • fix bad rebase that messed up new save file header ceac21221
  • check save exists before attempting to use a56f5a84e
  • remove warning about standalone mode adf05b8cf
  • resize save vector before copying 4f0cc4ea1
  • fix bad rebase that messed up new save file header (for real) 9be5aa75c
  • update current volume when changing enhanced music volume ee66e9201
  • fairy flags acting different placed vs inherent 3f750666f
  • allow canceling delete/copy save with ESC 5d8e9b5c3
  • do not update saves order.txt in standalone mode 1ac8d0b5a
  • set ascii mode for ending graphics 8e31cfecd
  • Conveyor oddities related to Force Dir flag db349d14f
  • Triggers tab state issues d1cbad2f8
     
    • "->LevelState" not setting the state properly
    • "->LevelState" and "->GlobalState" not working on ffcs
  • reset the map view cursor state in init_game 9d07bd272
     

    For replay determinism.

  • 'Load Quest' menu option was busted from recent refactors 705aa3a4d

Editor

  • bad index for -quick-assign 10b87bb3b
  • support headless switch with quick assign a6e4fb664

ZScript

  • support absolute path includes on non-windows too 2b5690bcc
  • null check results before attempting to write zasm 69d5f16e4

Visual Studio Code Extension

  • some more CONST_ASSERT issues d5d3c1dd0
  • header_guard works properly for edited file, no longer causes dupe errors 888a050e3
  • handle non-windows paths d3bfe96d0

Documentation

  • correct typo in comment for jit_threads option 1e11cd6f5

Build

  • add targets for common replay test invocations 2a97f57d6
  • add stubs for sdl music to un-break web build 68f407138
  • fix windows compile 2769fc999

Chores

  • bump version to alpha 117 ed0d04620
  • clean up stdout garbage whitespace output 5ce129bcd
  • modify changelog for recent music additions 0c2a8aeb9
  • add more to recent music changelog de1ed3ec2

ZScript

  • Make all 'yyerror' error messages start with 'ERROR:' 917169753

Refactors

  • Screen Script dialog now new GUI, respects script metadata e48455725
  • New "Screen Data" dialog d1449c0a0

Player

  • split save code from title.cpp, remove .icn ab10ed1e5
     

    .icn files contained just the color data for each ring variant needed by the title screen. The idea was to avoid loading each quest just to show a single tile graphic. But, this same data is already in the gamedata save structure, so we don't need to maintained a separate file doing the same. The greatly simplifies much of the code dealing with displaying these icons.

  • remove skipicon and print_metadata_for_each_save_slot config options 7a45e5691
  • move more save file handling behind saves.h interface 5415c4554
  • move save file name into saves.cpp, remove -savefile 28c78ffc3
  • store saves in a vector becc8102f
  • remove support of .dat# when loading save files 985583d1e
  • update icon only once when making new save 3d1b13133
  • remove unnecessary sleep/flash of black on updating save icon 855e0684d
  • skip slow combo movement modification when nothing would change 4693d82e8

Tests

  • add more visual indicators to playground_scrolling_script.zplay f6d318fe5
  • forgot to update zasm snapshot from f6d318 cfd6241df
  • fix usage of -quick-assign in test_zquest.py ff333ee4a
  • add stdout to parser expectations to capture warnings/errors f78c85e65
  • check if gfx segments exist in workflow get_args 2da41aa14
  • support starting replay from a sav file 0b8a1a41a
  • add script for splitting replays b771f0c16
     

    also support folders in the replay test directory

  • split large replay files e79878288
  • support headless flag for web replay tests 4cee3d64f

CI

Misc.

  • add 'std_zh' scope to changelog generation d82a0d845
  • make std_zh a scope, instead of a type efee4a34e
  • support squashing and rewriting commit body for changelogs 7c6430abe

Visual Studio Code Extension

Don't miss a new ZQuestClassic release

NewReleases is sending notifications on new releases.