AGS 3.4.0.6 (Alpha) - Builder Patch

Started by Crimson Wizard, Sat 27/09/2014 17:25:18

Previous topic - Next topic

Crimson Wizard

#120
Quote from: Calin Leafshade on Thu 01/01/2015 16:46:24
There seems to a problem with sound in the new version. It seems to randomly cut off sounds for no reason. Some times it works and other times it doesnt. The same seems to happen for MP3 and OGG.
Was you able to get any specifics which would help to reproduce it?

Quote from: Calin Leafshade on Thu 01/01/2015 16:46:24
EDIT: Also, winsetup doesn't seem to exit properly on close.
Are you building debug version of the project? There is a known bug that Debug version hangs running on certain circumstances.

Quote from: Calin Leafshade on Thu 01/01/2015 16:46:24
EDIT EDIT: Seems the sound issue persists in 3.3.0 (custom res)
You mean 3.4.0.1 ? 3.3.0 had no custom resolutions.

Quote from: Calin Leafshade on Thu 01/01/2015 16:46:24
EDIT X 3: It seems that AGS is not properly releasing audio channels.
Can you elaborate, what made you think so? Any details please?
Are you running with or without threaded audio option?
Are you running on Linux maybe? Recently I've fixed a bug on Linux that caused game crash when releasing audio clip.

Can you give just any details of what you do?

Calin Leafshade

Very sorry for the shitty bug reports. I was making my MAGS game and was very stressed about the timing.

I will be more clear now.

The winsetup issue was probably due using a debug version because i was building the engine myself.

The audio issue persists all the way back to earlier versions though.

I was using the new audio system and occasionally sounds would either cut off or just not play. I assigned them to the Sound type and played them as normal with aClip.Play().
All the priority settings were default and i tried wav,mp3 and ogg all to the same effect.

Then I made a new sound type called "GameSounds" and assigned all the audio clips to that and it seemed to solve the problem.

Here is a version of the game exhibiting the problem. Its a 3.4.0.2 project: https://dl.dropboxusercontent.com/u/27247158/deepunssrcwerror.zip

You'll notice that the thuds on the door sound fine to begin with until like the 5th or 6th thud at which point they become cut off and muted.
The same thing happens on 3.3.0 CR

I tried with threaded audio and without and it doesnt seem to help.
This was running on windows. I havent checked other OSes.


Crimson Wizard

Alright, I see. I will test that through.
Is it the source of your MAGS game? I dled it recently too.

Calin Leafshade

This is an incomplete version of the source to the MAGS game. Near the end of the development I switch back to an earlier version of AGS because this version was too unstable (I later found out the issue extended back further so oops)

If you want to play my game first then dont use this source until you have :>

Crimson Wizard

Quote from: Calin Leafshade on Fri 02/01/2015 19:31:55
Then I made a new sound type called "GameSounds" and assigned all the audio clips to that and it seemed to solve the problem.
Hm, can you tell, which properties this audio type had?

Calin Leafshade


Crimson Wizard

Calin, this problem is related to the following script:

Sounds.asc
Code: ags

function repeatedly_execute_always() {
    int delta = -5;
    if (windy) 
        delta = 5;
    windChannel.Volume = Maths.ClampInt(windChannel.Volume + delta,  0,  windVol);
}


If I remove the call to windChannel.Volume, the sound continues to play normally.

I should note that the Wind clip is not repeated by default, nor asked to play repeatedly, so it is supposed to stop soon after running. Yet you continue to set channel's volume all the time through the game.

I am not yet sure how it works internally, maybe this causes corruption in data or some conflict. I'll investigate further.

Calin Leafshade

Ah its supposed to loop so I thought it would keep hold of the channel and then fade up the wind when outside and fade out otherwise.

Crimson Wizard

#128
It appears that in AGS the AudioChannel script pointer has no invalidation if the clip stops; it keep same channel id all the time.
The Wind sound starts earlier than "Thump", and when it ends, the next "Thump" instance will be played on same channel as was used for Wind. And all the consequent changes to that channel will affect other sound instead...

portableTaco

Hey CW...do the custom resolutions only apply to D3D and not directDraw5? When I started my empty project template it was auto defaulted to directDraw5, and upon using say, 800x600 I get no issues.  But, when I switch to 1366x768 I get an error similar to Meekah on page 5 of this thread.  If this is because it doesn't work with directDraw5, then forgive me for misunderstanding, but I will include this just because I thought more systems were compatible with directDraw5 (at least in 2010....)?

Here's the error:
---------------------------
Illegal exception
---------------------------
An exception 0xC0000005 occurred in ACWIN.EXE at EIP = 0x00473B35 ; program pointer is -3, ACI version 3.4.0.2, gtags (1,30)

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

Most versions of Windows allow you to press Ctrl+C now to copy this entire message to the clipboard for easy reporting.
An error file CrashInfo.dmp has been created. You may be asked to upload this file when reporting this problem on the AGS Forums. (code 0)
---------------------------

Thanks! =D

Crimson Wizard

@portableTaco, well Mikah never answered to my questions...
As I said, unfortunately I lost some files required to read crash dumps. I'll make new ones when next version is released (very soon).

Regarding your questions:
1) Custom resolutions apply to the game, not gfx renderer. Renderers just told to draw it.
2) Depending on your system some renderer may not work, or may not support some modes. On other hand, it could try to run your game in different (scaled) size.
3) DirectDraw 5 is inferior to D3D9 and may not be properly supported on newer systems.

4) Regardless of all this, engine is not supposed to crash like that; even if some error is encountered it should give you clear message and shutdown normally.

I'll be looking in your problem in following days. I plan to upload a new version later today, when this happens please take a chance to upgrade and see if the bug is still there.

Crimson Wizard

#131
AGS 3.4.0.3 (Alpha) - Click And Script

ZIP-archive:
http://www.mediafire.com/download/x1laei0i9azbm11/AGS_3.4.0.3-Alpha-ClickAndScript.zip

Debug symbols (for developers):
http://www.mediafire.com/download/xv5d2otjnl709d1/PDB_3_4_0_3.zip

This release fixes nasty bugs we had with new game building system, and adds a lot of interesting stuff to Script API.

Includes all changes from 3.3.3 release

What's new since 3.4.0.2:

Common features
Custom properties max limit is removed


Editor
Improvements
* Removed the lower limit of custom game resolution (was 128 pixels). Now you can create games as small as 1x1 if you desire.

Bug Fixes
* Fixed several errors in new game compiler (introduced in 3.4.0.2).
* Fixed legacy compiler option not working properly (introduced in 3.4.0.2).
* Fixed project items could sometimes get incorrectly arranged inside the folder (I hope I got this right, let Tzachs or monkey_05_06 correct me on this).


I remind you that since 3.4.0.2 there is a new game compiling system. You may enable old game compiler with a checkbox in Editor Preferences:
Spoiler


[close]
Try using this if you got any strange problems after building your game in new version of the Editor.
NOTE: this option will be removed after we become sure that everything works correct.



Script API

ProcessClick -> Room.ProcessClick
The old ProcessClick() global function is now a static function of Room class. You may need to fix your scripts if you use it, or disable "Enforce object-based scripting" option in Game Settings.

Mouse clicking simulation

Mouse.Click(MouseButton)
This function fires mouse click event at current mouse position (at mouse.x / mouse.y).
So you can do following:
Code: ags

    Mouse.SetPosition(100, 100);
    Mouse.Click(eMouseLeft);

This will simulate user click at (100,100).

GUI.Click(MouseButton) and Button.Click(MouseButton)
Run the OnClick event handler for the GUI or Button, if there is one.
Code: ags

    btnStart.OnClick(eMouseLeft); // simulate user press on a button


GUI.ProcessClick(int x, int y, MouseButton))
Performs default processing of a mouse click at the specified co-ordinates, similar to old ProcessClick, but affects only interface (GUI and any child controls).
Code: ags

    GUI.ProcessClick(50, 120, eMouseRight); // simulate user click with right mouse button on GUI



Improved Custom Dialog Options rendering

Following callbacks are now supported for custom dialog options rendering:

Code: ags

  // runs each tick when dialog options are on screen
  void dialog_options_repexec(DialogOptionsRenderingInfo *info);
  // runs when user pressed a key while dialog options are on screen
  void dialog_options_key_press(DialogOptionsRenderingInfo *info, eKeyCode key);


Additionally following items added to DialogOptionsRenderingInfo struct:
Code: ags

  bool RunActiveOption(); // runs the active dialog option (defined with ActiveOptionID property)
  void Update(); // forces dialog options to redraw itself ("dialog_options_render" callback will be called)


--- ATTENTION, breaking changes! ---
* You must now explicitly run active option, even if you use mouse controls.
* You must now explicitly reset active option if the mouse is not above options UI
* The "dialog_options_get_active" callback is now NOT called, at all. It is supported only for backwards compatibility when running old games.
You will need to slightly change the logic of your script. In most cases it will be enough to simply rename "dialog_options_get_active" to "dialog_options_repexec".


Following are two examples of making custom dialog options with the new script system:

1. Classic mouse controls
Spoiler

int dlg_opt_color = 14;
int dlg_opt_acolor = 13;
int dlg_opt_ncolor = 4;

function dialog_options_get_dimensions(DialogOptionsRenderingInfo *info)
{
    // Create a 200x200 dialog options area at (50,100)
    info.X = 50;
    info.Y = 100;
    info.Width = 200;
    info.Height = 200;
}

function dialog_options_render(DialogOptionsRenderingInfo *info)
{
    info.Surface.Clear(dlg_opt_color);
    int i = 1,  ypos = 0;
    // Render all the options that are enabled
    while (i <= info.DialogToRender.OptionCount)
    {
        if (info.DialogToRender.GetOptionState(i) == eOptionOn)
        {
            if (info.ActiveOptionID == i) info.Surface.DrawingColor = dlg_opt_acolor;
            else info.Surface.DrawingColor = dlg_opt_ncolor;
            info.Surface.DrawStringWrapped(5, ypos, info.Width - 10,
                    eFontFont0, eAlignLeft, info.DialogToRender.GetOptionText(i));
            ypos += GetTextHeight(info.DialogToRender.GetOptionText(i), eFontFont0, info.Width - 10);
        }
        i++;
    }
}

function dialog_options_repexec(DialogOptionsRenderingInfo *info)
{
    info.ActiveOptionID = 0;
    if (mouse.y < info.Y || mouse.y >= info.Y + info.Height ||
        mouse.x < info.X || mouse.x >= info.X + info.Width)
    {
        return; // return if the mouse is outside UI bounds
    }

    int i = 1, ypos = 0;
    // Find the option that corresponds to where the player clicked
    while (i <= info.DialogToRender.OptionCount)
    {
        if (info.DialogToRender.GetOptionState(i) == eOptionOn)
        {
            ypos += GetTextHeight(info.DialogToRender.GetOptionText(i), eFontFont0, info.Width - 10);
            if ((mouse.y - info.Y) < ypos)
            {
                info.ActiveOptionID = i;
                return;
            }
        }
        i++;
    }
}

function dialog_options_mouse_click(DialogOptionsRenderingInfo *info, MouseButton button)
{
    info.RunActiveOption();
}

[close]

2. Keyboard controls
Spoiler

int dlg_opt_color = 14;
int dlg_opt_acolor = 13;
int dlg_opt_ncolor = 4;

function dialog_options_get_dimensions(DialogOptionsRenderingInfo *info)
{
    // Create a 200x200 dialog options area at (50,100)
    info.X = 50;
    info.Y = 100;
    info.Width = 200;
    info.Height = 200;
    info.ActiveOptionID = 1; // set to first option
}

function dialog_options_render(DialogOptionsRenderingInfo *info)
{
    info.Surface.Clear(dlg_opt_color);
    int i = 1,  ypos = 0;
    // Render all the options that are enabled
    while (i <= info.DialogToRender.OptionCount)
    {
        if (info.DialogToRender.GetOptionState(i) == eOptionOn)
        {
            if (info.ActiveOptionID == i) info.Surface.DrawingColor = dlg_opt_acolor;
            else info.Surface.DrawingColor = dlg_opt_ncolor;
            info.Surface.DrawStringWrapped(5, ypos, info.Width - 10,
                    eFontFont0, eAlignLeft, info.DialogToRender.GetOptionText(i));
            ypos += GetTextHeight(info.DialogToRender.GetOptionText(i), eFontFont0, info.Width - 10);
        }
        i++;
    }
}

function dialog_options_key_press(DialogOptionsRenderingInfo *info, eKeyCode keycode)
{
    if (keycode == eKeyUpArrow && info.ActiveOptionID > 1)
        info.ActiveOptionID = info.ActiveOptionID - 1;
    if (keycode == eKeyDownArrow && info.ActiveOptionID < info.DialogToRender.OptionCount)
        info.ActiveOptionID = info.ActiveOptionID + 1;
    if (keycode == eKeyReturn || keycode == eKeySpace)
        info.RunActiveOption();
}
[close]


System.RuntimeInfo
This property returns a string, which contains runtime information, same as you were getting when pressed Ctrl+V (Ctrl+Alt+V - since AGS 3.3.3).


Engine
Bug Fixes
* Fixed crash caused by "break" or "continue" statement inside a loop if there were local variables declared inside the loop.
* Fixed rare pathfinding bug (introduced in 3.3.1.1165)


WinSetup
Improvements
* You can now make actual language name displayed instead of "Game Default" if you put following line in the "[language]" section of acsetup.cfg:
Code: text

default_translation_name = "British"


Bug Fixes
* Fixed crash when game resolution is equal or higher than current display resolution and user clicked on "Windowed" checkbox.

dbuske

#132
Found a bug or error in the newest alpha put out today.
GlobalScript.asc(222): Error (line 222): Undefined token 'ProcessClick'
I am using Win 7 premium 64bit
It was during starting to compile and run a game
I was not using process click
What if your blessings come through raindrops
What if your healing comes through tears...

Calin Leafshade

Quote from: Crimson Wizard on Sun 04/01/2015 19:44:23
Script API

ProcessClick -> Room.ProcessClick
The old ProcessClick() global function is now a static function of Room class. You may need to fix your scripts if you use it, or disable "Enforce object-based scripting" option in Game Settings.

dbuske

Thanks Calin, I turned off forcing object based scripting and it compiled and ran the game
What if your blessings come through raindrops
What if your healing comes through tears...

portableTaco

Quote from: Crimson Wizard on Sun 04/01/2015 18:28:14
I'll be looking in your problem in following days. I plan to upload a new version later today, when this happens please take a chance to upgrade and see if the bug is still there.

I checked it again with the new version you released and yes, it still crashes in the same way. 

Crimson Wizard

Quote from: portableTaco on Mon 05/01/2015 06:02:06
Quote from: Crimson Wizard on Sun 04/01/2015 18:28:14
I'll be looking in your problem in following days. I plan to upload a new version later today, when this happens please take a chance to upgrade and see if the bug is still there.

I checked it again with the new version you released and yes, it still crashes in the same way. 
Can you upload a crash dump?

portableTaco

Quote from: Crimson Wizard on Mon 05/01/2015 14:32:21
Can you upload a crash dump?

Not a problem at all. This was the only 3.4.0.3 .dmp in my project directory, so I'm assuming this is what you're after.  Hope this helps!
http://www.mediafire.com/download/vhez371hrkmfhms/CrashInfo.3.4.0.3.dmp

Crimson Wizard

Quote from: portableTaco on Tue 06/01/2015 07:15:41
Quote from: Crimson Wizard on Mon 05/01/2015 14:32:21
Can you upload a crash dump?

Not a problem at all. This was the only 3.4.0.3 .dmp in my project directory, so I'm assuming this is what you're after.  Hope this helps!
http://www.mediafire.com/download/vhez371hrkmfhms/CrashInfo.3.4.0.3.dmp

Can I ask you about something else: put following line into acsetup.cfg under [misc] section:
Code: txt

log=1

Then run the game. A log file "ags.log" should appear in standard Saved Games folder, in ".ags" subfolder. Can you attach it also?

portableTaco

#139
Quote from: Crimson Wizard on Tue 06/01/2015 12:32:15
Can I ask you about something else: put following line into acsetup.cfg under [misc] section:
Code: txt

log=1

Then run the game. A log file "ags.log" should appear in standard Saved Games folder, in ".ags" subfolder. Can you attach it also?
Here's the .log file for the crash.  It happens when I hit F5 to run in the Editor.
http://www.mediafire.com/download/wvb4jv52nb7ukb7/ags.log

However after seeing the log file I think I may have figured out why it's crashing.  When I run it in the editor, I'm hitting F5 to run, and the log file has the following error:
Code: ags

Attempting to find nearest supported resolution for screen size 1366 x 768 (32-bit) windowed
Attempt to switch gfx mode to 1366 x 736 (32-bit) windowed; game frame: 1366 x 768, frame placement: proportional
Failed. Unable to find a suitable graphics driver
Attempting to find nearest supported resolution for screen size 1366 x 768 (24-bit) windowed
Attempt to switch gfx mode to 1366 x 736 (24-bit) windowed; game frame: 1366 x 768, frame placement: proportional
Failed. Unable to find a suitable graphics driver

What was weird to me was that when I tried to run the game from the compiled .exe, it ran fine even when I had compiled with directDraw5 selected as the renderer. It turns out that if I run it in the editor as CTRL+F5 to run without the debugger, it also runs fine.  So I looked at the new log file and lo and behold, it adds this line after the two failed windowed attempts:
Code: ags

Attempting to find nearest supported resolution for screen size 1366 x 768 (32-bit) fullscreen
Attempt to switch gfx mode to 1366 x 768 (32-bit) fullscreen; game frame: 1366 x 768, frame placement: center
Succeeded.

Seems like it gave up on Windowed mode and attempted Fullscreen instead, which in this instance was fine for the driver so it worked.  But, for whatever reason the normal run (F5) does no such attempt to fallback on fullscreen mode, so it crashes.  All my other "successful" directDraw5 runs have all fallen back on Fullscreen mode.  However direct3D does create the Window successfully:

Code: ags

Attempting to find nearest supported resolution for screen size 1366 x 768 (32-bit) windowed
Attempt to switch gfx mode to 1366 x 736 (32-bit) windowed; game frame: 1366 x 768, frame placement: proportional
Succeeded. Using gfx mode 1366 x 736 (32-bit) windowed


SMF spam blocked by CleanTalk