AGS 3.6.1 - Beta 16 -- new WIP version

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

Previous topic - Next topic

Crimson Wizard

There's a bug introduced in the latest Beta (10) where a character who is ordered to move several times in a row would "teleport" to a random location in he room.

I was going to release a new update soon, but got distracted. So until then, here's a temporary build that has it fixed:
https://cirrus-ci.com/task/6707220583284736

Crimson Wizard

#41
Updated to Beta 11
(Please use download links in the first post)

Changes in this update:

Editor:
- 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.
- 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 startup SetRestartPoint() call 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 Project Explorer's folders collapsing after certain user actions, such as dragging items or renaming things.
- Fixed Script editor not marking "autoptr" and "builtin" as keywords.
- Fixed Script editor not applying color theme to character literals.

Scripting:
- Support "#else" preprocessor directive.

Script API:
- Added support for a text formatting to a number of functions: DisplayAtY(), Character.SayAt(), Character.SayBackground(), DrawingSurface.DrawStringWrapped().

Engine:
- 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.
- 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.
- Fixed engine failing to startup sometimes if controller device subsystem failed to init (it should not init at all in this version, as we do not support joysticks yet).
- Fixed characters occasionally "teleporting" when ordered to move (regression since Beta 10)



NOTE: In regards to the SetRestartPoint() change, I have to post this clarification.
SetRestartPoint() and RestartGame() are still working as before. The change refers to the automatic restart point set when the game starts. This was disabled in the engine, in favor of letting users set it themselves if and where they prefer. Some games may need this, others not, some games use custom saves and it would not be fair to generate an unnecessary file on startup (and sometimes this file may be quite big, as it also depends on amount of script data).

As an attempt to make this transition easier, upon loading an older project the Editor will insert a SetRestartPoint() call into game_start() function in the GlobalScript. This call is safe to remove, or move elsewhere.

Crimson Wizard

#42
Updated to Beta 12
(Please use download links in the first post)

Contains all fixes from 3.6.0 Patch 6.

Other changes:

Editor:
- In General Settings moved few properties to different groups for better consistency.
- Apply color themes to Log Panel.
- Fixed View preview does not display very large sprites.

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).
- Fixed Overlays may display incorrectly after loading a legacy (pre-3.5.0) save file.



EDIT: I had to re-upload this again... after finding and fixing a mistake in String.Substring function :/

Crimson Wizard

There's a mistake in Android port in this version, it does not let to start a game.

Here's a temporary editor build that has this fixed:
https://cirrus-ci.com/task/6489562277478400

Dave Gilbert

#44
Hi! I found a copy/paste bug in the latest version.

In the dialog editor tab, if I copy some text and try to paste it into one of the "option text" fields (using control-v), the text gets pasted into the SCRIPT instead of the option field.

For example, here I was trying to copy/paste the words "Yeah they do" into an option text field:


Crimson Wizard

Quote from: Dave Gilbert on Tue 14/11/2023 19:21:36Hi! I found a copy/paste bug in the latest version.

In the dialog editor tab, if I copy some text and try to paste it into one of the "option text" fields (using control-v), the text gets pasted into the SCRIPT instead of the option field.

Thank you for reporting, we're looking into this now.

As a workaround, use a "paste" command from the text field's context menu. This bug only occurs when you use keyboard shortcuts.

Dave Gilbert

Thanks! I'll use that method for now, then. Right-clicking and selecting "paste" also works.

eri0o

There is already a fix for the keyboard shortcuts that will be in the next 3.6.1 release! :) (now the issue is understood more in depth we are evaluating some details around this)

cat

I do not know if this specific to this AGS version or a general thing (I'm using AGS Editor .NET (Build 3.6.1.10) v3.6.1, October 2023)

I have a game resolution of 1280 x 720 with a huge scrolling room (3760 x 720). I use the GotThere module which calls player.Walk(noBlock) and later checks if the player character has reached its destination.
I had the problem that for some hotspots it didn't work (for others it did). The module relies on the player reaching exactly the point that was demanded. Using the DebugHelper module, I found out that the player was standing on x = 2630 instead of the requested 2631. When I changed the requested walk-to point by one pixel (to 2630), it suddenly worked.

Now the question: Is this a known thing that the player will not reach certain points within a walkable area? Is this related to my room size or scrolling? Is this something with even vs. odd numbers (the other hotspot also didn't work with odd number but did with even)

Crimson Wizard

#49
Quote from: cat on Sun 19/11/2023 21:00:18Now the question: Is this a known thing that the player will not reach certain points within a walkable area? Is this related to my room size or scrolling? Is this something with even vs. odd numbers (the other hotspot also didn't work with odd number but did with even)

It has been a known thing that it sometimes characters do this: because of imperfect diagonal walking direction character could end up few pixels off and did not adjust the final position, avoiding making it look like a "jump".

But in the recent Beta (starting with v3.6.1.9, i think) there's a fix that is supposed to make character end up on a accurate destination, so long as there's a path to it. So, I am not sure if this is expected anymore.

Could you post a walkable mask (image that may be imported into AGS) and a pair of starting/ending coordinates that cause a mistake for us to test?

cat

#50
The walkable area is a rectangle, going from about 74, 702 to 3747, 719. No matter how often I tried, the character would not walk exactly to 2631, 710. 2631, 710 did work. Same for 1161, 710 vs 1160, 710.

I additionally have another walkable area, but this goes upwards in a totally different place and direction, I don't think this is related.

Crimson Wizard

#51
Quote from: cat on Sun 19/11/2023 21:21:06The walkable area is a rectangle, going from about 74, 702 to 3747, 719. No matter how often I tried, the character would not walk exactly to 2631, 710. 2631, 710 did work. Same for 1161, 710 vs 1160, 710.

Is this related to the starting coordinates or not at all?

Could you print Character.DestinationX/Y properties somewhere and see what they are after you issue a Walk command?
this might tell if this is a problem with pathfinding or walking.

cat

Not at all. I click on the hotspot, the player walks to 2630, 710 (instead of 2631, 710) using the GotThere module (which uses player.Walk inside). While still standing there, I click the hotspot again, the character will not move and trigger the action. No matter how often I click. I change the desired point to 2630, 710 -> the player walks there and executes the action, no matter where I started.

(I'll be off to bed for now)

Crimson Wizard

Quote from: cat on Sun 19/11/2023 21:51:44Not at all. I click on the hotspot, the player walks to 2630, 710 (instead of 2631, 710) using the GotThere module (which uses player.Walk inside). While still standing there, I click the hotspot again, the character will not move and trigger the action. No matter how often I click. I change the desired point to 2630, 710 -> the player walks there and executes the action, no matter where I started.

Can you check the Room properties and tell what is the value of MaskResolution?

Crimson Wizard

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

Changes in this update:

Editor:
- In Room Editor the hint with coordinates is now also displayed when moving Objects or Characters with keyboard.
- For Android build target Editor now supports a directory to place plugins in.
- For Android build target disabled compression of `.ags` and `.vox` assets, as that seriously slows down engine streaming resources (sprites etc).
- 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.
- For Color Themes: implemented character literal, braces match and braces error settings.
- Fixed Editor failing to start if user preferences file is corrupted (this is a second fix, complementing one done in AGS 3.5.1).
- Fixed General Settings and Default Setup not working correctly right after importing a pre-3.* game project.
- Fixed in Dialog panel certain editing commands (Copy, Paste, Undo etc) would affect the script even if cursor is set to the option's text.
- Fixed Dialog properties displaying internal values not meant to be seen by a user.
- Fixed selecting parent GUI after its control did not display GUI's own properties in the Properties Grid.
- Fixed Editor generating deprecated settings in the default config file.

Engine:
- Fixed String.Substring() (regression in 3.6.1).
- Fixed File.Open() in case of an absolute path (regression in 3.6.1).
- Fixed pushed textual button not redrawn after mouse up (regression in 3.6.1).
- Fixed crash in Software renderer when drawing a flipped frame (regression in 3.6.1).

Engine Plugin API:
- Added IAGSStream interface, IAGSEngine.OpenFileStream() and GetFileStreamByHandle().
  Besides the obvious uses, this is critically needed for the games packaged into APK for Android, because plugins do not have a easy access to the game files in such case.
- Remade IAGSEngine.ResolveFilePath() (was introduced in 3.6.1 earlier), don't return allocated array of chars, instead accept an output buffer and its length as arguments.

Android:
- Fixed engine not being able to find game data when it is in APK.

cat

#55
Quote from: Crimson Wizard on Sun 19/11/2023 22:50:50Can you check the Room properties and tell what is the value of MaskResolution?

It is 1:2 - I didn't even know this setting existed! Should I change it to 1:1? What is the benefit of different resolutions?

Crimson Wizard

#56
Quote from: cat on Mon 20/11/2023 16:42:56
Quote from: Crimson Wizard on Sun 19/11/2023 22:50:50Can you check the Room properties and tell what is the value of MaskResolution?

It is 1:2 - I didn't even know this setting existed! Should I change it to 1:1?

It's been historically hardcoded as 1:2 for high resolution games (anything above 320x200), but since some recent version (3.5.0 or 3.5.1) the default is now 1:1 everywhere and this property was added for backwards compatibility, and in case someone needs this for any reason.

There is another global property in General Settings (Rooms -> Default mask resolution) that sais what this value should be by default in newly created rooms.

Quote from: cat on Mon 20/11/2023 16:42:56What is the benefit of different resolutions?

Saving bit of memory on masks in very large rooms + maybe emulating less precise walking and click detection on hotspots; although to be fair I can hardly imagine the real use case.

cat

#57
Ah, okay. The game I'm working on is based on another (older) game. That's why the new settings are not applied.
With setting it to 1:1, it now works also with odd numbered coordinates.

Should I split out the posts about this topic here and move them to a different board/thread to keep this here clean?

Crimson Wizard

#58
Quote from: cat on Mon 20/11/2023 16:55:33Should I split out the posts about this topic here and move them to a different board/thread to keep this here clean?

I don't think it's a big deal, so either is fine with me.

EDIT: if I recall right, changing mask resolution will convert existing one(s). It should be safe to convert to a higher res (1:2 -> 1:1), but opposite conversion is lossy (you will loose certain pixels and that cannot be automatically undone).

cat

I just realized I don't have moderation powers in this board anyway ;)

SMF spam blocked by CleanTalk