AGS 3.6.1 - Beta 12 -- new WIP version

Started by Crimson Wizard, Sat 27/05/2023 04:37:47

Previous topic - Next topic

Crimson Wizard

#20
There's an experimental change that adds object pointer as an argument to all interaction functions:
https://github.com/adventuregamestudio/ags/pull/2061

I would appreciate if somebody could download a test build and try it out, see if it works well:
https://cirrus-ci.com/task/4853453999046656
Updated version, fixed Hotspot's WalkOn and Mouse over event args:
https://cirrus-ci.com/task/4755886569160704
(will be ready in 30-40 mins after posting this)

Crimson Wizard

#21
Updated to Beta 6
(Please use download links in the first post)

Changes in this update:

Editor:
- Discontinued Source control integration functionality, removed "Put sound and sprite files in source control" option from General Settings.
- Export Game's Title into translations.
- Fixed Editor refusing to open a game if one of the translation files is missing.
- Fixed Game.agf was not created after importing a 2.* game project (regression in 3.6.0).
- Fixed Log Panel displaying recent messages with a delay.

Script API:
- 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 Object.AnimationVolume property, which works similar to Character.AnimationVolume.

Engine:
- Character.AnimationVolume now applies to the portrait animation too.
- 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.
- Removed few of the less important game messages from logging, because they may quickly clutter the log under some circumstances.
- Fixed deleted dynamic sprite leaving sprite slots marked as "taken" forever, which continuously increases the size of the sprites list at runtime (regression since previous 3.6.1 Betas)
- Partially improved performance of repeated creation and deletion of a large number of dynamic sprites on each game update (regression since previous 3.6.1 Betas)
- Fixed Buttons and ListBoxes using Translated property in reverse way (regression since previous 3.6.1 Betas).
- Fixed debugger (editor) log output did not receive initial engine messages.

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



Regarding expanded interaction functions, these are functions connected to Look at, Interact, Talk to and other similar events. They all now may have 2 parameters: a pointer to object, and cursor mode, similar to the following examples:
Code: ags
function Ego_Interact(Character *c, CursorMode mode)
function oObject1_Look(Object *o, CursorMode mode)

Exceptions:
- Hotspot WalkOn and MouseOver events do not have CursorMode parameter.
- All Region events do not have CursorMode parameter.

The purpose of this addition is to improve situation where you connect same function to multiple events and/or multiple objects at once. In such case you will be able to distinguish object and mode for which the function is actually called.

These new parameters are optional. If you don't have them declared in script, they will be ignored by the engine, and your script is going to run as before.

Crimson Wizard

Updated to Beta 7
(Please use download links in the first post)

Changes in this update:

Contains all fixes from 3.6.0 Patch 4.

Editor:
- In Dialog Script editor support most Edit menu and context menu commands from the regular Script editor, with a few exceptions.
- 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.
- Improved LipSync panel looks in case user's system has display scaling option enabled.

Engine:
- Support handling multiple mouse clicks per game frame, similar to how multiple key presses were supported since 3.6.0.
- Fixed program crash occuring when trying to get a screenshot from a save which does not contain one (regression in previous 3.6.1 Betas).

Android:
- Fixed crash in AGS Player when opening a games directory for browsing a list of games (regression in previous 3.6.1 Betas).

Crimson Wizard

Updated to Beta 8
(Please use download links in the first post)

Changes in this update:

Common features:
- Implemented Deflate compression option for sprites. (This is an algorithm used in PNG and ZIP formats, and testing shows about x1.5-x2 compression improvement compared to LZW).

Editor:
- Fixed Line tool in the Room Editor triggering sometimes after a context menu was called with Shift + RMB.
- Fixed Autocomplete not treating certain struct members as "static" or "protected" if their declaration is too long.

Engine:
- 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).
- Fixed invalid gui could be interacted with if a previous interaction displayed a message box on screen, sometimes leading to engine crashes (regression since the previous Beta).

Compatibility:
- Implemented "dataver_for_legacysaves" override option in config, which lets to instruct the engine which game data version to assume when loading 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.
- 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.

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



Some of the fixes mentioned here will likely be also backported to 3.6.0 and released as a part of next patch.

nightmarer

Great work! Great improvement the Deflate compression.

Crimson Wizard

#25
QuoteSupport handling multiple mouse clicks per game frame, similar to how multiple key presses were supported since 3.6.0.

Ah, I just realized that there is still an oversight in this. on_mouse_click should probably have mx,my parameters, in case the mouse moved between clicks?

I primarily added this multiple clicks support after being asked by a person who was doing a tool-automated speed run of AGS games. So, it was supposed to support multiple simulated clicks in a row. But since mouse.x,y properties are only updated once per game frame, then this is still useless... (except when clicking on gui and interactive objects that have proper events, perhaps)

EDIT: also I noticed that some engines have "modifier keys" as a part of the mouse event (let know whether player did  Ctrl + Click, and similar).

Crimson Wizard

#26
I found a very nasty bug; it occurs after you restored a save containing user managed structs, and then try to save again. When saving it has a chance to crash the engine, or write a random amount of garbage into the save file.

This bug was introduced around 3.6.1 Beta 1, released in the end of May. Which makes me wonder how it lasted unnoticed for 3 full months. Unless nobody is using 3.6.1 Betas, or nobody who used them had any managed structs in their scripts...

It is possibly not present in ags 4 releases, because of some differences in program code.

EDIT: we have some trouble with the build server, but I will release an emergency update with a fix as soon as it's working again.

Crimson Wizard

#27
Updated to Beta 9
(Please use download links in the first post)

Contains all changes from 3.6.0 Patch 5.

Other changes in this update:

Editor:
 - 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.

Script API:
 - 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.

Engine:
 - 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.
- 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().
- Fixed managed structs in script may cause program crashes after you restored a save and try to save again (regression in previous 3.6.1 Betas).

Compatibility:
 - Warn of write into "readonly" script variables, instead of error, as some older games may to try to write there.
 - Fixed inventory window not updated after game.top_inv_item is assigned a new value.

Baguettator

#28
Hi ! I noticed a problem, I use 3.6.1.6, I have some "strings" declared at the top of my script, I give them a value in game_start function (String a="My String A" etc...), but if I have a code that asks "if (Label.Text==a)", it crashes as "a" is null.

Perhaps it has been fixed since newest versions, but I have to mention it in case of !

Of course, the call of "a" is done after "a" has been given a value, and after game_start function.

EDIT : also I saw that declaring label array in game_start doesn't work (label pointers will be null if they are called later in the code)

Crimson Wizard

#29
Quote from: Baguettator on Fri 15/09/2023 11:08:29Hi ! I noticed a problem, I use 3.6.1.6, I have some "strings" declared at the top of my script, I give them a value in game_start function (String a="My String A" etc...), but if I have a code that asks "if (Label.Text==a)", it crashes as "a" is null.

This sounds like this may be a scripting mistake, please post an actual script example, and exact error message.

Quote from: Baguettator on Fri 15/09/2023 11:08:29EDIT : also I saw that declaring label array in game_start doesn't work (label pointers will be null if they are called later in the code)

Please post an actual script example, so that we can see what exactly you are doing.

Dave Gilbert

Dang. I blink and there are new updates. Thanks so much! I will try it soon.

Baguettator

Quote from: Crimson Wizard on Fri 15/09/2023 12:27:20
Quote from: Baguettator on Fri 15/09/2023 11:08:29Hi ! I noticed a problem, I use 3.6.1.6, I have some "strings" declared at the top of my script, I give them a value in game_start function (String a="My String A" etc...), but if I have a code that asks "if (Label.Text==a)", it crashes as "a" is null.

This sounds like this may be a scripting mistake, please post an actual script example, and exact error message.

Quote from: Baguettator on Fri 15/09/2023 11:08:29EDIT : also I saw that declaring label array in game_start doesn't work (label pointers will be null if they are called later in the code)

Please post an actual script example, so that we can see what exactly you are doing.

OK sorry it's my fault, it seems I made a mistake in my code...!

Baguettator

Quote from: Crimson Wizard on Fri 15/09/2023 12:27:20
Quote from: Baguettator on Fri 15/09/2023 11:08:29Hi ! I noticed a problem, I use 3.6.1.6, I have some "strings" declared at the top of my script, I give them a value in game_start function (String a="My String A" etc...), but if I have a code that asks "if (Label.Text==a)", it crashes as "a" is null.

This sounds like this may be a scripting mistake, please post an actual script example, and exact error message.

Quote from: Baguettator on Fri 15/09/2023 11:08:29EDIT : also I saw that declaring label array in game_start doesn't work (label pointers will be null if they are called later in the code)

Please post an actual script example, so that we can see what exactly you are doing.

Sorry, but in fact, it a real bug !

What I did :

Code: ags
// At the top of TopScript.asc, a Script File located higher than global Script.
String a;

function game_start()
{
  a="Test";
}

export a;

// In TopScript.ash
import String a;

// In Global Script

function on_key_press(eKeyCode keycode, int mod)
{
  if (keycode==eKeyG) Display(a); // THIS crashes because it returns a null String !
}

That's a problem !

Crimson Wizard

#33
@Baguettator
I used your code in a new game, and it works correctly. You may try it yourself, if you would just create a new test game from a random template.

Is this the real code you are using? Is this string variable changed anywhere else in script?

I think it's best to deal with cases like this in the tech help forums first, to let others look into your script and make sure it's not a scripting mistake.

Baguettator

Quote from: Crimson Wizard on Mon 18/09/2023 13:43:51@Baguettator
I used your code in a new game, and it works correctly. You may try it yourself, if you would just create a new test game from a random template.

Is this the real code you are using? Is this string variable changed anywhere else in script?

I think it's best to deal with cases like this in the tech help forums first, to let others look into your script and make sure it's not a scripting mistake.

Big Sorry... The problem was I made a mistake in the name of the "game_start" function. I forgot the "_"... So it wasn't called !

And sorry, I told about it here as I thought it was a bug from the new versions of AGS.

Thanls for help anyway !

Crimson Wizard

Updated to Beta 10
(Please use download links in the first post)

Changes in this update:

Editor:
- "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.
- For script's tabs added a context menu command for opening this script's location.
- 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.
- Config will now be saved in UTF-8, letting to support setup program's title text in unicode.
- 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 Editor could miss some of the files when cleaning up old compiled files after the Game's Filename property is changed.

Engine:
- 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.
- 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.
- Engine will now skip blocking Character.Say commands instantly while skipping a cutscene.
- Deprecated in-game "console", as practically useless.
- Fixed buttons on a non-clickable GUI were still changing to "mouse over" graphic under cursor.
- Fixed Characters may be seemingly "walking in place" for some time when arriving at destination.
- Fixed "Before fade-in" event could be called recursively under some peculiar conditions (this is a regression since 3.6.0).
- Fixed button click not registered if it has been made not visible and visible again during a single game frame (this is a regression since 3.6.0).

Compatibility:
- Fixed a "New Room" command in old-style dialog scripts was preventing "First time Enter room" event to be called.

Crimson Wizard

#36
There's a serious mistake since Beta 9 (one before the current one) which cause portrait animations to not update. Unfortunately it was reported only now.

I will have to release another update as soon as this is fixed; or re-release Beta 10.

EDIT: done, sorry, please download again.

eri0o


Dave Gilbert

#38
QuoteGoto 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

YESSSSSSSSSSS. Thank you so much! I didn't even realize I wanted this. :)

edit: It even works from the dialog editor!! Bliss!

Crimson Wizard

#39
Radiant had decided to "officially" release his FontEdit's sources under LGPL3 license, so now I can post an experimental version source, which allows to create WFN (bitmap) fonts with up to 64k characters, making it usable for Unicode games too:
https://github.com/ivan-mogilko/fontedit

Executable:
https://www.dropbox.com/s/xth28bfzu78vtqi/FontEditUni.zip?dl=0

The version may has some minor functionalities disabled during this update, and I did not have time to go back and fix everything. But if anyone would like to take this on, the sources are available, and also I may accept PRs.

Although, I believe someone should rewrite this on a modern UI framework, to make this program work on other platforms too.

NOTE: There's a Rulaman's FontEditor, also available as the Editor's plugin, but unfortunately I found its source code more complicated to edit and upgrade to 64k chars limit for some reasons.

SMF spam blocked by CleanTalk