AGS 4.0 - Alpha 22 for public test

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

Previous topic - Next topic

Crimson Wizard

There's another bad bug in the lasted alpha version, which prevents from creating new Fonts in game.
Following temp build has it fixed:
https://cirrus-ci.com/task/5147027429916672

arj0n

AGS Editor .NET 32-bit (Build 4.00.00.17)
v4.0.0, April 2025

Issue: error when hitting Enter key in the open text parser window in the editor while no list item is selected:
  • Open Text Parser window from the project panel
  • Have no list item selected
  • Hit enter key
  • 'Object reference not set' Error

The error msg:

Error: Object reference not set to an instance of an object.
Version: AGS 4.00.00.17

System.NullReferenceException: Object reference not set to an instance of an object.
   at AGS.Editor.frmMain.SelectPropertyByName(String propertyName)
   at AGS.Editor.TextParserEditor.lvwWords_ItemActivate(Object sender, EventArgs e)
   at System.Windows.Forms.ListView.OnItemActivate(EventArgs e)
   at System.Windows.Forms.ListView.WmReflectNotify(Message& m)
   at System.Windows.Forms.ListView.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)



Crimson Wizard

Quote from: arj0n on Sun 25/05/2025 15:10:44Issue: error when hitting Enter key in the open text parser window in the editor while no list item is selected:
  • Open Text Parser window from the project panel
  • Have no list item selected
  • Hit enter key
  • 'Object reference not set' Error

The error msg:

Error: Object reference not set to an instance of an object.


Looks like this bug is present at least since AGS 3.2.1.

arj0n

Quote from: Crimson Wizard on Sun 25/05/2025 17:48:28Looks like this bug is present at least since AGS 3.2.1.
The parser is generally a lesser used section I think, and then you still have to hit enter at a somewhat illogic moment, so not that surprisingly this minor issue stayed hidden that long :)

Monsieur OUXX

I've been trying to read through the entire thread, all the updates with the GUIs, the blending modes,  the rendering layers, the nested objects,  the constructors, the new format for dialogs export, etc.

My head is literally spinning from all the awesomeness.

I don't know if that's ever happened to any game before,  but... I genuinely think I'm coming back from Unity to AGS. 2 years ago, I had sacrificed convenience for power. And now I can come back.

In other words: THANK. YOU.
 


Crimson Wizard

There should be a big update to 4.0 Alpha in about a week or two, but since a number of serious regressions were found since the previous update, I wonder if anyone could test whatever game they are making with AGS 4 using latest "nightly" build and see if anything is wrong:
https://cirrus-ci.com/task/6429007354265600

(of course, making a project copy for this test just in case).

edmundito

I have a couple of questions:
Is there a version of the docs with the updated scripting API?

Do I need to put the .crm files in source control or are they re-built by the editor?

Crimson Wizard

#368
Quote from: edmundito on Wed 11/06/2025 14:30:13Is there a version of the docs with the updated scripting API?

No, still not, unfortunately.

We just now have got a build system that allows to have ags3 and ags4 manuals in parallel.
Alan Drake have prepared a list of things to write:
https://github.com/adventuregamestudio/ags-manual/issues/283

EDIT:
As a first iteration, one could gather the information posted here in this thread, in "Update" posts, which sometimes contain explanation of a new feature; then the related PRs on github contain explanation, script examples, and sometimes links to test projects.


Quote from: edmundito on Wed 11/06/2025 14:30:13Do I need to put the .crm files in source control or are they re-built by the editor?

.crm files are strictly output files in AGS 4, so they do not have to be put under source control now.

Crimson Wizard

#369
Updated to Alpha 22
(Please use download links in the first post)

This update contains all the new features and fixes from 3.6.2 release and 3.6.2 Patch 1 (except ones related to backwards compatibility).

Own changes:

Editor:
- Editor requires .NET Framework 4.7 to run.
- In General Settings added "GUI common controls handle only left mouse button" option that lets prevent RMB from activating gui controls, except those that have separate actions for left and right mouse buttons.
- Added XOffset and YOffset properties for the View Frames.
- Redesigned Color Finder panel, now it lets to specify alpha color component, and convert between several different color representations.
- Fixed error occuring when creating a new Font.
- Fixed error occuring when renaming a room.

Script API:
- Added ShaderProgram and ShaderInstance structs, meant for the custom shaders support.
- Added Character.Shader, GUI.Shader, GUIControl.Shader, Object.Shader, Overlay.Shader, Camera.Shader, Viewport.Shader, Mouse.CursorShader, Screen.Shader.
- Added Button.GraphicFlip property.
- Added GUIControl.Rotation.
- Added GUIControl.ScaleX and ScaleY properties, GUIControl.SetScale() function.
- ViewFrame.Flipped property is now settable and returns eFlipDirection instead of bool.
- ViewFrame.Speed property is now settable.
- Added ViewFrame.XOffset and YOffset properties.

Engine:
- Support custom shaders, initialized through script API. Shaders are loaded and compiled from GLSL (for OpenGL) or HLSL (for Direct3D) shader scripts, and may be attached to game objects, camera, or the whole game view. Shaders may have user-defined constants, and have up to 3 secondary textures on input.
- Support compressing game saves using Deflate algorithm. Added config option "compress_saves" in "misc" section, disabled by default.
- Always compress a screenshot in game save using Deflate algorithm.
- Consistent GUI translation: the values of textual properties will never be automatically translated on assignment or reading them, only the text displayed on screen will be translated.
- Fixed error occuring when either a screenshot is made, or Crossfade or Dissolve room transition is run.
- Fixed error which had a chance to occur when ordering a character to walk after recently restoring a save.
- Fixed character not making the first animation step before starting a move.



The shader support is a new big feature, and difficult to explain in few words, so I suggest reading more thorough explanation in the dedicated forum thread here:
https://www.adventuregamestudio.co.uk/forums/engine-development/experiment-ags-4-custom-shaders-support/
This will be added to the AGS 4 manual eventually.




Mehrdad

#370
Great update. Well done!
Thanks so much for adding XOffset and YOffset properties for the View Frames. It's really useful for me :P
Also for shaders.
My official site: http://www.pershaland.com/

Crimson Wizard

Quote from: Mehrdad on Mon 16/06/2025 13:44:06Thanks so much for adding XOffset and YOffset properties for the View Frames. It's really useful for me :P

Yes, these were asked for very long ago, and it appeared that AGS already have them for a long time but they were unused in the program, so I just wired them up.

Of course there's still no convenient way to set them up visually in the editor (rather than typing by hand for every frame). A View editor redesign is something that has to be done in the future.

edmundito

Found an issue when helping a friend import a game created with 3.6.0 in regards to the fonts that can be improved:

1. When the fonts were imported, only one appeared on the font file list; the rest had to be removed and reimported

2. Moving fonts into the Fonts\ folder causes all kinds of problems. It would be nice if the editor detected them and asked to see if you wanted to import them. This should be true for anything automatically added to the game that AGS recognized as valid format

Crimson Wizard

Quote from: edmundito on Thu 19/06/2025 02:28:401. When the fonts were imported, only one appeared on the font file list; the rest had to be removed and reimported

I was not able to reproduce this with a random project.
Please provide more information:
- which fonts were present in the old project
- which font files and font items appear in the upgraded project
- which files appear in the Fonts folder.


Quote from: edmundito on Thu 19/06/2025 02:28:402. Moving fonts into the Fonts\ folder causes all kinds of problems. It would be nice if the editor detected them and asked to see if you wanted to import them. This should be true for anything automatically added to the game that AGS recognized as valid format

Note that you can import from Fonts folder as well, editor is supposed to allow that.

About automated suggestion - please open a feature suggestion in github tracker.
There are a number of issues to discuss there. For instance, in regards to fonts, as fonts are separated into font files / fonts now, there's no direct match between a font file and a font. AGS can import font files, but will need some instruction about whether to create font items from them.

Baguettator

Encountered something that seems a problem : while running my game through the editor, I double clicked on a listbox that had no onclick function related, and while editor was displaying an error message saying "you can't modify the script while the game is running", a new onclick function appeared in my global script, related to that listbox.

Not a BIG problem, even if then, when I closed the game, and tried to save my project, it said "the global script has been modified externally, do you want to reload it ?". It didn't damage anything. Perhaps it's just a thing that should be reworked so the script is really locked while the editor launches the game ?

Last thing, about fonts : is it planned to be able to just import 1 font, and manipulate that font in the editor and in the game too using scripts ? Like changing its size, perhaps its style too (bold, italic etc...). It could be so convenient... But perhaps it's too complicate for now to have things working like that.

EDIT : sorry I forgot to say I'm using the last build (4.00.00.18)

Crimson Wizard

#375
Quote from: Baguettator on Tue 15/07/2025 15:54:36Encountered something that seems a problem : while running my game through the editor, I double clicked on a listbox that had no onclick function related, and while editor was displaying an error message saying "you can't modify the script while the game is running", a new onclick function appeared in my global script, related to that listbox.

This was reported before, should definitely be fixed in all affected versions.

Quote from: Baguettator on Tue 15/07/2025 15:54:36Last thing, about fonts : is it planned to be able to just import 1 font, and manipulate that font in the editor and in the game too using scripts ? Like changing its size, perhaps its style too (bold, italic etc...). It could be so convenient... But perhaps it's too complicate for now to have things working like that.

In the latest AGS 4 you can import only 1 font file and create any number of fonts from it, each with different settings. Is that what you are referring to?

"Style" (bold, italic) cannot be changed though since that's a property of a font file afaik: at least in the fonts that I've seen bold and italic styles require a separate font file. I suppose there's some trick that text processors use when registering font families, but idk if it's worth doing in AGS. If that's really necessary I guess a similar behavior could be implemented in the AGS Editor, where AGS would import not just 1 font file, but multiple font files as a "category" and choose one depending on a style. That's not a big priority though, since you can do same thing by hand, and the result shall be about the same.

In regards to modifying fonts in script, there have not been exact plans, but I suppose that eventually this may be done some day. Also, translation files could have a way to define larger range of the font settings that they use (because currently they may only tell which font number to use as "Normal font" and "Speech font", but nothing else). If translation is added after the game was finished then it may be inconvenient to choose a font which is uses without recompiling the game package.

ThreeOhFour

Finally back to building an AGS project after getting it written and when I tried to update my project from Alpha 14 of AGS 4.0 to Alpha 22 I noticed that my functions that use the DrawLine() command no longer work. Has the way dynamic sprites work changed between these versions? It doesn't crash, it's just that nothing shows up. Restoring my backup up project and opening it in the Alpha 14 build had the lines showing up as expected.

Crimson Wizard

#377
Quote from: ThreeOhFour on Today at 02:19:58Finally back to building an AGS project after getting it written and when I tried to update my project from Alpha 14 of AGS 4.0 to Alpha 22 I noticed that my functions that use the DrawLine() command no longer work. Has the way dynamic sprites work changed between these versions? It doesn't crash, it's just that nothing shows up. Restoring my backup up project and opening it in the Alpha 14 build had the lines showing up as expected.

We moved to full 32-bit ARGB colors. All colors in script must be made a 0xAARRGGBB number, or a Game.CreateColorFromRGB used.

Another potential issue is drawing with a transparent color. Since alpha component is now in play, the result is that with fully transparent color no pixels are changed. This may be worked around by setting DrawingSurface.BlendMode = eBlendCopy.

ThreeOhFour

Quote from: Crimson Wizard on Today at 02:23:44We moved to full 32-bit ARGB colors. All colors in script must be made a 0xAARRGGBB number, or a Game.CreateColorFromRGB used.

Another potential issue is drawing with a transparent color. Since alpha component is now in play, the result is that with fully transparent color no pixels are changed. This may be worked around by setting DrawingSurface.BlendMode = eBlendCopy.

That fixed it, thank you! I just replaced

Code: ags
surface.DrawingColor = 14458110;

with

Code: ags
surface.DrawingColor = 0xFFEA99FB;

and everything works properly. Cheers!

SMF spam blocked by CleanTalk