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 - greg

Thanks very much, CW!  This fixed both the font issue and the hard crash in game_start() I'd been encountering.

Of the issues I'd reported, I'm only still experiencing the flakey AudioChannel.LengthMs issue.  That is, AudioChannel.LengthMs is sometimes returning 0 even when AudioChannel.PlayingClip.ID is not null.  (Details are a few appends down, but if you need further debugging information from me, just let me know.)  Thanks!
Sure, here's the code.  Line 1001 is the one with "GetWalkableAreaAtRoom(player.x, player.y) != GetGlobalInt(EXIT_WA_ENABLED)":

Code: ags
function exit_hidewalkablearea() {
  if (GetGlobalInt(EXIT_WA_ENABLED) != -1) {  // line 999
    // don't hide walkable area if the character is currently on top of it
    if (GetWalkableAreaAtRoom(player.x, player.y) != GetGlobalInt(EXIT_WA_ENABLED)) {  // line 1001
      SetGlobalInt(EXIT_WA_ENABLED, -1);

In 3.6 (but not in 3.5.1), when I call this function before setting SetGlobalInt(EXIT_WA_ENABLED, -1), I get the crash from the dump file.  Now that I'm setting the variable first, I no longer get the crash (because it fails the condition at line 999).

I'd guess the change in behavior here is that 3.5.1 returns -1 for GetGlobalInt(foo) if foo hasn't been set, whereas 3.6 doesn't?  So in 3.5.1, even though I hadn't set the variable, it failed the condition at line 999 and never tried calling GetWalkableAreaAtRoom().

Sure, I've appended the crash message below, and I've uploaded the CrashInfo file here:

The functions that called GetGlobalInt(foo) before SetGlobalInt(foo, bar) were called in game_start().  Also, thanks for the heads-up that GetGlobalInt and SetGlobalInt have been deprecated!

Separately, since upgrading from 3.5.1 to 3.6, I noticed that AudioChannel.LengthMs is sometimes returning 0 even when AudioChannel.PlayingClip.ID is not null.  Namely, in the same place in my code, the same log message sometimes prints this:

Code: ags
channel.ID: 3, channel.PlayingClip.ID: 267, channel.LengthMs: 3692

And sometimes it prints this:

Code: ags
channel.ID: 3, channel.PlayingClip.ID: 267, channel.LengthMs: 0

I can reproduce this consistently, but not every time, when I skip the cutscene in which the clip is played.  However, the behavior sometimes occurs (though far less often) even if I don't skip the cutscene.  (I had the same code in AGS 3.5.1, and channel.LengthMs never returned 0.)

Illegal exception
An exception 0xC0000005 occurred in ACWIN.EXE at EIP = 0x00537F70; program pointer is -42, ACI version, gtags (78,214)

AGS cannot continue, this exception was fatal. Please note down the numbers above, remember what you were doing at the time and contact the game author for support or post these details on the AGS Technical Forum.

in "Interface.asc", line 1001
from "Interface.asc", line 1010
from "Extender.asc", line 587
from "Extender.asc", line 596
from "Extender.asc", line 1090
from "Extender.asc", line 3539
(and more...)
Thanks for this awesome new build!  The Object.Scaling option and additional audio channels are especially amazing.

When testing out the most recent version of 3.6, I noticed the following:

1. Text within buttons is placed differently in the editor than in the game.  Here's some text with alignment eAlignMiddleCenter.  (The font is LinLibertine_aBS.ttf, imported at 20 pt.)

It's worth noting that, when upgrading from 3.5.1 to 3.6, the font had a VerticalOffset of -2, which appeared as -2 in the editor and -4 in the game.  I've since set this offset to 0, and it now appears as 0 in the editor and -2 in the game.

2. Calling GetGlobalInt before SetGlobalInt results in a crash.  As my game was loading, I was calling GetGlobalInt(foo) before I'd called SetGlobalInt(foo, bar).  In 3.5.1, there was no error or crash.  In 3.6, there was a crash.  I addressed this by updating my script to set the variable before getting it.  I wanted to report it, though, as it's a different behavior from 3.5.1.
Quote from: Crimson Wizard on 18 Jun 2021, 01:58
Made a fix, and the temp download will be available from the build server here after the server work is over (under "Artifacts" line):

Thanks for preparing this fix!  I tested the new build on my game, and it indeed resolved the issue I was experiencing.  Thank you!
> Is it only button itself that hides during blocking action, or whole GUI?

I'm hiding the GUI, then the button, then moving/resizing/showing the button, then showing the GUI.  If the mouse is over the button at the time the GUI is reshown, the button doesn't recognize the click until you move the mouse by >=1 pixel.

To work around the problem (back in 3.1.2 and now with 3.5.1), I just manually bump the mouse after showing the GUI:

Mouse.SetPosition(mouse.x+1, mouse.y);

> I cannot reproduce this, do you have some simple game to test?

Sure, if you'd like, I can DM you my game.  With the workaround above, though, I'm unblocked.
With AGS 3.5.1, I noticed that the engine no longer recognizes a second click on a GUI button if the mouse hasn't moved since the previous click.

(This behavior existed in AGS 3.1.2, then went away in AGS 3.2.1.  With 3.5.1, I'm observing it again.)

Here's what I'm doing:
* Within the game, the player clicks on a GUI button.
* The button's OnClick function is called.  This triggers a blocking action, during which the GUI button is hidden.
* The player regains control of the game, and the GUI button reappears.  The player hasn't moved the mouse at all, so the mouse is in the same place, and the GUI button is still below the mouse.
* The player clicks on the same GUI button.
* Observed behavior: Nothing happens.
- Expected behavior (and behavior before 3.5.1): The button's OnClick function is called.
I noticed that, while playing an AudioClip of eAudioTypeMusic (say, aMusFoo), when an AudioClip of aAudioTypeSound plays (say, aSfxBar), the observed volume of aMusFoo decreases substantially and remains decreased even after aSfxBar stops playing.  I've checked the volume of the channel playing aMusFoo before/during/after aSfxBar plays, and its value doesn't change; however, the observed volume definitely decreases.

Any idea what's going on here?  I'm guessing this is related to the internals of AGS' sound handling?

Other debugging information:
* I'm using v3.5.0.30, though I've observed this in previous versions of 3.5 as well.  (I hadn't yet added sound to my game back in the 3.4 days, so I'm not sure if it's a regression from then.)
* Even though sSfxBar isn't speech, I've tested with Game.SetAudioTypeSpeechVolumeDrop set to 0 for all my audio types, and it makes no difference.
* "Crossfade tracks" is disabled for all my audio types.
* For eAudioTypeMusic, MaxChannels is 2, and for eAudioTypeSound, Max Channels is 0 (but ends up being 2 after you subtract the channels used by my other AudioTypes).

SMF spam blocked by CleanTalk