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

Messages - Crimson Wizard

#1162
AGS 3.6.1 - Patch 5
Full release number: 3.6.1.27


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 August 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 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!



#1163
I've made a draft of the solution described above,
may be found in this branch:
https://github.com/ivan-mogilko/ags-refactoring/tree/draft--upgradesaves

At first I wanted to let load both saves with less and more data, but implemented only loading saves with less for now. Skipping extra bits is simply annoying to code, so I'll leave this for the time when this functionality is fleshed out enough.

The problem of resetting un-restored data is solved very simply. It is strange how i did not figure this out back when I tried this for the first time. AGS already has an ability to "reload game"; this is used for example in RunAGSGame function. So, when engine detects that the save has less data, it cancels loading this save, reloads game, and then loads save again, now knowing that the game was "reset".
This way all data which was not loaded from a save gets reset to the default state.



From the scripting perspective, there's a new callback and a new struct:

Code: ags
enum RestoredSaveResult
{
  eRestoredSave_ClearData   = 0x01,
  eRestoredSave_MissingData = 0x08,
  eRestoredSave_ExtraData   = 0x10
};


managed struct RestoredSaveInfo
{
  bool         Cancel;
  readonly RestoredSaveResult Result;
  readonly int AudioClipTypeCount;
  readonly int CharacterCount;
  readonly int DialogCount;
  readonly int GUICount;
  readonly int InventoryItemCount;
  readonly int CursorCount;
  readonly int ViewCount;
  readonly int GlobalScriptDataSize;
  readonly int ScriptModuleCount;
  readonly int RoomScriptDataSize;

  import int[] GetGUIControlCounts();
  import int[] GetViewLoopCounts();
  import int[] GetViewFrameCounts();
  import int[] GetScriptDataSizes();

};

struct RestoredSaveInfo contains some info about how the restoration went in Result field, and then numbers of all the objects found in save, and sizes of script data (variables).

Notice the "Cancel" field, it's the only writeable field in this struct, and user may set it to true or false in a script callback. The value of this field is read back by the engine after the callback has finished. If it's set to "true", the engine will quit the game with error message stating that the save is mismatching the game.

The callback is optional and is defined as:
Code: ags
function validate_restored_save(RestoredSaveInfo* saveInfo)
{
  // check saveInfo and decide what to do
}

Here user may script a "compatible" or "incompatible" save detection, and set the saveInfo.Cancel field.

The Cancel field will default to false if no mismatches were found, and to true if there are mismatches. This is done in case this callback is not present in script: in that case the engine will always fail.


EDIT:

I might add that a user does not have to "Cancel" the save with default error message. It's possible to handle this in a custom way, let save to restore, and then display error in game in a more pretty way.
#1164
I think you need to open your cursor in the editor and set its "StandardMode" property to "True".
#1165
Quote from: eri0o on Sat 03/08/2024 04:33:54- Allegro remaining internals that are still in the engine actually uses a 63 color palette, so that is the actual maximum number of colors (this has been lifted to all 255 colors in AGS 4).

That is a misunderstanding. Palette is not limited to 63 colors, it has full 256 colors.
What is limited is color precision. Instead of having all 256 variants of R, G and B, it supports only 64 variants, with gaps in between, so you cannot have, for example, Red values 0,1,2,3,4,5,6 etc, but will effectively have them clamped to 0,4,8,12 etc.
In theory, this has been fixed in AGS 4.


As for 32-bit color games, the equivalent for these are shaders, but AGS does not support user-defined shaders at the moment.
#1166
This may be done by having a darkness area painted on a object or overlay with black or dark grey color, and making such overlay translucent (using Transparency property), and placing it with higher baseline/zorder than the rest of things in the room.

Then anything passing under such overlay would get partially darkened.
#1167
Well, particular functions may be added a non-blocking variants (by accepting BlockingStyle argument), at least in theory. FadeIn/Out is one such case.
#1168
Quote from: lapsking on Thu 01/08/2024 12:47:48Thanks for your reply Crimson. The problem is I'm terrible at mathematics, unlike you guys. I'm more of a visual person and I prefer to draw hotspots by hand. That's the main reason I was attracted to AGS engine in first place, because of it's friendly interface.

Well, this may be done with a "visual" method too, if you create a custom mask from a sprite. This allows to have as many "things" as there are unique colors.

But this is a topic for technical help forums.
#1169
Quote from: lapsking on Thu 01/08/2024 11:26:17Another thing is the possibility to add more hotspots, for example a library with 100 books. I've already worked it around by adding books as objects one by one, but it wasn't easy.

Hotspots amount may in theory be increased up to 255 (that's the maximum that the room masks allow).

But having 100 separate hotspots for individual books on the shelves is almost similarly suboptimal as having 100 objects for that.
It may be easier to have a single hotspot for a shelf and script a mathematical formula that gives you a book's index based on a coordinate.
#1170
Quote from: Vincent on Wed 31/07/2024 09:53:35Hi @Crimson Wizard I was wondering to ask you if it's possible with this module to have some sort of key pushed combination? For example if you push 'A' it goes with punch1, if you push another time 'A' (within a range of time) it goes with punch2 and so on? If that's possible how to do something like that?

This module only detects presses, but it does not know what they are for. You'll have to script that yourself.

In fact, when I wrote this module, i had plans to make a fighting game. This module was a start, and the next module should be "action sequencer", but I never wrote it. The idea was that ActionSequencer would read information from KeyListener, and record a list of key presses.
You can do something like that, in your way.
#1171
Planning this:

Quote from: Crimson Wizard on Mon 29/07/2024 14:36:491. Support reading saves with different counts of items and data (latter is regarding scripts), where user has the final decision in a script callback, based on certain information that engine passes there.

The way I see this, the process of reading a save is going to be as folows:

1. Engine reads the save, and compares the entries in a save with the game data, for consistency.
2. If an inconsistency is found (e.g. number of entries or size of data is different),
   2.1. If save has more data than the engine, then this fact is marked, but reading continues,
        only the matching amount of data is applied to the game.
   2.2. If save has less data then the engine, then
       a) engine marks and remembers this fact;
       b) engine aborts reading save, and reloads the game in order to clear all its data to the initial state.
       c) after reloading the game, engine restarts reading same save once again, but keeps in memory the fact that it is being read after clean reset.
       d) if there's a marker of a clean reset, then the above restart does not happen, and reading continues.
3. Save is read, and game data reinitialized as necessary.
4. Engine tries to run a script callback, named something like "on_restored_save_validate" (this is just an example and may be changed).
   4.1. If such callback does not exist, and there's no indication of save being inconsistent, then the game is simply continued as normal.
   4.2. If such callback does not exist, and there's a recorded indication about save being inconsitent, then the game is aborted with error message.
   4.3. If such callback exists in script, then it is run.
5. The script callback receives a struct, containing information about the restored save:
   - a variable telling if save is inconsistent, and how (possibly using a set of flags);
   - a group of variables that tell counts of entries per object type:
     how many characters, gui, etc was read from this save.
   This information, as well as a read script data, may be used by game developer to decide what to do with this save.
   Developer's decision may be passed to the engine either with function's return value, or a settable field in the passed struct.
   The instruction can be:
   - continue the game,
   - abort with a error message,
   - restore a different save (something like a fallback to default state).
#1172
Alright, so, I am trying to write a more explicit plan, and break the solution into several big steps. These steps may be implemented in sequence, or parallel, some of these is optional, and they probably loosely depend on each other.

1. Support reading saves with different counts of items and data (latter is regarding scripts), where user has the final decision in a script callback, based on certain information that engine passes there.

2. Support identifying object entries in saves by script names, as opposed to the array index. This might help in case object order changes, after deleting something in the middle. The idea is that engine writes object's script name along its data when making a save, and when reading back engine looks up for the matching object in the game. Since AGS currently does not enforce object's script name (it's virtually not obligatory, you can create a object that does not have any name at all), these that don't have names may be identified by a generated "name" like "#ID" (where ID is a numeric index).
Such approach still won't on things that don't have unique named IDs, and on script data.
(Potentially, this may be done in the latest AGS 4, where script compiler gathers script's table of contents, for "watch variables" feature.)

3. Support callbacks that let write/read custom user data in saves. This needs to be thought through bit more, to clarify the use cases, because in regular circumstances engine would write script variables into saves, which are already containing custom data. So likely this feature may be useful would the full script data NOT saved (following some setting).

4. Support partial save states, that is - let user configure which data save and not. Of course this won't be a fine tuning, - as there's too many options there, - but a rough one, where you choose types of objects that are saved or not (e.g. GUI, script data, etc). Such feature will remove certain game data from save/restore operation completely. This will require users to reconfigure the game state after restoring a save, but on the other hand there will be no problems with these objects breaking saves.
I've been also thinking about maybe removing certain things from saves completely. Such as - Views and dynamic sprites, for instance. Views may be changed at runtime (frame images and sounds), but they also may be restored by a script after save is loaded, based on current game situation. Same refers to dynamic sprites. I think that it could have been a mistake to add these to saves. Views are annoying, as they contribute to breaking saves even if a single frame is added or removed. And dynamic sprites may increase the disk size of a save file tenfold.
#1173
Quote from: Mehrdad on Wed 24/07/2024 18:53:01Edit :  If you add MAC and iOS ports to the editor I can test them.

Building for iOS and Mac is not integrated in the Editor, and likely won't be for a while. But engine ports are available, just like in AGS 3.
#1174
Quote from: Perpetuall on Sat 27/07/2024 02:47:00Well, there are a few reasons. For one thing, all the modules I am using were written for 2.72 or earlier, and it's a real pain trying to get them to work with AGS 3. Some of them I can't get to work at all, and I'm not skilled enough to know how to code an alternative.

It's possible to use 2.72 scripts in AGS 3, if you toggle some of the backwards compatibility settings:
https://adventuregamestudio.github.io/ags-manual/GeneralSettings.html#backwards-compatibility

There are only few exceptions, such as "global messages" that you can no longer edit in the AGS 3 editor. But all script functions should still work.
I witnessed few times how the people upgraded their ancient projects to the latest AGS 3 without changing much of the script.
#1175
Quote from: Perpetuall on Sat 27/07/2024 01:14:08(P.S. Right now I'm using AGS 2.72)

What is the reason you're using 2.72? That version was more or less okay for the early 2000-ies, but for today it has a horrible system compatibility, you'll be stuck with Windows only, and some things will work slower than they could (game rendering for instance).
#1176
Quote from: DiggingUpGraves on Fri 26/07/2024 13:01:45I wholly fixed it by just giving 'Walk to' a cursor

This means that you are using random cursors in your game, instead of configuring a logical behavior.
#1177
When the ActiveInventory is reset (in your case that's because item is removed from inventory), cursor switches to the first enabled cursor mode in the list. By default that's Walk cursor, but may be a different one if you disabled Walk.

Normally you should disable cursors that you don't use. This may be done either by disabling "StandardMode" property in the editor (if I remember correctly), or by setting Mouse.DisableMode in game_start function in script.
#1178
@Akril15 do you have mirrors in multiple rooms?
Do you remove created mirrors in Room Leave event?

I never used this module, but the common way of dealing with anything dynamically created is to create on room load and remove on room leave.
#1179
I think I was one of the people who noted this problem many years ago.

The success here largely depends on which method is used to display a text. Because engine will need to be able to guess what and when to slow down.

Standard functions that display temporary game texts (such as speech) may be easily overridden, because engine knows what they do.

However, there are games that use custom user-written functions to display speech, where the text display is made up of a number of lower-level commands. They achieve a effect in combination, which may not be obvious to the engine. In this case the situation is complicated.

From the top of my head, there are following options:
- a "speech skip style" parameter. Engine may force this style to not include "timeout" and only player input, in hopes that custom function relies on this parameter.
- a "text reading speed" parameter. Engine may try to adjust that to a lower speed value, again in hopes that custom function actually uses that.
- WaitMouseKey and similar commands that have a timeout: engine may override these to have a larger or infinite timeout. These functions may similarly be overridden to react to any kind of input: in case game is scripted to be skipped by a mouse but player has only a keyboard, and so on.

EDIT:
An alternative (or complementary) to above could be a configurable hotkey that pauses the game or slows game speed until pressed again.
#1180
Quote from: lafouine88 on Wed 24/07/2024 19:22:09@Crimson Wizard, what do you mean by 'painting' on it?

I mean - import your world mask pieces as sprites, and then use DrawingSurface.DrawImage function to paint these sprites over room as location changes.

Quick code example, only to illustrate basic idea:
Code: ags
DrawingSurface* ds = GetDrawingSurfaceForWalkableArea();
ds.Clear(0);
ds.DrawImage(MASK_SPRITE);
ds.Release();

Unfortunately, there's a missing functionality in AGS 3.*, where it does not let you import 8-bit sprites into 32-bit games and keep them 8-bit (it converts everything to 32-bit). So if you are in 3.*, then you likely will have to resort to some workaround.

Khris seems to have a suggestion, although I did not test that myself.

In AGS 4.0 this may be easier, as engine lets you import and keep 8-bit masks as sprites, and use them in game as 8-bit.

There of course may be a different approach. For instance, you could try generating walkable or non-walkable areas (walls) from the background somehow, or from a custom data which describes obstacles. But this largely depends on how do you define your levels.
SMF spam blocked by CleanTalk