Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Topics - Crimson Wizard

#1
AGS 3.6.2 - Patch 1
Full release number: 3.6.2.11


For Editor
Spoiler

For Android
Spoiler
NOTE: the Editor now includes Android build component letting you prepare your own games for Android
[close]

For Engine/Editor developers
Spoiler


Released: 15th June 2025

Previous stable version: AGS 3.6.1 P11 forum thread


This release is brought to you by:

- Alan v.Drake (fixes)
- Crimson Wizard
- edmundito (fixes)
- eri0o
- homelightgames (scalable images for the wizard dialogs)
- rofl0r (compatibility fixes for old games)
- Walter Agazzi (compatibility fixes for old games)


Summary

3.6.2 is planned to be a second update to 3.6, focusing mostly on convenience of existing Editor and Engine features, and expanding existing script commands. For a quick mention, the noteable changes are:
- you may create object event functions in any script of your choosing (except room events);
- a support for loading saves from older versions of the game;
- dynamic arrays have Length pseudo-attribute, letting you to read their length in script;
- dialog events (in "on_event") may let writing custom dialog handling in script easier.
But there's more.

As usual, please refer to "Upgrading to AGS 3.6.2" topic in the manual for further information on most outstanding changes in this version:
https://adventuregamestudio.github.io/ags-manual/UpgradeTo362.html

The full changelog follows.


Changes in the Patch 1:

Editor:
- On failed new font import do not replace the font with font 0 in preview, as that's confuses users and hides import errors.
- Fixed an unhandled exception which occured on Text Parser panel when user pressed Enter while no item is selected.

Engine:
- Try to detect incorrect argument types in string formatting functions such as String.Format, in attempt to avoid crashes when a '%s' format is used (this is still not 100% secure though).
- Do not quit with error if a wrong GUI type is assigned as a "TextWindow GUI", display default message box instead and log a warning.
- Fixed a crash occuring when reading Character.DestinationX/Y properties while the character is turning on spot after a call to FaceDirection.
- Fixed a crash occuring when SpeechView is assigned a view that has no loops.
- Fixed Lucas-Arts speech positioning mistake occuring, for example, when there's a big transparent GUI covering whole screen.
- Fixed dialog options with no text, they were displayed and could be selected by player, which should not be happening.
- Fixed Character.PlaceOnWalkableArea() and Room.NearestWalkableArea() returning wrong results if Room's mask resolution is not 1:1.
- Fixed Direct3D and OpenGL renderers displaying sprites with occasional "magenta" pixels when "Smooth scaled sprites" setting is enabled but graphic filter is set to "Nearest-neighbour".

Compatibility:
- Support detecting and loading game data from Linux game ports where it's called "agsgame.dat", and is created using an older version of the third-party "agspack" utility.
- Disable smooth walk transition in pre-3.6.1 games, as apparently this breaks logic in some of them where precise walking coordinates and/or timing is required by scripts.
- Fixed misaligned text centering on buttons in pre-3.6.0 games.



What is new in 3.6.2

Common:
- Event handler function are now allowed to be located in any script module.
- New naming rule for the voice clips: full char name, followed by a number, separated by a dot, e.g. "RogerTheGreat.1234.ogg". The old rule may be enabled again by a switch in "Backwards Compatibility" settings.

Editor:
- In "Start New Game Wizard" game template selection now displays template's description right in the dialog.
- "Game statistics" now have Ctrl + F2 shortcut instead of F2.
- F2 can be used for starting editing names of items in the Project Tree (ones that support that) and folders in the Sprite Manager.
- Added "Game Speed" property in General Settings.
- Added "Use old-style voice clip naming rule" property in General Settings, it lets to select whether the game should expect old-style voice clip filenames (4-letter char name followed by number) or the new one (full char name, followed by a number, separated by a dot).
- In General Settings renamed "Override built-in inventory window click handling" option to the older variant "Handle inventory window clicks in script" (because it's easier to understand).
- GUI selection in settings is now done using drop-down lists which list all eligible GUI types instead of having user to type GUI number. The setting will be automatically fixed if a GUI is removed.
- Property Grid now displays Custom Properties right in the main properties list for each item that supports them.
- Added "WrapText", "TextPaddingHorizontal", "TextPaddingVertical" properties to GUI Button.
- GUI Labels can select full range of Alignment values in their TextAlignment property.
- Added "TurnWhenFacing" property to Characters.
- Textual GUI controls can now select "Null Font" as their font: this will prevent any text to be drawn even if one is assigned, and make it have zero size (when it matters).
- Property Grid and Room's navigation bar now display object's description along with the script name on the drop-down list labels.
- "Events" tab on the Properties Grid now has "ScriptModule" selection, which lets define in which module should the related script functions be generated and looked for. The GUI Controls use a ScriptModule set in their parent GUI, and Room events always has a fixed room script selected.
- Added "Open Recent" submenu in the File menu.
- Sync script editor's commands in Edit menu with the context menu.
- Added "Toggle Line Comment" command to Edit menu for scripts.
- More panes in the Editor are DPI-aware (rescale well with the system font scaling).
- Editor tabs now display icons indicating their contents (may be disabled in Editor Preferences).
- Room panel tabs now display room names.
- Editor will now remember certain window states: "Sprite selector" window and splitter position, splitter position in "Sprite manager".
- Support reordering folders in Project Explorer with drag & drop.
- Support importing plain script files: ash, asc or both, - besides script modules (*.scm).
- On "Color Finder" pane also display actual RGB values that the engine will use. They may be different from requested RGB, because historically engine limits drawing color's RGB precision to 16-bit.
- Font's "SourceFilename" and "Font Size" properties now have buttons that let import another font file, or reimport same font with different size respectively, instead of clicking on a button on the preview window.
- Added a readonly "ProjectFilename" property to Fonts, which displays their in-project file name.
- Global Variables panel now allows to declare arrays.
- Added "Controls transparency" slider to GUI edit pane.
- Copy, paste and delete commands now apply to all the selected GUI controls in GUI editor.
- When pasting a copied GUI control, Locked property of a new control will be turned off.
- Support editing group properties for selected GUI controls.
- Added a multiline Text edit window for Button and Label controls, that may be called by Ctrl+E, from context menu, or by pressing "..." button of the Text property in the Properties grid.
- Support reordering folders in Sprite Manager with drag & drop.
- Added "Replace source paths for sprites..." context menu command in Sprite Manager. This command allows to batch-replace parent folder for all sprite source paths, in case you moved original files from one folder to another.
- Added "Palette index" selection for sprite's import transparency option.
- Support importing 32-bit BMP files of extended formats (this support is formal at the moment, and does not guarantee that any of the extended data will be interpreted).
- Support importing 1-bit (monochrome) and 4-bit images as sprites, room backgrounds and masks (converted to 8-bit).
- Do not alter or clamp palette for 8-bit sprites imported in a 16/32-bit game.
- Support importing indexed images which palettes contain translucent alpha as sprites with alpha.
- Support importing indexed PNGs as room backgrounds and masks.
- Added "Change Room Number" context menu command for the Rooms in Project Explorer.
- When the room background size changes, reset room edges to defaults.
- Removed obsolete "Copy walkable area mask to regions" command from the Room editor.
- Improved scrolling of drop-down lists in the Room's navigation bar: made scroll buttons larger, and support mouse wheel.
- In Room Editor, during any area drawing mode Ctrl + LMB now works as area picker regardless of the currently selected tool.
- Added "Replace source paths for audio clips..." context menu command for the Audio node. This command allows to batch-replace parent folder for all clips' source paths, in case you moved original files from one folder to another.
- Don't restrict compiling a voice-based lipsync if game has a Lucas-Arts style speech.
- Do not delete previously built game exe from Compiled/Windows folder when testing a game from the editor.
- Editor will now report any missing script functions that are assigned to events, but not present in script, as warnings when compiling the game.
- Editor will now report any script functions that *look like* event functions, but not assigned to corresponding events, as warnings when compiling the game.
- Editor will interrupt "Check for updates" process if it is taking too long with no progress.
- Added "/maketemplate" command-line option that tells Editor to run, make template out of the said game, and quit.
- Fixed Project Explorer refreshing when user changes names or descriptions of room objects.
- Fixed importing indexed PNG as a sprite, previously Editor would mistakenly treat the source image as 32-bit.
- Fixed importing GIFs with "palette 0 / N" transparency option would refer a palette color from each individual frame's palette rather than the original GIF palette, which could lead to wrong colors used as transparents.
- Fixed importing 8-bit BMP sprites with no "Remap palette" and "Leave As Is" as a transparency option would still remap palette index 0 to the first found palette entry with Alpha 0, even if that's a filler entry not used by the image.
- Fixed exporting room backgrounds was always writing a 32-bit image rather than using actual background's color depth.
- Fixed Autocomplete failing in case of UNIX line endings in script file.
- Fixed Autocomplete not giving correct results in case of a long chained access, i.e. something like "var
  • .member.member".
- Fixed Autocomplete giving wrong list of choices for wrong syntax cases like: indexed access of a type and non-array struct variable, member access of a static array.
 - Fixed Button getting resized to the image's size when user cancels different sprite assignment.
 - Fixed "Color Finder" and color properties were mapping a color number to RGB values with accuracy mistakes, resulting in slightly different values than the engine would use.
 - Fixed Font preview could crash the Editor with out of memory error in case of a very big font.
 - Fixed Editor refusing to open a project if one or more of the sections are missing in the file.
 - Fixed an unhandled exception occuring when rebuilding rooms if any script's header is missing.
 - Fixed a "unterminated string" error in Dialogs was not pointing to the actual error location.
 - Fixed double warning message when trying to close the Editor while a game test is running.
 - Fixed Editor may display a "save project" confirmation when run with "/compile" command-line parameter.

Scripting:
 - Dynamic arrays now have Length readonly property that returns their number of elements.
 - Support zero-length dynamic arrays. This may be useful if you need to have a dynamic array with no elements, but don't want to bother about checking a null pointer.

Script API:
 - Added eNullFont constant that lets assign or pass a "null font" to any property or function parameter which expects a font's ID. This "null font" will simply make any text not drawn and have no actual measurements (size, spacing, etc).
 - Added global events: eEventDialogStart, eEventDialogStop, eEventDialogRun, eEventDialogOptionsOpen, eEventDialogOptionsClose (these are handled in "on_event").
 - Events eEventGUIMouseDown and eEventGUIMouseUp now get additional parameters: mouse button, mouse x and y positions (relative to the exact GUI).
 - Expanded "on_mouse_click" callback, now supports two more parameters: click x,y coordinates.
 - Added RestoredSaveInfo struct which contains information about game save's contents,
 - Support "validate_restored_save" callback, which lets user to validate restored saves with mismatching data and request cancellation or continuation of restoring this save.
 - Added Button.WrapText, TextPaddingHorizontal, TextPaddingVertical.
 - Added Character.Following property that returns another Character that this one follows after.
 - Added Character.TurnWhenFacing property.
 - Added Character.MoveStraight() complementing WalkStraight().
 - Added DateTime.CreateFromDate() and CreateFromRawTime().
 - Added static Dialog.CurrentDialog property and non-static ExecutedOption and AreOptionsDisplayed properties.
 - Added static Dialog.Stop() function, a OO-style alias to StopDialog().
 - Added RenderLayer enum, and optional "layers" parameter to DynamicSprite.CreateFromScreenShot(), that tells which of the game's render layers to capture when making a screenshot.
 - Added File.Copy() and File.Rename().
 - Added FileSortStyle and SortDirection enum, and File.GetFiles() function that returns a dynamic array of filenames found using certain pattern, and optionally sorted by name or time, in ascending or descending order.
 - Added File.GetFileTime() that returns file's modification time.
 - Added File.ReadFloat(), WriteFloat(), ReadRawFloat(), WriteRawFloat(), ReadRawBytes() and WriteRawBytes().
 - Added Game.InBlockingWait property, that tells whether game is waiting for any blocking action or a Wait* call to complete.
 - Added SaveGameSortStyle enum and Game.GetSaveSlots() function that returns a dynamic array of save slot indexes, optionally sorted in certain way.
 - Added Game.GetSaveSlotTime() that returns a time this save slot was last written.
 - Added Game.ScanSaveSlots() that scans a range of game saves and tests them for compatibility, using "validate_restored_save" too if it's present in user script.
  This action is not run immediately, but is scheduled to be executed after current script ends. It reports of scanning completion by sending eEventSavesScanComplete event.
 - Label.TextAlignment has now type Alignment, rather than HorizontalAlignment, and has full alignment range (both horizontal and vertical).
 - Added optional "fileSortStyle" and "sortDirection" parameters to ListBox.FillDirList().
 - Added optional save slot range (min/max), saveSortStyle and sortDirection parameters to ListBox.FillSaveGameList(). This lets to define the exact range of saves it should fill, and order them in desired way.
 - Added ListBox.FillSaveGameSlots(), which initializes a list of saves from a dynamic array of save slot indexes.
 - Added Object.DestinationX and DestinationY properties, complementing ones in Character.
 - Added Overlay.SetPosition() and SetSize() functions for convenience.
 - Added Room.BackgroundCount readonly property.
 - Added Room.NearestWalkableArea() that returns the nearest found point on a walkable area.
 - Added GetWalkBehindBase() function, complementing SetWalkBehindBase().
 - Added Speech.SpeakingCharacter that returns currently speaking character (for blocking speech).
 - Added GetTimerPos() that returns timer's position (remaining time), in ticks.
 - Added CopySaveSlot() and MoveSaveSlot(), which moves existing save to another slot.
 - Added optional save slot range (min/max) parameters to RestoreGameDialog() and SaveGameDialog().
 - Added optional "sprite" parameter to SaveGameSlot(), that lets to pass a number of an arbitrary sprite to write into this save instead of a standard "screenshot".
 - Added optional "width", "height" and "layer" parameters to SaveScreenShot().
  SaveScreenShot() now accepts paths containing standard file tokens ($SAVEGAMEDIR$ etc).
 - Added SendEvent() function that allows to trigger "on_event" function calls in script. Special event value eEventUserEvent may be used as a base index for user-defined events.
 - Added System.DisplayFPS property that toggles FPS counter (a replacement to Debug(4, 1)).
 - Added System.GetEngineInteger() and System.GetEngineString() for returning diagnostic information about engine's runtime state. Possible arguments are defined by EngineValueID enum.
 - Added new game-wide option OPT_SAVEGAMESCREENSHOTLAYER that lets to define which of the game's render layers will be captured when making a standard screenshot for the save game.
 - Add SaveComponentSelection enum and game option OPT_SAVECOMPONENTSIGNORE, which lets to skip certain components when saving or restoring a game. This has dual purpose: reduce number of things in game that may break older saves by simply not having them in a save, and also reducing the size of game saves on disk (e.g. in case of dynamic sprites). Note that all things that were not restored from the save will retain their *current state*.
 - Fixed some script functions in AGS API were declared with "int" return value, while they are supposed to be "void".

Engine:
 - Updated to SDL 2.30.11 and SDL_Sound 2.0.4.
 - Engine now potentially supports reading saves made in older game versions with different content, so long as these saves have *less* data in any given type (i.e. less Characters, or less controls on a certain GUI, or less variables in script, and so forth). This feature is enabled by having a special "validate_restored_save" function anywhere in the game script, that accepts an argument of type RestoredSaveInfo. RestoredSaveInfo  contains various information about the restored save, and "Cancel" property, that must be explicitly set to "false" in script in order to allow to restore such save.
 - Engine supports returning to previously saved rooms which have less script data.
  It's important to remember though that it does no validation of restored room state on its own.
 - Dropped support for pre-3.5.0 game saves.
 - Increased the cap of simultaneously loaded scripts to 1024 (this includes all regular script modules, a single active dialog script, and a single active room script).
 - Engine no longer quits with error in case a script function assigned to a Room event is missing. Logs warnings about missing script functions assigned to any events.
 - Character.FollowCharacter() can now have a distance parameter up to 32766 (was limited to 255).
 - Ensure that Character.Speaking returns true when a speech is playing even if the character has no speech view.
 - Character.PlaceOnWalkableArea() now does a 1-pixel step scan, ensuring walkable area will be found regardless of how small it is. Optimized the search algorithm to keep it fast enough even in very large rooms.
 - Support voice-based lipsync (Pamela, Papagayo) with Lucas-Arts style speech.
 - DynamicSprite.CreateFromFile() may now load 1-bit and 4-bit bitmaps, converting to 8-bit.
 - Do not alter or clamp palette for 8-bit sprites loaded into a 16/32-bit game at runtime.
 - Assigning InventoryItem.Graphic will no longer reassign CursorGraphic too even if they were identical previously.
 - Calling DeleteSaveSlot() on a slot within 0-50 range will no longer secretly move a save with the topmost number (within the same range) to fill the emptied slot. If you still like to recreate this behavior, then use MoveSaveSlot() command.
 - Support calling StopDialog() inside any regular script and dialog script, and also while dialog options are displayed. That will schedule dialog's stop to be performed after current script finishes.
 - Removed arbitrary limit of 2k bytes for the result of String.Format().
 - Engine will no longer quit with error if any object is assigned a non-existing sprite, but continue, using a sprite 0 as a placeholder instead.
 - Ensure that the objects with identical z-order (baseline) always keep same relative sort order when being drawn (note: engine does not guarantee a predefined order, only a persistent one).
 - Implemented video buffering on a separate thread. Allow to drop late video frames.
 - When mouse is locked in window, confine its position to the game viewport; exclude black border.
 - Added "display" config option to "graphics" section. This is a 1-based display index, where 0 means "use default display".
 - Added new accessibility config settings in "access" section: "speechskip", "textskip", "textreadspeed". These let player to override game's skipping style for character speech and text messages, and text reading speed parameter that controls speech timing.
 - Added "max_save" config option in "override" section: this lets to enforce an arbitrary number of saves displayed in a standard save/restore dialogs in game.
 - Added "--display" command-line argument that lets choose which display to open game window on.
 - Added "--no-plugins" command-line argument that denies loading any plugins; also added respective config option "noplugins" in "override" section.
 - Fixed Software renderer being unable to restore a windowed mode on certain monitors, when switching from a real fullscreen mode.
 - Fixed character may get stuck inside a non-walkable area after Character.WalkStraight().
 - Fixed character may rarely finish walking on a non-walkable pixel.
 - Fixed calling Character.StopMoving() after AddWaypoint() succeeded a regular Walk() call with eWalkableAreas parameter will wrongfully teleport the character to the nearest walkable area, even though AddWaypoint is supposed to ignore walkable areas.
 - Fixed a number of region or hotspot's "Stand on hotspot" events may unexpectedly run after a blocking character's walk, even if character is no longer standing on that region/hotspot.
 - Fixed Lucas-Arts style character speech displaying offscreen if character is standing below the bottom of a room viewport.
 - Fixed calling Dialog.Start() inside a dialog script would create a nested "dialog state", which could eventually lead to internal mistakes and program stack overflow. Dialog.Start() will now schedule a proper dialog topic switch, equivalent to "goto-dialog" command.
 - Fixed displaying room masks with Debug command in legacy "upscale" mode.
 - Fixed a potential lockup that may occur when the engine is run from the editor, and is told to stop at a breakpoint.
 - Fixed 48khz OGG clips may have extra silence added to them in the end, causing "hickups" when the sound playback is looped.

Engine Plugin API:
 - Updated few callback and function prototypes in order to make them 64-bit compatible (allow pass and receive pointers). This includes AGS_EngineOnEvent for AGSE_TRANSLATETEXT and render stage events, and CallGameScriptFunction which now lets pass a const char* argument.
 - Added IAGSEngine.CreateDynamicArray(), which lets plugins to create dynamic arrays.
 - Added IAGSEngine.GetDynamicArrayLength() and IAGSEngine.GetDynamicArraySize(), which tell the passed array object's number of elements, and total size in bytes respectively.
 - Added IAGSEngine.Log(), which lets plugins to print using engine's log system.

Compatibility:
 - Fixed loading of games made in AGS 2.55-56 which include plugins.
 - Fixed loading of rare games made with AGS 2.5 or higher, which contained deprecated "room animations" (animations themselves are currently not functional).
 - Fixed old rooms with rare x3 resolution not displaying correctly.
 - Fixed old pathfinder imprecision affecting few pre-3.0 games.
 - Allow pre-2.7 games to have RestartGame() command be followed and overridden by a NewRoom().
  This is necessary for some older games to be able to proceed.

Windows:
 - Windows version of AGS is now built with MSVS 2019 and higher.

WinSetup:
 - Redesigned winsetup into a tabbed dialog.
 - Added "Reset To Defaults" button that resets all options to values from the game's default config file.
 - Added "Display" selection, allows to select which display to open the game window on.
 - Added "Accessibility" settings for skipping speech and text messages, for text reading speed.
 - In "disabled" section of config "access_skipstyle" setting lets disable all options in setup related to the speech and text skipping.

#2
AGS Engine & Editor Releases / AGS 3.6.2
Sat 17/05/2025 21:18:09
AGS 3.6.2
Full release number: 3.6.2.10


For Editor
Spoiler

For Android
Spoiler
NOTE: the Editor now includes Android build component letting you prepare your own games for Android
[close]

For Engine/Editor developers
Spoiler


Released: 17th May 2025

Previous stable version: AGS 3.6.1 P11 forum thread


This release is brought to you by:

- Alan v.Drake (fixes)
- Crimson Wizard
- edmundito (fixes)
- eri0o
- homelightgames (scalable images for the wizard dialogs)
- rofl0r (compatibility fixes for old games)
- Walter Agazzi (compatibility fixes for old games)


Summary

3.6.2 is planned to be a second update to 3.6, focusing mostly on convenience of existing Editor and Engine features, and expanding existing script commands. For a quick mention, the noteable changes are:
- you may create object event functions in any script of your choosing (except room events);
- a support for loading saves from older versions of the game;
- dynamic arrays have Length pseudo-attribute, letting you to read their length in script;
- dialog events (in "on_event") may let writing custom dialog handling in script easier.
But there's more.

As usual, please refer to "Upgrading to AGS 3.6.2" topic in the manual for further information on most outstanding changes in this version:
https://adventuregamestudio.github.io/ags-manual/UpgradeTo362.html

The full changelog follows.


What is new in 3.6.2

Common:
 - Event handler function are now allowed to be located in any script module.
 - New naming rule for the voice clips: full char name, followed by a number, separated by a dot, e.g. "RogerTheGreat.1234.ogg". The old rule may be enabled again by a switch in "Backwards Compatibility" settings.

Editor:
 - In "Start New Game Wizard" game template selection now displays template's description right in the dialog.
 - "Game statistics" now have Ctrl + F2 shortcut instead of F2.
 - F2 can be used for starting editing names of items in the Project Tree (ones that support that) and folders in the Sprite Manager.
 - Added "Game Speed" property in General Settings.
 - Added "Use old-style voice clip naming rule" property in General Settings, it lets to select whether the game should expect old-style voice clip filenames (4-letter char name followed by number) or the new one (full char name, followed by a number, separated by a dot).
 - In General Settings renamed "Override built-in inventory window click handling" option to the older variant "Handle inventory window clicks in script" (because it's easier to understand).
 - GUI selection in settings is now done using drop-down lists which list all eligible GUI types instead of having user to type GUI number. The setting will be automatically fixed if a GUI is removed.
 - Property Grid now displays Custom Properties right in the main properties list for each item that supports them.
 - Added "WrapText", "TextPaddingHorizontal", "TextPaddingVertical" properties to GUI Button.
 - GUI Labels can select full range of Alignment values in their TextAlignment property.
 - Added "TurnWhenFacing" property to Characters.
 - Textual GUI controls can now select "Null Font" as their font: this will prevent any text to be drawn even if one is assigned, and make it have zero size (when it matters).
 - Property Grid and Room's navigation bar now display object's description along with the script name on the drop-down list labels.
 - "Events" tab on the Properties Grid now has "ScriptModule" selection, which lets define in which module should the related script functions be generated and looked for. The GUI Controls use a ScriptModule set in their parent GUI, and Room events always has a fixed room script selected.
 - Added "Open Recent" submenu in the File menu.
 - Sync script editor's commands in Edit menu with the context menu.
 - Added "Toggle Line Comment" command to Edit menu for scripts.
 - More panes in the Editor are DPI-aware (rescale well with the system font scaling).
 - Editor tabs now display icons indicating their contents (may be disabled in Editor Preferences).
 - Room panel tabs now display room names.
 - Editor will now remember certain window states: "Sprite selector" window and splitter position, splitter position in "Sprite manager".
 - Support reordering folders in Project Explorer with drag & drop.
 - Support importing plain script files: ash, asc or both, - besides script modules (*.scm).
 - On "Color Finder" pane also display actual RGB values that the engine will use. They may be different from requested RGB, because historically engine limits drawing color's RGB precision to 16-bit.
 - Font's "SourceFilename" and "Font Size" properties now have buttons that let import another font file, or reimport same font with different size respectively, instead of clicking on a button on the preview window.
 - Added a readonly "ProjectFilename" property to Fonts, which displays their in-project file name.
 - Global Variables panel now allows to declare arrays.
 - Added "Controls transparency" slider to GUI edit pane.
 - Copy, paste and delete commands now apply to all the selected GUI controls in GUI editor.
 - When pasting a copied GUI control, Locked property of a new control will be turned off.
 - Support editing group properties for selected GUI controls.
 - Added a multiline Text edit window for Button and Label controls, that may be called by Ctrl+E, from context menu, or by pressing "..." button of the Text property in the Properties grid.
 - Support reordering folders in Sprite Manager with drag & drop.
 - Added "Replace source paths for sprites..." context menu command in Sprite Manager. This command allows to batch-replace parent folder for all sprite source paths, in case you moved original files from one folder to another.
 - Added "Palette index" selection for sprite's import transparency option.
 - Support importing 32-bit BMP files of extended formats (this support is formal at the moment, and does not guarantee that any of the extended data will be interpreted).
 - Support importing 1-bit (monochrome) and 4-bit images as sprites, room backgrounds and masks (converted to 8-bit).
 - Do not alter or clamp palette for 8-bit sprites imported in a 16/32-bit game.
 - Support importing indexed images which palettes contain translucent alpha as sprites with alpha.
 - Support importing indexed PNGs as room backgrounds and masks.
 - Added "Change Room Number" context menu command for the Rooms in Project Explorer.
 - When the room background size changes, reset room edges to defaults.
 - Removed obsolete "Copy walkable area mask to regions" command from the Room editor.
 - Improved scrolling of drop-down lists in the Room's navigation bar: made scroll buttons larger, and support mouse wheel.
 - In Room Editor, during any area drawing mode Ctrl + LMB now works as area picker regardless of the currently selected tool.
 - Added "Replace source paths for audio clips..." context menu command for the Audio node. This command allows to batch-replace parent folder for all clips' source paths, in case you moved original files from one folder to another.
 - Don't restrict compiling a voice-based lipsync if game has a Lucas-Arts style speech.
 - Do not delete previously built game exe from Compiled/Windows folder when testing a game from the editor.
 - Editor will now report any missing script functions that are assigned to events, but not present in script, as warnings when compiling the game.
 - Editor will now report any script functions that *look like* event functions, but not assigned to corresponding events, as warnings when compiling the game.
 - Editor will interrupt "Check for updates" process if it is taking too long with no progress.
 - Added "/maketemplate" command-line option that tells Editor to run, make template out of the said game, and quit.
 - Fixed Project Explorer refreshing when user changes names or descriptions of room objects.
 - Fixed importing indexed PNG as a sprite, previously Editor would mistakenly treat the source image as 32-bit.
 - Fixed importing GIFs with "palette 0 / N" transparency option would refer a palette color from each individual frame's palette rather than the original GIF palette, which could lead to wrong colors used as transparents.
 - Fixed importing 8-bit BMP sprites with no "Remap palette" and "Leave As Is" as a transparency option would still remap palette index 0 to the first found palette entry with Alpha 0, even if that's a filler entry not used by the image.
 - Fixed exporting room backgrounds was always writing a 32-bit image rather than using actual background's color depth.
 - Fixed Autocomplete failing in case of UNIX line endings in script file.
 - Fixed Autocomplete not giving correct results in case of a long chained access, i.e. something like "var[0].member.member".
 - Fixed Autocomplete giving wrong list of choices for wrong syntax cases like: indexed access of a type and non-array struct variable, member access of a static array.
 - Fixed Button getting resized to the image's size when user cancels different sprite assignment.
 - Fixed "Color Finder" and color properties were mapping a color number to RGB values with accuracy mistakes, resulting in slightly different values than the engine would use.
 - Fixed Font preview could crash the Editor with out of memory error in case of a very big font.
 - Fixed Editor refusing to open a project if one or more of the sections are missing in the file.
 - Fixed an unhandled exception occuring when rebuilding rooms if any script's header is missing.
 - Fixed a "unterminated string" error in Dialogs was not pointing to the actual error location.
 - Fixed double warning message when trying to close the Editor while a game test is running.
 - Fixed Editor may display a "save project" confirmation when run with "/compile" command-line parameter.

Scripting:
 - Dynamic arrays now have Length readonly property that returns their number of elements.
 - Support zero-length dynamic arrays. This may be useful if you need to have a dynamic array with no elements, but don't want to bother about checking a null pointer.

Script API:
 - Added eNullFont constant that lets assign or pass a "null font" to any property or function parameter which expects a font's ID. This "null font" will simply make any text not drawn and have no actual measurements (size, spacing, etc).
 - Added global events: eEventDialogStart, eEventDialogStop, eEventDialogRun, eEventDialogOptionsOpen, eEventDialogOptionsClose (these are handled in "on_event").
 - Events eEventGUIMouseDown and eEventGUIMouseUp now get additional parameters: mouse button, mouse x and y positions (relative to the exact GUI).
 - Expanded "on_mouse_click" callback, now supports two more parameters: click x,y coordinates.
 - Added RestoredSaveInfo struct which contains information about game save's contents,
 - Support "validate_restored_save" callback, which lets user to validate restored saves with mismatching data and request cancellation or continuation of restoring this save.
 - Added Button.WrapText, TextPaddingHorizontal, TextPaddingVertical.
 - Added Character.Following property that returns another Character that this one follows after.
 - Added Character.TurnWhenFacing property.
 - Added Character.MoveStraight() complementing WalkStraight().
 - Added DateTime.CreateFromDate() and CreateFromRawTime().
 - Added static Dialog.CurrentDialog property and non-static ExecutedOption and AreOptionsDisplayed properties.
 - Added static Dialog.Stop() function, a OO-style alias to StopDialog().
 - Added RenderLayer enum, and optional "layers" parameter to DynamicSprite.CreateFromScreenShot(), that tells which of the game's render layers to capture when making a screenshot.
 - Added File.Copy() and File.Rename().
 - Added FileSortStyle and SortDirection enum, and File.GetFiles() function that returns a dynamic array of filenames found using certain pattern, and optionally sorted by name or time, in ascending or descending order.
 - Added File.GetFileTime() that returns file's modification time.
 - Added File.ReadFloat(), WriteFloat(), ReadRawFloat(), WriteRawFloat(), ReadRawBytes() and WriteRawBytes().
 - Added Game.InBlockingWait property, that tells whether game is waiting for any blocking action or a Wait* call to complete.
 - Added SaveGameSortStyle enum and Game.GetSaveSlots() function that returns a dynamic array of save slot indexes, optionally sorted in certain way.
 - Added Game.GetSaveSlotTime() that returns a time this save slot was last written.
 - Added Game.ScanSaveSlots() that scans a range of game saves and tests them for compatibility, using "validate_restored_save" too if it's present in user script.
   This action is not run immediately, but is scheduled to be executed after current script ends. It reports of scanning completion by sending eEventSavesScanComplete event.
 - Label.TextAlignment has now type Alignment, rather than HorizontalAlignment, and has full alignment range (both horizontal and vertical).
 - Added optional "fileSortStyle" and "sortDirection" parameters to ListBox.FillDirList().
 - Added optional save slot range (min/max), saveSortStyle and sortDirection parameters to ListBox.FillSaveGameList(). This lets to define the exact range of saves it should fill, and order them in desired way.
 - Added ListBox.FillSaveGameSlots(), which initializes a list of saves from a dynamic array of save slot indexes.
 - Added Object.DestinationX and DestinationY properties, complementing ones in Character.
 - Added Overlay.SetPosition() and SetSize() functions for convenience.
 - Added Room.BackgroundCount readonly property.
 - Added Room.NearestWalkableArea() that returns the nearest found point on a walkable area.
 - Added GetWalkBehindBase() function, complementing SetWalkBehindBase().
 - Added Speech.SpeakingCharacter that returns currently speaking character (for blocking speech).
 - Added GetTimerPos() that returns timer's position (remaining time), in ticks.
 - Added CopySaveSlot() and MoveSaveSlot(), which moves existing save to another slot.
 - Added optional save slot range (min/max) parameters to RestoreGameDialog() and SaveGameDialog().
 - Added optional "sprite" parameter to SaveGameSlot(), that lets to pass a number of an arbitrary sprite to write into this save instead of a standard "screenshot".
 - Added optional "width", "height" and "layer" parameters to SaveScreenShot().
   SaveScreenShot() now accepts paths containing standard file tokens ($SAVEGAMEDIR$ etc).
 - Added SendEvent() function that allows to trigger "on_event" function calls in script. Special event value eEventUserEvent may be used as a base index for user-defined events.
 - Added System.DisplayFPS property that toggles FPS counter (a replacement to Debug(4, 1)).
 - Added System.GetEngineInteger() and System.GetEngineString() for returning diagnostic information about engine's runtime state. Possible arguments are defined by EngineValueID enum.
 - Added new game-wide option OPT_SAVEGAMESCREENSHOTLAYER that lets to define which of the game's render layers will be captured when making a standard screenshot for the save game.
 - Add SaveComponentSelection enum and game option OPT_SAVECOMPONENTSIGNORE, which lets to skip certain components when saving or restoring a game. This has dual purpose: reduce number of things in game that may break older saves by simply not having them in a save, and also reducing the size of game saves on disk (e.g. in case of dynamic sprites). Note that all things that were not restored from the save will retain their *current state*.
 - Fixed some script functions in AGS API were declared with "int" return value, while they are supposed to be "void".

Engine:
 - Updated to SDL 2.30.11 and SDL_Sound 2.0.4.
 - Engine now potentially supports reading saves made in older game versions with different content, so long as these saves have *less* data in any given type (i.e. less Characters, or less controls on a certain GUI, or less variables in script, and so forth). This feature is enabled by having a special "validate_restored_save" function anywhere in the game script, that accepts an argument of type RestoredSaveInfo. RestoredSaveInfo   contains various information about the restored save, and "Cancel" property, that must be explicitly set to "false" in script in order to allow to restore such save.
 - Engine supports returning to previously saved rooms which have less script data.
   It's important to remember though that it does no validation of restored room state on its own.
 - Dropped support for pre-3.5.0 game saves.
 - Increased the cap of simultaneously loaded scripts to 1024 (this includes all regular script modules, a single active dialog script, and a single active room script).
 - Engine no longer quits with error in case a script function assigned to a Room event is missing. Logs warnings about missing script functions assigned to any events.
 - Character.FollowCharacter() can now have a distance parameter up to 32766 (was limited to 255).
 - Ensure that Character.Speaking returns true when a speech is playing even if the character has no speech view.
 - Character.PlaceOnWalkableArea() now does a 1-pixel step scan, ensuring walkable area will be found regardless of how small it is. Optimized the search algorithm to keep it fast enough even in very large rooms.
 - Support voice-based lipsync (Pamela, Papagayo) with Lucas-Arts style speech.
 - DynamicSprite.CreateFromFile() may now load 1-bit and 4-bit bitmaps, converting to 8-bit.
 - Do not alter or clamp palette for 8-bit sprites loaded into a 16/32-bit game at runtime.
 - Assigning InventoryItem.Graphic will no longer reassign CursorGraphic too even if they were identical previously.
 - Calling DeleteSaveSlot() on a slot within 0-50 range will no longer secretly move a save with the topmost number (within the same range) to fill the emptied slot. If you still like to recreate this behavior, then use MoveSaveSlot() command.
 - Support calling StopDialog() inside any regular script and dialog script, and also while dialog options are displayed. That will schedule dialog's stop to be performed after current script finishes.
 - Removed arbitrary limit of 2k bytes for the result of String.Format().
 - Engine will no longer quit with error if any object is assigned a non-existing sprite, but continue, using a sprite 0 as a placeholder instead.
 - Ensure that the objects with identical z-order (baseline) always keep same relative sort order when being drawn (note: engine does not guarantee a predefined order, only a persistent one).
 - Implemented video buffering on a separate thread. Allow to drop late video frames.
 - When mouse is locked in window, confine its position to the game viewport; exclude black border.
 - Added "display" config option to "graphics" section. This is a 1-based display index, where 0 means "use default display".
 - Added new accessibility config settings in "access" section: "speechskip", "textskip", "textreadspeed". These let player to override game's skipping style for character speech and text messages, and text reading speed parameter that controls speech timing.
 - Added "max_save" config option in "override" section: this lets to enforce an arbitrary number of saves displayed in a standard save/restore dialogs in game.
 - Added "--display" command-line argument that lets choose which display to open game window on.
 - Added "--no-plugins" command-line argument that denies loading any plugins; also added respective config option "noplugins" in "override" section.
 - Fixed Software renderer being unable to restore a windowed mode on certain monitors, when switching from a real fullscreen mode.
 - Fixed character may get stuck inside a non-walkable area after Character.WalkStraight().
 - Fixed character may rarely finish walking on a non-walkable pixel.
 - Fixed calling Character.StopMoving() after AddWaypoint() succeeded a regular Walk() call with eWalkableAreas parameter will wrongfully teleport the character to the nearest walkable area, even though AddWaypoint is supposed to ignore walkable areas.
 - Fixed a number of region or hotspot's "Stand on hotspot" events may unexpectedly run after a blocking character's walk, even if character is no longer standing on that region/hotspot.
 - Fixed Lucas-Arts style character speech displaying offscreen if character is standing below the bottom of a room viewport.
 - Fixed calling Dialog.Start() inside a dialog script would create a nested "dialog state", which could eventually lead to internal mistakes and program stack overflow. Dialog.Start() will now schedule a proper dialog topic switch, equivalent to "goto-dialog" command.
 - Fixed displaying room masks with Debug command in legacy "upscale" mode.
 - Fixed a potential lockup that may occur when the engine is run from the editor, and is told to stop at a breakpoint.
 - Fixed 48khz OGG clips may have extra silence added to them in the end, causing "hickups" when the sound playback is looped.

Engine Plugin API:
 - Updated few callback and function prototypes in order to make them 64-bit compatible (allow pass and receive pointers). This includes AGS_EngineOnEvent for AGSE_TRANSLATETEXT and render stage events, and CallGameScriptFunction which now lets pass a const char* argument.
 - Added IAGSEngine.CreateDynamicArray(), which lets plugins to create dynamic arrays.
 - Added IAGSEngine.GetDynamicArrayLength() and IAGSEngine.GetDynamicArraySize(), which tell the passed array object's number of elements, and total size in bytes respectively.
 - Added IAGSEngine.Log(), which lets plugins to print using engine's log system.

Compatibility:
 - Fixed loading of games made in AGS 2.55-56 which include plugins.
 - Fixed loading of rare games made with AGS 2.5 or higher, which contained deprecated "room animations" (animations themselves are currently not functional).
 - Fixed old rooms with rare x3 resolution not displaying correctly.
 - Fixed old pathfinder imprecision affecting few pre-3.0 games.
 - Allow pre-2.7 games to have RestartGame() command be followed and overridden by a NewRoom().
   This is necessary for some older games to be able to proceed.

Windows:
 - Windows version of AGS is now built with MSVS 2019 and higher.

WinSetup:
 - Redesigned winsetup into a tabbed dialog.
 - Added "Reset To Defaults" button that resets all options to values from the game's default config file.
 - Added "Display" selection, allows to select which display to open the game window on.
 - Added "Accessibility" settings for skipping speech and text messages, for text reading speed.
 - In "disabled" section of config "access_skipstyle" setting lets disable all options in setup related to the speech and text skipping.
#3
AGS 3.6.1 - Patch 11
Full release number: 3.6.1.33


For Editor
Spoiler

For Android
Spoiler
NOTE: the Editor now includes Android build component letting you prepare your own games for Android
[close]

For Engine/Editor developers
Spoiler


Released: 17th May 2025

Previous stable version: AGS 3.6.0 P13 forum thread


This release is brought to you by:

- Alan v.Drake (fixes, improvements)
- Crimson Wizard
- Donovan Watteau (fixes)
- edmundito (iOS fixes)
- eri0o
- mausimus (Text Parser fixes)
- Walter Agazzi (fixes)



Summary

3.6.1 update focuses mainly on improving performance and usability of existing features, in both Editor and Engine.

The noteable addition to the Editor is a "Log Panel", which lets you read game logs right in the editor's window. "Goto definition" now works on game object script names and opens their respective panels. Room editor features better panning and zoom controls. Views allow to select and modify multiple frames at once.

In the engine, there's a significant improvement to script performance, which may make script-heavy games run 30-40% faster compared to AGS 3.6.0 (these were real test results on a certain game with 3D simulation). There's a big improvement to the speed of manipulating Overlays, and general speed improvement of graphics rendering primarily useful for high resolution games.

There are other fixes and improvements to various parts of the program too.
Please be sure to read "Upgrading to AGS 3.6.1" topic in the manual: https://adventuregamestudio.github.io/ags-manual/UpgradeTo361.html


Changes in the Patch 11:

Editor:
 - Clear output panels when loading a different project.

Engine:
 - Fixed engine could run scheduled previous room's event after changing to a different room.
   This could happen, for example, if the room was changed in "on_event" with eEventEnterRoomAfterFadein; in such case a previously scheduled "After Fade-in" would run before proper "Before Fade-in" of the new room.
 - Fixed in 8-bit games Fade effect did not having a frame delay (was passing instantly).

Compatibility:
 - Fixed certain old 8-bit games (like "Trilby's Notes") did not recover after the FadeOut() script command.


Changes in the Patch 10:

Editor:
- Fixed a check for an imported room mask size did not correctly account for the room's mask resolution setting (it worked, but mishandled some edge cases).
- Fixed exceptions occuring when reimporting a sprite or a audio clip from source, if the source filename string was wrapped in double quotes.
- Fixed script variables generation could sometimes produce a non-latin character in a variable name if the Editor is running on a system with non-English current locale.
- Fixed '\n' linebreaks not saved correctly in dialog option strings.
- Fixed translation compiler mistreating escaped opening bracket in a text line (`"\["`);
  it must keep it as-is, because "[" char is a old-style line break in AGS.
- Fixed LogPanel not applying filter settings right after they were changed.

Engine:
- Fixed a AudioChannel did not report a correct Position right after a AudioClip.PlayFrom() call.
- Fixed Button resizing to sprite 0 size if NormalGraphic is set to 0 (default button look).
- Fixed Character movement recalculation when changing move speeds while walking, and movement path contains 45-degrees diagonal segments.
- Fixed a solid Character (serving an obstacle) can get ignored by a walking Character, if the obstacle character's position appears within the walking character's own blocking zone.
  (This seems to be a redundant condition introduced very long time ago in the engine by mistake.)
- Fixed object's look not updated after it was assigned a dynamic sprite, redrawn, sprite deleted, object redrawn without a sprite (used a placeholder), and then another dynamic sprite assigned with coincidentally the same number.
- Fixed font outline index limited to 127 (although we theoretically support higher font numbers).
- Fixed font outline parameters not initialized correctly if engine is built by a system that treats "char" as unsigned 8-bit type.
- Fixed a crash which occured when script mistakenly tried to call RunInteraction() for a inventory item 0.
- Fixed loading translation entries larger than 1024 bytes.
- Fixed SDL log level was defaulting to "verbose" if not read from config (should be "info").

WinSetup:
- Fixed "Save and Run" command sometimes caused 2 engine processes, one of which terminated later.
  This did not prevent a game from running, but could result in temporary CPU and memory overload.


Changes in the Patch 9:

Editor:
- Fixed dragging an item to a folder in Project Explorer might cause that item to visibly appear in a wrong folder, if there are folders which name differ only in letter case.

Engine:
- Fixed Character.Animate() could cause game to error reporting "invalid loop" if this character was idling at the time, and Character.LockView() was not called prior to Animate(). (This is a regression in 3.6.1)
- Fixed inventory cursor hotspot (crosshair) not drawn properly over item sprites with alpha.

OSX:
- Fixed location of global config file: was in game installation directory, now in "Library/Application Support/uk.co.adventuregamestudio".


Changes in the Patch 8:

Editor:
- Fixed game cannot be loaded if its GameFileName setting is an empty string.
- Fixed pressing Alt was not selecting Main Menu.
- Fixed error occuring when trying to assign an image to the multiple selected View Frames if they have different initial images.
- Fixed script preprocessor directive "#else" in the nested conditions.

Engine:
- Made File.ReadStringBack() support reading back strings without null-terminator in the end
  (ReadStringBack() reads a string, which has its length prepended to the sequence of chars).
- Improved graphic mode selection when game window is moved to a secondary monitor.
  Note that still not all graphic setups are reliable on secondary monitors, specifically "real fullscreen" mode may be behaving unexpectedly if you try to switch to it on non-primary display.
- Fixed AudioChannel's Paused state is not saved when saving the game.
- Fixed error in case a character was walking while being locked to a temporary View, and switched to a directional loop which does not exist in the locked view.
- Fixed active item cursor's image may duplicate itself onto other cursors under certain conditions.
  (this is regression since 3.6.1 Patch 6)
- Fixed Inventory Window in automatic mode not redrawing its contents immediately when player character changes.
- Fixed ListBox.FillDirList() may add case-sensitive duplicates on platforms with case-sensitive filesystems.
- Fixed room's fade-out effect playing while skipping a cutscene (it must skip instantly).
- Fixed FadeOut or FadeIn not toggling screen state if they are inside a skipped cutscene. This could have resulted in screen not turning to black or not restored as expected if cutscene was skipped by player.
- Fixed Wait() delay of value > 32k would be treated as infinite timeout.
- Fixed Ctrl + Alt key combination not working (toggle mouse lock). This is a regression in 3.6.1.
- Fixed game may fail loading on platforms with strict memory alignment (e.g. MIPS processors).

Compatibility:
- Fixed SetCharacterViewEx() not treating "align" parameter according to old-style set of values.
- Fixed SetTextOverlay() could cause internal mistakes leading to unexpected errors in game.
- Fixed Wait() calls for pre-3.6.0 versions of Script API, where negative delay was treated as 0.

WinSetup:
- Fixed setup not distinguishing "desktop resolution" and "native resolution" from explicit resolution sizes when saving or loading config. Made sure that it remembers exactly the choice that user made ("desktop", "game resolution" or explicit resolution size).
- Fixed "native game resolution" not present in the list if it equals desktop resolution.
- Fixed nearest resolution selection in case config requested a resolution equal to the native game's resolution, but that resolution was not among the supported ones.


Changes in the Patch 7:

Engine:
- Hotfix mouse cursor not being drawn sometimes after changing rooms (regression in 3.6.1 P6).


Changes in the Patch 6:

Editor:
- Fixed Ctrl+C and Ctrl+V not working in GUI editor.
- Fixed sprite export and copying a sprite to clipboard operations were always exporting a 32-bit image, regardless of the actual sprite's color depth.
- Fixed "Recreate spritefile" command was unintentionally converting any sprite to 32-bit if its source was not found, and it was taking existing image from the old spritefile.

Engine:
- Fixed Software renderer could crash the game under some circumstances when the sprite cache's limit is exceeded (this is a regression in 3.6.1).
- Fixed text-based lipsync's frame delay calculation: the existing formula was causing the delay value to "jump" back and forth with the slightest difference of speech text length, resulting in the speech lines of close length to be played with the notably different animation speeds.
- Fixed drawing a 32-bit sprites on a 8-bit surface (e.g. a room mask), it was done wrong and was causing a memory corruption too.
- Fixed drawing a room's walkable mask in script could cause errors during character walking if used colors exceeded walkable area number limit.
- Fixed walk-behinds not drawn over characters and objects anymore (regardless of their baselines) after walk-behind mask was changed using drawing operations in script.
- Fixed Game.SimulateKeyPress() not working in "old key-handling mode" (regression since 3.6.0).
- Fixed script location is not reported in case of logical errors in engine's functions (regression since 3.6.0).

WinSetup:
- Removed an obscure "Use 85 Hz display" option.


Changes in the Patch 5:

Editor:
- When the room background size changes, clamp Room Edges to the new size.
- Fixed Editor refusing to load a project if its folder name exceeds 40 characters.
  (An obsolete historical limitation which we forgot to cut from the program.)

Compiler:
- Fixed script compilation hanging forever if a non-latin unicode character is met in script (outside of comments).

Engine:
- Fixed GUI.ProcessClick() using mouse position when detecting a GUI control, instead of the position passed in the argument list.
- Fixed Region.GetAtScreenXY() was returning null for offscreen coordinates. Made it return region
  • for consistency with other room areas, and backwards compatibility.
- Fixed room Overlays not sorted in the order of their creation, like screen Overlays.
 - Fixed a potential mistake in Lucas-Arts speech position when there are multiple room viewports and speaking character is not directly visible in any of them.
 - Fixed Engine could switch program's locale to the current system locale by mistake when player is typing text. This could potentially lead to random glitches in text input in games which are run in ASCII mode and are handling extended characters.
 - Fixed TextBox was trying to display unsupported characters (in ASCII mode), resulting in random garbage.


Changes in the Patch 4:

Editor:
 - Fixed extracting templates with very large files inside would cause "Out of memory" error.
 - Fixed crash occuring when trying to import a non-existant GIF frame during Sprite Import.
 - Fixed potential mistake with sprite transparency occuring when importing a 8-bit sprite into 16/32-bit game.

Compiler:
 - Fixed "\t" (and few other less common escaped chars) not handled properly when they are inside string literals.
 - Fixed a crash in compiler occuring if user script defined a variadic function.
  (User-defined variadic functions are not properly usable at the moment, but this at least prevents an unhandled exception.)

Scripting:
 - Declare "UNICODE" macro for scripts if game is made in unicode mode.

Script API:
 - Added a number of missing OPT_* constants used with Get/SetGameOption functions.

Engine:
 - Fixed setting Screen.AutoSizeViewportOnRoomLoad to false in "game_start" could cause primary viewport and camera become initialized with zero width and height.
 - Fixed setting camera's size in "game_start" would unexpectedly get camera clamped to 320x200.
 - Fixed number of mistakes in Text Parser occuring when handling "multiwords".


Changes in the Patch 3:

Editor:
 - Fixed that after deleting a View's frame editor did not select next frame (regression in 3.6.1).
 - Fixed "Delete last loop" button not appearing in the View Editor if the view is filled using "Assign sprites to view" command from the Sprite Manager.

Engine:
 - Implemented an alternate solution for rendering "bad" TTF fonts that does not increase their loading times (after previous patch 2).
 - Allow scene render during "load room" event if the last room transition was "Instant".
  This has to be done because number of games used this event for custom transitions.
 - For games compiled in "Debug" mode "warnings.log" file will be written in "savegame dir" on platforms where modifying game directory is forbidden in principle (OSX, iOS, Android, Web).
 - Fixed System.Log() was registered for plugins using a wrong argument list.

Compatibility:
 - Fixed loading of 3.5.0 saves (broken in 3.6.1).

Windows:
 - Fixed disk space check was testing space in the current directory instead of the save game location.


Changes in the Patch 2:

Editor:
 - Fixed few potential program errors for "Generate Keystore" in Android preferences.
 - Fixed external processes (such as test game runs) were started using ShellExecute, which could theoretically lead to unintended results.

Engine:
 - Fixed String.Replace crashing the engine if the resulting string exceeds 3000 bytes.
 - Fixed releasing a mouse button could cause double "on_event" call (with eEventGUIMouseUp).
 - Improved rendering of TTF fonts which have glyph sizes surpassing declared font's height.
  This fixes the look of text on gui controls, and automatic outlining on these fonts.
 - Fixed a dialog shown with InputBox() function drawing typed text beyond text box'es border.
 - Fixed custom dialog options in the "old mode" not triggering redraw when the active option changes.


Changes in the Patch 1:

Editor:
- Fixed View's frame preview sometimes drawn incorrectly, in case of certain panel sizes.
- Fixed folding in the script editor not working correctly if there's a commented closing bracket ("//}") inside this code section.
- Fixed Editor sometimes failing to update game exe's file information and/or icons, if user was importing any sprites during this working session.

Engine:
- Fixed room objects not updating under Direct3D/OpenGL renderer, if they were assigned a dynamic sprite, then that sprite was deleted, and a new one assigned with coincidentally same ID.
- Fixed room objects not updating under Software renderer, if they were assigned a dynamic sprite, and that sprite was modified while object was not visible on screen.
- Fixed inventory cursor's crosshair not displayed (when enabled in game settings).



What is new in 3.6.1

Common features:
- Implemented Deflate compression option for sprites.
- Removed length limits for: Game name, savegame folder, Character's script name and regular name (description), Inventory item's name (description), Mouse cursor's script name, Audioclip's script name.

Editor:
- Discontinued Source control integration functionality, removed "Put sound and sprite files in source control" option from General Settings.
- In General Settings moved few properties to different groups for better consistency.
- Added "Scale Character sprite offsets" property to General Settings. This property refers to scaling of Character.z and sprite offsets added by LockViewOffset script command.
- Added TextureCacheSize and SoundCacheSize properties to Default Setup. These let configure the sizes of runtime texture and sound cache sizes respectively.
- Added "Leave room after fade-out" event to Rooms (called "Unload" by default).
- Added Translated property to all GUI Controls (was available only in ListBox). Translated property tells whether this control's text has to be translated, and applied text direction (in right-to-left text mode).
- Support '\n' linebreak character in the Label's Text and potentially other text properties.
- Improved Room Editor controls:
  Added free panning mode done by holding the middle mouse button, or alternatively - by holding Space + LMB.
  Mouse Wheel without key modifiers scrolls the room vertically; Shift + Mouse Wheel scrolls the room horizontally.
  Zoom is done by Ctrl + Mouse Wheel and room now zooms towards or outwards the cursor position.
- In Room Editor the context menu is now displayed by RMB or Shift + RMB while editing masks.
  The individual room mode menu is merged with the "copy coordinates" command when shown.
- In Room Editor the hint with coordinates is now also displayed when moving Objects or Characters with keyboard.
- In Dialog Script editor support most Edit menu and context menu commands from the regular Script editor, with a few exceptions.
- In Sprite Manager added command "View" -> "Show filenames" which toggles display of a sprite's source filename under the sprites.
- Adjust sprites' import settings after "Crop sprite edges" command; this would ensure that these sprites are restored from source file keeping their cropped sizes.
- During sprite export Editor will display a proper progress dialog.
- Zoom controls in Character and View panes now allow downscaling too. View editor displays the preview sprite stretched to fill the parent panel.
- View editor now allows to select multiple frames at once, across multiple loops too, using standard Shift + LMB and Ctrl + LMB combinations. Properties panel lets modify properties for all the selected frames at once.
- Added "Replace with all sprites from folder" command to the View editor's context menu.
- For Audio Clips in the project tree added "Force Reimport", "Force reimport all file(s)" and "Replace Source File" context menu commands.
- For Output Panel added "Copy selection" context menu command.
- Implemented Log Panel that lets you see the engine and game logs right in the Editor.
- Improved LipSync panel looks in case user's system has display scaling option enabled.
- "Goto Definition" command in script will now work for most of the game entities too, such as Characters, GUIs, and so forth. In that case it will find a game's entity and open a respective editor panel for it. This still does not work for some types, such as Room objects, and Views.
- Added main menu commands for opening a Project folder and Compiled folder.
- Added "Export Global Messages to script" menu command. This command is meant for upgraded pre-3.2 game projects, and will generate a script with a String array, moving global messages texts there.
- For script's tabs added a context menu command for opening this script's location.
- When run with "/compile" argument Editor will print all messages to the console (stdout), instead of displaying modal message windows.
- For Android build target Editor now supports a directory to place plugins in.
- When building a game for Android and Linux the Editor will now be more tolerant to missing plugins and only issue a warning instead of stopping with error.
- Config will now be saved in UTF-8, letting to support setup program's title text in unicode.
- For non-Windows build targets Editor will fix config containing Direct3D graphics driver option and set OpenGL instead.
- For Color Themes: implemented character literal, braces match and braces error settings.
- Made Editor be somewhat more tolerate to missing XML nodes in Game.agf, in many cases it will still let open a game.
- When upgrading older game projects, Editor will insert a call to SetRestartPoint() in the end of the 'game_start' function in GlobalScript.asc. This is done to complement removal of an automatic restart point in the engine. This inserted command is safe to remove.
- When upgrading pre-3.2 rooms with disabled SaveLoadEnabled property the Editor will reset this property and insert a comment with a warning into the corresponding room's script. This is done because this property is deprecated as is no longer accessible.
- Fixed Editor refusing to open a game if one of the translation files is missing.
- Fixed General Settings and Default Setup not working correctly right after importing a pre-3.* game project.
- Fixed importing GIFs or 8-bit PNGs may lose transparent pixels if source images used other palette index than 0 for transparency.
- Fixed Project Explorer's folders collapsing after certain user actions, such as dragging items or renaming things.
- Fixed deleting collapsed "region" in script would sometimes lead to portion of the script undeleted but staying invisible.
- (Possibly) Fixed a "Index out of range" exception in Script editor, related to the "script location" drop-down list, which could occur at random circumstances while
  working with the script, and any Color Theme is enabled.
- Fixed Editor could miss some of the files when cleaning up old compiled files after the Game's Filename property is changed.

Scripting:
- Support "#else" preprocessor directive.

Script API:
- Implemented Room's "After fade-out" event.
- Added eEventLeaveRoomAfterFadeout event for the global "on_event".
- Added eEventGameSaved event which runs after game was saved.
- Expanded interaction functions for Character, Object, InventoryItem, Hotspot and Region types: now they all receive respective object's pointer as a parameter, similar to GUI event functions, as well as a cursor mode this interaction was run with, if applicable.
- Added Game.ResetDoOnceOnly(), which completely resets all DoOnceOnly instances.
- Added Game.PrecacheSprite() and Game.PrecacheView(), which preload certain sprites and linked frame sounds into the engine's sprite cache memory.
- Added ScriptName property to AudioClip, Character, Dialog, GUI, GUIObject, Hotspot, InventoryItem, Object.
- Added static GetByName() function to AudioClip, Character, Dialog, GUI, GUIObject, Hotspot, InventoryItem, Object.
- Added Object.AnimationVolume property, which works similar to Character.AnimationVolume.
- Added static File.ResolvePath() and File.Path attribute.
- Added support for a text formatting to a number of functions: DisplayAtY(), Character.SayAt(), Character.SayBackground(), DrawingSurface.DrawStringWrapped().

Engine:
- Updated to SDL 2.28.5 and SDL_Sound 2.0.3+.
- Significant performance improvement to scripts. Script running speed restored to a level close to AGS 3.2.1. Testing few "script-heavy" games showed fps raise by up to 30-40% compared with 3.6.0 engine.
- Improved performance of String objects in script.
  For instance, appending a character to a String is now roughly x2 times faster, *sequential* iteration of String.Chars[] in Unicode mode is about x12 (!) times faster (Strings in ASCII mode have relatively less improvement, because they have been faster than Unicode mode already).
- Improved performance when creating, deleting and manipulating Overlays; allows the game to have thousands of those with much less slowing down.
- Improved performance when updating and deleting dynamic sprites, and notifying any objects that have to redraw themselves. Engine no longer resets Graphic properties of objects referencing deleted dynamic sprite to 0.
- Implemented "texture cache", in addition to the existing "sprite cache". The texture cache keeps textures generated from raw sprites and lets reusing them, improving performance and reducing CPU workload. The actual impact is proportional to the game's resolution and amount of simultaneously animated objects on screen.
- WFN font renderer now too supports unicode mode and renders texts in utf-8, so long as the font contains glyphs of corresponding indexes.
- Buttons, ListBoxes and TextBoxes now support Right-to-left text direction.
- DrawingSurface.DrawString now supports Right-to-left text direction.
- All the script File functions now treat paths in case-insensitive way (including subdirs), which makes them platform-independent.
- Removed an automatic SetRestartPoint() call at startup. This is done in case user does not want to use default "restart" save slot, or has a custom save system.
- Support handling multiple mouse clicks per game frame, similar to how multiple key presses were supported since 3.6.0.
- When starting up, engine will now precache only first 4 or 8 loops of the starting player character's View. This is done to avoid filling sprite cache with too much sprites at once in case when the player's View contains lots of additional animations.
- Characters will now have their graphic offsets, set by Character.z property and LockViewOffset() function, scaled along with the character's own scaling. This is done so long as the respective game option is enabled in the General Settings.
- Ensure that character and object scaling is updated even when the game is not drawn. This fixes rare issues when their scale property did not update in time whilst the game was completely fadeout, and similar cases.
- Allow to change Character's move speed while its moving.
- When Character is ordered a new move command while already moving, the engine will try to make a smooth transition between old and new moving without a delay.
- Ensure that when Overlays have identical ZOrder they will be sorted in the order of their creation. Besides convenience, this is also meant to restore historical behavior from before Overlay.ZOrder property was introduced.
- Allow game to call DynamicSprite.CreateFromDrawingSurface() and CreateFromBackground() with zero or negative size, clamping it to 1x1, in consistency with Create().
- Engine will now log a warning for the most incorrect parameters to Animate function instead of quitting the game.
- Engine will now skip blocking Character.Say commands instantly while skipping a cutscene.
- Object.SetView now lets invalid loop and frame values, and fallbacks to using loop 0, frame 0, printing a warning. This is also consistent with backwards-compatble SetObjectFrame() behavior.
- Changed Object.SetView() to not play a frame's sound, which could lead to a duplicated sound play if Object.Animate is run right after.
- Text Overlays internal images are now registered as dynamic sprites, and their IDs may be read from Overlay.Graphic. This lets find out their sizes using Game.SpriteWidth/SpriteHeight and optionally draw them somewhere using DrawingSurface.DrawImage.
- Ensure all the script API is now correctly available for the plugins.
- Engine will now safeguard plugin's reading and writing of game saves, so that any mistakes done by plugins won't affect other parts of a save.
- Engine will disable vsync in a "infinite fps" mode, because vsync prevents getting more fps.
- Engine will force any in-game debug messages to be displayed in message boxes, disregarding game's "Display all messages as speech" option.
- Display critical alerts as system modal messages on all platforms that support that (unless engine is run with "--no-message-box" parameter).
- Print some info about memory usage when reporting a "Out of memory" error.
- Deprecated in-game "console", as practically useless.
- Added new config settings in "graphics" section: "sprite_cache_size" (which replaces deprecated "cachemax" in "misc") and "texture_cache_size".
- Fixed Characters may be seemingly "walking in place" for some time when arriving at destination.
- Fixed Display and Say commands treating the second met "&" sign as a voice-over token too (they must only check the first one in string).
- Fixed PlayMP3File() function limiting filename argument by an arbitrary number of characters.
- Fixed speechlines were adjusting their Y position while trying to not overlap GUIs even when these GUIs are completely offscreen.
- Fixed first Sierra-style speechline in a sequence was adjusting its Y position without need when GUIs are set to be hidden during game pause (this includes blocking speech). Normally, the speechlines are adjusting their Y position in order to not overlap GUIs, but when GUIs are hiding during speech there should not be any need to do so.
- Fixed script behavior in case a local variable was assigned a value without being initialized with a zero memory by compiler's intruction beforehand. This is not a problem with the standard compiler, but technically could be an issue with any custom implementation.
- Fixed old-style letterbox viewport getting broken after loading an old pre-3.5.0 save.

Engine Plugin API:
- Added IAGSStream interface, IAGSEngine.OpenFileStream() and GetFileStreamByHandle().
- Added IAGSEngine.ResolveFilePath() method, which resolves a script path (with location tokens) into a proper system filepath.
- Fixed IAGSEngine.GetFontType() incorrectly reporting TTF font type for WFN fonts with more than 128 characters.

Compatibility:
- In Editor, restored all the Character's variables available in "backward-compatible" mode. This is primarily to make it easier to import very old games.
- Allow to run an animation over a loop with zero frames, by using the placeholder frame. This lets particular old games to continue running instead of crashing with error.
- Fixed slower character walking speeds in pre-3.1 upscaled and high-resolution games.
- Fixed Object.SetView() and SetObjectFrame() not treating -1 for loop and frame as "keep previous values" in older games.
- Fixed inventory window not updated after game.top_inv_item is assigned a new value.
- Fixed a "New Room" command in old-style dialog scripts was preventing "First time Enter room" event to be called.

Windows:
- 32-bit Windows engine is now built as "large address aware" program, which will allow it to use up to 3 GB of RAM on 32-bit systems and 4 GB of RAM on 64-bit systems (was 2 GB previously).

iOS:
- Updated port for 3.6.*.

Web / Emscripten:
- Fixed Safari cannot switch the game into fullscreen mode.

WinSetup:
- Added options for setting texture cache and sound cache size.
- Added options to disable particular graphic drivers and graphic driver selection, and fullscreen mode selection.




Thanks to everyone who contributed to and tested this version!





#4
AGS 3.6.1 - Patch 10
Full release number: 3.6.1.32


For Editor
Spoiler

For Android
Spoiler
NOTE: the Editor now includes Android build component letting you prepare your own games for Android
[close]

For Engine/Editor developers
Spoiler


Released: 13th April 2025

Previous stable version: AGS 3.6.0 P13 forum thread


This release is brought to you by:

- Alan v.Drake (fixes, improvements)
- Crimson Wizard
- Donovan Watteau (fixes)
- edmundito (iOS fixes)
- eri0o
- mausimus (Text Parser fixes)
- Walter Agazzi (fixes)



Summary

3.6.1 update focuses mainly on improving performance and usability of existing features, in both Editor and Engine.

The noteable addition to the Editor is a "Log Panel", which lets you read game logs right in the editor's window. "Goto definition" now works on game object script names and opens their respective panels. Room editor features better panning and zoom controls. Views allow to select and modify multiple frames at once.

In the engine, there's a significant improvement to script performance, which may make script-heavy games run 30-40% faster compared to AGS 3.6.0 (these were real test results on a certain game with 3D simulation). There's a big improvement to the speed of manipulating Overlays, and general speed improvement of graphics rendering primarily useful for high resolution games.

There are other fixes and improvements to various parts of the program too.
Please be sure to read "Upgrading to AGS 3.6.1" topic in the manual: https://adventuregamestudio.github.io/ags-manual/UpgradeTo361.html


Changes in the Patch 10:

Editor:
 - Fixed a check for an imported room mask size did not correctly account for the room's mask resolution setting (it worked, but mishandled some edge cases).
 - Fixed exceptions occuring when reimporting a sprite or a audio clip from source, if the source filename string was wrapped in double quotes.
 - Fixed script variables generation could sometimes produce a non-latin character in a variable name if the Editor is running on a system with non-English current locale.
 - Fixed '\n' linebreaks not saved correctly in dialog option strings.
 - Fixed translation compiler mistreating escaped opening bracket in a text line (`"\["`);
   it must keep it as-is, because "[" char is a old-style line break in AGS.
 - Fixed LogPanel not applying filter settings right after they were changed.

Engine:
 - Fixed a AudioChannel did not report a correct Position right after a AudioClip.PlayFrom() call.
 - Fixed Button resizing to sprite 0 size if NormalGraphic is set to 0 (default button look).
 - Fixed Character movement recalculation when changing move speeds while walking, and movement path contains 45-degrees diagonal segments.
 - Fixed a solid Character (serving an obstacle) can get ignored by a walking Character, if the obstacle character's position appears within the walking character's own blocking zone.
   (This seems to be a redundant condition introduced very long time ago in the engine by mistake.)
 - Fixed object's look not updated after it was assigned a dynamic sprite, redrawn, sprite deleted, object redrawn without a sprite (used a placeholder), and then another dynamic sprite assigned with coincidentally the same number.
 - Fixed font outline index limited to 127 (although we theoretically support higher font numbers).
 - Fixed font outline parameters not initialized correctly if engine is built by a system that treats "char" as unsigned 8-bit type.
 - Fixed a crash which occured when script mistakenly tried to call RunInteraction() for a inventory item 0.
 - Fixed loading translation entries larger than 1024 bytes.
 - Fixed SDL log level was defaulting to "verbose" if not read from config (should be "info").

WinSetup:
 - Fixed "Save and Run" command sometimes caused 2 engine processes, one of which terminated later.
   This did not prevent a game from running, but could result in temporary CPU and memory overload.


Changes in the Patch 9:

Editor:
 - Fixed dragging an item to a folder in Project Explorer might cause that item to visibly appear in a wrong folder, if there are folders which name differ only in letter case.

Engine:
 - Fixed Character.Animate() could cause game to error reporting "invalid loop" if this character was idling at the time, and Character.LockView() was not called prior to Animate(). (This is a regression in 3.6.1)
 - Fixed inventory cursor hotspot (crosshair) not drawn properly over item sprites with alpha.

OSX:
 - Fixed location of global config file: was in game installation directory, now in "Library/Application Support/uk.co.adventuregamestudio".


Changes in the Patch 8:

Editor:
 - Fixed game cannot be loaded if its GameFileName setting is an empty string.
 - Fixed pressing Alt was not selecting Main Menu.
 - Fixed error occuring when trying to assign an image to the multiple selected View Frames if they have different initial images.
 - Fixed script preprocessor directive "#else" in the nested conditions.

Engine:
 - Made File.ReadStringBack() support reading back strings without null-terminator in the end
   (ReadStringBack() reads a string, which has its length prepended to the sequence of chars).
 - Improved graphic mode selection when game window is moved to a secondary monitor.
   Note that still not all graphic setups are reliable on secondary monitors, specifically "real fullscreen" mode may be behaving unexpectedly if you try to switch to it on non-primary display.
 - Fixed AudioChannel's Paused state is not saved when saving the game.
 - Fixed error in case a character was walking while being locked to a temporary View, and switched to a directional loop which does not exist in the locked view.
 - Fixed active item cursor's image may duplicate itself onto other cursors under certain conditions.
   (this is regression since 3.6.1 Patch 6)
 - Fixed Inventory Window in automatic mode not redrawing its contents immediately when player character changes.
 - Fixed ListBox.FillDirList() may add case-sensitive duplicates on platforms with case-sensitive filesystems.
 - Fixed room's fade-out effect playing while skipping a cutscene (it must skip instantly).
 - Fixed FadeOut or FadeIn not toggling screen state if they are inside a skipped cutscene. This could have resulted in screen not turning to black or not restored as expected if cutscene was skipped by player.
 - Fixed Wait() delay of value > 32k would be treated as infinite timeout.
 - Fixed Ctrl + Alt key combination not working (toggle mouse lock). This is a regression in 3.6.1.
 - Fixed game may fail loading on platforms with strict memory alignment (e.g. MIPS processors).

Compatibility:
 - Fixed SetCharacterViewEx() not treating "align" parameter according to old-style set of values.
 - Fixed SetTextOverlay() could cause internal mistakes leading to unexpected errors in game.
 - Fixed Wait() calls for pre-3.6.0 versions of Script API, where negative delay was treated as 0.

WinSetup:
 - Fixed setup not distinguishing "desktop resolution" and "native resolution" from explicit resolution sizes when saving or loading config. Made sure that it remembers exactly the choice that user made ("desktop", "game resolution" or explicit resolution size).
 - Fixed "native game resolution" not present in the list if it equals desktop resolution.
 - Fixed nearest resolution selection in case config requested a resolution equal to the native game's resolution, but that resolution was not among the supported ones.


Changes in the Patch 7:

Engine:
 - Hotfix mouse cursor not being drawn sometimes after changing rooms (regression in 3.6.1 P6).


Changes in the Patch 6:

Editor:
 - Fixed Ctrl+C and Ctrl+V not working in GUI editor.
 - Fixed sprite export and copying a sprite to clipboard operations were always exporting a 32-bit image, regardless of the actual sprite's color depth.
 - Fixed "Recreate spritefile" command was unintentionally converting any sprite to 32-bit if its source was not found, and it was taking existing image from the old spritefile.

Engine:
 - Fixed Software renderer could crash the game under some circumstances when the sprite cache's limit is exceeded (this is a regression in 3.6.1).
 - Fixed text-based lipsync's frame delay calculation: the existing formula was causing the delay value to "jump" back and forth with the slightest difference of speech text length, resulting in the speech lines of close length to be played with the notably different animation speeds.
 - Fixed drawing a 32-bit sprites on a 8-bit surface (e.g. a room mask), it was done wrong and was causing a memory corruption too.
 - Fixed drawing a room's walkable mask in script could cause errors during character walking if used colors exceeded walkable area number limit.
 - Fixed walk-behinds not drawn over characters and objects anymore (regardless of their baselines) after walk-behind mask was changed using drawing operations in script.
 - Fixed Game.SimulateKeyPress() not working in "old key-handling mode" (regression since 3.6.0).
 - Fixed script location is not reported in case of logical errors in engine's functions (regression since 3.6.0).

WinSetup:
 - Removed an obscure "Use 85 Hz display" option.


Changes in the Patch 5:

Editor:
 - When the room background size changes, clamp Room Edges to the new size.
 - Fixed Editor refusing to load a project if its folder name exceeds 40 characters.
   (An obsolete historical limitation which we forgot to cut from the program.)

Compiler:
 - Fixed script compilation hanging forever if a non-latin unicode character is met in script (outside of comments).

Engine:
 - Fixed GUI.ProcessClick() using mouse position when detecting a GUI control, instead of the position passed in the argument list.
 - Fixed Region.GetAtScreenXY() was returning null for offscreen coordinates. Made it return region[0] for consistency with other room areas, and backwards compatibility.
 - Fixed room Overlays not sorted in the order of their creation, like screen Overlays.
 - Fixed a potential mistake in Lucas-Arts speech position when there are multiple room viewports and speaking character is not directly visible in any of them.
 - Fixed Engine could switch program's locale to the current system locale by mistake when player is typing text. This could potentially lead to random glitches in text input in games which are run in ASCII mode and are handling extended characters.
 - Fixed TextBox was trying to display unsupported characters (in ASCII mode), resulting in random garbage.


Changes in the Patch 4:

Editor:
 - Fixed extracting templates with very large files inside would cause "Out of memory" error.
 - Fixed crash occuring when trying to import a non-existant GIF frame during Sprite Import.
 - Fixed potential mistake with sprite transparency occuring when importing a 8-bit sprite into 16/32-bit game.

Compiler:
 - Fixed "\t" (and few other less common escaped chars) not handled properly when they are inside string literals.
 - Fixed a crash in compiler occuring if user script defined a variadic function.
   (User-defined variadic functions are not properly usable at the moment, but this at least prevents an unhandled exception.)

Scripting:
 - Declare "UNICODE" macro for scripts if game is made in unicode mode.

Script API:
 - Added a number of missing OPT_* constants used with Get/SetGameOption functions.

Engine:
 - Fixed setting Screen.AutoSizeViewportOnRoomLoad to false in "game_start" could cause primary viewport and camera become initialized with zero width and height.
 - Fixed setting camera's size in "game_start" would unexpectedly get camera clamped to 320x200.
 - Fixed number of mistakes in Text Parser occuring when handling "multiwords".


Changes in the Patch 3:

Editor:
 - Fixed that after deleting a View's frame editor did not select next frame (regression in 3.6.1).
 - Fixed "Delete last loop" button not appearing in the View Editor if the view is filled using "Assign sprites to view" command from the Sprite Manager.

Engine:
 - Implemented an alternate solution for rendering "bad" TTF fonts that does not increase their loading times (after previous patch 2).
 - Allow scene render during "load room" event if the last room transition was "Instant".
   This has to be done because number of games used this event for custom transitions.
 - For games compiled in "Debug" mode "warnings.log" file will be written in "savegame dir" on platforms where modifying game directory is forbidden in principle (OSX, iOS, Android, Web).
 - Fixed System.Log() was registered for plugins using a wrong argument list.

Compatibility:
 - Fixed loading of 3.5.0 saves (broken in 3.6.1).

Windows:
 - Fixed disk space check was testing space in the current directory instead of the save game location.


Changes in the Patch 2:

Editor:
 - Fixed few potential program errors for "Generate Keystore" in Android preferences.
 - Fixed external processes (such as test game runs) were started using ShellExecute, which could theoretically lead to unintended results.

Engine:
 - Fixed String.Replace crashing the engine if the resulting string exceeds 3000 bytes.
 - Fixed releasing a mouse button could cause double "on_event" call (with eEventGUIMouseUp).
 - Improved rendering of TTF fonts which have glyph sizes surpassing declared font's height.
   This fixes the look of text on gui controls, and automatic outlining on these fonts.
 - Fixed a dialog shown with InputBox() function drawing typed text beyond text box'es border.
 - Fixed custom dialog options in the "old mode" not triggering redraw when the active option changes.


Changes in the Patch 1:

Editor:
- Fixed View's frame preview sometimes drawn incorrectly, in case of certain panel sizes.
- Fixed folding in the script editor not working correctly if there's a commented closing bracket ("//}") inside this code section.
- Fixed Editor sometimes failing to update game exe's file information and/or icons, if user was importing any sprites during this working session.

Engine:
- Fixed room objects not updating under Direct3D/OpenGL renderer, if they were assigned a dynamic sprite, then that sprite was deleted, and a new one assigned with coincidentally same ID.
- Fixed room objects not updating under Software renderer, if they were assigned a dynamic sprite, and that sprite was modified while object was not visible on screen.
- Fixed inventory cursor's crosshair not displayed (when enabled in game settings).



What is new in 3.6.1

Common features:
- Implemented Deflate compression option for sprites.
- Removed length limits for: Game name, savegame folder, Character's script name and regular name (description), Inventory item's name (description), Mouse cursor's script name, Audioclip's script name.

Editor:
- Discontinued Source control integration functionality, removed "Put sound and sprite files in source control" option from General Settings.
- In General Settings moved few properties to different groups for better consistency.
- Added "Scale Character sprite offsets" property to General Settings. This property refers to scaling of Character.z and sprite offsets added by LockViewOffset script command.
- Added TextureCacheSize and SoundCacheSize properties to Default Setup. These let configure the sizes of runtime texture and sound cache sizes respectively.
- Added "Leave room after fade-out" event to Rooms (called "Unload" by default).
- Added Translated property to all GUI Controls (was available only in ListBox). Translated property tells whether this control's text has to be translated, and applied text direction (in right-to-left text mode).
- Support '\n' linebreak character in the Label's Text and potentially other text properties.
- Improved Room Editor controls:
  Added free panning mode done by holding the middle mouse button, or alternatively - by holding Space + LMB.
  Mouse Wheel without key modifiers scrolls the room vertically; Shift + Mouse Wheel scrolls the room horizontally.
  Zoom is done by Ctrl + Mouse Wheel and room now zooms towards or outwards the cursor position.
- In Room Editor the context menu is now displayed by RMB or Shift + RMB while editing masks.
  The individual room mode menu is merged with the "copy coordinates" command when shown.
- In Room Editor the hint with coordinates is now also displayed when moving Objects or Characters with keyboard.
- In Dialog Script editor support most Edit menu and context menu commands from the regular Script editor, with a few exceptions.
- In Sprite Manager added command "View" -> "Show filenames" which toggles display of a sprite's source filename under the sprites.
- Adjust sprites' import settings after "Crop sprite edges" command; this would ensure that these sprites are restored from source file keeping their cropped sizes.
- During sprite export Editor will display a proper progress dialog.
- Zoom controls in Character and View panes now allow downscaling too. View editor displays the preview sprite stretched to fill the parent panel.
- View editor now allows to select multiple frames at once, across multiple loops too, using standard Shift + LMB and Ctrl + LMB combinations. Properties panel lets modify properties for all the selected frames at once.
- Added "Replace with all sprites from folder" command to the View editor's context menu.
- For Audio Clips in the project tree added "Force Reimport", "Force reimport all file(s)" and "Replace Source File" context menu commands.
- For Output Panel added "Copy selection" context menu command.
- Implemented Log Panel that lets you see the engine and game logs right in the Editor.
- Improved LipSync panel looks in case user's system has display scaling option enabled.
- "Goto Definition" command in script will now work for most of the game entities too, such as Characters, GUIs, and so forth. In that case it will find a game's entity and open a respective editor panel for it. This still does not work for some types, such as Room objects, and Views.
- Added main menu commands for opening a Project folder and Compiled folder.
- Added "Export Global Messages to script" menu command. This command is meant for upgraded pre-3.2 game projects, and will generate a script with a String array, moving global messages texts there.
- For script's tabs added a context menu command for opening this script's location.
- When run with "/compile" argument Editor will print all messages to the console (stdout), instead of displaying modal message windows.
- For Android build target Editor now supports a directory to place plugins in.
- When building a game for Android and Linux the Editor will now be more tolerant to missing plugins and only issue a warning instead of stopping with error.
- Config will now be saved in UTF-8, letting to support setup program's title text in unicode.
- For non-Windows build targets Editor will fix config containing Direct3D graphics driver option and set OpenGL instead.
- For Color Themes: implemented character literal, braces match and braces error settings.
- Made Editor be somewhat more tolerate to missing XML nodes in Game.agf, in many cases it will still let open a game.
- When upgrading older game projects, Editor will insert a call to SetRestartPoint() in the end of the 'game_start' function in GlobalScript.asc. This is done to complement removal of an automatic restart point in the engine. This inserted command is safe to remove.
- When upgrading pre-3.2 rooms with disabled SaveLoadEnabled property the Editor will reset this property and insert a comment with a warning into the corresponding room's script. This is done because this property is deprecated as is no longer accessible.
- Fixed Editor refusing to open a game if one of the translation files is missing.
- Fixed General Settings and Default Setup not working correctly right after importing a pre-3.* game project.
- Fixed importing GIFs or 8-bit PNGs may lose transparent pixels if source images used other palette index than 0 for transparency.
- Fixed Project Explorer's folders collapsing after certain user actions, such as dragging items or renaming things.
- Fixed deleting collapsed "region" in script would sometimes lead to portion of the script undeleted but staying invisible.
- (Possibly) Fixed a "Index out of range" exception in Script editor, related to the "script location" drop-down list, which could occur at random circumstances while
  working with the script, and any Color Theme is enabled.
- Fixed Editor could miss some of the files when cleaning up old compiled files after the Game's Filename property is changed.

Scripting:
- Support "#else" preprocessor directive.

Script API:
- Implemented Room's "After fade-out" event.
- Added eEventLeaveRoomAfterFadeout event for the global "on_event".
- Added eEventGameSaved event which runs after game was saved.
- Expanded interaction functions for Character, Object, InventoryItem, Hotspot and Region types: now they all receive respective object's pointer as a parameter, similar to GUI event functions, as well as a cursor mode this interaction was run with, if applicable.
- Added Game.ResetDoOnceOnly(), which completely resets all DoOnceOnly instances.
- Added Game.PrecacheSprite() and Game.PrecacheView(), which preload certain sprites and linked frame sounds into the engine's sprite cache memory.
- Added ScriptName property to AudioClip, Character, Dialog, GUI, GUIObject, Hotspot, InventoryItem, Object.
- Added static GetByName() function to AudioClip, Character, Dialog, GUI, GUIObject, Hotspot, InventoryItem, Object.
- Added Object.AnimationVolume property, which works similar to Character.AnimationVolume.
- Added static File.ResolvePath() and File.Path attribute.
- Added support for a text formatting to a number of functions: DisplayAtY(), Character.SayAt(), Character.SayBackground(), DrawingSurface.DrawStringWrapped().

Engine:
- Updated to SDL 2.28.5 and SDL_Sound 2.0.3+.
- Significant performance improvement to scripts. Script running speed restored to a level close to AGS 3.2.1. Testing few "script-heavy" games showed fps raise by up to 30-40% compared with 3.6.0 engine.
- Improved performance of String objects in script.
  For instance, appending a character to a String is now roughly x2 times faster, *sequential* iteration of String.Chars[] in Unicode mode is about x12 (!) times faster (Strings in ASCII mode have relatively less improvement, because they have been faster than Unicode mode already).
- Improved performance when creating, deleting and manipulating Overlays; allows the game to have thousands of those with much less slowing down.
- Improved performance when updating and deleting dynamic sprites, and notifying any objects that have to redraw themselves. Engine no longer resets Graphic properties of objects referencing deleted dynamic sprite to 0.
- Implemented "texture cache", in addition to the existing "sprite cache". The texture cache keeps textures generated from raw sprites and lets reusing them, improving performance and reducing CPU workload. The actual impact is proportional to the game's resolution and amount of simultaneously animated objects on screen.
- WFN font renderer now too supports unicode mode and renders texts in utf-8, so long as the font contains glyphs of corresponding indexes.
- Buttons, ListBoxes and TextBoxes now support Right-to-left text direction.
- DrawingSurface.DrawString now supports Right-to-left text direction.
- All the script File functions now treat paths in case-insensitive way (including subdirs), which makes them platform-independent.
- Removed an automatic SetRestartPoint() call at startup. This is done in case user does not want to use default "restart" save slot, or has a custom save system.
- Support handling multiple mouse clicks per game frame, similar to how multiple key presses were supported since 3.6.0.
- When starting up, engine will now precache only first 4 or 8 loops of the starting player character's View. This is done to avoid filling sprite cache with too much sprites at once in case when the player's View contains lots of additional animations.
- Characters will now have their graphic offsets, set by Character.z property and LockViewOffset() function, scaled along with the character's own scaling. This is done so long as the respective game option is enabled in the General Settings.
- Ensure that character and object scaling is updated even when the game is not drawn. This fixes rare issues when their scale property did not update in time whilst the game was completely fadeout, and similar cases.
- Allow to change Character's move speed while its moving.
- When Character is ordered a new move command while already moving, the engine will try to make a smooth transition between old and new moving without a delay.
- Ensure that when Overlays have identical ZOrder they will be sorted in the order of their creation. Besides convenience, this is also meant to restore historical behavior from before Overlay.ZOrder property was introduced.
- Allow game to call DynamicSprite.CreateFromDrawingSurface() and CreateFromBackground() with zero or negative size, clamping it to 1x1, in consistency with Create().
- Engine will now log a warning for the most incorrect parameters to Animate function instead of quitting the game.
- Engine will now skip blocking Character.Say commands instantly while skipping a cutscene.
- Object.SetView now lets invalid loop and frame values, and fallbacks to using loop 0, frame 0, printing a warning. This is also consistent with backwards-compatble SetObjectFrame() behavior.
- Changed Object.SetView() to not play a frame's sound, which could lead to a duplicated sound play if Object.Animate is run right after.
- Text Overlays internal images are now registered as dynamic sprites, and their IDs may be read from Overlay.Graphic. This lets find out their sizes using Game.SpriteWidth/SpriteHeight and optionally draw them somewhere using DrawingSurface.DrawImage.
- Ensure all the script API is now correctly available for the plugins.
- Engine will now safeguard plugin's reading and writing of game saves, so that any mistakes done by plugins won't affect other parts of a save.
- Engine will disable vsync in a "infinite fps" mode, because vsync prevents getting more fps.
- Engine will force any in-game debug messages to be displayed in message boxes, disregarding game's "Display all messages as speech" option.
- Display critical alerts as system modal messages on all platforms that support that (unless engine is run with "--no-message-box" parameter).
- Print some info about memory usage when reporting a "Out of memory" error.
- Deprecated in-game "console", as practically useless.
- Added new config settings in "graphics" section: "sprite_cache_size" (which replaces deprecated "cachemax" in "misc") and "texture_cache_size".
- Fixed Characters may be seemingly "walking in place" for some time when arriving at destination.
- Fixed Display and Say commands treating the second met "&" sign as a voice-over token too (they must only check the first one in string).
- Fixed PlayMP3File() function limiting filename argument by an arbitrary number of characters.
- Fixed speechlines were adjusting their Y position while trying to not overlap GUIs even when these GUIs are completely offscreen.
- Fixed first Sierra-style speechline in a sequence was adjusting its Y position without need when GUIs are set to be hidden during game pause (this includes blocking speech). Normally, the speechlines are adjusting their Y position in order to not overlap GUIs, but when GUIs are hiding during speech there should not be any need to do so.
- Fixed script behavior in case a local variable was assigned a value without being initialized with a zero memory by compiler's intruction beforehand. This is not a problem with the standard compiler, but technically could be an issue with any custom implementation.
- Fixed old-style letterbox viewport getting broken after loading an old pre-3.5.0 save.

Engine Plugin API:
- Added IAGSStream interface, IAGSEngine.OpenFileStream() and GetFileStreamByHandle().
- Added IAGSEngine.ResolveFilePath() method, which resolves a script path (with location tokens) into a proper system filepath.
- Fixed IAGSEngine.GetFontType() incorrectly reporting TTF font type for WFN fonts with more than 128 characters.

Compatibility:
- In Editor, restored all the Character's variables available in "backward-compatible" mode. This is primarily to make it easier to import very old games.
- Allow to run an animation over a loop with zero frames, by using the placeholder frame. This lets particular old games to continue running instead of crashing with error.
- Fixed slower character walking speeds in pre-3.1 upscaled and high-resolution games.
- Fixed Object.SetView() and SetObjectFrame() not treating -1 for loop and frame as "keep previous values" in older games.
- Fixed inventory window not updated after game.top_inv_item is assigned a new value.
- Fixed a "New Room" command in old-style dialog scripts was preventing "First time Enter room" event to be called.

Windows:
- 32-bit Windows engine is now built as "large address aware" program, which will allow it to use up to 3 GB of RAM on 32-bit systems and 4 GB of RAM on 64-bit systems (was 2 GB previously).

iOS:
- Updated port for 3.6.*.

Web / Emscripten:
- Fixed Safari cannot switch the game into fullscreen mode.

WinSetup:
- Added options for setting texture cache and sound cache size.
- Added options to disable particular graphic drivers and graphic driver selection, and fullscreen mode selection.




Thanks to everyone who contributed to and tested this version!



#5
Overview

Following a recent request (see issue 2705),
I started working on an experimental feature which would allow to attach custom pixel shaders to game objects in AGS 4.0.

THIS POST WAS UPDATED TO COVER THE LATEST STATE

The two PRs with shaders support was merged into AGS 4 branch:
https://github.com/adventuregamestudio/ags/pull/2716
https://github.com/adventuregamestudio/ags/pull/2733
This feature is now a part of AGS 4 since Alpha 22 update. Please see the AGS 4 release thread for download links:
https://www.adventuregamestudio.co.uk/forums/ags-engine-editor-releases/ags-4-0-early-alpha-for-public-test/
Demo game project:
https://www.dropbox.com/scl/fi/q8lwoi6xwg4m7apezs6i8/ags4-shaders.zip?rlkey=12d4gxmfln1dh4h1zh0e2vpfs&st=9wdbt6e4&dl=0
Compiled game:
https://www.dropbox.com/scl/fi/yj98k9o43tiuufbo180cq/ags4-shaders-game.zip?rlkey=yspxgpfzduspun7o6a6s8kq4l&st=xuewfvb4&dl=0

Example preview:
Spoiler

[close]



Explanation and instructions

The idea overall is this:

1. User writes custom shader scripts

Shaders are written in either GLSL (OpenGL shader language) or HLSL (Microsoft's shader language for Direct3D). These scripts are distributed along with the game, either as external files, or packaged using "Package custom folders" option in General Settings.

OpenGL graphics driver uses GLSL scripts and compiles them into shaders at runtime.
Direct3D graphics driver uses HLSL scripts and compiles them into shaders at runtime.
Optionally Direct3D can also load up precompiled shader objects (FXO). These may be created using Microsoft's "fxc" utility ("Effect-Compiler") from the older DirectX SDK (deprecated and archived), or possibly a modern equivalent "dxc" ("directx compiler"). Frankly, I haven't tested the latter yet, so not fully sure if it supports old HSLS dialect for Direct3D 9, which is used by AGS.



2. In script there are two new structs declared: ShaderProgram and ShaderInstance.

ShaderProgram represents a compiled shader, while ShaderInstance represents a shader setup: which is a shader + a set of custom shader values.
For those who have an idea of how modern game engines work: you may think of ShaderInstance as a kind of a very limited "Material" type.
ShaderProgram is used to create ShaderInstances, and ShaderInstances are assigned to the game objects.

Following may have a shader assigned:
* Screen.Shader
* Viewport.Shader (e.g. Screen.Viewport.Shader)
* Camera.Shader (e.g. Game.Camera.Shader)
* Object.Shader, Character.Shader, GUI.Shader, GUIControl.Shader, Overlay.Shader
* Room.BackgroundShader
* Mouse.CursorShader


The new structs are declared like:
Code: ags
builtin managed struct ShaderProgram {
  /// Creates a new ShaderProgram by either loading a precompiled shader, or reading source code and compiling one.
  import static ShaderProgram* CreateFromFile(const string filename); // $AUTOCOMPLETESTATICONLY$
  /// Creates a new shader instance of this shader program.
  import ShaderInstance* CreateInstance();
  /// Gets the default shader instance of this shader program.
  import readonly attribute ShaderInstance* Default;
};

builtin managed struct ShaderInstance {
  /// Sets a shader's constant value as 1 float
  import void SetConstantF(const string name, float value);
  /// Sets a shader's constant value as 2 floats
  import void SetConstantF2(const string name, float x, float y);
  /// Sets a shader's constant value as 3 floats
  import void SetConstantF3(const string name, float x, float y, float z);
  /// Sets a shader's constant value as 4 floats
  import void SetConstantF4(const string name, float x, float y, float z, float w);
  /// Sets a secondary shader's input texture, using a sprite number. Only indexes 1-3 are supported.
  import void SetTexture(int index, int sprite);

  /// Gets this instance's parent Shader
  import readonly attribute ShaderProgram* Shader;
};

You create a ShaderProgram using CreateFromFile static method. The filename you pass may contain a glsl, hlsl or fxo extension, but the engine will choose an actual file depending on the current graphics driver. For example, you call CreateFromFile("shaders/myshader.glsl"). If you run with OpenGL engine will look for "myshader.glsl". If you run with Direct3D engine will look for "myshader.fxo" (precompiled directx shader), and if it's not present, then for "myshader.hlsl" (directx shader source). This goes vice versa too. Such approach lets user pass the filename in any format, and not make extra if/else conditions in script checking current gfx driver (although you may if you need to).

ShaderProgram object is created always, even if shader compilation is failed for any reason. This is essential, because graphic driver may not support this shader, or not support shaders at all (such as Software graphics driver). This lets you write scripts not worrying about things failing if player switches to another driver. Of course the real visual effect will only appear if the actual shader was initialized successfully; otherwise this shader program will just do nothing.

After ShaderProgram is created, you have two options:
* use ShaderProgram.Default property which returns a always present default ShaderInstance. This instance is there to simplify things for you.
* create more ShaderInstances using ShaderProgram.CreateInstance() method.

Simple example would be like:
Code: ags
ShaderProgram* myshader;

function game_start()
{
    myshader = ShaderProgram.CreateFromFile("$DATA$/shaders/myshader.glsl");
    Screen.Shader = myshader.Default;
}

Why create more instances? Shaders may have "constants" in them, which may be thought as shader settings. These "constants" are not really constants in general sense, they are called "constants" because they don't change while shader is used in drawing. But you may change their values between the draws.
There are alot of purposes to use constants. Just to give couple of examples:
* a shader that tints a sprite by adding certain color - may have a constant "color", which you configure in script.
* a shader that changes the sprite look depending on time - then it will have a constant "current time", which engine will update each frame (find more info below).

So, suppose you have one shader, but want to configure this shader differently for different objects. That's where you need separate ShaderInstances.
You create 5 shader instances, and assign these to 5 objects, then set different constant values for these separate instances.

Here's an example:
Code: ags
ShaderProgram* myshader;
ShaderInstance* myshaderInsts[5];

function game_start()
{
    myshader = ShaderProgram.CreateFromFile("$DATA$/shaders/myshader.glsl");
    for (int i = 0; i < 5; i++)
    {
        myshaderInsts[i] = myshader.CreateInstance();
        object[i].Shader = myshaderInsts[i];
    }
    
    myshaderInsts[0].SetConstantF3("Color", 1.0, 0.0, 0.0); // red
    myshaderInsts[1].SetConstantF3("Color", 0.0, 1.0, 0.0); // green
    myshaderInsts[2].SetConstantF3("Color", 0.0, 0.0, 1.0); // blue
    // and so on
}



How to write shaders

In very primitive way "pixel shader" is an algorithm that is run over each pixel of a sprite, receives a real pixel color as an input, and returns same or another pixel color as an output. So what it does, essentially, is changing sprite pixel colors in some way. This change is not permanent (the sprite remains) but the result of a shader is used to draw this sprite on screen.

Unfortunately, I do not have enough expertise nor spare time to explain shader scripts from ground up. But AGS uses standard shader languages, and there must be thousands of tutorials online.

There are however few things that I must mention.

When writing shaders you may have your custom constants in it, but are also allowed to use a number of "standard" constants provided by the engine. The engine sets their values automatically for each draw so you don't have to do that yourself (in fact, if you do then these values will get overridden by the engine).
In GLSL these must match the name and type, but their order is not important (they may be not present if not used too). That's because OpenGL finds these by name.
In HLSL these constants EITHER must match the type and the *register number*, OR you have to write an accompanying ini file called "<shadername>.d3ddef", which describes your shader. That's because Direct3D 9 needs a different utility library for finding constant automatically, but this library is outdated, so I decided to not use it to be safe. I will explain "d3ddef" file a little further.

Following is the list of primary standard constants:
* float iTime - current time in seconds; note that it's not exact values that should matter, but the fact they it changes over time
* int iGameFrame - current game frame index (NOTE: must be float in HLSL, because apparently it D3D9-compatible mode does not support integer constants? at least that's what I read somewhere);
* sampler2D iTexture - sprite's texture reference;
* vec2 iTextureDim - texture's dimensions in pixels (type `float2` in HLSL);
* float iAlpha - sprite's general alpha (object's transparency);
* vec2 iOutputDim - final dimensions in pixels (type `float2` in HLSL); this constant is only set for the "whole screen shader" and tells the real resolution that the image will have when appear in window. If this shader will be applied to other game object, then this constant will have value of zero.

These are standard constants used to attach more textures to the shader:
 * sampler2D iTexture0 to iTexture3 (NOTE: iTexture0 is an alias to iTexture, and either of these two may be used);
* vec2 iTextureDim0 to iTextureDim3 (NOTE: iTextureDim0 is an alias to iTextureDim).

Other predefined input parameters:
* vec2 vTexCoord - is predefined for GLSL only, gets current texture coordinate for the pixel. HLSL should use TEXCOORD0 input parameter (see shader examples below).

Example of declaring parameters in GLSL:
Code: ags
uniform float iTime;
uniform int iGameFrame;
uniform sampler2D iTexture;
uniform vec2 iTextureDim;
uniform float iAlpha;

varying vec2 vTexCoord;

Example of declaring parameters in HLSL (notice the order of registers! - that matters if you precompile the shader):
Code: ags
// Pixel shader input structure
struct PS_INPUT
{
    float2 Texture    : TEXCOORD0;
};

// Pixel shader output structure
struct PS_OUTPUT
{
    float4 Color  : COLOR0;
};

sampler2D iTexture; // is in sampler register 0

const float  iTime:        register( c0 );
const float  iGameFrame:    register( c1 );
const float2 iTextureDim:  register( c2 );
const float  iAlpha:        register( c3 );



Example of my "Colorwave" shader in GLSL (for OpenGL):

Spoiler
Code: ags
uniform sampler2D iTexture;

uniform float iTime;
uniform int iGameFrame;
uniform vec2 iTextureDim;
uniform float iAlpha;

varying vec2 vTexCoord;

#define PI                 3.1415
#define PI2                6.283
#define FPS                120.0
#define WAVE_DIR          -1.0
#define TINT_STRENGTH      0.2
#define X_OFFSET_STRENGTH  0.00
#define Y_OFFSET_STRENGTH  0.02

void main()
{
    vec2 uv = vTexCoord;
    // convert from textcoord [-1;1] to [0;1] range
    vec2 uv_1 = uv * 0.5 + 0.5;
    // timer goes [0 -> 1) and resets, in FPS frequency
    float timer = mod(iGameFrame, FPS) / FPS;
    // wave cycles by timer + add starting phase depending on texture pixel position
    float wave_x = sin((WAVE_DIR * PI2 * timer) + (PI2 * uv_1.x));
    float wave_y = sin((WAVE_DIR * PI2 * timer) + (PI2 * uv_1.y));
    float wave_z = sin((WAVE_DIR * PI2 * timer) + (PI  * uv_1.x));
    
    vec3 tint = vec3(TINT_STRENGTH * wave_x, TINT_STRENGTH * wave_y, TINT_STRENGTH * wave_z);
    vec4 color = texture2D(iTexture, uv + vec2(wave_x * X_OFFSET_STRENGTH, wave_y * Y_OFFSET_STRENGTH));
    
    gl_FragColor = vec4(color.xyz + tint, color.w);
}
[close]

and same shader in HLSL (for Direct3D):

Spoiler
Code: ags
// Pixel shader input structure
struct PS_INPUT
{
    float2 Texture    : TEXCOORD0;
};

// Pixel shader output structure
struct PS_OUTPUT
{
    float4 Color  : COLOR0;
};

// Global variables
sampler2D iTexture;

const float  iTime:        register( c0 );
const float  iGameFrame:   register( c1 );
const float2 iTextureDim:  register( c2 );
const float  iAlpha:       register( c3 );

#define PI                 3.1415
#define PI2                6.283
#define FPS                120.0
#define WAVE_DIR          -1.0
#define TINT_STRENGTH      0.2
#define X_OFFSET_STRENGTH  0.00
#define Y_OFFSET_STRENGTH  0.02

PS_OUTPUT main( in PS_INPUT In )
{
    float2 uv = In.Texture;
    // convert from textcoord [-1;1] to [0;1] range
    float2 uv_1 = uv * 0.5 + 0.5;
    
    // timer goes [0 -> 1) and resets, in FPS frequency
    float timer = fmod(iGameFrame, FPS) / FPS;
    // wave cycles by timer + add starting phase depending on texture pixel position
    float wave_x = sin((WAVE_DIR * PI2 * timer) + (PI2 * uv_1.x));
    float wave_y = sin((WAVE_DIR * PI2 * timer) + (PI2 * uv_1.y));
    float wave_z = sin((WAVE_DIR * PI2 * timer) + (PI  * uv_1.x));
    
    float3 tint = float3(TINT_STRENGTH * wave_x, TINT_STRENGTH * wave_y, TINT_STRENGTH * wave_z);
    float4 color = tex2D(iTexture, uv + float2(wave_x * X_OFFSET_STRENGTH, wave_y * Y_OFFSET_STRENGTH));
    
    PS_OUTPUT Out;
    Out.Color = float4(color.xyz + tint, color.w);
    return Out;
}
[close]

Back to the "d3ddef" file required for the Direct3D's HLSL shaders. This file is obligatory if you have custom constants, as Direct3D cannot know about these. Another reason to write one if you like to specify compiler target (HLSL version).
"d3ddef" file is a simply "ini" file, which may contain few options:

Code: ags
[compiler]
target = compilation target ("ps_2_0", and so on)
entry = entry function name (e.g. "main")

[constants]
<constant_name> = register index (a number >= 0)

If "compiler" options are not present, Direct3D will use defaults.
If "constants" are not present, Direct3D will use default hardcoded register values. Note that if you write "[constants]" section in it, then you MUST mention ALL constants, including standard ones.

This may be an example of "colorwave.d3ddef" for my demo shader (I don't really use it in the demo game, but could have):
Code: ags
[compiler]
target = ps_2_b

[constants]
iGameFrame = 1
iTextureDim = 2
iAlpha = 3
#6
AGS 3.6.0 - Patch 13
Full release number: 3.6.0.60


For Editor
Spoiler

For Android
Spoiler
NOTE: the Editor now includes Android build component letting you prepare your own games for Android
[close]

For Engine/Editor developers
Spoiler

Released: 5th April 2025

Previous stable version: AGS 3.5.1 P20 forum thread


This release is brought to you by:

- Alan v. Drake (improvements, fixes)
- Cameron Cawley [ccawley2011] (fixes, improvements to SpriteFont plugin)
- Crimson Wizard (stuff :))
- Dominik Mierzejewski (fix)
- Donovan Watteau (fix)
- eri0o (updated Android port, Web port, Editor improvements, etc)
- fernewelten (new fonts outlining, improvements to script compiler, fixes)
- Francesco Ariis (fixes)
- Morgan Willcock (improving templates, help with CI)
- Pablo Navarro [panreyes] (fixes)
- ChamberOfFear (improvements)
- rofl0r (fixes, suggestions)
- sonneveld (porting engine to SDL2)
- Thierry Crozat (fixes, plugin update)
- vga256 (fixes)
- Walter Agazzi (fixes)


Summary

AGS 3.6.0 is another big change to AGS.
First of all, this release presents a SDL2-based engine. For about 2 decades AGS engine was based on Allegro 4 graphic library, which was discontinued somewhere in the early 2010-ies (only received few patches since). There was an intent to move to to Allegro 5 or SDL since, but for various reasons this task was continuously postponed. Now it's done.
Secondly the Editor and Engine now have full Unicode support. This means that you may use any language whatsoever in scripts, object descriptions and custom properties, as well as translations; so long as you also provide proper unicode fonts.
Third, we have finally expanded a list of platforms that the Editor can build for: now this includes Android and Web (Emscripten) port.

There are much more changes and improvements in this release, check out the full list of changes below.
Also, please be sure to read "Upgrading to AGS 3.6" topic in the manual: https://adventuregamestudio.github.io/ags-manual/UpgradeTo36.html



Changes in the Patch 13:

Editor:
 - Fixed translation compiler mistreating escaped opening bracket in a text line (`"\["`); it must keep it as-is, because "[" char is a old-style line break in AGS.

Engine:
 - Fixed loading translation entries larger than 1024 bytes.

WinSetup:
 - Fixed "Save and Run" command sometimes caused 2 engine processes, one of which terminated later.
   This did not prevent a game from running, but could result in temporary CPU and memory overload.


Changes in the Patch 12:

Engine:
- Fixed deleted DynamicSprite which is still assigned to a mouse cursor may cause engine's sprite cache to enter a corrupt state, eventually leading to a crash.


Changes in the Patch 11:

Editor:
- Fixed exception in Room Messages editor occuring if a certain game's Character is missing.

Engine:
- Fixed disabled GUIs not hiding their controls if "Hide all their controls" disabled style is set in General Settings, and game is run with Direct3D or OpenGL renderers.
- Fixed "greyed out" GUI controls leaving traces on parent GUIs when running with Software renderer.
- Fixed text parser in Dialog Options not working correctly if "new key handling" mode is on.
- Fixed DynamicSprite.SaveToFile() return value was inverse (regression in 3.6.0).
- Fixed engine crash in GetHotspotProperty() if the function is called with invalid ID.
- Fixed room Camera may fail to restore its position in the room after loading a save.
- Fixed fonts may not be assigned correct parameters when a new game is launched by calling RunAGSGame() in script (regression since 3.6.0 or 3.5.*).

Compatibility:
- Fixed engine refusing to load saves made by 3.2.0 engine, although being capable to do so.


Changes in the Patch 10:

Editor:
- Fixed a warning condition for copying 32-bit bitmaps to a desktop clipboard of less color depth.
- Fixed keyboard shortcuts for GUI Editor's Copy and Paste commands.
- Fixed a rare exception when scrolling the room in the editor.
- Fixed "Auto-number speech lines" and "Create voice acting script" operations failing if a Character's name contains underscore.

Compiler:
- Fixed escaped character literals not being parsed correctly. This makes character literals like '\n' and '\t' actually work in script.

Engine:
- Updated SDL_Sound library to 2.0.3.
- Improved OpenGL texture management, which should result in less system and video memory spent on sprite textures.
- Fixed Character.AddWaypoint() potentially using wrong walkspeed, if multiple characters or objects are ordered to start a non-blocking move in a mixed order.
- Fixed Character.AddWaypoint() is using incorrect speed if this room has a non 1:1 mask resolution, and "Scale speed with mask resolution" setting is enabled.
- Fixed Overlay.Create() crashing the engine if a non-existing sprite is passed as an argument.
- Fixed Say("...") command get stuck in endless loop if Speech.DisplayPostTimeMs is non-zero.
- Fixed PlayFlic() not working if called second time in game. This is likely a regression since 3.6.0.
- Fixed NumPad keys not handled properly by the engine (in on_key_press, IsKeyPressed, and TextBox control). This is a regression since 3.6.0.
- Fixed OpenGL renderer causing scaled sprites to have colored outlines sometimes while using Linear filter.


Changes in the Patch 9:

Engine:
- Fixed engine incorrectly reporting a script loading error, which may occur if the total size of script's global variables is bigger than the size of the compiled bytecode.


Changes in the Patch 8:

Editor:
- Fixed command "Crop sprite edges" in the Sprite Manager would copy import settings from the completely unrelated sprite onto the cropped one.

Engine:
- Fixed `@GAMENAME@` label not updating if Game.Name property is changed at runtime.
- Fixed System.ColorDepth was reporting a final display resolution, while it should report game's native resolution for historical reasons.

Compatibility:
- Fixed "upscale" mode not working for "default" game resolution in pre-3.1 games (the hidden meaning of "default" is 320x200 also).

Windows:
- Fixed a rare bug when the Windows engine could fail loading the game for no good reason.
  This error is related to a bug in Windows SDK 8.1.


Changes in the Patch 7:

Editor:
- For Android build target disabled compression of `.ags` and `.vox` assets, as that slows down engine streaming resources (sprites etc).
- Fixed Editor failing to start if user preferences file is corrupted
  (this is a second fix, complementing one done in AGS 3.5.1).
- Fixed RAM use spiking fast during batch sprite reimport from sources, which could randomly lead to program errors.
- Fixed Dialog properties displaying internal values not meant to be seen by a user.
- Fixed selecting parent GUI after its control did not display GUI's own properties in the Properties Grid.
- Fixed Editor generating deprecated settings in the default config file.

Engine:
- Fixed GUI controls unexpectedly clipping parts of text even if "controls clip contents" setting is disabled, in case when their Font has VerticalOffset property set.


Changes in the Patch 6:

Editor:
- Fixed GUI editor could display selection rectangle from a different GUI editor pane, if two or more are displayed on screen at the same time.
- Fixed Script editor not marking "autoptr" and "builtin" as keywords.
- Fixed Script editor not applying color theme to character literals.
 
Engine:
- Made String.Chars and Length properties work faster in ASCII mode.
- Issue a warning when blocking Display or Say commands are called during fade-out.
- Fixed engine failing to startup sometimes if controller device subsystem failed to init (it should not init at all in this version, as we do not support joysticks yet).
- Fixed "Before fade-in" event could be called recursively under some peculiar conditions (regression since 3.6.0).
- Fixed buttons on a non-clickable GUI were still changing to "mouse over" graphic under cursor.
- Fixed button click not registered if it has been made not visible and visible again during a single game frame (regression since 3.6.0).
- Fixed TextWindow borders drawn behind the rightmost corner pieces, which may be seen if the edge sprites are half-transparent.
- Fixed a brief black screen flash occuring right after the video playback ends (regression since 3.6.0).
- Fixed engine refusing to load legacy saves if the audio clip count does not match (number of audio clips should not affect saves).
 
WinSetup:
- Added an option to disable "smooth scaled sprites" setting.
- Added an option to disable language selection.
- Made filter names in "disabled" section treated in case insensitive way.


Changes in the Patch 5:

Editor:
- Reimplemented multiple sprites properties editing in the Sprite Manager. This ability was dropped in 3.5.0 unintentionally.
- Fixed Autocomplete not treating certain struct members as "static" or "protected" if their declaration is too long.

Engine:
- Fixed Character.WalkStraight() was resetting walking animation if called during walking.
- Fixed Character's idle animation getting reset to frame 0 when the speech is played without a valid speech view (idle animation should continue playing in such case).
- Fixed idle animation sometimes not starting immediately after Character finishes walking.
- Fixed a crash occuring if script tries to get or set a custom property for a non-existing Room Object (this seem possible to do by iterating over `object[]` array).

Compatibility:
- Implemented "legacysave_assume_dataver" override option in config, which lets to instruct the engine which game data version to assume when restoring legacy (pre-3.5.0) saves. This "hack" appeared to be necessary because of a mistake done during development of the older engine versions, where the save format was changed, but engine was made to rely on the game data version instead of incrementing save format index.
- Implemented "legacysave_let_gui_diff" override option in config, which lets the engine to read less gui elements from restored save than the number registered by the game. This is to emulate a (possibly unintended) effect in pre-3.5.0 saves.
- Fixed engine could try to load game data from game.exe without checking whether data is actually appended to it when restoring a legacy save in a game with a different file structure.
- Fixed number of GUI elements were not tested when loading a legacy save, which could lead to GUI data getting overwritten incorrectly without a warning if number of controls changed since. If the test failed, engine will act according to "legacysave_let_gui_diff" config option: either quit with error or log a warning and continue.

Plugins:
- Fixed potential "index out of bounds" exceptions in the built-in PalRender plugin.

Templates:
- In "Verb Coin" template fixed action label could be updated incorrectly if the cursor was moved over buttons on any other GUI.


Changes in the Patch 4:

Editor:
- Export Game's Title into translations.
- Fixed Game.agf was not created after importing a 2.* game project (regression in 3.6.0).

Engine:
- Character.AnimationVolume property is now applied to the portrait animation as well.
- Removed few of the less important game messages from logging, because they may quickly clutter the log under some circumstances.
- Fixed when animating a character portrait, the first frame's linked sound is not played.
- Fixed IsSpeechVoxAvailable() returning positive result if run from IDE and Speech folder is empty.
- Fixed speech and messages were skipped by modifiers and other special keys (Ctrl, Alt, etc).
- Fixed crash occuring when you resize DynamicSprite while it is displayed on screen.
- Fixed audio clip started right before a ChangeRoom would not play until after the room changes.
- Fixed in Software display mode the room Overlays may not be properly covered by a walk-behind under very specific conditions.
- Fixed System.Log() would cause engine crash if there are more format placeholders than args.
- Fixed some game options that are not allowed to be changed at runtime could still be overwritten when restoring an old save, leading to a weird game behavior.


Changes in the Patch 3:

Editor:
- Don't error when loading a room file which has unsupported number of events, instead these will be cut out. This may let e.g. use room templates from newer versions of AGS.
- Sprite's default property is changed from deprecated Resolution setting to SourceFile.
- Fixed full spritefile recreation would write duplicate sprites into the spritefile, if game project (Game.agf file) contained multiple sprites with same ID for any reason (for example, if they were added by manually editing Game.agf).
- Fixed importing SCI fonts with >128 chars.
- Fixed font preview did not properly display characters with indexes 128-255.

Engine:
- Fixed "noloopcheck" script function modifier was not handled correctly sometimes.
- Fixed a button with inventory placeholder did not update immediately when the active inventory is set.
- Fixed textual GUIs were not redrawn immediately after a call to SetGameOption(OPT_RIGHTTOLEFT).


Changes in the Patch 2:

Common:
- Fixed a TTF font could cause a crash in the Editor or the Engine if the font renderer tries to draw a letter with higher number than the highest glyph number in the font.

Editor:
- Added "Restore all sprites..." command to the Sprite Manager's context menu (this duplicates the "File -> Recreate sprite file" menu command added previously).
- Refresh Sprite Manager after fully recreating a sprite file.
- Sprites will now hide their "Resolution" property if the game settings have "Allow relative asset resolutions" disabled. This is to avoid user's misuse of this property.
- Fixed a minor memory leak occuring when editing a tree item's label in Project Explorer.

Engine:
- Engine will now find and load plugins in the game dir when run from a different location.
- Fixed crash occuring if Character was told to FaceLocation while "Turn to face" game setting is enabled, and character's View does not have enough loops.
- Fixed Character resetting current non-blocking animation if it was ordered to Move, as soon as it arrives at destination.
- Fixed crash occuring if a GUI button was somehow set a negative NormalImage number.
- Fixed "bad script stack" error could be sometimes displayed if the game was aborted in the middle of running a script.


Changes in the Patch 1:

Editor:
- Fixed room's deprecated setting LegacyMusicVolumeAdjustment not applied correctly.

Engine:
- Fixed Room Objects whose dynamic sprite was deleted in "leave room" event becoming invisible during fade-out transition. Logically this has to happen, but historically they kept displaying until the transition end, so we restored this behavior for compatibility, and simply because there's no "after fade-out" event in the engine yet to delete these sprites.
- Fixed Game.StopAudio() fails to remove queued clips if no particular audio type id is requested.
- Fixed performance regression in the script related to long loops (regression in 3.6.0).
- Fixed memory leak occuring when printing text in Right-to-left mode (regression in 3.6.0).
- Fixed rare mistake during text wrapping which may occur if a Unicode text is cut in the middle of the word.
- Fixed playing certain WAVs caused game to freeze forever on exit.

Compatibility:
- Fixed frame-linked sounds not playing in the games made before 3.6.0.
- Allow game to call DynamicSprite.Create() with negative size, clamping it to 1x1.

Templates:
- In Sierra-style template fixed "mouse over" graphic for the "Load" icon.



What is new in 3.6.0

Common features:
- Full Unicode support for all game texts: game properties, scripts, translations, input.
  ASCII/ANSI mode is still working, for backwards compatibility. This may be configured in the game project.
- Extended sprite compression options: lossless storage optimization for 16- and 32-bit sprites; LZW compression option for sprites in addition to existing RLE compression.
- GUI controls may now be told to clip their contents, which means that nothing gets drawn outside of their borders (as defined by X, Y, Width, Height properties). The only exception is Sliders, which are more complicated.
- The historical TTF fonts' "fixup" that altered their height and vertical offset is now optional and works only if backwards compatible option is set.
- Max number of AudioChannels is now 16 (was 8).
- Removed game Cursors hard limit (was 20).
- Increased Room Objects limit to 256 (was 40).
- Discontinued "Windows Game Explorer" support in both Editor and Engine.

Editor:
- Editor requires .NET Framework 4.6 to run.
- Added Android build target support (requires "Android component" installed).
- Added Web/Emscripten build target support (requires "Web build component" installed).
- Expanded UI color theme format, support global color options and allow missing entries.
- Script editor works in unicode mode.
- Added "Text format" option in General Settings which lets switching between ASCII/ANSI and Unicode (UTF-8) modes. This defines which format the game texts will be written in, when saving the game project and compiling the game.
- Added "Use old-style keyboard handling" option to the General Settings, which lets select between classic key press handling and new one meant for unicode chars support in scripts.
- Supports compiling UTF-8 translations. TRS file now has "Encoding" setting that tells how to interpret this TRS text.
- Added support for building multiple speech voxes, by taking files from the Speech subfolders.
- Added support for adding custom files into the game package. This is done by assigning a list of directories to "Package custom data folder" option in General Settings.
- Editor now copies a acsetup.cfg file from the project's root folder (if one is provided by) as a base for generating default config file. Settings from Default Setup will be written over, but other found options won't be removed.
- Added "Sprite file compression" option in General Settings, replacing "Compress the sprite file" option. The new option allows a selection of compression algorithm used for sprites.
  Currently supported: None, RLE (old default compression) and LZW.
- Added "Enable sprite storage optimization" option to the General Settings, that permits the editor to repack sprites in a different storage format, reducing their disk size whenever possible. This option may be used alongside with the sprite compression. Note that this does not change how the sprites work in game.
- Added "GUI controls clip their contents" option to the General Settings.
- Added "TTF fonts height used in the game logic" option to the General Settings, that makes your game use real font's pixel height when arranging text and text-based UI elements, as opposed to the nominal font's size.
- Added "Touch to Mouse Emulation", "Touch to Mouse motion mode" and "Display FPS on Screen" to Default Setup. Removed few deprecated options.
- Added "TTF font adjustment" property to Fonts, as well as to General Settings where it serves as a project default for the new fonts. This property lets you choose between "no changes" and backward compatible TTF fixup meant to keep fonts made for AGS displayed as they were meant to.
- In the "Import TTF" dialog added a choice to import the size closest to the given pixel height.
- Fonts now have Auto Outline Style and Auto Outline Thickness properties.
- Fonts now have a readonly Family Name field, that lets user see the original name of a font they've imported (if available).
- Added IdleDelay property to Characters that lets you set time needed to pass before IdleView is activated. This is equivalent to the Character.SetIdleView script function.
- Added Character.IdleAnimationDelay property to let setup idle view's animation speed.
- Added Cursor.AnimationDelay property to let setup cursor's animation speed.
- The TextWindow edges now have distinct names in the dropdown list of the property grid.
- Rooms created from a Blank template will now have default background of a game's resolution.
- When creating new room objects they will now have their script names set to some default value.
- Added Room.BackgroundAnimationEnabled property to let have disabled animation on room load.
- Editor will now create an empty sprite file if one is missing in the game project. Any existing sprite descriptions in the project will be kept, letting user to reimport these from sources.
- Added "File -> Restore all sprites from sources" menu command.
- Added "Apply" button on editor's Preferences dialog.
- In Preferences replaced "Import Color Theme" with a "Open Theme Folder", as a temporary solution for managing theme files.
- Select script editor's font in the editor's Preferences.
- Added "Help" option to the editor pane's tab context menu.
- Upgraded script editor to Scintilla 3.21.1 and ScintillaNET 3.6.3.
- Cursor's position in script is now displayed on the status bar.
- Dialog scripts now too can open help topics for keywords or script functions under cursor on F1.
- Added zoom controls for the Sprite Manager, Character, Cursor, Inventory and View panes.
- Sprites may now be imported by drag'n'drop into the Sprite manager.
- In sprite manager's context menu added command "Create source files for all sprites with missing / external sources..."
- In sprite manager's context menu added (restored) command "Replace sprite using previous files".
  Also made "previous file" remembered consistently whenever a sprite is imported or replaced.
- In sprite manager's "export all" dialog added "skip if inside project's folder" option.
- In sprite manager's "export all" dialog added "reset tile settings" option.
- On the View pane the frames having set delay and linked sound will be now indicated with icons.
- Editor no longer errors and fails when opening a game project with some script files missing.
- Editor no longer errors on empty translations when compiling the game.
- Editor now exports values of the string type Custom Properties to translations.
- Editor no longer prevents exporting string arguments from Get/SetTextProperty calls to TRS file.
- Editor now cleanups spritefile on game load, identifying any data not referenced by the project and marking it for deletion.
- Fixed editor silently enabling all available Build Targets when upgrading a pre-3.4.0 project. This could be very inconvenient as there are several of them supported now.
- Fixed open folders in the Project Tree were collapsing whenever you create a new subfolder or change an object's name in properties.
- Fixed editor was not preventing from entering Character's and AudioClip's ScriptName too long for the engine to handle.
- Fixed Image and View properties in various objects were allowing negative values.
- Fixed some of the object previews (at least GUI) could crash if user entered a non-existing sprite's number as an Image property.
- Fixed editor displaying unhandled exception if the script which user is trying to open was missing. Instead it will now open a blank script.
- Fixed room editor was suggesting to save the modified room even if no changes were made.
- Fixed a recently imported sprite could be displayed incorrectly scaled up in the room editor for high-resolution games, if the "Allow relative asset resolutions" was enabled in General Settings, and the sprite 0 had "Resolution" property set to "Low".
- Fixed program crash occuring on sprite's import if failed to open a source file for any reason.
- Fixed View animation preview stopping at frame 100 (if loop contains over 100 frames).
- Fixed going to a "find all" result in dialog script did not highlight the found text, and sometimes did not scroll down to it.
- Fixed "Goto Definition" not working for Enums and Defines (macros).
- Fixed script autocomplete sometimes was not updated right after opening a script.
- Fixed script autocomplete for function calls was mistreating commas in strings and inline comments as if they were separating actual parameters.
- Fixed script autocomplete was not displaying members of extended structs if the parent struct was declared in another header.
- Fixed script autocomplete was not working for enum names.
- Fixed structs and enums were not highlighted if declared inside a script's body.
- Fixed in dialogs numbers inside names were incorrectly highlighted as numeric values.
- Fixed matching or mismatching braces were not highlighted consistently at all times in regular and dialog scripts.
- Fixed crash occuring when user was trying to set breakpoint on the very last line in script.
- Fixed few editor panes were not opening correct help topics in F1.
- (Possibly) fixed error message text in the runtime error popup could be drawn partially beyond the popup borders if the user's system has text scaling option enabled.

Compiler:
- Support unicode character literals.
- Support using float literals when defining default values for function arguments.
- Support hexadecimal number literals (e.g. "0xABCDEF").
- Removed 500-characters line limit.

Script API:
- Expanded `on_key_press` callback, now supports two parameters: key code and key modifier flags.
- In the new key handling mode `on_key_press` is called for each actual key press;
  e.g. combinations like Ctrl+Z will result in two `on_key_press` calls, one with eKeyCtrlLeft and second with eKeyZ; added support for "NEW_KEYINPUT_API" macro in scripts.
- Implemented new `on_text_input(int ch)` callback which is called when the engine receives a printable character. This callback is essential for handling unicode chars in script.
- Similarily, expanded `dialog_options_key_press` with the third `mod` argument, and implemented `dialog_options_text_input` callback for receiving unicode chars during the custom dialog options state.
- Implemented `dialog_options_close` callback which is called when custom dialog options are removed from the screen. This allows to perform any required cleanup.
- Added eEventEnterRoomAfterFadein event for `on_event` callback, which corresponds to "enter after fade-in" room event.
- Added eKey constants for Shift, Control and Alt keys.
- Added eKeyMod enum for key modifiers constants.
- String.AppendChar(), ReplaceChar() functions and String.Chars[] property are now working with the unicode characters.
- String.Format("%c") specifier will now be able to print unicode characters.
- Extended Button.Animate() to have blocking style, direction and starting frame parameters, thus matching other Animate commands (of Character and Object).
- Extended all Animate() commands by adding "volume" parameter, that defines volume of the frame-linked sounds for the duration of this animation.
- Added Character.AnimationVolume, defining volume of the frame-linked sounds.
- Added Character.IdleAnimationDelay to let control idle view's animation speed.
- Character.Scaling is no longer limited by a range of 5-200 (now supports 1-32767).
- Hotspot.Name and Object.Name may now be set in script.
- Added Object.ManualScaling and Object.Scaling.
- Deprecated Object.IgnoreScaling (use Object.ManualScaling instead).
- Object.SetView default loop & frame values are now 0 (was -1 which retained loop and frame indexes from the previous view, often unexpected to the user).
- DrawingSurface.DrawImage() and DrawSurface() now support optional source rect coordinates.
- Added functions for getting DrawingSurface of room masks: GetDrawingSurfaceForWalkableArea(), GetDrawingSurfaceForWalkbehind(), Hotspot.GetDrawingSurface(), Region.GetDrawingSurface().
- Added new delay parameter to Mouse.ChangeModeView() to let control cursor's animation speed.
- Added Game.ChangeSpeechVox() and Game.SpeechVoxFilename, support switching the voice-over pack.
- Added Mouse.AutoLock property that toggles automatic mouse lock inside the game window.
- Added Room.Exists().
- Added System.Log().
- Added SkipWait() that skips any active Wait() function.
- Added WaitMouse() to complement existing Wait functions.
- Added InputType enum which defines input devices and lets create their sets as flags.
- Added WaitInput(), a more generic and extendable function that accepts a combination of flags telling which input types to wait for.
- All Wait* functions now may have infinite timeout if you pass a negative timeout parameter.
- All Wait* functions now return the reason they were skipped: a combination of InputType flag and a respective key or button code.
- Added GUIControl.Transparency property.
- Added Overlay.CreateRoomGraphical and CreateRoomTextual. Use these two functions to create "room overlays": that is - overlays that display a sprite inside the room, sorted among other room objects, characters and walk-behinds.
- Added readonly Overlay.InRoom property that tells if this is a room or screen overlay.
- Extended Overlay.CreateGraphical() with a new "clone" parameter that tells whether to assign a sprite index, or make a sprite's copy owned exclusively by this overlay. The former will save program memory but make overlay update if the sprite is edited later. The latter is meant primarily for backwards compatibility.
  Overlay.CreateRoomGraphical has the same param.
- Added Overlay.Graphic property that lets you change overlay's sprite after it's created.
- Added Overlay.Width and Height properties, that let you freely scale existing Overlay.
- Added readonly Overlay.GraphicWidth and GraphicHeight properties that let read original overlay's graphic size, as not all overlays hold a sprite reference (e.g. textual overlays).
- Added Overlay.Transparency property.
- Added Overlay.ZOrder property that lets you sort Overlays among themselves and other objects in the same "game layer": screen overlays are sorted among GUI, while room overlays are sorted among room objects, characters and walk-behinds.
- Added Speech.TextOverlay and Speech.PortraitOverlay for accessing blocking speech overlay and portrait overlay respectively.
- Added Game.BlockingWaitSkipped which tells the result of the last blocking wait skipping, also including result of the blocking speech skipping.
- SkipSpeechStyle now supports eSkipNone mode; when used it will disable any kind of skipping, such speech can be only skipped by a direct command from script.
- Extended Screen.ScreenToRoomPoint() with an optional "restrictToViewport" argument, which lets to choose whether tests over empty place result in conversion through the default viewport or a null pointer.
- Added AudioClip.PlayOnChannel().
- Added AudioChannel.Pause() and Resume() functions, and IsPaused property.
- Added AudioChannel.SeekMs(), complementing PositionMs (as the Seek() function interprets position differently depending on the audio format).
- PlayVideo() now supports an option to play both game's and video's audio track simultaneously.
- Added File.WriteRawInt() to complement ReadRawInt().
- File paths in script now support $DATA$ token, which tells to read files from the game package. This only works for read operations. Functions that support this token currently are:
  File.Open(), DynamicSprite.CreateFromFile(), ListBox.FillDirList().
- Debug(2, 0) command that displayed walkable areas is superceded by Debug(2, n), where "n" is a mask type: 0 - none, 1 - hotspots, 2 - walkbehinds, 3 - walkable areas, 4 - regions. This command also works as a toggle switch, calling it with the same mask index will turn it off.
- Debug(5, n) command that displayed character's walk paths now also works as a toggle switch.

Engine:
- New SDL2-based backend for graphics, audio and input.
- Hqx graphic filters discontinued (could be temporary).
- Windows-only DirectMedia video playback discontinued (could be temporary).
  Only OGG/OGV videos are kept supported at this point.
- Support resizing game window on desktop systems.
- Support "borderless full-screen window" mode in addition to the real (exclusive) fullscreen.
- Support for switching vertical sync at runtime with Direct3D/OpenGL renderers. Also enable vsync in windowed mode too.
- Unicode (UTF-8) text support: engine can now switch between ASCII and UTF-8 text mode. This is controlled by both game's OPT_GAMETEXTENCODING setting and translation's "Encoding" setting: they tells whether to interpret game texts as UTF-8 or ASCII/ANSI.
- Support optional translation's "GameEncoding" setting: it hints the original game's codepage to help with their conversion. This is mostly meant for translating existing older (ANSI) games.
- Engine now supports using real pixel height of the TTF fonts when arranging text and UI elements on screen; using nominal import size of the font is used as a compatible mode for the old games.
- Also supports separate "normal" and backward compatible "fixup" modes when initializing TTF fonts, letting to display both common TTFs and ones made specifically for AGS in the past to display as they were meant to be.
- Supports scripts using functions and variables from any other scripts, regardless of the script module order in the project.
- Removed limit of simultaneous Button animations.
- Removed limit of Character followers.
- Removed Overlay limit.
- Character.SetWalkSpeed() is no longer restricted by an arbitrary limit of 50.
- Process character's idle view based on real game speed, not hardcoded 40 fps.
- Improved file writing times (e.g. when doing a game save) by using buffered file stream. Initial tests showed 50% faster file writing.
- Engine now renders GUI controls as separate textures when using hardware accelerated renderers. This may significantly improve performance in the high-resolution games and games with large number of GUI elements on screen.
- Engine now shares the video texture data for all game objects on screen sharing same sprite. This improves performance in case there are multiple objects which use same image.
- Various performance optimizations for both raw drawing and texture updates (Direct3D/OpenGL).
- Engine now ensures that in threaded audio mode the AudioChannel's state only changes once the game is updated, and not while the game script is running. This prevents situations when the clip could begin playing before all properties are set in script, or when AudioChannel's properties' values (such as Position) could change while running a game script.
- 24-bit wav PCM support, comes with the new sound library.
- File.ReadRawLineBack() now always reads full line, and not limited to 200 characters anymore.
- Debug displays, such as showing room mask and character walk paths, are now implemented as non-blocking translucent overlays, allowing you to keep playing the game while they are on.
- Implemented debug key controls for calling a built-in save and restore game dialogs. These controls have to be set in user config as "save_game_key" and "restore_game_key" in "[override]" category. These may be used by testers if the game is missing a save function or one is bugged.
- Engine now supports loading compiled scripts as separate files packed along with the game, along with those embedded into the main game data or inside room files.
- Engine no longer bails out with error if the chosen translation cannot be loaded on startup.
- When reporting script errors, engine will print callstack for all the active script "threads": for example, if there's Wait() function called and error happened in repeatedly_execute_always, then it will print both actual error's location, and Wait() call's location.
- Engine config now has graphic modes defined as a simplier string options: "[graphics] fullscreen" for the fullscreen mode setup, and "[graphics] window" for the windowed.
  Fullscreen option can explicitly define a "borderless full-screen window" mode.
- Added "emul_mouse_mode" and "emul_mouse_relative" options to config in "[touch]" category.
- Added "cache_size" and "stream_threshold" options to config in "[sound]" category, they setup the rules for sound caching and choosing whether to load a clip fully into mem or stream one.
- Added "load_latest_save" and "show_fps" options to config in "[misc]" category.
- Added "background" option to config in "[misc]" category, that defines the starting run-in-background (aka multitasking) mode (may later be changed by SetMultitaskingMode()).
  Added "--background" command line option for the same purpose.
- Added "--sdl-log" command line option for setting up SDL2 library output verbosity. The engine log config now has a new "sdl" group meant for SDL2 messages.
- Support "--user-conf-dir" command-line arg (and "user_conf_dir" config option) superceding "--localuserconf"; the new option directly tells the location of user config file.
- Path related command-line and config options, - such as "shared_data_dir", "user_data_dir" and "user_conf_dir", now support $GAMENAME$ token in path which is resolved to the game's title.
- Added "--clear-cache-on-room-change" command-line arg (and similar config option).
- Don't error when DrawingSurface.DrawImage has bad transparency parameter (warning instead).
- Don't error when detecting bad format in File.Read* functions (warning instead).
- Added stubs for agsshell plugin (a contemporary cross-platform variant of ags_shell).
- Added stubs for agsappopenurl plugin.
- Fixed potential crashes if a room-related API function has been called in "game_start"; this is achieved by having a dummy room placeholder object. Still results of such calls are undefined and should not be relied upon.
- Fixed potential crash on room load if the walkable area mask contained color values above the supported range.
- Fixed dialog script's "goto-previous" command not working if used from the first sub-topic run using "goto-dialog" (a very-very old bug).
- Fixed AGS_EngineInitGfx plugin callback was not called during OpenGL renderer initialization.
- Fixed Direct3D/OpenGL renderers were displaying plugin's raw drawings in a wrong position in the scrolling rooms, if the drawing was done on AGSE_PRESCREENDRAW or AGSE_POSTROOMDRAW events.
- Fixed overlay may fail to be created sometimes, if previously another overlay had been forcefully removed when changing rooms (this is an ancient bug which existed for many years).
- Fixed ListBox.RowCount reporting 0 if called before the control was displayed once.
- Fixed GetTextWidth would still return a size of an outline for an empty text string.
- Fixed text may be misaligned in gui controls, as its outline thickness is not counted.
- Fixed some TTF fonts could be cut at the bottom when the speech is displayed.
- Fixed scheduled sound fadeout effect was not cancelled by skipping a cutscene.
- Fixed OGV Theora videos positioned incorrectly if they have certain sizes or aspect ratios.
- Fixed game fps sped up if SetGameSpeed() is called repeatedly in game script.
- Fixed game not reacting to system close commands when stuck in script, which made it impossible
  to close the "hanging" game by usual means (other than terminating the process).

Engine Plugin API:
- Added IAGSEngine::GetGameInfo() function which returns information about the game, such as its title and GUID.
- Added new render callback AGSE_POSTROOMDRAW, for handling drawing inside the room above all room objects.
- Added IAGSFontRenderer2 interface, expanding the original font renderer interface, improving font plugins support.
- Added ReplaceFontRenderer2() and NotifyFontUpdated() functions.

Compatibility:
- Fallback to the first loop with frames if current character's loop does not have any.
- Use the dummy frame if current character's speech view loop does not have any.
- Ignore character having view/loop with no frames while it's not in the current room.
- Legacy behavior of MoveCharacterBlocking's return value.
- Fixed walkable area's continuous scaling was broken for high-res rooms in old games.
- In pre-3.* games force player to walkable area after changing rooms, this is to emulate an unintentional effect created by the old engines.
- Fixed pre-3.4.1 anti-aliased TTF fonts display (their vertical position was broken).
- For pre-3.5.0 games support old behavior of coincidental dynamic sprite replacement on GUI backgrounds (and few other places) without explicit assignment; that is - when the new DynamicSprite is created right after deleting an old one.
- Support Label.TextAlignment with legacy alignment constants for pre-3.5.0 games made with the custom engine from "Clifftop Games".
- Support native resolution hack for games made with "Clifftop Games" custom engine, where 640x400 games are run as 640x360.

Android:
- Rewrote universal AGS game launcher/player using up-to-date Google guidelines. The former "launcher" is now called "AGS Player".
- Implemented single game project template meant for building your own signed APK.
- Implemented two touch-to-mouse control scheme (selectable in config), for one finger emulating LMB only, and for two fingers emulating LMB and RMB.
- Support relative motion speed setting for touch-to-mouse emulation.
- In AGS Player added "Browse" button to the game folder selection, which opens default system file picker.
- AGS Player now searches for games recursively, in all the subfolders.
- AGS Player now has preference button per each game, which opens individual game's settings.

OSX:
- OpenGL renderer is now supported on MacOS.

Web / Emscripten:
- Initial port release.

Windows:
- Installer will create program links with three-digit version in the name.

Plugins:
- Added SpriteFont plugin to the list of builtins, for ports that use ones.
  SpriteFont plugin is updated to support custom "Clifftop Games" font variants.

WinSetup:
- Added "Fullscreen as borderless window" checkbox.
- Remade sound options to reflect the move to the new audio system in the engine.




Known issues

* Although Unicode text is supported overall, some languages may still not be printed correctly automatically. Firstly, those that require "letter linking", such as Arabic or Persian, do not have the proper linking on its own. This may be worked around using special text converters and fonts. Another issue is that texts printed right-to-left in the source (where print direction is done using Unicode's control characters) are not wrapped correctly and may require manual placement of line breaks, or scripting their split in game.
* MIDI no longer plays on its own on Windows. For MIDI you (and your players) must install "sound banks" (also known as "sound font"). Please refer to this article: https://adventuregamestudio.github.io/ags-manual/MIDI-playback.html
* AudioChannel.Position and AudioChannel.Seek do not work for MIDI and MOD sounds. Try sticking to PositionMs and SeekMs for now.
* There are reports about Direct3D not being able to restore the fullscreen mode after alt+tabbing occasionaly.





Thanks to everyone who contributed to and tested this version!



#7
I post this here and not in e.g. "Editor development", because this is not exactly related to the program development.

For a long time I've been thinking that there has to be a separate section in the manual, which describes what AGS can do and how the game acts in principle. Existing topics are covering mostly the editor windows, and tutorials are step-by-step instructions on how to make something first. But I wished there was a kind of a summary, that would give a perspective on the "whole thing".

I started writing this some time ago, but things were progressing slowly, because I've been busy with other things, and also this sort of writing seem to depend on my mood. Sometimes it turns out good, and sometimes it's way too "technical" and dry.

But things that I wrote seemed as they may be useful, and it's a shame to keep them hidden. So I finally added the "Game Features" section to the manual, including 4 articles I wrote.
It may be found in our manual source here (not published on the online manual page yet):
https://github.com/adventuregamestudio/ags-manual/wiki#game-features

The 4 articles are:
- Game (https://github.com/adventuregamestudio/ags-manual/wiki/Feature_Game)
- Rooms (https://github.com/adventuregamestudio/ags-manual/wiki/Feature_Rooms)
- Characters (https://github.com/adventuregamestudio/ags-manual/wiki/Feature_Characters)
- Inventory Items (https://github.com/adventuregamestudio/ags-manual/wiki/Feature_InventoryItems)
Latter is partially based on a small text written by RootBound a while back.

This is not necessarily the final look of them, and could be adjusted and amended further. My wish was to make a starting point from which this sort of documentation may be expanded.

Just a reminder, if anyone would like to work on this, our manual source is currently open for editing as wiki pages, and you only need a github account for this.
#8
Engine Development / AGS 4: Touch input API
Wed 05/03/2025 12:47:44
This has been a request for a long while, but somehow we never got to implement touch API in script.
@eri0o has started to research this and made a draft, but it stayed unfinished for some time.

Recently I took his old draft and updated to a working version, ready to be included into the engine.

The PR:
https://github.com/adventuregamestudio/ags/pull/2692
Test build may be downloaded here:
https://cirrus-ci.com/task/5043738189234176


The API is very simple for starters, there are no sophisticated gesture detections, only basic things.

First there's array of TouchPointer objects that let to learn current state of N pointers, where "Pointer" is an abstract "device" that can touch a sensor. Normally this is a finger touching a touch pad or touch screen. Mouse can be emulated through this as well:

Code: ags
managed struct TouchPointer {
  /// Gets this touch pointer's identifier.
  import readonly attribute int ID;
  /// Gets whether this touch pointer is currently down (in touching state).
  import readonly attribute bool IsDown;
  /// Gets this touch pointer's X screen coordinate.
  import readonly attribute int X;
  /// Gets this touch pointer's Y screen coordinate.
  import readonly attribute int Y;
};

builtin struct Touch {
  /// Number of touch pointers registered by the game engine.
  readonly import static attribute int TouchPointerCount;  // $AUTOCOMPLETESTATICONLY$
  /// Accesses a touch pointer state by its identifier.
  readonly import static attribute TouchPointer* TouchPointers[];  // $AUTOCOMPLETESTATICONLY$
};

Besides the pointer states, there are pointer callbacks that you may add to your code:

Code: ags
function on_pointer_down(int pointer, int x, int y);
function on_pointer_up(int pointer, int x, int y);
function on_pointer_move(int pointer, int x, int y);


Here's an example of a game built for Android, which requires 2 fingers to control:
https://www.dropbox.com/scl/fi/6pqtttp2pwzyshqgn9ceg/ags4-touch-test-apk.zip?rlkey=764b7unhlrm9lafv3b4qnuy2f&st=f7h1x5um&dl=0

It features 2 on-screen "pads", one of which works like a joystick and another has 4 "buttons". These may be interacted with 2 fingers simultaneously, and it does not matter which finger you use on what.
(Now when I think about it, it's possible to use more fingers, in which case extra fingers will probably override each others.)
I apologize for the crude gfx and low resolution, i used lazy design and "programmers art".
But I think it serves a proof of concept.

Here's the game project:
https://www.dropbox.com/scl/fi/1ozjmq0yn0qi3103leb3r/ags4-touch-test.zip?rlkey=em6spjqj1z2a9cazpvss9ojq0&st=rn64iyj2&dl=0


The related code looks like this:
Spoiler
Code: ags
int JoystickRelX, JoystickRelY;

void HandleJoystickMotion(TouchPointer *p)
{
    int rel_x;
    int rel_y;
    if (p != null)
    {
        rel_x = p.X - gJoystick.X;
        rel_y = p.Y - gJoystick.Y;
    }
    else
    {
        rel_x = gJoystick.Width / 2;
        rel_y = gJoystick.Height / 2;
    }

    int btn_x = (rel_x - btnStick.Width / 2);
    int btn_y = (rel_y - btnStick.Height / 2);
    if (btn_x < 0) btn_x = 0;
    if (btn_x > gJoystick.Width - btnStick.Width) btn_x = gJoystick.Width - btnStick.Width;
    if (btn_y < 0) btn_y = 0;
    if (btn_y > gJoystick.Height - btnStick.Height) btn_y = gJoystick.Height - btnStick.Height;
    btnStick.X = btn_x;
    btnStick.Y = btn_y;
    
    JoystickRelX = rel_x;
    JoystickRelY = rel_y;
}

void HandlePlayerJoystick()
{
    int dx = JoystickRelX - gJoystick.Width / 2;
    int dy = JoystickRelY - gJoystick.Height / 2;
    float fdx = IntToFloat(dx) / IntToFloat(gJoystick.Width / 2);
    float fdy = IntToFloat(dy) / IntToFloat(gJoystick.Height / 2);
    player.x += FloatToInt(fdx * IntToFloat(player.WalkSpeedX), eRoundNearest);
    player.y += FloatToInt(fdy * IntToFloat(player.WalkSpeedY), eRoundNearest);
    if (player.x < 0) player.x = 0;
    if (player.y < 0) player.y = 0;
    if (player.x > Room.Width) player.x = Room.Width;
    if (player.y > Room.Height) player.y = Room.Height;
}

void HandlePadMotion(TouchPointer *p)
{
}

void HandlePadDown(TouchPointer *p)
{
    int rel_x = p.X - gPad.X;
    int rel_y = p.Y - gPad.Y;
    
    if (rel_x < gPad.Width / 2)
    {
        if (rel_y < gPad.Height / 2)
        {
            player.SayBackground("BLUE");
        }
        else
        {
            player.SayBackground("GREEN");
        }
    }
    else
    {
        if (rel_y < gPad.Height / 2)
        {
            player.SayBackground("RED");
        }
        else
        {
            player.SayBackground("YELLOW");
        }
    }
}

// called on every game cycle, except when the game is blocked
function repeatedly_execute()
{
    HandleJoystickMotion(null); // reset
    for (int i = 0; i < Touch.TouchPointerCount; i++)
    {
        TouchPointer* p = Touch.TouchPointers[i];
        if (p.IsDown)
        {
            if (p.X >= gJoystick.X && p.X <= gJoystick.X + gJoystick.Width &&
                p.Y >= gJoystick.Y && p.Y <= gJoystick.Y + gJoystick.Height)
            {
                HandleJoystickMotion(p);
            }
            else if (p.X >= gPad.X && p.X <= gPad.X + gPad.Width &&
                p.Y >= gPad.Y && p.Y <= gPad.Y + gPad.Height)
            {
                HandlePadMotion(p);
            }
        }
    }

    HandlePlayerJoystick();
}

function on_pointer_down(int pointer, int x, int y)
{
    if (x >= gPad.X && x <= gPad.X + gPad.Width &&
        y >= gPad.Y && y <= gPad.Y + gPad.Height)
    {
        HandlePadDown(Touch.TouchPointers[pointer]);
    }
}
[close]
#9
AGS 3.6.0 - Patch 12
Full release number: 3.6.0.59


For Editor
Spoiler

For Android
Spoiler
NOTE: the Editor now includes Android build component letting you prepare your own games for Android
[close]

For Engine/Editor developers
Spoiler

Released: 27th February 2025

Previous stable version: AGS 3.5.1 P20 forum thread


This release is brought to you by:

- Alan v. Drake (improvements, fixes)
- Cameron Cawley [ccawley2011] (fixes, improvements to SpriteFont plugin)
- Crimson Wizard (stuff :))
- Dominik Mierzejewski (fix)
- Donovan Watteau (fix)
- eri0o (updated Android port, Web port, Editor improvements, etc)
- fernewelten (new fonts outlining, improvements to script compiler, fixes)
- Francesco Ariis (fixes)
- Morgan Willcock (improving templates, help with CI)
- Pablo Navarro [panreyes] (fixes)
- ChamberOfFear (improvements)
- rofl0r (fixes, suggestions)
- sonneveld (porting engine to SDL2)
- Thierry Crozat (fixes, plugin update)
- vga256 (fixes)
- Walter Agazzi (fixes)


Summary

AGS 3.6.0 is another big change to AGS.
First of all, this release presents a SDL2-based engine. For about 2 decades AGS engine was based on Allegro 4 graphic library, which was discontinued somewhere in the early 2010-ies (only received few patches since). There was an intent to move to to Allegro 5 or SDL since, but for various reasons this task was continuously postponed. Now it's done.
Secondly the Editor and Engine now have full Unicode support. This means that you may use any language whatsoever in scripts, object descriptions and custom properties, as well as translations; so long as you also provide proper unicode fonts.
Third, we have finally expanded a list of platforms that the Editor can build for: now this includes Android and Web (Emscripten) port.

There are much more changes and improvements in this release, check out the full list of changes below.
Also, please be sure to read "Upgrading to AGS 3.6" topic in the manual: https://adventuregamestudio.github.io/ags-manual/UpgradeTo36.html



Changes in the Patch 12:

Engine:
- Fixed deleted DynamicSprite which is still assigned to a mouse cursor may cause engine's sprite cache to enter a corrupt state, eventually leading to a crash.


Changes in the Patch 11:

Editor:
- Fixed exception in Room Messages editor occuring if a certain game's Character is missing.

Engine:
- Fixed disabled GUIs not hiding their controls if "Hide all their controls" disabled style is set in General Settings, and game is run with Direct3D or OpenGL renderers.
- Fixed "greyed out" GUI controls leaving traces on parent GUIs when running with Software renderer.
- Fixed text parser in Dialog Options not working correctly if "new key handling" mode is on.
- Fixed DynamicSprite.SaveToFile() return value was inverse (regression in 3.6.0).
- Fixed engine crash in GetHotspotProperty() if the function is called with invalid ID.
- Fixed room Camera may fail to restore its position in the room after loading a save.
- Fixed fonts may not be assigned correct parameters when a new game is launched by calling RunAGSGame() in script (regression since 3.6.0 or 3.5.*).

Compatibility:
- Fixed engine refusing to load saves made by 3.2.0 engine, although being capable to do so.


Changes in the Patch 10:

Editor:
- Fixed a warning condition for copying 32-bit bitmaps to a desktop clipboard of less color depth.
- Fixed keyboard shortcuts for GUI Editor's Copy and Paste commands.
- Fixed a rare exception when scrolling the room in the editor.
- Fixed "Auto-number speech lines" and "Create voice acting script" operations failing if a Character's name contains underscore.

Compiler:
- Fixed escaped character literals not being parsed correctly. This makes character literals like '\n' and '\t' actually work in script.

Engine:
- Updated SDL_Sound library to 2.0.3.
- Improved OpenGL texture management, which should result in less system and video memory spent on sprite textures.
- Fixed Character.AddWaypoint() potentially using wrong walkspeed, if multiple characters or objects are ordered to start a non-blocking move in a mixed order.
- Fixed Character.AddWaypoint() is using incorrect speed if this room has a non 1:1 mask resolution, and "Scale speed with mask resolution" setting is enabled.
- Fixed Overlay.Create() crashing the engine if a non-existing sprite is passed as an argument.
- Fixed Say("...") command get stuck in endless loop if Speech.DisplayPostTimeMs is non-zero.
- Fixed PlayFlic() not working if called second time in game. This is likely a regression since 3.6.0.
- Fixed NumPad keys not handled properly by the engine (in on_key_press, IsKeyPressed, and TextBox control). This is a regression since 3.6.0.
- Fixed OpenGL renderer causing scaled sprites to have colored outlines sometimes while using Linear filter.


Changes in the Patch 9:

Engine:
- Fixed engine incorrectly reporting a script loading error, which may occur if the total size of script's global variables is bigger than the size of the compiled bytecode.


Changes in the Patch 8:

Editor:
- Fixed command "Crop sprite edges" in the Sprite Manager would copy import settings from the completely unrelated sprite onto the cropped one.

Engine:
- Fixed `@GAMENAME@` label not updating if Game.Name property is changed at runtime.
- Fixed System.ColorDepth was reporting a final display resolution, while it should report game's native resolution for historical reasons.

Compatibility:
- Fixed "upscale" mode not working for "default" game resolution in pre-3.1 games (the hidden meaning of "default" is 320x200 also).

Windows:
- Fixed a rare bug when the Windows engine could fail loading the game for no good reason.
  This error is related to a bug in Windows SDK 8.1.


Changes in the Patch 7:

Editor:
- For Android build target disabled compression of `.ags` and `.vox` assets, as that slows down engine streaming resources (sprites etc).
- Fixed Editor failing to start if user preferences file is corrupted
  (this is a second fix, complementing one done in AGS 3.5.1).
- Fixed RAM use spiking fast during batch sprite reimport from sources, which could randomly lead to program errors.
- Fixed Dialog properties displaying internal values not meant to be seen by a user.
- Fixed selecting parent GUI after its control did not display GUI's own properties in the Properties Grid.
- Fixed Editor generating deprecated settings in the default config file.

Engine:
- Fixed GUI controls unexpectedly clipping parts of text even if "controls clip contents" setting is disabled, in case when their Font has VerticalOffset property set.


Changes in the Patch 6:

Editor:
- Fixed GUI editor could display selection rectangle from a different GUI editor pane, if two or more are displayed on screen at the same time.
- Fixed Script editor not marking "autoptr" and "builtin" as keywords.
- Fixed Script editor not applying color theme to character literals.
 
Engine:
- Made String.Chars and Length properties work faster in ASCII mode.
- Issue a warning when blocking Display or Say commands are called during fade-out.
- Fixed engine failing to startup sometimes if controller device subsystem failed to init (it should not init at all in this version, as we do not support joysticks yet).
- Fixed "Before fade-in" event could be called recursively under some peculiar conditions (regression since 3.6.0).
- Fixed buttons on a non-clickable GUI were still changing to "mouse over" graphic under cursor.
- Fixed button click not registered if it has been made not visible and visible again during a single game frame (regression since 3.6.0).
- Fixed TextWindow borders drawn behind the rightmost corner pieces, which may be seen if the edge sprites are half-transparent.
- Fixed a brief black screen flash occuring right after the video playback ends (regression since 3.6.0).
- Fixed engine refusing to load legacy saves if the audio clip count does not match (number of audio clips should not affect saves).
 
WinSetup:
- Added an option to disable "smooth scaled sprites" setting.
- Added an option to disable language selection.
- Made filter names in "disabled" section treated in case insensitive way.


Changes in the Patch 5:

Editor:
- Reimplemented multiple sprites properties editing in the Sprite Manager. This ability was dropped in 3.5.0 unintentionally.
- Fixed Autocomplete not treating certain struct members as "static" or "protected" if their declaration is too long.

Engine:
- Fixed Character.WalkStraight() was resetting walking animation if called during walking.
- Fixed Character's idle animation getting reset to frame 0 when the speech is played without a valid speech view (idle animation should continue playing in such case).
- Fixed idle animation sometimes not starting immediately after Character finishes walking.
- Fixed a crash occuring if script tries to get or set a custom property for a non-existing Room Object (this seem possible to do by iterating over `object[]` array).

Compatibility:
- Implemented "legacysave_assume_dataver" override option in config, which lets to instruct the engine which game data version to assume when restoring legacy (pre-3.5.0) saves. This "hack" appeared to be necessary because of a mistake done during development of the older engine versions, where the save format was changed, but engine was made to rely on the game data version instead of incrementing save format index.
- Implemented "legacysave_let_gui_diff" override option in config, which lets the engine to read less gui elements from restored save than the number registered by the game. This is to emulate a (possibly unintended) effect in pre-3.5.0 saves.
- Fixed engine could try to load game data from game.exe without checking whether data is actually appended to it when restoring a legacy save in a game with a different file structure.
- Fixed number of GUI elements were not tested when loading a legacy save, which could lead to GUI data getting overwritten incorrectly without a warning if number of controls changed since. If the test failed, engine will act according to "legacysave_let_gui_diff" config option: either quit with error or log a warning and continue.

Plugins:
- Fixed potential "index out of bounds" exceptions in the built-in PalRender plugin.

Templates:
- In "Verb Coin" template fixed action label could be updated incorrectly if the cursor was moved over buttons on any other GUI.


Changes in the Patch 4:

Editor:
- Export Game's Title into translations.
- Fixed Game.agf was not created after importing a 2.* game project (regression in 3.6.0).

Engine:
- Character.AnimationVolume property is now applied to the portrait animation as well.
- Removed few of the less important game messages from logging, because they may quickly clutter the log under some circumstances.
- Fixed when animating a character portrait, the first frame's linked sound is not played.
- Fixed IsSpeechVoxAvailable() returning positive result if run from IDE and Speech folder is empty.
- Fixed speech and messages were skipped by modifiers and other special keys (Ctrl, Alt, etc).
- Fixed crash occuring when you resize DynamicSprite while it is displayed on screen.
- Fixed audio clip started right before a ChangeRoom would not play until after the room changes.
- Fixed in Software display mode the room Overlays may not be properly covered by a walk-behind under very specific conditions.
- Fixed System.Log() would cause engine crash if there are more format placeholders than args.
- Fixed some game options that are not allowed to be changed at runtime could still be overwritten when restoring an old save, leading to a weird game behavior.


Changes in the Patch 3:

Editor:
- Don't error when loading a room file which has unsupported number of events, instead these will be cut out. This may let e.g. use room templates from newer versions of AGS.
- Sprite's default property is changed from deprecated Resolution setting to SourceFile.
- Fixed full spritefile recreation would write duplicate sprites into the spritefile, if game project (Game.agf file) contained multiple sprites with same ID for any reason (for example, if they were added by manually editing Game.agf).
- Fixed importing SCI fonts with >128 chars.
- Fixed font preview did not properly display characters with indexes 128-255.

Engine:
- Fixed "noloopcheck" script function modifier was not handled correctly sometimes.
- Fixed a button with inventory placeholder did not update immediately when the active inventory is set.
- Fixed textual GUIs were not redrawn immediately after a call to SetGameOption(OPT_RIGHTTOLEFT).


Changes in the Patch 2:

Common:
- Fixed a TTF font could cause a crash in the Editor or the Engine if the font renderer tries to draw a letter with higher number than the highest glyph number in the font.

Editor:
- Added "Restore all sprites..." command to the Sprite Manager's context menu (this duplicates the "File -> Recreate sprite file" menu command added previously).
- Refresh Sprite Manager after fully recreating a sprite file.
- Sprites will now hide their "Resolution" property if the game settings have "Allow relative asset resolutions" disabled. This is to avoid user's misuse of this property.
- Fixed a minor memory leak occuring when editing a tree item's label in Project Explorer.

Engine:
- Engine will now find and load plugins in the game dir when run from a different location.
- Fixed crash occuring if Character was told to FaceLocation while "Turn to face" game setting is enabled, and character's View does not have enough loops.
- Fixed Character resetting current non-blocking animation if it was ordered to Move, as soon as it arrives at destination.
- Fixed crash occuring if a GUI button was somehow set a negative NormalImage number.
- Fixed "bad script stack" error could be sometimes displayed if the game was aborted in the middle of running a script.


Changes in the Patch 1:

Editor:
- Fixed room's deprecated setting LegacyMusicVolumeAdjustment not applied correctly.

Engine:
- Fixed Room Objects whose dynamic sprite was deleted in "leave room" event becoming invisible during fade-out transition. Logically this has to happen, but historically they kept displaying until the transition end, so we restored this behavior for compatibility, and simply because there's no "after fade-out" event in the engine yet to delete these sprites.
- Fixed Game.StopAudio() fails to remove queued clips if no particular audio type id is requested.
- Fixed performance regression in the script related to long loops (regression in 3.6.0).
- Fixed memory leak occuring when printing text in Right-to-left mode (regression in 3.6.0).
- Fixed rare mistake during text wrapping which may occur if a Unicode text is cut in the middle of the word.
- Fixed playing certain WAVs caused game to freeze forever on exit.

Compatibility:
- Fixed frame-linked sounds not playing in the games made before 3.6.0.
- Allow game to call DynamicSprite.Create() with negative size, clamping it to 1x1.

Templates:
- In Sierra-style template fixed "mouse over" graphic for the "Load" icon.



What is new in 3.6.0

Common features:
- Full Unicode support for all game texts: game properties, scripts, translations, input.
  ASCII/ANSI mode is still working, for backwards compatibility. This may be configured in the game project.
- Extended sprite compression options: lossless storage optimization for 16- and 32-bit sprites; LZW compression option for sprites in addition to existing RLE compression.
- GUI controls may now be told to clip their contents, which means that nothing gets drawn outside of their borders (as defined by X, Y, Width, Height properties). The only exception is Sliders, which are more complicated.
- The historical TTF fonts' "fixup" that altered their height and vertical offset is now optional and works only if backwards compatible option is set.
- Max number of AudioChannels is now 16 (was 8).
- Removed game Cursors hard limit (was 20).
- Increased Room Objects limit to 256 (was 40).
- Discontinued "Windows Game Explorer" support in both Editor and Engine.

Editor:
- Editor requires .NET Framework 4.6 to run.
- Added Android build target support (requires "Android component" installed).
- Added Web/Emscripten build target support (requires "Web build component" installed).
- Expanded UI color theme format, support global color options and allow missing entries.
- Script editor works in unicode mode.
- Added "Text format" option in General Settings which lets switching between ASCII/ANSI and Unicode (UTF-8) modes. This defines which format the game texts will be written in, when saving the game project and compiling the game.
- Added "Use old-style keyboard handling" option to the General Settings, which lets select between classic key press handling and new one meant for unicode chars support in scripts.
- Supports compiling UTF-8 translations. TRS file now has "Encoding" setting that tells how to interpret this TRS text.
- Added support for building multiple speech voxes, by taking files from the Speech subfolders.
- Added support for adding custom files into the game package. This is done by assigning a list of directories to "Package custom data folder" option in General Settings.
- Editor now copies a acsetup.cfg file from the project's root folder (if one is provided by) as a base for generating default config file. Settings from Default Setup will be written over, but other found options won't be removed.
- Added "Sprite file compression" option in General Settings, replacing "Compress the sprite file" option. The new option allows a selection of compression algorithm used for sprites.
  Currently supported: None, RLE (old default compression) and LZW.
- Added "Enable sprite storage optimization" option to the General Settings, that permits the editor to repack sprites in a different storage format, reducing their disk size whenever possible. This option may be used alongside with the sprite compression. Note that this does not change how the sprites work in game.
- Added "GUI controls clip their contents" option to the General Settings.
- Added "TTF fonts height used in the game logic" option to the General Settings, that makes your game use real font's pixel height when arranging text and text-based UI elements, as opposed to the nominal font's size.
- Added "Touch to Mouse Emulation", "Touch to Mouse motion mode" and "Display FPS on Screen" to Default Setup. Removed few deprecated options.
- Added "TTF font adjustment" property to Fonts, as well as to General Settings where it serves as a project default for the new fonts. This property lets you choose between "no changes" and backward compatible TTF fixup meant to keep fonts made for AGS displayed as they were meant to.
- In the "Import TTF" dialog added a choice to import the size closest to the given pixel height.
- Fonts now have Auto Outline Style and Auto Outline Thickness properties.
- Fonts now have a readonly Family Name field, that lets user see the original name of a font they've imported (if available).
- Added IdleDelay property to Characters that lets you set time needed to pass before IdleView is activated. This is equivalent to the Character.SetIdleView script function.
- Added Character.IdleAnimationDelay property to let setup idle view's animation speed.
- Added Cursor.AnimationDelay property to let setup cursor's animation speed.
- The TextWindow edges now have distinct names in the dropdown list of the property grid.
- Rooms created from a Blank template will now have default background of a game's resolution.
- When creating new room objects they will now have their script names set to some default value.
- Added Room.BackgroundAnimationEnabled property to let have disabled animation on room load.
- Editor will now create an empty sprite file if one is missing in the game project. Any existing sprite descriptions in the project will be kept, letting user to reimport these from sources.
- Added "File -> Restore all sprites from sources" menu command.
- Added "Apply" button on editor's Preferences dialog.
- In Preferences replaced "Import Color Theme" with a "Open Theme Folder", as a temporary solution for managing theme files.
- Select script editor's font in the editor's Preferences.
- Added "Help" option to the editor pane's tab context menu.
- Upgraded script editor to Scintilla 3.21.1 and ScintillaNET 3.6.3.
- Cursor's position in script is now displayed on the status bar.
- Dialog scripts now too can open help topics for keywords or script functions under cursor on F1.
- Added zoom controls for the Sprite Manager, Character, Cursor, Inventory and View panes.
- Sprites may now be imported by drag'n'drop into the Sprite manager.
- In sprite manager's context menu added command "Create source files for all sprites with missing / external sources..."
- In sprite manager's context menu added (restored) command "Replace sprite using previous files".
  Also made "previous file" remembered consistently whenever a sprite is imported or replaced.
- In sprite manager's "export all" dialog added "skip if inside project's folder" option.
- In sprite manager's "export all" dialog added "reset tile settings" option.
- On the View pane the frames having set delay and linked sound will be now indicated with icons.
- Editor no longer errors and fails when opening a game project with some script files missing.
- Editor no longer errors on empty translations when compiling the game.
- Editor now exports values of the string type Custom Properties to translations.
- Editor no longer prevents exporting string arguments from Get/SetTextProperty calls to TRS file.
- Editor now cleanups spritefile on game load, identifying any data not referenced by the project and marking it for deletion.
- Fixed editor silently enabling all available Build Targets when upgrading a pre-3.4.0 project. This could be very inconvenient as there are several of them supported now.
- Fixed open folders in the Project Tree were collapsing whenever you create a new subfolder or change an object's name in properties.
- Fixed editor was not preventing from entering Character's and AudioClip's ScriptName too long for the engine to handle.
- Fixed Image and View properties in various objects were allowing negative values.
- Fixed some of the object previews (at least GUI) could crash if user entered a non-existing sprite's number as an Image property.
- Fixed editor displaying unhandled exception if the script which user is trying to open was missing. Instead it will now open a blank script.
- Fixed room editor was suggesting to save the modified room even if no changes were made.
- Fixed a recently imported sprite could be displayed incorrectly scaled up in the room editor for high-resolution games, if the "Allow relative asset resolutions" was enabled in General Settings, and the sprite 0 had "Resolution" property set to "Low".
- Fixed program crash occuring on sprite's import if failed to open a source file for any reason.
- Fixed View animation preview stopping at frame 100 (if loop contains over 100 frames).
- Fixed going to a "find all" result in dialog script did not highlight the found text, and sometimes did not scroll down to it.
- Fixed "Goto Definition" not working for Enums and Defines (macros).
- Fixed script autocomplete sometimes was not updated right after opening a script.
- Fixed script autocomplete for function calls was mistreating commas in strings and inline comments as if they were separating actual parameters.
- Fixed script autocomplete was not displaying members of extended structs if the parent struct was declared in another header.
- Fixed script autocomplete was not working for enum names.
- Fixed structs and enums were not highlighted if declared inside a script's body.
- Fixed in dialogs numbers inside names were incorrectly highlighted as numeric values.
- Fixed matching or mismatching braces were not highlighted consistently at all times in regular and dialog scripts.
- Fixed crash occuring when user was trying to set breakpoint on the very last line in script.
- Fixed few editor panes were not opening correct help topics in F1.
- (Possibly) fixed error message text in the runtime error popup could be drawn partially beyond the popup borders if the user's system has text scaling option enabled.

Compiler:
- Support unicode character literals.
- Support using float literals when defining default values for function arguments.
- Support hexadecimal number literals (e.g. "0xABCDEF").
- Removed 500-characters line limit.

Script API:
- Expanded `on_key_press` callback, now supports two parameters: key code and key modifier flags.
- In the new key handling mode `on_key_press` is called for each actual key press;
  e.g. combinations like Ctrl+Z will result in two `on_key_press` calls, one with eKeyCtrlLeft and second with eKeyZ; added support for "NEW_KEYINPUT_API" macro in scripts.
- Implemented new `on_text_input(int ch)` callback which is called when the engine receives a printable character. This callback is essential for handling unicode chars in script.
- Similarily, expanded `dialog_options_key_press` with the third `mod` argument, and implemented `dialog_options_text_input` callback for receiving unicode chars during the custom dialog options state.
- Implemented `dialog_options_close` callback which is called when custom dialog options are removed from the screen. This allows to perform any required cleanup.
- Added eEventEnterRoomAfterFadein event for `on_event` callback, which corresponds to "enter after fade-in" room event.
- Added eKey constants for Shift, Control and Alt keys.
- Added eKeyMod enum for key modifiers constants.
- String.AppendChar(), ReplaceChar() functions and String.Chars[] property are now working with the unicode characters.
- String.Format("%c") specifier will now be able to print unicode characters.
- Extended Button.Animate() to have blocking style, direction and starting frame parameters, thus matching other Animate commands (of Character and Object).
- Extended all Animate() commands by adding "volume" parameter, that defines volume of the frame-linked sounds for the duration of this animation.
- Added Character.AnimationVolume, defining volume of the frame-linked sounds.
- Added Character.IdleAnimationDelay to let control idle view's animation speed.
- Character.Scaling is no longer limited by a range of 5-200 (now supports 1-32767).
- Hotspot.Name and Object.Name may now be set in script.
- Added Object.ManualScaling and Object.Scaling.
- Deprecated Object.IgnoreScaling (use Object.ManualScaling instead).
- Object.SetView default loop & frame values are now 0 (was -1 which retained loop and frame indexes from the previous view, often unexpected to the user).
- DrawingSurface.DrawImage() and DrawSurface() now support optional source rect coordinates.
- Added functions for getting DrawingSurface of room masks: GetDrawingSurfaceForWalkableArea(), GetDrawingSurfaceForWalkbehind(), Hotspot.GetDrawingSurface(), Region.GetDrawingSurface().
- Added new delay parameter to Mouse.ChangeModeView() to let control cursor's animation speed.
- Added Game.ChangeSpeechVox() and Game.SpeechVoxFilename, support switching the voice-over pack.
- Added Mouse.AutoLock property that toggles automatic mouse lock inside the game window.
- Added Room.Exists().
- Added System.Log().
- Added SkipWait() that skips any active Wait() function.
- Added WaitMouse() to complement existing Wait functions.
- Added InputType enum which defines input devices and lets create their sets as flags.
- Added WaitInput(), a more generic and extendable function that accepts a combination of flags telling which input types to wait for.
- All Wait* functions now may have infinite timeout if you pass a negative timeout parameter.
- All Wait* functions now return the reason they were skipped: a combination of InputType flag and a respective key or button code.
- Added GUIControl.Transparency property.
- Added Overlay.CreateRoomGraphical and CreateRoomTextual. Use these two functions to create "room overlays": that is - overlays that display a sprite inside the room, sorted among other room objects, characters and walk-behinds.
- Added readonly Overlay.InRoom property that tells if this is a room or screen overlay.
- Extended Overlay.CreateGraphical() with a new "clone" parameter that tells whether to assign a sprite index, or make a sprite's copy owned exclusively by this overlay. The former will save program memory but make overlay update if the sprite is edited later. The latter is meant primarily for backwards compatibility.
  Overlay.CreateRoomGraphical has the same param.
- Added Overlay.Graphic property that lets you change overlay's sprite after it's created.
- Added Overlay.Width and Height properties, that let you freely scale existing Overlay.
- Added readonly Overlay.GraphicWidth and GraphicHeight properties that let read original overlay's graphic size, as not all overlays hold a sprite reference (e.g. textual overlays).
- Added Overlay.Transparency property.
- Added Overlay.ZOrder property that lets you sort Overlays among themselves and other objects in the same "game layer": screen overlays are sorted among GUI, while room overlays are sorted among room objects, characters and walk-behinds.
- Added Speech.TextOverlay and Speech.PortraitOverlay for accessing blocking speech overlay and portrait overlay respectively.
- Added Game.BlockingWaitSkipped which tells the result of the last blocking wait skipping, also including result of the blocking speech skipping.
- SkipSpeechStyle now supports eSkipNone mode; when used it will disable any kind of skipping, such speech can be only skipped by a direct command from script.
- Extended Screen.ScreenToRoomPoint() with an optional "restrictToViewport" argument, which lets to choose whether tests over empty place result in conversion through the default viewport or a null pointer.
- Added AudioClip.PlayOnChannel().
- Added AudioChannel.Pause() and Resume() functions, and IsPaused property.
- Added AudioChannel.SeekMs(), complementing PositionMs (as the Seek() function interprets position differently depending on the audio format).
- PlayVideo() now supports an option to play both game's and video's audio track simultaneously.
- Added File.WriteRawInt() to complement ReadRawInt().
- File paths in script now support $DATA$ token, which tells to read files from the game package. This only works for read operations. Functions that support this token currently are:
  File.Open(), DynamicSprite.CreateFromFile(), ListBox.FillDirList().
- Debug(2, 0) command that displayed walkable areas is superceded by Debug(2, n), where "n" is a mask type: 0 - none, 1 - hotspots, 2 - walkbehinds, 3 - walkable areas, 4 - regions. This command also works as a toggle switch, calling it with the same mask index will turn it off.
- Debug(5, n) command that displayed character's walk paths now also works as a toggle switch.

Engine:
- New SDL2-based backend for graphics, audio and input.
- Hqx graphic filters discontinued (could be temporary).
- Windows-only DirectMedia video playback discontinued (could be temporary).
  Only OGG/OGV videos are kept supported at this point.
- Support resizing game window on desktop systems.
- Support "borderless full-screen window" mode in addition to the real (exclusive) fullscreen.
- Support for switching vertical sync at runtime with Direct3D/OpenGL renderers. Also enable vsync in windowed mode too.
- Unicode (UTF-8) text support: engine can now switch between ASCII and UTF-8 text mode. This is controlled by both game's OPT_GAMETEXTENCODING setting and translation's "Encoding" setting: they tells whether to interpret game texts as UTF-8 or ASCII/ANSI.
- Support optional translation's "GameEncoding" setting: it hints the original game's codepage to help with their conversion. This is mostly meant for translating existing older (ANSI) games.
- Engine now supports using real pixel height of the TTF fonts when arranging text and UI elements on screen; using nominal import size of the font is used as a compatible mode for the old games.
- Also supports separate "normal" and backward compatible "fixup" modes when initializing TTF fonts, letting to display both common TTFs and ones made specifically for AGS in the past to display as they were meant to be.
- Supports scripts using functions and variables from any other scripts, regardless of the script module order in the project.
- Removed limit of simultaneous Button animations.
- Removed limit of Character followers.
- Removed Overlay limit.
- Character.SetWalkSpeed() is no longer restricted by an arbitrary limit of 50.
- Process character's idle view based on real game speed, not hardcoded 40 fps.
- Improved file writing times (e.g. when doing a game save) by using buffered file stream. Initial tests showed 50% faster file writing.
- Engine now renders GUI controls as separate textures when using hardware accelerated renderers. This may significantly improve performance in the high-resolution games and games with large number of GUI elements on screen.
- Engine now shares the video texture data for all game objects on screen sharing same sprite. This improves performance in case there are multiple objects which use same image.
- Various performance optimizations for both raw drawing and texture updates (Direct3D/OpenGL).
- Engine now ensures that in threaded audio mode the AudioChannel's state only changes once the game is updated, and not while the game script is running. This prevents situations when the clip could begin playing before all properties are set in script, or when AudioChannel's properties' values (such as Position) could change while running a game script.
- 24-bit wav PCM support, comes with the new sound library.
- File.ReadRawLineBack() now always reads full line, and not limited to 200 characters anymore.
- Debug displays, such as showing room mask and character walk paths, are now implemented as non-blocking translucent overlays, allowing you to keep playing the game while they are on.
- Implemented debug key controls for calling a built-in save and restore game dialogs. These controls have to be set in user config as "save_game_key" and "restore_game_key" in "[override]" category. These may be used by testers if the game is missing a save function or one is bugged.
- Engine now supports loading compiled scripts as separate files packed along with the game, along with those embedded into the main game data or inside room files.
- Engine no longer bails out with error if the chosen translation cannot be loaded on startup.
- When reporting script errors, engine will print callstack for all the active script "threads": for example, if there's Wait() function called and error happened in repeatedly_execute_always, then it will print both actual error's location, and Wait() call's location.
- Engine config now has graphic modes defined as a simplier string options: "[graphics] fullscreen" for the fullscreen mode setup, and "[graphics] window" for the windowed.
  Fullscreen option can explicitly define a "borderless full-screen window" mode.
- Added "emul_mouse_mode" and "emul_mouse_relative" options to config in "[touch]" category.
- Added "cache_size" and "stream_threshold" options to config in "[sound]" category, they setup the rules for sound caching and choosing whether to load a clip fully into mem or stream one.
- Added "load_latest_save" and "show_fps" options to config in "[misc]" category.
- Added "background" option to config in "[misc]" category, that defines the starting run-in-background (aka multitasking) mode (may later be changed by SetMultitaskingMode()).
  Added "--background" command line option for the same purpose.
- Added "--sdl-log" command line option for setting up SDL2 library output verbosity. The engine log config now has a new "sdl" group meant for SDL2 messages.
- Support "--user-conf-dir" command-line arg (and "user_conf_dir" config option) superceding "--localuserconf"; the new option directly tells the location of user config file.
- Path related command-line and config options, - such as "shared_data_dir", "user_data_dir" and "user_conf_dir", now support $GAMENAME$ token in path which is resolved to the game's title.
- Added "--clear-cache-on-room-change" command-line arg (and similar config option).
- Don't error when DrawingSurface.DrawImage has bad transparency parameter (warning instead).
- Don't error when detecting bad format in File.Read* functions (warning instead).
- Added stubs for agsshell plugin (a contemporary cross-platform variant of ags_shell).
- Added stubs for agsappopenurl plugin.
- Fixed potential crashes if a room-related API function has been called in "game_start"; this is achieved by having a dummy room placeholder object. Still results of such calls are undefined and should not be relied upon.
- Fixed potential crash on room load if the walkable area mask contained color values above the supported range.
- Fixed dialog script's "goto-previous" command not working if used from the first sub-topic run using "goto-dialog" (a very-very old bug).
- Fixed AGS_EngineInitGfx plugin callback was not called during OpenGL renderer initialization.
- Fixed Direct3D/OpenGL renderers were displaying plugin's raw drawings in a wrong position in the scrolling rooms, if the drawing was done on AGSE_PRESCREENDRAW or AGSE_POSTROOMDRAW events.
- Fixed overlay may fail to be created sometimes, if previously another overlay had been forcefully removed when changing rooms (this is an ancient bug which existed for many years).
- Fixed ListBox.RowCount reporting 0 if called before the control was displayed once.
- Fixed GetTextWidth would still return a size of an outline for an empty text string.
- Fixed text may be misaligned in gui controls, as its outline thickness is not counted.
- Fixed some TTF fonts could be cut at the bottom when the speech is displayed.
- Fixed scheduled sound fadeout effect was not cancelled by skipping a cutscene.
- Fixed OGV Theora videos positioned incorrectly if they have certain sizes or aspect ratios.
- Fixed game fps sped up if SetGameSpeed() is called repeatedly in game script.
- Fixed game not reacting to system close commands when stuck in script, which made it impossible
  to close the "hanging" game by usual means (other than terminating the process).

Engine Plugin API:
- Added IAGSEngine::GetGameInfo() function which returns information about the game, such as its title and GUID.
- Added new render callback AGSE_POSTROOMDRAW, for handling drawing inside the room above all room objects.
- Added IAGSFontRenderer2 interface, expanding the original font renderer interface, improving font plugins support.
- Added ReplaceFontRenderer2() and NotifyFontUpdated() functions.

Compatibility:
- Fallback to the first loop with frames if current character's loop does not have any.
- Use the dummy frame if current character's speech view loop does not have any.
- Ignore character having view/loop with no frames while it's not in the current room.
- Legacy behavior of MoveCharacterBlocking's return value.
- Fixed walkable area's continuous scaling was broken for high-res rooms in old games.
- In pre-3.* games force player to walkable area after changing rooms, this is to emulate an unintentional effect created by the old engines.
- Fixed pre-3.4.1 anti-aliased TTF fonts display (their vertical position was broken).
- For pre-3.5.0 games support old behavior of coincidental dynamic sprite replacement on GUI backgrounds (and few other places) without explicit assignment; that is - when the new DynamicSprite is created right after deleting an old one.
- Support Label.TextAlignment with legacy alignment constants for pre-3.5.0 games made with the custom engine from "Clifftop Games".
- Support native resolution hack for games made with "Clifftop Games" custom engine, where 640x400 games are run as 640x360.

Android:
- Rewrote universal AGS game launcher/player using up-to-date Google guidelines. The former "launcher" is now called "AGS Player".
- Implemented single game project template meant for building your own signed APK.
- Implemented two touch-to-mouse control scheme (selectable in config), for one finger emulating LMB only, and for two fingers emulating LMB and RMB.
- Support relative motion speed setting for touch-to-mouse emulation.
- In AGS Player added "Browse" button to the game folder selection, which opens default system file picker.
- AGS Player now searches for games recursively, in all the subfolders.
- AGS Player now has preference button per each game, which opens individual game's settings.

OSX:
- OpenGL renderer is now supported on MacOS.

Web / Emscripten:
- Initial port release.

Windows:
- Installer will create program links with three-digit version in the name.

Plugins:
- Added SpriteFont plugin to the list of builtins, for ports that use ones.
  SpriteFont plugin is updated to support custom "Clifftop Games" font variants.

WinSetup:
- Added "Fullscreen as borderless window" checkbox.
- Remade sound options to reflect the move to the new audio system in the engine.




Known issues

* Although Unicode text is supported overall, some languages may still not be printed correctly automatically. Firstly, those that require "letter linking", such as Arabic or Persian, do not have the proper linking on its own. This may be worked around using special text converters and fonts. Another issue is that texts printed right-to-left in the source (where print direction is done using Unicode's control characters) are not wrapped correctly and may require manual placement of line breaks, or scripting their split in game.
* MIDI no longer plays on its own on Windows. For MIDI you (and your players) must install "sound banks" (also known as "sound font"). Please refer to this article: https://adventuregamestudio.github.io/ags-manual/MIDI-playback.html
* AudioChannel.Position and AudioChannel.Seek do not work for MIDI and MOD sounds. Try sticking to PositionMs and SeekMs for now.
* There are reports about Direct3D not being able to restore the fullscreen mode after alt+tabbing occasionaly.





Thanks to everyone who contributed to and tested this version!



#10
I've started experimenting with necessary changes to the engine that would allow to have all script objects to have same parent class(es). There's a number of technical difficulties, but I won't discuss them here, they are related to historical "dirty" architecture of AGS engine and not interesting to anyone except engine developers. What I'm interested more is to discuss what these parent classes could look like in script.

The following is just my current thoughts, not a final plan.

I suppose that the problem of choosing parent classes is a problem of defining which qualities and roles do particular types have and share. If many types share same roles then we may create a base class for those roles. If there are types among them which share only a part of these roles, but others do not apply to them, then there may be a need to split the base class into two classes, one inheriting another, where first base class has role A and second roles A and B, and types that require only role A would use the first base class and those that require both would use the second. On another hand, sometimes it may seem that certain role is just too "small" and splitting another base class may not be convenient. In which case probably we could live with the fact that certain property is inherited by types that do not use it in any practical way.

In game engines there's another approach to this problem, called Entity-Component system, where functionalities are spread onto separate "components", which are then attached to a object or type of an object. Unfortunately, it's not clear whether this will be possible to do in AGS, but likely it will be more difficult to achieve than direct inheritance.

Keeping this approach in mind, which roles may we have for types in AGS script?

I'm not sure if all of the script structs should have a parent, although they could have, similar to "object" in C# or Java.
If so, we may consider that to be a role of "any builtin object", that is any object created by the engine, as opposed by types declared by user.
(Although, I suppose, one could invent a way to let managed user structs inherit some predefined base class too, maybe even automatically, but I won't touch this topic here.)
If I think about one, I can only see it having a property which returns its type name, useful for diagnostic purposes, and perhaps for casting too (although there could be builtin script syntax for testing that). Another thing that it could have is a check for validity, in case it may be disposed before all script references are gone: this is already a thing with DynamicSprite (can be Deleted), Overlay (can be Removed) and File (can be Closed).
Unfortunately, "Object" name is already taken by the room objects, so I'd use something like "Entity" for this:

Code: ags
builtin managed struct Entity {
    readonly attribute String TypeName;
    readonly attribute bool   Valid; // name taken from Overlay, but may be Disposed
};

Then, there are classes that are just utility ones, like File or DrawingSurface that exist only temporarily; and then there are classes that play a role, I'd say, of a "game element". These are parts of a game that take certain place in a game scene, whether a global one or a room, they have a prolonged lifetime, and may be saved in a game state. They have to be uniquely identified (have a script name), and may have custom properties attached to them, letting user to configure them for custom scripts. I think that these may have their own parent class, which I call "GameEntity":

Code: ags
builtin managed struct GameEntity extends Entity {
    readonly attribute String ScriptName;
    
    // Functions or properties for dealing with custom properties
    function int GetProperty(name);
    function void SetProperty(name, int);
    function String GetTextProperty(name);
    function void SetTextProperty(name, string);
};

Note that I don't use numeric ID here in this base class. The reason is that, unlike ScriptName, which is globally unique, numeric IDs are unique only among objects of same type. Therefore using ID from a base class makes no sense IMO, since you won't know which array to put it in, or which other IDs to compare with.

Then, there's an other distinction: objects that imply continuous "behavior" in the game (i was not sure how to put it in a better way).
The way I see this, there are types that do not really "act" on their own, but instead either represent "assets" which can be instanced by command, or are used with other types. The examples are: AudioClip (that actually creates a playback instance, but is not active itself), or Dialog (that represents a game substate, again creates a dialog instance when run), or View (that is a collection of animations applied to other objects), or InventoryItem (which is an abstract thing which characters hold in their bags).
And then there are types that actually do "act" and affect the game just as they enter the scene: being drawn, interacting with each other, etc: Characters, Objects, various areas and regions in the room, GUI and Overlays.
The common quality of this kind is that they may require a way of turning them on and off (having "enabled" state).
Arguably, they also look like all having a "position" in the scene, but I don't know if that may be a coincidence. Some of the types mentioned above sort of do have a location, but they do not allow to change that at runtime (masked regions).
In theory, I suppose, if we ever support Parent->Child node like relation between objects in game, then this base type may also host Parent/Child references.

I'd call this base type the "Actor", because it's "acting" in a scene:

Code: ags
builtin managed struct Actor extends GameEntity {
    attribute bool Enabled;
    // Fantasy attributes for parent->child relation:
    // attribute Actor* Parent;
    // attribute Actor* Children[];
};

Finally we're getting for things that have certain position in a scene space and may be moved around. Or rather they have full set of "transform" properties: position, scale and rotation. Note that these do not have to be visible, have a graphical representation. A theoretical example of an object that has a position but does not have a view can be a "marker" or "emitter" type of object: something that just marks a spot, but does not display a thing. Another example is an object that does not have a graphic, but displays something else, like Camera and Viewport.

I have no idea how to call this properly, so I named it silly as a "Thing" for now:
Code: ags
builtin managed struct Thing extends Actor {
    attribute int X;
    attribute int Y;
    attribute float ScaleX;
    attribute float ScaleY;
    attribute float Rotation;
};

And then finally we have 2 roles: a visual object which has all kinds of additional visual effects (such as transparency, blending etc) and object that may be interacted with by clicking. We do have visual objects that cannot be interacted with directly (like Overlays). But I don't know if it's worth or not separating these.

Code: ags
builtin managed struct GraphicObject extends Thing {
    attribute bool Visible;
    attribute int Transparency; // or Alpha
    attribute BlendMode BlendMode;
    // etc
    
    // For interactive objects
    attribute bool Clickable;
};

But like I mentioned earlier, having that amount of base types may not be convenient for AGS. Few of the above could be merged, while reserving an option to split them later. For example, Entity and GameEntity could be merged, if we don't want base class for everything (e.g. types like File or DateTime could go without a parent class).

Then there's a problem of adding Verb Interactions to this hierarchy. The objects that require these are Hotspots, Objects, Characters and InventoryItems, and first three may even be parents to each other, or share same "Interactable With Verbs" base class. But InventoryItem is a distinct case, because it does not have a position in the scene, it's only drawn within a gui, so it cannot share a base type that has position. One way to solve this is to move Verb Interactions to a higher parent class.
#11
AGS 3.6.2 - RC3
Full release number: 3.6.2.9


For Editor
Spoiler

For Android
Spoiler
NOTE: the Editor now includes Android build component letting you prepare your own games for Android
[close]

For Engine/Editor developers
Spoiler


Released: 13th April 2025

Previous stable version: AGS 3.6.1 P10 forum thread


This release is brought to you by:

- Alan v.Drake (palette fix)
- Crimson Wizard
- edmundito (some fixes)
- eri0o
- homelightgames (scalable images for the wizard dialogs)
- rofl0r (couple of compatibility reports & fixes)


Summary

3.6.2 is planned to be a second update to 3.6, focusing mostly on convenience of existing Editor and Engine features, and expanding existing script commands. For a quick mention, the noteable changes are:
- you may create object event functions in any script of your choosing (except room events);
- a support for loading saves from older versions of the game;
- dynamic arrays have Length pseudo-attribute, letting you to read their length in script;
- dialog events (in "on_event") may let writing custom dialog handling in script easier.
But there's more.

As usual, please refer to "Upgrading to AGS 3.6.2" topic in the manual for further information on most outstanding changes in this version:
https://adventuregamestudio.github.io/ags-manual/UpgradeTo362.html

The full changelog follows.


What is new in 3.6.2

Common:
 - Event handler function are now allowed to be located in any script module.
 - New naming rule for the voice clips: full char name, followed by a number, separated by a dot, e.g. "RogerTheGreat.1234.ogg". The old rule may be enabled again by a switch in "Backwards Compatibility" settings.

Editor:
 - In "Start New Game Wizard" game template selection now displays template's description right in the dialog.
 - "Game statistics" now have Ctrl + F2 shortcut instead of F2.
 - F2 can be used for starting editing names of items in the Project Tree (ones that support that) and folders in the Sprite Manager.
 - Added "Game Speed" property in General Settings.
 - Added "Use old-style voice clip naming rule" property in General Settings, it lets to select whether the game should expect old-style voice clip filenames (4-letter char name followed by number) or the new one (full char name, followed by a number, separated by a dot).
 - GUI selection in settings is now done using drop-down lists which list all eligible GUI types instead of having user to type GUI number. The setting will be automatically fixed if a GUI is removed.
 - Property Grid now displays Custom Properties right in the main properties list for each item that supports them.
 - Added "WrapText", "TextPaddingHorizontal", "TextPaddingVertical" properties to GUI Button.
 - GUI Labels can select full range of Alignment values in their TextAlignment property.
 - Added "TurnWhenFacing" property to Characters.
 - Textual GUI controls can now select "Null Font" as their font: this will prevent any text to be drawn even if one is assigned, and make it have zero size (when it matters).
 - Property Grid and Room's navigation bar now display object's description along with the script name on the drop-down list labels.
 - "Events" tab on the Properties Grid now has "ScriptModule" selection, which lets define in which module should the related script functions be generated and looked for. The GUI Controls use a ScriptModule set in their parent GUI, and Room events always has a fixed room script selected.
 - Added "Open Recent" submenu in the File menu.
 - Sync script editor's commands in Edit menu with the context menu.
 - Added "Toggle Line Comment" command to Edit menu for scripts.
 - More panes in the Editor are DPI-aware (rescale well with the system font scaling).
 - Editor tabs now display icons indicating their contents (may be disabled in Editor Preferences).
 - Room panel tabs now display room names.
 - Editor will now remember certain window states: "Sprite selector" window and splitter position, splitter position in "Sprite manager".
 - Support reordering folders in Project Explorer with drag & drop.
 - Support importing plain script files: ash, asc or both, - besides script modules (*.scm).
 - On "Color Finder" pane also display actual RGB values that the engine will use. They may be different from requested RGB, because historically engine limits drawing color's RGB precision to 16-bit.
 - Font's "SourceFilename" and "Font Size" properties now have buttons that let import another font file, or reimport same font with different size respectively, instead of clicking on a button on the preview window.
 - Added a readonly "ProjectFilename" property to Fonts, which displays their in-project file name.
 - Global Variables panel now allows to declare arrays.
 - Added "Controls transparency" slider to GUI edit pane.
 - Copy, paste and delete commands now apply to all the selected GUI controls in GUI editor.
 - When pasting a copied GUI control, Locked property of a new control will be turned off.
 - Support editing group properties for selected GUI controls.
 - Added a multiline Text edit window for Button and Label controls, that may be called by Ctrl+E, from context menu, or by pressing "..." button of the Text property in the Properties grid.
 - Support reordering folders in Sprite Manager with drag & drop.
 - Added "Replace source paths for sprites..." context menu command in Sprite Manager. This command allows to batch-replace parent folder for all sprite source paths, in case you moved original files from one folder to another.
 - Added "Palette index" selection for sprite's import transparency option.
 - Support importing 32-bit BMP files of extended formats (this support is formal at the moment, and does not guarantee that any of the extended data will be interpreted).
 - Support importing 1-bit (monochrome) and 4-bit images as sprites, room backgrounds and masks (converted to 8-bit).
 - Do not alter or clamp palette for 8-bit sprites imported in a 16/32-bit game.
 - Support importing indexed images which palettes contain translucent alpha as sprites with alpha.
 - Support importing indexed PNGs as room backgrounds and masks.
 - When the room background size changes, reset room edges to defaults.
 - Removed obsolete "Copy walkable area mask to regions" command from the Room editor.
 - Improved scrolling of drop-down lists in the Room's navigation bar: made scroll buttons larger, and support mouse wheel.
 - In Room Editor, during any area drawing mode Ctrl + LMB now works as area picker regardless of the currently selected tool.
 - Added "Change Room Number" context menu command for the Rooms in Project Explorer.
 - Added "Replace source paths for audio clips..." context menu command for the Audio node. This command allows to batch-replace parent folder for all clips' source paths, in case you moved original files from one folder to another.
 - Don't restrict compiling a voice-based lipsync if game has a Lucas-Arts style speech.
 - Do not delete previously built game exe from Compiled/Windows folder when testing a game from the editor.
 - Editor will now report any missing script functions that are assigned to events, but not present in script, as warnings when compiling the game.
 - Editor will now report any script functions that *look like* event functions, but not assigned to corresponding events, as warnings when compiling the game.
 - Added "/maketemplate" command-line option that tells Editor to run, make template out of the said game, and quit.
 - Fixed Project Explorer refreshing when user changes names or descriptions of room objects.
 - Fixed importing indexed PNG as a sprite, previously Editor would mistakenly treat the source image as 32-bit.
 - Fixed importing GIFs with "palette 0 / N" transparency option would refer a palette color from each individual frame's palette rather than the original GIF palette, which could lead to wrong colors used as transparents.
 - Fixed importing 8-bit BMP sprites with no "Remap palette" and "Leave As Is" as a transparency option would still remap palette index 0 to the first found palette entry with Alpha 0, even if that's a filler entry not used by the image.
 - Fixed exporting room backgrounds was always writing a 32-bit image rather than using actual background's color depth.
 - Fixed Autocomplete failing in case of UNIX line endings in script file.
 - Fixed Autocomplete not giving correct results in case of a long chained access, i.e. something like "var[0].member.member".
 - Fixed Autocomplete giving wrong list of choices for wrong syntax cases like: indexed access of a type and non-array struct variable, member access of a static array.
 - Fixed Button getting resized to the image's size when user cancels different sprite assignment.
 - Fixed "Color Finder" and color properties were mapping a color number to RGB values with accuracy mistakes, resulting in slightly different values than the engine would use.
 - Fixed Font preview could crash the Editor with out of memory error in case of a very big font.
 - Fixed Editor refusing to open a project if one or more of the sections are missing in the file.
 - Fixed an unhandled exception occuring when rebuilding rooms if any script's header is missing.
 - Fixed a "unterminated string" error in Dialogs was not pointing to the actual error location.
 - Fixed double warning message when trying to close the Editor while a game test is running.
 - Fixed Editor may display a "save project" confirmation when run with "/compile" command-line parameter.

Scripting:
 - Dynamic arrays now have Length readonly property that returns their number of elements.
 - Support zero-length dynamic arrays. This may be useful if you need to have a dynamic array with no elements, but don't want to bother about checking a null pointer.

Script API:
 - Added eNullFont constant that lets assign or pass a "null font" to any property or function parameter which expects a font's ID. This "null font" will simply make any text not drawn and have no actual measurements (size, spacing, etc).
 - Added global events: eEventDialogStart, eEventDialogStop, eEventDialogRun, eEventDialogOptionsOpen, eEventDialogOptionsClose (these are handled in "on_event").
 - Events eEventGUIMouseDown and eEventGUIMouseUp now get additional parameters: mouse button, mouse x and y positions (relative to the exact GUI).
 - Expanded "on_mouse_click" callback, now supports two more parameters: click x,y coordinates.
 - Added RestoredSaveInfo struct which contains information about game save's contents,
 - Support "validate_restored_save" callback, which lets user to validate restored saves with mismatching data and request cancellation or continuation of restoring this save.
 - Added Button.WrapText, TextPaddingHorizontal, TextPaddingVertical.
 - Added Character.Following property that returns another Character that this one follows after.
 - Added Character.TurnWhenFacing property.
 - Added Character.MoveStraight() complementing WalkStraight().
 - Added DateTime.CreateFromDate() and CreateFromRawTime().
 - Added static Dialog.CurrentDialog property and non-static ExecutedOption and AreOptionsDisplayed properties.
 - Added static Dialog.Stop() function, a OO-style alias to StopDialog().
 - Added RenderLayer enum, and optional "layers" parameter to DynamicSprite.CreateFromScreenShot(), that tells which of the game's render layers to capture when making a screenshot.
 - Added File.Copy() and File.Rename().
 - Added FileSortStyle and SortDirection enum, and File.GetFiles() function that returns a dynamic array of filenames found using certain pattern, and optionally sorted by name or time, in ascending or descending order.
 - Added File.GetFileTime() that returns file's modification time.
 - Added File.ReadFloat(), WriteFloat(), ReadRawFloat(), WriteRawFloat(), ReadRawBytes() and WriteRawBytes().
 - Added Game.InBlockingWait property, that tells whether game is waiting for any blocking action or a Wait* call to complete.
 - Added SaveGameSortStyle enum and Game.GetSaveSlots() function that returns a dynamic array of save slot indexes, optionally sorted in certain way.
 - Added Game.GetSaveSlotTime() that returns a time this save slot was last written.
 - Added Game.ScanSaveSlots() that scans a range of game saves and tests them for compatibility, using "validate_restored_save" too if it's present in user script.
   This action is not run immediately, but is scheduled to be executed after current script ends. It reports of scanning completion by sending eEventSavesScanComplete event.
 - Label.TextAlignment has now type Alignment, rather than HorizontalAlignment, and has full alignment range (both horizontal and vertical).
 - Added optional "fileSortStyle" and "sortDirection" parameters to ListBox.FillDirList().
 - Added optional save slot range (min/max), saveSortStyle and sortDirection parameters to ListBox.FillSaveGameList(). This lets to define the exact range of saves it should fill, and order them in desired way.
 - Added ListBox.FillSaveGameSlots(), which initializes a list of saves from a dynamic array of save slot indexes.
 - Added Object.DestinationX and DestinationY properties, complementing ones in Character.
 - Added Overlay.SetPosition() and SetSize() functions for convenience.
 - Added Room.BackgroundCount readonly property.
 - Added Room.NearestWalkableArea() that returns the nearest found point on a walkable area.
 - Added GetWalkBehindBase() function, complementing SetWalkBehindBase().
 - Added Speech.SpeakingCharacter that returns currently speaking character (for blocking speech).
 - Added GetTimerPos() that returns timer's position (remaining time), in ticks.
 - Added CopySaveSlot() and MoveSaveSlot(), which moves existing save to another slot.
 - Added optional save slot range (min/max) parameters to RestoreGameDialog() and SaveGameDialog().
 - Added optional "sprite" parameter to SaveGameSlot(), that lets to pass a number of an arbitrary sprite to write into this save instead of a standard "screenshot".
 - Added optional "width", "height" and "layer" parameters to SaveScreenShot().
   SaveScreenShot() now accepts paths containing standard file tokens ($SAVEGAMEDIR$ etc).
 - Added SendEvent() function that allows to trigger "on_event" function calls in script.
   Special event value eEventUserEvent may be used as a base index for user-defined events.
 - Added System.DisplayFPS property that toggles FPS counter (a replacement to Debug(4, 1)).
 - Added System.GetEngineInteger() and System.GetEngineString() for returning diagnostic information about engine's runtime state. Possible arguments are defined by EngineValueID enum.
 - Added new game-wide option OPT_SAVEGAMESCREENSHOTLAYER that lets to define which of the game's render layers will be captured when making a standard screenshot for the save game.
 - Add SaveComponentSelection enum and game option OPT_SAVECOMPONENTSIGNORE, which lets to skip certain components when saving or restoring a game. This has dual purpose: reduce number of things in game that may break older saves by simply not having them in a save, and also reducing the size of game saves on disk (e.g. in case of dynamic sprites). Note that all things that were not restored from the save will retain their *current state*.
 - Fixed some script functions in AGS API were declared with "int" return value, while they are supposed to be "void".

Engine:
 - Updated to SDL 2.30.11 and SDL_Sound 2.0.4.
 - Engine now potentially supports reading saves made in older game versions with different content, so long as these saves have *less* data in any given type (i.e. less Characters, or less controls on a certain GUI, or less variables in script, and so forth).
   This feature is enabled by having a special "validate_restored_save" function anywhere in the game script, that accepts an argument of type RestoredSaveInfo. RestoredSaveInfo contains various information about the restored save, and "Cancel" property, that must be explicitly set to "false" in script in order to allow to restore such save.
 - Engine supports returning to previously saved rooms which have less script data.
   It's important to remember though that it does no validation of restored room state on its own.
 - Dropped support for pre-3.5.0 game saves.
 - Increased the cap of simultaneously loaded scripts to 1024 (this includes all regular script modules, a single active dialog script, and a single active room script).
 - Engine no longer quits with error in case a script function assigned to a Room event is missing. Logs warnings about missing script functions assigned to any events.
 - Character.FollowCharacter() can now have a distance parameter up to 32766 (was limited to 255).
 - Ensure that Character.Speaking returns true when a speech is playing even if the character has no speech view.
 - Character.PlaceOnWalkableArea() now does a 1-pixel step scan, ensuring walkable area will be found regardless of how small it is. Optimized the search algorithm to keep it fast enough even in very large rooms.
 - Support voice-based lipsync (Pamela, Papagayo) with Lucas-Arts style speech.
 - DynamicSprite.CreateFromFile() may now load 1-bit and 4-bit bitmaps, converting to 8-bit.
 - Do not alter or clamp palette for 8-bit sprites loaded into a 16/32-bit game at runtime.
 - Assigning InventoryItem.Graphic will no longer reassign CursorGraphic too even if they were identical previously.
 - Calling DeleteSaveSlot() on a slot within 0-50 range will no longer secretly move a save with the topmost number (within the same range) to fill the emptied slot. If you still like to recreate this behavior, then use MoveSaveSlot() command.
 - Support calling StopDialog() inside any regular script and dialog script, and also while dialog options are displayed. That will schedule dialog's stop to be performed after current script finishes.
 - Removed arbitrary limit of 2k bytes for the result of String.Format().
 - Engine will no longer quit with error if any object is assigned a non-existing sprite, but continue, using a sprite 0 as a placeholder instead.
 - Ensure that the objects with identical z-order (baseline) always keep same relative sort order when being drawn (note: engine does not guarantee a predefined order, only a persistent one).
 - Implemented video buffering on a separate thread. Allow to drop late video frames.
 - When mouse is locked in window, confine its position to the game viewport; exclude black border.
 - Added "display" config option to "graphics" section. This is a 1-based display index, where 0 means "use default display".
 - Added new accessibility config settings in "access" section: "speechskip", "textskip", "textreadspeed". These let player to override game's skipping style for character speech and text messages, and text reading speed parameter that controls speech timing.
 - Added "max_save" config option in "override" section: this lets to enforce an arbitrary number of saves displayed in a standard save/restore dialogs in game.
 - Added "--display" command-line argument that lets choose which display to open game window on.
 - Added "--no-plugins" command-line argument that denies loading any plugins; also added respective config option "noplugins" in "override" section.
 - Fixed Software renderer being unable to restore a windowed mode on certain monitors, when switching from a real fullscreen mode.
 - Fixed character may get stuck inside a non-walkable area after Character.WalkStraight().
 - Fixed character may rarely finish walking on a non-walkable pixel.
 - Fixed calling Character.StopMoving() after AddWaypoint() succeeded a regular Walk() call with eWalkableAreas parameter will wrongfully teleport the character to the nearest walkable area, even though AddWaypoint is supposed to ignore walkable areas.
 - Fixed a number of region or hotspot's "Stand on hotspot" events may unexpectedly run after a blocking character's walk, even if character is no longer standing on that region/hotspot.
 - Fixed Lucas-Arts style character speech displaying offscreen if character is standing below the bottom of a room viewport.
 - Fixed calling Dialog.Start() inside a dialog script would create a nested "dialog state", which could eventually lead to internal mistakes and program stack overflow. Dialog.Start() will now schedule a proper dialog topic switch, equivalent to "goto-dialog" command.
 - Fixed displaying room masks with Debug command in legacy "upscale" mode.
 - Fixed a potential lockup that may occur when the engine is run from the editor, and is told to stop at a breakpoint.
 - Fixed 48khz OGG clips may have extra silence added to them in the end, causing "hiccups" when the sound playback is looped.

Engine Plugin API:
 - Updated few callback and function prototypes in order to make them 64-bit compatible (allow pass and receive pointers). This includes AGS_EngineOnEvent for AGSE_TRANSLATETEXT and render stage events, and CallGameScriptFunction which now lets pass a const char* argument.
 - Added IAGSEngine.CreateDynamicArray(), which lets plugins to create dynamic arrays.
 - Added IAGSEngine.GetDynamicArrayLength() and IAGSEngine.GetDynamicArraySize(), which tell the passed array object's number of elements, and total size in bytes respectively.
 - Added IAGSEngine.Log(), which lets plugins to print using engine's log system.

Compatibility:
 - Fixed loading of games made in AGS 2.55-56 which include plugins.
 - Fixed loading of rare games made with AGS 2.5 or higher, which contained deprecated "room animations" (animations themselves are currently not functional).
 - Fixed old rooms with rare x3 resolution not displaying correctly.
 - Fixed old pathfinder imprecision affecting few pre-3.0 games.
 - Allow pre-2.7 games to have RestartGame() command be followed and overridden by a NewRoom().
   This is necessary for some older games to be able to proceed.

Windows:
 - Windows version of AGS is now built with MSVS 2019 and higher.

WinSetup:
 - Redesigned winsetup into a tabbed dialog.
 - Added "Reset To Defaults" button that resets all options to values from the game's default config file.
 - Added "Display" selection, allows to select which display to open the game window on.
 - Added "Accessibility" settings for skipping speech and text messages, for text reading speed.
 - In "disabled" section of config "access_skipstyle" setting lets disable all options in setup related to the speech and text skipping.
#12
Engine Development / Coroutines in AGS
Mon 03/02/2025 13:52:02
I have recently rewrote a engine's script executor in the AGS 4 branch (see PR #2621). While the script format and basic execution remains exactly same, this rewrite changes the way the script execution state is handled. Among other things, it introduced an improved concept of "script thread". AGS had a sort of a "script thread" idea before, there has been 2 threads: normal one which run most script, and non-blocking one which run "repeatedly_execute_always". But this system was very limited, and not convenient to expand. The new system allows to do 2 following things relatively easily:

1. Create new (temporary) "script threads" dynamically. The "script thread" contains its own stack memory (for local variables) and callstack queue (for remembering nested function calls).
2. Saving script thread's state and restoring later. This means that the whole local state of a script's execution is saved at a current point, kept recorded for an undefined duration, and then later may be run from the same point again.

In my opinion this opens a potential for implementing coroutines in AGS. Coroutines are types of functions that can pause, then wait for something (either some event, or a external command) and resume.
I have spoken about my vision of what coroutine may be in AGS earlier here:
https://www.adventuregamestudio.co.uk/forums/editor-development/feature-request-behavior-of-hotspot-that-results-in-a-room-change/msg636665195/#msg636665195
But that was never meant to be a final plan, and when I think about this now I have doubts about few things.
Then I made a dirty experiment here:
https://www.adventuregamestudio.co.uk/forums/editor-development/feature-request-behavior-of-hotspot-that-results-in-a-room-change/msg636668451/#msg636668451
Again, this was merely a technical proof of concept, not a feature suggestion.

I'd like to open a proper conversation about how coroutines may be designed in AGS, both from the point of view of script syntax and internal implementation.

For the reference, following is technically possible to do with "script threads" now:
- script threads may be created anytime, and stored by the engine; they may be identified by something (whether string name or numeric index);
- script threads may be paused at any or almost any instruction in script, and resumed by the engine (resuming means simply that engine runs previously recorded script thread again);
- running a saved script thread may be done either by engine's updating the game (i.e. if there's a list of script threads which are checked on each game update), or by a direct command from a script.
- script threads may be cloned (copied and saved as a different thread object); idk if that is necessary, but it's possible.
- saving or cloning a script thread may be full or partial. For instance, we may record/copy only the latest nested function call and its local data, but ignore everything that preceded it.

What cannot be done:
- as far as I can tell, we cannot save script execution that have nested engine calls in them. What I mean is, suppose there's a engine function that can be run from the script, but also calls another script. Then you have an interleaved nested script and engine calls: engine -> script -> engine -> script -> ...
This kind of nested call was not possible before, it is possible now with the new executor system, but we won't be able to save such callstack nor restore it, because engine own functions cannot be restored by the script executor. I suppose there may be ways around it, but this seems too complicated, so perhaps not worth trying.
Then, perhaps the engine should not make such nested calls on the same script thread, but always create new temporary script thread whenever it has to run another script callback while being inside one script callback already (like what happens when it runs rep-exec-always, while being inside a Wait called by a script).

Above should be kept in mind when designing coroutines feature.


#13
AGS 3.6.1 - Patch 9
Full release number: 3.6.1.31


For Editor
Spoiler

For Android
Spoiler
NOTE: the Editor now includes Android build component letting you prepare your own games for Android
[close]

For Engine/Editor developers
Spoiler


Released: 14th January 2025

Previous stable version: AGS 3.6.0 P11 forum thread


This release is brought to you by:

- Alan v.Drake (fixes, improvements)
- Crimson Wizard
- Donovan Watteau (fixes)
- edmundito (iOS fixes)
- eri0o
- mausimus (Text Parser fixes)
- Walter Agazzi (fixes)



Summary

3.6.1 update focuses mainly on improving performance and usability of existing features, in both Editor and Engine.

The noteable addition to the Editor is a "Log Panel", which lets you read game logs right in the editor's window. "Goto definition" now works on game object script names and opens their respective panels. Room editor features better panning and zoom controls. Views allow to select and modify multiple frames at once.

In the engine, there's a significant improvement to script performance, which may make script-heavy games run 30-40% faster compared to AGS 3.6.0 (these were real test results on a certain game with 3D simulation). There's a big improvement to the speed of manipulating Overlays, and general speed improvement of graphics rendering primarily useful for high resolution games.

There are other fixes and improvements to various parts of the program too.
Please be sure to read "Upgrading to AGS 3.6.1" topic in the manual: https://adventuregamestudio.github.io/ags-manual/UpgradeTo361.html


Changes in the Patch 9:

Editor:
 - Fixed dragging an item to a folder in Project Explorer might cause that item to visibly appear in a wrong folder, if there are folders which name differ only in letter case.

Engine:
 - Fixed Character.Animate() could cause game to error reporting "invalid loop" if this character was idling at the time, and Character.LockView() was not called prior to Animate(). (This is a regression in 3.6.1)
 - Fixed inventory cursor hotspot (crosshair) not drawn properly over item sprites with alpha.

OSX:
 - Fixed location of global config file: was in game installation directory, now in "Library/Application Support/uk.co.adventuregamestudio".


Changes in the Patch 8:

Editor:
 - Fixed game cannot be loaded if its GameFileName setting is an empty string.
 - Fixed pressing Alt was not selecting Main Menu.
 - Fixed error occuring when trying to assign an image to the multiple selected View Frames if they have different initial images.
 - Fixed script preprocessor directive "#else" in the nested conditions.

Engine:
 - Made File.ReadStringBack() support reading back strings without null-terminator in the end
   (ReadStringBack() reads a string, which has its length prepended to the sequence of chars).
 - Improved graphic mode selection when game window is moved to a secondary monitor.
   Note that still not all graphic setups are reliable on secondary monitors, specifically "real fullscreen" mode may be behaving unexpectedly if you try to switch to it on non-primary display.
 - Fixed AudioChannel's Paused state is not saved when saving the game.
 - Fixed error in case a character was walking while being locked to a temporary View, and switched to a directional loop which does not exist in the locked view.
 - Fixed active item cursor's image may duplicate itself onto other cursors under certain conditions.
   (this is regression since 3.6.1 Patch 6)
 - Fixed Inventory Window in automatic mode not redrawing its contents immediately when player character changes.
 - Fixed ListBox.FillDirList() may add case-sensitive duplicates on platforms with case-sensitive filesystems.
 - Fixed room's fade-out effect playing while skipping a cutscene (it must skip instantly).
 - Fixed FadeOut or FadeIn not toggling screen state if they are inside a skipped cutscene. This could have resulted in screen not turning to black or not restored as expected if cutscene was skipped by player.
 - Fixed Wait() delay of value > 32k would be treated as infinite timeout.
 - Fixed Ctrl + Alt key combination not working (toggle mouse lock). This is a regression in 3.6.1.
 - Fixed game may fail loading on platforms with strict memory alignment (e.g. MIPS processors).

Compatibility:
 - Fixed SetCharacterViewEx() not treating "align" parameter according to old-style set of values.
 - Fixed SetTextOverlay() could cause internal mistakes leading to unexpected errors in game.
 - Fixed Wait() calls for pre-3.6.0 versions of Script API, where negative delay was treated as 0.

WinSetup:
 - Fixed setup not distinguishing "desktop resolution" and "native resolution" from explicit resolution sizes when saving or loading config. Made sure that it remembers exactly the choice that user made ("desktop", "game resolution" or explicit resolution size).
 - Fixed "native game resolution" not present in the list if it equals desktop resolution.
 - Fixed nearest resolution selection in case config requested a resolution equal to the native game's resolution, but that resolution was not among the supported ones.


Changes in the Patch 7:

Engine:
 - Hotfix mouse cursor not being drawn sometimes after changing rooms (regression in 3.6.1 P6).


Changes in the Patch 6:

Editor:
 - Fixed Ctrl+C and Ctrl+V not working in GUI editor.
 - Fixed sprite export and copying a sprite to clipboard operations were always exporting a 32-bit image, regardless of the actual sprite's color depth.
 - Fixed "Recreate spritefile" command was unintentionally converting any sprite to 32-bit if its source was not found, and it was taking existing image from the old spritefile.

Engine:
 - Fixed Software renderer could crash the game under some circumstances when the sprite cache's limit is exceeded (this is a regression in 3.6.1).
 - Fixed text-based lipsync's frame delay calculation: the existing formula was causing the delay value to "jump" back and forth with the slightest difference of speech text length, resulting in the speech lines of close length to be played with the notably different animation speeds.
 - Fixed drawing a 32-bit sprites on a 8-bit surface (e.g. a room mask), it was done wrong and was causing a memory corruption too.
 - Fixed drawing a room's walkable mask in script could cause errors during character walking if used colors exceeded walkable area number limit.
 - Fixed walk-behinds not drawn over characters and objects anymore (regardless of their baselines) after walk-behind mask was changed using drawing operations in script.
 - Fixed Game.SimulateKeyPress() not working in "old key-handling mode" (regression since 3.6.0).
 - Fixed script location is not reported in case of logical errors in engine's functions (regression since 3.6.0).

WinSetup:
 - Removed an obscure "Use 85 Hz display" option.


Changes in the Patch 5:

Editor:
 - When the room background size changes, clamp Room Edges to the new size.
 - Fixed Editor refusing to load a project if its folder name exceeds 40 characters.
   (An obsolete historical limitation which we forgot to cut from the program.)

Compiler:
 - Fixed script compilation hanging forever if a non-latin unicode character is met in script (outside of comments).

Engine:
 - Fixed GUI.ProcessClick() using mouse position when detecting a GUI control, instead of the position passed in the argument list.
 - Fixed Region.GetAtScreenXY() was returning null for offscreen coordinates. Made it return region[0] for consistency with other room areas, and backwards compatibility.
 - Fixed room Overlays not sorted in the order of their creation, like screen Overlays.
 - Fixed a potential mistake in Lucas-Arts speech position when there are multiple room viewports and speaking character is not directly visible in any of them.
 - Fixed Engine could switch program's locale to the current system locale by mistake when player is typing text. This could potentially lead to random glitches in text input in games which are run in ASCII mode and are handling extended characters.
 - Fixed TextBox was trying to display unsupported characters (in ASCII mode), resulting in random garbage.


Changes in the Patch 4:

Editor:
 - Fixed extracting templates with very large files inside would cause "Out of memory" error.
 - Fixed crash occuring when trying to import a non-existant GIF frame during Sprite Import.
 - Fixed potential mistake with sprite transparency occuring when importing a 8-bit sprite into 16/32-bit game.

Compiler:
 - Fixed "\t" (and few other less common escaped chars) not handled properly when they are inside string literals.
 - Fixed a crash in compiler occuring if user script defined a variadic function.
   (User-defined variadic functions are not properly usable at the moment, but this at least prevents an unhandled exception.)

Scripting:
 - Declare "UNICODE" macro for scripts if game is made in unicode mode.

Script API:
 - Added a number of missing OPT_* constants used with Get/SetGameOption functions.

Engine:
 - Fixed setting Screen.AutoSizeViewportOnRoomLoad to false in "game_start" could cause primary viewport and camera become initialized with zero width and height.
 - Fixed setting camera's size in "game_start" would unexpectedly get camera clamped to 320x200.
 - Fixed number of mistakes in Text Parser occuring when handling "multiwords".


Changes in the Patch 3:

Editor:
 - Fixed that after deleting a View's frame editor did not select next frame (regression in 3.6.1).
 - Fixed "Delete last loop" button not appearing in the View Editor if the view is filled using "Assign sprites to view" command from the Sprite Manager.

Engine:
 - Implemented an alternate solution for rendering "bad" TTF fonts that does not increase their loading times (after previous patch 2).
 - Allow scene render during "load room" event if the last room transition was "Instant".
   This has to be done because number of games used this event for custom transitions.
 - For games compiled in "Debug" mode "warnings.log" file will be written in "savegame dir" on platforms where modifying game directory is forbidden in principle (OSX, iOS, Android, Web).
 - Fixed System.Log() was registered for plugins using a wrong argument list.

Compatibility:
 - Fixed loading of 3.5.0 saves (broken in 3.6.1).

Windows:
 - Fixed disk space check was testing space in the current directory instead of the save game location.


Changes in the Patch 2:

Editor:
 - Fixed few potential program errors for "Generate Keystore" in Android preferences.
 - Fixed external processes (such as test game runs) were started using ShellExecute, which could theoretically lead to unintended results.

Engine:
 - Fixed String.Replace crashing the engine if the resulting string exceeds 3000 bytes.
 - Fixed releasing a mouse button could cause double "on_event" call (with eEventGUIMouseUp).
 - Improved rendering of TTF fonts which have glyph sizes surpassing declared font's height.
   This fixes the look of text on gui controls, and automatic outlining on these fonts.
 - Fixed a dialog shown with InputBox() function drawing typed text beyond text box'es border.
 - Fixed custom dialog options in the "old mode" not triggering redraw when the active option changes.


Changes in the Patch 1:

Editor:
- Fixed View's frame preview sometimes drawn incorrectly, in case of certain panel sizes.
- Fixed folding in the script editor not working correctly if there's a commented closing bracket ("//}") inside this code section.
- Fixed Editor sometimes failing to update game exe's file information and/or icons, if user was importing any sprites during this working session.

Engine:
- Fixed room objects not updating under Direct3D/OpenGL renderer, if they were assigned a dynamic sprite, then that sprite was deleted, and a new one assigned with coincidentally same ID.
- Fixed room objects not updating under Software renderer, if they were assigned a dynamic sprite, and that sprite was modified while object was not visible on screen.
- Fixed inventory cursor's crosshair not displayed (when enabled in game settings).



What is new in 3.6.1

Common features:
- Implemented Deflate compression option for sprites.
- Removed length limits for: Game name, savegame folder, Character's script name and regular name (description), Inventory item's name (description), Mouse cursor's script name, Audioclip's script name.

Editor:
- Discontinued Source control integration functionality, removed "Put sound and sprite files in source control" option from General Settings.
- In General Settings moved few properties to different groups for better consistency.
- Added "Scale Character sprite offsets" property to General Settings. This property refers to scaling of Character.z and sprite offsets added by LockViewOffset script command.
- Added TextureCacheSize and SoundCacheSize properties to Default Setup. These let configure the sizes of runtime texture and sound cache sizes respectively.
- Added "Leave room after fade-out" event to Rooms (called "Unload" by default).
- Added Translated property to all GUI Controls (was available only in ListBox). Translated property tells whether this control's text has to be translated, and applied text direction (in right-to-left text mode).
- Support '\n' linebreak character in the Label's Text and potentially other text properties.
- Improved Room Editor controls:
  Added free panning mode done by holding the middle mouse button, or alternatively - by holding Space + LMB.
  Mouse Wheel without key modifiers scrolls the room vertically; Shift + Mouse Wheel scrolls the room horizontally.
  Zoom is done by Ctrl + Mouse Wheel and room now zooms towards or outwards the cursor position.
- In Room Editor the context menu is now displayed by RMB or Shift + RMB while editing masks.
  The individual room mode menu is merged with the "copy coordinates" command when shown.
- In Room Editor the hint with coordinates is now also displayed when moving Objects or Characters with keyboard.
- In Dialog Script editor support most Edit menu and context menu commands from the regular Script editor, with a few exceptions.
- In Sprite Manager added command "View" -> "Show filenames" which toggles display of a sprite's source filename under the sprites.
- Adjust sprites' import settings after "Crop sprite edges" command; this would ensure that these sprites are restored from source file keeping their cropped sizes.
- During sprite export Editor will display a proper progress dialog.
- Zoom controls in Character and View panes now allow downscaling too. View editor displays the preview sprite stretched to fill the parent panel.
- View editor now allows to select multiple frames at once, across multiple loops too, using standard Shift + LMB and Ctrl + LMB combinations. Properties panel lets modify properties for all the selected frames at once.
- Added "Replace with all sprites from folder" command to the View editor's context menu.
- For Audio Clips in the project tree added "Force Reimport", "Force reimport all file(s)" and "Replace Source File" context menu commands.
- For Output Panel added "Copy selection" context menu command.
- Implemented Log Panel that lets you see the engine and game logs right in the Editor.
- Improved LipSync panel looks in case user's system has display scaling option enabled.
- "Goto Definition" command in script will now work for most of the game entities too, such as Characters, GUIs, and so forth. In that case it will find a game's entity and open a respective editor panel for it. This still does not work for some types, such as Room objects, and Views.
- Added main menu commands for opening a Project folder and Compiled folder.
- Added "Export Global Messages to script" menu command. This command is meant for upgraded pre-3.2 game projects, and will generate a script with a String array, moving global messages texts there.
- For script's tabs added a context menu command for opening this script's location.
- When run with "/compile" argument Editor will print all messages to the console (stdout), instead of displaying modal message windows.
- For Android build target Editor now supports a directory to place plugins in.
- When building a game for Android and Linux the Editor will now be more tolerant to missing plugins and only issue a warning instead of stopping with error.
- Config will now be saved in UTF-8, letting to support setup program's title text in unicode.
- For non-Windows build targets Editor will fix config containing Direct3D graphics driver option and set OpenGL instead.
- For Color Themes: implemented character literal, braces match and braces error settings.
- Made Editor be somewhat more tolerate to missing XML nodes in Game.agf, in many cases it will still let open a game.
- When upgrading older game projects, Editor will insert a call to SetRestartPoint() in the end of the 'game_start' function in GlobalScript.asc. This is done to complement removal of an automatic restart point in the engine. This inserted command is safe to remove.
- When upgrading pre-3.2 rooms with disabled SaveLoadEnabled property the Editor will reset this property and insert a comment with a warning into the corresponding room's script. This is done because this property is deprecated as is no longer accessible.
- Fixed Editor refusing to open a game if one of the translation files is missing.
- Fixed General Settings and Default Setup not working correctly right after importing a pre-3.* game project.
- Fixed importing GIFs or 8-bit PNGs may lose transparent pixels if source images used other palette index than 0 for transparency.
- Fixed Project Explorer's folders collapsing after certain user actions, such as dragging items or renaming things.
- Fixed deleting collapsed "region" in script would sometimes lead to portion of the script undeleted but staying invisible.
- (Possibly) Fixed a "Index out of range" exception in Script editor, related to the "script location" drop-down list, which could occur at random circumstances while
  working with the script, and any Color Theme is enabled.
- Fixed Editor could miss some of the files when cleaning up old compiled files after the Game's Filename property is changed.

Scripting:
- Support "#else" preprocessor directive.

Script API:
- Implemented Room's "After fade-out" event.
- Added eEventLeaveRoomAfterFadeout event for the global "on_event".
- Added eEventGameSaved event which runs after game was saved.
- Expanded interaction functions for Character, Object, InventoryItem, Hotspot and Region types: now they all receive respective object's pointer as a parameter, similar to GUI event functions, as well as a cursor mode this interaction was run with, if applicable.
- Added Game.ResetDoOnceOnly(), which completely resets all DoOnceOnly instances.
- Added Game.PrecacheSprite() and Game.PrecacheView(), which preload certain sprites and linked frame sounds into the engine's sprite cache memory.
- Added ScriptName property to AudioClip, Character, Dialog, GUI, GUIObject, Hotspot, InventoryItem, Object.
- Added static GetByName() function to AudioClip, Character, Dialog, GUI, GUIObject, Hotspot, InventoryItem, Object.
- Added Object.AnimationVolume property, which works similar to Character.AnimationVolume.
- Added static File.ResolvePath() and File.Path attribute.
- Added support for a text formatting to a number of functions: DisplayAtY(), Character.SayAt(), Character.SayBackground(), DrawingSurface.DrawStringWrapped().

Engine:
- Updated to SDL 2.28.5 and SDL_Sound 2.0.3+.
- Significant performance improvement to scripts. Script running speed restored to a level close to AGS 3.2.1. Testing few "script-heavy" games showed fps raise by up to 30-40% compared with 3.6.0 engine.
- Improved performance of String objects in script.
  For instance, appending a character to a String is now roughly x2 times faster, *sequential* iteration of String.Chars[] in Unicode mode is about x12 (!) times faster (Strings in ASCII mode have relatively less improvement, because they have been faster than Unicode mode already).
- Improved performance when creating, deleting and manipulating Overlays; allows the game to have thousands of those with much less slowing down.
- Improved performance when updating and deleting dynamic sprites, and notifying any objects that have to redraw themselves. Engine no longer resets Graphic properties of objects referencing deleted dynamic sprite to 0.
- Implemented "texture cache", in addition to the existing "sprite cache". The texture cache keeps textures generated from raw sprites and lets reusing them, improving performance and reducing CPU workload. The actual impact is proportional to the game's resolution and amount of simultaneously animated objects on screen.
- WFN font renderer now too supports unicode mode and renders texts in utf-8, so long as the font contains glyphs of corresponding indexes.
- Buttons, ListBoxes and TextBoxes now support Right-to-left text direction.
- DrawingSurface.DrawString now supports Right-to-left text direction.
- All the script File functions now treat paths in case-insensitive way (including subdirs), which makes them platform-independent.
- Removed an automatic SetRestartPoint() call at startup. This is done in case user does not want to use default "restart" save slot, or has a custom save system.
- Support handling multiple mouse clicks per game frame, similar to how multiple key presses were supported since 3.6.0.
- When starting up, engine will now precache only first 4 or 8 loops of the starting player character's View. This is done to avoid filling sprite cache with too much sprites at once in case when the player's View contains lots of additional animations.
- Characters will now have their graphic offsets, set by Character.z property and LockViewOffset() function, scaled along with the character's own scaling. This is done so long as the respective game option is enabled in the General Settings.
- Ensure that character and object scaling is updated even when the game is not drawn. This fixes rare issues when their scale property did not update in time whilst the game was completely fadeout, and similar cases.
- Allow to change Character's move speed while its moving.
- When Character is ordered a new move command while already moving, the engine will try to make a smooth transition between old and new moving without a delay.
- Ensure that when Overlays have identical ZOrder they will be sorted in the order of their creation. Besides convenience, this is also meant to restore historical behavior from before Overlay.ZOrder property was introduced.
- Allow game to call DynamicSprite.CreateFromDrawingSurface() and CreateFromBackground() with zero or negative size, clamping it to 1x1, in consistency with Create().
- Engine will now log a warning for the most incorrect parameters to Animate function instead of quitting the game.
- Engine will now skip blocking Character.Say commands instantly while skipping a cutscene.
- Object.SetView now lets invalid loop and frame values, and fallbacks to using loop 0, frame 0, printing a warning. This is also consistent with backwards-compatble SetObjectFrame() behavior.
- Changed Object.SetView() to not play a frame's sound, which could lead to a duplicated sound play if Object.Animate is run right after.
- Text Overlays internal images are now registered as dynamic sprites, and their IDs may be read from Overlay.Graphic. This lets find out their sizes using Game.SpriteWidth/SpriteHeight and optionally draw them somewhere using DrawingSurface.DrawImage.
- Ensure all the script API is now correctly available for the plugins.
- Engine will now safeguard plugin's reading and writing of game saves, so that any mistakes done by plugins won't affect other parts of a save.
- Engine will disable vsync in a "infinite fps" mode, because vsync prevents getting more fps.
- Engine will force any in-game debug messages to be displayed in message boxes, disregarding game's "Display all messages as speech" option.
- Display critical alerts as system modal messages on all platforms that support that (unless engine is run with "--no-message-box" parameter).
- Print some info about memory usage when reporting a "Out of memory" error.
- Deprecated in-game "console", as practically useless.
- Added new config settings in "graphics" section: "sprite_cache_size" (which replaces deprecated "cachemax" in "misc") and "texture_cache_size".
- Fixed Characters may be seemingly "walking in place" for some time when arriving at destination.
- Fixed Display and Say commands treating the second met "&" sign as a voice-over token too (they must only check the first one in string).
- Fixed PlayMP3File() function limiting filename argument by an arbitrary number of characters.
- Fixed speechlines were adjusting their Y position while trying to not overlap GUIs even when these GUIs are completely offscreen.
- Fixed first Sierra-style speechline in a sequence was adjusting its Y position without need when GUIs are set to be hidden during game pause (this includes blocking speech). Normally, the speechlines are adjusting their Y position in order to not overlap GUIs, but when GUIs are hiding during speech there should not be any need to do so.
- Fixed script behavior in case a local variable was assigned a value without being initialized with a zero memory by compiler's intruction beforehand. This is not a problem with the standard compiler, but technically could be an issue with any custom implementation.
- Fixed old-style letterbox viewport getting broken after loading an old pre-3.5.0 save.

Engine Plugin API:
- Added IAGSStream interface, IAGSEngine.OpenFileStream() and GetFileStreamByHandle().
- Added IAGSEngine.ResolveFilePath() method, which resolves a script path (with location tokens) into a proper system filepath.
- Fixed IAGSEngine.GetFontType() incorrectly reporting TTF font type for WFN fonts with more than 128 characters.

Compatibility:
- In Editor, restored all the Character's variables available in "backward-compatible" mode. This is primarily to make it easier to import very old games.
- Allow to run an animation over a loop with zero frames, by using the placeholder frame. This lets particular old games to continue running instead of crashing with error.
- Fixed slower character walking speeds in pre-3.1 upscaled and high-resolution games.
- Fixed Object.SetView() and SetObjectFrame() not treating -1 for loop and frame as "keep previous values" in older games.
- Fixed inventory window not updated after game.top_inv_item is assigned a new value.
- Fixed a "New Room" command in old-style dialog scripts was preventing "First time Enter room" event to be called.

Windows:
- 32-bit Windows engine is now built as "large address aware" program, which will allow it to use up to 3 GB of RAM on 32-bit systems and 4 GB of RAM on 64-bit systems (was 2 GB previously).

iOS:
- Updated port for 3.6.*.

Web / Emscripten:
- Fixed Safari cannot switch the game into fullscreen mode.

WinSetup:
- Added options for setting texture cache and sound cache size.
- Added options to disable particular graphic drivers and graphic driver selection, and fullscreen mode selection.




Thanks to everyone who contributed to and tested this version!



#14
There's again a case when I must other people for any ideas, because I am in doubts or might not be seeing a good solution.

AGS does support creating and loading sprites dynamically.
In the old versions of script API it also supported playing an external sound file: PlayMP3File function. Since the new audio API was introduced in v3.2, all the imported clips are registered as AudioClip object, and they return AudioChannel when run. But there was never a way to register one dynamically at runtime, and PlayMP3File became inconsistent with the rest.

Now, in AGS 4 we cut out lots of deprecated API, and PlayMP3File among them, but there's no substitution for it yet. There was an open feature suggestion to support playing external sound files in AGS 4. The simplest solution is to have another function like that, except it would return AudioChannel. But this solution has a problem, as external clips will still be outside the system, and things normally applied to AudioClips would not be applied to them.

Thus I thought that a better solution would be to support dynamically created AudioClip objects instead. Similar to how sprites are created as DynamicSprite.CreateFromFile, there would be AudioClip.CreateFromFile returning AudioClip* pointer, which you would have to store in your own variable.

This solution seems good, but there's a problem: normal AudioClips are stored in Game.AudioClips[] array, where Game.AudioClipCount is there number. And they have a numeric ID, which tells their index in this array. And these IDs are used in some cases to attach a clip to something else, like ViewFrame.
You see where this is going: that's just another case of AGS relying on numeric IDs...

If AudioClip is dynamic, then just like a dynamic sprite it may be deleted in any time. If it's deleted, its ID becomes unused. What happens to array in such case? In case of sprites, they are all kept on their places. So internal list of sprites contains gaps (well, it contains gaps also because you can import sprites under arbitrary number). We could do same for AudioClips too, but then it's not obvious what to do with AudioClipCount: is it going to be a real number of available audioclips, or a number of elements in array, where some elements may be gaps?...

It looks like this problem exists in multiple instances, like Rooms, which I've been discussing only recently.


I'd wish there was a consistent solution to this. It could be that AGS requires overhaul of object storage and cross-reference, that would be essential if we want to support dynamic creation of everything (gui, characters, etc). But that's a lot of work, and may be a separate future task. For now I'd like to find something suitable at least in the short term.


Here are the possible approaches that I see, and all of them have their downsides.

1. Do not add dynamic AudioClips to the main list, have them only referenced by user's pointer variables. This means that their IDs will have to be unused (-1?). That's the simplest dumb solution, but it's bad, because it creates a discrepancy between objects of same type but different origin (imported at design time vs loaded at runtime). Dynamic AudioClips won't be found when iterating AudioClips[] array, and they cannot be attached where script or engine expects a ID - such as ViewFrames.

2. Have dynamic AudioClips in the list, and shift the list when a clip is deleted to avoid gaps. This helps AudioClipCount property stay meaningful. But this breaks clip IDs, although technically could be worked around, but makes their reference by ID prone to mistakes.

3. Have dynamic AudioClips in the list, and replace with null pointer when they are deleted. The next loaded clip will be assigned the first available ID from the gap (that's how sprites work).
This keeps IDs intact. But AudioClipCount's meaning becomes dubious. Also users will have to test the list's elements for null when iterating, but only if they use dynamic clips in their game.

4. The variant of 3, replace deleted clips with a dummy AudioClip object that contains no data, and serves only to avoid null pointer errors. This *seems* safer at first, but there is now a problem of not being to test an element for validity, unless we introduce some way to distinguish this "dummy clip". So maybe it's actually going to be more confusing than helpful.



Does anyone have opinion over those? Or any other ideas?
#15
There was an old request to be able to access Room descriptions in script, and maybe number of rooms in game too.

I opened a PR for adding this to AGS 4.0:
https://github.com/adventuregamestudio/ags/pull/2626

But here's a issue: rooms are not sequential, and room list may have gaps in it.

Suppose I add following:
Code: ags
/// Gets the total number of the rooms in game.
static readonly attribute int Game.RoomCount;
/// Gets the room's name (description) by its index, returns null if such room does not exist.
static readonly attribute String Game.RoomNames[];

RoomCount returns the number of valid rooms in game.
If RoomNames[] is accessed by a room number, then it will have gaps in it.
If RoomNames[] will represent a sequence having only valid rooms, then you won't be able to tell which rooms are these.

If we leave the first variant, it will work easily to get a name for particular room by its number,
but it will make it more difficult to iterate,
and also RoomCount becomes ambiguous.

The only idea I had so far (besides leaving as it is), is to introduce a second array which stores numbers of valid rooms in a sequential array, like:
Code: ags
/// access sequentially 0 to RoomCount
static readonly attribute int Game.RoomNumbers[];

Then iterating over all valid rooms will be performed as:
Code: ags
for (int i = 0; i < Game.RoomCount; ++i)
{
     String name = Game.RoomNames[Game.RoomNumbers[i]];
}


What do you think?
#16
Engine Development / AGS engine Mac OS X port
Fri 20/12/2024 03:47:09
The old forum thread may still be found here. Please beware that it was started many years ago and may contain alot of outdated information.

This new thread is dedicated to discussing the Mac OSX port of AGS engine. Following is a brief cover of the topic.

NOTE: I used information provided by @eri0o in other forum threads to write the following, but I am not a Mac developer myself, so the instructions below may contain gaps or mistakes. If you notice anything wrong or missing, then please report that in comments.



AGS engine runs natively on 32-bit and 64-bit Mac OSX.
To run AGS games on Mac at the very least you need the Mac engine executable and a game data.

In general, there are two ways to prepare a game for Mac: a "proper" and "quick and dirty" ones.

A proper way is to create a Application Bundle: which is a package containing game data compiled by the editor (gamename.ags and any other custom files), engine executable, and additional files required by the Mac. The Bundle may also be signed and notarized. This is the way to officially distribute your game for Mac, whether commercially or for free.

A "quick and dirty" way may be used whenever you need a quick test of your game. This method requires simply a engine executable and game data files, placed together in a single folder. Running engine exe will make it look for a nearby game data, load and run it. The same method could be used to run virtually any game made in AGS, even if it was not released for Mac.

We discuss this in more detail further.



Building games for Mac OSX in the Editor

Unfortunately, at the time of writing this post, AGS Editor does not support preparing a Application Bundle for Mac. This may change in the future, in which case this section will be updated.

For now, you have to build your game normally, and then find the files located inside Compiled/Data folder. These are "raw game data" files, independent from any operating system. You should be using these when preparing a Mac package yourself.



Making a Application Bundle

Let's talk about the proper way of preparing your game for Mac, that is - creating Application Bundle.

In macOS, a bundle is a directory with a standard hierarchical structure that contains executable and resources.
Here's the Apple technical documentation regarding this:  Application Bundle. It may be not trivial to understand for a non-technical user at the first attempt, but I recommend getting acquainted with it nevertheless.

At minimum, your ags game application bundle will look like this:

Code: ags
📁 MyGame.app/
  📁 Contents/
      📜 Info.plist
      📁 MacOS/
        ☕ ags
      📁 Resources/
        📦 mygame.ags

At the top level we have a directory that has a name that ends in .app, e.g. "MyGame.app".
Below there's a subdirectory called Contents. This is where you place the bundle files, some of them in further subdirectories.

1. Info.plist

Info.plist - this is a runtime-configuration file called the "information property list". This file is a plain-text xml file, which contains information required for the Mac to handle your app bundle correctly.
You may find an example of this file in our engine repository:
https://github.com/adventuregamestudio/ags/blob/master/OSX/xcode/AGSKit/AGSKit/Info.plist
This file may be used as a template for the plist in your bundle.

If you look inside, you will see a series of <key> and <string> entries. These are like "property name" and "property value". You may edit values (inside <string> entry), but should not touch the "keys" unless you know what are you doing. You may also add more key/value entries if necessary.
Related Apple docs:
- Application Bundle
- About Info.plist Keys and Values


The most important entry there is CFBundleExecutable. You must enter the value for this entry, which is the plain name of the engine executable (without any paths). Usually that should be ags, for example:
Code: ags
<key>CFBundleExecutable</key>
<string>ags</string>

2. MacOS directory

This directory must contain the engine executable (called plainly "ags" or similar).

3. Resources

This directory must contain all the game resources: these are the files that you normally distribute as "AGS game" (except ".exe" file, of course): gamename.ags, audio.vox, speech.vox, acsetup.cfg, translation files, and so on. In the usual case you should just copy contents of Compiled/Data folder there.

Signing and Notarization

In theory you may skip this, but if you do then whenever a player tries to run your game, they would have to go through a number of steps to allow this game to run on their Mac computer. So ideally you should Sign and Notarize your game before distributing. You will need an Apple developer account for this.

Here's a Apple doc on this topic:
https://developer.apple.com/documentation/security/notarizing-macos-software-before-distribution

KNOWN ISSUES

If you have prepared the Application Bundle on Windows, there will be a problem that the engine executable will not be marked as "executable" for Mac, and won't be run. If that's the case, then you can fix it on Mac using "chmod" command from the terminal:

Code: bash
chmod +x ags

This mark can be then preserved if you distribute your bundle using archive type that keeps it: such as "dmg" or "tar.gz". There's also an information that Steam may take care of this, but this has to be double checked.



Getting the Mac engine

NOTE: this section is currently underway, we will need to gather more information on this.

There are obviously 3 ways you can get the AGS engine for Mac:
1. Build it yourself, from the source code in our repository. You shall have Mac computer with Xcode IDE installed for this. This is explained in this readme: https://github.com/adventuregamestudio/ags/blob/master/OSX/README.md
2. Get it from someone else who built it. Please note that the built executable will only be compatible with a certain range of OS versions.
3. We might provide the Mac port executable in our AGS releases, but if we do, then these likely will only be guaranteed to work on the recent versions of Mac OS.



Game-written paths and files

Following are the default locations of files created by the game:

User config: Users/<username>/Library/Application Support/GAMENAME/acsetup.cfg
Game saves: Users/<username>/Library/Application Support/GAMENAME/
Shared game files*: Users/<username>/Library/Application Support/uk.co.adventuregamestudio/GAMENAME/
Engine log location: Users/<username>/Library/Application Support/uk.co.adventuregamestudio/

* - shared game files are ones that are written in script using $APPDATADIR$ path token.

NOTES:
1. You, or players, may assign a different savegame location in game config, see these docs:
https://adventuregamestudio.github.io/ags-manual/DefaultSetup.html#environment
https://adventuregamestudio.github.io/ags-manual/EngineConfigFile.html#configuration-file-options
2. Because there's no analogue of WinSetup on Mac, the "user config" may only be written by the engine if you call System.SaveConfigToFile() in script.
#17
In 3.6.2 and 4.0.0 New Game Wizard displays a template's description under the list of game templates.

Without changing the overall dialog's height these controls look cramped:
Spoiler

[close]

IMHO it needs at least 1 more row for the list of templates, and increase the Description field maybe x1.5 in case the text is longer.

Unfortunately, it's not easy to do because of the first page that has this bitmap:



I'd like to find a way to redesign this wizard's intro page in such way that will let us increase the height at least once, or ideally - will make it easier for us to adjust its size in the future, if such need arises.
#18
AGS 3.6.1 - Patch 8
Full release number: 3.6.1.30


For Editor
Spoiler

For Android
Spoiler
NOTE: the Editor now includes Android build component letting you prepare your own games for Android
[close]

For Engine/Editor developers
Spoiler


Released: 17th November 2024

Previous stable version: AGS 3.6.0 P11 forum thread


This release is brought to you by:

- Alan v.Drake (fixes, improvements)
- Crimson Wizard
- Donovan Watteau (fixes)
- edmundito (iOS fixes)
- eri0o
- mausimus (Text Parser fixes)
- Walter Agazzi (fixes)



Summary

3.6.1 update focuses mainly on improving performance and usability of existing features, in both Editor and Engine.

The noteable addition to the Editor is a "Log Panel", which lets you read game logs right in the editor's window. "Goto definition" now works on game object script names and opens their respective panels. Room editor features better panning and zoom controls. Views allow to select and modify multiple frames at once.

In the engine, there's a significant improvement to script performance, which may make script-heavy games run 30-40% faster compared to AGS 3.6.0 (these were real test results on a certain game with 3D simulation). There's a big improvement to the speed of manipulating Overlays, and general speed improvement of graphics rendering primarily useful for high resolution games.

There are other fixes and improvements to various parts of the program too.
Please be sure to read "Upgrading to AGS 3.6.1" topic in the manual: https://adventuregamestudio.github.io/ags-manual/UpgradeTo361.html


Changes in the Patch 8:

Editor:
 - Fixed game cannot be loaded if its GameFileName setting is an empty string.
 - Fixed pressing Alt was not selecting Main Menu.
 - Fixed error occuring when trying to assign an image to the multiple selected View Frames if they have different initial images.
 - Fixed script preprocessor directive "#else" in the nested conditions.

Engine:
 - Made File.ReadStringBack() support reading back strings without null-terminator in the end
   (ReadStringBack() reads a string, which has its length prepended to the sequence of chars).
 - Improved graphic mode selection when game window is moved to a secondary monitor.
   Note that still not all graphic setups are reliable on secondary monitors, specifically "real fullscreen" mode may be behaving unexpectedly if you try to switch to it on non-primary display.
 - Fixed AudioChannel's Paused state is not saved when saving the game.
 - Fixed error in case a character was walking while being locked to a temporary View, and switched to a directional loop which does not exist in the locked view.
 - Fixed active item cursor's image may duplicate itself onto other cursors under certain conditions.
   (this is regression since 3.6.1 Patch 6)
 - Fixed Inventory Window in automatic mode not redrawing its contents immediately when player character changes.
 - Fixed ListBox.FillDirList() may add case-sensitive duplicates on platforms with case-sensitive filesystems.
 - Fixed room's fade-out effect playing while skipping a cutscene (it must skip instantly).
 - Fixed FadeOut or FadeIn not toggling screen state if they are inside a skipped cutscene. This could have resulted in screen not turning to black or not restored as expected if cutscene was skipped by player.
 - Fixed Wait() delay of value > 32k would be treated as infinite timeout.
 - Fixed Ctrl + Alt key combination not working (toggle mouse lock). This is a regression in 3.6.1.
 - Fixed game may fail loading on platforms with strict memory alignment (e.g. MIPS processors).

Compatibility:
 - Fixed SetCharacterViewEx() not treating "align" parameter according to old-style set of values.
 - Fixed SetTextOverlay() could cause internal mistakes leading to unexpected errors in game.
 - Fixed Wait() calls for pre-3.6.0 versions of Script API, where negative delay was treated as 0.

WinSetup:
 - Fixed setup not distinguishing "desktop resolution" and "native resolution" from explicit resolution sizes when saving or loading config. Made sure that it remembers exactly the choice that user made ("desktop", "game resolution" or explicit resolution size).
 - Fixed "native game resolution" not present in the list if it equals desktop resolution.
 - Fixed nearest resolution selection in case config requested a resolution equal to the native game's resolution, but that resolution was not among the supported ones.


Changes in the Patch 7:

Engine:
 - Hotfix mouse cursor not being drawn sometimes after changing rooms (regression in 3.6.1 P6).


Changes in the Patch 6:

Editor:
 - Fixed Ctrl+C and Ctrl+V not working in GUI editor.
 - Fixed sprite export and copying a sprite to clipboard operations were always exporting a 32-bit image, regardless of the actual sprite's color depth.
 - Fixed "Recreate spritefile" command was unintentionally converting any sprite to 32-bit if its source was not found, and it was taking existing image from the old spritefile.

Engine:
 - Fixed Software renderer could crash the game under some circumstances when the sprite cache's limit is exceeded (this is a regression in 3.6.1).
 - Fixed text-based lipsync's frame delay calculation: the existing formula was causing the delay value to "jump" back and forth with the slightest difference of speech text length, resulting in the speech lines of close length to be played with the notably different animation speeds.
 - Fixed drawing a 32-bit sprites on a 8-bit surface (e.g. a room mask), it was done wrong and was causing a memory corruption too.
 - Fixed drawing a room's walkable mask in script could cause errors during character walking if used colors exceeded walkable area number limit.
 - Fixed walk-behinds not drawn over characters and objects anymore (regardless of their baselines) after walk-behind mask was changed using drawing operations in script.
 - Fixed Game.SimulateKeyPress() not working in "old key-handling mode" (regression since 3.6.0).
 - Fixed script location is not reported in case of logical errors in engine's functions (regression since 3.6.0).

WinSetup:
 - Removed an obscure "Use 85 Hz display" option.


Changes in the Patch 5:

Editor:
 - When the room background size changes, clamp Room Edges to the new size.
 - Fixed Editor refusing to load a project if its folder name exceeds 40 characters.
   (An obsolete historical limitation which we forgot to cut from the program.)

Compiler:
 - Fixed script compilation hanging forever if a non-latin unicode character is met in script (outside of comments).

Engine:
 - Fixed GUI.ProcessClick() using mouse position when detecting a GUI control, instead of the position passed in the argument list.
 - Fixed Region.GetAtScreenXY() was returning null for offscreen coordinates. Made it return region[0] for consistency with other room areas, and backwards compatibility.
 - Fixed room Overlays not sorted in the order of their creation, like screen Overlays.
 - Fixed a potential mistake in Lucas-Arts speech position when there are multiple room viewports and speaking character is not directly visible in any of them.
 - Fixed Engine could switch program's locale to the current system locale by mistake when player is typing text. This could potentially lead to random glitches in text input in games which are run in ASCII mode and are handling extended characters.
 - Fixed TextBox was trying to display unsupported characters (in ASCII mode), resulting in random garbage.


Changes in the Patch 4:

Editor:
 - Fixed extracting templates with very large files inside would cause "Out of memory" error.
 - Fixed crash occuring when trying to import a non-existant GIF frame during Sprite Import.
 - Fixed potential mistake with sprite transparency occuring when importing a 8-bit sprite into 16/32-bit game.

Compiler:
 - Fixed "\t" (and few other less common escaped chars) not handled properly when they are inside string literals.
 - Fixed a crash in compiler occuring if user script defined a variadic function.
   (User-defined variadic functions are not properly usable at the moment, but this at least prevents an unhandled exception.)

Scripting:
 - Declare "UNICODE" macro for scripts if game is made in unicode mode.

Script API:
 - Added a number of missing OPT_* constants used with Get/SetGameOption functions.

Engine:
 - Fixed setting Screen.AutoSizeViewportOnRoomLoad to false in "game_start" could cause primary viewport and camera become initialized with zero width and height.
 - Fixed setting camera's size in "game_start" would unexpectedly get camera clamped to 320x200.
 - Fixed number of mistakes in Text Parser occuring when handling "multiwords".


Changes in the Patch 3:

Editor:
 - Fixed that after deleting a View's frame editor did not select next frame (regression in 3.6.1).
 - Fixed "Delete last loop" button not appearing in the View Editor if the view is filled using "Assign sprites to view" command from the Sprite Manager.

Engine:
 - Implemented an alternate solution for rendering "bad" TTF fonts that does not increase their loading times (after previous patch 2).
 - Allow scene render during "load room" event if the last room transition was "Instant".
   This has to be done because number of games used this event for custom transitions.
 - For games compiled in "Debug" mode "warnings.log" file will be written in "savegame dir" on platforms where modifying game directory is forbidden in principle (OSX, iOS, Android, Web).
 - Fixed System.Log() was registered for plugins using a wrong argument list.

Compatibility:
 - Fixed loading of 3.5.0 saves (broken in 3.6.1).

Windows:
 - Fixed disk space check was testing space in the current directory instead of the save game location.


Changes in the Patch 2:

Editor:
 - Fixed few potential program errors for "Generate Keystore" in Android preferences.
 - Fixed external processes (such as test game runs) were started using ShellExecute, which could theoretically lead to unintended results.

Engine:
 - Fixed String.Replace crashing the engine if the resulting string exceeds 3000 bytes.
 - Fixed releasing a mouse button could cause double "on_event" call (with eEventGUIMouseUp).
 - Improved rendering of TTF fonts which have glyph sizes surpassing declared font's height.
   This fixes the look of text on gui controls, and automatic outlining on these fonts.
 - Fixed a dialog shown with InputBox() function drawing typed text beyond text box'es border.
 - Fixed custom dialog options in the "old mode" not triggering redraw when the active option changes.


Changes in the Patch 1:

Editor:
- Fixed View's frame preview sometimes drawn incorrectly, in case of certain panel sizes.
- Fixed folding in the script editor not working correctly if there's a commented closing bracket ("//}") inside this code section.
- Fixed Editor sometimes failing to update game exe's file information and/or icons, if user was importing any sprites during this working session.

Engine:
- Fixed room objects not updating under Direct3D/OpenGL renderer, if they were assigned a dynamic sprite, then that sprite was deleted, and a new one assigned with coincidentally same ID.
- Fixed room objects not updating under Software renderer, if they were assigned a dynamic sprite, and that sprite was modified while object was not visible on screen.
- Fixed inventory cursor's crosshair not displayed (when enabled in game settings).



What is new in 3.6.1

Common features:
- Implemented Deflate compression option for sprites.
- Removed length limits for: Game name, savegame folder, Character's script name and regular name (description), Inventory item's name (description), Mouse cursor's script name, Audioclip's script name.

Editor:
- Discontinued Source control integration functionality, removed "Put sound and sprite files in source control" option from General Settings.
- In General Settings moved few properties to different groups for better consistency.
- Added "Scale Character sprite offsets" property to General Settings. This property refers to scaling of Character.z and sprite offsets added by LockViewOffset script command.
- Added TextureCacheSize and SoundCacheSize properties to Default Setup. These let configure the sizes of runtime texture and sound cache sizes respectively.
- Added "Leave room after fade-out" event to Rooms (called "Unload" by default).
- Added Translated property to all GUI Controls (was available only in ListBox). Translated property tells whether this control's text has to be translated, and applied text direction (in right-to-left text mode).
- Support '\n' linebreak character in the Label's Text and potentially other text properties.
- Improved Room Editor controls:
  Added free panning mode done by holding the middle mouse button, or alternatively - by holding Space + LMB.
  Mouse Wheel without key modifiers scrolls the room vertically; Shift + Mouse Wheel scrolls the room horizontally.
  Zoom is done by Ctrl + Mouse Wheel and room now zooms towards or outwards the cursor position.
- In Room Editor the context menu is now displayed by RMB or Shift + RMB while editing masks.
  The individual room mode menu is merged with the "copy coordinates" command when shown.
- In Room Editor the hint with coordinates is now also displayed when moving Objects or Characters with keyboard.
- In Dialog Script editor support most Edit menu and context menu commands from the regular Script editor, with a few exceptions.
- In Sprite Manager added command "View" -> "Show filenames" which toggles display of a sprite's source filename under the sprites.
- Adjust sprites' import settings after "Crop sprite edges" command; this would ensure that these sprites are restored from source file keeping their cropped sizes.
- During sprite export Editor will display a proper progress dialog.
- Zoom controls in Character and View panes now allow downscaling too. View editor displays the preview sprite stretched to fill the parent panel.
- View editor now allows to select multiple frames at once, across multiple loops too, using standard Shift + LMB and Ctrl + LMB combinations. Properties panel lets modify properties for all the selected frames at once.
- Added "Replace with all sprites from folder" command to the View editor's context menu.
- For Audio Clips in the project tree added "Force Reimport", "Force reimport all file(s)" and "Replace Source File" context menu commands.
- For Output Panel added "Copy selection" context menu command.
- Implemented Log Panel that lets you see the engine and game logs right in the Editor.
- Improved LipSync panel looks in case user's system has display scaling option enabled.
- "Goto Definition" command in script will now work for most of the game entities too, such as Characters, GUIs, and so forth. In that case it will find a game's entity and open a respective editor panel for it. This still does not work for some types, such as Room objects, and Views.
- Added main menu commands for opening a Project folder and Compiled folder.
- Added "Export Global Messages to script" menu command. This command is meant for upgraded pre-3.2 game projects, and will generate a script with a String array, moving global messages texts there.
- For script's tabs added a context menu command for opening this script's location.
- When run with "/compile" argument Editor will print all messages to the console (stdout), instead of displaying modal message windows.
- For Android build target Editor now supports a directory to place plugins in.
- When building a game for Android and Linux the Editor will now be more tolerant to missing plugins and only issue a warning instead of stopping with error.
- Config will now be saved in UTF-8, letting to support setup program's title text in unicode.
- For non-Windows build targets Editor will fix config containing Direct3D graphics driver option and set OpenGL instead.
- For Color Themes: implemented character literal, braces match and braces error settings.
- Made Editor be somewhat more tolerate to missing XML nodes in Game.agf, in many cases it will still let open a game.
- When upgrading older game projects, Editor will insert a call to SetRestartPoint() in the end of the 'game_start' function in GlobalScript.asc. This is done to complement removal of an automatic restart point in the engine. This inserted command is safe to remove.
- When upgrading pre-3.2 rooms with disabled SaveLoadEnabled property the Editor will reset this property and insert a comment with a warning into the corresponding room's script. This is done because this property is deprecated as is no longer accessible.
- Fixed Editor refusing to open a game if one of the translation files is missing.
- Fixed General Settings and Default Setup not working correctly right after importing a pre-3.* game project.
- Fixed importing GIFs or 8-bit PNGs may lose transparent pixels if source images used other palette index than 0 for transparency.
- Fixed Project Explorer's folders collapsing after certain user actions, such as dragging items or renaming things.
- Fixed deleting collapsed "region" in script would sometimes lead to portion of the script undeleted but staying invisible.
- (Possibly) Fixed a "Index out of range" exception in Script editor, related to the "script location" drop-down list, which could occur at random circumstances while
  working with the script, and any Color Theme is enabled.
- Fixed Editor could miss some of the files when cleaning up old compiled files after the Game's Filename property is changed.

Scripting:
- Support "#else" preprocessor directive.

Script API:
- Implemented Room's "After fade-out" event.
- Added eEventLeaveRoomAfterFadeout event for the global "on_event".
- Added eEventGameSaved event which runs after game was saved.
- Expanded interaction functions for Character, Object, InventoryItem, Hotspot and Region types: now they all receive respective object's pointer as a parameter, similar to GUI event functions, as well as a cursor mode this interaction was run with, if applicable.
- Added Game.ResetDoOnceOnly(), which completely resets all DoOnceOnly instances.
- Added Game.PrecacheSprite() and Game.PrecacheView(), which preload certain sprites and linked frame sounds into the engine's sprite cache memory.
- Added ScriptName property to AudioClip, Character, Dialog, GUI, GUIObject, Hotspot, InventoryItem, Object.
- Added static GetByName() function to AudioClip, Character, Dialog, GUI, GUIObject, Hotspot, InventoryItem, Object.
- Added Object.AnimationVolume property, which works similar to Character.AnimationVolume.
- Added static File.ResolvePath() and File.Path attribute.
- Added support for a text formatting to a number of functions: DisplayAtY(), Character.SayAt(), Character.SayBackground(), DrawingSurface.DrawStringWrapped().

Engine:
- Updated to SDL 2.28.5 and SDL_Sound 2.0.3+.
- Significant performance improvement to scripts. Script running speed restored to a level close to AGS 3.2.1. Testing few "script-heavy" games showed fps raise by up to 30-40% compared with 3.6.0 engine.
- Improved performance of String objects in script.
  For instance, appending a character to a String is now roughly x2 times faster, *sequential* iteration of String.Chars[] in Unicode mode is about x12 (!) times faster (Strings in ASCII mode have relatively less improvement, because they have been faster than Unicode mode already).
- Improved performance when creating, deleting and manipulating Overlays; allows the game to have thousands of those with much less slowing down.
- Improved performance when updating and deleting dynamic sprites, and notifying any objects that have to redraw themselves. Engine no longer resets Graphic properties of objects referencing deleted dynamic sprite to 0.
- Implemented "texture cache", in addition to the existing "sprite cache". The texture cache keeps textures generated from raw sprites and lets reusing them, improving performance and reducing CPU workload. The actual impact is proportional to the game's resolution and amount of simultaneously animated objects on screen.
- WFN font renderer now too supports unicode mode and renders texts in utf-8, so long as the font contains glyphs of corresponding indexes.
- Buttons, ListBoxes and TextBoxes now support Right-to-left text direction.
- DrawingSurface.DrawString now supports Right-to-left text direction.
- All the script File functions now treat paths in case-insensitive way (including subdirs), which makes them platform-independent.
- Removed an automatic SetRestartPoint() call at startup. This is done in case user does not want to use default "restart" save slot, or has a custom save system.
- Support handling multiple mouse clicks per game frame, similar to how multiple key presses were supported since 3.6.0.
- When starting up, engine will now precache only first 4 or 8 loops of the starting player character's View. This is done to avoid filling sprite cache with too much sprites at once in case when the player's View contains lots of additional animations.
- Characters will now have their graphic offsets, set by Character.z property and LockViewOffset() function, scaled along with the character's own scaling. This is done so long as the respective game option is enabled in the General Settings.
- Ensure that character and object scaling is updated even when the game is not drawn. This fixes rare issues when their scale property did not update in time whilst the game was completely fadeout, and similar cases.
- Allow to change Character's move speed while its moving.
- When Character is ordered a new move command while already moving, the engine will try to make a smooth transition between old and new moving without a delay.
- Ensure that when Overlays have identical ZOrder they will be sorted in the order of their creation. Besides convenience, this is also meant to restore historical behavior from before Overlay.ZOrder property was introduced.
- Allow game to call DynamicSprite.CreateFromDrawingSurface() and CreateFromBackground() with zero or negative size, clamping it to 1x1, in consistency with Create().
- Engine will now log a warning for the most incorrect parameters to Animate function instead of quitting the game.
- Engine will now skip blocking Character.Say commands instantly while skipping a cutscene.
- Object.SetView now lets invalid loop and frame values, and fallbacks to using loop 0, frame 0, printing a warning. This is also consistent with backwards-compatble SetObjectFrame() behavior.
- Changed Object.SetView() to not play a frame's sound, which could lead to a duplicated sound play if Object.Animate is run right after.
- Text Overlays internal images are now registered as dynamic sprites, and their IDs may be read from Overlay.Graphic. This lets find out their sizes using Game.SpriteWidth/SpriteHeight and optionally draw them somewhere using DrawingSurface.DrawImage.
- Ensure all the script API is now correctly available for the plugins.
- Engine will now safeguard plugin's reading and writing of game saves, so that any mistakes done by plugins won't affect other parts of a save.
- Engine will disable vsync in a "infinite fps" mode, because vsync prevents getting more fps.
- Engine will force any in-game debug messages to be displayed in message boxes, disregarding game's "Display all messages as speech" option.
- Display critical alerts as system modal messages on all platforms that support that (unless engine is run with "--no-message-box" parameter).
- Print some info about memory usage when reporting a "Out of memory" error.
- Deprecated in-game "console", as practically useless.
- Added new config settings in "graphics" section: "sprite_cache_size" (which replaces deprecated "cachemax" in "misc") and "texture_cache_size".
- Fixed Characters may be seemingly "walking in place" for some time when arriving at destination.
- Fixed Display and Say commands treating the second met "&" sign as a voice-over token too (they must only check the first one in string).
- Fixed PlayMP3File() function limiting filename argument by an arbitrary number of characters.
- Fixed speechlines were adjusting their Y position while trying to not overlap GUIs even when these GUIs are completely offscreen.
- Fixed first Sierra-style speechline in a sequence was adjusting its Y position without need when GUIs are set to be hidden during game pause (this includes blocking speech). Normally, the speechlines are adjusting their Y position in order to not overlap GUIs, but when GUIs are hiding during speech there should not be any need to do so.
- Fixed script behavior in case a local variable was assigned a value without being initialized with a zero memory by compiler's intruction beforehand. This is not a problem with the standard compiler, but technically could be an issue with any custom implementation.
- Fixed old-style letterbox viewport getting broken after loading an old pre-3.5.0 save.

Engine Plugin API:
- Added IAGSStream interface, IAGSEngine.OpenFileStream() and GetFileStreamByHandle().
- Added IAGSEngine.ResolveFilePath() method, which resolves a script path (with location tokens) into a proper system filepath.
- Fixed IAGSEngine.GetFontType() incorrectly reporting TTF font type for WFN fonts with more than 128 characters.

Compatibility:
- In Editor, restored all the Character's variables available in "backward-compatible" mode. This is primarily to make it easier to import very old games.
- Allow to run an animation over a loop with zero frames, by using the placeholder frame. This lets particular old games to continue running instead of crashing with error.
- Fixed slower character walking speeds in pre-3.1 upscaled and high-resolution games.
- Fixed Object.SetView() and SetObjectFrame() not treating -1 for loop and frame as "keep previous values" in older games.
- Fixed inventory window not updated after game.top_inv_item is assigned a new value.
- Fixed a "New Room" command in old-style dialog scripts was preventing "First time Enter room" event to be called.

Windows:
- 32-bit Windows engine is now built as "large address aware" program, which will allow it to use up to 3 GB of RAM on 32-bit systems and 4 GB of RAM on 64-bit systems (was 2 GB previously).

iOS:
- Updated port for 3.6.*.

Web / Emscripten:
- Fixed Safari cannot switch the game into fullscreen mode.

WinSetup:
- Added options for setting texture cache and sound cache size.
- Added options to disable particular graphic drivers and graphic driver selection, and fullscreen mode selection.




Thanks to everyone who contributed to and tested this version!



#19
AGS 3.6.2 - Beta 6
Full release number: 3.6.2.6

ACHTUNG!
This is a BETA version of AGS 3.6.2.
It's considered relatively stable but is not thoroughly tested yet and also may have planned additions.
Use at your own risk. Please back up any games before opening them in this version of AGS.
New settings in this version may make your project files unusable in previous versions after saving with this version.


For Editor
Spoiler

For Android
Spoiler
NOTE: the Editor now includes Android build component letting you prepare your own games for Android
[close]

For Engine/Editor developers
Spoiler


Released: 20th January 2025

Previous stable version: AGS 3.6.1 P9 forum thread


This release is brought to you by:

- Alan v.Drake (palette fix)
- Crimson Wizard
- edmundito (some fixes)
- eri0o
- rofl0r (couple of compatibility reports & fixes)


What is new in 3.6.2

3.6.2 is planned to be a second minor update to 3.6, focusing mostly on convenience of existing Editor and Engine features, and expanding existing script commands. There's however one bigger change: a support for loading saves from older versions of the game.

Common features:
 - Event handler function are now allowed to be located in any script module.
 - New naming rule for the voice clips: full char name, followed by a number, separated by a dot, e.g. "RogerTheGreat.1234.ogg". The old rule may be enabled again by a switch in "Backwards Compatibility" settings.

Editor:
 - In "Start New Game Wizard" game template selection now displays template's description right in the dialog.
 - "Game statistics" now have Ctrl + F2 shortcut instead of F2.
 - F2 can be used for starting editing names of items in the Project Tree (ones that support that) and folders in the Sprite Manager.
 - Added "Game Speed" property in General Settings.
 - Added "Use old-style voice clip naming rule" property in General Settings, it lets to select whether the game should expect old-style voice clip filenames (4-letter char name followed by number) or the new one (full char name, followed by a number, separated by a dot).
 - Property Grid now displays Custom Properties right in the main properties list for each item that supports them.
 - Added "WrapText", "TextPaddingHorizontal", "TextPaddingVertical" properties to GUI Button.
 - GUI Labels can select full range of Alignment values in their TextAlignment property.
 - Added "TurnWhenFacing" property to Characters.
 - Textual GUI controls can now select "Null Font" as their font: this will prevent any text to be drawn even if one is assigned, and make it have zero size (when it matters).
 - "Events" tab on the Properties Grid now has "ScriptModule" selection, which lets define in which module should the related script functions be generated and looked for. The GUI Controls use a ScriptModule set in their parent GUI, and Room events always has a fixed room script selected.
 - Added "Open Recent" submenu in the File menu.
 - Sync script editor's commands in Edit menu with the context menu.
 - Added "Toggle Line Comment" command to Edit menu for scripts.
 - More panes in the Editor are DPI-aware (rescale well with the system font scaling).
 - Editor tabs now display icons indicating their contents (may be disabled in Editor Preferences).
 - Room panel tabs now display room names.
 - Editor will now remember certain window states: "Sprite selector" window and splitter position, splitter position in "Sprite manager".
 - Support reordering folders in Project Explorer with drag & drop.
 - Support importing plain script files: ash, asc or both, - besides script modules (*.scm).
 - On "Color Finder" pane also display actual RGB values that the engine will use. They may be different from requested RGB, because historically engine limits drawing color's RGB precision to 16-bit.
 - Font's "SourceFilename" and "Font Size" properties now have buttons that let import another font file, or reimport same font with different size respectively, instead of clicking on a button on the preview window.
 - Global Variables panel now allows to declare arrays.
 - Added "Controls transparency" slider to GUI edit pane.
 - Copy, paste and delete commands now apply to all the selected GUI controls in GUI editor.
 - When pasting a copied GUI control, Locked property of a new control will be turned off.
 - Support editing group properties for selected GUI controls.
 - Added a multiline Text edit window for Button and Label controls, that may be called by Ctrl+E, from context menu, or by pressing "..." button of the Text property in the Properties grid.
 - Support reordering folders in Sprite Manager with drag & drop.
 - Support importing 32-bit BMP files of extended formats (this support is formal at the moment, and does not guarantee that any of the extended data will be interpreted).
 - Support importing indexed images which palettes contain translucent alpha as sprites with alpha.
 - Support importing 1-bit (monochrome) and 4-bit images as sprites, room backgrounds and masks (converted to 8-bit).
 - Support importing indexed PNGs as room backgrounds and masks.
 - Do not alter or clamp palette for 8-bit sprites imported in a 16/32-bit game.
 - Removed obsolete "Copy walkable area mask to regions" command from the Room editor.
 - Improved scrolling of drop-down lists in the Room's navigation bar: made scroll buttons larger, and support mouse wheel.
 - In Room Editor, during any area drawing mode Ctrl + LMB now works as area picker regardless of the currently selected tool.
 - Do not delete previously built game exe from Compiled/Windows folder when testing a game from the editor.
 - Editor will now report any missing script functions that are assigned to events, but not present in script, as warnings when compiling the game.
 - Editor will now report any script functions that *look like* event functions, but not assigned to corresponding events, as warnings when compiling the game.
 - Added "/maketemplate" command-line option that tells Editor to run, make template out of the said game, and quit.
 - Fixed Editor refusing to open a project if one or more of the sections are missing in the file.
 - Fixed dragging an item into the folder in Project Explorer could move it into a wrong folder if the folders have similar names only different in letter case.
 - Fixed importing indexed PNG as a sprite, previously Editor would mistakenly treat the source image as 32-bit.
 - Fixed importing 8-bit BMP sprites with no "Remap palette" and "Leave As Is" as a transparency option would still remap palette index 0 to the first found palette entry with Alpha 0, even if that's a filler entry not used by the image.
 - Fixed exporting room backgrounds was always writing a 32-bit image rather than using actual background's color depth.
 - Fixed Button getting resized to the image's size when user cancels different sprite assignment.
 - Fixed "Color Finder" and color properties were mapping a color number to RGB values with accuracy mistakes, resulting in slightly different values than the engine would use.
 - Fixed an unhandled exception occuring when rebuilding rooms if any script's header is missing.
 - Fixed a "unterminated string" error in Dialogs was not pointing to the actual error location.
 - Fixed double warning message when trying to close the Editor while a game test is running.
 - Fixed Editor may display a "save project" confirmation when run with "/compile" command-line parameter.

Scripting:
 - Dynamic arrays now have Length readonly property that returns their number of elements.
 - Support zero-length dynamic arrays. This may be useful if you need to have a dynamic array with no elements, but don't want to bother about checking a null pointer.

Script API:
 - Added eNullFont constant that lets assign or pass a "null font" to any property or function parameter which expects a font's ID. This "null font" will simply make any text not drawn and have no actual measurements (size, spacing, etc).
 - Added global events: eEventDialogStart, eEventDialogStop, eEventDialogRun, eEventDialogOptionsOpen, eEventDialogOptionsClose (these are handled in "on_event").
 - Events eEventGUIMouseDown and eEventGUIMouseUp now get additional parameters: mouse button, mouse x and y positions (relative to the exact GUI).
 - Expanded "on_mouse_click" callback, now supports two more parameters: click x,y coordinates.
 - Added RestoredSaveInfo struct which contains information about game save's contents,
 - Support "validate_restored_save" callback, which lets user to validate restored saves with mismatching data and request cancellation or continuation of restoring this save.
 - Added Button.WrapText, TextPaddingHorizontal, TextPaddingVertical.
 - Added Character.Following property that returns another Character that this one follows after.
 - Added Character.TurnWhenFacing property.
 - Added Character.MoveStraight() complementing WalkStraight().
 - Added DateTime.CreateFromDate() and CreateFromRawTime().
 - Added static Dialog.CurrentDialog property and non-static ExecutedOption and AreOptionsDisplayed properties.
 - Added RenderLayer enum, and optional "layers" parameter to DynamicSprite.CreateFromScreenShot(), that tells which of the game's render layers to capture when making a screenshot.
 - Added File.Copy() and File.Rename().
 - Added FileSortStyle and SortDirection enum, and File.GetFiles() function that returns a dynamic array of filenames found using certain pattern, and optionally sorted by name or time, in ascending or descending order.
 - Added File.GetFileTime() that returns file's modification time.
 - Added Added File.ReadFloat(), WriteFloat(), ReadRawFloat(), WriteRawFloat(), ReadRawBytes() and WriteRawBytes().
 - Added SaveGameSortStyle enum and Game.GetSaveSlots() function that returns a dynamic array of save slot indexes, optionally sorted in certain way.
 - Added Game.GetSaveSlotTime() that returns a time this save slot was last written.
 - Added Game.ScanSaveSlots() that scans a range of game saves and tests them for compatibility, using "validate_restored_save" too if it's present in user script. This action is not run immediately, but is scheduled to be executed after current script ends. It reports of scanning completion by sending eEventSavesScanComplete event.
 - Label.TextAlignment has now type Alignment, rather than HorizontalAlignment, and has full alignment range (both horizontal and vertical).
 - Added optional "fileSortStyle" and "sortDirection" parameters to ListBox.FillDirList().
 - Added optional save slot range (min/max), saveSortStyle and sortDirection parameters to ListBox.FillSaveGameList(). This lets to define the exact range of saves it should fill, and order them in desired way.
 - Added ListBox.FillSaveGameSlots(), which initializes a list of saves from a dynamic array of save slot indexes.
 - Added Object.DestinationX and DestinationY properties, complementing ones in Character.
 - Added Overlay.SetPosition() and SetSize() functions for convenience.
 - Added Speech.SpeakingCharacter that returns currently speaking character (for blocking speech).
 - Added GetTimerPos() that returns timer's position (remaining time), in ticks.
 - Added CopySaveSlot() and MoveSaveSlot(), which moves existing save to another slot.
 - Added optional save slot range (min/max) parameters to RestoreGameDialog() and SaveGameDialog().
 - Added optional "sprite" parameter to SaveGameSlot(), that lets to pass a number of an arbitrary sprite to write into this save instead of a standard "screenshot".
 - Added SendEvent() function that allows to trigger "on_event" function calls in script. Special event value eEventUserEvent may be used as a base index for user-defined events.
 - Added System.DisplayFPS property that toggles FPS counter (a replacement to Debug(4, 1)).
 - Added System.GetEngineInteger() and System.GetEngineString() for returning diagnostic information about engine's runtime state. Possible arguments are defined by EngineValueID enum.
 - Added new game-wide option OPT_SAVEGAMESCREENSHOTLAYER that lets to define which of the game's render layers will be captured when making a standard screenshot for the save game.
 - Add SaveComponentSelection enum and game option OPT_SAVECOMPONENTSIGNORE, which lets to skip certain components when saving or restoring a game. This has dual purpose: reduce number of things in game that may break older saves by simply not having them in a save, and also reducing the size of game saves on disk (e.g. in case of dynamic sprites). Note that all things that were not restored from the save will retain their *current state*.
 - Fixed some script functions in AGS API were declared with "int" return value, while they are supposed to be "void".

Engine:
 - Updated to SDL 2.30.11 and SDL_Sound 2.0.4.
 - Engine now potentially supports reading saves made in older game versions with different content, so long as these saves have *less* data in any given type (i.e. less Characters, or less controls on a certain GUI, or less variables in script, and so forth).
   This feature is enabled by having a special "validate_restored_save" function anywhere in the game script, that accepts an argument of type RestoredSaveInfo. RestoredSaveInfo contains various information about the restored save, and "Cancel" property, that must be explicitly set to "false" in script in order to allow to restore such save.
 - Engine supports returning to previously saved rooms which have less script data.
   It's important to remember though that it does no validation of restored room state on its own.
 - Dropped support for pre-3.5.0 game saves.
 - Increased the cap of simultaneously loaded scripts to 1024 (this includes all regular script modules, a single active dialog script, and a single active room script).
 - Engine no longer quits with error in case a script function assigned to a Room event is missing. Logs warnings about missing script functions assigned to any events.
 - Character.FollowCharacter() can now have a distance parameter up to 32766 (was limited to 255).
 - Ensure that Character.Speaking returns true when a speech is playing even if the character has no speech view.
 - DynamicSprite.CreateFromFile() may now load 1-bit and 4-bit bitmaps, converting to 8-bit.
 - Do not alter or clamp palette for 8-bit sprites loaded into a 16/32-bit game at runtime.
 - Assigning InventoryItem.Graphic will no longer reassign CursorGraphic too even if they were identical previously.
 - Calling DeleteSaveSlot() on a slot within 0-50 range will no longer secretly move a save with the topmost number (within the same range) to fill the emptied slot. If you still like to recreate this behavior, then use MoveSaveSlot() command.
 - Support calling StopDialog() inside any regular script and dialog script, and also while dialog options are displayed. That will schedule dialog's stop to be performed after current script finishes.
 - Removed arbitrary limit of 2k bytes for the result of String.Format().
 - Ensure that the objects with identical z-order (baseline) always keep same relative sort order when being drawn (note: engine does not guarantee predefined order, only determenistic one).
 - Implemented video buffering on a separate thread. Allow to drop late video frames.
 - Added new accessibility config settings in "access" section: "speechskip", "textskip", "textreadspeed". These let player to override game's skipping style for character speech and text messages, and text reading speed parameter that controls speech timing.
 - Added "max_save" config option in "override" section: this lets to enforce an arbitrary number of saves displayed in a standard save/restore dialogs in game.
 - Added "--no-plugins" command-line argument that denies loading any plugins; also added respective config option "noplugins" in "override" section.
 - Fixed character may get stuck inside a non-walkable area after Character.WalkStraight().
 - Fixed calling Dialog.Start() inside a dialog script would create a nested "dialog state", which could eventually lead to internal mistakes and program stack overflow. Dialog.Start() will now schedule a proper dialog topic switch, equivalent to "goto-dialog" command.
 - Fixed calling Character.Animate() during idling state could cause incorrect error, reporting invalid animation loop.
 - Fixed inventory cursor's crosshair hotspot was drawn incorrectly if active item's sprite has a alpha channel.
 - Fixed displaying room masks with Debug command in legacy "upscale" mode.
 - Fixed a potential lockup that may occur when the engine is run from the editor, and is told to stop at a breakpoint.
 - Fixed 48khz OGG clips may have extra silence added to them in the end, causing "hickups" when the sound playback is looped.

Engine Plugin API:
 - Added IAGSEngine.CreateDynamicArray(), which lets plugins to create dynamic arrays.
 - Added IAGSEngine.GetDynamicArrayLength() and IAGSEngine.GetDynamicArraySize(), which tell the passed array object's number of elements, and total size in bytes respectively.
 - Added IAGSEngine.Log(), which lets plugins to print using engine's log system.

Compatibility:
 - Fixed loading of games made in AGS 2.55-56 which include plugins.
 - Fixed loading of rare games made with AGS 2.5 or higher, which contained deprecated "room animations" (animations themselves are currently not functional).
 - Fixed old pathfinder imprecision affecting few pre-3.0 games.
 - Allow pre-2.7 games to have RestartGame() command be followed and overridden by a NewRoom(). This is necessary for some older games to be able to proceed.

Windows:
 - Windows version of AGS is now built with MSVS 2019 and higher.

WinSetup:
 - Redesigned winsetup into a tabbed dialog.
 - Added "Reset To Defaults" button that resets all options to values from the game's default config file.
 - Added "Accessibility" settings for skipping speech and text messages, for text reading speed.
 - In "disabled" section of config "access_skipstyle" setting lets disable all options in setup related to the speech and text skipping.
#20
AGS 3.6.1 - Patch 7
Full release number: 3.6.1.29


For Editor
Spoiler

For Android
Spoiler
NOTE: the Editor now includes Android build component letting you prepare your own games for Android
[close]

For Engine/Editor developers
Spoiler


Released: 23th September 2024

Previous stable version: AGS 3.6.0 P11 forum thread


This release is brought to you by:

- Alan v.Drake (fixes, improvements)
- Crimson Wizard
- edmundito (iOS fixes)
- eri0o
- mausimus (Text Parser fixes)
- Walter Agazzi (fixes)



Summary

3.6.1 update focuses mainly on improving performance and usability of existing features, in both Editor and Engine.

The noteable addition to the Editor is a "Log Panel", which lets you read game logs right in the editor's window. "Goto definition" now works on game object script names and opens their respective panels. Room editor features better panning and zoom controls. Views allow to select and modify multiple frames at once.

In the engine, there's a significant improvement to script performance, which may make script-heavy games run 30-40% faster compared to AGS 3.6.0 (these were real test results on a certain game with 3D simulation). There's a big improvement to the speed of manipulating Overlays, and general speed improvement of graphics rendering primarily useful for high resolution games.

There are other fixes and improvements to various parts of the program too.
Please be sure to read "Upgrading to AGS 3.6.1" topic in the manual: https://adventuregamestudio.github.io/ags-manual/UpgradeTo361.html


Changes in the Patch 7:

Engine:
 - Hotfix mouse cursor not being drawn sometimes after changing rooms (regression in 3.6.1 P6).


Changes in the Patch 6:

Editor:
 - Fixed Ctrl+C and Ctrl+V not working in GUI editor.
 - Fixed sprite export and copying a sprite to clipboard operations were always exporting a 32-bit image, regardless of the actual sprite's color depth.
 - Fixed "Recreate spritefile" command was unintentionally converting any sprite to 32-bit if its source was not found, and it was taking existing image from the old spritefile.

Engine:
 - Fixed Software renderer could crash the game under some circumstances when the sprite cache's limit is exceeded (this is a regression in 3.6.1).
 - Fixed text-based lipsync's frame delay calculation: the existing formula was causing the delay value to "jump" back and forth with the slightest difference of speech text length, resulting in the speech lines of close length to be played with the notably different animation speeds.
 - Fixed drawing a 32-bit sprites on a 8-bit surface (e.g. a room mask), it was done wrong and was causing a memory corruption too.
 - Fixed drawing a room's walkable mask in script could cause errors during character walking if used colors exceeded walkable area number limit.
 - Fixed walk-behinds not drawn over characters and objects anymore (regardless of their baselines) after walk-behind mask was changed using drawing operations in script.
 - Fixed Game.SimulateKeyPress() not working in "old key-handling mode" (regression since 3.6.0).
 - Fixed script location is not reported in case of logical errors in engine's functions (regression since 3.6.0).

WinSetup:
 - Removed an obscure "Use 85 Hz display" option.


Changes in the Patch 5:

Editor:
 - When the room background size changes, clamp Room Edges to the new size.
 - Fixed Editor refusing to load a project if its folder name exceeds 40 characters.
   (An obsolete historical limitation which we forgot to cut from the program.)

Compiler:
 - Fixed script compilation hanging forever if a non-latin unicode character is met in script (outside of comments).

Engine:
 - Fixed GUI.ProcessClick() using mouse position when detecting a GUI control, instead of the position passed in the argument list.
 - Fixed Region.GetAtScreenXY() was returning null for offscreen coordinates. Made it return region[0] for consistency with other room areas, and backwards compatibility.
 - Fixed room Overlays not sorted in the order of their creation, like screen Overlays.
 - Fixed a potential mistake in Lucas-Arts speech position when there are multiple room viewports and speaking character is not directly visible in any of them.
 - Fixed Engine could switch program's locale to the current system locale by mistake when player is typing text. This could potentially lead to random glitches in text input in games which are run in ASCII mode and are handling extended characters.
 - Fixed TextBox was trying to display unsupported characters (in ASCII mode), resulting in random garbage.


Changes in the Patch 4:

Editor:
 - Fixed extracting templates with very large files inside would cause "Out of memory" error.
 - Fixed crash occuring when trying to import a non-existant GIF frame during Sprite Import.
 - Fixed potential mistake with sprite transparency occuring when importing a 8-bit sprite into 16/32-bit game.

Compiler:
 - Fixed "\t" (and few other less common escaped chars) not handled properly when they are inside string literals.
 - Fixed a crash in compiler occuring if user script defined a variadic function.
   (User-defined variadic functions are not properly usable at the moment, but this at least prevents an unhandled exception.)

Scripting:
 - Declare "UNICODE" macro for scripts if game is made in unicode mode.

Script API:
 - Added a number of missing OPT_* constants used with Get/SetGameOption functions.

Engine:
 - Fixed setting Screen.AutoSizeViewportOnRoomLoad to false in "game_start" could cause primary viewport and camera become initialized with zero width and height.
 - Fixed setting camera's size in "game_start" would unexpectedly get camera clamped to 320x200.
 - Fixed number of mistakes in Text Parser occuring when handling "multiwords".


Changes in the Patch 3:

Editor:
 - Fixed that after deleting a View's frame editor did not select next frame (regression in 3.6.1).
 - Fixed "Delete last loop" button not appearing in the View Editor if the view is filled using "Assign sprites to view" command from the Sprite Manager.

Engine:
 - Implemented an alternate solution for rendering "bad" TTF fonts that does not increase their loading times (after previous patch 2).
 - Allow scene render during "load room" event if the last room transition was "Instant".
   This has to be done because number of games used this event for custom transitions.
 - For games compiled in "Debug" mode "warnings.log" file will be written in "savegame dir" on platforms where modifying game directory is forbidden in principle (OSX, iOS, Android, Web).
 - Fixed System.Log() was registered for plugins using a wrong argument list.

Compatibility:
 - Fixed loading of 3.5.0 saves (broken in 3.6.1).

Windows:
 - Fixed disk space check was testing space in the current directory instead of the save game location.


Changes in the Patch 2:

Editor:
 - Fixed few potential program errors for "Generate Keystore" in Android preferences.
 - Fixed external processes (such as test game runs) were started using ShellExecute, which could theoretically lead to unintended results.

Engine:
 - Fixed String.Replace crashing the engine if the resulting string exceeds 3000 bytes.
 - Fixed releasing a mouse button could cause double "on_event" call (with eEventGUIMouseUp).
 - Improved rendering of TTF fonts which have glyph sizes surpassing declared font's height.
   This fixes the look of text on gui controls, and automatic outlining on these fonts.
 - Fixed a dialog shown with InputBox() function drawing typed text beyond text box'es border.
 - Fixed custom dialog options in the "old mode" not triggering redraw when the active option changes.


Changes in the Patch 1:

Editor:
- Fixed View's frame preview sometimes drawn incorrectly, in case of certain panel sizes.
- Fixed folding in the script editor not working correctly if there's a commented closing bracket ("//}") inside this code section.
- Fixed Editor sometimes failing to update game exe's file information and/or icons, if user was importing any sprites during this working session.

Engine:
- Fixed room objects not updating under Direct3D/OpenGL renderer, if they were assigned a dynamic sprite, then that sprite was deleted, and a new one assigned with coincidentally same ID.
- Fixed room objects not updating under Software renderer, if they were assigned a dynamic sprite, and that sprite was modified while object was not visible on screen.
- Fixed inventory cursor's crosshair not displayed (when enabled in game settings).



What is new in 3.6.1

Common features:
- Implemented Deflate compression option for sprites.
- Removed length limits for: Game name, savegame folder, Character's script name and regular name (description), Inventory item's name (description), Mouse cursor's script name, Audioclip's script name.

Editor:
- Discontinued Source control integration functionality, removed "Put sound and sprite files in source control" option from General Settings.
- In General Settings moved few properties to different groups for better consistency.
- Added "Scale Character sprite offsets" property to General Settings. This property refers to scaling of Character.z and sprite offsets added by LockViewOffset script command.
- Added TextureCacheSize and SoundCacheSize properties to Default Setup. These let configure the sizes of runtime texture and sound cache sizes respectively.
- Added "Leave room after fade-out" event to Rooms (called "Unload" by default).
- Added Translated property to all GUI Controls (was available only in ListBox). Translated property tells whether this control's text has to be translated, and applied text direction (in right-to-left text mode).
- Support '\n' linebreak character in the Label's Text and potentially other text properties.
- Improved Room Editor controls:
  Added free panning mode done by holding the middle mouse button, or alternatively - by holding Space + LMB.
  Mouse Wheel without key modifiers scrolls the room vertically; Shift + Mouse Wheel scrolls the room horizontally.
  Zoom is done by Ctrl + Mouse Wheel and room now zooms towards or outwards the cursor position.
- In Room Editor the context menu is now displayed by RMB or Shift + RMB while editing masks.
  The individual room mode menu is merged with the "copy coordinates" command when shown.
- In Room Editor the hint with coordinates is now also displayed when moving Objects or Characters with keyboard.
- In Dialog Script editor support most Edit menu and context menu commands from the regular Script editor, with a few exceptions.
- In Sprite Manager added command "View" -> "Show filenames" which toggles display of a sprite's source filename under the sprites.
- Adjust sprites' import settings after "Crop sprite edges" command; this would ensure that these sprites are restored from source file keeping their cropped sizes.
- During sprite export Editor will display a proper progress dialog.
- Zoom controls in Character and View panes now allow downscaling too. View editor displays the preview sprite stretched to fill the parent panel.
- View editor now allows to select multiple frames at once, across multiple loops too, using standard Shift + LMB and Ctrl + LMB combinations. Properties panel lets modify properties for all the selected frames at once.
- Added "Replace with all sprites from folder" command to the View editor's context menu.
- For Audio Clips in the project tree added "Force Reimport", "Force reimport all file(s)" and "Replace Source File" context menu commands.
- For Output Panel added "Copy selection" context menu command.
- Implemented Log Panel that lets you see the engine and game logs right in the Editor.
- Improved LipSync panel looks in case user's system has display scaling option enabled.
- "Goto Definition" command in script will now work for most of the game entities too, such as Characters, GUIs, and so forth. In that case it will find a game's entity and open a respective editor panel for it. This still does not work for some types, such as Room objects, and Views.
- Added main menu commands for opening a Project folder and Compiled folder.
- Added "Export Global Messages to script" menu command. This command is meant for upgraded pre-3.2 game projects, and will generate a script with a String array, moving global messages texts there.
- For script's tabs added a context menu command for opening this script's location.
- When run with "/compile" argument Editor will print all messages to the console (stdout), instead of displaying modal message windows.
- For Android build target Editor now supports a directory to place plugins in.
- When building a game for Android and Linux the Editor will now be more tolerant to missing plugins and only issue a warning instead of stopping with error.
- Config will now be saved in UTF-8, letting to support setup program's title text in unicode.
- For non-Windows build targets Editor will fix config containing Direct3D graphics driver option and set OpenGL instead.
- For Color Themes: implemented character literal, braces match and braces error settings.
- Made Editor be somewhat more tolerate to missing XML nodes in Game.agf, in many cases it will still let open a game.
- When upgrading older game projects, Editor will insert a call to SetRestartPoint() in the end of the 'game_start' function in GlobalScript.asc. This is done to complement removal of an automatic restart point in the engine. This inserted command is safe to remove.
- When upgrading pre-3.2 rooms with disabled SaveLoadEnabled property the Editor will reset this property and insert a comment with a warning into the corresponding room's script. This is done because this property is deprecated as is no longer accessible.
- Fixed Editor refusing to open a game if one of the translation files is missing.
- Fixed General Settings and Default Setup not working correctly right after importing a pre-3.* game project.
- Fixed importing GIFs or 8-bit PNGs may lose transparent pixels if source images used other palette index than 0 for transparency.
- Fixed Project Explorer's folders collapsing after certain user actions, such as dragging items or renaming things.
- Fixed deleting collapsed "region" in script would sometimes lead to portion of the script undeleted but staying invisible.
- (Possibly) Fixed a "Index out of range" exception in Script editor, related to the "script location" drop-down list, which could occur at random circumstances while
  working with the script, and any Color Theme is enabled.
- Fixed Editor could miss some of the files when cleaning up old compiled files after the Game's Filename property is changed.

Scripting:
- Support "#else" preprocessor directive.

Script API:
- Implemented Room's "After fade-out" event.
- Added eEventLeaveRoomAfterFadeout event for the global "on_event".
- Added eEventGameSaved event which runs after game was saved.
- Expanded interaction functions for Character, Object, InventoryItem, Hotspot and Region types: now they all receive respective object's pointer as a parameter, similar to GUI event functions, as well as a cursor mode this interaction was run with, if applicable.
- Added Game.ResetDoOnceOnly(), which completely resets all DoOnceOnly instances.
- Added Game.PrecacheSprite() and Game.PrecacheView(), which preload certain sprites and linked frame sounds into the engine's sprite cache memory.
- Added ScriptName property to AudioClip, Character, Dialog, GUI, GUIObject, Hotspot, InventoryItem, Object.
- Added static GetByName() function to AudioClip, Character, Dialog, GUI, GUIObject, Hotspot, InventoryItem, Object.
- Added Object.AnimationVolume property, which works similar to Character.AnimationVolume.
- Added static File.ResolvePath() and File.Path attribute.
- Added support for a text formatting to a number of functions: DisplayAtY(), Character.SayAt(), Character.SayBackground(), DrawingSurface.DrawStringWrapped().

Engine:
- Updated to SDL 2.28.5 and SDL_Sound 2.0.3+.
- Significant performance improvement to scripts. Script running speed restored to a level close to AGS 3.2.1. Testing few "script-heavy" games showed fps raise by up to 30-40% compared with 3.6.0 engine.
- Improved performance of String objects in script.
  For instance, appending a character to a String is now roughly x2 times faster, *sequential* iteration of String.Chars[] in Unicode mode is about x12 (!) times faster (Strings in ASCII mode have relatively less improvement, because they have been faster than Unicode mode already).
- Improved performance when creating, deleting and manipulating Overlays; allows the game to have thousands of those with much less slowing down.
- Improved performance when updating and deleting dynamic sprites, and notifying any objects that have to redraw themselves. Engine no longer resets Graphic properties of objects referencing deleted dynamic sprite to 0.
- Implemented "texture cache", in addition to the existing "sprite cache". The texture cache keeps textures generated from raw sprites and lets reusing them, improving performance and reducing CPU workload. The actual impact is proportional to the game's resolution and amount of simultaneously animated objects on screen.
- WFN font renderer now too supports unicode mode and renders texts in utf-8, so long as the font contains glyphs of corresponding indexes.
- Buttons, ListBoxes and TextBoxes now support Right-to-left text direction.
- DrawingSurface.DrawString now supports Right-to-left text direction.
- All the script File functions now treat paths in case-insensitive way (including subdirs), which makes them platform-independent.
- Removed an automatic SetRestartPoint() call at startup. This is done in case user does not want to use default "restart" save slot, or has a custom save system.
- Support handling multiple mouse clicks per game frame, similar to how multiple key presses were supported since 3.6.0.
- When starting up, engine will now precache only first 4 or 8 loops of the starting player character's View. This is done to avoid filling sprite cache with too much sprites at once in case when the player's View contains lots of additional animations.
- Characters will now have their graphic offsets, set by Character.z property and LockViewOffset() function, scaled along with the character's own scaling. This is done so long as the respective game option is enabled in the General Settings.
- Ensure that character and object scaling is updated even when the game is not drawn. This fixes rare issues when their scale property did not update in time whilst the game was completely fadeout, and similar cases.
- Allow to change Character's move speed while its moving.
- When Character is ordered a new move command while already moving, the engine will try to make a smooth transition between old and new moving without a delay.
- Ensure that when Overlays have identical ZOrder they will be sorted in the order of their creation. Besides convenience, this is also meant to restore historical behavior from before Overlay.ZOrder property was introduced.
- Allow game to call DynamicSprite.CreateFromDrawingSurface() and CreateFromBackground() with zero or negative size, clamping it to 1x1, in consistency with Create().
- Engine will now log a warning for the most incorrect parameters to Animate function instead of quitting the game.
- Engine will now skip blocking Character.Say commands instantly while skipping a cutscene.
- Object.SetView now lets invalid loop and frame values, and fallbacks to using loop 0, frame 0, printing a warning. This is also consistent with backwards-compatble SetObjectFrame() behavior.
- Changed Object.SetView() to not play a frame's sound, which could lead to a duplicated sound play if Object.Animate is run right after.
- Text Overlays internal images are now registered as dynamic sprites, and their IDs may be read from Overlay.Graphic. This lets find out their sizes using Game.SpriteWidth/SpriteHeight and optionally draw them somewhere using DrawingSurface.DrawImage.
- Ensure all the script API is now correctly available for the plugins.
- Engine will now safeguard plugin's reading and writing of game saves, so that any mistakes done by plugins won't affect other parts of a save.
- Engine will disable vsync in a "infinite fps" mode, because vsync prevents getting more fps.
- Engine will force any in-game debug messages to be displayed in message boxes, disregarding game's "Display all messages as speech" option.
- Display critical alerts as system modal messages on all platforms that support that (unless engine is run with "--no-message-box" parameter).
- Print some info about memory usage when reporting a "Out of memory" error.
- Deprecated in-game "console", as practically useless.
- Added new config settings in "graphics" section: "sprite_cache_size" (which replaces deprecated "cachemax" in "misc") and "texture_cache_size".
- Fixed Characters may be seemingly "walking in place" for some time when arriving at destination.
- Fixed Display and Say commands treating the second met "&" sign as a voice-over token too (they must only check the first one in string).
- Fixed PlayMP3File() function limiting filename argument by an arbitrary number of characters.
- Fixed speechlines were adjusting their Y position while trying to not overlap GUIs even when these GUIs are completely offscreen.
- Fixed first Sierra-style speechline in a sequence was adjusting its Y position without need when GUIs are set to be hidden during game pause (this includes blocking speech). Normally, the speechlines are adjusting their Y position in order to not overlap GUIs, but when GUIs are hiding during speech there should not be any need to do so.
- Fixed script behavior in case a local variable was assigned a value without being initialized with a zero memory by compiler's intruction beforehand. This is not a problem with the standard compiler, but technically could be an issue with any custom implementation.
- Fixed old-style letterbox viewport getting broken after loading an old pre-3.5.0 save.

Engine Plugin API:
- Added IAGSStream interface, IAGSEngine.OpenFileStream() and GetFileStreamByHandle().
- Added IAGSEngine.ResolveFilePath() method, which resolves a script path (with location tokens) into a proper system filepath.
- Fixed IAGSEngine.GetFontType() incorrectly reporting TTF font type for WFN fonts with more than 128 characters.

Compatibility:
- In Editor, restored all the Character's variables available in "backward-compatible" mode. This is primarily to make it easier to import very old games.
- Allow to run an animation over a loop with zero frames, by using the placeholder frame. This lets particular old games to continue running instead of crashing with error.
- Fixed slower character walking speeds in pre-3.1 upscaled and high-resolution games.
- Fixed Object.SetView() and SetObjectFrame() not treating -1 for loop and frame as "keep previous values" in older games.
- Fixed inventory window not updated after game.top_inv_item is assigned a new value.
- Fixed a "New Room" command in old-style dialog scripts was preventing "First time Enter room" event to be called.

Windows:
- 32-bit Windows engine is now built as "large address aware" program, which will allow it to use up to 3 GB of RAM on 32-bit systems and 4 GB of RAM on 64-bit systems (was 2 GB previously).

iOS:
- Updated port for 3.6.*.

Web / Emscripten:
- Fixed Safari cannot switch the game into fullscreen mode.

WinSetup:
- Added options for setting texture cache and sound cache size.
- Added options to disable particular graphic drivers and graphic driver selection, and fullscreen mode selection.




Thanks to everyone who contributed to and tested this version!



SMF spam blocked by CleanTalk