Jibble

Author Topic: AGS 3.6.0 WIP (Alpha 21) - SDL2-based engine + Unicode support  (Read 21071 times)

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
AGS 3.6.0 - Alpha - for Public Test

ACHTUNG!
This is a ALPHA version of AGS 3.6.0.
It's not considered stable yet and must go through extensive testing.
Use at your own risk. Please back up any games before opening them in this version of AGS.
New settings in this version may make your project files unusable in previous versions after saving with this version.


Last update: 14th March 2022


Preword

This release presents a SDL2-based engine. For about 2 decades AGS engine was based on Allegro 4 graphic library, which was discontinued somewhere in the early 2010-ies (only received few patches since). There was an intent to move either to Allegro 5 or SDL (1 or 2) since, but for various reasons this task was continiously postponed. Finally we have a good progress there enough to make a build for public test.
(NOTE: Allegro 5 is very different in everything, therefore it was not trivial to just go from Allegro 4 to 5. In fact it appeared to be easier to change from Allegro 4 to SDL2).

NOTE: contains all the changes from AGS 3.5.1 (Patch 9).


Credits

- SDL2 port mostly done by Nick Sonneveld;
- Improved Android port, and Web/Emscripten port made by eri0o;
- me basically gathered Nick Sonneveld's works together, tidied and fixed where necessary.
+ added more stuff (see below) and some new script commands
+ some stuff added by Alan v. Drake.
+ fernewelten (fixes)
+ panreyes (fixes)


Downloads and instructions

* Full AGS 3.6.0 as installer
* Full AGS 3.6.0 as a .zip archive
* Android game player, aka launcher (APK signed with Debug key), suitable for running any compatible AGS game.


Notable changes related to new backend and ports

Full list of changes now available here (will be posted for the final release on forums too):
https://github.com/adventuregamestudio/ags/blob/v.3.6.0.20/Changes.txt

* Freely resizable window (in desktop windowed mode, obviously).
* Software renderer uses SDL2 as a final output, meaning the actual drawing on screen may be done by anything that your system supports from DirectX to OpenGL. This presumably ensures that it works on any version of Windows.
* Fully rewritten audio playback, now uses OpenAL interface and modern SDL-based sound library.
* On Android supports both "software" and "hardware" types of renderers (they are both OpenGL but use different approaches drawing sprites and effects).
* Removed AVI/MPEG video support (may be temporary...). The main reason is that in the old engine they were implemented using Windows-only DirectX interface and Allegro 4 was already providing access to these. SDL2 does not, and it may be an extra hassle to recreate them. So this is under question now.
* For similar reasons removed support for DirectX-related functions in plugin API. I'm afraid this will break some older plugins that require DirectDraw and similar things. Direct3D plugin maybe will continue working as it wants Direct3D renderer, and that is still present.


Other Notable engine/editor changes

Editor now requires .NET Framework 4.6 (was 4.5). NOTE: the compiled games DO NOT require .NET to run.

Full Unicode support. Editor and engine can work in Unicode mode, allowing practically any human language. ASCII/ANSI mode is still supported for backward compatibility. See "Text format" option in General Settings. Additionally, translations (TRS) have individual setting. More information on translations is here: https://www.adventuregamestudio.co.uk/forums/index.php?topic=59240.0

Improved key input handling, with the purpose for easing unicode input support. This is controlled by the "Use old keyboard handling" option in General Settings: setting it to "false" will use new handling mode with extended features. See "Script API" section below for more information.

New rewritten Android game player (aka "launcher"). Suitable for building for Google Play and similar stores, can read game assets from the android-specific packages (apk, aab).

Introducing Web/Emscripten port capable of running games in browsers.

Build Android and Web/Emscripten games from the Editor.

Editor supports multiple compressions for sprites, which may be selected in General Settings. Currently available: RLE (old default) and LZW.
Also, there's an option to optimize sprite storage format to reduce disk space whenever possible. This option is separate from compression but may be used alongside for the further effect. It's enabled by default in this version.

Editor supports packing multiple speech voxes, using files in the "Speech" subfolders (e.g. "Speech\french" subfolder will produce "sp_french.vox").
Engine can switch to a different speech vox by a script command (see below).

Editor supports packing custom files into the game (General Settings -> Compiler -> Package custom data folder(s)). These may be read in script using File.Open with "$DATA$" path token.

Engine supports "borderless full-screen window" mode in addition to the real (exclusive) fullscreen.

Engine supports scripts using functions and variables (imported) from any other scripts, regardless of the script module order in the project. These still have to be declared as "import" above their use though.

There's "GUI controls clip their contents" option in the General Settings (enabled by default). This clips texts to the control's rectangle.

Configuration for TTF fonts that let display both common TTFs and ones made specifically for AGS in the past as they were meant to be.
Fixed display of certain TTF fonts which previously had their heights calculated wrongly. This could lead to texts being cut of at the bottom due to the graphical surface being not large enough.

Custom font outline thickness and style, works for automatic outlines only. In the font properties you may set how thick outline is in pixels, and choose between "Square" and "Round" style.

Removed a limit of Overlays created at the same time (was 30).

Now has 16 max Audio Channels (was 8).

Select script editor's font in the editor's Preferences.

Zoom controls on almost all panels (sprite manager, cursor, inventory item, and so on).

Debug displays, such as showing room mask and character walk paths, are now implemented as non-blocking translucent overlays, allowing you to keep playing the game while they are on. (See "Debug" script command).


New Script API

 - Expanded on_key_press callback, now supports two parameters: key code and key modifier flags: on_key_press(eKeyCode key, int mod); where "mod" argument contains key modifiers (ctrl, alt, shift, etc).
 - In the new key handling mode on_key_press is called for each actual key press; e.g. combinations like Ctrl+Z will result in two on_key_press calls, one with eKeyCtrlLeft and second with eKeyZ.
 - Implemented new on_text_input(int ch) callback which is called when the engine receives a printable character. This callback is essential for handling unicode chars in script.
 - Similarily, expanded dialog_options_key_press with the third mod argument, and implemented dialog_options_text_input callback for receiving unicode chars during the custom dialog options state.
 - Added eKey constants for Shift, Control and Alt keys.
 - Added eKeyMod enum for key modifiers constants.
 - String.AppendChar, ReplaceChar and Chars[] property are now working with the unicode characters.
 - String.Format("%c") specifier will now be able to print unicode characters.
 - Added Game.ChangeSpeechVox() and Game.SpeechVoxFilename, which work in a similar fashion to Game.ChangeTranslation and Game.TranslationFilename respectively.
 - DrawingSurface.DrawImage() and DrawSurface() now accept optional source rect coordinates, so you can draw a chosen part of the sprite directly;
Code: Adventure Game Studio
  1. DrawingSurface.DrawImage(int x, int y, int spriteSlot, optional int transparency, optional int width, optional int height,
  2.                 optional int cut_x, optional int cut_y, optional int cut_width, optional int cut_height);
- Functions for getting drawing surfaces for room areas and regions, letting you paint them at runtime:
   static Hotspot.GetDrawingSurface(), static Region.GetDrawingSurface(), GetDrawingSurfaceForWalkableArea(), GetDrawingSurfaceForWalkbehind();
 - Room.Exists(): tests if the room of certain number is available;
 - Every function accepting file path now supports "$DATA$" location token, which lets you read game resources. This was added mainly for reading custom packed files, but will work with any game resource fwiw. Opening files like this will only work in read mode, writing will fail. Examples:
Code: Adventure Game Studio
  1. File *f = File.Open("$DATA$/MyDir/myfile.txt", eFileRead);
Code: Adventure Game Studio
  1. ListBox.FillDirList("$DATA$/MyDir/*.*");
- WaitMouse(): complements other Wait* functions.
 - SkipWait(): skips current Wait (will normally only work from repeatedly_execute_always callback).
 - All the Wait* functions now accept "0" as "no timeout", in which case waiting may only be interrupted using either corresponding input or SkipWait.
 - All the Wait* functions now return a code telling how they were interrupted:
Quote
* positive value means a key code;
* negative value means a -(mouse code);
* 0 means timeout or interrupt with a script command.
- AudioChannel.Pause(), Resume() functions and AudioChannel.IsPaused read-only property.
 - AudioClip.PlayOnChannel() lets you play a clip explicitly on a certain channel, disregarding any audio type rules. Works with channels 1-15 now (channel 0 is kept reserved for a speech voice-over).
 - Characters now may be scaled freely, not limited to 5 - 200% (new range is 1 - 32767 for technical reasons).
 - Added Character.IdleAnimationDelay to let control idle view's animation speed.
 - Hotspot.Name and Object.Name may now be set in script.
 - Object.SetView() now resets loop and frame to 0 by default. Previously default was -1 which made object retain loop & frame, which was often unexpected, and could cause game errors.
 - Object.ManualScaling and Scaling properties, now letting to scale an object by command similar to Character (previously objects were only scaled by the walkable area).
 - Added new delay parameter to Mouse.ChangeModeView() to let control cursor's animation speed.
 - Game.BlockingWaitSkipped: returns the last reason of the last blocking action interruption: this is same as Wait* function return value, but also works for skipped blocking speech, and so on.
 - readonly Overlay.Width and Overlay.Height: let you know the overlay's size;
 - Overlay.Transparency lets you change overlay's translucency without recreating its image.
 - Overlay.ZOrder lets you to define overlay's drawing order on screen. Overlays are now sorted among GUIs.
 - Speech.TextOverlay and Speech.PortraitOverlay: give access to the text and portrait overlays of a current blocking speech. In practice these are only available in repeatedly_execute_always callback. Among other things, these properties allow to detect appearance, removal, and change of the blocking speech; also calling Speech.TextOverlay.Remove() will work as a speech interrupt.
 - System.Log(): prints into the engine log.
 - Debug(2, 0) command that displayed walkable areas is superceded by Debug(2, n), where "n" is a mask type: 0 - none, 1 - hotspots, 2 - walkbehinds, 3 - walkable areas, 4 - regions. This command also works as a toggle switch, calling it with the same mask index will turn it off.
 - Debug(5, n) command that displayed character's walk paths now also works as a toggle switch.


Known problems

...?


Other potential issue

* On Windows we currently build engine dynamically linking to SDL2.dll. This means one have to be put along with the game exe. Because this may be a hassle, I suppose we may later change this to static linking just like Allegro 4 was linked to the engine before.
* On Linux, if you are using our prebuilt binaries you should be fine, if not then you have to install SDL2 runtime libs on your linux system.
* Noticed there may be problems playing MIDI, again need to test more and fix.
* Anything we don't know yet about ....






In regards to building Web version of the game. This only works when you have "Web build component" installed along with the Editor. The new "Web" Build target should become available. If you check it, and rebuild the project, the Editor will deploy necessary files into Compiled/Web folder in your project.

Note that you cannot run index.html directly, it likely won't work. You need to create a web server with these files on it. There is a multitude of ways you can do that. For example I've been testing this using a simple Google Chrome app called Web Server for Chrome. You may find your own way.

For any questions regarding the Web port please refer to and post in dedicated forum thread:
https://www.adventuregamestudio.co.uk/forums/index.php?topic=59164.0
« Last Edit: 24 Mar 2022, 01:41 by Crimson Wizard »

Joseph DiPerla

  • Joseph DiPerla, Adventure Game Creator Wannabe!
    • I can help with backgrounds
    • I can help with characters
    • I can help with play testing
    • I can help with story design
    • I can help with translating
    • I can help with voice acting
    • I can help with web design
Nice. I will give this ago within the next couple of days. Thank you all!
Joseph DiPerla--- http://www.adventurestockpile.com
Play my Star Wars MMORPG: http://sw-bfs.com
See my Fiverr page for translation and other services: https://www.fiverr.com/josephdiperla
Google Plus Adventure Community: https://plus.google.com/communities/116504865864458899575

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
Updated to Alpha 2, this is just to include latest fixes and changes from AGS 3.5.1, to keep them in sync.

New download links in the first post.

Hello.

I have received this error while running a room.
https://imgur.com/byuwNv7

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
I have received this error while running a room.
https://imgur.com/byuwNv7


Does this room open well in the editor? If so, can other engine (like 3.5.1) run same game?

Hello, I'm not having this error in the 3.5.1 version.
This error happens while being in that room during a half minute. It is truth that this room has a lot of things going on, animations and other events, but it works fine in the 3.5.1.
« Last Edit: 11 Apr 2021, 22:18 by nightmarer »

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
Updated to Alpha 3, this is just to include latest fixes and changes from AGS 3.5.1. New download links in the first post.


Hello, I'm not having this error in the 3.5.1 version.
This error happens while being in that room during a half minute. It is truth that this room has a lot of things going on, animations and other events, but it works fine in the 3.5.1.

Sorry, I did not have a chance to reply. I don't think I will be able to do much without game itself. Can I get a copy to test?

Hello.

The thing is that it happens randomly. Yesterday I got the same error in another part of the game.
But I tried to replicate and it doesn't happen.
https://imgur.com/a/oyD4syF

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
The thing is that it happens randomly. Yesterday I got the same error in another part of the game.
But I tried to replicate and it doesn't happen.
https://imgur.com/a/oyD4syF

I won't be able to solve anything having only this error message, because there may be various reasons why program runs out of memory.
I would like to test and compare the game in 3.5.1 and 3.6.0 to observe how much memory they use, and and maybe find out what causes this difference.

Hi!
So far, so good, but the game crashes when I alt-tab when running in Full Screen mode. (Compiled exe). No problems so far Windowed.
This is the error:
https://imgur.com/zOZodXH
Let me know if you think this is worth investigating/need any more info.
Thanks for everything!

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
Heads up regarding the memory issue: there's definitely a memory leak in this version, and it seems to be related to audio (found out by disabling certain functions in the engine code).

EDIT: well, apparently the loaded audio never gets deleted from memory in the new code.

The easiest way to observe this is:
Code: Adventure Game Studio
  1. function room_RepExec()
  2. {
  3.         atest.Play();
  4. }
  5.  

game crashes in several seconds.

or more manual:
Code: Adventure Game Studio
  1. function on_key_press(eKeyCode key)
  2. {
  3.         atest.Play();
  4. }
  5.  
« Last Edit: 11 May 2021, 03:50 by Crimson Wizard »

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
Updated to Alpha 4
(use download links in the first post)

Updated to include all changes from v.3.5.1.5.

Fixed major memory leak in the audio subsystem.

eri0o

@Potajito, do you still have the crash when alt+tabbing?

@Potajito, do you still have the crash when alt+tabbing?
Yes as of 3.6.0.3! That is, using Direct9. Open GL is all fine (was also with previous alpha). Are we not supposed to used Directx?
Thanks!

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
Potajito, we found out that this is because AGS 3.6.0 does not properly support suspending the game when it's alt+tabbed, so it always keeps running and redrawing in background. And Direct3D seem to not like that in fullscreen: similar error happens if you run any previous version in fullscreen and have "SetMultitaskingMode(1)" in script.

So, the fix is then first to restore proper handling of disabled multitasking (which is the default) and then figure out conditions under which game should not be redrawn even if multitasking is on.
« Last Edit: 23 May 2021, 04:22 by Crimson Wizard »

Potajito, we found out that this is because AGS 3.6.0 does not properly support suspending the game when it's alt+tabbed, so it always keeps running and redrawing in background. And Direct3D seem to not like that in fullscreen: similar error happens if you run any previous version in fullscreen and have "SetMultitaskingMode(1)" in script.

So, the fix is then first to restore proper handling of disabled multitasking (which is the default) and then figure out conditions under which game should not be redrawn even if multitasking is on.
Nice! Thanks for looking into it. I'm more than happy using just OpenGl, but you never know what people would prefer.

Another one on the latest Alpha 4:


When creating a new project, either new or from a template.

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
Where do you create your game, is the location writeable and you have permissions there? Were you able to create a game in the same place with the previous versions (3.5.0, 3.5.1)?

Where do you create your game, is the location writeable and you have permissions there? Were you able to create a game in the same place with the previous versions (3.5.0, 3.5.1)?
Yep, it is writable! in fact what I did was create a project in 3.5 (same folder, same name) and then just open it with 3.6.

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
Yes, there's something wrong with it, I'll investigate.


EDIT:
Sorry for this, there was a stupid mistake made in template extraction.

The fixed version will be available here, under "Artifacts", as soon as build server finishes working:
https://cirrus-ci.com/task/6038530150367232
« Last Edit: 24 May 2021, 12:44 by Crimson Wizard »

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
Seeing as some people already use this engine when building their games, I'd like to ask for an opinion of Windows users about SDL2.dll.

All the previous versions depended on "Allegro 4" library, but that library was merged with the engine exe, so you only had that game.exe or acwin.exe to handle and copy around.

This new version currently links SDL2 library dynamically, so you have to additionally have SDL2.dll.

Is this a big deal for people? I think we may reconfigure the engine to use "static linking" with SDL2. This is bit less flexible (e.g. one won't be able to swap it by hand if it needs an update), but I don't remember if there are other disadvantages.

Gilbert

  • Global Moderator
  • * KILL* * KILL * * KILL *
    • Lifetime Achievement Award Winner
I'm not familiar with these kind of stuff, but my question is, does it matter which version of the dll the user have?
That is, is the AGS engine guaranteed to work with whatever version (or, at least the newest version one can retrieve from the net) of sdl2.dll one has on their hands?
So, if sdl2.dll is not of the same version used when the AGS engine is compiled the games still work?
If the engine works only with specific version of the dll I think it's better to link it statically to the executable. (Or, at least advise people to include the file when they distribute their games).

I have been using some very old programming package and the resultant executables rely on openal32.dll to run. However, they only work with the dll precompiled included with the engine, not every other version you can find on the net.

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
I'm not familiar with these kind of stuff, but my question is, does it matter which version of the dll the user have?

Yes of course. The DLL's interface should be matching: function prototypes, but also function adresses in memory I think. So it mostly depends on how the library developers keep backwards compatibility (if they do). It may stay compatible in a small range of updates, or larger range, but I don't know about this particular lib.


Maybe I should not have mentioned this point at all, as being able to swap the DLL is not important. Having DLL may simply mean less maintenance for engine devs.

Or, at least advise people to include the file when they distribute their games

If we have it as DLL we will definitely include it with Editor's distribution, there's no question about that.
« Last Edit: 04 Jul 2021, 04:19 by Crimson Wizard »

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
Updated to Alpha 5
(use download links in the first post)

Updated to include all changes from v.3.5.1.8.

Updates sound library, this fixes few sound formats not playing in the new engine.



SUPER EXPERIMENTAL, but AGS now supports Unicode translations, if your TRS files are saved as UTF-8 and certain hint is added to the files, engine should correctly interpret the text as unicode, and display unicode texts with appropriate fonts.

Unfortunately texts in the game properties and script cannot contain unicode yet. Hence we call it "partial unicode support".

More explanation on how to use Unicode translations in your game may be found here: https://www.adventuregamestudio.co.uk/forums/index.php?topic=59240.0

In short, you should have following line among the other options in TRS file:
Code: [Select]
// Text encoding hint
//#Encoding=UTF-8

The translation compiler will add it to TRA data, to let engine know to interpret these translations as unicode.
If there's no such line, or value it empty, - it will be interpreted as ASCII.

And TRS should of course be saved as UTF-8 (plain UTF-8, without BOM!).
« Last Edit: 04 Jul 2021, 22:31 by Crimson Wizard »

Joseph DiPerla

  • Joseph DiPerla, Adventure Game Creator Wannabe!
    • I can help with backgrounds
    • I can help with characters
    • I can help with play testing
    • I can help with story design
    • I can help with translating
    • I can help with voice acting
    • I can help with web design
Neat. I am sure there are quite a few who need this feature.
Joseph DiPerla--- http://www.adventurestockpile.com
Play my Star Wars MMORPG: http://sw-bfs.com
See my Fiverr page for translation and other services: https://www.fiverr.com/josephdiperla
Google Plus Adventure Community: https://plus.google.com/communities/116504865864458899575

Gilbert

  • Global Moderator
  • * KILL* * KILL * * KILL *
    • Lifetime Achievement Award Winner
If we have it as DLL we will definitely include it with Editor's distribution, there's no question about that.
Should be okay, but it's still safer to put a note somewhere to remind people to distribute their games with the dll file. Say, if for some stupid reasons (such as errr... saving space?) someone doesn't ZIP the entire Compiled folder of their game for distribution, but decides to remove a few files from it they may receive confusing reports from players, that some could run the game (as long as a compatible dll file is in the path) and some couldn't (can be either missing the file from the path or they have a version sdl2.dll file in the path that is not compatible with that particular AGS engine; an even nastier problem is a player might be able to run the game at one point, but after some updates of their system that somehow updated also the sdl2.dll in the path would suddenly make the game unstartable).

Another problem is when someone wants to run a game in a different version (e.g. drops the engine of say V3.8 onto the folder of a game created with V3.6) and if these two engine versions somehow use different version of the dll this may not work, until they also drops a suitable version of the dll file onto the folder. Swapping engine is considered a more advanced action though, so I think it's less of a problem here.

We're glad that currently the AGS engine only relies on one single external library to work, so either way it's not a very big problem ATM.

eri0o

We could have a directory inside the Editor install directory named platforms (or runtime) and then inside this directory have one for each OS: Windows, Linux, ... And then inside these, one for each Architecture.

Then when picking up the engine, the Editor would just grab everything in the directory specified. So in this way, if the engine was built with static library (which I prefer and think is the best approach) or dynamic library, it will work with both. Of course we still need to figure out default, but at least it could pickup both from it's specific engine directory.

Hey guys. I opened my game with AGS 3.6.0 alpha 4 and everything has played amazingly. We made the game with AGS 3.5.0.24. I also tried the android launcher.

This new version currently links SDL2 library dynamically, so you have to additionally have SDL2.dll.

Is this a big deal for people?

I do not think it's a big deal, it's great. The improvements ARE  a big deal. Many many thanks for the hard work.

The performance, animations, interactions, the whole game feels smoother and quicker than previous versions. I love that I can change the audio output device and the game reacts to that!

I'm not getting Potajito nor nightmarer issues. It's all good.

Some small things I noticed and questions:

*maybe i'm doing something wrong or missed something, but I cannot reproduce any video.
  I was using .ogv without problems in the 3.5 version. Now it says "Unable to load theora video 'videoname.ogv' ".
  I tried mp4 but it's not supported as you stated.
  Any recommendation? Thanks

*In full screen, it behaves similar to windows mode, I can move the cursor outside of the game (I have two monitors) and if I click outside, the game minimizes. This happens even if I "auto lock to window" in the mouse options in winsetup.
Something similar happens in AGS 3.5 with openGL only. When the cursor clicks very near the edge, it bounces down to the bottom of the screen and minimizes the game. Is it possible to fix this in AGS 3.5?

*Not important, just to mention, but in debug mode ctrl+X for changing rooms, I cannot write the room number as I used to in previous versions. I use a lot this function because it's faster to write the number than clicking the arrow (i have more than 100 rooms)

*And finally, I don't have much to compare to the android version  since it's the first time I use the launcher. Here I just have two questions.
The process to create a standalone apk is the same as previous versions? I have read about it but never tried. If the process is indeed the same, what libraries should I use?
And second, how can I get the keyboard to appear in the screen using the 3.6 launcher? anyway, sorry if this is answered in some other forums but couldn't find any.
In general, I love it! the game plays nicely on the phone. There are some rooms with big backgrounds, alpha channel or parallax that do not plays well, but It's an easy fix I guess.

We're releasing our game in STEAM in the couple of weeks, therefore we're using the AGS 3.5 version, we don't have the time to do a thorough test. But looking forward to do it and update it in the future.

Thanks again for doing this.
Have a great day.


I compiled 3.6.0.4 on my Mac from source code (followed the guide I posted some days ago in the Mac thread). My game works perfectly. The only problem that I found is that in windowed mode, there's no way to open the game with the window enlarged. The game always opens in a small window 320x200 in the center of the screen. I can drag the window corner and resize works perfectly, respecting the ratio, but the game always starts small. This is the config.

Code: [Select]
[graphics]
driver=software
windowed=1
screen_def=max
game_scale_fs=proportional
game_scale_win=max_round
filter=stdscale
vsync=0
render_at_screenres=1
match_device_ratio=1

I tried also with "game_scale_win=3", it doesn't change.


Another thing: how to distribute the game for mac? My game works probably because I have SDL2 installed on my MacBook, but if I want to send the game to someone else how can I embed the library?

eri0o

Quote
I compiled 3.6.0.4 on my Mac from source

How do you do it? CMake is wired to do full static library compilation. It doesn't depend on anything, you can check with ldd on command line.

How do you do it? CMake is wired to do full static library compilation. It doesn't depend on anything, you can check with ldd on command line.

I don't understand your question. I just downloaded ags-v.3.6.0.4.zip, extracted it, copied the resources of the game, compiled it with "Cmake" and "make" (like I did with 3.5.1.8). Everything worked smoothly. It wasn't supposed to work?

eri0o

Quote
My game works probably because I have SDL2 installed on my MacBook

Perhaps I am not understanding what you said. What do you mean by the above?

To clarify, all cmake builds are self contained in any OS, it's scripted to download all dependencies, build them on your machine, and static link to all of them. The result is a self contained binary that should work pretty much anywhere that's the same OS and architecture.

So if you are referring to a binary you built on MacOS, SDL2 is already inside the binary. It should work as long the standard C libraries are compatible across machines.

About distribution, you need to notarize and sign your application, here's a guide:
http://www.edenwaith.com/blog/index.php?p=112
« Last Edit: 06 Jul 2021, 13:34 by eri0o »

So if you are referring to a binary you built on MacOS, SDL2 is already inside the binary. It should work as long the standard C libraries are compatible across machines.

Ah ok, I get it now. I thought the SDL2 was not in the binary, because I read for the windows version the DLL should be zipped together with the exe. Or am I wrong?

eri0o

Quote
Ah ok, I get it now. I thought the SDL2 was not in the binary, because I read for the windows version the DLL should be zipped together with the exe. Or am I wrong?

Windows version provided by the Editor is built with a different build system (using VS Solutions). And there hasn't been a decision yet to build it statically or to keep it dynamically yet, this is why it's not shipped together yet.

If you use CMake on Windows, a static-linked version of ags executable will be built.

For Windows and Linux, for distributable binaries, I recommend using the Docker Images generated by the CI or building the same images from the Dockerfiles as a standardized build environment - it's not needed, on Windows it should be fine, but on Linux you may have glibc incompatibilities when running your binary elsewhere.
« Last Edit: 06 Jul 2021, 16:04 by eri0o »

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
I compiled 3.6.0.4 on my Mac from source code (followed the guide I posted some days ago in the Mac thread). My game works perfectly. The only problem that I found is that in windowed mode, there's no way to open the game with the window enlarged. The game always opens in a small window 320x200 in the center of the screen.

I finally realized why that may be, will link a test build soon.

EDIT: https://cirrus-ci.com/build/5531686894043136
« Last Edit: 06 Jul 2021, 23:20 by Crimson Wizard »

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
Updated to Alpha 6
(use download links in the first post)

Backported a number of simplier Script API entries from the experimental ags4 branch; because many of them are ready for a while, and they are simple enough to not require big changes to the engine:

 - DrawingSurface.DrawImage() and DrawSurface() now accept optional source rect coordinates, so you can draw a chosen part of the sprite directly;
Code: Adventure Game Studio
  1. DrawingSurface.DrawImage(int x, int y, int spriteSlot, optional int transparency, optional int width, optional int height,
  2.                 optional int cut_x, optional int cut_y, optional int cut_width, optional int cut_height);
- Room.Exists(): tests if the room of certain number is available;
 - WaitMouse(): complements other Wait* functions.
 - SkipWait(): skips current Wait (will normally only work from repeatedly_execute_always callback).
 - All the Wait* functions now accept "0" as "no timeout", in which case waiting may only be interrupted using either corresponding input or SkipWait.
 - All the Wait* functions now return a code telling how they were interrupted:
Quote
* positive value means a key code;
* negative value means a -(mouse code);
* 0 means timeout or interrupt with a script command.
- Object.SetView() now resets loop and frame to 0 by default. Previously default was -1 which made object retain loop & frame, which was often unexpected, and could cause game errors.
 - Object.ManualScaling and Scaling properties, now letting to scale an object by command similar to Character (previously objects were only scaled by the walkable area).
 - Game.BlockingWaitSkipped: returns the last reason of the last blocking action interruption: this is same as Wait* function return value, but also works for skipped blocking speech, and so on.
 - Speech.TextOverlay and Speech.PortraitOverlay: give access to the text and portrait overlays of a current blocking speech. In practice these are only available in repeatedly_execute_always callback. Among other things, these properties allow to detect appearance, removal, and change of the blocking speech; also calling Speech.TextOverlay.Remove() will work as a speech interrupt.
 - System.Log(): prints into the engine log.


Oh, and Characters now may be scaled freely, not limited to 5 - 200% (new range is 1 - 32767 for technical reasons).
« Last Edit: 16 Jul 2021, 07:49 by Crimson Wizard »

Great job! Thanks for adding System.Log(), super useful addition.

- WaitMouse(): complements other Wait* functions.
 - SkipWait(): skips current Wait (will normally only work from repeatedly_execute_always callback).
 - All the Wait* functions now accept "0" as "no timeout", in which case waiting may only be interrupted using SkipWait.

Is -1 still a valid parameter for Wait* functions?

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
Is -1 still a valid parameter for Wait* functions?

What is -1  :-\? I tried in AGS 3.5.1 and passing anything negative results in error.

Is -1 still a valid parameter for Wait* functions?

What is -1  :-\? I tried in AGS 3.5.1 and passing anything negative results in error.

I seem to recall it was mentioned on Discord? I'll try to find the conversation, maybe I'm getting things mixed up...

Found the conversation and you're right; somebody mentioned that WaitMouseKey(-1) was an alternative in 3.5.1 to while(WaitMouseKey(1) == 0) {}, but indeed, it didn't compile. For some reason, the idea that -1 was valid had gotten stuck in my head.

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
I'm sorry, but I'll have to fix and reupload the latest version, because the speech is broken completely, I forgot to test it.

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
Ok, I fixed the broken speech bug, and reuploaded Alpha 6 version, please download again.

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
In regards to the recent additions, Speech.TextOverlay and Speech.PortraitOverlay are exposing internal overlays created by the engine for the standard blocking speech.
They may come useful if you don't want to bother writing full custom speech, but at the same time would like to do some adjustments to built-in one.

Couple of examples of what you may do with them in script:


Detecting when the blocking speech has begun, changed to the next line or is over:
Code: Adventure Game Studio
  1. Overlay* lastSpeech;
  2.  
  3. function late_repeatedly_execute_always() {
  4.     Overlay* curSpeech = Speech.TextOverlay;
  5.     if (lastSpeech == null && curSpeech != null) {
  6.          // speech has started
  7.     } else if (lastSpeech != null && curSpeech == null) {
  8.          // speech is over
  9.     } else if (lastSpeech != null && curSpeech != lastSpeech) {
  10.          // speech changed to the next line
  11.     }
  12.     lastSpeech = curSpeech;
  13. }
  14.  


Waving a speech portrait up and down
Code: Adventure Game Studio
  1. #define PORTRAIT_YMIN 5
  2. #define PORTRAIT_YMAX 30
  3. int plast = -1;
  4. int pmove = 1;
  5. function repeatedly_execute_always() {
  6.         if (Speech.PortraitOverlay != null) {
  7.                 if (plast >= 0) Speech.PortraitOverlay.Y = plast;
  8.                 Speech.PortraitOverlay.Y += pmove;
  9.                 if (Speech.PortraitOverlay.Y < PORTRAIT_YMIN) pmove = 1;
  10.                 if (Speech.PortraitOverlay.Y > PORTRAIT_YMAX) pmove = -1;
  11.                 plast = Speech.PortraitOverlay.Y;
  12.         }
  13. }
  14.  
« Last Edit: 16 Jul 2021, 11:31 by Crimson Wizard »

I receive this exception when I try to save the game with 3.6.0.5 editor.

https://ibb.co/CtCM3yb

Let me know if I can do something to solve it.


Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
I receive this exception when I try to save the game with 3.6.0.5 editor.

https://ibb.co/CtCM3yb


Apparently this error has been there since previous alpha, but was not noticed for some reason.
There will be a fixed build here after a short while: https://cirrus-ci.com/task/6002945838809088

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
Updated to Alpha 7
(use download links in the first post)

Had to do another update soon, because number of serious bugs were found and fixed recently.

* Editor not saving sprite file correctly after new sprites were added;
* Some OGV videos not loading;
* AudioChannel.PositionMs only returning values with second-precision;
* Papagayo lip sync not working well (related to the above);
* few less important ones.


Also we now distribute SDL2.dll within the Editor's installer/zip file, for convenience (at least until we change to static SDL2 linking).
« Last Edit: 18 Jul 2021, 23:17 by Crimson Wizard »

Sorry, The links doesn't work for me.
My official site: http://www.pershaland.ir/

arj0n

  • Mittens Vassal
  • art consists in drawing a line somewhere
    • arj0n worked on one or more games that won an AGS Award!
    •  
    • arj0n worked on one or more games that was nominated for an AGS Award!
Sorry, The links doesn't work for me.
There's a "v." in the folder name which shouldn't be there.
Go here and scroll down a bit for the DL's: https://github.com/adventuregamestudio/ags/releases/tag/3.6.0.6

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
Fixed links.

I created downloads with the wrong folder, but since it's an alpha version I'd leave it as it is perhaps.

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
I have a small idea, but I'd like to hear some opinions, in case someone can see problems with this.

There has been an ongoing struggle with audio system in AGS, when people try to make channels work like they want but AGS has its own mind and results are often unexpected.

Not planning any system rewrite in this version, but I thought that it may be possible to ease this situation by giving a more "low-level" function for those who might want to write their own channel logic in scripts. The idea is to introduce a new function e.g. AudioClip.PlayOnChannel(int chan, optional AudioPriority, optional RepeatStyle). This function would put the clip on the exactly given channel, ignoring any rules, such as audio type reservation, priority, and so on. In other words, so long as the sound is successfully loaded, it will be put on exactly that channel no matter what.

Dualnames

  • AGS Baker
  • Rottwheelers
  • Pretty Badass
    • Lifetime Achievement Award Winner
    • Dualnames worked on one or more games that won an AGS Award!
    •  
    • Dualnames worked on one or more games that was nominated for an AGS Award!
Does AGS struggle with audio being cut now, with SDL being implemented?
No more military army stuff. I'm alive and back.

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
Does AGS struggle with audio being cut now, with SDL being implemented?

Do you have a sound clip or a game for a test?
« Last Edit: 02 Aug 2021, 12:06 by Crimson Wizard »

Does AGS struggle with audio being cut now, with SDL being implemented?
I used to get that a lot in previous AGS versions, but with SDL so far I haven't had that issue.

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
Updated to Alpha 8
(use download links in the first post)


More fixes
* SDL2 Software renderer now draws 8-bit games correctly again;
* Fixed AudioClip.Play() wrongly returning success even when the audio system failed to load the sound.


Sprite manager update
* There's now a Zoom slider, and zoom may be changed with a Ctrl+mousewheel.
* Can drag & drop image files from the file explorer to import them into the game.


Support packing custom files in game, and reading game resources in script

Editor now can pack custom files into the game. The option is General Settings -> Compiler -> Package custom data folder(s). This setting accepts a comma-separated list of folders. These folders must be located inside the game project. All of their contents will be packed into the game, including ones in subfolders and their subfolders recursively.

These files may be opened for reading in script using File.Open with "$DATA$" path token.

All the script functions that accept filepaths now support "$DATA$" token. This makes them work with the game resources. Game resources may be only opened for reading.
For example:
Code: Adventure Game Studio
  1. // open custom packed file
  2. File *f = File.Open("$DATA$/MyDir/myfile.txt", eFileRead);
  3. // create a dynamic sprite out of a custom packed image file
  4. DynamicSprite *spr = DynamicSprite.CreateFromFile("$DATA$/MyDir/mypic.bmp");
  5. // List all existing resources
  6. ListBox.FillDirList("$DATA$/MyDir/*.*");
  7.  

You may even use this with regular game files, even though that may be not commonly meaningful (if only for some hacks):
Code: Adventure Game Studio
  1. // List all existing rooms
  2. ListBox.FillDirList("$DATA$/*.crm");
  3.  


Room masks may be retrieved as 8-bit DrawingSurfaces and modified in script

Code: Adventure Game Studio
  1. static DrawingSurface* Hotspot.GetDrawingSurface();
  2. static DrawingSurface* Region.GetDrawingSurface();
  3. DrawingSurface* GetDrawingSurfaceForWalkableArea();
  4. DrawingSurface* GetDrawingSurfaceForWalkbehind();
  5.  

Because these are 8-bit images, and each area index corresponds to one of the colors from 0-255 range, painting certain area is as trivial as
Code: Adventure Game Studio
  1. ds.DrawingColor = 4; // will draw area number 4.
  2.  

You may do almost everything with them, but "DrawImage" will only work correctly if you draw a 8-bit image, otherwise colours will get all messed up (also I think this may cause crashes).


AudioClip.PlayOnChannel()

This is a workaround for AGS audio system limitations.

This function lets you play a clip explicitly on a certain channel, disregarding any audio type rules. So you may script your own channel logic.
Works with channels 1-7 now (channel 0 is kept reserved for a speech voice-over).


Misc stuff

Added readonly Overlay.Width and Height properties to let know the size of the overlay.
« Last Edit: 06 Aug 2021, 12:40 by Crimson Wizard »

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
Updated to Alpha 9
(use download links in the first post)

Has all fixes from AGS 3.5.1 - Patch 3.

Also...

Fonts

Fixed display of certain TTF fonts which previously had their heights calculated wrongly. This could lead to incorrect vertical alignment, as well as texts being cut of at the bottom due to the graphical surface being not large enough.

Added support for custom automatic outline thickness and style, originally created by fernwelten. You may now choose outline thickness in font properties, and choose between Square or Round automatic outlines.

Overlays

There's no more limit to how many overlays you may create and have simultaneously.

Overlays now have ZOrder property and are sorted among the GUI. By default, for backward compatibility, speech overlays have very high ZOrder, which places them on top, and custom overlays have a very low negative zorder, which places them below GUI. But you may change that using that property.

Added Overlay.Transparency, which lets you change overlay's translucency without recreating its image.

Android

eri0o had adjusted a game project template for building for Google Play and similar stores. Engine now supports reading game assets from the Android-specific packages (apk, aab).
For more information please visit this post: https://www.adventuregamestudio.co.uk/forums/index.php?topic=55681.msg636638927#msg636638927
We'll be writing a better documentation after a while.


I think we may be done adding new features to this version; there's already more than anticipated. Now it's time to test, fix and polish what we have.
« Last Edit: 26 Aug 2021, 15:49 by Crimson Wizard »

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
A small update, I found an annoying bug in the latest alpha release, and reuploaded a fixed version.

The problem was related to Editor failing on some paths with non-latin characters; please keep an eye on such situations.

ThreeOhFour

  • AGS Baker
  • Wild colonial boy.
    • Lifetime Achievement Award Winner
    • ThreeOhFour worked on one or more games that won an AGS Award!
    •  
    • ThreeOhFour worked on one or more games that was nominated for an AGS Award!
I just wanted to stop by and sing my praise for the way AGS handles regions/characters/hotspots in rooms now. I was quite content with how it used to do it, but the new way is better and more flexible. Thank you for the ongoing hard work!

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
I've been up to fixing number of things in this Alpha, but got distracted lately, so meanwhile here's a small update with just some additions, some to "fill" couple logical "gaps" in scripting, others to enhance existing functionality.

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

Audio related

* Rised number of audio channels to 16 (was 8).
* added AudioChannel.Pause() and Resume() functions, and AudioChannel.IsPaused read-only property.

Editor

* Alan v.Drake added line numbers in the Dialog script editor; and also line and cursor position in script are now printed on the status bar.

Character's idle views

* exposed IdleDelay property for Characters in the editor (was only possible to set through script function SetIdleView).
* fixed idle view timing, now it is now correctly based on the game speed rather than the hardcoded 40 fps.

Engine's options

* --localuserconf parameter is superceded with --user-conf-dir, and similarily there's "user_conf_dir" config option that directly tells the location of user config file.
* path related config options, such as "shared_data_dir", "user_data_dir" and "user_conf_dir" now support $GAMENAME$ token in path which is resolved to the game's title. The potential use case is to let user set up an absolute path leading to a location they want to store saves and other files in. In such case they might also need to have subdirs per each game there.
E.g. you may put "user_data_dir=C:/All My AGS Saves/$GAMENAME$" to every game config (or into the global AGS config).
« Last Edit: 13 Sep 2021, 19:12 by Crimson Wizard »

Audio related

* Rised number of audio channels to 16 (was 8).
* added AudioChannel.Pause() and Resume() functions, and AudioChannel.IsPaused read-only property.



Grundislav

  • AGS Baker
  • Mittens Prince
  • Brogan
    • Lifetime Achievement Award Winner
    • Grundislav worked on one or more games that won an AGS Award!
    •  
    • Grundislav worked on one or more games that was nominated for an AGS Award!
An audio bug: when the game initially loads, the music volume is loud, but when a game is restored, the music volume drops by about 10%.

https://cdn.discordapp.com/attachments/221048075207180288/896953768694910987/volumechange.mp4
« Last Edit: 11 Oct 2021, 20:02 by Grundislav »

I'm not sure this is the best place to leave a suggestion, but right now, the only way to change the delay of a view frame is manually in the View editor, and it can get quite cumbersome if for whatever reason you need to change the values for a lot of frames. How feasible would it be to expose the view frame delay property to the script?
« Last Edit: 14 Oct 2021, 18:55 by Laura Hunt »

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
I'm not sure this is the best place to leave a suggestion, but right now, the only way to change the delay of a view frame is manually in the View editor, and it can get quite cumbersome if for whatever reason you need to change the values for a lot of frames. How feasible would it be to expose the view frame delay property to the script?

Delay is already exposed to script, but as a readonly property called "Speed". Making it writeable is mostly a matter of adding this field to savegames, otherwise saving/restoring game will make frame data inconsistent.

But I guess this is also why the view editor needs multiple selection and being able to edit properties from multiple frames at once.
« Last Edit: 14 Oct 2021, 21:41 by Crimson Wizard »

But I guess this is also why the view editor needs multiple selection and being able to edit properties from multiple frames at once.

Agree, that would also be a very welcome addition. But I guess it would take more work?

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
But I guess this is also why the view editor needs multiple selection and being able to edit properties from multiple frames at once.

Agree, that would also be a very welcome addition. But I guess it would take more work?

Editor currently does not have any mechanism for this, there might be a default handling available for the PropertyGrid control, but I know nothing about that.
Someone has to research how this works first.
« Last Edit: 14 Oct 2021, 22:02 by Crimson Wizard »

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
Unfortunately I got very distracted from AGS recently, so this took more time since the last update... but here's the new one.

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

Editor:

* Added "Use graphical font height in game logic" property to the General Settings, that makes your game use real font's pixel height when arranging text and text-based UI elements, as opposed to the nominal font's size. This is important for TTF fonts, because importing them with N point size does not guarantee N pixel height. Unfortunately AGS used to "lie" about their height all those years, which could lead to some fonts not fitting into gui controls right or even have their bottom parts "cut off" when displayed as a speech. Now you may prevent that using this setting.
* Fixed "Use old-style custom dialog options API" was not set when importing pre-3.4.0 projects.
* Fixed comboboxes' drop-down arrows were not painted with the right color from a color theme.

Script compiler:

* Removed 500-characters line limit.

Script API:

* Debug(2, 0) command that displayed walkable areas is superceded by Debug(2, n), where "n" is a mask type: 0 - none, 1 - hotspots, 2 - walkbehinds, 3 - walkable areas, 4 - regions. This command also works as a toggle switch, calling it with the same mask index will turn it off.
* Debug(5, n) command that displayed character's walk paths now also works as a toggle switch.

Engine:

* Support "borderless full-screen window" mode in addition to the real (exclusive) fullscreen.
* Support scripts using functions and variables (imported) from any other scripts, regardless of the script module order in the project. These still have to be declared as "import" above their use though.
* Engine now supports using real pixel height of the TTF fonts when arranging text and UI elements on screen; using nominal import size of the font is used as a compatible mode for the old games.
Note that you may always configure the vertical line spacing using font's LineSpacing property in the editor.
* Engine now ensures that in threaded audio mode the script's AudioChannel's state only changes once the game is updated, and not while the game script is running. This prevents situations when the clip could begin playing before all properties are set in script, or when AudioChannel's properties' values (such as Position) could change while running a game script.
* Character.SetWalkSpeed() is no longer restricted by an arbitrary limit of 50.
* File.ReadRawLineBack() now always reads full line, and not limited to 200 characters anymore.
* Debug displays, such as showing room mask and character walk paths, are now implemented as non-blocking translucent overlays, allowing you to keep playing the game while they are on.
* Engine config now has graphic modes defined as a simplier string options: "[graphics] fullscreen" for the fullscreen mode setup, and "[graphics] window" for the windowed. Fullscreen option can explicitly define a "borderless full-screen window" mode. (See below for the new config explanation; it will be also added to documentation later).
* Fixed engine could crash due to incorrect disposal of resources if its startup was interrupted for any reason.
* Fixed some TTF fonts were not centered correctly and/or cut from below when text is displayed.
* Fixed crash in case there were too many reserved audio channels.
* Fixed new sound panning implementation.
* Fixed character may have incorrect Frame values while turning.

Android:

* Fixed reading of separate game files (not merged with the main AGS game file) from inside the APK.

WinSetup:

* Added "Fullscreen as borderless window" checkbox.



New graphics mode configuration:

Instead of having several detached options that combined would result in a window size definition, there's now only 1 option (per mode) that contains all possible variants in a single string:
* WxH - explicit window size (e.g. 1280x720);
* xS - integer game scaling factor (e.g. x4);
* desktop - use current system's desktop resolution;
** in windowed mode will try to create largest possible resizing window, while keeping game scaling style (max stretch, proportional stretch or max integer multiplier);
* native - use game's native resolution;
* full_window - special option for the fullscreen mode, this means a borderless window covering whole desktop;
* default - currently we default to (this is also a fallback option in case config parsing went wrong):
** in fullscreen mode to full_window;
** in windowed mode to desktop;

In [graphics] section fullscreen mode is defined by the option "fullscreen" while the windowed mode is defined by the option "window".

Config examples:

Code: [Select]
[graphics]
fullscreen=1280x720
window=x2
game_scale_fs=proportional
game_scale_win=round

Code: [Select]
[graphics]
fullscreen=full_window
window=native
game_scale_fs=stretch
game_scale_win=round
« Last Edit: 31 Oct 2021, 15:56 by Crimson Wizard »

Dave Gilbert

  • Mittens Vassal
  • AGS Baker
  • Eye see you.
    • Lifetime Achievement Award Winner
    • Dave Gilbert worked on one or more games that won an AGS Award!
    •  
    • Dave Gilbert worked on one or more games that was nominated for an AGS Award!
Hooray! Thanks CW.

I am not sure if this is a bug or not, or if it's specifically related to version 3.6, but I noticed a weird issue when switching between monitors.

I have a two monitor setup. One laptop and a second monitor. I typically have the monitors in "Extend" mode (where the desktop area is spread out between the two) and test my game on my second monitor. If the game is running and I switch from "Extend" mode to "second screen only" mode, the game minimizes itself and won't come back. Clicking on the icon in the taskbar does nothing (although I can still hear the music and sound). I have to open up the task manager to exit out of the game.

I admit this is an unusual case that not many people will deal with, but it is a bit annoying when it comes up.

Anyway, I'm off to play with fonts now!

-Dave

Thanks for this awesome new build!  The Object.Scaling option and additional audio channels are especially amazing.

When testing out the most recent version of 3.6, I noticed the following:

1. Text within buttons is placed differently in the editor than in the game.  Here’s some text with alignment eAlignMiddleCenter.  (The font is LinLibertine_aBS.ttf, imported at 20 pt.)

https://drive.google.com/file/d/1VYqbj3KUjmCIAcXKTJudgZ33z8IkCJMw/view

It’s worth noting that, when upgrading from 3.5.1 to 3.6, the font had a VerticalOffset of -2, which appeared as -2 in the editor and -4 in the game.  I’ve since set this offset to 0, and it now appears as 0 in the editor and -2 in the game.

2. Calling GetGlobalInt before SetGlobalInt results in a crash.  As my game was loading, I was calling GetGlobalInt(foo) before I’d called SetGlobalInt(foo, bar).  In 3.5.1, there was no error or crash.  In 3.6, there was a crash.  I addressed this by updating my script to set the variable before getting it.  I wanted to report it, though, as it’s a different behavior from 3.5.1.

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
1. Text within buttons is placed differently in the editor than in the game.  Here’s some text with alignment eAlignMiddleCenter.  (The font is LinLibertine_aBS.ttf, imported at 20 pt.)

I am currently experimenting with changing something in how TTF fonts work, and latest build unfortunately may contain mistakes. I realized this too late, when it was already posted. In any case it's better to not rely on the font looks right away and wait until the next update, which hopefully will be ready soon enough.

Quote
the font had a VerticalOffset of -2, which appeared as -2 in the editor and -4 in the game

This sounds weird though. But I will look at this as soon as I fix other obvious mistakes.

2. Calling GetGlobalInt before SetGlobalInt results in a crash.  As my game was loading, I was calling GetGlobalInt(foo) before I’d called SetGlobalInt(foo, bar).  In 3.5.1, there was no error or crash.  In 3.6, there was a crash.  I addressed this by updating my script to set the variable before getting it.  I wanted to report it, though, as it’s a different behavior from 3.5.1.

I will look into this, but just wanted to mention that these functions were deprecated many years ago, today it's recommended to use normal variables in script.

Matti

Nice work! A lot of good stuff in there!

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
@greg
2. Calling GetGlobalInt before SetGlobalInt results in a crash.  As my game was loading, I was calling GetGlobalInt(foo) before I’d called SetGlobalInt(foo, bar).  In 3.5.1, there was no error or crash.  In 3.6, there was a crash.  I addressed this by updating my script to set the variable before getting it.  I wanted to report it, though, as it’s a different behavior from 3.5.1.

I tried this, and I cannot reproduce a crash, nor see how exactly it may happen.

Could you give more information, like post the exact script, tell what function do you call the GetGlobalInt from, what kind of crash (were there error messages)?

Sure, I've appended the crash message below, and I've uploaded the CrashInfo file here: https://drive.google.com/file/d/1WNVKOHaYn9HYax55KrQxvRI79nyY3A82/view?usp=sharing

The functions that called GetGlobalInt(foo) before SetGlobalInt(foo, bar) were called in game_start().  Also, thanks for the heads-up that GetGlobalInt and SetGlobalInt have been deprecated!

Separately, since upgrading from 3.5.1 to 3.6, I noticed that AudioChannel.LengthMs is sometimes returning 0 even when AudioChannel.PlayingClip.ID is not null.  Namely, in the same place in my code, the same log message sometimes prints this:

Code: Adventure Game Studio
  1. channel.ID: 3, channel.PlayingClip.ID: 267, channel.LengthMs: 3692

And sometimes it prints this:

Code: Adventure Game Studio
  1. channel.ID: 3, channel.PlayingClip.ID: 267, channel.LengthMs: 0

I can reproduce this consistently, but not every time, when I skip the cutscene in which the clip is played.  However, the behavior sometimes occurs (though far less often) even if I don’t skip the cutscene.  (I had the same code in AGS 3.5.1, and channel.LengthMs never returned 0.)

---------------------------
Illegal exception
---------------------------
An exception 0xC0000005 occurred in ACWIN.EXE at EIP = 0x00537F70; program pointer is -42, ACI version 3.6.0.10, gtags (78,214)

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.

in "Interface.asc", line 1001
from "Interface.asc", line 1010
from "Extender.asc", line 587
from "Extender.asc", line 596
from "Extender.asc", line 1090
from "Extender.asc", line 3539
(and more...)

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
Sure, I've appended the crash message below, and I've uploaded the CrashInfo file here: https://drive.google.com/file/d/1WNVKOHaYn9HYax55KrQxvRI79nyY3A82/view?usp=sharing

The functions that called GetGlobalInt(foo) before SetGlobalInt(foo, bar) were called in game_start().

From thois crash dump it seems that the last called function was GetWalkableAreaAtRoom. But maybe there was something wrong with either engine or the dump.

Could you post the code around "Interface.asc", line 1001 ?

EDIT: I can confirm that calling GetWalkableAreaAtRoom in game_start will crash the engine. No room is loaded at the time when game_start was called, but it seems this time engine was not able to handle that properly and display a regular error.
« Last Edit: 06 Nov 2021, 18:00 by Crimson Wizard »

Sure, here's the code.  Line 1001 is the one with "GetWalkableAreaAtRoom(player.x, player.y) != GetGlobalInt(EXIT_WA_ENABLED)":

Code: Adventure Game Studio
  1. function exit_hidewalkablearea() {
  2.   if (GetGlobalInt(EXIT_WA_ENABLED) != -1) {  // line 999
  3.     // don't hide walkable area if the character is currently on top of it
  4.     if (GetWalkableAreaAtRoom(player.x, player.y) != GetGlobalInt(EXIT_WA_ENABLED)) {  // line 1001
  5.       RemoveWalkableArea(GetGlobalInt(EXIT_WA_ENABLED));
  6.       SetGlobalInt(EXIT_WA_ENABLED, -1);
  7.     }
  8.   }
  9. }

In 3.6 (but not in 3.5.1), when I call this function before setting SetGlobalInt(EXIT_WA_ENABLED, -1), I get the crash from the dump file.  Now that I'm setting the variable first, I no longer get the crash (because it fails the condition at line 999).

I'd guess the change in behavior here is that 3.5.1 returns -1 for GetGlobalInt(foo) if foo hasn't been set, whereas 3.6 doesn't?  So in 3.5.1, even though I hadn't set the variable, it failed the condition at line 999 and never tried calling GetWalkableAreaAtRoom().

Thanks,
Greg

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
I'd guess the change in behavior here is that 3.5.1 returns -1 for GetGlobalInt(foo) if foo hasn't been set, whereas 3.6 doesn't?  So in 3.5.1, even though I hadn't set the variable, it failed the condition at line 999 and never tried calling GetWalkableAreaAtRoom().

I never paid attention to this, but just tested in several versions including 3.5.1, and it always returns "0" if called before SetGlobalInt.

Although looking at the engine code, it seems like this global ints array is not properly initialized in program memory at the game start, which in theory means that these values could be anything and must not be relied upon. So, I'm not really sure how they may have any consistent values as shown by tests.
« Last Edit: 07 Nov 2021, 00:46 by Crimson Wizard »

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
Updated to Alpha 12
(use download links in the first post)

IMPORTANT: I remade one recently added property in General Settings, and unfortunately this conflicts with the previous build (Alpha 11). If you already used that build, here's what you need to do to make your project open in the current version again:
- Open Game.agf in a notepad;
- Search for the line starting as "<UseRealFontHeight>" and delete it. Save the file.

I apologize for this inconvenience.


TTF fonts setup

In this version I implemented a way to configure how TTF fonts are loaded and displayed in AGS. The problem was that AGS historically did some fixups to TTF looks for backward compatibility, but that made some fonts act worse and not position correctly when drawn in game. There are two new properties in the project that let to specify either new and old behavior.

1) "TTF font adjustment" - this property exists in Fonts and may be set individually for each of them; also similar property is in General Settings and sets default value for each new font you add to your game. This property lets you choose between "no changes" and backward compatible TTF fixup called "Resize ascender to the nominal font height".

To clarify a little, what this "fixup" means: the font has ascender and descender parts separated by a baseline. Ascender is parts of letters above baseline, descender is parts below baseline.
In the past AGS forcefully resized ascender to match the font's size. This could lead to ascender becoming larger or smaller. Because AGS draws texts starting with top-left corner, such change would result in text appearing shifted up or down relative to what you'd normally expect.
Now you may disable this behavior. The ability to keep it for the chosen fonts is left because there's a number of TTF fonts around created specially for AGS, possibly taking this weird behavior into account. For these fonts it may be desired to retain this "fixup".

2) "TTF fonts height used in the game logic" - this property exists in "General Settings" and has a global effect on all fonts. It lets you select what value is used as a height of line of text in game: TTF's nominal size (in "points") or real size in pixels. "Nominal size" is a backward compatible choice.

Why there's a difference: TTF are vector fonts, which do not always scale 1:1 to pixels because they must keep letter proportions. So, when you tell AGS to import a font at size 10, the actual pixel size may end up equal to 10, bit less or larger. Historically AGS ignored that fact and always reported text height using the "nominal" size, but that was a "lie".
The best way to check this out is to put some common TTF font on a GUI, and set GUI's height exactly to the font's size. In many fonts you will notice that some letters (usually "q,j,g,y" and similar) will not fit in, sometimes by a noteable amount.

So, now there's a setting that lets you enable using real height. This means that if you do GetTextHeight or GetFontHeight and so on -- it will report correct pixel heights of a text. Also, default font's linespacing is set equal either to the nominal or real height depending on this setting. But linespacing may also always be customized using corresponding Font's property, in the editor ("LineSpacing").


Other changes:

Editor:
- Fonts now have a readonly Family Name field, that lets user see the original name of a font they've imported (if available).

Engine:
 - Fixed potential crashes if a room-related API function has been called in "game_start"; this is achieved by having a dummy room placeholder object. Still results of such calls are undefined and should not be relied upon.
 - Fixed some TTF fonts could be cut at the bottom when the speech is displayed.

Compatibility
 - When running pre-3.4.1 games, anti-aliased TTF fonts display is now corrected (their vertical position was broken).
« Last Edit: 08 Nov 2021, 02:32 by Crimson Wizard »

Thanks very much, CW!  This fixed both the font issue and the hard crash in game_start() I'd been encountering.

Of the issues I'd reported, I'm only still experiencing the flakey AudioChannel.LengthMs issue.  That is, AudioChannel.LengthMs is sometimes returning 0 even when AudioChannel.PlayingClip.ID is not null.  (Details are a few appends down, but if you need further debugging information from me, just let me know.)  Thanks!

Great news about this new version !

I hope it will be soon a first 3.6 beta release :)

Good job, keep going ! ;)

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
Updated to Alpha 13
(use download links in the first post)


PLEASE NOTE: For the technical reasons Editor now requires .NET Framework 4.6 to run (was 4.5).


Multiple Speech VOX support

Editor now packs alternate speech voxes, by scanning the top-level directories inside the "Speech" folder. For each top-level subdirectory It creates a sp_[name].vox where [name] is the lowercase subdir name.

For example, if you have this in your game project:

 - Speech
 - - Francais
 - - MyLang

The editor will create following voxes:

 - speech.vox (with top-level files from the root "Speech" folder);
 - sp_francais.vox (with top-level files from "Speech/Francais");
 - sp_mylang.vox (with top-level files from "Speech/MyLang");


Engine supports switching to a different speech vox anytime. To order so, there's a new script function Game.ChangeSpeechVox(string name), where you pass the "[name]" part of the vox filename. E.g. if you have sp_francais.vox then do Game.ChangeSpeechVox("francais"). For default speech.vox pass empty string. The new readonly property Game.SpeechVoxFilename returns current vox name. This works in similar fashion to the functions that control translations.

Note that speech vox selection is not tied to the current text translation in any way, so you may switch both text and voice to the same language, or switch them to different languages to have e.g. French voice-over with English text.



Other changes:

Editor:
- In the "Import TTF" dialog added a choice to import the size closest to the given pixel height (because TTF's point size does not 1:1 correspond to the size in pixels).
- Default config is now saved also when the game is run in debug mode (F5). This ensures that the test run is using the latest Default Setup, if the user's config has not been created yet.
- Editor no longer errors on empty translations when compiling the game.
- Editor now exports values of the string type Custom Properties to translations.

Engine:
- Engine no longer bails out with error if the chosen translation cannot be loaded on startup.
- Fixed previous music was not gradually lowering volume when crossfading (regression in 3.6.0).
- Fixed game window becoming non-resizing after switching from fullscreen (regression in 3.6.0).
« Last Edit: 28 Nov 2021, 17:34 by Crimson Wizard »

Hello all.

Any update about the PNG compression for this new version?

Regards.

BTW I see at the beginning of my game that the black background, which it was blac at 3.5.1 now is pink.
After that everything is fine.
Any reason for that?

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
Any update about the PNG compression for this new version?

If you mean changing the compression method for the game sprites, there were no actual plans for this within 3.6.0.

EDIT: ags currently has a ready support for LZW compression which is used with room backgrounds for some reason. It might be curious to experiment also using this with sprites (optionally, if certain setting is on) and see what compression ratios it can achieve and what will be a perfomance impact.

BTW I see at the beginning of my game that the black background, which it was blac at 3.5.1 now is pink.
After that everything is fine.

Do you mean the room's background, or before the first room fades in? Does this depend on the graphics driver selection?
« Last Edit: 29 Nov 2021, 11:36 by Crimson Wizard »

Any update about the PNG compression for this new version?

If you mean changing the compression method for the game sprites, there were no actual plans for this within 3.6.0.

EDIT: ags currently has a ready support for LZW compression which is used with room backgrounds for some reason. It might be curious to experiment also using this with sprites (optionally, if certain setting is on) and see what compression rates it can achieve and what will be a perfomance impact.

Our sprites are 1,6 GB and our acsprset file is 3,4 GB. It is a shame that our game is going to be so huge in disk space.


BTW I see at the beginning of my game that the black background, which it was blac at 3.5.1 now is pink.
After that everything is fine.

Do you mean the room's background, or before the first room fades in? Does this depend on the graphics driver selection?

There where is empty background before it was black, and now it is pink/purple. This purple screen starts as soon as there is a fade in. Maybe it is showing the alpha layer as purple, when it should be invisible.

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
There where is empty background before it was black, and now it is pink/purple. This purple screen starts as soon as there is a fade in. Maybe it is showing the alpha layer as purple, when it should be invisible.

Is the "fade" layer itself purple, or something behind it? Do you use standard fade effect, or other methods, like gui with changing transparency?
Could you record a video of what is happening?
Do you know approximately since which build this started?
« Last Edit: 29 Nov 2021, 14:13 by Crimson Wizard »

Not sure from which build started, but I will provide you a video.

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
Not sure from which build started, but I will provide you a video.

Actually, I've been testing some of my own games, and it looks like similar thing happen if you have a room without any imported background, then there's a 320x200 magenta rectangle drawn instead of regular black one.


Meanwhile, I made an experimental build that lets select a "LZW" compression for sprites:
https://www.dropbox.com/s/d51t7xnmnwfkzh8/ags-3.6.0--experiment-spritelzw.zip?dl=0
it replaces regular "Compress sprites" option to "Sprite compression type", which has None / RLE (current) / LZW.

Could you check that out and see what difference does this make to your game sprites? I tried this with my games, but the effect was kind of small (but my largest sprite file is around 15 mb).
NOTE that it's best to use this on a side copy of a project, not the main one.

If this does not help much then I may look into adding Deflate (compression used by PNG) or else.
« Last Edit: 30 Nov 2021, 02:54 by Crimson Wizard »

arj0n

  • Mittens Vassal
  • art consists in drawing a line somewhere
    • arj0n worked on one or more games that won an AGS Award!
    •  
    • arj0n worked on one or more games that was nominated for an AGS Award!
Tried the 3 sprite file compression settings on one of my latest project.

Filetype sprites before importing into ags: png,
largest being still pretty small: 35,5 KB (36.369 bytes)

Game:
Resolution: 640x480, 32-bit true-colour
Total sprites: 1855 / 90000
acsprset.spr filesize: 63,2 MB

Results after compile:
None: game.exe filesize: 550 MB (576.947.304 bytes)
LZW: game.exe filesize: 138 MB (144.977.308 bytes)
RLE: game.exe filesize: 105 MB (110.966.094 bytes)
« Last Edit: 30 Nov 2021, 23:39 by arj0n »

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
Game:
Resolution: 640x480, 32-bit true-colour
Total sprites: 1855 / 90000
acsprset.spr filesize: 63,2 MB

Results after compile:
None: game.exe filesize: 550 MB (576.947.304 bytes)
LZW: game.exe filesize: 138 MB (144.977.308 bytes)
RLE: game.exe filesize: 105 MB (110.966.094 bytes)

Could you post sizes of acsprset.spr after changing compression and compiling, not full game.exe?
Also, do you have an estimate on the total size of source sprites?

arj0n

  • Mittens Vassal
  • art consists in drawing a line somewhere
    • arj0n worked on one or more games that won an AGS Award!
    •  
    • arj0n worked on one or more games that was nominated for an AGS Award!
Could you post sizes of acsprset.spr after changing compression and compiling, not full game.exe?
Also, do you have an estimate on the total size of source sprites?

sure:

source sprites: 2.352 png files; 6,03 MB (6.328.527 bytes)

Sprite file compression:
None: acsprset.spr filesize: 475 MB (498.297.296 bytes)
LZW: acsprset.spr filesize: 63,2 MB (66.327.300 bytes)
RLE: acsprset.spr filesize: 30,8 MB (32.316.086 bytes)

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
source sprites: 2.352 png files; 6,03 MB (6.328.527 bytes)

Sprite file compression:
None: acsprset.spr filesize: 475 MB (498.297.296 bytes)
LZW: acsprset.spr filesize: 63,2 MB (66.327.300 bytes)
RLE: acsprset.spr filesize: 30,8 MB (32.316.086 bytes)

This is horrendous...

Anyway, it's curious how LZW is twice as worse in your case, because in the hi-res 32-bit game I tested LZW was around 2% better than RLE:
raw: 14238 KB, RLE: 2693 KB, LZW: 2650 KB.
I'd wish to see other various projects tested, as results will likely depend on the amount of graphic detail and colors in a single sprite. But for now LZW does not seem worth adding, unless someone finds a project that displays better results with it. I suspect it may be best for larger photorealistic images.

Meanwhile, there are 2 more methods I am planning to add for this experiment, one is PNG's deflate algorithm, and another is basically to store sprites as indexed images whenever possible (if the total number of used colors is 256 or less). Latter has been suggested couple of years ago and i've been keeping that in mind for a while. Indexed format may in fact be used combined with other compression for even bigger effect.
« Last Edit: 01 Dec 2021, 18:41 by Crimson Wizard »

Not sure from which build started, but I will provide you a video.

Actually, I've been testing some of my own games, and it looks like similar thing happen if you have a room without any imported background, then there's a 320x200 magenta rectangle drawn instead of regular black one.


Meanwhile, I made an experimental build that lets select a "LZW" compression for sprites:
https://www.dropbox.com/s/d51t7xnmnwfkzh8/ags-3.6.0--experiment-spritelzw.zip?dl=0
it replaces regular "Compress sprites" option to "Sprite compression type", which has None / RLE (current) / LZW.

Could you check that out and see what difference does this make to your game sprites? I tried this with my games, but the effect was kind of small (but my largest sprite file is around 15 mb).
NOTE that it's best to use this on a side copy of a project, not the main one.

If this does not help much then I may look into adding Deflate (compression used by PNG) or else.
I'm afraid it didn't change the size of the asprset.spr. Do I need to do anything or just run it?

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
I'm afraid it didn't change the size of the asprset.spr. Do I need to do anything or just run it?

You need to choose a "Sprite compression" in General Settings. I dont remember if saving is enough, so perhaps rebuild the game to be sure. The "RLE" is standard compression, "LZW" is a new choice added.

Ok I see, what it needs to be changed.
LEH 3.481.618 KB - I had this one selected
LZW 2.934.687 KB

Not sure from which build started, but I will provide you a video.
BTW I sent you the videos through Discord

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
Reuploaded the experimental version with the new method that stores 16-bit and 32-bit images as 8-bit with palette so long as they have below 257 different colors in them.
https://www.dropbox.com/s/d51t7xnmnwfkzh8/ags-3.6.0--experiment-spritelzw.zip?dl=0
This new method is called "Indexed" for short.

My own test results vary depending on the game's graphic style. In the game with good quality antialiased sprites the effect is barely noticeable (reduces size by 10%) as most sprites have >256 colors with varying alpha channel values; but in the game with "old-school" pixel graphics it's comparable to RLE.
Might try another version of indexed image store where alpha channel is saved separately, which may significantly reduce the number of color variations and fit them into the 8-bit palette.

Also would need to make it possible to combine "indexed" format with other compressions (e.g. Indexed + RLE or Indexed + LZW).
« Last Edit: 02 Dec 2021, 01:41 by Crimson Wizard »

arj0n

  • Mittens Vassal
  • art consists in drawing a line somewhere
    • arj0n worked on one or more games that won an AGS Award!
    •  
    • arj0n worked on one or more games that was nominated for an AGS Award!
640x480, 32-bit true-colour
Total sprites in project (F2):   1855 / 90000
source sprites: 2.352 png files; 6,03 MB (6.328.527 bytes)

Sprite file compression:
None: acsprset.spr filesize: 475 MB (498.297.296 bytes)
Indexed: acsprset.spr filesize: 118 MB (124.652.814 bytes)
LZW: acsprset.spr filesize: 63,2 MB (66.327.300 bytes)
RLE: acsprset.spr filesize: 30,8 MB (32.316.086 bytes)

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
640x480, 32-bit true-colour

Sprite file compression:
None: acsprset.spr filesize: 475 MB (498.297.296 bytes)
Indexed: acsprset.spr filesize: 118 MB (124.652.814 bytes)

Well, it looks like it saved virtually all of your 32-bit sprites as indexed 8-bit, reducing size 4 times as expected :).
But yes, this is maximum of what it can do, so for better results it has to be combined with the other compression types.

arj0n

  • Mittens Vassal
  • art consists in drawing a line somewhere
    • arj0n worked on one or more games that won an AGS Award!
    •  
    • arj0n worked on one or more games that was nominated for an AGS Award!
Given all sprites in my test do have below 257 different colors in them, this seems like a good result to me already :)

320x200, 32-bit true-colour
Total sprites in project:   35703 / 90000
PNG folder: 1,61 GB (1.734.822.663 bytes)

Sprite file compression:
None: acsprset.spr filesize: 8,77 GB (9.425.965.010 bytes)
Indexed: acsprset.spr filesize: 7,66 GB (8.229.703.633 bytes)
LZW: acsprset.spr filesize: 2,79 GB (3.005.119.147 bytes)
RLE: acsprset.spr filesize: 3,32 GB (3.565.176.753 bytes)

arj0n

  • Mittens Vassal
  • art consists in drawing a line somewhere
    • arj0n worked on one or more games that won an AGS Award!
    •  
    • arj0n worked on one or more games that was nominated for an AGS Award!
That's quite a different result, nightmarer.

My 32-bit background sprites seem to have a max amount of only about 17 different colors in them.
When looking at your 'indexed' compression result, I suspect your sprites have a higher amount of different colors?

I guess that our sprites are pretty colored :)

arj0n

  • Mittens Vassal
  • art consists in drawing a line somewhere
    • arj0n worked on one or more games that won an AGS Award!
    •  
    • arj0n worked on one or more games that was nominated for an AGS Award!

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
Here's a new experimental build:
https://www.dropbox.com/s/d51t7xnmnwfkzh8/ags-3.6.0--experiment-spritelzw.zip?dl=0

PLEASE NOTE: you may will have to make a new clean copy of your project to open in this build, because experimental settings changed again. Also do full rebuild at least once to ensure sprite file is recreated with correct settings.

* Can select "Indexed bitmap" method separate from the compression, which allows to mix these. The new option in settings is called "Save sprites as indexed bitmaps when possible" (True/False, default is True). So you may do both "Save sprites as indexed bitmap..." and some compression (None / RLE / LZW).
* The "indexed bitmap" method now does two attempts: first tries to make 256-colored palette with alpha, if failed then tries to make palette without alpha and if second succeeded then writes an indexed bitmap with an accompanying alpha channel. This essentially stores 32-bit sprite in 16-bit: less efficient but may still give x2 decrease in size if lucky.
* Slightly improved RLE compression, may do better by like couple % (not too important, but should mention this).



My 32-bit background sprites seem to have a max amount of only about 17 different colors in them.

BTW, is there a reason why your game is not 8-bit? In your old game remakes you might be able to only use 1 set of sprites and change actual palette to emulate palettes from various systems.
« Last Edit: 03 Dec 2021, 03:14 by Crimson Wizard »

arj0n

  • Mittens Vassal
  • art consists in drawing a line somewhere
    • arj0n worked on one or more games that won an AGS Award!
    •  
    • arj0n worked on one or more games that was nominated for an AGS Award!
BTW, is there a reason why your game is not 8-bit? In your old game remakes you might be able to only use 1 set of sprites and change actual palette to emulate palettes from various systems.

Normally I do use the palette change for such old game indeed.
But this time it wasn't an option because:
  • what is depicted in the sprites (for ex. a mirror) is the same for amiga en dos but differs in the atari version.
  • the dos version uses a strange way of vertical lines to create an effect, a bit like shading
There are several differences like the location and shape of mirror, lamp & nightstand for example:


But when I tried to go for an 8bit version for my project, I failed to get a normal result for the room bg after importing an 8bit version of the background sprite.
Here a test using a new clean project importing a 8bit room bg image:
Spoiler: ShowHide


AGS basic settings:
Spoiler: ShowHide



arj0n

  • Mittens Vassal
  • art consists in drawing a line somewhere
    • arj0n worked on one or more games that won an AGS Award!
    •  
    • arj0n worked on one or more games that was nominated for an AGS Award!
Here's a new experimental build:
https://www.dropbox.com/s/d51t7xnmnwfkzh8/ags-3.6.0--experiment-spritelzw.zip?dl=0

indexed bitmaps true
none: 118 MB (124.645.394 bytes)
rle: 9,24 MB (9.693.772 bytes)
lzw: 16,0 MB (16.871.106 bytes)

indexed bitmaps false
none: 475 MB (498.297.296 bytes)
rle: 29,5 MB (31.035.907 bytes)
lzw: 63,2 MB (66.327.162 bytes)

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
indexed bitmaps true
none: 118 MB (124.645.394 bytes)
rle: 9,24 MB (9.693.772 bytes)
lzw: 16,0 MB (16.871.106 bytes)

IIRC your raw sources were 6 MB, so indexed bitmaps + RLE give a pretty close result?

arj0n

  • Mittens Vassal
  • art consists in drawing a line somewhere
    • arj0n worked on one or more games that won an AGS Award!
    •  
    • arj0n worked on one or more games that was nominated for an AGS Award!
Correct.

Hello.
Here my files.

indexed bitmaps true
none: 7,41 GB (7.966.279.437 bytes)
rle: 3,23 GB (3.476.975.790 bytes)
lzw: 2,61 GB (2.811.194.259 bytes)

indexed bitmaps false
none: 8,77 GB (9.425.965.010 bytes)
rle: 3,31 GB (3.555.361.792 bytes)
lzw: 2,79 GB (3.005.119.147 bytes)

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
Ah well, I see that indexed format does not help alot in your situation (effect is only noteable without extra compression).

Probably I'll add these new compression choices first, and then after check if the deflate (png's) compression will work any better.

At least LZW saves about 0.7 GB compared to RLE already.
« Last Edit: 04 Dec 2021, 19:44 by Crimson Wizard »

Any ETA for the stable release?

I'm so looking forward to adding all 9 languages into one single build for my prototype!!  :grin:

Any news about how the 3.6.0 is going to be released? I'm longing to change from 3.5.1 and enjoy the new features included.

Hi there !

Is the 3.6 version of AGS will allow to do something with the "length" of ListBox Items ? As far as I know, there is no option to "cut" the text, it always go outside the list box.

Of course, it could be perfect that AGS "remembers" the full length of the item, even if it's displayed not fully in the listbox. For scripting reasons, it could be nice ;)

Something like that is possible ?

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
Hello.
Is the 3.6 version of AGS will allow to do something with the "length" of ListBox Items ? As far as I know, there is no option to "cut" the text, it always go outside the list box.

Of course, it could be perfect that AGS "remembers" the full length of the item, even if it's displayed not fully in the listbox. For scripting reasons, it could be nice

TBH I only recently realized that it's happening for some reason, never paid much attention to this before, I guess.

To be clear, none of the gui controls in AGS seem to clip their textual contents, and buttons only clip the image when certain property is set.
This is not right, afaik any normal GUI system clips the control contents to its size. I think it's possible to make this change for 3.6.0, maybe even unconditionally, because it looks weird. Unless someone has an idea of a good use case for non-clipping the text (which cannot be solved by also adding a label somewhere).
Of course this will have nothing to do with the actual text property, the clipping is a drawing operation that does not change the control's data but only affects its look.



Also, I'm sorry for not answering earlier -
Any ETA for the stable release?
Any news about how the 3.6.0 is going to be released? I'm longing to change from 3.5.1 and enjoy the new features included.

I believe that the main bulk of changes is already complete (in fact it has much more than I initially planned, considering it also has a new render, audio & input backend based on SDL2). And I know that at least few people already made or are making their games with this (I recall seeing a 3.6.0 game in the AGS database).

But it's difficult to say when exactly the "final" release will be. Some of the new features may require polishing, and the version needs more testing overall.
Unfortunately the developers team is really small (there are like 2-4 people working at irregular times, and not all of them are working on this exactly version), so the only realistic solution is if the AGS community participates in testing.
I do regularily use the engine to run the games (not make ones), so may notice if some issue stands out, but frankly don't know how "stable" overall this is, and have to also rely on what other people report.

There are several known problems in 3.6.0, after fixing which I may release it as "Beta" to encourage more use and testing.
« Last Edit: 28 Dec 2021, 20:16 by Crimson Wizard »

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
Updated to Alpha 14
(use download links in the first post)

Contains all the changes from 3.5.1 Patch 6.

PLEASE NOTE: For the technical reasons Editor now requires .NET Framework 4.6 to run (was 4.5).


Editor
 - Added "Sprite file compression" option in General Settings, replacing "Compress the sprite file" option. The new option allows a selection of compression algorithm used for sprites. Currently supported: None, RLE (old default compression) and LZW.
 - Added "Enable sprite storage optimization" option to the General Settings, that permits the editor to repack sprites in a different storage format, reducing their disk size whenever possible. This option may be used alongside with the sprite compression. Note that this does not change how the sprites work in game.

NOTES: RLE compression is best for the games with simple graphics without much detail. LZW works better than RLE when the graphics are detailed, especially with anti-aliasing etc.
"Enable sprite storage optimization" is best for games with low-res "old-school" gfx which use relatively small number of individual colors. Games with anti-aliased sprites with alpha channel will benefit less from this (or not at all). Having this option enabled does not have any consequences if sprite storage cannot be optimized, these sprites are simply stored as default, so it's okay to keep this enabled at all times (unless your tests show that game loading times became longer because of this).

Engine
 - Fixed default black room backgrounds were displayed as magenta / "magic pink" (regression).
« Last Edit: 30 Dec 2021, 12:32 by Crimson Wizard »

Pajama Sam

  • Sam's The name
Does this version have 16 sound channels now?
« Last Edit: 30 Dec 2021, 06:55 by Pajama Sam »

Thanks again for the amazing work! I wish I knew more about Windows/.net programming to be able to help you.

One question, do you think it will ever be possible to customize the font size of the editor UI? Not the code editor, because you can zoom in/zoom out, but the right panel (Explore project and Properties) would be extremely useful!

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
My plan in regards to 3.6.0 is currently this:

1. Fill in most noteable gaps in existing functionality; fix known issues with the base features, etc.
2. Release 3.6.0 as Beta version, and encourage people to use and test it more.
3. While in Beta stage, look if there are feature requests that are significant and don't require much changes to implement, and maybe do some.

For some time I hoped to bring 3.6.0 to almost finished state before the New Year, but somehow I got distracted and did not work much during the autumn months... So now I do not want to prolong its development further. It's been worked on roughly for 13 or 14 months now, so it's time to wrap up.



Does this version have 16 sound channels now?

Yes, it does for a while. All the additions to 3.6.0 are mentioned in the first post (a little disorganized list, but I will make a proper one soon).

One question, do you think it will ever be possible to customize the font size of the editor UI? Not the code editor, because you can zoom in/zoom out, but the right panel (Explore project and Properties) would be extremely useful!

Sorry, I cannot really tell, this is something to plan ahead and think through. Editor currently supports "color themes" (File -> Preferences -> Editor appearance -> Color themes), which recolor all controls. So I suppose similar method could be used to alter fonts everywhere. But we need to ask those who were working on this last time, maybe they have certain plans already (Chamber of Fear (persn on github) and Alan v. Drake).

« Last Edit: 30 Dec 2021, 13:00 by Crimson Wizard »

Dave Gilbert

  • Mittens Vassal
  • AGS Baker
  • Eye see you.
    • Lifetime Achievement Award Winner
    • Dave Gilbert worked on one or more games that won an AGS Award!
    •  
    • Dave Gilbert worked on one or more games that was nominated for an AGS Award!
This is SO GREAT! Thanks, CW.

One small thing I noticed. You incorporated this feature where you can resize the sprite images in the sprite tab (which is fantastic!), but it's not implemented in the view tab as well. The test that eri0o created in the thread contained both. Is it possible to include the view loop resizing as well?

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
One small thing I noticed. You incorporated this feature where you can resize the sprite images in the sprite tab (which is fantastic!), but it's not implemented in the view tab as well. The test that eri0o created in the thread contained both. Is it possible to include the view loop resizing as well?

Ah, right, this was suspended because it also included the "sound" icon, but there has been an argument about how this icon should be positioned.
But it must be possible to only add the zoom controls alone for now. I'll try do that on the next update.

Dave Gilbert

  • Mittens Vassal
  • AGS Baker
  • Eye see you.
    • Lifetime Achievement Award Winner
    • Dave Gilbert worked on one or more games that won an AGS Award!
    •  
    • Dave Gilbert worked on one or more games that was nominated for an AGS Award!
Yay! Thanks so much. I wasn't aware about a sound icon, but I found the thread and that also sounds extremely useful!

Pajama Sam

  • Sam's The name
I wanted to suggest a script that can modify a sound as the game is running.
Such as-

Code: Adventure Game Studio
  1. function object_AnyClick()
  2. {
  3.    Sound.Pitch=-or+ number;
  4. }
  5.  

or
Code: Adventure Game Studio
  1. function object_AnyClick()
  2. {
  3.    Sound.FadeIn=-or+ number;
  4.    Sound.FadeOut=-or+ number;
  5. }
  6.  

or
Code: Adventure Game Studio
  1. function object_AnyClick()
  2. {
  3.    Sound.Reverse=true;
  4. }
  5.  

Do you think these things could be useful in some way. Or is this already a module or plugin?

By the way what you did with resizing in the sprite tab is fantastic.Now people with poor eyesight"like my brother" can make games that were impossible for them to see to make.

I would also like to suggest making the scripting text size adjustable in prefrences.
« Last Edit: 01 Jan 2022, 05:46 by Pajama Sam »

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
Code: Adventure Game Studio
  1. function object_AnyClick()
  2. {
  3.    Sound.FadeIn=-or+ number;
  4.    Sound.FadeOut=-or+ number;
  5. }
  6.  


By "fade" do you mean volume? You may adjust the volume from the channel returned from Play function.
Code: Adventure Game Studio
  1. AudioChannel *chan = aSound.Play();
  2. ...
  3. // later
  4. ...
  5. chan.Volume += 1;
  6.  

More info in the manual: https://adventuregamestudio.github.io/ags-manual/AudioChannel.html


I would also like to suggest making the scripting text size adjustable in prefrences.

Scripting text may be changed with Ctrl + Mouse Wheel, the only problem at the moment is that it does not save, so you have to do it every time.
I guess it should be possible to save the script font size in user settings.
« Last Edit: 01 Jan 2022, 06:34 by Crimson Wizard »

Pajama Sam

  • Sam's The name
I just forgot that you could fade sound that way but the main ones I was talking about were pitch and reverse.Another good thing would be the ability to set the sound file at more amplitude than the original.I know that volume control is available now but this is limited to the original clips volume.

Sorry, I cannot really tell, this is something to plan ahead and think through. Editor currently supports "color themes" (File -> Preferences -> Editor appearance -> Color themes), which recolor all controls. So I suppose similar method could be used to alter fonts everywhere. But we need to ask those who were working on this last time, maybe they have certain plans already (Chamber of Fear (persn on github) and Alan v. Drake).

Yes, font size as part of the color themes would be ideal! Maybe, if it's easier, you could try to build an experimental/alternative version that uses by default a bigger font size (maybe 4px or 6px more) and see what happens?
If you need a beta tester, I'm here. thank you!


Dave Gilbert

  • Mittens Vassal
  • AGS Baker
  • Eye see you.
    • Lifetime Achievement Award Winner
    • Dave Gilbert worked on one or more games that won an AGS Award!
    •  
    • Dave Gilbert worked on one or more games that was nominated for an AGS Award!
Hello! I upgraded from 3.6.0.12 (alpha 13) to 3.6.0.13 (alpha 14). My game loads, compiles, and runs just fine. However, when I added some sprites to sprite editor, I got this error on saving:



I kept a backup so I could revert back to 3.6.0.12. But any help is appreciated!
« Last Edit: 18 Jan 2022, 15:17 by Dave Gilbert »

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
Hello! I upgraded from 3.6.0.12 (alpha 13) to 3.6.0.13 (alpha 14). My game loads, compiles, and runs just fine. However, when I added some sprites to sprite editor, I got this error on saving:

So, ^ this is a bug found in the latest 3.6.0 build, it was reported just recently, and I will be releasing an update soon.

It happens whenever you are changing sprites in your game and then try to save.
« Last Edit: 18 Jan 2022, 15:58 by Crimson Wizard »

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
Updated to Alpha 15
(use download links in the first post)

Contains all the changes from 3.5.1 Patch 7.

PLEASE NOTE: For the technical reasons Editor now requires .NET Framework 4.6 to run (was 4.5).


Editor:
- Added "GUI controls clip their contents" option to the General Settings. Enabled by default in the new projects, this clips texts to the control's rectangle.
- Added zoom controls for the Cursor, Inventory Item and View panes.
- On the View pane the frames having set delay and linked sound will be now indicated with icons.
- Fixed potential exception that may occur when trying to save a modified spritefile (regression since 3.6.0.13).

Engine:
- Added "--sdl-log" command line option for setting up SDL2 library output verbosity. The engine log config now has a new "sdl" group meant for SDL2 messages.
- Fixed potential crash on startup which happens if no audio device was found.
- Fixed number of problems with OGV Theora playback (stuttering and freezing video).
- Corrections to switching graphic mode between windowed and fullscreen.

Android:
- Fix single game launcher not starting (regression since 3.6.0.13).
- AGS Player now searches for the games using proper detection (ported fix from 3.5.1 where it was applied to an older version of the game launcher).
- In AGS Player added "Browse" button to the game folder selection, which opens default system file picker.
- AGS Player now searches for games recursively, in all the subfolders.
- Fixed AGS Player crashing if no android.cfg was present in the games dir.

WinSetup:
- Fixed "Fullscreen as borderless window" checkbox was not actually working.

Great Job Crimson Wizard and the developer team !

It seems that the 3.6 can be considered as a beta version, now ? Or should we wait a bit more time ?

The new features are very interesting :)

Any way to have the "GUI Controls clip their content" option available individually ? Or is it for all GUI Controls ?

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
It seems that the 3.6 can be considered as a beta version, now ?

Almost, I guess; i'd like to wait until we have Android and/or Web build available from the Editor (eri0o is working on that afaik).

Any way to have the "GUI Controls clip their content" option available individually ? Or is it for all GUI Controls ?

It is for all GUI in game.
Personally I believe that it should be a normal default, as it is in any common GUI frameworks, as far as I am aware. But the option exists for backward compatibility, e.g. if you import an older project where you'd like to keep existing looks.

In theory it is possible to have per-control option too, not much things have to be added by the way, as such option already exists, but is only used by the Button with image (known as ClipImage property).
The reason I did not do that right away is because I believe that would complicate game desig; such beavior already introduces separate idea of control's visual dimension different from the one defined by the X,Y,Width,Height.
There may be few situations where a user may want to have a text going outside a button, for example, but I think that may be solved by having both button and label combined.
In any case, I'd rather wait and see if there are any issues with the current option, as we may always add per-control option if there's no way around that.

Great !

The function to built for Android inside the Editor will be a very nice feature !!

I plan to go on the 3.6 very soon with my game.

eri0o

Once I get it a little prettier I will open a topic in the Editor board to ask feedback with test builds.

Spoiler: ShowHide
« Last Edit: 20 Jan 2022, 21:08 by eri0o »

It's FANTASTIC @eri0o   !!!
I can't wait for it  8-0
My official site: http://www.pershaland.ir/

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
Only few days later, I must post an update fixing another annoying bug found just now.

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

IMPORTANT: If you were using 3.6.0 before, then you may receive a warning about your project spritefile containing "leftover" data which will be cleaned up now. That is normal, kind of (see below). That does not delete any actual sprites from the game project itself, only fixes the compiled "acsprset.spr"


Editor:
- Fixed sprites were never deleted from spritefile, only had their references deleted from the project (NOTE: this bug exists at least since Alpha 9).
- Editor now cleanups spritefile on game load, identifying any data not referenced by the project and marking it for deletion.

Engine:
- Updated SDL_Sound lib to recent version, this is purely internal change but it's unknown if this will lead to anything noteable in particular.



« Last Edit: 21 Jan 2022, 13:11 by Crimson Wizard »

Also I had an idea about Listboxes : should it be possible to have a feature that when you click on a listbox, if you just clicked on the already selected index, the listbox gets Listbox.SelectedIndex=-1 ?

It should be a nice native effect. What do you think ?

Also, sorry for the double-post, but I think this question has been asked a thousand times, but if possible, could we imagine a compatibility for AGS managing the PNG files like it manages BMP files ?

Creating DynamicSprites from PNG files out of the game, things like that. Would be perfect, with the alpha canal, will make the life easier for dynamicsprites with transparent backgrounds :)

Grundislav

  • AGS Baker
  • Mittens Prince
  • Brogan
    • Lifetime Achievement Award Winner
    • Grundislav worked on one or more games that won an AGS Award!
    •  
    • Grundislav worked on one or more games that was nominated for an AGS Award!
Engine:
- Updated SDL_Sound lib to recent version, this is purely internal change but it's unknown if this will lead to anything noteable in particular.

Unfortunately this seems to have brought back the annoying issue that was in the previous audio system.

Let's say you have INTRO.OGG and LOOP.OGG, and code it so one plays immediately after the other for a seamless transition:
Code: Adventure Game Studio
  1. CurrentMusic = aIntro.Play();
  2. SetGameOption(OPT_CROSSFADEMUSIC, 0);
  3. CurrentMusic = aLoop.PlayQueued();

But there is a very small hiccup when switching tracks. Sometimes it's more noticeable than others, but the problem had been completely resolved in an earlier version of this alpha.

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
Engine:
- Updated SDL_Sound lib to recent version, this is purely internal change but it's unknown if this will lead to anything noteable in particular.

Unfortunately this seems to have brought back the annoying issue that was in the previous audio system.

Does this happen with any random clips? I may test with the older library version, or make test builds for others to try.

Grundislav

  • AGS Baker
  • Mittens Prince
  • Brogan
    • Lifetime Achievement Award Winner
    • Grundislav worked on one or more games that won an AGS Award!
    •  
    • Grundislav worked on one or more games that was nominated for an AGS Award!
It happens with any music track, and has been happening since at least version 2.72.

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
Thing is, that SDL_Sound library is not participating in playing the sounds, but only in loading (decoding) them. So if anything affected this was elsewhere.

eri0o

The gap between songs tracking bug is this one: https://github.com/adventuregamestudio/ags/issues/501

@Grundislav, can you make a tiny test game that reproduces? I tried to make one, and I am not sure if I was hearing it or not, but when I recorded the sound being output with Audacity, I didn't saw the hiccup, which I was able to actually see in a previous version. If you could point an alpha version that had no hiccups would be interesting too

Anyway, rolling back SDL_sound in case it's the culprit it should be easy. I updated because it brought compatibility with 32bit wav files and fixed some minor issues. But as CW said we only use it for decoding.

It happens with any music track, and has been happening since at least version 2.72.

Does it happen only with mp3 files, or also with ogg and wav? If it's only a problem with mp3, it might be an issue of the format itself, not AGS, since mp3 encoding always creates a tiny "gap" at the end of the file.

(For more info: https://sound.stackexchange.com/questions/8916/mp3-gapless-looping-help)
« Last Edit: 28 Jan 2022, 12:36 by Laura Hunt »

Grundislav

  • AGS Baker
  • Mittens Prince
  • Brogan
    • Lifetime Achievement Award Winner
    • Grundislav worked on one or more games that won an AGS Award!
    •  
    • Grundislav worked on one or more games that was nominated for an AGS Award!
I use Oggs, so it’s not the issue with MP3s. Also I was assuming it was because of the SDL_sound update, but I’m probably wrong on that. If it helps, the version of the alpha I tested where the issue was not present was alpha 10. Is there an archive of previous versions where I can download alpha 10 again to make the test games for comparison?

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
I use Oggs, so it’s not the issue with MP3s. Also I was assuming it was because of the SDL_sound update, but I’m probably wrong on that. If it helps, the version of the alpha I tested where the issue was not present was alpha 10. Is there an archive of previous versions where I can download alpha 10 again to make the test games for comparison?

Certainly, we have all the releases on github:
https://github.com/adventuregamestudio/ags/releases

specifically 3.6.0 alpha 10:
https://github.com/adventuregamestudio/ags/releases/tag/v.3.6.0.9

The downloads are attached at the end of the post, under "Assets".

Grundislav

  • AGS Baker
  • Mittens Prince
  • Brogan
    • Lifetime Achievement Award Winner
    • Grundislav worked on one or more games that won an AGS Award!
    •  
    • Grundislav worked on one or more games that was nominated for an AGS Award!
Great, thank you!

Here is an archive with several tests for 2 tracks. All notes provided in the readme.txt.

https://www.dropbox.com/s/vayozljgedx3rx0/AudioTests.zip?dl=0

Sorry to post it here, but maybe it needs to be fixed in the new 3.6 coming...

I encounter this problem : when I press "enter", it generates something that would be done by pressiong CtrlK or something like that (a combination of 2 keys, but NOT the "enter" key).

I have no "if (keycode==eKeyenter)" in my "on_keypress" function... And I don't ever know if "enter" key can be used like that.

Any idea about it ? Which value has the enter key ?

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
I encounter this problem : when I press "enter", it generates something that would be done by pressiong CtrlK or something like that (a combination of 2 keys, but NOT the "enter" key).

It's a known issue that eKeyCtrlM has the same code as Enter/Return.
This may be noticed by comparing their values in the key codes table in the manual: https://adventuregamestudio.github.io/ags-manual/ASCIIcodes.html

The workaround is to additionally test if ctrl is pressed as
Code: Adventure Game Studio
  1. if ( IsKeyPressed(eKeyCtrlLeft) ||  IsKeyPressed(eKeyCtrlRight) )
  2.  

Oh, I see ! But is there a way to fix it ?

EDIT : eKeyCtrlLeft and eKeyCtrlRight don't exist... Have they got another name in AGS ?

EDIT 2 : so I just used their ASCII code (405 and 406) instead, but there are no "enum value" for them in my version (3.5.1)

EDIT 3 : in the same "theme", is "eMouseWheelNorth" and "eMouseWheelSouth" should work with a tactile pad of a PC ? (I don't know the english name for that, but you know, the tactile zone where your fingers can simulate the mouse, like for a smartphone. Scrolling can be done by using two fingers).
« Last Edit: 29 Jan 2022, 08:35 by Baguettator »

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
Oh, I see ! But is there a way to fix it ?

Probably won't do this for 3.5.1, as it's a rare problem and there's a workaround (posted above). We may look if it's possible to improve in 3.6.0 version.


EDIT 3 : in the same "theme", is "eMouseWheelNorth" and "eMouseWheelSouth" should work with a tactile pad of a PC ? (I don't know the english name for that, but you know, the tactile zone where your fingers can simulate the mouse, like for a smartphone. Scrolling can be done by using two fingers).

I don't know. But we recently received a bug report that touch pad does not register some command for the right click on Linux in 3.5.1, and later this was confirmed to work in 3.6.0. Perhaps you could test in 3.6.0 to see if it works there.
« Last Edit: 29 Jan 2022, 15:02 by Crimson Wizard »

OK, will see in 3.6 !

And what about the ekeyCtrlLeft and ekeyCtrlRight ? Have they been deleted ?

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
And what about the ekeyCtrlLeft and ekeyCtrlRight ? Have they been deleted ?

They have been added in 3.6.0, were not declared earlier. The values themselves should be valid in earlier versions.

I'm not sure if this is an issue with 3.6.0 or with all versions of the engine, so I'll mention it here.

When importing ttf fonts, it seems that the engine is mixing up px (pixels) and pt (points).

I have a font that is 11x11 pixels (this one), however, when I import it, AGS says it has a point size of 11 and thus a pixel height of 14:



However, this is incorrect because as mentioned above, the pixel size is 11, which corresponds to a point size of 8. This happens with other fonts too, e.g., if I have a font with a nominal size of 9px, AGS will say it's 9pt, etc.

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
I have a font that is 11x11 pixels (this one), however, when I import it, AGS says it has a point size of 11 and thus a pixel height of 14:



However, this is incorrect because as mentioned above, the pixel size is 11, which corresponds to a point size of 8.

Please check the value of "TTF font adjustment" property?
« Last Edit: 29 Jan 2022, 23:13 by Crimson Wizard »

Please check the value of "TTF font adjustment" property?

In my example above, it's set to "Resize ascender to the nominal font height". If I switch it to "Do nothing", the Font Height field changes to 13.

That's the only thing that changes; the point size field still displays "11 pt".

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
However, this is incorrect because as mentioned above, the pixel size is 11

I'm not certain if I understand this. AFAIK the TTF is not supposed to have a fixed pixel size itself, its pixel size depends on the point size it's used at, as well as some characteristics.
In the description it sais "font is designed to be displayed at 11px and multiples thereof", but afaik that does not mean that "the font is 11px".
Where may I see the information about point size 8 corresponding to 11px?

AGS asks for the size you want to import the font at, and it's the "Point size" property it displays.

UPDATE: I've read a bit about this, and apparently AGS editor uses "Point" term incorrectly there. I think it's meaning is rather "Import size", as in something that user requested.
TBH this specific may be due to how the importing process works with the library that we're using.

It also might be that the new "import ttf" dialog is also wrong, and should be designed differently. As an option it may be reversed to its old looks if it was more correct.

On a side note, testing this font in 3.2.1 produces same results as 3.6.0, judging by the font looks (when importing with same size parameter).

UPDATE 2: Running under debugger, i can see that when the font is imported with the size "11", its data sais "size 11x11". However the font rendering library calculates final size by summing "ascender + descender", which results in a higher height (13). AGS uses this reported number to show as "Font Height".
What puzzles me further is that under the same circumstances the actual size of letters on screen (tested by screenshot) could be 14px (capital letters).
Perhaps, 11x11 is some kind of a control size, not directly related to particular letter(s).
I wish I knew more about TTF fonts.
« Last Edit: 30 Jan 2022, 00:16 by Crimson Wizard »

I'm not certain if I understand this. AFAIK the TTF is not supposed to have a fixed pixel size itself, its pixel size depends on the point size it's used at, as well as some characteristics.
In the description it sais "font is designed to be displayed at 11px and multiples thereof", but afaik that does not mean that "the font is 11px".

Right, but pixel fonts like this one are not "real" true type fonts; rather they are more like bitmap fonts saved as ttf for convenience and for wider compatibilty than a strict bitmap font format. But they are only meant to be rendered at very specific sizes (i.e., the "native" size the characters/glyphs were designed at, and integer multipliers of that, just like any pixel art in general).


Where may I see the information about point size 8 corresponding to 11px?

Here, for example: https://simplecss.eu/pxtoems.html



It also might be that the new "import ttf" dialog is also wrong, and should be designed differently. As an option it may be reversed to its old looks if it was more correct.

It could be an option, yes. So far, the "Import at font's point size" option hasn't done anything for me in most cases. How does AGS calculate the font's point size anyway, given that, as you said above, a true vector font doesn't really have a specific/default point size?


UPDATE 2: Running under debugger, i can see that when the font is imported with the size "11", its data sais "size 11x11". However the font rendering library calculates final size by summing "ascender + descender", which results in a higher height (13). AGS uses this reported number to show as "Font Height".
What puzzles me further is that under the same circumstances the actual size of letters on screen (tested by screenshot) could be 14px (capital letters).
Perhaps, 11x11 is some kind of a control size, not directly related to particular letter(s).

Yes, I found that confusing too. I'm assuming that 11x11 is simply saying that every character by itself fits in a 11x11 cell, but of course, this is not the same as the total font height when we take the tallest characters + descenders into account. But at least this confirms that AGS is calculating the total font height correctly as 14 (when the "resize ascender" option is active). This is making me think that maybe AGS is indeed doing things correctly, and it's the font designers who are failing to account for the real total height of their fonts by reporting only the "cell size".
« Last Edit: 30 Jan 2022, 08:55 by Laura Hunt »

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
It also might be that the new "import ttf" dialog is also wrong, and should be designed differently. As an option it may be reversed to its old looks if it was more correct.

It could be an option, yes. So far, the "Import at font's point size" option hasn't done anything for me in most cases. How does AGS calculate the font's point size anyway, given that, as you said above, a true vector font doesn't really have a specific/default point size?

I think there may be a misunderstanding too. "Import at font's point size" also uses the number field, it tries to import the font at the typed size. But it uses "point" term incorrectly, as it seems. So the correct title would be "Import at this font's size".
The difference between two these options is that the first option imports at the size given by user, and the second searches for the font size that results in particular full font height (ascender + descender).
I may either remove the second option if it's not useful, or reorganize fields to make it more clear that both options use the number field.


But at least this confirms that AGS is calculating the total font height correctly as 14 (when the "resize ascender" option is active).
Erm, this particular option is a backward compatibility feature, and is meant mostly for fonts which made specifically for AGS in the past. Because ascender is resized to match the demanded font size, this option may result in font glyphs being drawn lower, adding vertical space above the letters.

The problem with 3.6.0 is that it still uses unmodified templates from 3.5.*, and therefore when you create your games all the properties are adjusted for importing these older projects.
We need to update the templates to have the recommended settings for 3.6.0, with "resize ascender" off, and other changes.
« Last Edit: 30 Jan 2022, 15:35 by Crimson Wizard »

It also might be that the new "import ttf" dialog is also wrong, and should be designed differently. As an option it may be reversed to its old looks if it was more correct.

It could be an option, yes. So far, the "Import at font's point size" option hasn't done anything for me in most cases. How does AGS calculate the font's point size anyway, given that, as you said above, a true vector font doesn't really have a specific/default point size?

I think there may be a misunderstanding too. "Import at font's point size" also uses the number field, it tries to import the font at the typed size. But it uses "point" term incorrectly, as it seems. So the correct title would be "Import at this font's size".
The difference between two these options is that the first option imports at the size given by user, and the second searches for the font size that results in particular full font height (ascender + descender).
I may either remove the second option if it's not useful, or reorganize fields to make it more clear that both options use the number field.

Oh. Oh! Yeah, that wasn't clear to me at all, I thought only the second option used the number field.

But at least this confirms that AGS is calculating the total font height correctly as 14 (when the "resize ascender" option is active).
Erm, this particular option is a backward compatibility feature, and is meant mostly for fonts which made specifically for AGS in the past. Because ascender is resized to match the demanded font size, this option may result in font glyphs being drawn lower, adding vertical space above the letters.

The problem with 3.6.0 is that it still uses unmodified templates from 3.5.*, and therefore when you create your games all the properties are adjusted for importing these older projects.
We need to update the templates to have the recommended settings for 3.6.0, with "resize ascender" off, and other changes.

Yes, I had the impression that "resize ascender" was the new option and "do nothing" was the backwards-compatible one. All clear now.

PROBLEM !! :)

I installed the 3.6 last version, and I encountered a problem using the ReadRawLine function.

I use this function to read some attributes for characters and custom things players can create to play with in the game. So I read these informations in a .txt file, and store that in a struct.

I have to read this line :

0;NomVéhicCréé0;null;null;null;0;25;25;25;25;55;35;10;10;90;10;null;0;null;0;null;0;0;

and it crashes !

I debugged the situation and found that, using this function, it meant that :

String s=File.ReadRawLineBack();
Display(s);
// Displayed : "0;NomV"

It seems that "é" was causing an error in the ReadRawLineBack function. I changed into the .txt file and replaced all the "é" with "e", and it worked perfectly.

Any idea what's happenning ? It was NOT happenning with the 3.5.1 version I used before :)

EDIT : was the limit of 199 removed for the ReadRawLineBack function ? I thought that yes, but I'm not sure...

EDIT 2 : just managed to launch the game with the 3.6, and I found that scrolling with the finger pad works perfectly ! (it was one of my previous questions).
« Last Edit: 02 Feb 2022, 19:31 by Baguettator »

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
It seems that "é" was causing an error in the ReadRawLineBack function. I changed into the .txt file and replaced all the "é" with "e", and it worked perfectly.

Any idea what's happenning ? It was NOT happenning with the 3.5.1 version I used before :)

Yes, this is a bug in 3.6.0, any letter with code above 127 will be mistakenly treated as an end of file. We have this recorded, and it will be trivial to fix.

I should note just in case, that if the letter is a "unicode" one (code above 255), and text is saved as UTF-8, this expected to be read normally (after this bug is fixed), as it reads byte by byte, but the string will only be correctly displayed if the engine works in the Unicode mode. Currently it may only be switched to this mode by the use of translation options; if you use translations and it has a utf-8 encoding option set, as explained in the thread: https://www.adventuregamestudio.co.uk/forums/index.php?topic=59240.0

EDIT : was the limit of 199 removed for the ReadRawLineBack function ? I thought that yes, but I'm not sure...

Yes, it should be mentioned in the Changes log: https://github.com/adventuregamestudio/ags/blob/master/Changes.txt

EDIT 2 : just managed to launch the game with the 3.6, and I found that scrolling with the finger pad works perfectly ! (it was one of my previous questions).

Nice, this is very good to know that SDL2 works better in this regard.
« Last Edit: 03 Feb 2022, 01:35 by Crimson Wizard »

Does that mean that I need to put this :

// Text encoding hint
//#Encoding=UTF-8
// Source text encoding hint
//#GameEncoding=UTF-8

At the top of my translation file, then save the file where I have to read something using the ReadRawLineBack function in UTF-8, and then it will work as expected ?

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
Does that mean that I need to put this :

At the top of my translation file, then save the file where I have to read something using the ReadRawLineBack function in UTF-8, and then it will work as expected ?

You need to have that translation active, for the engine to display the UTF-8 text.
Create and compile translation normally, you don't have to save the file somewhere else.


On a separate note, we're currently conducting experiments to see how easy that would be to make the Editor itself work and save data in unicode mode. If it worked, then users won't have to rely on translations.
There are preliminary tests that give a hope it's possible, but this may take a while to integrate, so no promises for now.
« Last Edit: 03 Feb 2022, 21:22 by Crimson Wizard »

OK, but the ReadRawLineBack function is used in another .txt file, not the one for the translation. So are we talking about the same thing ?

Sorry if I misunderstand you, english is not my 1st language :(

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
OK, but the ReadRawLineBack function is used in another .txt file, not the one for the translation. So are we talking about the same thing ?

There are two separate problems.

1. ReadRawLineBack had a mistake that made it cut the line if a utf-8 character is met. Now this is fixed, you may download the patched editor here:
https://cirrus-ci.com/task/5287098419773440

2. Displaying the UTF-8 characters on screen. This is not directly related to ReadRawLineBack, but related to the data it read.
Engine will only display UTF-8 characters on screen if it works in "unicode" mode and you provide a proper unicode font.
There's currently only one way to switch engine to "unicode" mode: it is to enable translation that has "//#Encoding=UTF-8" in it.

Perfect ! It works great !! Thanks a LOT :)

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
Updated to Alpha 17
(use download links in the first post)

Synced with AGS 3.5.1 - Patch 8.

New changes:

Editor:
- Added Web/Emscripten build target support (requires "Web build component" installed). See below for brief instructions.
- Added Character.IdleAnimationDelay property to let setup idle view's animation speed.
- Added Cursor.AnimationDelay property to let setup cursor's animation speed.
- Rooms created from a Blank template will now have default background of a game's resolution.
- Editor no longer prevents exporting string arguments from Get/SetTextProperty calls to TRS file.
- Fixed Custom properties' default values were not exported to translation.

Script API:
- Hotspot.Name and Object.Name may now be set in script.
- Added Character.IdleAnimationDelay to let control idle view's animation speed.
- Added new delay parameter to Mouse.ChangeModeView() to let control cursor's animation speed.

Engine:
- Fixed AudioChannel.Speed not working.
- Fixed AudioChannel.PositionMs now resetting when the repeating clip rewinds.
- Fixed File.ReadRawLine() failing at character values >127.
- Fixed potential crash on room load if the walkable area mask contained color values above the supported range.
- Fixed loading savegame made before 3.6.0 was crashing due to incorrect audio channels initialization.

Web / Emscripten:
- Initial port release.



In regards to building Web version of the game. We do not provide necessary files in installation yet, so you'd have to download them yourself for now. They may be found attached to any release on github starting with v3.6.0.16, the archive is called "emscripten.zip". For instance, the current one is: https://github.com/adventuregamestudio/ags/releases/download/v.3.6.0.16/emscripten.zip

Go to your Editor's program folder, create a new subfolder inside called "Web". Unpack emscripten.zip there (unpack fully, there are several archives inside for technical reasons, we will fix this later).
You should now have 4 files there:
- ags.js
- ags.wasm
- index.html
- my_game_files.js

Now when you have this, run the Editor and open your project. The new "Web" Build target should become available. If you check it, and rebuild the project, the Editor will deploy necessary files into Compiled/Web folder in your project.

Note that you cannot run index.html directly, it likely won't work. You need to create a web server with these files on it. There is a multitude of ways you can do that. For example I've been testing this using a simple Google Chrome app called Web Server for Chrome. You may find your own way.

For any questions regarding the Web port please refer to and post in dedicated forum thread:
https://www.adventuregamestudio.co.uk/forums/index.php?topic=59164.0
« Last Edit: 04 Feb 2022, 12:00 by Crimson Wizard »

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

- Added Character.IdleAnimationDelay property to let setup idle view's animation speed.
- Added Cursor.AnimationDelay property to let setup cursor's animation speed.
- Rooms created from a Blank template will now have default background of a game's resolution.
- Editor no longer prevents exporting string arguments from Get/SetTextProperty calls to TRS file.
- Fixed Custom properties' default values were not exported to translation.

Yesss I already said this on Discord, but thanks again for these fixes/additions! :)

I have a very tiny additional suggestion to make. In the header of the .tra file, there are some lines with instructions as to how to use the various parameters:

Code: Adventure Game Studio
  1. // The normal font to use - DEFAULT or font number
  2. //#NormalFont=DEFAULT
  3. // The speech font to use - DEFAULT or font number
  4. //#SpeechFont=DEFAULT
  5. // Text direction - DEFAULT, LEFT or RIGHT
  6. //#TextDirection=DEFAULT
  7. // Text encoding hint
  8. //#Encoding=UTF-8

However, "Text encoding hint" doesn't have any instructions, so new users won't know which options can be used here (I myself sometimes forget if I should write ASCII or ANSI there). In order to make it more user friendly, could it be amended to something like this?

Code: Adventure Game Studio
  1. // Text encoding hint - UTF-8 or ASCII
  2. //#Encoding=UTF-8


Hey !

Is it possible to manage in-game the windowed mode ? It could be pleasant to decide in-game to switch from full screen to windowed mode and vice-versa, or adjust the size of the windowed mode.

eri0o

Use alt+enter to alternate between windowed and Fullscreen mode. On windowed mode it's possible to resize the window by clicking on the window borders and resizing. It will obey what you set about the sizing behavior on Winsetup/acsetup.cfg (proportional, stretch, ...)

Through script it should be System.Windowed property.
« Last Edit: 04 Feb 2022, 21:11 by eri0o »

Thanks ErioO !

Also, I just thought about something I encountered before, and maybe it could be changed in new versions of AGS : now, the maximum number of parameters in a function is 14. Could this limit be removed/pushed away ? It could be useful :)

EDIT : also new suggestion : would it be possible and technically possible to have a text in a label that uses different fonts ? Also for ListBox Items in different colors ? It could be useful ;) But I don't know if it's technically possible in AGS ?
« Last Edit: 05 Feb 2022, 20:08 by Baguettator »

eri0o

It should not be needed to push more than 14 parameters in a function. The usual approach is to simply build and object (managed struct) and then pass this managed struct to the function.

Hmm... I can't vizualize your solution. How could it "increase" the number of parameters in a function by passing a struct ?

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
Hmm... I can't vizualize your solution. How could it "increase" the number of parameters in a function by passing a struct ?

You can put multiple variables in a managed struct and pass the instance of that struct as 1 parameter. There may be other solutions, depending on the situation: what the function is for, how do you use it, maybe it can be replaced with just a struct and setting struct members instead? But this is a general scripting topic.

EDIT : also new suggestion : would it be possible and technically possible to have a text in a label that uses different fonts ? Also for ListBox Items in different colors ? It could be useful ;) But I don't know if it's technically possible in AGS ?

It's currently possible to script your own label or list box that uses several fonts and colors, with DrawingSurface and DynamicSprite functions.
In theory it's possible to implement some kind of a "rich text" control in the engine too, for example one that draws text using html-like tags, but that's a serious work that requires some good design decision first. We have already planned to wrap 3.6.0 version up, and now working towards finishing priority major features. The other features added were ones that cover problems that are too inconvenient for scripting and simple enough to do quickly in the engine at the same time.
If there's an actual interest in such engine feature, you may post it in the engine suggestions forum section, or our issue tracker on github.
« Last Edit: 05 Feb 2022, 23:29 by Crimson Wizard »

eri0o

Hey, I would like to suggest two modifications on the top post

  • Clearly explain when saying the Editor requires .NET, that it's just something the developer needs, but not for people who will be playing the game. Also, for people in Windows 10 and forward, you already have .NET preinstalled.
  • Remove the SDL2.dll download from there, since it already comes with both the archive and the installer. It may confuse people as if it's a requirement - it's, but it's already packed with the Editor and it will already pack it in the Windows games when needed.

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
Hey, I would like to suggest two modifications on the top post

Should be done now.

You can put multiple variables in a managed struct and pass the instance of that struct as 1 parameter. There may be other solutions, depending on the situation: what the function is for, how do you use it, maybe it can be replaced with just a struct and setting struct members instead? But this is a general scripting topic.

I really don't understand how a managed struct can replace several function parameters, but the thing is I created functions to place some tokens in a map (like a tabletop game), and sometimes 1 function is to set the different possibilities of placement for 1 token. So, for each possibility, I need to tell which tile, which x coordinate of the tile, and which y coordinate of the tile. 3 parameters per possibility. In this case, my function can get only 4 possibilities. Of course I can set up a way to stock these possibilities, then recall the same function with other parameters and increase the number of possibilities, that's what I did. But it could be useful to have a greater limit. Or maybe I'm wrong ?

It's currently possible to script your own label or list box that uses several fonts and colors, with DrawingSurface and DynamicSprite functions.
In theory it's possible to implement some kind of a "rich text" control in the engine too, for example one that draws text using html-like tags, but that's a serious work that requires some good design decision first. We have already planned to wrap 3.6.0 version up, and now working towards finishing priority major features. The other features added were ones that cover problems that are too inconvenient for scripting and simple enough to do quickly in the engine at the same time.
If there's an actual interest in such engine feature, you may post it in the engine suggestions forum section, or our issue tracker on github.

Hmm seems complicate for me to do so. Is there any module for that kind of things, existing for the 3.6 ? Or any method to do the same ?

Also, I already mentionned it, but got no answer : I don't know if it's a problem, but it's a bit annoying for me : in my struct to manage the maps in my game, I have plenty of functions to set up the map. I have a huge function that creates the chosen map (with if/else conditions). The problem is that when my function becomes to big, and if I write something like that :

Code: Adventure Game Studio
  1. function Cartes::Create(int c)
  2. {
  3.   this.PlaceTokenA(
  4.   // the PlaceTokenA function has parameters like "int tile, int x, int y, int rotation" etc...
  5. }

Normally, when I hit the "(", AGS shows me the order of the parameters below the editor's text. But it doesn't if the function is too big (I think after a hundred or so lines long). It's a bit annoying because sometimes I have to look in the script in which order are the parameter of the function (like PlaceTokenA), it's a lost of time. Any idea why it happens ? Is it possible to correct it ?

eri0o

@Baguettator, I am sorry but this is very offtopic, if you want help with the design you should ask in the advanced technical forum.

Sorry, I didn't thought about it. Excuse me for that...

But I think this is not offtopic : I don't know if it's a problem, but it's a bit annoying for me : in my struct to manage the maps in my game, I have plenty of functions to set up the map. I have a huge function that creates the chosen map (with if/else conditions). The problem is that when my function becomes to big, and if I write something like that :

    function Cartes::Create(int c)
    {
      this.PlaceTokenA(
      // the PlaceTokenA function has parameters like "int tile, int x, int y, int rotation" etc...
    }

Normally, when I hit the "(", AGS shows me the order of the parameters below the editor's text. But it doesn't if the function is too big (I think after a hundred or so lines long). It's a bit annoying because sometimes I have to look in the script in which order are the parameter of the function (like PlaceTokenA), it's a lost of time. Any idea why it happens ? Is it possible to correct it ?

For me, it's a problem, like a problem of memory or I don't know what...

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
Updated to Alpha 18
(use download links in the first post)

I had to post another update early, because there was a critical bug found in the Alpha 17, related to audio playback.

New changes:

Editor:
- The new Editor's Preferences dialog now features several tabs, including "Advanced" with a property grid. There's nothing special there yet (it just repeats all the same options in the table format), but this will be used later to add certain settings for Android build, etc.
- Added Room.BackgroundAnimationEnabled property to let have disabled animation on room load.
- Renamed font's "Point Size" property to just "Font Size", because AGS historically used wrong term in regards to this value.
- An attempt to enhance new "Import TTF dialog", making it easier for users to understand the import method selection.

Engine:
- Fixed potential crash occuring randomly when the audio playback starts (regression in 3.6.0.16).



I don't know if it's a problem, but it's a bit annoying for me : in my struct to manage the maps in my game, I have plenty of functions to set up the map. I have a huge function that creates the chosen map (with if/else conditions). The problem is that when my function becomes to big, and if I write something like that :
<...>
Normally, when I hit the "(", AGS shows me the order of the parameters below the editor's text. But it doesn't if the function is too big (I think after a hundred or so lines long).

This sounds like a autocomplete bug; we may open a bug report for that. Autocomplete is known to have number of problems in AGS...
« Last Edit: 07 Feb 2022, 14:16 by Crimson Wizard »

Thanks Crimson for your answer ! Indeed, it could be SO NICE to have the autocomplete working well, at least for my situation... Let me know :)

eri0o

On the top post it's written
Quote
Known problems

* AudioChannel.Speed property is not working at the moment.
But you have fixed this already CW.

Stranga

  • Check out my games via my website link!
    • I can help with making music
    • I can help with story design
Hello everyone,

I have a strange bug when saving and loading a game.

If I have a room with a background with more than one frame and save it, when it loads the background animation just plays. Now, I figured that I can now turn off background animations via the room setting, however, I was working with day/night cycles, and if I save at night and load it's day (or background frame resorts to default which I think is 0). Basically, it's not saving room background frames (Not sure if this is affecting other frame animations, haven't tested it with views yet)


I'm not sure if this is an actual bug and I have to code it some other way, just thought I'd report it just in case.

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
if I save at night and load it's day (or background frame resorts to default which I think is 0). Basically, it's not saving room background frames (Not sure if this is affecting other frame animations, haven't tested it with views yet)

Looks like a bug.

Stranga

  • Check out my games via my website link!
    • I can help with making music
    • I can help with story design
Thanks for the update and fix CW  :-D

I also found this, not sure if it's a bug either but when running custom dialog options via scripting I get these errors:
Spoiler: ShowHide




the first one is in Turkish, which just seems to show some displacement of the letters and the other two are Russian which doesn't show up at all, I've tried a few different fonts with Russian but still, the same result.
The rest of the GUI and regular text seems to work fine :)

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
I also found this, not sure if it's a bug either but when running custom dialog options via scripting I get these errors:

I cannot answer this question without knowing more details - what script you have, which fonts you have, and so on.

Stranga

  • Check out my games via my website link!
    • I can help with making music
    • I can help with story design
I cannot answer this question without knowing more details - what script you have, which fonts you have, and so on.

My apologies, here's the script:
Spoiler: ShowHide
Code: Adventure Game Studio
  1. // new module script
  2.  
  3. //int dlg_opt_color = ;
  4. int dlg_opt_acolor = 30719;
  5. int dlg_opt_ncolor = 65535;
  6. int DlgCursorPos = 1;
  7.  
  8. import int  KeyUp[2];
  9. import int  KeyDown[2];
  10. import int  KeyLeft[2];
  11. import int  KeyRight[2];
  12. import int  KeyAction[2];
  13. import int  KeyBack;
  14. import int  KeyMenu;
  15. import int  KeySprint[2];
  16.  
  17. import bool CanPress;
  18.  
  19. function repeatedly_execute()
  20. {
  21.   btnDialogCursor.Visible = false;
  22.   btnOptionsBox.Visible = false;
  23. }
  24.  
  25. function dialog_options_get_dimensions(DialogOptionsRenderingInfo *info)
  26. {
  27.   // Create a 200x200 dialog options area at (50,100)
  28.   info.X = 30;
  29.   info.Y = 50;//50
  30.   info.Width = 256;
  31.   info.Height = 256;
  32.   info.ActiveOptionID = 1; // set to first option
  33. }
  34.  
  35. function dialog_options_render(DialogOptionsRenderingInfo *info)
  36. {
  37.   //info.Surface.Clear(dlg_opt_color);
  38.   int i = 1,  ypos = 24,  xpos = 0;
  39.   // Render all the options that are enabled
  40.   while (i <= info.DialogToRender.OptionCount)
  41.   {
  42.     if (info.DialogToRender.GetOptionState(i) == eOptionOn)
  43.     {
  44.       if (info.ActiveOptionID == i){
  45.        
  46.           btnDialogCursor.SetPosition(6, ypos+42); //Cursor Position
  47.           btnDialogCursor.Animate(5, 0, 5, eRepeat);
  48.       }
  49.        else
  50.        
  51.         info.Surface.DrawingColor = dlg_opt_ncolor;
  52.         info.Surface.DrawStringWrapped(5, ypos, info.Width - 10,
  53.         eFontfntDefault, eAlignLeft, info.DialogToRender.GetOptionText(i));
  54.         ypos += GetTextHeight(info.DialogToRender.GetOptionText(i), eFontfntAll, info.Width - 10);  
  55.     }
  56.     aMenuSelector.Play();
  57.     i++;
  58.   }
  59. }
  60.  
  61. function dialog_options_key_press(DialogOptionsRenderingInfo *info, eKeyCode keycode)
  62. {
  63.   switch (keycode)
  64.   {
  65.   case KeyUp[0]:
  66.   case KeyUp[1]:
  67.     // check all options upwards until found an active one
  68.     for (int next_opt = info.ActiveOptionID - 1; next_opt >= 1; next_opt--)
  69.     {
  70.       if (info.DialogToRender.GetOptionState(next_opt) == eOptionOn)
  71.       {
  72.         info.ActiveOptionID = next_opt;
  73.         break;
  74.       }
  75.     }
  76.   break;
  77.   case KeyDown[0]:
  78.   case KeyDown[1]:
  79.     // check all options downwards until found an active one
  80.     for (int next_opt = info.ActiveOptionID + 1; next_opt <= info.DialogToRender.OptionCount; next_opt++)
  81.     {
  82.       if (info.DialogToRender.GetOptionState(next_opt) == eOptionOn)
  83.       {
  84.         info.ActiveOptionID = next_opt;
  85.         break;
  86.       }
  87.     }
  88.   break;
  89.   }
  90.  
  91. if(CanPress)
  92.   {
  93.     switch(keycode)
  94.     {
  95.       case KeyAction[0]:
  96.       case KeyAction[1]:
  97.         btnDialogCursor.Visible = false;
  98.         btnOptionsBox.Visible = false;
  99.         btnPopUp.Visible = false;
  100.         btnPopTalk.Visible = false;
  101.         info.RunActiveOption();
  102.       break;
  103.     }
  104.   }
  105. }
  106.  
  107. function dialog_options_repexec(DialogOptionsRenderingInfo *info)
  108. {
  109.     btnOptionsBox.Visible = true;
  110.     btnDialogCursor.Visible = true;
  111. }
  112.  


Here's the font I am using too: https://opengameart.org/content/lanapixel-localization-friendly-pixel-font
The game is keyboard-only based so I used the custom choice scripting found in the manual. I also use this same font with other languages too and it works fine with them.

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
Here's the font I am using too: https://opengameart.org/content/lanapixel-localization-friendly-pixel-font
The game is keyboard-only based so I used the custom choice scripting found in the manual. I also use this same font with other languages too and it works fine with them.

I will make some tests, but something I noticed in the script:
- calling GetTextHeight you use eFontfntAll, but
- calling DrawStringWrapped you use eFontfntDefault.

What's the difference between these fonts, could you double check that this is correct?

Stranga

  • Check out my games via my website link!
    • I can help with making music
    • I can help with story design
That was the problem! Thanks, CW! I can't believe I missed that  :-[ Everything works fine now  :-D

Edit: the difference was that "Default" was the AGS font I was using during the development "All" was the one that contained the customer symbols and such for different languages
« Last Edit: 03 Mar 2022, 02:25 by Stranga »

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
Updated to Alpha 19
(use download links in the first post)

New changes:

Editor:
 - Finally, full Unicode support right in the Editor. Script, game properties and so on, support any human language. Note that you have to use proper Unicode fonts for this to work correctly.
To upgrade your game to unicode mode, goto General Settings and check the "Text format" option. Changing it will convert game files and resave the project. If you had only basic latin text - nothing should change; this is mostly done in case you had other languages in your game. After we update templates, unicode mode should be default for all the new projects.
ANSI mode is still supported, mostly in case you're upgrading an old game and wish to stick to old fonts.
- Upgraded script editor to Scintilla 3.21.1 and ScintillaNET 3.6.3. This was done for easier unicode support. I don't think anything has changed feature-wise, but keep an eye for regressions.
- Added Android build target support (requires "Android component" installed).
More info on building for Android is here: https://www.adventuregamestudio.co.uk/forums/index.php?topic=59772.0
- Removed game Cursors hard limit (was 20), fwiw.
- Fixed few editor panes were not opening correct help topics in F1.

Engine:
- Added "--clear-cache-on-room-change" command-line arg (and similar config option).
- Fixed OGV Theora videos positioned incorrectly if they have certain sizes or aspect ratios.


I think we're now done with major features in this version. In order to move to Beta stage, we only need to update game templates, because they are still upgraded from 3.5.1, and some options are set to backward compatible values at start.
« Last Edit: 03 Mar 2022, 08:43 by Crimson Wizard »

eri0o

The web component is now in too (as part of the installer), so it's not necessary to link it separately in the main page anymore.

I think during beta we will also be writing the missing manual pages, updating script API changes in documentation.
« Last Edit: 03 Mar 2022, 11:49 by eri0o »

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
Unfortunately found two bugs in Alpha 19:
- When converting text format (in General Settings) all your scripts should be closed, otherwise the editor may crash;
- In script editor deleting multiple lines at once (with selection) may cause crash.

Both are fixed in this temp build:
https://cirrus-ci.com/task/6570224085368832

I will be releasing a proper update too soon.

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
Updated to Alpha 20
(use download links in the first post)

Had to make new update soon, to fix couple of problems found since the last update.

New changes:

Editor:
- Fixed crash when changing game encoding if any script window is open (since 3.6.0.18).
- Fixed script editor "random" errors when deleting multiline selection (regression in 3.6.0.18).

Compiler:
- Support hexadecimal number literals (32-bit max). May be used anywhere where regular decimal numbers are used.
Code: Adventure Game Studio
  1. int a = 0xFFFFFF00;
  2. int b = 0x01234567;
  3. int c = 0xabcdefab; // both capital and small x and a-f letters are supported
  4. int d = 16 + 0x10; // means 16 + 16
  5.  

Engine:
- Removed limit of simultaneous Button animations (was 15).
- Removed limit of Character followers (was 30) (was not demanded, but because why not).

Full list of changes is available here:
https://github.com/adventuregamestudio/ags/blob/master/Changes.txt
« Last Edit: 06 Mar 2022, 15:28 by Crimson Wizard »

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
Updated to Alpha 21
(use download links in the first post)

We are working to complete the unicode support in this version, and also fixing some issues found since the last update.
We still have to prepare updated game templates, imho this is the last thing remaining before announcing 3.6.0 Beta.

New changes:

Editor:
 - Added "Use old keyboard handling" option to the General Settings (Backwards compatibility section), which lets select between classic key press handling and new one meant for easier unicode chars support in scripts. See below for more information on this new mode.
 - Select script editor's font in the editor's Preferences.
 - Fixed some editor's panes do not update previews on property changes (regression since 3.6.0.19).

Compiler:
 - Support for the unicode character literals.

Script API:
 - Expanded on_key_press callback, now supports two parameters: key code and key modifier flags.
 - In the new key handling mode on_key_press is called for each actual key press; e.g. combinations like Ctrl+Z will result in two on_key_press calls, one with eKeyCtrlLeft and second with eKeyZ.
 - Implemented new on_text_input(int ch) callback which is called when the engine receives a printable character. This callback is essential for handling unicode chars in script.
 - Similarily, expanded dialog_options_key_press with the third mod argument, and implemented dialog_options_text_input callback for receiving unicode chars during the custom dialog options state.
 - Added eKeyMod enum for key modifiers constants.
 - String.AppendChar, ReplaceChar and Chars[] property are now working with the unicode characters.
 - String.Format("%c") specifier will now be able to print unicode characters.

Engine:
 - Update engine's sound config to match new SDL2 backend, allow to choose specific sound driver.
 - Allow to choose output graphics driver for software mode in config.
 - Fixed engine was handling buffered key presses one at a game frame, could cause delayed reaction to the key input (regression in 3.6.0).
 - Fixed engine switching to ASCII mode when changing to default translation, even if the game is compiled in unicode mode.

Winsetup:
 - Updated sound config, removing obsolete settings.

Full list of changes is available here:
https://github.com/adventuregamestudio/ags/blob/master/Changes.txt
Description of the current engine config:
https://github.com/adventuregamestudio/ags/blob/master/OPTIONS.md



In regards to the key input changes. There are two things.

1. Regardless of the handling mode (see below), the on_key_press function now supports the second parameter: key modifiers. It stores current key modifiers (ctrl, shift, alt, etc) as bit flags. The reason for introducing this parameter is that because the key presses are buffered between game frames, using IsKeyPressed does not always correspond to each handled key. Having an actual "mod" parameter ensures that you can know which modifiers were on when this particular key was pressed.

NOTE: the "int mod" is an optional parameter, and may be omited from the function. It will work correctly even with 1 parameter (eKeyCode).

The list of key mods:
Code: Adventure Game Studio
  1. enum eKeyMod
  2. {
  3.   eKeyModShiftLeft,
  4.   eKeyModShiftRight,
  5.   eKeyModShift,        // this means: any shift
  6.   eKeyModCtrlLeft,
  7.   eKeyModCtrlRight,
  8.   eKeyModCtrl,         // this means: any control
  9.   eKeyModAltLeft,
  10.   eKeyModAltRight,
  11.   eKeyModAlt,           // this means: any alt
  12.   eKeyModNum,        // numlock
  13.   eKeyModCaps         // capslock
  14. };
  15.  

These are not normal enums, but bit fields, which means that you should not use regular comparison with them (like "if (mod == eKeyModCtrl)"), but bit field check instead: "if (mod & eKeyModCtrl)".
Code: Adventure Game Studio
  1. function on_key_press(eKeyCode key, int mod) {
  2.     if (key == eKeyQ && (mod & eKeyModCtrl)) { // this tests for ctrl + Q
  3.     }
  4.     if (key == eKeyF1 && (mod & eKeyModAlt)) { // this tests for alt + F1
  5.     }
  6.     if (mod & eKeyModNum) { // this tests if num lock was on when this key is pressed
  7.     }
  8. }
  9.  

2. The new key handling mode, it's enabled by setting "Use old keyboard handling" in Backwards compatibility (General Settings) to false (this will be the new game default after we update game templates).

What is the difference between old mode and new mode?

Old mode is a backward compatible input handling mode, where
* lone mod keys (Ctrl, Alt, Shift) are not passed further into the engine nor script;
* key + mod combos are merged into one key code for the on_key_press callback: e.g. eKeyCodeCtrlA key codes;
* on_text_input script callback is NOT called.

New mode is:
* all keys are passed into the engine and on_key_press script callback as-is, one by one; e.g. if you press Ctrl + Z, then you get two on_key_press calls, one for Ctrl and another for Z argument..
* on_text_input script callback receives printable characters, which may be used to handle unicode chars typed by the player correctly.

There's a new compiler macro "NEW_KEYINPUT_API" which may be tested using #ifdef and #ifndef to know which mode is set when the game is run. This is mostly useful to the script module writers.

Examples of new mode script
Code: Adventure Game Studio
  1. function on_key_press(eKeyCode k, int mod) {
  2.     if (k == eKeyV && (mod & eKeyModCtrl)) {
  3.          // player pressed Ctrl+V, paste the copied text into your custom text control
  4.     }
  5.     if (k == eKeyAlt) {
  6.          // player pressed either Alt
  7.     }
  8. }
  9.  
  10. function on_text_input(int ch) {
  11.     // player pressed some keys, which formed a printable character
  12.     // this may be either ASCII char, or Unicode char, depending on the game mode
  13.     lblTextField.Text = lblTextField.Text.AppendChar(ch);
  14. }
  15.  
« Last Edit: 14 Mar 2022, 22:22 by Crimson Wizard »

Hi, I tried the latest alpha and in some rooms I get this error, I tried to isolate the room functions and interactions, but makes no differnce.
Any guidance on how to debug it? thanks

eri0o

@Andrea1992, You mean you only get these errors in some rooms, but not others?

Trying to narrow down where it could be the problem in AGS, some questions:
  • Do these rooms have multiple background frames and the other don't?
  • Do they use walkbehinds in some special way?
  • Is there any character that is just in the rooms that have this error but not in the others?

Other than this I would ask, if possible, if you could share the room .crm file - a dm is fine.
« Last Edit: 16 Mar 2022, 11:44 by eri0o »

Yes, I only get these errors in some rooms.
There aren't multiple background frames in these rooms (Most of the other rooms have multiple backgrounds though, but they're working fine)
There aren't walk behinds.
The room setting "ShowPlayerCharacter" is set to False for these rooms. They are close ups to show details of some objects and some have animations.

The error happens as soon as I change to these rooms.
Here you can download the .crm files of a couples of rooms with the error.
https://ln5.sync.com/dl/fe4035540/b4fwh9cr-a6khtsp6-5cz5e5dg-7ek279rh

Thanks!
« Last Edit: 16 Mar 2022, 12:22 by Andrea1992 »

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
@Andrea1992, "Program pointer +204" indicates a stage during loading the room, when engine prepares walkable areas and walk-behinds.
Unfortunately, checking these rooms alone, and importing them into another game, does not reproduce the problem.

Do you remember what was the previous version of AGS you were using where you did not have such errors?
Is it acceptable for you to PM a full compiled game for a test?

I made the game with AGS 3.5.0.24
I have PM a link to the game.
Thanks.

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
@Andrea1992, it appears to be some older bug which I could not fix correctly. It happens when you move from the room with several backgrounds to room with less backgrounds.
Here's the build that should have this fixed:
https://cirrus-ci.com/task/5214597316608000

Thanks Crimson, the build fixed the problem. So, when you update to alpha 22 or beta,  will the fix be included? or will I have to use a different ags build?

Also, the game freezes sometimes. There is a cutscene in one of the rooms with fewer backgrounds and when I tried to escape it, it freezes the game completely. (This is when you talk to the girl outside the house)


Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
Also, the game freezes sometimes. There is a cutscene in one of the rooms with fewer backgrounds and when I tried to escape it, it freezes the game completely. (This is when you talk to the girl outside the house)

Could you tell the number of the room and what do i have to do to reproduce the problem? I never played your game before.

Room 5,
To get there, from the bedroom (initial room) go outside using the door, then talk to the girl that arrives (only character in that room). This sends you to the room 5, where the cutscene esc problem occurs,
thanks

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
Room 5,
To get there, from the bedroom (initial room) go outside using the door, then talk to the girl that arrives (only character in that room). This sends you to the room 5, where the cutscene esc problem occurs,
thanks

Ok I finally found the actual cause for this, it happens when you have WaitMouse/Key(-1) in the middle of the cutscene. Engine does not handle -1 (infinite timeout) properly when skipping the cutscene.

EDIT: again, the fixed temp build:
https://cirrus-ci.com/task/5993769815244800

Quote
So, when you update to alpha 22 or beta,  will the fix be included?

Yes of course.
« Last Edit: 17 Mar 2022, 13:28 by Crimson Wizard »

So this means...Pedro in Japanese?

Stranga

  • Check out my games via my website link!
    • I can help with making music
    • I can help with story design
I've encountered a problem with translations in list boxes and dialogue options displaying symbols rather than being translated, not sure if a bug or my mistake but here's what I'm referring to:

Screenshots:
Spoiler: ShowHide

Happens with all listboxes and dialogue


This happened when I tried navigating the dialogue options via keyboard, never ran into it in the previous alphas only 3.6.0.20



My Dialogue Script:
Spoiler: ShowHide
Code: Adventure Game Studio
  1. // new module script
  2.  
  3. //int dlg_opt_color = ;
  4. int dlg_opt_acolor = 2047;
  5. int dlg_opt_ncolor = 65535;
  6. int DlgCursorPos = 1;
  7.  
  8. import int  KeyUp[2];
  9. import int  KeyDown[2];
  10. import int  KeyLeft[2];
  11. import int  KeyRight[2];
  12. import int  KeyAction[2];
  13. import int  KeyBack;
  14. import int  KeyMenu;
  15. import int  KeySprint[2];
  16. import int KeyInventory[2];
  17.  
  18.  
  19. function dialog_options_get_dimensions(DialogOptionsRenderingInfo *info)
  20. {
  21.   // Create a 200x200 dialog options area at (50,100)
  22.   info.X = 30;
  23.   info.Y = 100;
  24.   info.Width = 256;
  25.   info.Height = 256;
  26.   info.ActiveOptionID = 1; // set to first option
  27. }
  28.  
  29. function dialog_options_render(DialogOptionsRenderingInfo *info)
  30. {
  31.   btnCoverUp.Visible = true;
  32.   DialogOpen = true;
  33.   //info.Surface.Clear(dlg_opt_color);
  34.   int i = 1,  ypos = 24,  xpos = 0;
  35.   // Render all the options that are enabled
  36.   while (i <= info.DialogToRender.OptionCount)
  37.   {
  38.     if (info.DialogToRender.GetOptionState(i) == eOptionOn)
  39.     {
  40.       if (info.ActiveOptionID == i)
  41.       {
  42.         btnPointer.SetPosition(xpos+26, ypos+95); //Cursor Position
  43.         info.Surface.DrawingColor = dlg_opt_acolor;
  44.       }
  45.        else
  46.        {
  47.         info.Surface.DrawingColor = dlg_opt_ncolor;
  48.        }
  49.      
  50.       info.Surface.DrawStringWrapped(5, ypos, info.Width - 10,
  51.       eFontfntSnatcher, eAlignLeft, info.DialogToRender.GetOptionText(i));
  52.       ypos += GetTextHeight(info.DialogToRender.GetOptionText(i), eFontfntSnatcher, info.Width - 10);
  53.     }
  54.     //aClick.Play();
  55.     i++;
  56.   }
  57. }
  58.  
  59. function dialog_options_key_press(DialogOptionsRenderingInfo *info, eKeyCode keycode)
  60. {
  61.   switch (keycode)
  62.   {
  63.   case KeyUp[0]:
  64.   case KeyUp[1]:
  65.   aCursor.Play();
  66.     // check all options upwards until found an active one
  67.     for (int next_opt = info.ActiveOptionID - 1; next_opt >= 1; next_opt--)
  68.     {
  69.       if (info.DialogToRender.GetOptionState(next_opt) == eOptionOn)
  70.       {
  71.         info.ActiveOptionID = next_opt;
  72.         break;
  73.       }
  74.     }
  75.   break;
  76.   case KeyDown[0]:
  77.   case KeyDown[1]:
  78.   aCursor.Play();
  79.     // check all options downwards until found an active one
  80.     for (int next_opt = info.ActiveOptionID + 1; next_opt <= info.DialogToRender.OptionCount; next_opt++)
  81.     {
  82.       if (info.DialogToRender.GetOptionState(next_opt) == eOptionOn)
  83.       {
  84.         info.ActiveOptionID = next_opt;
  85.         break;
  86.       }
  87.     }
  88.   break;
  89.   }
  90.  
  91. if(CanPress)
  92.   {
  93.     switch(keycode)
  94.     {
  95.       case KeyAction[0]:
  96.       case KeyAction[1]:
  97.       aSelector.Play();
  98.       DialogOpen = false;
  99.       btnPointer.Visible = false;
  100.       btnCoverUp.Visible = false;
  101.       info.RunActiveOption();
  102.       break;
  103.     }
  104.   }
  105. }
  106.  
  107. function dialog_options_repexec(DialogOptionsRenderingInfo *info)
  108. {
  109.   btnPointer.Visible = true;
  110. }
  111.  
  112.  
  113.  
  114.  

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
I've encountered a problem with translations in list boxes and dialogue options displaying symbols rather than being translated, not sure if a bug or my mistake but here's what I'm referring to:

I recall dialog options worked before, did this new error appear after some changes, or engine update, or with another language?

Is the given translation saved in UTF-8 and has "Encoding" set in TRS? Does it use correct font that has necessary characters?

Does the same language/font work everywhere else, e.g. on labels, speech etc?
« Last Edit: 19 Mar 2022, 02:19 by Crimson Wizard »

eri0o

I managed to reproduce the mentioned crash and noted down a way to reproduce here with a minimal game: https://github.com/adventuregamestudio/ags/issues/1582

I could not reproduce the mentioned issue with the translation though. Stranga, if you could make a tiny example game of the mentioned issue with symbols and translations it would be helpful!
« Last Edit: 19 Mar 2022, 02:47 by eri0o »

Stranga

  • Check out my games via my website link!
    • I can help with making music
    • I can help with story design
@Crimson Wizard

The error code is something new as I loaded a backup on 3.6.0.17 and the dialogue navigation works fine, however, the text is still not being translated in list boxes and dialogue, everything else works fine (labels, buttons e.c.t).
Example of labels working fine:
Spoiler: ShowHide

My text box is a label.


UTF-8 Encoding has been  set in the TRS file, I also tested it with another font but it still shows the same symbols

Example:
Spoiler: ShowHide


@eri0o I'll get to work on a small build for you to test soon :)

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
The temp build with a keyboard fix may be downloaded here:
https://cirrus-ci.com/task/5721016642043904

please tell if it fixes the key input.

But i don't yet know what is wrong with translations. I'll have to think more about it, or wait for your small test game.

Quote
I loaded a backup on 3.6.0.17 and the dialogue navigation works fine, however, the text is still not being translated in list boxes and dialogue
So, if I understand correctly, translation in dialog options did not work in 3.6.0.17 too?

I remember that previously you had issue with some languages, but they were fixed?
https://www.adventuregamestudio.co.uk/forums/index.php?topic=58976.msg636644048#msg636644048

Do you use same font as on labels there, or a different one?
« Last Edit: 19 Mar 2022, 03:41 by Crimson Wizard »

Stranga

  • Check out my games via my website link!
    • I can help with making music
    • I can help with story design
Ok, temp build fixes keyboard issue, great! :)

Strangely when I started a fresh empty game and make a list box and a dialogue both with translated lines they worked. However, when I made a game out of a template they didn't work, I compared both versions' TRS files and didn't find any differences, both had UTF-8 encoding on them. Strangely I changed the Text Format under general settings to UTF8 and it worked?
Screenshot:
Spoiler: ShowHide


However, this didn't work on my game, only on the test game so there's isn't much for debugging.

Quote
So, if I understand correctly, translation in dialog options did not work in 3.6.0.17 too?
That's correct, it didn't work on that version either

Quote
I remember that previously you had issues with some languages, but they were fixed?
https://www.adventuregamestudio.co.uk/forums/index.php?topic=58976.msg636644048#msg636644048

I thought that would've been the case but it seems to still show those symbols when I applied that particular fix to this problem.

Quote
Do you use the same font as on labels there, or a different one?
Yes, everything has the same fonts.

Something is telling me that it may be an issue with my scripting somewhere. I'll look into it further but here's the test build I quickly made: http://www.fileconvoy.com/dfl.php?id=gd863cb389b33e2171000418743282b849981e52b80

EDIT:
Quote
Strangely I changed the Text Format under general settings to ASCII then back to UTF8 and it worked?
Only the dialogue worked not the listbox

BREAKTHROUGH: I think I found the problem, the list box fonts are not changing when I change translations

I'm using this script to change all fonts in game but it seems to be missing listboxes:
Spoiler: ShowHide
Code: Adventure Game Studio
  1. function ReplaceFontOnAllGUIs(int old_font, int new_font)
  2. {
  3.   int i = 0;
  4.   while (i < Game.GUICount)
  5.   {
  6.     ReplaceFontOnGUI(gui[i], old_font, new_font);
  7.     i++;
  8.   }
  9. }
  10.  


Yep! That's definitely the problem! Still not sure how to fix it, unfortunately.
Found it:
Spoiler: ShowHide
Code: Adventure Game Studio
  1. function ReplaceFontOnGUI(GUI *g, int old_font, int new_font)
  2. {
  3.   int i = 0;
  4.   while (i < g.ControlCount)
  5.   {
  6.     Button *b = g.Controls[i].AsButton;
  7.     if (b != null)
  8.     {
  9.       if (b.Font == old_font)
  10.         b.Font = new_font;
  11.     }
  12.     Label *l = g.Controls[i].AsLabel;
  13.     if (l != null)
  14.     {
  15.       if (l.Font == old_font)
  16.         l.Font = new_font;
  17.     }
  18.     ListBox *lb = g.Controls[i].AsListBox; //HERE!
  19.     if (lb != null)
  20.     {
  21.       if (lb.Font == old_font)
  22.         lb.Font = new_font;
  23.     }
  24.     i++;
  25.   }
  26. }
  27.  
« Last Edit: 19 Mar 2022, 05:01 by Stranga »

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
Strangely when I started a fresh empty game and make a list box and a dialogue both with translated lines they worked. However, when I made a game out of a template they didn't work, I compared both versions' TRS files and didn't find any differences, both had UTF-8 encoding on them. Strangely I changed the Text Format under general settings to UTF8 and it worked?

According to the plan, the game should switch to UTF-8 mode if active translation is UTF-8, even if the game itself has the Text Format set to ascii.
I will double check that this works.

EDIT: Ok I found and fixed two more recent bugs...
1. if game was ASCII, but translation UTF-8, then the translation keys were incorrectly loaded, so translation could not be performed
2. winsetup did not list translation names properly (did not cut ".tra" extensions from them)

Temp build with fixes will be available here when the building process is complete (about 20-30 mins after me posting):
https://cirrus-ci.com/task/4630726241943552
« Last Edit: 19 Mar 2022, 12:34 by Crimson Wizard »

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
@Stranga, i opened a 3.6.0 Beta thread: https://www.adventuregamestudio.co.uk/forums/index.php?topic=59842.0
let's continue discussing problem there (i will lock this thread soon).