AGS 3.5.1

Started by Crimson Wizard, Fri 04/06/2021 20:01:39

Previous topic - Next topic

Crimson Wizard

AGS 3.5.1
Full release number: 3.5.1.7


For Editor
Spoiler

For Android
Spoiler

For Engine/Editor developers
Spoiler

Released: 4th June 2021

Previous stable version: AGS 3.5.0 P10 forum thread


This release is brought to you by:

- Alan v. Drake
- Crimson Wizard
- eri0o
- James Duong (implemented "--console-attach" option for Windows)
- Morgan Willcock
- Nick Sonneveld
- rofl0r
- Thierry Crozat (bug fixing)



Summary

3.5.1 is a minor update after 3.5.0, which contains mostly utility additions, fixes and perfomance improvements.

For the reference, we currently have another major version in works, which is already usable although may be not as stable, and introduces a SDL2-based engine, planned to be released as 3.6.0. If you're interested you may find it here: https://www.adventuregamestudio.co.uk/forums/index.php?topic=58976.0


What is new in 3.5.1

Editor:
- Added "Attach game data to exe" option to General Settings. This lets you to package game data separately from the game.exe (only important on Windows at the moment).
- Deprecated "Limit display mode to 16-bit" property in Runtime Setup as it's no longer used by the engine.
- Display aspect ratio in game resolution dialog.
- Implemented classic Color Picker dialog for the Color type values in the property grid, instead of the default one which does not allow user-defined colors.
- Improved tab switching performance for script windows.
- Editor will now enforce full game rebuild after upgrading an older project, this ensures that all scripts are recompiled with the new version rules.
- Fixed room lists in property editor were not updated after room number is changed.
- Fixed importing pre-3.* projects broken by incorrect assignment of "Game file name" property.
- Fixed importing Characters and GUI without sprites still created empty sprite folders.
- Fixed crash when exporting/importing Characters with no Normal View.
- Fixed translation compiler did not correctly save some of the escaped sequences, such as "\n".

Scripting:
- Implemented correct parsing of a "const string" function return type.
- Fixed implementing imported functions was forbidden in the room scripts.

Script API:
- Added GUI.Shown readonly property that tells whether GUI is active on screen. This is primarily for GUIs with "Popup At Y" style, because they hide themselves regardless of Visible property. Note that since 3.5.0 GUI.Visible only tells a script-set value.
- File.Open() now supports $CONFIGFILE$ tag which will try to open user config file for reading or writing regardless of where config is located on disk.
- Added System.SaveConfigToFile() which writes current engine settings to the user config file. Only the options that can be changed at runtime are written back at the moment.
- GetTranslation() now returns "const string" (was "string"). This is to prevent modifying returned string using old-style string functions, such as StrCat(), as this string may be allocated in the internal engine memory for its own use.

Engine:
- Support loading audio and video from data packages larger than 2 GB.
- Improved game data loading times by introducing buffered file stream. Initial tests showed 3-4 times faster file reading.
- Improved game perfomance by not reupdating all of the GUIs each time anything changes, instead only affected GUI will be updated each time.
- Some improvement to general script perfomance.
- Some improvement to script Dictionary and Set types perfomance.
- Room Object's Graphic property now can be assigned a sprite with index over 32767 and up to 65535. This restriction is due to internal data format, which cannot be fully fixed without breaking compatibility with plugin API. This may still be worked around by assigning a View, as View's frames may contain sprites of any index available.
- Similarily, Object's View, Loop and Frame can now be assigned a value over 32767 and up to 65535; not that this was ever an issue...
- Removed arbitrary limit of 1000000 dynamic array elements (now supports over 2 billion).
- Dialogs with no enabled options left will be now stopped, instead of raising script error.
- Engine will not longer quit the game when failing to write a save, but simply display an error on screen (...why this was a thing in the first place?!).
- When restoring a save engine will now try to match game pack by GUID rather than using exe/pack name. This resolves potential problems when game package may have different name in distribution to another system. Also makes saves in multi-game collections more reliable.
- In Debug game mode allow to toggle infinite FPS mode (prior it could not be turned off).
- Expanded text parser error messages for easier debugging.
- Adjusted all the command-line options to have consistent prefix convention, where all full-name options must be preceded by double-dash, and one-letter options by single dash.
- Added "--localuserconf" command and similar global config option which tells engine to read and write user config in the game's directory rather than using standard platform path. Game dir must be writeable for this to work.
- Added "--conf" command which forces engine to read only explicit config file on startup.
- Added "--user-data-dir" and "--shared-data-dir" commands for setting save game directory and shared app data directory from command line (this corresponds to existing options in config).
- Fully configurable log output (in both game config and command line) allows to set up which message types and groups are printed by which output methods (sinks), including: file, system console, in-game console. "warnings.log" is now created only if file log was not requested by user.
- Added "--log-" set of command line options for setting up log output.
- Added "--tell-filepath" option for printing known engine's and game's file locations.
- Added "--tell-gameproperties" option for printing some of the game's general settings.
More information on log config and --tell commands currently may be found in following text file: OPTIONS.md
This has to be added to the manual eventually.
- Support proper lookup for Allegro 4 library resources (such as its own config and digital MIDI patches) in the game directory.
- Engine will no longer precreate directories for common files: saves, user config, shared files and so forth, - before actually having to write these. This ensures that no new directories are created on your disk without actual need. Also this fixed a problem that could happen if someone deleted e.g. a game's save directory while game was running.
- Fixed running game from another directory by passing its relative filename as command-line argument: in this case engine was incorrectly using its own directory to search for external game data, opening files for reading by script command, and so on.
- Fixed some of the engine's own hotkeys (such windowed/fullscreen mode toggle) not working during certain skippable game states.
- Fixed overlay was set to wrong position if it were using TextWindow gui and either its text or X, Y properties got changed.
- Fixed crash occuring when the speech is using text window gui with zero Padding and the speech text is an empty line.
- Fixed characters and room objects were not updating their looks if their current graphic was a Dynamic Sprite, and that sprite was modified with ChangeCanvasSize, CopyTransparencyMask, Crop, Flip, Resize, Rotate or Tint function.
- Fixed Views' frames keeping reference to deleted Dynamic Sprites causing crashes. Now they will be reset to dummy sprite 0 for safety.
- Fixed engine crash when button's graphic is set to sprite out of range.
- Fixed animated cursor's normal graphic reappearing in between animation frames if mouse mode is being repeatedly reassigned, for example in rep-exec script.
- Fixed certain interactions did not work with GUI if it was made fully transparent.
- Fixed ListBox.FillSaveGameList() search pattern, it included files which contain save filename pattern but do not exactly match; for example: "agssave.001_".
- Fixed engine was ignoring audio files in game directory when running games which use old audio system.
- Fixed crash in Direct3D and OpenGL renderers that occured if game uses a plugin that performs software drawing on screen, and one of the rooms is smaller than the game's resolution.
- Fixed Direct3D was assigning wrong fullscreen refresh rate sometimes, slowing alt-tabbing.
- Fixed "--test" mode was lost upon restoring a save.

Engine Plugin API:
- Added IAGSEngine::GetRenderStageDesc() function which returns current render stage parameters. As of this version these parameters include 3 transformation matrixes, allowing any 3D render plugin to stay compliant to engine's scene rendering.

Compatibility:
- Fixed engine was trying to read unnecessary data when loading pre-2.72 games.
- Fixed "upscale" mode for old games (was broken in 3.5.0). Also engine will now try to detect if "upscale" mode wanted by reading old config options (if they are present).
- Fixed GUI.Visible not returning expected values for GUIs with "Popup At Y" style in pre-3.5.0 games, breaking some older games logic.
- Fixed potential buffer overflow when reading pre-3.1.0 games with old dialog script texts.
- Fixed engine was applying player's position too early when ChangeRoom was called for 2.72 and earlier games, which could result in wrong placement in the new room if the character was walking right before the transition.

Android:
- Corrected game scanning in AGS launcher, now it will work consistently with the desktop ports, and detect any compatible game data files named "*.ags" or "*.exe".

OSX:
- When looking for game files engine will no longer use hardcoded filename, will search for any compatible pack file instead.

Windows:
- Windows version of the engine now reads global configuration file. It is looked up in "%USERPROFILE%/Saved Games/Adventure Game Studio/acsetup.cfg"
- Default log file location is now also in "%USERPROFILE%/Saved Games/Adventure Game Studio".
- Added "--no-message-box" command line option to hide message boxes when alerts are raised. These messages will be still printed to log (if one is enabled).
- Added "--console-attach" command line option to try attach to the parent process's console. This is useful if you run game from command line and want to see engine's log in the console.

WinSetup:
- Fixed changing fullscreen mode from "use current desktop" to explicit resolution on save.







Thanks to everyone who contributed to and tested this version!




Crimson Wizard

#1
Known issues (to be patched)

- Game.TranslationFilename does not return anything (always empty string).
- The detection of gui controls under mouse fails after GUI becomes disabled and then enabled again (which occurs during blocking actions too). The workaround is to simply move a mouse around a bit.

Temporary fixed download from the build server:
https://cirrus-ci.com/task/5217947690991616
https://cirrus-ci.com/task/5400078748745728
https://cirrus-ci.com/task/6678417748787200

greg

With AGS 3.5.1, I noticed that the engine no longer recognizes a second click on a GUI button if the mouse hasn't moved since the previous click.

(This behavior existed in AGS 3.1.2, then went away in AGS 3.2.1.  With 3.5.1, I'm observing it again.)

Here's what I'm doing:
* Within the game, the player clicks on a GUI button.
* The button's OnClick function is called.  This triggers a blocking action, during which the GUI button is hidden.
* The player regains control of the game, and the GUI button reappears.  The player hasn't moved the mouse at all, so the mouse is in the same place, and the GUI button is still below the mouse.
* The player clicks on the same GUI button.
* Observed behavior: Nothing happens.
- Expected behavior (and behavior before 3.5.1): The button's OnClick function is called.

Crimson Wizard

#3
Quote from: greg on Sun 13/06/2021 17:09:03
With AGS 3.5.1, I noticed that the engine no longer recognizes a second click on a GUI button if the mouse hasn't moved since the previous click.

(This behavior existed in AGS 3.1.2, then went away in AGS 3.2.1.  With 3.5.1, I'm observing it again.)

I cannot reproduce this, do you have some simple game to test?
Is it only button itself that hides during blocking action, or whole GUI?

Does anyone else observe same behavior?

greg

> Is it only button itself that hides during blocking action, or whole GUI?

I'm hiding the GUI, then the button, then moving/resizing/showing the button, then showing the GUI.  If the mouse is over the button at the time the GUI is reshown, the button doesn't recognize the click until you move the mouse by >=1 pixel.

To work around the problem (back in 3.1.2 and now with 3.5.1), I just manually bump the mouse after showing the GUI:

Mouse.SetPosition(mouse.x+1, mouse.y);

> I cannot reproduce this, do you have some simple game to test?

Sure, if you'd like, I can DM you my game.  With the workaround above, though, I'm unblocked.

Crimson Wizard

Quote from: greg on Wed 16/06/2021 14:58:25
Sure, if you'd like, I can DM you my game.  With the workaround above, though, I'm unblocked.

Yes, I'd like to fix the bug of course.

Dave Gilbert

Woo! Upgrading. Thanks so much, CW.

Crimson Wizard

#7
Quote from: greg on Wed 16/06/2021 14:58:25
> Is it only button itself that hides during blocking action, or whole GUI?

I'm hiding the GUI, then the button, then moving/resizing/showing the button, then showing the GUI.  If the mouse is over the button at the time the GUI is reshown, the button doesn't recognize the click until you move the mouse by >=1 pixel.

To work around the problem (back in 3.1.2 and now with 3.5.1), I just manually bump the mouse after showing the GUI:

Mouse.SetPosition(mouse.x+1, mouse.y);

I found a small bug where I was optimizing GUI redrawing on screen and overdone a bit... Basically the detection of gui controls under mouse fails after GUI becomes disabled and then enabled again (which occurs during blocking actions too). As mentioned above, the workaround is to move a mouse around a little.

Made a fix, and the temp download will be available from the build server here after the server work is over (under "Artifacts" line):
https://cirrus-ci.com/task/5400078748745728

I'm currently waiting for a while (maybe until the end of this week) to see if any other regressions are noticed, and then release an "official" patch.

Crimson Wizard

#8
Hmm... While testing previous problem I noticed that OpenGL renderer does not perform linear filtering properly unless "Render sprites in screen resolution" is enabled.
AGS 3.5.0 seem to have similar problem, so no idea how long this was broken. EDIT: looks like this was wrong from the start when we added OpenGL support on Windows & Linux.
Why no one reported this before though?...

Will be pushing this fix too.

fernewelten

#9
Quote from: Crimson Wizard on Fri 18/06/2021 02:28:58
OpenGL renderer does not perform linear filtering properly unless "Render sprites in screen resolution" is enabled. […]
Why no one reported this before though?...

Most probably, nobody whatsoever has been using that feature â€" or playing games that use that feature on a recent Engine â€" for the last few years.

  • If it's a historic game, it will come bundled with its own, proper engine which will be ancient and lack OpenGL.
  • If it's a modern game, you'd need a low-resolution loving game coder that likes their sprites to look more blocky than they need to be, paired with players that bet on the OpenGL renderer and filtering. This combination doesn't seem all that likely.

eri0o

It's the reverse, pixels rule for low resolution games, linear filtering (and most other filters) only make sense if people are playing HD games in slightly different resolution than the one it was originally made.

fernewelten

That was kind of my point. "Render sprites in screen resolution" turned OFF means extra blocky sprites, i.e., the game coder or player explicitly specifies that the sprites should be rendered in low resolution even when a better resolution was achievable. If that's the design decision, then the game players are not very likely to choose "Linear filtering" to go with that.

Here's the explanation from the 3.5.0 cockpit (that option would be turned OFF):
Quote
Render sprites at screen resolution
When drawing zoomed character and object sprites, AGS will take advantage of higher runtime resolution to give scaled images more detail than it would be possible if the game was displayed in its native resolution. […] Currently supported only by Direct3D and OpenGL renderers.


eri0o

Ah, sorry, I misunderstood you and got the opposite  :P

Crimson Wizard

#13
This is how I found the error: the game I was testing had "Render sprites in screen res" turned OFF, and linear filter set. Filter worked in Direct3D mode, but not OpenGL, which made me suspicious.

Quote from: fernewelten on Fri 18/06/2021 13:45:58
"Render sprites in screen resolution" turned OFF means extra blocky sprites, i.e., the game coder or player explicitly specifies that the sprites should be rendered in low resolution even when a better resolution was achievable. If that's the design decision, then the game players are not very likely to choose "Linear filtering" to go with that.

I think there's a use case for this. Having "Render sprites in screen resolution" OFF does not simply mean "blocky sprites", it rather means "no subpixels", - that everything in the game will be drawn in same res, consistent with each other. But linear filter is applied after that, when the final image is being scaled up to the window, so it still makes sense.
I don't know if it makes sense for only high-res games, or low-res games too, depends on the preference I guess.

eri0o

There are some other modes in OpenGL docs.

Maybe one dayâ,,¢ï¸, we could try some of those in in the OpenGL filter to see if it's worth adding more options.

greg

Quote from: Crimson Wizard on Fri 18/06/2021 01:58:02
Made a fix, and the temp download will be available from the build server here after the server work is over (under "Artifacts" line):
https://cirrus-ci.com/task/5400078748745728

Thanks for preparing this fix!  I tested the new build on my game, and it indeed resolved the issue I was experiencing.  Thank you!

SMF spam blocked by CleanTalk