AGS 3.6.2

Started by Crimson Wizard, Sat 17/05/2025 21:18:09

Previous topic - Next topic

Crimson Wizard

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.

blexx

Amazing. Thank you! What are your plans for AGS 3.x.x? I guess from now on there will only be bugfixes and you are focusing on version 4? Or will version 3 continue to receive major updates?

Crimson Wizard

Quote from: blexx on Sun 18/05/2025 12:10:45What are your plans for AGS 3.x.x? I guess from now on there will only be bugfixes and you are focusing on version 4? Or will version 3 continue to receive major updates?

Yes, the plan currently is to focus on AGS 4.

lafouine88

Thanks for the new release!!

I just have one quick question, on my rebuilt version of the game, the characters' speech are displaced to the far right of the screen for some reason. Is there some new option that has changed and I haven't seen?

3-6-10" border="0

Thanks and good job to all of you

Crimson Wizard

Quote from: lafouine88 on Sun 25/05/2025 11:41:39I just have one quick question, on my rebuilt version of the game, the characters' speech are displaced to the far right of the screen for some reason. Is there some new option that has changed and I haven't seen?

No, there are no new options, and even if there were, AGS is supposed to keep old behavior when upgrading an older game.

I need to know how this speech was supposed to look like before, and how it's done in script.

Crimson Wizard

In regards to the above problem, I got a PM from lafouine88 with more screenshots, it did not answer all the questions I had, but gave me an idea that this may be related to how GUIs are positioned on screen, and AGS trying to adjust the speech position because of GUI. Possibly something was broken in that logic. Unfortunately I was not able to reproduce this so far, it may require very specific combination of GUIs on screen. I'll keep looking.

lafouine88

Here is the post :


So there were no big tricks. The character uses "normal sprites" and I just go "player.say("..."). For test purposes I did that using function On_KeyPress() with nothing else than "player.say("...");" The sprites are 256*256 for my character but much lower for the others, and the problem goes for each one.
sam" border="0

One interesting thing thought is that, when I use player.saybackground() the speech is centered like so:
samback" border="0

I also tried creating a new character, with different views but the issue remains:
newsam" border="0

My map is a big one so I tried walking to the far right to see if maybe the speech was displayed in a specific place, but no. Even when I walk to the right edge of the map the text displays on the right of the screen.
I was previously on 3.6.2.6 with the walkpath correction (sometimes the character would get out from walkable area and be placed back on it automatically) and it worked normally.

About GUI's I have many on screen. All lifebars buttons etc. plus one that I just use for tests which is the yellow,red,blue,green and black lines to the right. I tried deactivating this one plus some others that could have interfered. But none of them seem to be the cause.

I'll try some more things tonight and let you know if I find something. Still, this whole thing is pretty weird, especially if I'm the only one getting this problem^^



Crimson Wizard

Quote from: lafouine88 on Mon 26/05/2025 09:40:15About GUI's I have many on screen. All lifebars buttons etc. plus one that I just use for tests which is the yellow,red,blue,green and black lines to the right. I tried deactivating this one plus some others that could have interfered. But none of them seem to be the cause.

I'll try some more things tonight and let you know if I find something. Still, this whole thing is pretty weird, especially if I'm the only one getting this problem^^

If you could PM me the compiled game, then I would run this under debugger and see what's engine is doing there.

Crimson Wizard

#8
@lafouine88 I confirmed that this is because AGS is trying to move the speech position away from GUIs, but the logic there is a strange mess and has unexpected results.

In 3.6.2 I have corrected one weird condition that was only meant to work in 320x200 games, making it work similar in any resolution. Apparently, this affects your game now.

I will need to rethink the rules of this adjustment and fix this.

lafouine88

Ok that's noted.
Since I have dozens of GUI's and my whole thing is a huge mess, I understand that the things gets buggy^^
Should I try to isolate the problematic GUI or is it the combination of many that is a problem? Or should I just get back to my previous version until the next patch?

Thanks a lot for your work :)

Crimson Wizard

I did not mean that your game is a mess, it's the engine is a mess in some places.

The GUI that is causing this is a fullscreen GUI called "gInterface". I noticed that it's in users habit to create fullscreen transparent GUIs with only couple of items on them on the edge. Unfortunately, engine cannot detect that its made of transparent pixels, so it thinks that it covers whole screen. It has a rule which makes it ignore such GUIs when adjusting speech text, and that rule got somehow broken in this release.

Anyway, it turned out that the mistake was just a math error.
The fixed build may be downloaded here:
https://cirrus-ci.com/task/6198851733815296
(it may be ready in 10-20 minutes after i posted this)


Crimson Wizard

#11
Sorry, I screwed up something in the build server, ordered a new build while the previous was not ready yet. There will be a new build after a while here:
https://cirrus-ci.com/task/5264716513148928

Crimson Wizard

Here's an updated temporary build with all accumulated fixes so far:
https://cirrus-ci.com/task/5506729732997120

Following bugs fixed:
- Pressing Enter on Text Parser panel while no item is selected was causing an exception.
- Engine crashing if SpeechView has no loops.
- Speech displaying in a wrong place if there's a transparent GUI covering whole screen.
- Pink pixels appearing around sprites when the sprite anti-aliasing setting is on.
- Engine crashing if Character.DestinationX/Y is read while character is turning on spot after a call to FaceDirection.
- Dialog options with empty names are still displayed (as empty lines) and can be selected.



I will wait for a small while before releasing a first patch to 3.6.2, in case more regressions are found.


RootBound

I posted this on discord this week but will mention it here too:

I found an "illegal exception" bug. This happened when I made a mistake in my code and used "%s" instead of "%c" when formatting a string to use String.Chars[]. The line that caused the error was inside a "for" statement, and looked like this:
Code: ags
String value = String.Format("%s", otherString.Chars[i]);

Changing %s to %c stops the error, but I assume there ought to simply be some kind of error message here that stops compilation of the game instead of a crash.
They/them. Here are some of my games:

Kiszonka

Thanks for your hard work! :)

I moved from from 3.6.2.6 beta to 3.6.2.10, and since upgrading I've been experiencing an issue regarding characters walking.
When a character hits an edge of a walkable area, they sometimes teleport to a seemingly random location (sometimes more than 300px away).

It happens in more than one room in my game and I can repro this about 10%-20% of the time by hitting a specific corner in a specific room (image attached - teleport happens when walking from right to left).

Mask resolution of the room is 1:4.


Crimson Wizard

#15
Quote from: Kiszonka on Sun 01/06/2025 12:26:22I moved from from 3.6.2.6 beta to 3.6.2.10, and since upgrading I've been experiencing an issue regarding characters walking.
When a character hits an edge of a walkable area, they sometimes teleport to a seemingly random location (sometimes more than 300px away).

It happens in more than one room in my game and I can repro this about 10%-20% of the time by hitting a specific corner in a specific room (image attached - teleport happens when walking from right to left).

Mask resolution of the room is 1:4.

Hello.

In order to diagnose the problem I will need a walkable area (could you export the walkable mask and upload somewhere?), and an example of walking order that results in this problem: starting and target coordinates.

Out of curiosity, why do you use 1:4 mask resolution? We've only have it in AGS as a formality, I have not heard anyone using this before (old games used 1:2 sometimes for performance reasons, and today people just use 1:1 most of the time).

Crimson Wizard

#16
Quote from: RootBound on Sun 01/06/2025 10:10:12I posted this on discord this week but will mention it here too:

I am not available on discord at all times, and there's no guarantee that the bug reports will be noticed if posted in tech support chat, for instance, because nor me nor other developers read all of it consistently. It's best to post bug reports on forums or in our github issue tracker.

Quote from: RootBound on Sun 01/06/2025 10:10:12I found an "illegal exception" bug. This happened when I made a mistake in my code and used "%s" instead of "%c" when formatting a string to use String.Chars[]. The line that caused the error was inside a "for" statement, and looked like this:
Code: ags
String value = String.Format("%s", otherString.Chars[i]);

Changing %s to %c stops the error, but I assume there ought to simply be some kind of error message here that stops compilation of the game instead of a crash.

Added argument test into the engine. This may prevent crashes in majority of cases, but does not give a 100% guarantee. Because of how AGS script is compiled it's not always possible to know the value type for certain, and not possible at all when it is returned by a plugin's script function.

Opened a feature suggestion about implementing string format parsing in the compiler:
https://github.com/adventuregamestudio/ags/issues/2739

Kiszonka

Quote from: Crimson Wizard on Sun 01/06/2025 13:20:06
Quote from: Kiszonka on Sun 01/06/2025 12:26:22I moved from from 3.6.2.6 beta to 3.6.2.10, and since upgrading I've been experiencing an issue regarding characters walking.
When a character hits an edge of a walkable area, they sometimes teleport to a seemingly random location (sometimes more than 300px away).

It happens in more than one room in my game and I can repro this about 10%-20% of the time by hitting a specific corner in a specific room (image attached - teleport happens when walking from right to left).

Mask resolution of the room is 1:4.

Hello.

In order to diagnose the problem I will need a walkable area (could you export the walkable mask and upload somewhere?), and an example of walking order that results in this problem: starting and target coordinates.

Out of curiosity, why do you use 1:4 mask resolution? We've only have it in AGS as a formality, I have not heard anyone using this before (old games used 1:2 sometimes for performance reasons, and today people just use 1:1 most of the time).

Hello! Thank you for your time.

I was able to reproduce this issue in an empty project using the BASS template, using my custom character (attached below).

Sadly I was not able to automate this behaviour, which got me to wonder whether it's related to calling Walk() while the character is already walking somewhere, as a player normally does when walking through a longer area.

I did record some of the walk targets and positions of the player at the time of the bug taking place, but using these same values in code didn't result in the bug occurring. Apologies I can't provide starting and target coordinates.

The bug normally occurs when walking past the curved area and can occur when walking in either direction - I noticed it more commonly when walking right to left.

I uploaded the empty project with just the room and the character if you'd like to use it:
https://drive.google.com/drive/folders/1wtCmUpi3qFBgDCYcupLwKUoJLgEy7Inx?usp=drive_link

Or if you prefer here are just the exported character and the walkable area mask:
https://drive.google.com/drive/folders/1ux_qqHvlbNPPqCyEFnUOtW4m1K7I76zH?usp=drive_link

The room's info:
Background size: 1640x360
Mask resolution 1:4

Game's info:
Template: BASS
Resolution: 640x360

As for why I use 1:4 mask resolution - habit to pick the most performant option when less performant options don't seem to bring significant benefits (though characters snag a bit as they walk in some areas, so maybe it would be smart to up the resolution). I wasn't aware most modern AGS games use higher mask resolutions. My project is also a pixely game so precision didn't seem necessary at the time of making this room.
1:4 also makes it a bit easier to fill hotspots and walkable areas in the editor :)

Crimson Wizard

@Kiszonka this appears to be a mistake in PlaceOnWalkableArea. This function is run whenever a character ends up on a non-walkable area after walking (because of pathfinder imperfection), and idea is that it jumps a pixel to the nearest area.

I suspect that there may be a coordinate conversion mistake somewhere.

The easy way to reproduce the issue is this:
Code: ags
function on_key_press(eKeyCode k)
{
  if (k == eKeySpace)
  {
    Point* p = Screen.ScreenToRoomPoint(mouse.x, mouse.y);
    player.x = p.x;
    player.y = p.y;
  }
  else if (k == eKeyW)
  {
    player.PlaceOnWalkableArea();
  }
}

This puts a character on any place in room with Space key, and orders to move it to the nearest walkable area with W.

Crimson Wizard

Alright, here's a AGS build with this problem fixed up:
https://cirrus-ci.com/task/5954940373303296

this fix will also be included into the first 3.6.2 patch (when it's released).

SMF spam blocked by CleanTalk