AGS 4.0 - Alpha 17 for public test

Started by Crimson Wizard, Thu 01/06/2023 14:00:59

Previous topic - Next topic

Crimson Wizard

This temp build should have the problem with autocomplete crashing fixed:
https://cirrus-ci.com/task/6320305364271104

yarooze

Sorry, but it's me again.

It seems for me, that the function Character.AddWaypoint doesn't work as described: https://adventuregamestudio.github.io/ags-manual/Character.html#characteraddwaypoint


If I put it into the default game, the character walks endless on the 50,145 point and sometimes the game crashes then:
Code: ags
function room_AfterFadeIn()
{
  cEgo.Walk(50, 145);
  cEgo.AddWaypoint(100, 145);
}

If I remove AddWaypoint line, then cEgo stops on the 50,145.

Am I doing something wrong?
My Blog

Crimson Wizard

Quote from: yarooze on Thu 26/12/2024 22:30:35and sometimes the game crashes then

Please tell is there any error message when it crashes?

yarooze

#163
Quote from: Crimson Wizard on Thu 26/12/2024 22:50:52
Quote from: yarooze on Thu 26/12/2024 22:30:35and sometimes the game crashes then

Please tell is there any error message when it crashes?


Looks like this:
https://get.hidrive.com/i/JNHiHwr8

then sometimes this message:

Code: ags
---------------------------
Illegal exception
---------------------------
An exception 0xC0000005 occurred in ACWIN.EXE at EIP = 0x779928CF; program pointer is +9908, engine version 4.0.0.11, gtags (0,9)

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.



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)
---------------------------
OK   
---------------------------

My Blog

Crimson Wizard

@yarooze there was a bug in AddWaypoint, here's a temp build with a fix:
https://cirrus-ci.com/task/5025614987526144

yarooze

Quote from: Crimson Wizard on Fri 27/12/2024 01:54:47@yarooze there was a bug in AddWaypoint, here's a temp build with a fix:
https://cirrus-ci.com/task/5025614987526144
It works. Thank you.

PlaySound("Your sound card works perfectly!");
My Blog

Crimson Wizard

Updated to Alpha 17
(Please use download links in the first post)

Contains all the new features and fixes from 3.6.2 Beta 5 (excepts ones related to backwards compatibility).


Own changes:

Editor:
- Fixed incorrect default values of GUI color properties (BackgroundColor, etc). This is a regression in 4.0 Alphas since we support full 32-bit color range values.
- Fixed default value of ListBox's SelectedBackgroundColor is being treated as "transparent", for the same reason.

Scripting:
- May omit struct's name when addressing a static member from within a struct's member function.

Script API:
- Added Game.RoomCount, RoomNumbers[] and RoomNames[] properties.
- Added Room.Number and Name properties.

Engine:
- Fixed program exception when Character.AddWaypoint() is called in script.


Baguettator

Hi,

I'm trying to test AGS 4.0 with my project developped on AGS 3.6.1.

I'm adjusting some of the deprecated functions now.

In AGS 4.0, is there a way to play MP3 files (or audio files) placed in the game's directory ? Before, I used to use the PlayMP3 function (with an old-style scripting enabled in general settings if I remember well).

Also, it doesn't seem Tween module is compatible with AGS 4.0 ?

And last question : is it normal that each time I want to launch my game, all the rooms are recompiled ? (even if I didn't change any Header script files)

Crimson Wizard

#168
Quote from: Baguettator on Thu 02/01/2025 12:43:28In AGS 4.0, is there a way to play MP3 files (or audio files) placed in the game's directory ? Before, I used to use the PlayMP3 function (with an old-style scripting enabled in general settings if I remember well).

No. We have discussed a possible replacement, but it was not done yet.

Quote from: Baguettator on Thu 02/01/2025 12:43:28Also, it doesn't seem Tween module is compatible with AGS 4.0 ?

It may require fixing some syntax mistakes.

Quote from: Baguettator on Thu 02/01/2025 12:43:28And last question : is it normal that each time I want to launch my game, all the rooms are recompiled ? (even if I didn't change any Header script files)

No, it's not normal.
But this is a known problem if you have just upgraded your project, then all rooms will be recompiled after fixing any mistake in script.
If that's the case, one way to fix this is to open Game.agf.user in a notepad and change value of "<RequiresRebuild>True</RequiresRebuild>" to "False".

Baguettator

Thanks Crimson !

I encounter a problem with the upgrade of AGS 4.0 : my game places tokens like in a tabletop game, it's gui's buttons with a dynamicsprite.CreateFromFile as visual. Sometimes it has to be rotated.

In AGS 4.0, all the sprites look "grey", like with black lines on them. And the larger sprites (supposed to be tiles, larger than tokens) are not displayed at all (only full black squares, I tested with a script that displays a text if I click on these buttons, and the text is well displayed. So the button is here, it has correct width/height, but it's full black instead of its intended picture).

https://drive.google.com/file/d/1IOlLnlPJ1-rahRnH7AoCIa-tobb5RlSe/view?usp=sharing

In AGS 3.6, everything was working perfectly...

Any idea ?

The only thing I changed by upgrading to AGS 4.0, is to remove the bool parameter in DynamicSprite.Create and DynamicSprite.CreateFromExistingFile, and these are not used for that tokens and tiles because I use sprites that are not imported in my game's editor. These images are in the Game's directory, and they are BMP files (or sometimes PNG, but on my examples they are BMP).

The buttons with the image displayed correctly in my example are buttons that have their sprite already imported in my editor's game. So they have no problem.

Baguettator

Also, another problem (or difference between AGS 3.6 and 4.0, if intended or not ?) I noticed :

In my code, I had this line :

Code: ags
String tmp_name="tmp";
File* tmp = File.Open(tmp_name, eFileWrite);

It was supposed to open (create) a file that didn't exist before, write in it, then copy its content into another file, then delete it (I think it's a bit weird to do that way, it's from a module I didn't make, but anyway...).

In AGS 3.6, no problem.

In AGS 4.0, tmp was always a null pointer.

Perhaps the File.Open command wasn't containing any tag for the path of the file ? it was just the name of the file, and I don't know if by default, if no path is indicated, AGS pointed to its game's directory.

The thing is, now in AGS 4, it's a crash, it wasn't before. I don't know if it's intended ?

Crimson Wizard

#171
Quote from: Baguettator on Thu 02/01/2025 19:30:03Perhaps the File.Open command wasn't containing any tag for the path of the file ? it was just the name of the file, and I don't know if by default, if no path is indicated, AGS pointed to its game's directory.

The thing is, now in AGS 4, it's a crash, it wasn't before. I don't know if it's intended ?

You should always insert a location token into the path. When you do not, AGS assumes "game's directory", which is forbidden for writing files.

In AGS 3 there was a backwards compatible mode, where in such case it would remap the path to "$APPDATADIR$" instead.

Initially it was supposed to work only for older games, but someone persuaded me to change it and make it work for new games too, which is a mistake in my opinion. Anyway, it seems people might be using this in 3.* versions without realizing what is going on.

AGS 4 is strict about this.

Baguettator

OK, thanks for the explanation ! It's not a problem for me, I corrected the script :)

Any idea about the sprite problem I wrote before ?

Crimson Wizard

Quote from: Baguettator on Thu 02/01/2025 15:00:41I encounter a problem with the upgrade of AGS 4.0 : my game places tokens like in a tabletop game, it's gui's buttons with a dynamicsprite.CreateFromFile as visual. Sometimes it has to be rotated.

In AGS 4.0, all the sprites look "grey", like with black lines on them. And the larger sprites (supposed to be tiles, larger than tokens) are not displayed at all (only full black squares, I tested with a script that displays a text if I click on these buttons, and the text is well displayed. So the button is here, it has correct width/height, but it's full black instead of its intended picture).

https://drive.google.com/file/d/1IOlLnlPJ1-rahRnH7AoCIa-tobb5RlSe/view?usp=sharing

Please upload an example of image, and post an example of a script command that loads this sprite into the game, so that I could test this.

Baguettator

#174
OK, here a folder with all the tokens I use. You find the tiles in the "Dalles" repertory, and the other tokens in every other directory.

https://drive.google.com/file/d/1uJiEOUisX77uaZZcMvKmSYU2k5uif5U9/view?usp=sharing

My script is very simple.

Code: ags
struct Token
{
DynamicSprite *ds;
};

Token token[50];

function CreateTokens(int id, String path, int angle)
{
  token[id].ds=DynamicSprite.CreateFromFile(path);
  if (angle>0) token[id].ds.Rotate(angle);
  gTabletop.controls[id].NormalGraphic=token[id].ds.Graphic;
  gTabletop.controls[id].Visible=true;

  // etc...
}

EDIT : it seems very strange, some sprites are displayed strangely (as I have shown in my previous screenshot), but some sprites don't appear at all, like if they were totally transparent...

Baguettator

#175
I found something annoying with the last update of AGS 4, it's that when you test the game with the editor, and the game crashes, the call stacks and the little message telling you what happenned are not displayed, you have to go to "window=>call stack" to see them, and you click "okay, close the game", the game doesn't close and the editor is stuck in debugging mod. (you can modify it, but you need Ctrl+Alt+Suppr to close it for real)

EDIT : seems to not concern every crash reason.

EDIT 2 : new problem I encounter in AGS 4. If I attach a function On_Click on a button called "Objectif", the function is by default called Objectif_OnClick. If I rename it, let say Fouille, then in the editor I click in the "..." button of on_click function in the right panel of the gui's window (with the Objectif button selected, so in this box there is the name of its onclick function, so in my case it's written Fouille), the editor creates a new function called Fouille. Previously in AGS 3.6, he knew that there was a function called Fouille, and he didn't create a new one, he jumped to the right function directly.

Crimson Wizard

Quote from: Baguettator on Fri 03/01/2025 15:17:43EDIT 2 : new problem I encounter in AGS 4. If I attach a function On_Click on a button called "Objectif", the function is by default called Objectif_OnClick. If I rename it, let say Fouille, then in the editor I click in the "..." button of on_click function in the right panel of the gui's window (with the Objectif button selected, so in this box there is the name of its onclick function, so in my case it's written Fouille), the editor creates a new function called Fouille. Previously in AGS 3.6, he knew that there was a function called Fouille, and he didn't create a new one, he jumped to the right function directly.

This may be the case with AGS 3.6.2 too (will need to test this), because this is where some additions to event creation and linking were done first.

Baguettator

Alright, thanks !

Have you looked into the sprite rendering issue ? (no pressure, just to know if you indentified at the problem)

Crimson Wizard

Quote from: Baguettator on Fri 03/01/2025 20:10:46Have you looked into the sprite rendering issue ? (no pressure, just to know if you indentified at the problem)

I did reproduce the problem, but did not have time to investigate this yet.

Baguettator

Nice, happy to know it's also for the others :D

Hope you'll be able to fix it !

I'm testing AGS 4.0 as deeply as I can with my game. I'll report if I encounter anything else !

Thanks a lot for developing the tool :)

SMF spam blocked by CleanTalk