AGS 4.0 - Alpha 23 for public test

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

Previous topic - Next topic

Pax Animo

- Edit -> Find: enter something, press Ok, first instance found (works fine, the UI for find and replace opens)
- Edit -> Find Next: UI doesn't open (clicks out of the - Edit menu dropdown)
Misunderstood

Pax Animo

#441
These also work as intended:
- Edit ->Replace
- Edit ->Replace all

I'm using a empty Game Template if that helps in anyway
Misunderstood

Crimson Wizard

Quote from: Pax Animo on Sat 30/08/2025 16:21:59- Edit -> Find Next: UI doesn't open (clicks out of the - Edit menu dropdown)

But "Find Next" is not supposed to open any UI, it should just move the caret to the next found instance, if there's any.

Pax Animo

Opps, sorry I misunderstood it's usage. Sorry for wasting your time. :-[
Misunderstood

Baguettator

Now AGS 4.0 (I think previous versions couldn't) can use saves even if the game has been modified a bit. It depends on what has been changed.

Is it possible to know which data makes an older save incompatible ? My Save Listbox is filled with the save files that are "compatible" (are going to work with the current version of my game). As I'm testing it, I'd like to know what I can do without making the savegames obsolete. Creating new variables ? New functions ?

Crimson Wizard

Quote from: Baguettator on Tue 02/09/2025 11:38:12Now AGS 4.0 (I think previous versions couldn't) can use saves even if the game has been modified a bit. It depends on what has been changed.

To clarify: this was added to both 3.6.2 and 4.0.

Quote from: Baguettator on Tue 02/09/2025 11:38:12Is it possible to know which data makes an older save incompatible ? My Save Listbox is filled with the save files that are "compatible" (are going to work with the current version of my game). As I'm testing it, I'd like to know what I can do without making the savegames obsolete. Creating new variables ? New functions ?

There's an article in the manual that explains that in detail:
https://adventuregamestudio.github.io/ags-manual/GameSavesCompatibility.html

This article was NOT updated after the new feature (I'm planning to do so), therefore when reading it keep in mind that SOME of these changes can still be tried to be restored with a new feature.

As for the new feature. There's a related explanation in the manual here in "Upgrading to 3.6.2" article:
https://adventuregamestudio.github.io/ags-manual/UpgradeTo362.html#loading-old-saves-feature

In very simple words, it can read saves which has less items of any kind. For example: save has 4 characters, new game version has 6 characters. Old save has 100 integer variables in script, new game version has 200 integer variables. In such case it can still read the save, restoring the values of these less items, while resetting the others to their default values. While doing so it only guarantees the correct result if you added new items at the end. If you remove an item in the middle of the list, then engine will NOT be able to figure that out. That's the biggest restriction.

Baguettator

Thanks for the answer, I will have a look at it !

Using your last build (not the last "official" release), I see that changing color for selected text and selected background for listboxes in editor doesn't show the end result on the GUI window.

EDIT : it seems that all the listboxes are displayed with texts using the color of the "text color" property and no background selected color. (in editor)

Crimson Wizard

Quote from: Baguettator on Wed 03/09/2025 07:01:56Using your last build (not the last "official" release), I see that changing color for selected text and selected background for listboxes in editor doesn't show the end result on the GUI window.

EDIT : it seems that all the listboxes are displayed with texts using the color of the "text color" property and no background selected color. (in editor)

It's not that, it simply does not select the first item in the GUI preview. The colors are fine in game.
This bug came from recent changes, it's already fixed in 3.* branch but not in 4.*. I will merge them in a short while.

Baguettator

Yeah, exactly. Thanks :)

Maybe this feature has already been requested : could it be possible to have something like a tag or a special function that we can use to debug the game, generating for example text in a txt file for debugging, but these lines of texts would be skipped (not included) into the translation file ? I have the feeling it's always useful to keep debugging lines in a game even if the game has been quite playtested, but it could be annoying if there are so many of these lines inside the translation file.

eri0o

Could you re-explain what you mean with different words and it's use case?

Crimson Wizard

#450
Quote from: eri0o on Wed 03/09/2025 20:58:41Could you re-explain what you mean with different words and it's use case?

He means simply don't include debug messages and logging texts into translation, because they are not meant to be translated.

We'd need some sort of a tag or annotation system for this in script.

As a very simple (and perhaps temporary) implementation, we could make so that editor skips texts found in certain function calls, like System.Log, or custom functions defined by user. The problem with such approach is that sometimes these texts may be created and assigned to String variables prior passing into a function, in which case editor won't be able to detect them.

Another option is to skip texts that have certain user-defined prefix. Like, if there's a text starting with "[DEBUG]" or "[LOG]", etc.

Baguettator

Exactly what I meant ! I'm sorry, I can't think another way to say it more easily !

Baguettator

About TextBoxes : I have the feeling that it's a bit annoying that we can't use on_key_press function while a textbox is visible on screen. In my case, I use one of it for the saveload GUI, that's very useful, but I can't use any  keyboard shortcut in-game to close/confirm (like pressing "escape" or "return") because of the textbox priority.

Is it essential that it blocks anything ? I know I could code my own, but if there is a built-in one, it could be a little less limiting ?

Crimson Wizard

#453
Quote from: Baguettator on Yesterday at 04:43:17About TextBoxes : I have the feeling that it's a bit annoying that we can't use on_key_press function while a textbox is visible on screen. In my case, I use one of it for the saveload GUI, that's very useful, but I can't use any  keyboard shortcut in-game to close/confirm (like pressing "escape" or "return") because of the textbox priority.

Is it essential that it blocks anything ? I know I could code my own, but if there is a built-in one, it could be a little less limiting ?

That's a good point, we need to think this over.

Normal GUI system has 2 mechanics:
- Focus, that tells which control is currently receiving an input
- Input propagation (or override), which means that if an input was not handled by focused control, then it goes "up" to parent, and then to parent's parent, and so on; or other way around, depending on how do you prefer to build your system. This also lets the parent to override input sent to controls. By "parent" we may assume the whole game as well, since it "parents" GUI.

As usual, one approach is big redesign, another is a smaller intermediate step which would allow just a minimal control over these things.

Baguettator

Sure ! I don't fully understand how the "parent" thing works, it's a bit early for my coding level :) But having TextBox blocking any key input, it's a bit frustrating. Perhaps for now, we could have a "bypass" control over it ? If I understand well, presing a key when there is a TextBox on screen doesn't launch the on_key_press function. Can this be changed ? So the on_key_press is called too ?

Also, I have another request : I use the "Set" struct to order a listbox with alphabetical order. The problem is that currently, letters like É, À, Ô etc... are considered after letter "Z". Is it possible to change so that the order would be : A, À, B, C, D, E, É, È, Ê, F, G, etc... ? Perhaps there is something like an official / standard method to order this kind of letters internationally speaking ?


Snarky

#455
I feel I should point out that the TextField module behaves more like you would expect, with a notion of focus and only consuming keypresses that are used for text entry, so that you can handle Enter and Esc separately. (By default it has Enter set as a shortcut for activating the field, but you can override this.)

Crimson Wizard

#456
Quote from: Baguettator on Yesterday at 11:24:05Perhaps for now, we could have a "bypass" control over it ? If I understand well, presing a key when there is a TextBox on screen doesn't launch the on_key_press function. Can this be changed ? So the on_key_press is called too ?

This cannot be done unconditionally, there has to be certain rule to this. Because if we do this always for all keys, then how would you tell if any TextBox is receiving an input at all? The game may have its own reaction to the letter keys too, and they would duplicate typing in text box. This will be unexpected and quickly become inconvenient for users.

Crimson Wizard

#457
Quote from: Baguettator on Yesterday at 11:24:05Also, I have another request : I use the "Set" struct to order a listbox with alphabetical order. The problem is that currently, letters like É, À, Ô etc... are considered after letter "Z". Is it possible to change so that the order would be : A, À, B, C, D, E, É, È, Ê, F, G, etc... ? Perhaps there is something like an official / standard method to order this kind of letters internationally speaking ?

I have got a bad feeling that our Dictionary and Set functions were not properly adjusted for unicode support too. If this guess is right, then any non-latin letters in keys will be compared not as letters, but as a multi-char sequences (because one letter in utf-8 may be represented by a combination of 1-4 values), which makes no sense from human's point of view.

Regardless, we are using standard string comparison function there that uses only character codes, but not their alphabetical meaning. I might search for solutions and see if they are easy to implement.

Alan v.Drake

So we need collation for sorting. The tricky part is that collation has to be generally tied to a locale.
Different languages have different sorting expectations, but I suppose std::locale("en_US.UTF-8") should do what we expect for sorting purposes.

https://en.cppreference.com/w/cpp/locale/collate.html


- Alan

Crimson Wizard

#459
Quote from: Alan v.Drake on Today at 08:02:24So we need collation for sorting. The tricky part is that collation has to be generally tied to a locale.
Different languages have different sorting expectations, but I suppose std::locale("en_US.UTF-8") should do what we expect for sorting purposes.

https://en.cppreference.com/w/cpp/locale/collate.html

The problem with this function is that these locale names depend on compilers, and the locale support depends on a standard library implementation. I've already met this problem elsewhere. Microsoft's compiler may expect one name format, while GCC expects another, or one of them does not support certain locales at all. Need to be careful when using this.

Here's what I am talking about:
https://github.com/adventuregamestudio/ags/blob/b8583107e9d27fed22872840c9c1355a41408685/Common/util/string_utils.cpp#L322-L323
If ".utf8" locale is not reliable, then another opportunity would be to convert from utf-8 to widechar string, and compare these with non-utf locale.

But then there's a unicode string comparison function in Allegro, it's used when comparing strings in script. Need to double check how it works, maybe it already is doing what is necessary. Because if not, then the regular string comparison will also need fixing.

SMF spam blocked by CleanTalk