AGS 4.0 - Alpha 18 for public test

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

Previous topic - Next topic

Crimson Wizard

Quote from: eri0o on Mon 06/01/2025 11:13:23I see you using the word "Opaque" a lot, and so more making a note here to remind me when making docs, alpha is actually a measure (or a value?) of Opacity. Throughout AGS Script API we use Transparency, which is the inverse. A 100 value of Transparency is a 0 value of alpha.

BTW there's a ticket that proposes to change Transparency to 0-255 alpha too:
https://github.com/adventuregamestudio/ags/issues/2549

Quote from: eri0o on Mon 06/01/2025 11:13:23Also with alpha in the color a lot of things that used to be blit can't be blit if the alpha is not 255.

This is a matter of providing a separate blitting function that supports alpha blending.
OTOH we may state that we do not support it everywhere for starters.

Baguettator

1) I have seen that AGS 4.0 is not displaying "perfectly" sprites : it seems sometimes (or always ? hard to say), there is a line (1 pixel width) that is not drawn. Also for ListBoxes' or TextBoxes' perimeter, not all the lines appear.

2) when you update the translation file, how it works ? If I have already a translation file, and then I delete some lines in my scripts : will the deleted lines be kept in the update ? I remember in 3.6, only the new lines were added (like a File.Append), but I had to delete manually in the .trs file the lines that weren't anymore in my game

3) request for quality of life : would it be possible to add an extra option for the search/replace process ? It would be great if we could choose to search in the full script OR only in the "texts" (the ones who appear in dark red color, between ""). For example, since AGS 4.0, I have to replace many [ symbols, and it would be great to have the replace process to only look at texts zones and not the full script (because you'll have to be careful to not replace the brackets of arrays, and it would be so long, so many "next" clicks...)

Here are my last thoughts ! :)

Crimson Wizard

#202
Quote from: Baguettator on Tue 07/01/2025 11:05:591) I have seen that AGS 4.0 is not displaying "perfectly" sprites : it seems sometimes (or always ? hard to say), there is a line (1 pixel width) that is not drawn. Also for ListBoxes' or TextBoxes' perimeter, not all the lines appear.

Does this happen always, or in a particular case? Can you give a precise example, like, which object, what are this object's properties (size, position, graphic settings)? Does this happen with any graphic driver or specific one?


Quote from: Baguettator on Tue 07/01/2025 11:05:592) when you update the translation file, how it works ? If I have already a translation file, and then I delete some lines in my scripts : will the deleted lines be kept in the update ? I remember in 3.6, only the new lines were added (like a File.Append), but I had to delete manually in the .trs file the lines that weren't anymore in my game

As far as I know, nothing has changed in this regard compared to 3.6.

eri0o

A note on translation files, I believe it now uses the PO format.

ThreeOhFour

Quote from: eri0o on Mon 06/01/2025 11:13:23Throughout AGS Script API we use Transparency, which is the inverse.

This gave me trouble for years when learn AGS because drawing programs use 'Opacity' for this (and usually handle it as a percentage, as AGS does, rather than the 8 bit alpha value) and I always had to convert things backwards. I'm not proposing that this be changed, just mentioning that it always stood out as a quirk in AGS's nomenclature.

I do think it would be great to be able to access the full range of the A value for a colour, though I can't say I've ever run up against it as an issue. But I imagine now that I'm getting back into making effects inside AGS that I would quite rapidly find uses for being able to read and store RGBA colour values.

Baguettator

Quote from: Crimson Wizard on Tue 07/01/2025 12:50:51Does this happen always, or in a particular case? Can you give a precise example, like, which object, what are this object's properties (size, position, graphic settings)? Does this happen with any graphic driver or specific one?

Perhaps, just try with the sprites I sent to you, especially those which are located in "dalles" folder. In my game, they are placed one next to the other, without any gap between (side by side). In AGS 4.0, I can see white lines between some sides of them (my background is white). As I also specified, list boxes and text boxes are concerned too. I'll tell you if I see anything else !

About the translation file, I know PO format, I don't know what does it change for me. Just it would be cool if the "update translation file" command would really update it (store the already translated lines, delete everything in the file, and then add all the lines from the scripts, comparing to the stored translated lines and if they match, putting the translated line in the updated file). I have made a "game" to especially do that, but it would be more convenient to have this built-in. (hope my explications are right, I'm not sure of my english language right now !)

And what about my 3° request ? :)

Crimson Wizard

#206
Quote from: Baguettator on Thu 09/01/2025 07:57:31Perhaps, just try with the sprites I sent to you, especially those which are located in "dalles" folder. In my game, they are placed one next to the other, without any gap between (side by side). In AGS 4.0, I can see white lines between some sides of them (my background is white).

Placed how? Were you using objects, or raw drawing them on a surface?
Were these sprites imported, or loaded using DynamicSprite.CreateFromFile?
Can you tell exact name(s) of sprite(s), in case it matters?

Quote from: Baguettator on Thu 09/01/2025 07:57:31As I also specified, list boxes and text boxes are concerned too.

I put a random text box and list box on gui, and they look fine. Does this happen with ANY listbox and textbox for you, or particular ones?
Is this problem seen in the editor or only at runtime?
Does this occur with the particular graphics driver, or any of them?

Snarky

Quote from: Baguettator on Thu 09/01/2025 07:57:31Perhaps, just try with the sprites I sent to you, especially those which are located in "dalles" folder. In my game, they are placed one next to the other, without any gap between (side by side). In AGS 4.0, I can see white lines between some sides of them (my background is white). As I also specified, list boxes and text boxes are concerned too. I'll tell you if I see anything else !

Can't you post a screenshot, at least? It's almost impossible to guess what the problem might be based on the information you've provided.

One possibility is that it has to do with scaling. Are the sprites scaled in-game? Is the game scaled on the screen?

Baguettator

Yes I will give more information when I will able to test.

But, question : my savegames are 250Mo each... It seems VERY large, doesn't it ? Which things take so many place in a save file ? Variables ?

Can it be improved to have savegames lighter ?

Crimson Wizard

#209
Quote from: Baguettator on Fri 10/01/2025 21:53:46But, question : my savegames are 250Mo each... It seems VERY large, doesn't it ? Which things take so many place in a save file ? Variables ?

Can it be improved to have savegames lighter ?

For instance, dynamic sprites are all written in saves by default.
You may avoid that using a new feature (introduced in 3.6.2 and latest 4.0), which allows to exclude dynamic sprites from saves. This is explained here:
https://adventuregamestudio.github.io/ags-manual/UpgradeTo362.html#restricting-the-data-read-or-written-in-a-save

This comes with an obvious problem: you must recreate all the necessary dynamic sprites for the current scene on "eEventRestoreGame" event.

Apart from that, I think you have mentioned that your game is not a standard point and click adventure game, but some kind of a base building strategy game?
In which case I would rather recommend designing your own save system instead. That could be much more convenient than using AGS save states, as you will fully control what is saved and loaded, what is kept intact when restoring a save, and what gets overwritten.

Baguettator

Thanks for explanations !

I had a crash for an array out of size, and the runtime executable (the program which runs the game while in the editor) didn't close normally. Perhaps this kind of error causes that issue ?

eri0o

It would be nice to get bug reports that are minimal, complete and verifiable.

QuoteMinimal – Use as little code as possible that still produces the same problem
Complete – Provide all parts needed to reproduce the problem
Verifiable – Test the code you're about to provide to make sure it reproduces the problem

I think without something that can be run and reproduces any issue it is very hard to grasp anything of what you are reporting. I refrained from writing this because it is useful to get some reporting of bugs but it's hard to act without having anything, ideally, make a small new AGS game that reproduces the issue and attach it somewhere that can be downloaded and link here.

Think in this way, someone writes a bad review in Steam about your game and then just say "bugs", but doesn't clarify any details, it would be nice to get everything needed to reproduce and fix such issues so others get to enjoy the game.

Baguettator

Sorry, I wrote it quickly because I already reported here this issue (when the runtime executable doesn't close normally), but really this message is so far now... Apologizes...

The thing is I had something like that :

Code: ags
for (int i=0 ; i<7 ; i++)
{
  btn[i].Visible=true;
}

The btn array's size was [6], so the game crashed (out of array size). And this crash reproduced the "runtime executable doesn't close normally" issue.

Baguettator

OK, so here's the problem with "transparent lines" appearing around sprites. I don't know if it's for any sprites, but at least for the tiles in my example (big squares), it's easy to see.

https://drive.google.com/file/d/149PE4pu_DI8YVueWZiyg_5tY4NOXpgAW/view?usp=sharing

I can imagine it's something about rotating sprites. This problem appears with both Draw functions (drawing a DynamicSprite into a surface) and attributing a dynamicsprite to an object (button in my case). If that dynamicsprite is NOT rotated, no problem, no "transparent lines" on edges. If it IS rotated, then the problem happens.

In my screen shots, tiles are the squares  behind every other tokens. There are 3x3 squares, so 9 in total. The rotation of each tile can be seen with the number written on the corner of the tile : the direction of the number indicates the rotation (0, 90, 180 or 270°). Each time a tile is 90 or 270° rotated, it shows the bug.

eri0o

That is zombicide.

But can you hit new in AGS and create a small game that reproduces this specific rotation issue, and share the game project here?

Crimson Wizard

#215
Quote from: Baguettator on Sat 11/01/2025 09:50:36The btn array's size was [6], so the game crashed (out of array size). And this crash reproduced the "runtime executable doesn't close normally" issue.

I noticed a similar problem, and apparently it does not matter which error is this.
When a "An error has occured" window appears in the editor, it does not stay and disappears automatically a moment later, game shuts down on its own too (at least in my case), without waiting for you to press the button.

This happens only in AGS 4. (not in any other recently updated versions like 3.6.2)

---

EDIT:  after subsequent tests, this seem random. Sometimes it happens and sometimes is not. It looks like something closes the error popup.
I also do not see the game being stuck in debug mode, although I had an idea why that could happen sometimes (and already pushed a fix earlier).

EDIT2: not sure, but this may be related to another particular application being opened at the same time.

Crimson Wizard

#216
Quote from: Baguettator on Sat 11/01/2025 11:36:11In my screen shots, tiles are the squares  behind every other tokens. There are 3x3 squares, so 9 in total. The rotation of each tile can be seen with the number written on the corner of the tile : the direction of the number indicates the rotation (0, 90, 180 or 270°). Each time a tile is 90 or 270° rotated, it shows the bug.

Do you rotate same sprite multiple times, or do you recreate it from original each time and then rotate to the final angle?

There's a known issue that if you keep rotating same sprite again and again, then it looses quality over time.
Although, in theory, rotation by the multiples of 90 degrees should not lead to this, so idk if it's related in this case.


EDIT: I tested rotating this big tile from the sprite archive that you have uploaded earlier, and I do reproduce this problem.
It becomes worse if I keep rotating same sprite, bit also happens if I recreate it before giving it a bigger rotation.

Baguettator

I rotate them 1 time after creating them.

Crimson Wizard

#218
I confirm that there's definitely something off with the dynamic sprite rotation in AGS 4.

I made a game in 3.6.0 where I draw 4 tiles on room background, each next rotated by 90 further.

In 3.6.0 version there are no gaps between them, but when replicating same game in 4.0 there are gaps.

Here are both game projects for comparison:
https://www.dropbox.com/scl/fi/fbr8o10b805h3hwvbo6rf/test-360-dynamictilerotate.zip?rlkey=zl3lmkrvfl6zbwo54ua7r9ugq&st=rvkvia0e&dl=0
https://www.dropbox.com/scl/fi/rdmwbkmrk93ud4pyvf78h/ags4-dynamictilerotate.zip?rlkey=2exi0wau9yaw8hcwtb4lc5of8&st=9dssf1cc&dl=0

My first guess is that the dynamic sprites get unexpectedly distorted when rotated.

eri0o

#219
allegro in both ags3 and ags4 are identical except in how they work with the palette for images with palette (8-bit). The rotation code (rotate.c) in both is identical.

In ags4, in Common/gfx/allegrobitmap.h there was a comment added that is like this
Code: ags
    // Draws rotated bitmap, using angle given in degrees.
    // Warning: does not resize destination bitmap; if it's not large enough
    // then the resulting image may end up cropped.

Found the workaround, just pass the width and height properly when rotating. Using your test game @Crimson Wizard

Code: ags
function room_Load()
{
  DynamicSprite *tile = DynamicSprite.CreateFromExistingSprite(1);
  int wid = tile.Width;
  int hit = tile.Height;
  
  DrawingSurface *ds = Room.GetDrawingSurfaceForBackground();
  ds.Clear(Game.GetColorFromRGB(255, 0, 0));
  ds.DrawImage(100, 100, tile.Graphic);
  tile.Rotate(90, 250, 250);
  ds.DrawImage(100 + wid, 100, tile.Graphic);
  tile.Rotate(90, 250, 250);
  ds.DrawImage(100 + wid * 2, 100, tile.Graphic);
  tile.Rotate(90, 250, 250);
  ds.DrawImage(100 + wid * 3, 100, tile.Graphic);
  ds.Release();
}

Works fine in ags4.

SMF spam blocked by CleanTalk