Adventure Game Studio

AGS Support => AGS Engine & Editor Releases => Topic started by: Crimson Wizard on Sun 20/03/2022 20:23:39

Title: AGS 3.6.0 - Beta 15
Post by: Crimson Wizard on Sun 20/03/2022 20:23:39
AGS 3.6.0 - Beta 15
Full release number: 3.6.0.35

ACHTUNG!
(http://i.imgur.com/3gHhXIz.png)
This is a BETA version of AGS 3.6.0.
It's considered relatively stable but is not thoroughly tested yet and also may have planned additions.
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.

Download AGS 3.6.0 Beta installer (https://github.com/adventuregamestudio/ags/releases/download/v.3.6.0.35/AGS-3.6.0.35-Beta15.exe)
Download AGS 3.6.0 Beta as a .zip archive (https://github.com/adventuregamestudio/ags/releases/download/v.3.6.0.35/AGS-3.6.0.35-Beta15.zip)

For Editor
Spoiler
VC 2015 redistributable needed for AGS Editor on Windows (https://download.microsoft.com/download/6/A/A/6AA4EDFF-645B-48C5-81CC-ED5963AEAD48/vc_redist.x86.exe)
Download Dark UI Theme for the editor (https://github.com/adventuregamestudio/ags/releases/download/v.3.5.0.31/VisualStudioDark-3.5.0.31.zip)
[close]

For Android
Spoiler
Android launcher (APK signed with Debug key), suitable for running any compatible AGS game (https://github.com/adventuregamestudio/ags/releases/download/v.3.6.0.35/AGS-3.6.0.35-debug.apk)
NOTE: the Editor now includes Android build component letting you prepare your own games for Android
[close]

For Engine/Editor developers
Spoiler
AGS source code central repository (https://github.com/adventuregamestudio/ags/tree/master)
Debug symbols database (for analysing crash dumps) (https://github.com/adventuregamestudio/ags/releases/download/v.3.6.0.35/AGS-3.6.0.35-pdb.zip)
[close]

Released: 1st September 2022

Previous stable version: AGS 3.5.1 P13 forum thread (https://www.adventuregamestudio.co.uk/forums/index.php?topic=60128.0)


This release is brought to you by:

- sonneveld (porting engine to SDL2)
- Alan v. Drake (improvements, fixes)
- Cameron Cawley [ccawley2011] (fixes, improvements to SpriteFont plugin)
- Crimson Wizard (stuff :))
- eri0o (updated Android port, Web port, Editor improvements, etc)
- fernewelten (new fonts outlining, improvements to script compiler, fixes)
- Francesco Ariis (fixes)
- Morgan Willcock (improving templates, help with CI)
- Pablo Navarro [panreyes] (fixes)
- ChamberOfFear (improvements)
- rofl0r (fixes, suggestions)
- Thierry Crozat (fixes, plugin update)
- vga256 (fixes)



What is new in 3.6.0

AGS 3.6.0 is another big change to AGS.
First of all, 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 continuously postponed. Finally it is done. (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).
Secondly the Editor and Engine now have full Unicode support. This means that you may use any language whatsoever in scripts, object descriptions and custom properties, as well as translations; so long as you also provide proper unicode fonts.
Third, we finally have expanded a list of platforms that the Editor can build for: now this includes Android and Web (Emscripten) port.

This version is currently in Beta stage, which means that all major features are present, but there's still a room for improvement, and of course this all has to be tested more and fixed as necessary.
We are also working on updating the documentation, as quite a few of the 3.6.0 changes will require user's attention and learning new things about Editor and script.

For more information please also see "Upgrading to AGS 3.6" topic in the manual: https://adventuregamestudio.github.io/ags-manual/UpgradeTo36.html


Common features:
- Full Unicode support for all game texts: game properties, scripts, translations, input.
  ASCII/ANSI mode is still working, for backwards compatibility. This may be configured in the game project.
- Extended sprite compression options: lossless storage optimization for 16- and 32-bit sprites; LZW compression option for sprites in addition to existing RLE compression.
- GUI controls may now be told to clip their contents, which means that nothing gets drawn outside of their borders (as defined by X, Y, Width, Height properties). The only exception is Sliders, which are more complicated.
- The historical TTF fonts' "fixup" that altered their height and vertical offset is now optional and works only if backwards compatible option is set.
- Max number of AudioChannels is now 16 (was 8).
- Removed game Cursors hard limit (was 20).
- Increased Room Objects limit to 256 (was 40).
- Discontinued "Windows Game Explorer" support in both Editor and Engine.

Editor:
- Editor requires .NET Framework 4.6 to run.
- Added Android build target support (requires "Android component" installed).
- Added Web/Emscripten build target support (requires "Web build component" installed).
- Script editor works in unicode mode.
- Added "Text format" option in General Settings which lets switching between ASCII/ANSI and
  Unicode (UTF-8) modes. This defines which format the game texts will be written in, when saving the game project and compiling the game.
- Added "Use old-style keyboard handling" option to the General Settings, which lets select between classic key press handling and new one meant for unicode chars support in scripts.
- Supports compiling UTF-8 translations. TRS file now has "Encoding" setting that tells how to interpret this TRS text.
- Added support for building multiple speech voxes, by taking files from the Speech subfolders.
- Added support for adding custom files into the game package. This is done by assigning a list of directories to "Package custom data folder" option in General Settings.
- 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.
- Added "GUI controls clip their contents" option to the General Settings.
- Added "TTF fonts height used in the game logic" option 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.
- Added "TTF font adjustment" property to Fonts, as well as to General Settings where it serves as a project default for the new fonts. This property lets you choose between "no changes" and backward compatible TTF fixup meant to keep fonts made for AGS displayed as they were meant to.
- In the "Import TTF" dialog added a choice to import the size closest to the given pixel height.
- Fonts now have Auto Outline Style and Auto Outline Thickness properties.
- Fonts now have a readonly Family Name field, that lets user see the original name of a font they've imported (if available).
- Added IdleDelay property to Characters that lets you set time needed to pass before IdleView is activated. This is equivalent to the Character.SetIdleView script function.
- Added Character.IdleAnimationDelay property to let setup idle view's animation speed.
- Added Cursor.AnimationDelay property to let setup cursor's animation speed.
- The TextWindow edges now have distinct names in the dropdown list of the property grid.
- Rooms created from a Blank template will now have default background of a game's resolution.
- When creating new room objects they will now have their script names set to some default value.
- Added Room.BackgroundAnimationEnabled property to let have disabled animation on room load.
- Editor will now create an empty spriteset file (acsprset.spr) if one is missing in the game project. Any existing sprite descriptions in the project will be kept, letting user to reimport these from sources.
- Added "File -> Restore all sprites from sources" menu command.
- Added "Apply" button on editor's Preferences dialog.
- Select script editor's font in the editor's Preferences.
- Added "Help" option to the editor pane's tab context menu.
- Upgraded script editor to Scintilla 3.21.1 and ScintillaNET 3.6.3.
- Cursor's position in script is now displayed on the status bar.
- Dialog scripts now too can open help topics for keywords or script functions under cursor on F1.
- Added zoom controls for the Sprite Manager, Character, Cursor, Inventory and View panes.
- Sprites may now be imported by drag'n'drop into the Sprite manager.
- In sprite manager's "export all" dialog added "skip if local" option.
- In sprite manager's context menu added command "Create source files for all sprites with missing / external sources..."
- On the View pane the frames having set delay and linked sound will be now indicated with icons.
- Editor no longer errors and fails when opening a game project with some script files missing.
- Editor no longer errors on empty translations when compiling the game.
- Editor now exports values of the string type Custom Properties to translations.
- Editor no longer prevents exporting string arguments from Get/SetTextProperty calls to TRS file.
- Editor now cleanups spritefile on game load, identifying any data not referenced by the project and marking it for deletion.
- Fixed editor silently enabling all available Build Targets when upgrading a pre-3.4.0 project. This could be very inconvenient as there are several of them supported now.
- Fixed editor was not preventing from entering Character's and AudioClip's ScriptName too long for the engine to handle.
- Fixed Image and View properties in various objects were allowing negative values.
- Fixed some of the object previews (at least GUI) could crash if user entered a non-existing sprite's number as an Image property.
- Fixed editor displaying unhandled exception if the script which user is trying to open was missing. Instead it will now open a blank script.
- Fixed room editor was suggesting to save the modified room even if no changes were made.
- Fixed a recently imported sprite could be displayed incorrectly scaled up in the room editor for high-resolution games, if the "Allow relative asset resolutions" was enabled in General Settings, and the sprite 0 had "Resolution" property set to "Low".
- Fixed View animation preview stopping at frame 100 (if loop contains over 100 frames).
- Fixed going to a "find all" result in dialog script did not highlight the found text, and sometimes did not scroll down to it.
- Fixed "Goto Definition" not working for Enums and Defines (macros).
- Fixed script autocomplete sometimes was not updated right after opening a script.
- Fixed script autocomplete for function calls was mistreating commas in strings and inline comments as if they were separating actual parameters.
- Fixed script autocomplete was not displaying members of extended structs if the parent struct was declared in another header.
- Fixed script autocomplete was not working for enum names.
- Fixed structs and enums were not highlighted if declared inside a script's body.
- Fixed in dialogs numbers inside names were incorrectly highlighted as numeric values.
- Fixed few editor panes were not opening correct help topics in F1.

Compiler:
- Support unicode character literals.
- Support using float literals when defining default values for function arguments.
- Support hexadecimal number literals (e.g. "0xABCDEF").
- Removed 500-characters line limit.

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; added support for "NEW_KEYINPUT_API" macro in scripts.
- 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.
- Implemented `dialog_options_close` callback which is called when custom dialog options are removed from the screen. This allows to perform any required cleanup.
- Added eEventEnterRoomAfterFadein event for `on_event` callback, which corresponds to "enter after fade-in" room event.
- Added eKey constants for Shift, Control and Alt keys.
- Added eKeyMod enum for key modifiers constants.
- String.AppendChar(), ReplaceChar() functions and String.Chars[] property are now working with the unicode characters.
- String.Format("%c") specifier will now be able to print unicode characters.
- Extended Button.Animate() to have blocking style, direction and starting frame parameters, thus matching other Animate commands (of Character and Object).
- Extended all Animate() commands by adding "volume" parameter, that defines volume of the frame-linked sounds for the duration of this animation.
- Added Character.AnimationVolume, defining volume of the frame-linked sounds.
- Added Character.IdleAnimationDelay to let control idle view's animation speed.
- Character.Scaling is no longer limited by a range of 5-200 (now supports 1-32767).
- Hotspot.Name and Object.Name may now be set in script.
- Added Object.ManualScaling and Object.Scaling.
- Deprecated Object.IgnoreScaling (use Object.ManualScaling instead).
- Object.SetView default loop & frame values are now 0 (was -1 which retained loop and frame indexes from the previous view, often unexpected to the user).
- DrawingSurface.DrawImage() and DrawSurface() now support optional source rect coordinates.
- Added functions for getting DrawingSurface of room masks: GetDrawingSurfaceForWalkableArea(), GetDrawingSurfaceForWalkbehind(), Hotspot.GetDrawingSurface(), Region.GetDrawingSurface().
- Added new delay parameter to Mouse.ChangeModeView() to let control cursor's animation speed.
- Added Game.ChangeSpeechVox() and Game.SpeechVoxFilename, support switching the voice-over pack.
- Added Mouse.AutoLock property that toggles automatic mouse lock inside the game window.
- Added Room.Exists().
- Added System.Log().
- Added SkipWait() that skips any active Wait() function.
- Added WaitMouse() to complement existing Wait functions.
- Added InputType enum which defines input devices and lets create their sets as flags.
- Added WaitInput(), a more generic and extendable function that accepts a combination of flags telling which input types to wait for.
- All Wait* functions now may have infinite timeout if you pass a negative timeout parameter.
- All Wait* functions now return the reason they were skipped: a combination of InputType flag and a respective key or button code.
- Added GUIControl.Transparency property.
- Added Overlay.CreateRoomGraphical and CreateRoomTextual. Use these two functions to create "room overlays": that is - overlays that display a sprite inside the room, sorted among other room objects, characters and walk-behinds.
- Added readonly Overlay.InRoom property that tells if this is a room or screen overlay.
- Extended Overlay.CreateGraphical() with a new "clone" parameter that tells whether to assign a sprite index, or make a sprite's copy owned exclusively by this overlay. The former will save program memory but make overlay update if the sprite is edited later. The latter is meant primarily for backwards compatibility. Overlay.CreateRoomGraphical has the same param.
- Added Overlay.Graphic property that lets you change overlay's sprite after it's created.
- Added Overlay.Width and Height properties, that let you freely scale existing Overlay.
- Added readonly Overlay.GraphicWidth and GraphicHeight properties that let read original overlay's graphic size, as not all overlays hold a sprite reference (e.g. textual overlays).
- Added Overlay.Transparency property.
- Added Overlay.ZOrder property that lets you sort Overlays among themselves and other objects in the same "game layer": screen overlays are sorted among GUI, while room overlays are sorted among room objects, characters and walk-behinds.
- Added Speech.TextOverlay and Speech.PortraitOverlay for accessing blocking speech overlay and portrait overlay respectively.
- Added Game.BlockingWaitSkipped which tells the result of the last blocking wait skipping, also including result of the blocking speech skipping.
- SkipSpeechStyle now supports eSkipNone mode; when used it will disable any kind of skipping, such speech can be only skipped by a direct command from script.
- Extended Screen.ScreenToRoomPoint() with an optional "restrictToViewport" argument, which lets to choose whether tests over empty place result in conversion through the default viewport or a null pointer.
- Added AudioClip.PlayOnChannel().
- Added AudioChannel.Pause() and Resume() functions, and IsPaused property.
- Added AudioChannel.SeekMs(), complementing PositionMs (as the Seek() function interprets position differently depending on the audio format).
- PlayVideo() now supports an option to play both game's and video's audio track simultaneously.
- Added File.WriteRawInt() to complement ReadRawInt().
- File paths in script now support $DATA$ token, which tells to read files from the game package.
  This only works for read operations. Functions that support this token currently are: File.Open(), DynamicSprite.CreateFromFile(), ListBox.FillDirList().
- 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:
- New SDL2-based backend for graphics, audio and input.
- Hqx graphic filters discontinued (could be temporary).
- Windows-only DirectMedia video playback discontinued (could be temporary).
  Only OGG/OGV videos are kept supported at this point.
- Support resizing game window on desktop systems.
- Support "borderless full-screen window" mode in addition to the real (exclusive) fullscreen.
- Unicode (UTF-8) text support: engine can now switch between ASCII and UTF-8 text mode.
  This is controlled by both game's OPT_GAMETEXTENCODING setting and translation's "Encoding" setting: they tells whether to interpret game texts as UTF-8 or ASCII/ANSI.
- Support optional translation's "GameEncoding" setting: it hints the original game's codepage to help with their conversion. This is mostly meant for translating existing older (ANSI) games.
- 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.
- Also supports separate "normal" and backward compatible "fixup" modes when initializing TTF fonts, letting to display both common TTFs and ones made specifically for AGS in the past to display as they were meant to be.
- Supports scripts using functions and variables from any other scripts, regardless of the script module order in the project.
- Removed limit of simultaneous Button animations.
- Removed limit of Character followers.
- Removed Overlay limit.
- Character.SetWalkSpeed() is no longer restricted by an arbitrary limit of 50.
- Process character's idle view based on real game speed, not hardcoded 40 fps.
- Improved file writing times (e.g. when doing a game save) by using buffered file stream. Initial tests showed 50% faster file writing.
- Engine now renders GUI controls as separate textures when using hardware accelerated renderers.
  This may significantly improve perfomance in the high-resolution games and games with large number of GUI elements on screen.
- Engine now shares the video texture data for all game objects on screen sharing same sprite. This improves perfomance in case there are multiple objects which use same image.
- Engine now ensures that in threaded audio mode the 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.
- 24-bit wav PCM support, comes with the new sound library.
- 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.
- Implemented debug key controls for calling a built-in save and restore game dialogs. These controls have to be set in user config as "save_game_key" and "restore_game_key" in "[override]" category. These may be used by testers if the game is missing a save function or one is bugged.
- Engine now supports loading compiled scripts as separate files packed along with the game, along with those embedded into the main game data or inside room files.
- Engine no longer bails out with error if the chosen translation cannot be loaded on startup.
- When reporting script errors, engine will print callstack for all the active script "threads": for example, if there's Wait() function called and error happened in repeatedly_execute_always, then it will print both actual error's location, and Wait() call's location.
- 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.
- Added "load_latest_save" and "show_fps" options to config (in "[misc]" category).
- Added "background" option to config in "[misc]" category, that defines the starting run-in-background (aka multitasking) mode (may later be changed by SetMultitaskingMode()).
  Added "--background" command line option for the same purpose.
- Added "cache_size" and "stream_threshold" options to config in "[sound]" category, they setup the rules for sound caching and choosing whether to load a clip fully into mem or stream one.
- 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.
- Support "--user-conf-dir" command-line arg (and "user_conf_dir" config option) superceding "--localuserconf"; the new option directly tells the location of user config file.
- Path related command-line and 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.
- Added "--clear-cache-on-room-change" command-line arg (and similar config option).
- Don't error when DrawingSurface.DrawImage has bad transparency parameter (warning instead).
- Don't error when detecting bad format in File.Read* functions (warning instead).
- Added stubs for agsshell plugin (a contemporary cross-platform variant of ags_shell).
- Added SpriteFont plugin to the list of builtins, for ports that use ones. SpriteFont plugin is updated to support custom "Clifftop Games" font variants.
- Fixed dialog script's "goto-previous" command not working if used from the first sub-topic run using "goto-dialog" (a very-very old bug).
- Fixed potential crash on room load if the walkable area mask contained color values above the supported range.
- 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 renderer error occuring if room background frames are of different sizes.
- Fixed AGS_EngineInitGfx plugin callback was not called during OpenGL renderer initialization.
- Fixed overlay may fail to be created sometimes, if previously another overlay had been forcefully removed when changing rooms (this is an ancient bug which existed for many years).
- Fixed ListBox.RowCount reporting 0 if called before the control was displayed once.
- Fixed text may be misaligned in gui controls, as its outline thickness is not counted.
- Fixed some TTF fonts could be cut at the bottom when the speech is displayed.
- Fixed scheduled sound fadeout effect was not cancelled by skipping a cutscene.
- Fixed OGV Theora videos positioned incorrectly if they have certain sizes or aspect ratios.
- Fixed multitasking mode persisting if the game was switched from windowed to real fullscreen mode (even though it's not supposed to work in exclusive fullscreen).
- Fixed game fps sped up if SetGameSpeed() is called repeatedly in game script.
- Fixed game not reacting to system close commands when stuck in script, which made it impossible to close the "hanging" game by usual means (other than terminating the process).

Engine Plugin API:
- Added IAGSEngine::GetGameInfo() function which returns information about the game, such as its title and GUID.
- Added new render callback AGSE_POSTROOMDRAW, for handling drawing inside the room above all room objects.
- Added IAGSFontRenderer2 interface, expanding the original font renderer interface, improving font plugins support.
- Added ReplaceFontRenderer2() and NotifyFontUpdated() functions.

Compatibility:
- Fallback to loop 0 if the speech view does not have frames in the current directional loop.
- Set the first loop with frames if current character's loop does not have any for some reason.
- Ignore character having view/loop with no frames while it's not in the current room.
- Legacy behavior of MoveCharacterBlocking's return value.
- Fixed walkable area's continuous scaling was broken for high-res rooms in old games.
- In pre-3.* games force player to walkable area after changing rooms, this is to emulate an unintentional effect created by the old engines.
- Fixed pre-3.4.1 anti-aliased TTF fonts display (their vertical position was broken).
- Support Label.TextAlignment with legacy alignment constants for pre-3.5.0 games made with the custom engine from "Clifftop Games".
- Support native resolution hack for games made with "Clifftop Games" custom engine, where 640x400 games are run as 640x360.

Android:
- Rewrote universal AGS game launcher/player using up-to-date Google guidelines. The former "launcher" is now called "AGS Player".
- Implemented single game project template meant for building your own signed APK.
- 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.

OSX:
- OpenGL renderer is now supported on MacOS.

Web / Emscripten:
- Initial port release.

Windows:
- Installer will create program links with three-digit version in the name.

WinSetup:
- Added "Fullscreen as borderless window" checkbox.
- Remade sound options to reflect the move to the new audio system in the engine.


KNOWN ISSUES
* MIDI no longer plays on its own on Windows. For MIDI you (and your players) must install "sound banks" (also known as "sound font"). Please refer to this article: https://github.com/adventuregamestudio/ags-manual/wiki/MIDI-playback
* AudioChannel.Position and AudioChannel.Seek do not work for MIDI and MOD sounds. Try sticking to PositionMs and SeekMs for now.
Title: Re: AGS 3.6.0 - Beta 1
Post by: eri0o on Mon 21/03/2022 00:45:19
Yey! We are in beta! Well done! 8-0
Title: Re: AGS 3.6.0 - Beta 1
Post by: Mehrdad on Mon 21/03/2022 05:57:58
congrats on the beta release!. Nice job !!  ;-D  ;)
Title: Re: AGS 3.6.0 - Beta 1
Post by: Stranga on Tue 22/03/2022 00:04:01
Awesome news about the beta! Loving the new AGS features :D
Title: Re: AGS 3.6.0 - Beta 1
Post by: Dave Gilbert on Tue 22/03/2022 14:03:36
Nice! Dutifully updating.
Title: Re: AGS 3.6.0 - Beta 1
Post by: shaun9991 on Tue 22/03/2022 14:32:55
Amazing work! So many wonderful features here!!!
Title: Re: AGS 3.6.0 - Beta 1
Post by: Stranga on Tue 22/03/2022 23:04:16
Having a strange problem since updating to the new beta, I think it may have something to do with the new keyboard handling system. I reverted back to the old via General settings but still doesn't seem to fix the problem.

My keyboard movement script is entirely done in repeatedly_execute(), which previously never interfered with hotspot.runinteraction, strangely if you hold down a movement key while interacting with a hotspot after the interaction completes the player is jolted in the direction of the key being held across the room. Seems to only happen if the game has entered a blocking sequence of some sort, maybe remembering key inputs during the hotspot interactions and playing them right after.

Keyboard Movement Script:
Spoiler
Code (ags) Select

// Main script for module '8 Direction Movement'

import int  KeyUp[2];
import int  KeyDown[2];
import int  KeyLeft[2];
import int  KeyRight[2];
import int  KeyAction[2];
import int  KeyBack;
import int  KeyMenu;
import int  KeySprint[2];


//required values

int xm;
int ym;
int _xspeed=9; //Player Speed
int _yspeed=9; //Player Speed
int xwidth=1;
int ywidth=1;
int slide=3;
int a;
int c;
int dir;
bool diagslowdown=true;
int walkanispeed=2;
bool thrust;
int walkingani=2;
bool disablemove;
bool nodirset;
bool eightdir = false;
int animticks;
int animticks2;
bool standing;

static function EightDir::SetSpeed(int x, int y) {
  _xspeed = x;
  _yspeed = y;
}

static function EightDir::SetSize(int x, int y) {
  xwidth = x;
  ywidth = y;
}

static function EightDir::WalkViewSpeed(int speed) {
  walkanispeed = speed;


  static function EightDir::SetWalkView(int view) {
  walkingani = view;


static function EightDir::SetSlide(int value) {
  slide = value;


static function EightDir::Disable(bool value) {
  disablemove = value;


static function EightDir::NoDirSet(bool value) {
  nodirset = value;


static function EightDir::DiagSlow(bool value) {
  diagslowdown = value;


static function EightDir::Thrust(int x, int y) {
  xm=x;
  ym=y; 
  thrust=true;


static function EightDir::EightLoopsMode(bool value) {
  eightdir = value;
}

static function EightDir::IsMoving() {
  if ((xm!=0)||(ym!=0)) {return 1;}
  if ((xm==0)&&(ym==0)) {return 0;}
}

static function EightDir::IsThrusting() {
  return thrust;
}

bool isInactive() {
  if(player.Room == 0) return true;
  return false;
}

int moveto(int val, int incr, int target)
{
  bool lt = val<target;
  bool gt = val>target;
  int old = val;
  if(lt) val += incr;
  else if(gt) val -= incr;
if(((old<=target && val>=target) || (old>=target && val<=target)))
val = target;
  return val;
}

#sectionstart repeatedly_execute  // DO NOT EDIT OR REMOVE THIS LINE
function repeatedly_execute()
{
if (!InDialogue)// <-----This was a test to see if I could use a global variable to stop being able to move/take inputs in whilst in an interaction...didn't work as well as I'd hoped
{
int wasdir = dir;
int wasx = player.x;
int wasy = player.y;


  if(isInactive()) return;

  bool up=false;
  bool down=false;
  bool left=false;
  bool right=false;


  if ((IsInterfaceEnabled()==true)&&(IsGamePaused()==false))
  {
 
  if (IsKeyPressed(KeyRight[0])||IsKeyPressed(KeyRight[1]))
  {
    right=true;
  }
  else if (IsKeyPressed(KeyLeft[0])||IsKeyPressed(KeyLeft[1]))
  {
    left = true;
  }
  else if (IsKeyPressed(KeyUp[0])||IsKeyPressed(KeyUp[1]))
  {
    up = true;
  } 
  else if (IsKeyPressed(KeyDown[0])||IsKeyPressed(KeyDown[1]))
  {
    down = true;
  }   
  else
  {
    walkanispeed=1;
    return;
  }
  }

  if(!up && !down && !left && !right)
  {
    return;
    player.StopMoving();
  }

  if ((IsInterfaceEnabled()==false)||(disablemove==true)) {xm=0;ym=0;}
 
  bool speedup = false;
 
  if(IsKeyPressed(KeySprint[0])||IsKeyPressed(KeySprint[1])) speedup = true;

 
 
  int xspeed = _xspeed;
  int yspeed = _yspeed;
 
   if(speedup)//RUN_________________________________RUN
  {
    if (player.View!=68)
    {
      player.LockView(68);
    }
    walkanispeed=4;
    xspeed = 15;
    yspeed = 15;
  }
  else
  {
   if (player.View!=2)
   {
     player.LockView(2);
   }
   walkanispeed=2;
  }
 
  int accel = 20;

  if ((player.Moving==false)&&(IsInterfaceEnabled()==true)&&(IsGamePaused()==false)&&(disablemove==false)) {

    int b=0;
   
    if ((xm==0) && (ym==0)) {thrust=false;}


    //moving values

      while (b<slide){

        if (thrust==false){
         
          if ((right==true) && (xm < xspeed))  {xm=moveto(xm,accel, xspeed);}   //right
          if ((left==true) && (xm > xspeed*(-1)))  {xm=moveto(xm, accel, -xspeed);}   //left

          if ((down==true) && (ym < yspeed))  {ym=moveto(ym, accel, yspeed);}   //down
          if ((up==true) && (ym > yspeed*(-1)))  {ym=moveto(ym, accel, -yspeed);}   //up

          if ((left==false) && (right==false)) xm = moveto(xm,accel, 0);
          if ((up==false) && (down==false)) ym = moveto(ym,accel,  0);
       
        } 

      if (thrust==true) {
       
        if (xm != 0){xm=moveto(xm, accel, 0);}
        if (ym != 0){ym=moveto(ym, accel, 0);}
      }

    //slowdown

    if (thrust==false){
      if (xm > xspeed){xm=moveto(xm, accel,  xspeed);}
      if (xm < xspeed*(-1)){xm=moveto(xm, accel, -xspeed);}
      if (ym > yspeed){ym=moveto(ym, accel, yspeed);}
      if (ym < yspeed*(-1)){ym=moveto(ym, accel,  -yspeed);}
    }

  b=b+1;
  }

  //diagslowdown

  if (diagslowdown==true){

    int slow=0;
    while (slow <slide+1){

     if ((right==true)&&(down==true)) {
       if (xm>(xspeed*70)/100) {xm=(xm*70)/100;}
       if (ym>(yspeed*70)/100) {ym=(ym*70)/100;}
     }

     if ((left==true)&&(down==true)) {
       if (xm<((xspeed*70)/100)*(-1)) {xm=((xspeed*70)/100)*(-1);}
       if (ym>(yspeed*70)/100) {ym=(ym*70)/100;}
     }

     if ((left==true)&&(up==true)) {
       if (xm<((xspeed*70)/100)*(-1)) {xm=((xspeed*70)/100)*(-1);}
       if (ym<((yspeed*70)/100)*(-1)) {ym=((yspeed*70)/100)*(-1);}
     }

     if ((right==true)&&(up==true)) {
       if (xm>(xspeed*70)/100) {xm=(xm*70)/100;}
       if (ym<((yspeed*70)/100)*(-1)) {ym=((yspeed*70)/100)*(-1);}
     }
   slow=slow+1;
   }
  }

  //right

  int loop=0;

  if (xm>0){

    while (loop <xm) {
      a=a+1;
      if (a>9) {a=0;}
      if (a==5){
        player.x = player.x +xwidth;
        if (GetWalkableAreaAt(player.x - GetViewportX(),player.y - GetViewportY())>0) {player.x=player.x +1;}
        player.x = player.x -xwidth;
      }
    loop=loop+1;
    }
  }


  //left

  loop=0;

  if (xm<0){

    while (loop > xm) {
      a=a+1;
      if (a>9) {a=0;}
      if (a==5){
        player.x = player.x -xwidth;
        if (GetWalkableAreaAt(player.x - GetViewportX(),player.y - GetViewportY())>0) {player.x=player.x -1;}
        player.x = player.x +xwidth;
      }
    loop=loop-1;
   }
  }


  //down

  loop=0;

  if (ym>0){

    while (loop <ym) {
      c=c+1;
      if (c>9) {c=0;}
      if (c==5){
        player.y = player.y +ywidth;
        if (GetWalkableAreaAt(player.x - GetViewportX(),player.y - GetViewportY())>0) {player.y=player.y +1;}
        player.y = player.y -ywidth;
      }
    loop=loop+1;
    }
  }


  //up

  loop=0;

  if (ym<0){
    while (loop >ym) {
      c=c+1;
      if (c>9) {c=0;}
      if (c==5){
        player.y = player.y -ywidth;
        if (GetWalkableAreaAt(player.x - GetViewportX(),player.y - GetViewportY())>0) {player.y=player.y -1;}
        player.y = player.y +ywidth;
      }
    loop=loop-1;
    }
  }


  //outpush

  player.x = player.x -xwidth;
    if (GetWalkableAreaAt(player.x - GetViewportX(),player.y - GetViewportY())==0) {player.x=player.x +1;}
  player.x = player.x +xwidth;

  player.x = player.x +xwidth;
    if (GetWalkableAreaAt(player.x - GetViewportX(),player.y - GetViewportY())==0) {player.x=player.x -1;}
  player.x = player.x -xwidth;

  player.y = player.y -ywidth;
    if (GetWalkableAreaAt(player.x - GetViewportX(),player.y - GetViewportY())==0) {player.y=player.y +1;}
  player.y = player.y +ywidth;

  player.y = player.y +ywidth;
    if (GetWalkableAreaAt(player.x - GetViewportX(),player.y - GetViewportY())==0) {player.y=player.y -1;}
  player.y = player.y -ywidth;

  //outpush #2

  player.y = player.y -ywidth;

  player.x = player.x -xwidth;
    if (GetWalkableAreaAt(player.x - GetViewportX(),player.y - GetViewportY())==0) {player.x=player.x +1;}
  player.x = player.x +xwidth;

  player.y = player.y +ywidth;
  player.y = player.y +ywidth;

  player.x = player.x -xwidth;
    if (GetWalkableAreaAt(player.x - GetViewportX(),player.y - GetViewportY())==0) {player.x=player.x +1;}
  player.x = player.x +xwidth;

  player.y = player.y -ywidth;



  player.y = player.y -ywidth;

  player.x = player.x +xwidth;
    if (GetWalkableAreaAt(player.x - GetViewportX(),player.y - GetViewportY())==0) {player.x=player.x -1;}
  player.x = player.x -xwidth;

  player.y = player.y +ywidth;

  player.y = player.y +ywidth;

  player.x = player.x +xwidth;
    if (GetWalkableAreaAt(player.x - GetViewportX(),player.y - GetViewportY())==0) {player.x=player.x -1;}
  player.x = player.x -xwidth;

  player.y = player.y -ywidth;



  player.x = player.x +xwidth;

  player.y = player.y -ywidth;
  if (GetWalkableAreaAt(player.x - GetViewportX(),player.y - GetViewportY())==0) {player.y=player.y +1;}
  player.y = player.y +ywidth;

  player.x = player.x -xwidth;



  player.x = player.x -xwidth;

  player.y = player.y -ywidth;
    if (GetWalkableAreaAt(player.x - GetViewportX(),player.y - GetViewportY())==0) {player.y=player.y +1;}
  player.y = player.y +ywidth;

  player.x = player.x +xwidth;



  player.x = player.x -xwidth;

  player.y = player.y +ywidth;
    if (GetWalkableAreaAt(player.x - GetViewportX(),player.y - GetViewportY())==0) {player.y=player.y -1;}
  player.y = player.y -ywidth;

  player.x = player.x +xwidth;


 
  player.x = player.x +xwidth;

  player.y = player.y +ywidth;
    if (GetWalkableAreaAt(player.x - GetViewportX(),player.y - GetViewportY())==0) {player.y=player.y -1;}
  player.y = player.y -ywidth;

  player.x = player.x -xwidth;


  //animations

  //set direction

  if (eightdir==false){

    if ((left==true)||(right==true)||(up==true)||(down==true)){

      if (thrust==false){

        if (ym>0) {if ((left==false)&&(right==false))  {dir=0;}}
        if (xm<0) {if ((up==false)&&(down==false))  {dir=1;}}
        if (xm>0) {if ((up==false)&&(down==false))  {dir=2;}}
        if (ym<0) {if ((left==false)&&(right==false))  {dir=3;}}

        if ((ym>0) && (player.Loop==3))  {dir=0;}
        if ((ym<0) && (player.Loop==0))  {dir=3;}
        if ((xm>0) && (player.Loop==1))  {dir=2;}
        if ((xm<0) && (player.Loop==2))  {dir=1;}
      }
    }
  }


  if (eightdir==true){

    if ((left==true)||(right==true)||(up==true)||(down==true)){

      if (thrust==false) {
   
        if ((xm>0)&&(ym==0)) {dir=2;}
        if ((xm<0)&&(ym==0)) {dir=1;}
        if ((xm==0)&&(ym>0)) {dir=0;}
        if ((xm==0)&&(ym<0)) {dir=3;}

        if ((xm>0)&&(ym>0)) {dir=4;}
        if ((xm<0)&&(ym>0)) {dir=6;}
        if ((xm<0)&&(ym<0)) {dir=7;}
        if ((xm>0)&&(ym<0)) {dir=5;}
      }
    }
  }
}
 
  bool any = (left==true)||(right==true)||(up==true)||(down==true);
 
if(any)
  {
    if(dir != wasdir || player.Loop != dir || standing)
    {
      player.Loop = dir;

//only reset this if we were standing previously
if(standing)
{
//NOT 0 -- start nudging forward rather than slide in walk frame
player.Frame = 1;
}
    }
    else
    {
      animticks++;
      if(animticks>=walkanispeed)
      {
        animticks=0;   
        animticks2++;
       
        int limit = 2;
        if(speedup) limit=1;
                 
        ViewFrame* tmp = Game.GetViewFrame(player.View, player.Loop,  player.Frame);
       
        if(animticks2 > limit)
        {
          animticks2 = 0;
          player.Frame = player.Frame+1;
          if(tmp.LinkedAudio != null)
          {
            tmp.LinkedAudio.Play();
            if(player.Frame >= Game.GetFrameCountForLoop(player.View,  player.Loop))
              player.Frame = 1;
          }
        }
      }
    }
  }
  else
  {
    player.Frame = 0;
standing = true;
animticks = 0;
animticks2 = 0;
return;
  }
  if(any) standing = false;

  if (player.Moving==true) {dir=player.Loop;}

  if (nodirset>0) {dir=player.Loop;}

  if (IsInterfaceEnabled()==false) {dir=player.Loop;}
 
  //LogMessage(String.Format("%d, yspeed=%d",player.y, yspeed));
}
else
{
  return;
}
}
#sectionend repeatedly_execute  // DO NOT EDIT OR REMOVE THIS LINE

[close]
Interaction Script:
Spoiler
Code (ags) Select

//----------------------------------------------------------------------------------------------------
// on_key_press
//----------------------------------------------------------------------------------------------------
import int  KeyUp[2];
import int  KeyDown[2];
import int  KeyLeft[2];
import int  KeyRight[2];
import int  KeyAction[2];
import int  KeyBack;
import int  KeyMenu;
import int  KeySprint[2];
import int KeyInventory[2];

function on_key_press(eKeyCode keycode)
{   

if (IsGamePaused()) keycode = 0;

    // Action Key--------------------------------------------------------------------------------------------------------------
    if (keycode == KeyAction[0] || keycode == KeyAction[1])
    {
      int px = player.x - GetViewportX(),py = player.y - GetViewportY();
      Hotspot*h = Hotspot.GetAtScreenXY(px, py);
      Object*o = Object.GetAtScreenXY(px, py);
      if (h.ID > 0 ) {
        if (player.ActiveInventory != null)
        {
          player.StopMoving();//These may be redundant
          h.RunInteraction(eModeUseinv);
        }
        else
        {
          player.StopMoving();//These may be redundant
          h.RunInteraction(eModeInteract);
        }
      }
    }
}
[close]
Title: Re: AGS 3.6.0 - Beta 1
Post by: Crimson Wizard on Tue 22/03/2022 23:34:31
Quote from: Stranga on Tue 22/03/2022 23:04:16if you hold down a movement key while interacting with a hotspot after the interaction completes the player is jolted in the direction of the key being held across the room. Seems to only happen if the game has entered a blocking sequence of some sort, maybe remembering key inputs during the hotspot interactions and playing them right after.

If it were in on_key_press, i would assume that maybe it does not process and clear the key buffer each frame during a blocking action.
But since the action keys are processed in rep-exec, i'm not certain. I will have to do some tests.
Title: Re: AGS 3.6.0 - Beta 1
Post by: Stranga on Wed 23/03/2022 00:09:48
Well, strangely I did convert the system to on_keypress and didn't seem to find that issue (besides the very jittery/slow/clunky movement of the player character). If I could convert it to run as smoothly as on repeat_exe I would to be honest but this still may cause other problems down the line, possibly for others. I did also notice that it halted an animation after moving to another room  and partly froze the game too whilst doing the same thing (Holding ANY keys down during interactions or cutscenes e.c.t)
Title: Re: AGS 3.6.0 - Beta 1
Post by: vga256 on Wed 23/03/2022 17:01:46
Great to see a beta out - with all the new features, this was enough to push me over the edge into upgrading my project!

I'm seeing an autocomplete bug with this version, but since I did not use any earlier versions of 3.6.0 I can't say where/when it might have emerged.

Behaviour:
Autocomplete does not continue working past the first word in a variable under ... unknown conditions.
Example:
Code (ags) Select

/// reactor pressure and temp constraints
float ReactorMaxPressure = 1000.0; // a made-up number in kpa
float ReactorMinPressure = 1.0;
float ReactorMaxTemp = 1500.0; // a made-up number in *C
float ReactorMinTemp = 1.0; // in *C
float AmbientTemperature = 25.0; // SATP in *C
float AmbientPressure = 100.0; // SATP in kPa


Code (ags) Select

function PlantSystemsToggleSysOps()
{
  Reactor...
}


When "Reactor" is entered, the autocomplete dropdown box correctly pops up and preselects ReactorMaxPressure. However, if I continue typing the variable name, "ReactorM..." the autocomplete box deselects ReactorMaxPressure and will not autocomplete with any variable name when I hit tab.

Workaround:
Code (ags) Select

function PlantSystemsToggleSysOps()
{
    int anyTempVariable;
    Reactor...
}


With the above code, the simple insertion of any new variable causes the autocomplete to work as expected for "ReactorM..." words.

Possible Cause (?):
I tested this behaviour throughout my script, and determined that this function definition causes autocomplete to fail:
Code (ags) Select

int NormalizeFlowRateWithinRange(int flowRate)
{
  for (int i = 0; i < MAX_ANIM_SPEED_GROUPS; i++)
  {
    if (flowRate <= animationSpeedRanges[i])
      return animationSpeedRanges[i];
  }
}


In *any* function below that piece of code, autocomplete will no longer properly autocomplete the word "ReactorM". Any function above this function autocompletes properly. I cannot see anything obvious about the above function that would cause a problem with autocomplete. Even commenting-out the entire function does not help.

Let me know if I can provide any more detail. It's a strange bug.
Title: Re: AGS 3.6.0 - Beta 1
Post by: eri0o on Thu 24/03/2022 00:39:46
@Stranga
Spoiler

this Keyboard Movement code is around 20 lines of code at least different from the one in Ash Pines. Is anything different there?

I just got
(https://i.imgur.com/yX42uO1.png)

Is this line EXACTLY:
Code (ags) Select
ViewFrame* tmp = Game.GetViewFrame(player.View, player.Loop,  player.Frame);
Because if it is, this another bug, with I thought we had fixed...
https://github.com/adventuregamestudio/ags/issues/802
[close]

So I can reproduce Stranga's reported problem (https://www.adventuregamestudio.co.uk/forums/index.php?topic=59842.msg636644498#msg636644498) on the engine built for release but when I try to run it on a debugger I keep hitting the bug above under the spoiler. I can't figure any minimal test case that reproduces the error though, everything appears to work.

On Ash Pines what I get is the engine is running and I can see keypresses on the log, but since I can't attach the debugger I don't know if the IsKeyPressed is getting the correct result or not - the character doesn't move anymore. I unfortunately am too much in the dark to even be able to write a bug report.
Title: Re: AGS 3.6.0 - Beta 1
Post by: Stranga on Thu 24/03/2022 00:47:27
@eri0o
Quotethis Keyboard Movement code is around 20 lines of code at least different from the one in Ash Pines. Is anything different there?

Yes, there's a small difference and it has to do with the number of views in that game. In Ash Pines, the player only has a left and right view rather than my latest/previous games where they have up, down, left, and right views.

Would you like to try a current demo game with your debugger? I can send you a build if you like?
Title: Re: AGS 3.6.0 - Beta 1
Post by: Crimson Wizard on Thu 24/03/2022 03:24:09
When testing under debugger it may be a good idea to enable "Multitasking mode" either using script command (https://adventuregamestudio.github.io/ags-manual/Globalfunctions_General.html#setmultitaskingmode) or config setting (https://github.com/adventuregamestudio/ags/blob/master/OPTIONS.md#configuration-file-options). Without "miltitasking" mode the input buffers are cleared on switching in and out of the game window, which also happens when breakpoint is hit.
Title: Re: AGS 3.6.0 - Beta 1
Post by: Crimson Wizard on Fri 25/03/2022 22:10:35
Quote from: eri0o on Thu 24/03/2022 00:39:46
Is this line EXACTLY:
Code (ags) Select
ViewFrame* tmp = Game.GetViewFrame(player.View, player.Loop,  player.Frame);
Because if it is, this another bug, with I thought we had fixed...
https://github.com/adventuregamestudio/ags/issues/802


This is happening as a combination of 2 reasons.
1) Engine allows to set Character's Frame directly without checking for validity, not even a warning. This is a surprise to me.

2) The game script has a mistake:
Code (ags) Select

          player.Frame = player.Frame+1;
          if(tmp.LinkedAudio != null)
          {
            tmp.LinkedAudio.Play();
            if(player.Frame >= Game.GetFrameCountForLoop(player.View,  player.Loop))
              player.Frame = 1;
          }

if you notice, the player's frame range is only tested if linked audio is not null. Normally it should be checked always, outside of the LinkedAudio "if".

3) The question remaining is, why does this error happen only when the key was held down during blocking action, and not all the time.


UPDATE After fixing the above script error I was able to reproduce the problem Stranga was talking about: if i hold down a movement key during the blocking action, the character jumps across the screen after blocking action is over.

Code (ags) Select

          player.Frame = player.Frame+1;
          if(tmp.LinkedAudio != null)
          {
            tmp.LinkedAudio.Play();
          }
          if(player.Frame >= Game.GetFrameCountForLoop(player.View,  player.Loop))
              player.Frame = 1;
Title: Re: AGS 3.6.0 - Beta 1
Post by: Crimson Wizard on Sat 26/03/2022 00:09:26
So, in regards to jumping after blocking action. After some debugging, it's confirmed that there are a lot of repeatedly_execute events get queued and then called at once as soon as blocking action ends. Basically, instead of 1 rep-exec, there's like 20 rep-execs called in a quick succession.

This may be related to some recent changes in the engine, because previously AGS did not let schedule more than 5 events at once and would simply quit the game with "internal error" if this happens. Removal of event queue limit is not a problem itself, but it seem to hide some other problem where it would keep accumulate rep-exec events when it really should not.

UPDATE:

This is the temp build with fix: https://cirrus-ci.com/task/6054112394477568
Title: Re: AGS 3.6.0 - Beta 1
Post by: greg on Sat 26/03/2022 19:04:34
Thanks for putting this beta together!  I'm very excited to try it out, and I just updated from 3.5.1.14 to the build in the previous comment.

I've noticed a couple strange things with object animations:

1. When I play an object's animation as eRepeat, it plays once and then stops.

2. When I play an object's animation backwards, it plays the first few frames of the animation (i.e. the last few frames of the loop) backwards and then starts playing in forward motion again.  This occurs whether or not I explicitly specify the starting frame.

Code (ags) Select

// context: loop 0 of view my_view has 12 frames
// this appears to play frame id 11, then 10, then 9, then 10, then 11
oObject.SetView(my_view, 0);
oObject.Animate(0, 5, eOnce, eBlock, eBackwards);

// and this does the same thing
oObject.SetView(my_view, 0, 11);
oObject.Animate(0, 5, eOnce, eBlock, eBackwards, 11);


Also, I noticed that the numerical values of internal enums (eBlock, eNoBlock, eForwards, eBackwards) have changed from AGS 3.5.1.  For example, instead of 0/1, eForwards and eBackwards are 1062/1063.  I'm assuming that's intended?
Title: Re: AGS 3.6.0 - Beta 1
Post by: Crimson Wizard on Sat 26/03/2022 20:00:44
@greg, sorry for that! I've been adding something to animation commands, which will be announced for the next update, and there was one small mistake...

Here's a link to another fixed build (it will be available roughly 20 mins after posting):
https://cirrus-ci.com/task/6209775263285248

Quote
Also, I noticed that the numerical values of internal enums (eBlock, eNoBlock, eForwards, eBackwards) have changed from AGS 3.5.1.  For example, instead of 0/1, eForwards and eBackwards are 1062/1063.  I'm assuming that's intended?

These constants did not change at least since 3.2.1 (this is as far as we can look back into the code history), but I know that Animate functions also must accept 1 and 0 (or true and false) for Direction and Blocking parameters.
Title: Re: AGS 3.6.0 - Beta 1
Post by: greg on Sat 26/03/2022 20:21:14
Thank you very much, CW!  That build fixed both object animation issues I had encountered.

Separately, I noticed that ch.PositionMs is now returning how long AudioChannel ch has been playing, not the position of the audio clip that's playing on ch.

Here's my test for this:

Code (ags) Select
AudioChannel* ch = aMusTest.Play(eAudioPriorityHigh);
// Msg("foo") is a simple function which prints "foo" to the screen.
Msg(String.Format("%d", ch.PositionMs));  // This prints 0, as expected.
// My gamespeed is 40, so each Wait(80) is roughly two seconds.
Wait(80);
Msg(String.Format("%d", ch.PositionMs));  // This prints ~2000, as expected
Wait(80);
ch.Seek(79500);
Msg(String.Format("%d", ch.PositionMs));  // This prints ~4000, where I'd expect ~79500.
Wait(80);
Msg(String.Format("%d", ch.PositionMs));  // This prints ~6000, where I'd expect ~81500.
Title: Re: AGS 3.6.0 - Beta 1
Post by: Crimson Wizard on Sat 26/03/2022 22:07:13
@greg, thank you for reporting; i now fixed couple of mistakes in both Seek and position reporting after seek. Besides wrong position report it also played one buffered chunk of previous position after Seek.

Here's goes another build:
https://cirrus-ci.com/task/6670891743444992
Title: Re: AGS 3.6.0 - Beta 1
Post by: greg on Sun 27/03/2022 20:43:50
Thanks so much, CW!  That fixed the issues I was experiencing with GetPositionMs.

As I was testing further, I also noticed the following:

1. For audio clips of type MP3 and length < ~1.5 seconds, aClip.Play() plays the first 0.15-0.40 seconds of the sound and then stops.  In AGS 3.5.1, this occurred for MP3s under ~0.5 seconds, and my workaround was to convert to OGG.  In AGS 3.6, I'm observing it for MP3s up to 1.5 seconds.  This doesn't appear to affect MP3s over 2.5 seconds or OGGs.

2. The editor no longer automatically highlights matching braces as I type.  Instead, after typing the brace, I need to press Ctrl+B to highlight the corresponding brace.  Is that intended?

3. For the masks toggled by the Debug(2, n), is there a way to adjust their size (e.g. to make them full screen)?  I tried adjusting General Settings > Rooms > Default mask resolution, but it had no effect.
Title: Re: AGS 3.6.0 - Beta 1
Post by: Crimson Wizard on Sun 27/03/2022 21:22:38
Quote from: greg on Sun 27/03/2022 20:43:50
3. For the masks toggled by the Debug(2, n), is there a way to adjust their size (e.g. to make them full screen)?

I cannot guess what does this mean, are they not overlaying correctly? Could you post a screenshot?

Quote from: greg on Sun 27/03/2022 20:43:50
I tried adjusting General Settings > Rooms > Default mask resolution, but it had no effect.

This setting means the mask's granularity relative to the room background, i.e. 1:1, 1:2 etc, the larger the second value is the less precise the mask is.
This affects every interaction with the mask: hotspot clicks, pathfinding on walkable area, and so on.
Title: Re: AGS 3.6.0 - Beta 1
Post by: greg on Sun 27/03/2022 22:10:09
Quote
3. For the masks toggled by the Debug(2, n), is there a way to adjust their size (e.g. to make them full screen)?

I cannot guess what does this mean, are they not overlaying correctly? Could you post a screenshot?

Sure, here's a screenshot: https://drive.google.com/file/d/1HK2B1U6ct4WUo2w1x2lAr-zaZBPLsxga/view?usp=sharing (https://drive.google.com/file/d/1HK2B1U6ct4WUo2w1x2lAr-zaZBPLsxga/view?usp=sharing)

The mask is in the top-left quarter of the screen.  I'm trying to make it full-screen, as in 3.5.1.
Title: Re: AGS 3.6.0 - Beta 1
Post by: Crimson Wizard on Sun 27/03/2022 22:34:52
Quote from: greg on Sun 27/03/2022 22:10:09
Sure, here's a screenshot: https://drive.google.com/file/d/1HK2B1U6ct4WUo2w1x2lAr-zaZBPLsxga/view?usp=sharing (https://drive.google.com/file/d/1HK2B1U6ct4WUo2w1x2lAr-zaZBPLsxga/view?usp=sharing)

The mask is in the top-left quarter of the screen.  I'm trying to make it full-screen, as in 3.5.1.

I'm thinking that this error happens if mask resolution in the room is 1:2, half of the background size, and engine forgets to scale the debug image to the room's size.
Title: Re: AGS 3.6.0 - Beta 1
Post by: Stranga on Sun 27/03/2022 23:53:53
Thanks, @CrimsonWizard for the fix and for finding that script mistake too, all fixed and working perfectly!
Title: Re: AGS 3.6.0 - Beta 1
Post by: Crimson Wizard on Mon 28/03/2022 02:54:42
@greg, I think i fixed the debug overlay here:
https://cirrus-ci.com/task/4631982184333312
Title: Re: AGS 3.6.0 - Beta 1
Post by: greg on Mon 28/03/2022 03:23:57
Quote@greg, I think i fixed the debug overlay here:

Yep, that fixed the debug overlay issue. Thank you!
Title: AGS 3.6.0 - Beta 1
Post by: Hobbes on Thu 31/03/2022 15:29:28
Woohoo! Updated just now. Thank you so much for this! I've been quietly updating from every 3.6.0 alpha version and great to see we're in beta. My game's working & compiling great! (Mac M1 native even, very excited!)
Title: Re: AGS 3.6.0 - Beta 2
Post by: Crimson Wizard on Fri 01/04/2022 00:23:21
Updated to Beta 2
(use download links in the first post)

Editor:
- Fixed saving of 16-bit sprites with "Sprite storage optimization" enabled.

Script API:
- Extended Button.Animate() to have blocking style, direction and starting frame parameters.

So now it is
Code (ags) Select
Button.Animate(int view, int loop, int delay, RepeatStyle=eOnce, BlockingStyle=eNoBlock, Direction=eForwards, int frame=0);
Note that the default value for BlockingStyle is eNoBlock, unlike for characters and objects, because historically button animations were nonblocking.

Engine:
- In the new key input mode, only key state is only updated once a game frame. This prevents situations when, for example, calling IsKeyPressed during one script callback may return different results without explicit engine updates (Wait calls) in between.
As one of the consequences, this means that the following code will no longer work:
Code (ags) Select

while (!IsKeyPressed(eKeySpace)) { }

And must be:
Code (ags) Select

while (!IsKeyPressed(eKeySpace)) { Wait(1); }


- 24-bit wav PCM support, comes with the new sound library.
- Fixed repeatedly execute callback was called numerous times in one frame right after any blocking action.
- Fixed some mp3 sounds were not playing a bit of sound in the end.
- Fixed AudioChannel.Position return value was incorrect right after successful Seek.
- Fixed 1 extra chunk of sound from the old position could be played after Seek.
- Fixed room debug overlays were not scaled properly if room masks resolution is other than 1:1.
- Fixed missing log group letter id for "script" ('s') used in config and command line.
Title: Re: AGS 3.6.0 - Beta 2
Post by: vga256 on Fri 01/04/2022 20:21:43
Excellent news. Thanks CW, eri0o and team!
Title: Re: AGS 3.6.0 - Beta 2
Post by: FanOfHumor on Sat 09/04/2022 06:27:12
Is the number of objects per room increased in this version?
Title: Re: AGS 3.6.0 - Beta 2
Post by: Crimson Wizard on Sat 09/04/2022 14:42:53
Quote from: Pajama Sam on Sat 09/04/2022 06:27:12
Is the number of objects per room increased in this version?

No, I would have noted that in the changes.

Maybe i could look into increasing it while this version is still in beta; but right now I'm busy on some perfomance improvements, so maybe later...
Title: Re: AGS 3.6.0 - Beta 2
Post by: vga256 on Mon 11/04/2022 17:04:00
Found a new bug in 3.6.0b2 - labels no longer "pass through" clicks to GUI elements below (lower z-order), even though their "Enabled" and "Clickable" properties are set to false (you also get the same behaviour when Enabled is true). Demo project here (https://vga256.com/ags/test-label-gui.zip). Drag away the label from the button to make the button function again. Drag label back over top of button to block clicks.
Title: Re: AGS 3.6.0 - Beta 2
Post by: Crimson Wizard on Mon 11/04/2022 18:37:17
Quote from: vga256 on Mon 11/04/2022 17:04:00
Found a new bug in 3.6.0b2 - labels no longer "pass through" clicks to GUI elements below (lower z-order), even though their "Enabled" and "Clickable" properties are set to false (you also get the same behaviour when Enabled is true).

Fixed, should be available as this temp build here (when it finishes building):
https://cirrus-ci.com/task/5006924272893952
Title: Re: AGS 3.6.0 - Beta 2
Post by: vga256 on Mon 11/04/2022 19:26:27
Works great. Thanks for the quick fix CW.
Title: Re: AGS 3.6.0 - Beta 2
Post by: Eon_Star on Fri 15/04/2022 17:11:27
Hi, I did test it works fine. Maybe you should add the mirror function under the hotspot options and the region sound property or options. Would do great. Thanks guys.
Title: Re: AGS 3.6.0 - Beta 2
Post by: Crimson Wizard on Fri 15/04/2022 17:23:47
Quote from: Eon_Star on Fri 15/04/2022 17:11:27
Maybe you should add the mirror function under the hotspot options and the region sound property or options.

Please elaborate?
Title: Re: AGS 3.6.0 - Beta 2
Post by: Eon_Star on Fri 15/04/2022 21:01:03
Hi, I mean maybe the under the hotspot options or region options (property window), there could be some functions to make a mirror from the hotspot. For example "Ä°s hotspot a mirror? true / false" and "Which region number ?  Region number : 1". Of course inside the room the right hotspot and region should be selected.

And inside the region properities we may choose, if there is a walk sound for the specified region number, like "Walk sound : True/ False", "Character Name : cEgo" "Walk sound number: 1". Something like that. A different sound for each region, when character walk on those regions.

Thanks for considering.
Title: Re: AGS 3.6.0 - Beta 2
Post by: vga256 on Fri 15/04/2022 22:15:37
Quote from: Eon_Star on Fri 15/04/2022 21:01:03
Hi, I mean maybe the under the hotspot options or region options (property window), there could be some functions to make a mirror from the hotspot. For example "Ä°s hotspot a mirror? true / false" and "Which region number ?  Region number : 1". Of course inside the room the right hotspot and region should be selected.

And inside the region properities we may choose, if there is a walk sound for the specified region number, like "Walk sound : True/ False", "Character Name : cEgo" "Walk sound number: 1". Something like that. A different sound for each region, when character walk on those regions.

Thanks for considering.

This seems like functionality that not be added in-engine, but via scripting. Recommendation: Add a Custom Property (-> Room -> Properties ... -> Edit Schema -> R-Click and Add New Property) called "IsMirror" or "Mirror" of Boolean type. Add a checkmark for Hotspots. Then this can be checked/set in your Room script via hHotspotWhatever.GetProperty("Mirror") and SetProperty("Mirror"). The same can be done for Walk sounds in specified Walkable Areas.
Title: Re: AGS 3.6.0 - Beta 2
Post by: Crimson Wizard on Fri 15/04/2022 22:27:20
Quote from: Eon_Star on Fri 15/04/2022 21:01:03
Hi, I mean maybe the under the hotspot options or region options (property window), there could be some functions to make a mirror from the hotspot. For example "Ä°s hotspot a mirror? true / false" and "Which region number ?  Region number : 1". Of course inside the room the right hotspot and region should be selected.

Are you speaking of making a visual effect that shows the character in a mirror?

This is of course not a problem of adding a property, but a much bigger problem of designing and coding such feature. Something like that has to be thoroughly planned first (what is expected from this function, how it is implemented technically, and so on). It's not even clear what should be shown in such "mirror", as the AGS rooms are not 3D, and engine has no idea about perspective, and objects opposing a "mirror".

Personally, I think in 2D games effects like that are better done with a script. Right now the mirror may be scripted, for example, using second character hiding under walk-behinds and showing in a certain gap. That's much easier to script such custom effect in a couple of rooms, rather than figuring out how to make a universal mirror function in the engine, that would suit everyone.


On the other hand, the region (or rather walkable area?) sounds seem like something that may be considered in the future, as right now game authors have to edit view frame sounds at runtime to achieve different walking sounds. Or at least something that would help to script this easier. Again, this is something that has to be thought through very well, there will be number of questions on how to do this, as sounds have to be played on particular animation frames only, and different sounds may be wanted for different characters.
Title: Re: AGS 3.6.0 - Beta 2
Post by: Eon_Star on Fri 15/04/2022 23:11:22
Thanks Crimson Wizard.

Maybe the mirror plugin could be inserted somehow as a property option. But I think the AGS came a long way already.

Thanks for your efforts.

;)

Title: Re: AGS 3.6.0 - Beta 3
Post by: Crimson Wizard on Sat 16/04/2022 06:44:42
Updated to Beta 3
(use download links in the first post)

Common:
- Discontinued "Windows Game Explorer" support in both Editor and Engine.

Editor:
- Editor will now create an empty spriteset file (acsprset.spr) if one is missing in the game project. Any existing sprite descriptions in the project will be kept, letting user to reimport these from sources.
- Added "File -> Restore all sprites from sources" menu command.
- Added "Apply" button on editor's Preferences dialog.
- Fixed blank rooms not assigned a default mask resolution.

Script API:
- Added GUIControl.Transparency property. This lets change individual transparency to any gui controls.
- Made Overlay.Width and Height properties settable, that let you freely scale existing Overlay.
- Added readonly Overlay.GraphicWidth and GraphicHeight properties that let read original overlay's graphic size (in exchange for Overlay.Width and Height).

Engine:
- Engine now renders GUI controls as separate textures when using hardware accelerated renderers. This may significantly improve perfomance in the high-resolution games and games with large number of GUI elements on screen.
- Fixed on_key_press not called sometimes.
- Fixed special engine key combos not working if the new style key handling was on.
- Fixed non-clickable controls stealing mouse clicks.
- Fixed ListBox items drawn over scrollbar in gui clipping mode.
- Fixed TextBox duplicating letter input.
- Fixed 16-bit sprite pixel corruption in 32-bit games.

Linux:
- Fixed engine failing to find game data in paths other than current working dir.
Title: Re: AGS 3.6.0 - Beta 3
Post by: vga256 on Sat 16/04/2022 19:55:04
There appears to be a bug with b3, or a change in implementation that has rendered my BackgroundImages for GUIs to be completely transparent (or non-existent, not sure which). I can confirmed that all of my GUI windows have a proper BackgroundImage set. This was working fine with b2. Am I missing something obvious?

(FWIW - the Modem Dialer window uses a button with a background image as a background, not a GUI.BackgroundImage, which is why it appears correct)

Screenshot:
(https://vga256.com/ags/guis.png)
Title: Re: AGS 3.6.0 - Beta 3
Post by: Crimson Wizard on Sat 16/04/2022 19:58:39
Quote from: vga256 on Sat 16/04/2022 19:55:04
There appears to be a bug with b3, or a change in implementation that has rendered my BackgroundImages for GUIs to be completely transparent (or non-existent, not sure which). I can confirmed that all of my GUI windows have a proper BackgroundImage set. This was working fine with b2. Am I missing something obvious?

(FWIW - the Modem Dialer window uses a button with a background image as a background, not a GUI.BackgroundImage, which is why it appears correct)

Screenshot:

Please, can you give have some info about the game: color depth, which renderer do you run, and so on?

EDIT: actually yes, it does not work and displays a black rectangle instead of the image. This version is not working, I will have to fix and re-release.

EDIT2 it happens with some GUI but not the others, I am not exactly sure why yet.
Title: Re: AGS 3.6.0 - Beta 3
Post by: vga256 on Sat 16/04/2022 20:07:36
Game is in 32-bit mode (sprites are imported in 32 bit mode as well), and behaviour is consistent across all renderers (OpenGL/D3D9/SDL2).
GUI Alpha rendering style: proper alpha blending
GUI controls clip their contents: false
Pixel-perfect click detection: true
Sprite alpha rendering style: proper alpha blending
When player interface is disabled, GUIs should: Display normally

I re-imported the affected background images just in case there was a problem with the sprite file, but this had no effect. Background displays properly in-Editor.

Update: I have https://vga256.com/ags/test-noguibg.zip (https://vga256.com/ags/test-noguibg.zip) created a demo project for your convenience here which has a white background PNG image used for the GUI.
Title: Re: AGS 3.6.0 - Beta 3
Post by: Crimson Wizard on Sat 16/04/2022 20:13:05
This happens if the image has an alpha channel.
Title: Re: AGS 3.6.0 - Beta 3
Post by: Crimson Wizard on Sat 16/04/2022 20:45:03
@vga256, here's the engine with a fix, please tell if it works:
https://www.dropbox.com/s/0lnc6banecf0nti/acwin--3.6.0-beta3-guifix.zip?dl=0
Title: Re: AGS 3.6.0 - Beta 3
Post by: vga256 on Sat 16/04/2022 20:50:44
Quote from: Crimson Wizard on Sat 16/04/2022 20:45:03
@vga256, here's the engine with a fix, please tell if it works:
https://www.dropbox.com/s/0lnc6banecf0nti/acwin--3.6.0-beta3-guifix.zip?dl=0

Yep, that fixed it. Thanks!
Title: Re: AGS 3.6.0 - Beta 3
Post by: Crimson Wizard on Sat 16/04/2022 20:55:54
We definitely need more testers. This mistake was made by a most recent change which I forgot to double check with all possible variants. Too bad that I dont have a good test game which would group similar functionality, like everything related to GUIs.
Or perhaps I should post temporary builds here to let someone try, instead of making a release?
Title: Re: AGS 3.6.0 - Beta 3
Post by: vga256 on Sat 16/04/2022 21:10:17
Happy to test out new early 3.6.x builds for you as I am using it exclusively. (Or can just send you my current AGS project which is extremely GUI-heavy).
Title: Re: AGS 3.6.0 - Beta 3
Post by: Crimson Wizard on Sat 16/04/2022 22:09:32
Please note: the Beta 3 has been reuploaded with a fix

The download links are all the same. I apologize for inconvenience.

Did this mostly because this was found within 24 hours; for any further problems i'd be making new releases as proper.
Title: Re: AGS 3.6.0 - Beta 3
Post by: FanOfHumor on Sun 17/04/2022 03:35:55
Not that I like to harp on this but do you think you might soon allow dragging folders in the sprite menu?If i'm being annoying just say the word and i'll zip my lip. :X
Title: AGS 3.6.0 - Beta 3
Post by: Hobbes on Sun 17/04/2022 03:52:37
Updated to latest beta yet again! So far, things seem to be running smoothly on my end. Once we're out of beta, I'm happy to compile an empty MacOS AGS (Silicon & Intel) application for people to stick their games into. I've got them right now, but not much use for the wider community I think, since we're in beta.

Keep up the great work! (As always)
Title: Re: AGS 3.6.0 - Beta 3
Post by: eri0o on Sun 17/04/2022 04:11:48
Hey Hobbes, can you test if the binary here works for you? https://cirrus-ci.com/task/6135298751987712 (it's the one named ags, the others are unreleased things for now)
Title: Re: AGS 3.6.0 - Beta 3
Post by: Crimson Wizard on Sun 17/04/2022 04:14:13
Quote from: Pajama Sam on Sun 17/04/2022 03:35:55
Not that I like to harp on this but do you think you might soon allow dragging folders in the sprite menu?

Do you mean dragging around the list, or drag & drop whole folders from the file explorer to import sprites?
Title: Re: AGS 3.6.0 - Beta 3
Post by: abstauber on Sun 17/04/2022 22:39:53
I just started porting my quite old game project from AGS 3.4 to 3.6b3.

It already compiles, but crashes with the following exception.
Since I replaced a lot of Viewports and System.ScreenHeights, I can't exactly tell you, what did cause this crash.


An exception 0xC0000094 occurred in ACWIN.EXE at EIP = 0x0050A95E; program pointer is +373, ACI version 3.6.0.23, gtags (663,20)



I hope it still somewhat helps.
Title: Re: AGS 3.6.0 - Beta 3
Post by: Crimson Wizard on Sun 17/04/2022 23:25:11
Quote from: abstauber on Sun 17/04/2022 22:39:53

An exception 0xC0000094 occurred in ACWIN.EXE at EIP = 0x0050A95E; program pointer is +373, ACI version 3.6.0.23, gtags (663,20)


0xC0000094 is "division by zero". "program pointer is +373" is around the gui controls drawing. I think "gtags" should contain ID.

Does it still crash? If yes, may I have a compiled game for a test?

EDIT: Hmm, the only suspicious division i could find is in Slider, when MaxValue - MinValue = 0
Title: Re: AGS 3.6.0 - Beta 3
Post by: abstauber on Sun 17/04/2022 23:40:52
I've just PM'ed the link to the project. It could also be very possible that I did something stupid, as I haven't spent much time porting the code yet.
Oh and the keyboard controls seem to be different now too. At least the arrow keys don't work anymore.
Thanks for looking into this.
Title: Re: AGS 3.6.0 - Beta 3
Post by: Crimson Wizard on Mon 18/04/2022 00:00:34
Quote from: abstauber on Sun 17/04/2022 23:40:52
I've just PM'ed the link to the project. It could also be very possible that I did something stupid, as I haven't spent much time porting the code yet.

The above is not a scripting mistake, but a engine error. Program should not crash like that even if script is wrong.

Quote from: abstauber on Sun 17/04/2022 23:40:52
Oh and the keyboard controls seem to be different now too. At least the arrow keys don't work anymore.

If the "General Settings -> Backwards Compatibility -> Use old-style key handling" is set to true, then nothing should change; so there may be a engine bug too.
Title: Re: AGS 3.6.0 - Beta 3
Post by: FanOfHumor on Mon 18/04/2022 02:27:49
QuoteDo you mean dragging around the list, or drag & drop whole folders from the file explorer to import sprites?
Yes ,I meant to say to drag and drop whole folders within  the sprite panel(as in to be able to organize the sprite folders).
Title: Re: AGS 3.6.0 - Beta 3
Post by: Crimson Wizard on Mon 18/04/2022 04:39:02
Quote from: abstauber on Sun 17/04/2022 22:39:53

An exception 0xC0000094 occurred in ACWIN.EXE at EIP = 0x0050A95E; program pointer is +373, ACI version 3.6.0.23, gtags (663,20)



So, this happens when any gui control has width or height = 0.
There's a temp fixed build here (installer and archive):
https://cirrus-ci.com/task/4575886656667648
Title: Re: AGS 3.6.0 - Beta 3
Post by: abstauber on Mon 18/04/2022 07:37:11
Thanks, this fixed it!
There's still a lot not working, but nothing crashes anymore :)
So  I guess it would be safe to port everything to 3.5 first and once it all works I move it over to 3.6 to actually identify bugs.


edit: yep, the game is also sort of broken in AGS 3.5. So I'll fix that first and report things here later.
Title: Re: AGS 3.6.0 - Beta 3
Post by: abstauber on Mon 18/04/2022 21:13:13
The new editor seems to have trouble switching themes when code is already being displayed.
This also happens with Visual Studio Dark.


Code (ags) Select
---------------------------
Adventure Game Studio
---------------------------
Something went wrong when trying to apply color theme AGS-Dracula-0.2. The editor will set the color theme back to the default theme and continue as normal, however it may not look right until the next time you restart the editor. See stack trace for more details.

System.NullReferenceException: Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt.

   bei AGS.Editor.ColorThemeJson.GetJToken(String id, JObject json)

   bei AGS.Editor.ColorThemeJson.DoTransform[T](String id, Func`2 transform)

   bei AGS.Editor.ColorThemeJson.GetColor(String id)

   bei AGS.Editor.ScintillaWrapper.LoadColorTheme(ColorTheme t)

   bei AGS.Editor.ColorThemes.Apply(Action`1 apply)
---------------------------
OK   
---------------------------
Title: Re: AGS 3.6.0 - Beta 3
Post by: eri0o on Mon 18/04/2022 22:44:46
making a fix for it...

Edit: it's here: https://cirrus-ci.com/task/6233116699262976
Title: Re: AGS 3.6.0 - Beta 3
Post by: abstauber on Tue 19/04/2022 07:47:25
Nice, that was fast :)
Title: Re: AGS 3.6.0 - Beta 3
Post by: Dualnames on Sat 23/04/2022 21:49:35
I'm getting the following error [trying to move Strangeland to 3.6.0:


Error: parsing "Rotta bezieht sich auf die Wortherkunft, die buchstäblich \"Fleisch erheben\" (oder \"wegnehmen\") bedeutet. Die Anspielung geht bei der Übersetzung etwas verloren: Der Vergnügungspark heißt im Englischen "\Carnival\" (\"Karneval\"), was im Deutschen lediglich Feierlichkeiten beschreibt, mit denen das Ende der Fastenzeit begangen wird." - Unrecognized escape sequence \C.
Version: AGS 3.6.0.23

System.ArgumentException: parsing "Rotta bezieht sich auf die Wortherkunft, die buchstäblich \"Fleisch erheben\" (oder \"wegnehmen\") bedeutet. Die Anspielung geht bei der Übersetzung etwas verloren: Der Vergnügungspark heißt im Englischen "\Carnival\" (\"Karneval\"), was im Deutschen lediglich Feierlichkeiten beschreibt, mit denen das Ende der Fastenzeit begangen wird." - Unrecognized escape sequence \C.
   at System.Text.RegularExpressions.RegexParser.ScanCharEscape()
   at System.Text.RegularExpressions.RegexParser.Unescape(String input)
   at System.Text.RegularExpressions.Regex.Unescape(String str)
   at AGS.Editor.Components.TranslationsComponent.CompileTranslation(Translation translation, CompileMessages errors)
   at AGS.Editor.Components.TranslationsComponent.AGSEditor_PreCompileGame(PreCompileGameEventArgs evArgs)
   at AGS.Editor.AGSEditor.PreCompileGameHandler.Invoke(PreCompileGameEventArgs evArgs)
   at AGS.Editor.AGSEditor.CompileGame(Boolean forceRebuild, Boolean createMiniExeForDebug)
   at AGS.Editor.Components.BuildCommandsComponent.TestGame(Boolean withDebugger)
   at AGS.Editor.Components.BuildCommandsComponent.CommandClick(String controlID)
   at AGS.Editor.GUIController._mainForm_OnMenuClick(String menuItemID)
   at AGS.Editor.MainMenuManager.MenuEventHandler(Object sender, EventArgs e)
   at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
   at System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)
   at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
   at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
   at System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
   at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
   at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
   at System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   at System.Windows.Forms.ToolStrip.WndProc(Message& m)
   at System.Windows.Forms.ToolStripDropDown.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


Any thoughts?
Title: Re: AGS 3.6.0 - Beta 3
Post by: Crimson Wizard on Sat 23/04/2022 22:09:36
Quote from: Dualnames on Sat 23/04/2022 21:49:35
I'm getting the following error [trying to move Strangeland to 3.6.0:

The error message mentions: "Unrecognized escape sequence \C"

Here's the part of the text which seem to be causing the problem:
Quote
Vergnügungspark heißt im Englischen "\Carnival\" (\"Karneval\")


What is wrong is that it displays this as an exception, meaning program fails to catch this in time and display as a regular error message.
Title: Re: AGS 3.6.0 - Beta 3
Post by: Dualnames on Sat 23/04/2022 22:43:42
So, can I do anything to fix it myself?
Title: Re: AGS 3.6.0 - Beta 3
Post by: Crimson Wizard on Sat 23/04/2022 23:10:17
Quote from: Dualnames on Sat 23/04/2022 22:43:42
So, can I do anything to fix it myself?

From what I understand this seem to be a mistake in translation file (trs), perhaps you may search for the mentioned line and fix the incorrect escape sequence there.
Title: Re: AGS 3.6.0 - Beta 3
Post by: tilapisha on Sun 24/04/2022 00:35:09
I'm trying to port my game from 3.5.18 to 3.6.0 (Beta 3) so that I can port it to web.

I'm getting this error (and some of the sprites, inventory items and other characters are split). Also, some objects are drawn a bit off (like this mirror) but this is easy enough to move.

(https://ibb.co/tHSsrNp)
https://ibb.co/tHSsrNp (https://ibb.co/tHSsrNp)

---------------------------
Illegal exception
---------------------------
An exception 0xC0000005 occurred in ACWIN.EXE at EIP = 0x00427447; program pointer is  3330, ACI version 3.6.0.23, gtags (2,71)

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 "room1.asc", line 51


Most versions of Windows allow you to press Ctrl C now to copy this entire message to the clipboard for easy reporting.

An error file CrashInfo.dmp has been created. You may be asked to upload this file when reporting this problem on the AGS Forums. (code 0)
---------------------------
OK  
---------------------------

This is my line 51:
function oSuit_AnyClick()
{
  cGoby.Say("I'm waiting for a special occasion to wear this."); //51
  oSuit.Visible = false;
  player.AddInventory(iSuit);
}


Also, my sprites are imported very oddly. I can go through and replace but it seems tedious.

https://ibb.co/drkjc3h
Title: Re: AGS 3.6.0 - Beta 3
Post by: Crimson Wizard on Sun 24/04/2022 00:49:02
Quote from: tilapisha on Sun 24/04/2022 00:35:09
I'm trying to port my game from 3.5.18 to 3.6.0 (Beta 3) so that I can port it to web.

I'm getting this error (and some of the sprites, inventory items and other characters are split). Also, some objects are drawn a bit off (like this mirror) but this is easy enough to move.

You were posting a link to repository with the game couple of days ago. Will I get these errors if I try the latest version?
"program pointer is  3330" refers to the character drawing, something may be wrong with the character view perhaps.

Quote from: tilapisha on Sun 24/04/2022 00:35:09some of the sprites, inventory items and other characters are split

Could you specify which sprites exactly; does this happen in the editor or only in game?

EDIT: I tried your game from the repository, and it seems to run fine in the latest 3.6.0...
Title: Re: AGS 3.6.0 - Beta 3
Post by: tilapisha on Sun 24/04/2022 03:34:43
I fixed it by reimporting all of my sprites.
Title: Re: AGS 3.6.0 - Beta 3
Post by: Dualnames on Sun 24/04/2022 05:06:10
But there's nothing wrong there per se, and the translation works fine on 3.5.1.7.
3.6.0 seems to hate it for some reason I can't fathom.


Rotta bezieht sich auf die Wortherkunft, die buchstäblich \"Fleisch erheben\" (oder \"wegnehmen\") bedeutet. Die Anspielung geht bei der Übersetzung etwas verloren: Der Vergnügungspark heißt im Englischen "\Carnival\" (\"Karneval\"), was im Deutschen lediglich Feierlichkeiten beschreibt, mit denen das Ende der Fastenzeit begangen wird.
Title: Re: AGS 3.6.0 - Beta 3
Post by: Crimson Wizard on Sun 24/04/2022 05:12:02
Quote from: Dualnames on Sun 24/04/2022 05:06:10
But there's nothing wrong there per se, and the translation works fine on 3.5.1.7.
3.6.0 seems to hate it for some reason I can't fathom.

Hmm, sorry, probably I was not clear enough; following is a incorrect place:
QuoteVergnügungspark heißt im Englischen "\Carnival\" (\"Karneval\")
This should be
QuoteVergnügungspark heißt im Englischen \"Carnival\" (\"Karneval\")

The escape parsing rules (parsing \x combinations) became more strict in the new version.
Title: Re: AGS 3.6.0 - Beta 3
Post by: Dualnames on Mon 25/04/2022 03:53:45
Alright, we're past that, now a different issue has risen!

[proper alpha blending seems to be somewhat broken]
Specifically on UI Buttons, instead of them [their graphic, which is a usually a png with alpha transparency] being displayed, they're not [they are fully transparent, as if their sprite is 0].

Even if on the editor they are displayed properly.
Title: Re: AGS 3.6.0 - Beta 3
Post by: Dualnames on Mon 25/04/2022 04:06:47
On a different note, I'm also now getting this exception.

https://i.ibb.co/sjsd0hf/image.png
Title: Re: AGS 3.6.0 - Beta 3
Post by: Crimson Wizard on Mon 25/04/2022 09:37:11
Quote from: Dualnames on Mon 25/04/2022 03:53:45
[proper alpha blending seems to be somewhat broken]
Specifically on UI Buttons, instead of them [their graphic, which is a usually a png with alpha transparency] being displayed, they're not [they are fully transparent, as if their sprite is 0].

Please try this build:
https://cirrus-ci.com/task/6113420188581888

Quote from: Dualnames on Mon 25/04/2022 04:06:47
On a different note, I'm also now getting this exception.
https://i.ibb.co/sjsd0hf/image.png

Division by zero, while drawing some gui control (gtags mean GUI ID, iirc). There was a bug fixed recently, related to controls with zero size. Please try above build as well; if not, then this should be investigated further for more details.

PS. I will try posting a new proper update later today.
Title: Re: AGS 3.6.0 - Beta 4
Post by: Crimson Wizard on Mon 25/04/2022 12:42:30
Updated to Beta 4
(use download links in the first post)

Editor:
- Fixed room editor was suggesting to save the modified room even if no changes were made.
- Fixed room preview not updating after changing object properties.
- Fixed changing theme when script editor is open causes error.
- Fixed any errors during translation compilation were causing unhandled exception in the editor.

Engine:
- Fixed sprites with alpha transparency and anti-aliased texts not displayed correctly on GUI.
- Fixed crash when gui control has zero size.
- Fixed potential crash when gui slider is less than 4 pixels wide or tall.

Windows:
- Installer will create program links with three-digit version in the name.
Title: Re: AGS 3.6.0 - Beta 4
Post by: vga256 on Tue 26/04/2022 22:07:37
Can anyone else confirm if AudioChannel.Panning is not working for them with 3.6.0? Demo files here (https://vga256.com/ags/audiotest.zip). Unless I've made some obvious basic mistake with scripting, I'm not getting any kind of audio panning regardless of the int (-100,100) passed to AudioChannel.Panning. Replicated the same behaviour in TweenPanning which uses this function as well.
Title: Re: AGS 3.6.0 - Beta 4
Post by: Dualnames on Wed 27/04/2022 05:24:42
The transparency issue still remains, the exception is solved so yay!
Title: Re: AGS 3.6.0 - Beta 4
Post by: Crimson Wizard on Wed 27/04/2022 06:39:17
Quote from: Dualnames on Wed 27/04/2022 05:24:42
The transparency issue still remains

Could you give more details about this issue? An example of sprite, the gui settings, etc?


Quote from: vga256 on Tue 26/04/2022 22:07:37
Can anyone else confirm if AudioChannel.Panning is not working for them with 3.6.0? Demo files here (https://vga256.com/ags/audiotest.zip). Unless I've made some obvious basic mistake with scripting, I'm not getting any kind of audio panning regardless of the int (-100,100) passed to AudioChannel.Panning. Replicated the same behaviour in TweenPanning which uses this function as well.

Yes, Panning is not working within the sound library again (not sure if it worked before).

EDIT: It's confirmed that with the new sound library the Panning does not work for stereo clips, only works for mono clips, allegedly according to the OpenAL specification.
We need to investigate of the available solutions.
Opened ticket: https://github.com/adventuregamestudio/ags/issues/1637

EDIT2 According to the OpenAL specs:
https://openal.org/documentation/OpenAL_Programmers_Guide.pdf (page 21)
Quote
Buffers containing more than one channel of data will be played without 3D spatialization.
This basically means that stereo wave is not positioned by OpenAL in 3D space, only mono wave is.
Title: Re: AGS 3.6.0 - Beta 4
Post by: eri0o on Wed 27/04/2022 10:46:23
The library we are using is for 3D positional audio, I linked in the issue a discussion that explains it a bit more.
Title: Re: AGS 3.6.0 - Beta 4
Post by: Dualnames on Wed 27/04/2022 13:09:10
(https://i.ibb.co/9YmsmDv/cw1.png%5D)

The sprite in question is this. Sprite 3819 is used as a normal graphic in a button. In general it seems to be weird because there are other UIs that appear on top of this UI [the top UIs get rendered [they are mostly transparent, but the UI that contains this button, doesn't really get rendered or is partially rendered].

I can take a video if it helps.
Title: Re: AGS 3.6.0 - Beta 4
Post by: Crimson Wizard on Wed 27/04/2022 13:19:45
Quote from: Dualnames on Wed 27/04/2022 13:09:10
I can take a video if it helps.

It would actually help if I could get this sprite (or any other sprite that causes this problem) and exact gui setup it's used on; this would let me investigate the situation closely.

EDIT: ok, since I can see the import settings, then perhaps i could make a sprite myself. But I'd really need to know GUI setup.
Title: Re: AGS 3.6.0 - Beta 4
Post by: Dualnames on Wed 27/04/2022 15:53:55
That'd be more complex to explain and would take more of your time [meaning we'd be lost in translation], I can rar the game files, if that helps? It's a big project in size.

EDIT: I could try thinning out the project, as well, so it's easier to send out, let me do that.
Title: Re: AGS 3.6.0 - Beta 4
Post by: eri0o on Wed 27/04/2022 17:24:45
Can't you right click on the project explorer and simply export the GUI?

(And then load an empty project and import it and then place the resulting project here...)
Title: Re: AGS 3.6.0 - Beta 4
Post by: Crimson Wizard on Wed 27/04/2022 18:34:20
Quote from: Dualnames on Wed 27/04/2022 15:53:55
That'd be more complex to explain and would take more of your time [meaning we'd be lost in translation], I can rar the game files, if that helps? It's a big project in size.

EDIT: I could try thinning out the project, as well, so it's easier to send out, let me do that.

So, this is happening because button moves, and the latest engine has a mistake when it does not update the control's texture position, so it stays hidden behind the screen.
Title: Re: AGS 3.6.0 - Beta 4
Post by: Crimson Wizard on Wed 27/04/2022 20:58:58
@Dualnames, please try this temp build:
https://cirrus-ci.com/task/5782450277187584
Title: Re: AGS 3.6.0 - Beta 4
Post by: Dualnames on Thu 28/04/2022 05:08:17
That works on the testing build, checking the main build also works yay!
Title: Re: AGS 3.6.0 - Beta 4
Post by: Dave Gilbert on Thu 28/04/2022 18:20:27
Hello! Loving the latest beta so far, although I've uncovered a pretty major bug. :(

I use several struct arrays where I store various data. One example: a struct containing characters and their view numbers for various costume changes. I propagate these structs at the beginning of the game by calling a function at game_start. ("setupCharacterInfo();"  in this example).

Filling up the structs with data works fine when the game first starts up, but if I load a saved game, the data just disappears. Calling the setup functions a second time under "eEventRestoreGame" fixes it, but I feel like this shouldn't be happening in the first place.

If you need any more information, please let me know!

-Dave


Title: Re: AGS 3.6.0 - Beta 4
Post by: Crimson Wizard on Thu 28/04/2022 18:25:27
Quote from: Dave Gilbert on Thu 28/04/2022 18:20:27
Filling up the structs with data works fine when the game first starts up, but if I load a saved game, the data just disappears. Calling the setup functions a second time under "eEventRestoreGame" fixes it, but I feel like this shouldn't be happening in the first place.

Was that save made after you configured these structs in your script or earlier?
Title: Re: AGS 3.6.0 - Beta 4
Post by: Dave Gilbert on Thu 28/04/2022 18:26:51
I configure the structs on game_start, so definitely after.
Title: Re: AGS 3.6.0 - Beta 4
Post by: Crimson Wizard on Thu 28/04/2022 20:17:40
So, we found that Strings in script are not saved properly.

Here's the fixed build:
https://cirrus-ci.com/task/5389912781357056
Title: Re: AGS 3.6.0 - Beta 4
Post by: Dave Gilbert on Thu 28/04/2022 20:29:49
Thanks! That fixed the problem.
Title: Re: AGS 3.6.0 - Beta 5
Post by: Crimson Wizard on Fri 06/05/2022 04:28:14
Updated to Beta 5
(use download links in the first post)

A bit unexpected, but this is suddenly a larger feature update, complementing improvements to Overlays in this version.
Additionally this update contains a way to set volume for the frame-linked sounds during animation (see below).
Normally this is not a good thing to add so much stuff while the version is already far in Beta, but some of these changes were in plans for 3.6.0 for a while now, and they appeared to be not too difficult to make. At the same time, I believe that's the last of the feature additions for 3.6.0 engine.

Editor:
- Fixed extracting room template files (other than the blank template).
- Fixed editor displaying unhandled exception if the room script which user is trying to open was missing. Instead it will now open a blank script.

Compiler:
- Support using float literals when defining default values for function arguments.

Script API:
- Extended all Animate() commands by adding "volume" parameter, that defines relative volume of the frame-linked sounds for the duration of this animation.
- Added Character.AnimationVolume, defining relative volume of the frame-linked sounds.
- Added Overlay.CreateRoomGraphical and CreateRoomTextual. Use these two functions to create "room overlays": that is - overlays that display a sprite inside the room, sorted among other room objects, characters and walk-behinds.
- Added readonly Overlay.InRoom property that tells if this is a room or screen overlay.
- Extended Overlay.CreateGraphical() with a new "clone" parameter that tells whether to assign a sprite index, or make a sprite's copy owned exclusively by this overlay. The former will save program memory but make overlay update if the sprite is edited later. The latter is meant primarily for backwards compatibility. Overlay.CreateRoomGraphical has the same param. Default is false (don't clone).
- Added Overlay.Graphic property that lets you change overlay's sprite after it's created.

Engine:
- Perfomance improvement to overlays: engine will not make a sprite copy when they are created whenever possible (non-dynamic sprites), or when told not to by the script command that creates a custom overlay.
- When reporting script errors, engine will print callstack for all the active script "threads": for example, if there's Wait() function called and error happened in repeatedly_execute_always, then it will print both actual error's location, and Wait() call's location.
- Added "load_latest_save" and "show_fps" options to config (in "[misc]" category).
- Fixed overlay may fail to be created sometimes, if previously another overlay had been forcefully removed when changing rooms (this is an ancient bug which existed for many years).
- Fixes GUI controls not getting redrawn in correct locations if they were moved at runtime.
- Fixed script's String type could be stored in game saves with a wrong length.
- Fixed Game.InputBox() duplicating key input if new key handling mode is active.



NOTES: On Overlays

So, from this update 3.6.0 allows to dynamically create overlays not only "on screen", among GUIs, but also inside rooms - among the characters and objects. Overlays still remain a simplistic kind of object that does not have any automated behavior, so it won't interact with anything inside the room, but it still may be sorted among other objects there by manually setting Overlay.ZOrder. So, for example, if you'd like room overlay to change its "baseline" along with its vertical position, you will have to do something like this in rep-exec:
Code (ags) Select
over.ZOrder = over.Y + over.Height;
In overall, I believe that room overlays open new possibilities in making temporary visual effects in the game, and also may help to script custom game elements from ground up (as they have no additional functionality on them).

On overlay's sprite cloning. This may not be well known, but for "historical reasons" (tm) overlays were doing a copy of the sprite when created. This was fine while overlays were limited to 20 in previous versions, but now when they are unlimited this could become an annoyance. So now, firstly, engine may decide when it is safe to not do a sprite copy (normally - when using regular non-dynamic sprites), and secondly Overlay.CreateGraphical now has an additional parameter which tells whether to make a copy of the sprite or not (not by default). This parameter may be used for backwards compatibility with some old scripts, where dynamic sprites are used to create an overlay and then discarded.

After the above change, it now makes sense to have Overlay.Graphic property, similar to Object.Graphic etc. This changes the overlay's sprite without having to recreate overlay.
Note that there's no Animate function for them, but you may script one yourself, using timers, and changing Overlay.Graphic.

NOTES: On Animation volume

Previously there was no way to choose the playback volume of sounds linked to the animation frames. The only related property was Character.ScaleVolume.
Now there are two ways to do this. First of all, there's Character.AnimationVolume. It sets the default relative volume of any frame sounds. For example, here's a primitive example of how you can make the footsteps volume depend on the character's X position in room:
Code (ags) Select
player.AnimationVolume = player.x * 100 / Room.Width;
Secondly, each Animate() function (for Button, Character and Object) now has a "volume" parameter. Passing -1 (default) will ignore this, but when a 0-100 value is passed, that value overrides the frame sound volume.

EDIT: hmm, i just realized that maybe Animate() should not override Character.AnimationVolume, but also be relative to it... According to the idea that character is "sound emitter" with it's volume and Animate() is playing an individual sequence, then the volume of the sequence should not be louder than the volume of the emitter?
Title: Re: AGS 3.6.0 - Beta 5
Post by: Crimson Wizard on Sun 08/05/2022 02:26:09
Started writing "Upgrade to 3.6.0" topic in the manual, in case someone needs an explanation on most noteable changes:
https://github.com/adventuregamestudio/ags-manual/wiki/UpgradeTo36
(work in progress)
Title: Re: AGS 3.6.0 - Beta 5
Post by: Dave Gilbert on Sun 15/05/2022 00:34:34
Hello! Noticing a problem with the searching feature.

Normally, when I do a search for a word or phrase in my script, I press "control-F", select "look in current project", and then press enter. I can click on the results and them I am taken to the point in the script where word/phrase resides.

However, it now only works properly when searching in a standard script. For dialog scripts (meaning dialog that is written in the dialog editor), it just opens up the dialog script without highlighting the search result. Here are examples:

(http://www.wadjeteyegames.com/temp/findSymbols-script.png)

(http://www.wadjeteyegames.com/temp/findSymbols-dialog.png)
Title: Re: AGS 3.6.0 - Beta 5
Post by: Crimson Wizard on Mon 16/05/2022 20:21:07
Quote from: Dave Gilbert on Sun 15/05/2022 00:34:34
Hello! Noticing a problem with the searching feature.

Normally, when I do a search for a word or phrase in my script, I press "control-F", select "look in current project", and then press enter. I can click on the results and them I am taken to the point in the script where word/phrase resides.

However, it now only works properly when searching in a standard script. For dialog scripts (meaning dialog that is written in the dialog editor), it just opens up the dialog script without highlighting the search result. Here are examples:


I tried this, and for me it finds the dialog line, but does not highlight it, just puts cursor there. Could you double check if that happens to you, or it does not even move to the line itself?
Title: Re: AGS 3.6.0 - Beta 5
Post by: Dave Gilbert on Mon 16/05/2022 21:41:27
Yes, you are correct. The cursor is put on the proper line, but when the script opens it is displayed at the beginning on the page. I have to press a key to jump down to where the cursor is.
Title: Re: AGS 3.6.0 - Beta 5
Post by: FanOfHumor on Thu 26/05/2022 19:15:15
I've been encountering an error" Undefined token overplay".Overplay is a function and is imported in overplay.ash but when I call it sometimes it works and sometimes it doesn't.I don't think theres anything wrong with how I placed the script although I could be wrong.I also encountered this same error for another function a few days ago.After a while it seemed to just fix itself with no changes done to it.
heres the .scm scripts
https://www.filemail.com/d/khuayqkknjpyaol (https://www.filemail.com/d/khuayqkknjpyaol)
Title: Re: AGS 3.6.0 - Beta 5
Post by: Crimson Wizard on Thu 26/05/2022 20:19:16
Quote from: Pajama Sam on Thu 26/05/2022 19:15:15
I've been encountering an error" Undefined token overplay".Overplay is a function and is imported in overplay.ash but when I call it sometimes it works and sometimes it doesn't.I don't think theres anything wrong with how I placed the script although I could be wrong.I also encountered this same error for another function a few days ago.After a while it seemed to just fix itself with no changes done to it.
heres the .scm scripts
https://www.filemail.com/d/khuayqkknjpyaol (https://www.filemail.com/d/khuayqkknjpyaol)

If this error happens during compilation, "Undefined token" means the script does not see the function. The usual case is that your module with function "overplay" is located below the module that tries to use it ("fishtank") in the list of modules. In AGS script modules can only see functions declared above them.
Title: Re: AGS 3.6.0 - Beta 5
Post by: Crimson Wizard on Thu 26/05/2022 21:02:06
About the Beta, I think we'll have another update soon, but because we haven't found any more critical bugs, and there are no more game features planned, we're taking time just doing less important fixes and improving some things.
Title: Re: AGS 3.6.0 - Beta 5
Post by: FanOfHumor on Thu 26/05/2022 21:13:06
QuoteIf this error happens during compilation, "Undefined token" means the script does not see the function. The usual case is that your module with function "overplay" is located below the module that tries to use it ("fishtank") in the list of modules. In AGS script modules can only see functions declared above them.
QuoteAbout the Beta, I think we'll have another update soon, but because we haven't found any more critical bugs, and there are no more game features planned, we're taking time just doing less important fixes and improving some things.
Oh ok.Thanks for letting me know. :)
Title: Re: AGS 3.6.0 - Beta 5
Post by: Baguettator on Sat 28/05/2022 16:41:17
Hi there !

I just tried the new version (beta 5), and I tried to change the text format in the general settings pannel : I switched from ANSII to UTF-8. As I'm french, with special characters like éàÉÈ I thought it was better do to that. But when I change the format, the game crashes during a function that "reads" some txt files. It seems the txt files can't be read, so the functions like ReadRawLineBack return an empty string (so it crashes in my function). These txt files are in UTF-8 format.

Any idea why it happens ?
Title: Re: AGS 3.6.0 - Beta 5
Post by: eri0o on Sat 28/05/2022 16:51:50
This is weird. Can you share a text file that causes the empty ReadRawLineBack ?
Title: Re: AGS 3.6.0 - Beta 5
Post by: Baguettator on Sat 28/05/2022 17:38:39
There it is ! :)

https://drive.google.com/file/d/15X6MnX3zM21rQhRtpn0nQ32GxrjLkL1U/view?usp=sharing
Title: Re: AGS 3.6.0 - Beta 5
Post by: Crimson Wizard on Sat 28/05/2022 23:25:15
Quote from: Baguettator on Sat 28/05/2022 16:41:17
I just tried the new version (beta 5), and I tried to change the text format in the general settings pannel : I switched from ANSII to UTF-8. As I'm french, with special characters like éàÉÈ I thought it was better do to that. But when I change the format, the game crashes during a function that "reads" some txt files. It seems the txt files can't be read, so the functions like ReadRawLineBack return an empty string (so it crashes in my function). These txt files are in UTF-8 format.

I made a new test game in UTF-8 format, and tried your file, and it worked well. Please post a script that crashes?

Here's a simple script i used:
Code (ags) Select

function room_AfterFadeIn()
{
File *f = File.Open("test.txt",eFileRead);
if (f == null) return;
while (!f.EOF) {
String s = f.ReadRawLineBack();
Display("%s", s);
}
}
Title: Re: AGS 3.6.0 - Beta 5
Post by: eri0o on Sat 28/05/2022 23:45:03
My guess is the location of the text file is incorrect... Where are you placing this file?

Also if this is going to be an internal game file, you can now since 3.6.0 package the file inside the game package and also read from it. More on this here (https://adventuregamestudio.github.io/ags-manual/UpgradeTo36.html#new-game-package-options).
Title: Re: AGS 3.6.0 - Beta 5
Post by: Baguettator on Sun 29/05/2022 09:28:43
Hmm, the file is located in the savegame directory (so in windows 10 : "saved games/[my game's directory]".

Here is the function that needs to read the file to save the attribute of something in the game (like a character for example) when the game is launching :

Code (ags) Select
File *f=File.Open("$SAVEGAMEDIR$/cartesinvasion.txt", eFileRead);
  int c=1;
  while (!f.EOF)
  {
    String s=f.ReadRawLineBack();
    if (c==n)
    {
      String t="";
      this.nom=LectureStringCustom(s, 1);
      t=LectureStringCustom(s, 2);
      this.famille=t.AsInt;
      t=LectureStringCustom(s, 3);
      this.valeur[0]=t.AsInt;
      t=LectureStringCustom(s, 4);
      this.typezombie[0]=t.AsInt;
      t=LectureStringCustom(s, 5);
      this.valeur[1]=t.AsInt;
      t=LectureStringCustom(s, 6);
      this.typezombie[1]=t.AsInt;
      t=LectureStringCustom(s, 7);
      this.valeur[2]=t.AsInt;
      t=LectureStringCustom(s, 8);
      this.typezombie[2]=t.AsInt;
      t=LectureStringCustom(s, 9);
      this.valeur[3]=t.AsInt;
      t=LectureStringCustom(s, 10);
      this.typezombie[3]=t.AsInt;
      t=LectureStringCustom(s, 11);
      if (t.AsInt==1) this.egouts=true;
      else this.egouts=false;
      t=LectureStringCustom(s, 12);
      if (t.AsInt==1) this.reactivation=true;
      else this.reactivation=false;
      t=LectureStringCustom(s, 13);
      if (t.AsInt==1) this.litsbleus=true;
      else this.litsbleus=false;
      t=LectureStringCustom(s, 14);
      if (t.AsInt==1) this.litsverts=true;
      else this.litsverts=false;
    }
    c++;
  }
  f.Close();


Here is the function that read the informations. Each information is separated in the file by a ";". So between each ";", there is 1 information.

Code (ags) Select
String LectureStringCustom(String s, int pos)
{
  String e=";";
  int r, rr;
  String nouvelle;
  for (int i=0 ; i<pos ; i++)
  {
    int p=s.IndexOf(e);
    if (i==pos-2) r=p+1;
    if (i==pos-1)
    {
      rr=p;
      nouvelle=s.Substring(r, rr-r); // Error indicates : String.Substring : invalid length
    }
    s=s.ReplaceCharAt(p, 'm');
  }
 
  return nouvelle;
}


I have to say that before I tried AGS 3.6 beta 5 (I was before on AGS 3.6.0.15), everything was OK.

Any idea ? Thanks a lot for helping ;)
Title: Re: AGS 3.6.0 - Beta 5
Post by: Crimson Wizard on Sun 29/05/2022 12:04:45
Code (ags) Select
nouvelle=s.Substring(r, rr-r); // Error indicates : String.Substring : invalid length

So it fails at Substring?

I tested your code with random "n" to trigger "if (c==n)" condition, and there was no errors. I guess "n" means a line. Could you tell at which "n" it happens, does it occur at any or particular lines?

I need to narrow the situation down to know which exactly conditions cause this error.

EDIT: actually, I ran this code in a loop, from n = 0 to 500, and met no error... tried in both ASCII and UTF-8 mode.
Title: Re: AGS 3.6.0 - Beta 5
Post by: eri0o on Sun 29/05/2022 13:48:07
While I also couldn't reproduce the error, I noticed the last line of the .txt is an empty line, so if that line is read and you don't notice there's no ; at all in the line perhaps there's some way it could fail in the code.

I would break the code in two parts, have a tried and tested csv parser and then use a result from that to move the data to the game object.
Title: Re: AGS 3.6.0 - Beta 6
Post by: Crimson Wizard on Sun 29/05/2022 19:24:23
Updated to Beta 6
(use download links in the first post)

Common features:
- Increased Room Objects limit to 256 (was 40). (This is as much as possible without changing game data format)

Editor:
- When creating new room objects they will now have their script names set to some default value.
- In sprite manager's "export all" dialog added "skip if local" option.
- In sprite manager's context menu added command "Create source files for all sprites with missing / external sources...".
- Fixed going to a "find all" result in dialog script did not highlight the found text, and sometimes did not scroll down to it.

Script API:
- Added InputType enum which defines input devices and lets create their sets as flags.
- Added WaitInput(), a more generic and extendable function that accepts a combination of flags telling which input types to wait for.
- All Wait* functions now return the reason they were skipped: a combination of InputType flag and a respective key or button code.

Engine:
- Upgraded SDL_Sound library, presumably fixes some issues with MIDI sounds.
- Improved file writing times (e.g. when doing a game save) by using buffered file stream. Initial tests showed 50% faster file writing.
- Engine now shares the video texture data for all game objects on screen sharing same sprite. This improves perfomance in case there are multiple objects which use same image.
- Made Animate() function's volume be relative to Character.AnimateVolume for characters.
- Implemented debug key controls for calling a built-in save and restore game dialogs. These controls have to be set in user config as "save_game_key" and "restore_game_key" in "[override]" category. These may be used by testers if the game is missing a save function or one is bugged.
- Added "cache_size" and "stream_threshold" options to config in "[sound]" category, they setup the rules for sound caching and choosing whether to load a clip fully into mem or stream one.
- Fixed dialog script's "goto-previous" command not working if used from the first sub-topic run using "goto-dialog" (a very-very old bug).
- Fixed renderer error occuring if room background frames are of different sizes.
- Fixed game fps sped up if SetGameSpeed() is called repeatedly in game script.
- Fixed Overlay.CreateRoomTextual() creating a screen overlay instead.
- Fixed WFN fonts rendered with misplaced letters if the text is drawn with negative coordinates.
- Fixed TheoraPlayer stopping too early on some videos.
- Fixed sprite cache size was never set from config.
- Fixed game not closing while window is minimized.
- Fixed crash when quitting with error during restoring a save.
- Fixed potential crash on exit on Windows when built in "release" configuration.





In regards to the WaitInput, and other Wait functions. Previously in this version we had a change that let them return the skip result like:
Quote
positive value means a key code, negative value means an inverted mouse code, and 0 means skipped by a timer or script command.
When planning on how a new input device could be supported (e.g. Gamepad, or joystick, etc), I realized that such approach was a mistake, and instead we now have this changed to using a combination of flags:
Code (ags) Select

enum InputType
{
  eInputNone       = 0x00000000,
  eInputKeyboard = 0x00020000,
  eInputMouse     = 0x00040000,
  eInputAny         = 0xFFFF0000
};

The Wait's return value now is a mix of a InputType and key/button code. To retrieve one or another you should be using bitwise operations.
Code (ags) Select

int result = WaitMouseKey(1000);
InputType how = result & eInputAny;
int keycode = result & 0xFFFF;

That's a bit complicated at the first glance, but lets to combine both values, and also easily add more devices to these return values.

The newest WaitInput also accepts a combination of InputType flags, so you can do this:
Code (ags) Select

WaitInput(eInputTime + eInputKeyboard);


When the gamepad, or other devices are supported inside the engine, this InputType enum will be expanded.



Title: Re: AGS 3.6.0 - Beta 6
Post by: eri0o on Sun 29/05/2022 23:26:57
I had the impression any changes in Wait return value was done in 3.6 itself, is the need to return 0 when in time skip something that was present in 3.5.1?
Title: Re: AGS 3.6.0 - Beta 6
Post by: Crimson Wizard on Sun 29/05/2022 23:34:43
Quote from: eri0o on Sun 29/05/2022 23:26:57
I had the impression any changes in Wait return value was done in 3.6 itself, is the need to return 0 when in time skip something that was present in 3.5.1?

Yes, it was a historical behavior since the beginning to have return value 0 for timeout and non-0 for other, working similar to boolean; this was purposedly left untouched in 3.6.0.
Title: Re: AGS 3.6.0 - Beta 6
Post by: Crimson Wizard on Sun 29/05/2022 23:58:59
I reuploaded the Beta 6 without eInputTime flag, so Wait functions are kept returning 0 for timeout as before.

Please download again (same links), if you've already installed Beta 6 earlier.
Title: Re: AGS 3.6.0 - Beta 6
Post by: Pax Animo on Mon 30/05/2022 17:30:23
Hey there,

Something odd is going on when having two characters SayBackground at the same time.

Code (ags) Select
function cRat_Look()
{
  if (Game.DoOnceOnly("ratlookat1")) {
    player.SayBackground("Shoo, go away!");
    cRat.SayBackground("?");
  }
}


This shuts down the game with a "appears not to have shut down properly error"

Update: actually this happens when any cCharacters.SayBackground, but works fine for player.SayBackground
Title: Re: AGS 3.6.0 - Beta 5
Post by: Baguettator on Mon 30/05/2022 18:28:57
Quote from: Crimson Wizard on Sun 29/05/2022 12:04:45
Code (ags) Select
nouvelle=s.Substring(r, rr-r); // Error indicates : String.Substring : invalid length

So it fails at Substring?

I tested your code with random "n" to trigger "if (c==n)" condition, and there was no errors. I guess "n" means a line. Could you tell at which "n" it happens, does it occur at any or particular lines?

I need to narrow the situation down to know which exactly conditions cause this error.

EDIT: actually, I ran this code in a loop, from n = 0 to 500, and met no error... tried in both ASCII and UTF-8 mode.

So I debugged it and I found what happenned : in one of the file (the one who made the game crashing), there were some "É" characters. And this made the game crash during the substring function.

The thing is : why ? The file is in UTF-8, and the game too. Or I'm misundersting something ? (which is surely the main reason of my problems I think ;) ).
Title: Re: AGS 3.6.0 - Beta 6
Post by: Crimson Wizard on Mon 30/05/2022 19:38:37
Quote from: Pax Animo on Mon 30/05/2022 17:30:23
Hey there,

Something odd is going on when having two characters SayBackground at the same time.

There seem to be a bug there. There will be a temp build with a fix here in roughly 20-30 minutes:
https://cirrus-ci.com/task/5199731981811712
EDIT: ready


Quote from: Baguettator on Mon 30/05/2022 18:28:57
So I debugged it and I found what happenned : in one of the file (the one who made the game crashing), there were some "É" characters. And this made the game crash during the substring function.

Could you please post a file? I'd really prefer to test real case rather than trying to reproduce this by luck.
EDIT: well, i tried to put random É in the file, but nothing happened.

Quote from: Baguettator on Mon 30/05/2022 18:28:57
The thing is : why ? The file is in UTF-8, and the game too.

The file format does not have a direct relation to the game. File can be read differently, what matters is how it is read and what you do with the data in script. Whether engine works correctly too.
Title: Re: AGS 3.6.0 - Beta 7
Post by: Crimson Wizard on Fri 03/06/2022 21:04:19
Updated to Beta 7
(use download links in the first post)

Script API:
- Implemented `dialog_options_close` callback which is called when custom dialog options are removed from the screen. This allows to perform any required cleanup.
- Added `eEventEnterRoomAfterFadein` event for `on_event` callback, which corresponds to "enter after fade-in" room event.

Engine:
- Fixed rendering scaled up WFN fonts.
- Fixed crash occuring when background speech is removed (found by Pax Animo).
Title: Re: AGS 3.6.0 - Beta 6
Post by: Baguettator on Sat 04/06/2022 10:26:12
Quote from: Crimson Wizard on Mon 30/05/2022 19:38:37
Quote from: Pax Animo on Mon 30/05/2022 17:30:23
Hey there,

Something odd is going on when having two characters SayBackground at the same time.

There seem to be a bug there. There will be a temp build with a fix here in roughly 20-30 minutes:
https://cirrus-ci.com/task/5199731981811712
EDIT: ready


Quote from: Baguettator on Mon 30/05/2022 18:28:57
So I debugged it and I found what happenned : in one of the file (the one who made the game crashing), there were some "É" characters. And this made the game crash during the substring function.

Could you please post a file? I'd really prefer to test real case rather than trying to reproduce this by luck.
EDIT: well, i tried to put random É in the file, but nothing happened.

Quote from: Baguettator on Mon 30/05/2022 18:28:57
The thing is : why ? The file is in UTF-8, and the game too.

The file format does not have a direct relation to the game. File can be read differently, what matters is how it is read and what you do with the data in script. Whether engine works correctly too.

Thanks for helping !

Did you displayed the String (with the Display function) that you obtained each time with the ReadRawLineback function ? I remember that all the É characters were not correctly displayed (something like ^A"< you know when the character is not properly read).

I will send you my files later (something like tomorrow or monday, I don't have any time before). Remember that in my code, I use a function which locates the ";" characters, and extract the informations between two ";". So it could be that each É or È was putting a new ";" and so it breaks the code.
Title: Re: AGS 3.6.0 - Beta 7
Post by: eri0o on Sat 04/06/2022 12:38:21
Could you make a small project that reproduces this issue? I haven't been able to trigger any of the mentioned crash using either the script you posted or the file.

You previously said it crashes, now you are saying it displays incorrectly, does it crashes or does it displays incorrectly?
Title: Re: AGS 3.6.0 - Beta 7
Post by: Crimson Wizard on Sat 04/06/2022 14:35:06
Quote from: Baguettator on Sat 04/06/2022 10:26:12
Did you displayed the String (with the Display function) that you obtained each time with the ReadRawLineback function ? I remember that all the É characters were not correctly displayed (something like ^A"< you know when the character is not properly read).

I did not display anything, I used exactly the code that you posted earlier: https://www.adventuregamestudio.co.uk/forums/index.php?topic=59842.msg636646559#msg636646559
where you said that substring crashes, to test the crash. I added É characters to the file too, in random places. But it did not crash for me neither in UTF-8 nor ASCII game mode.
Title: Re: AGS 3.6.0 - Beta 7
Post by: Baguettator on Sat 04/06/2022 16:37:31
Yes, it crashed. And it displayed incorrectly :)

As you have seen, the files contains many lines (each line containing informations about 1 character, written each one between a ";"). When I displayed the text, I saw that each É or characters like that was badly displayed. I displayed the text at each occurence of my function, and at some point, it crashed (saying the error I mentionned before).

I changed the É with E, it worked. And then, I changed the E to É, and it worked too...!!

Well, it worked for one file. For another, the É are displayed in game by ^ .

Strange...?
Title: Re: AGS 3.6.0 - Beta 7
Post by: Crimson Wizard on Sat 04/06/2022 16:40:44
@Baguettator, these all may be separate problems. Crash is one problem, wrong displayed characters is another.
For example, in order to display correct characters you also need a correct font.

If you want us to look into this problem we need a test case, where there's a 1) game settings 2) script and 3) a file, that in combination cause the problem.
Title: Re: AGS 3.6.0 - Beta 7
Post by: Dualnames on Tue 07/06/2022 08:36:32
Save to file appears to be problematic. Namely that white thing shouldn't be there.

Specifically:

(https://i.ibb.co/tpgf1s1/image.png)

Here are the images: https://easyupload.io/e5x7f4


Code (AGS) Select


   //Clearscreen is a dynamic sprite that grabs the screen as the Save UI opens, prior rather.
  //both Screenshots[0] and HDSave are dynamic sprites [declared in global variables]
 

    //SAVES A SMALL VERSION OF THE IMAGE
    Screenshots[0]=DynamicSprite.CreateFromExistingSprite(GrabAutosaveScreen(), false);//even replacing GrabAutosaveScreen with a sprite number results in a broken BMP file.
      Screenshots[0].Resize(61, 39);
      Screenshots[0].SaveToFile(String.Format("$SAVEGAMEDIR$/save%d.bmp",setSlot));

      //SAVES A BIGGER VERSION OF THE IMAGE
      if (HDSave!=null) HDSave.Delete();
      HDSave=DynamicSprite.CreateFromExistingSprite(ClearScreen.Graphic, false);
      HDSave.Resize(244, 167);
      HDSave.SaveToFile(String.Format("$SAVEGAMEDIR$/saveHD%d.bmp",setSlot));




This is not an issue in 3.5.0.26 or 3.5.1.13 afaik. The game's resolution is 640x480. And those are also the dimensions of Clearscreen DynamicSprite. Idk if it's because it's consecutive or what, I've tried a bunch of stuff, nothing seems to procure a non-broken image.

Title: Re: AGS 3.6.0 - Beta 7
Post by: eri0o on Tue 07/06/2022 12:24:03
I know you said it's the save to file, but any chance you tried to show the screenshot on screen before saving? Like, just to confirm the screenshot feature is working, and it's just file saving that is wrong.

Edit: managed to reproduce, it appears it's only saving the file: https://github.com/adventuregamestudio/ags/issues/1681

It's a mystery to me because I don't readily detect any change in the functions used, this is the part of Allegro4 we did not remove... So it may be some interaction between these...

Edit2: @Dualnames, CW fixed here: https://cirrus-ci.com/task/5976995031941120
Title: Re: AGS 3.6.0 - Beta 7
Post by: Crimson Wizard on Fri 10/06/2022 10:20:23
Have anything tried running latest 3.6.0 on linux in fullscreen mode? Trying this on a linux virtual machine results in a completely black window with no video or audio or reaction to input, regardless of the chosen renderer; so I am wondering if that's vm or engine's problem.
Title: Re: AGS 3.6.0 - Beta 7
Post by: Baguettator on Sun 12/06/2022 12:25:54
Hi !

About my text problems, it seems that I fixed that (or it fixed itself), I didn't understand well what happenned, so maybe it was my fault, I don't know. If I encounter another similar problem, I will post it :)

I tried to change the game translation, and it seems that the texts don't update when the function Game.ChangeTranslation is called. For example, I change my game from french to english, nothing happenned (texts still in french), but when the mouse went on a button, suddenly its text changed to the english one. Labels were not translated and the mouse didn't do anything on them. Surely because their image doesn't update when mouse is on them (and buttons do update).

Is it a problem with the Beta 3.6.0.25 ?
Title: Re: AGS 3.6.0 - Beta 7
Post by: Crimson Wizard on Sun 12/06/2022 20:13:58
Quote from: Baguettator on Sun 12/06/2022 12:25:54
I tried to change the game translation, and it seems that the texts don't update when the function Game.ChangeTranslation is called. For example, I change my game from french to english, nothing happenned (texts still in french), but when the mouse went on a button, suddenly its text changed to the english one. Labels were not translated and the mouse didn't do anything on them. Surely because their image doesn't update when mouse is on them (and buttons do update).

Is it a problem with the Beta 3.6.0.25 ?

This sounds like a problem with control texture update; i thought that this was fixed long ago, but will look again.
Title: Re: AGS 3.6.0 - Beta 7
Post by: eri0o on Mon 13/06/2022 13:21:08
@Baguettator, when you ask about 3.6.0.25, this is the version you are using or the version you are considering to upgrade to?
Title: Re: AGS 3.6.0 - Beta 7
Post by: Baguettator on Mon 13/06/2022 13:37:05
@eri0o it's the version I'm using ! ;)
Title: Re: AGS 3.6.0 - Beta 7
Post by: Crimson Wizard on Mon 13/06/2022 15:32:09
I missed this problem, it exists even in 3.5.1, which is very unfortunate. So it has to be fixed there too, and a new patch must be released.
Title: Re: AGS 3.6.0 - Beta 7
Post by: Baguettator on Mon 13/06/2022 15:39:53
Before I was with 3.5.1 (not the last patch), and it worked perfectly for me. It's only since 3.6.0.25.
Title: Re: AGS 3.6.0 - Beta 7
Post by: Crimson Wizard on Mon 13/06/2022 15:45:21
Quote from: Baguettator on Mon 13/06/2022 15:39:53
Before I was with 3.5.1 (not the last patch), and it worked perfectly for me. It's only since 3.6.0.25.

I just tested changing translation in the latest 3.5.1, and this bug is also present.
Title: Re: AGS 3.6.0 - Beta 7
Post by: Dualnames on Mon 13/06/2022 19:28:01
Is there a reason why changing one's OS settings from 24bit 48khz to 24bit 44khz would make an audio thing play properly (audio-crackling)?
I even tried rendering the file to 48 [it's originally at 44khz, and an ogg], but the issue i think lies outside the specific gamefile.

The same file plays fine outside of the engine. Is the default sample rate in-game set to 44?

Title: Re: AGS 3.6.0 - Beta 7
Post by: eri0o on Mon 13/06/2022 19:37:00
Which os, which audio driver, which version... These would be needed. SDL2 in the end will use something to output sound.
Title: Re: AGS 3.6.0 - Beta 7
Post by: Crimson Wizard on Mon 13/06/2022 20:06:26
Quote from: Dualnames on Mon 13/06/2022 19:28:01
Is there a reason why changing one's OS settings from 24bit 48khz to 24bit 44khz would make an audio thing play properly (audio-crackling)?
I even tried rendering the file to 48 [it's originally at 44khz, and an ogg], but the issue i think lies outside the specific gamefile.

The same file plays fine outside of the engine. Is the default sample rate in-game set to 44?

For the reference, according to the library code, the default openal's context is 48 khz.
But indeed we need more information on what os, what settings do you change, which audio driver do you use, and so on.
Also, I did not quite catch which frequency worked and which did not from your explanation.
Title: Re: AGS 3.6.0 - Beta 7
Post by: glurex on Mon 13/06/2022 20:53:48
Quote from: Crimson Wizard on Mon 13/06/2022 15:32:09
I missed this problem, it exists even in 3.5.1, which is very unfortunate. So it has to be fixed there too, and a new patch must be released.
Strange, I used the change game translation function in AGS 3.5.1 for Another Museum and it works without problem.
Title: Re: AGS 3.6.0 - Beta 7
Post by: Baguettator on Mon 13/06/2022 21:11:13
Exactly as me,I used long ago and it worked perfectly !
Title: Re: AGS 3.6.0 - Beta 7
Post by: Dualnames on Mon 13/06/2022 21:19:59
Quote from: Crimson Wizard on Mon 13/06/2022 20:06:26
Quote from: Dualnames on Mon 13/06/2022 19:28:01
Is there a reason why changing one's OS settings from 24bit 48khz to 24bit 44khz would make an audio thing play properly (audio-crackling)?
I even tried rendering the file to 48 [it's originally at 44khz, and an ogg], but the issue i think lies outside the specific gamefile.

The same file plays fine outside of the engine. Is the default sample rate in-game set to 44?

For the reference, according to the library code, the default openal's context is 48 khz.
But indeed we need more information on what os, what settings do you change, which audio driver do you use, and so on.
Also, I did not quite catch which frequency worked and which did not from your explanation.

The 24bit 44khz in the OS settings works. OS is Windows 10, audio driver is default.
But I can ask for more info if we can be a bit more specific, on what else we need, I'm not sure if the end user is knowledgable. To my knowledge, no settings were changed in the game's setup. [so whatever the defaults are]
Title: Re: AGS 3.6.0 - Beta 7
Post by: Crimson Wizard on Mon 13/06/2022 21:51:03
Quote from: Dualnames on Mon 13/06/2022 21:19:59
The 24bit 44khz in the OS settings works. OS is Windows 10, audio driver is default.

Could you clarify what setting that is, just to be sure, because I don't remember ever using such setting, neither thought that an os setting could conflict with the program.
I found one on Windows 7 in sound devices, according to it I have 48khz set apparently. Changing to 44khz on my Windows 7 does not seem to make any difference.
I may try on Windows 10 virtual machine later (although idk how close it is to emulate this behavior).
Title: Re: AGS 3.6.0 - Beta 7
Post by: Crimson Wizard on Mon 13/06/2022 21:58:31
@Baguettator, the bug was introduced in AGS 3.5.1 Patch 3.
I think in order to be noticed, there have to be separate GUIs with text on screen. If you have only 1 gui displayed with a button which changes translation, then the whole gui gets redrawn as soon as the button is pressed, so text is redrawn with the new translation as well. But if you have multiple guis, then you will see that only one with a "change translation" button is changed, until you do something with others.

Here's a fixed temp build for 3.6.0:
https://cirrus-ci.com/task/5957467392704512
Title: Re: AGS 3.6.0 - Beta 7
Post by: eri0o on Mon 13/06/2022 23:47:41
audio driver in my windows 10 machine, when I leave to default, is WASAPI, not sure if it's the same in the person of the case Dualnames mentions. I tried also directsound and winmm (Wave) and tried to vary the speakers default format for shared mode for sample rates and bit depth (not sure if this is where these are actually changed), but neither produced crackling.

@Dualnames, if the game is Strangeland, I am curious if could be a mix of the different things (ags and the plugin that uses SDL_mixer) accessing SDL2 audio backend.

Anyway, I would try using winsetup and then switching to directsound and seeing if this fixes it!
Title: Re: AGS 3.6.0 - Beta 7
Post by: Crimson Wizard on Tue 14/06/2022 00:03:24
Quote from: eri0o on Mon 13/06/2022 23:47:41
audio driver in my windows 10 machine, when I leave to default, is WASAPI, not sure if it's the same in the person of the case Dualnames mentions

By the way, it's logged, so you may ask a player to run with logging and check the info.
Log is set in config as
Quote
[log]
file=info
and the log file may be found in %USERPROFILE%/Saved Games/Adventure Game Studio
Title: Re: AGS 3.6.0 - Beta 7
Post by: Dualnames on Tue 14/06/2022 12:42:02
I will try that, meanwhile: https://steamcommunity.com/app/1346360/discussions/0/3416557114763335804/?tscn=1655196272
This kind of a weird issue, I'm not sure I understand the problem here, to fully answer this.

@eri0o: No, this is not about Strangeland, this is about Old Skies.
Title: Re: AGS 3.6.0 - Beta 7
Post by: eri0o on Tue 14/06/2022 13:01:16
damn, about the mouse issue the person mentions, it's probably because the person is used to the 144MHz monitor.

AGS runs game and graphics in the same sequence, so either it would need to render separately (in different threads), or separate this just for the mouse somehow, perhaps using the OS mouse if it's available - but keeping the existing approach if it's not, or doing this by a setting, I don't believe every platform will allow to override system cursor graphics, like mobile probably won't.

There's SDL_Cursor, so perhaps we could use SDL_CreateColorCursor, but not sure what that will entail, because then the lifetime of the cursor sprite is disconnected from the game graphics. Probably would need an issue on github to track this, but in essence, this is a new feature since I think the allegro ags version was using in engine rendered cursor - not sure if this is true in really older versions, since I remember at a point there was an issue of duplicated cursors, but there wasn't 144Hz monitors back then too.
Title: Re: AGS 3.6.0 - Beta 7
Post by: Crimson Wizard on Tue 14/06/2022 14:04:03
Quote from: eri0o on Tue 14/06/2022 13:01:16
AGS runs game and graphics in the same sequence, so either it would need to render separately (in different threads), or separate this just for the mouse somehow, perhaps using the OS mouse if it's available - but keeping the existing approach if it's not, or doing this by a setting, I don't believe every platform will allow to override system cursor graphics, like mobile probably won't.

There's SDL_Cursor, so perhaps we could use SDL_CreateColorCursor, but not sure what that will entail, because then the lifetime of the cursor sprite is disconnected from the game graphics.

EDIT: scrapped previous post.

Do i understand correctly that this is about "hardware cursors", which do not depend on game's own rendering?
Title: Re: AGS 3.6.0 - Beta 7
Post by: Dualnames on Tue 14/06/2022 14:13:59
Meanwhile regarding the audio:

Here's an mp4 recording that showcases the problem.
https://drive.google.com/file/d/18aGJbJisQdNvLuBzX6ujDfzNGzj7vPnE/view?usp=sharing

Here is the log:
http://primordia-game.com/Files0/ags.log

If this is missing key information do let me know of parameters for --log that are needed to show proper inf!
Title: Re: AGS 3.6.0 - Beta 7
Post by: eri0o on Tue 14/06/2022 14:30:28
For the audio, did changing to direct sound changed anything?

For the mouse, I opened a feature request to track this on GitHub (https://github.com/adventuregamestudio/ags/issues/1686), so it's easier to follow and report experiments there. I also was very specific about system cursors instead of going the rendering route, if that road proves not a good one, than closing and going the other is a possibility, but I was worried about the size of scope of the other approach.
Title: Re: AGS 3.6.0 - Beta 7
Post by: Crimson Wizard on Tue 14/06/2022 14:53:34
Quote from: Dualnames on Tue 14/06/2022 14:13:59
Meanwhile regarding the audio:

Here's an mp4 recording that showcases the problem.
https://drive.google.com/file/d/18aGJbJisQdNvLuBzX6ujDfzNGzj7vPnE/view?usp=sharing

EDIT: Ah, sorry, nevermind again.
The problem is in sound cracking, correct? The sounds overall are not distorted or anything (it seems).
Title: Re: AGS 3.6.0 - Beta 7
Post by: Dualnames on Tue 14/06/2022 15:02:14
The problem is speech, music, sound anything audio related crackles [I had the person test everything with everything else muted, crackle appears in all audio types/categories]

Edit: The only thing that makes it disappear is setting the OS Settings to be 24bit 44khz. [That's in the audio-device settings]
Edit: And yes, only crackling, no sound distortion.
Title: Re: AGS 3.6.0 - Beta 7
Post by: Crimson Wizard on Tue 14/06/2022 15:29:18
@Dualnames, have they tried different audio drivers?

The selection is now available in winsetup, on advanced tab.

(https://i.imgur.com/zXSTeu0.png)
Title: Re: AGS 3.6.0 - Beta 7
Post by: Snarky on Tue 14/06/2022 15:38:02
Quote from: Dualnames on Tue 14/06/2022 12:42:02
https://steamcommunity.com/app/1346360/discussions/0/3416557114763335804/?tscn=1655196272
This kind of a weird issue, I'm not sure I understand the problem here, to fully answer this.

Christ, the whining! "Nausea" because the cursor updates at 40 fps. (roll)
Title: Re: AGS 3.6.0 - Beta 7
Post by: eri0o on Tue 14/06/2022 16:14:30
About the audio, I found an open bug report in SDL2 issue tracker that looks suspicious: https://github.com/libsdl-org/SDL/issues/5538

(also more info in https://github.com/diasurgical/devilutionX/issues/1390 , it seems the WINMM (Wave) audio driver from sdl2 should bypass this issue at the cost of a bit of latency, I imagine it's negligible for 99% of adventures. No one tested direct sound though)

@Dualnames, my suggestion would be figuring out the person's hardware and drivers and open an issue on our GitHub with all of this information to track. Possibly the end solution would come from upstream if turns out these are the same issues.

(And of course, changing the audio driver like CW showed, trying directsound and Wave and seeing if any of those solves the issue. Curious stuff if it's resampling related like in SDL2 bug report, since Wasapi used to not support resampling, but is theoretically supporting resampling now since a Win10 update. Looking for this, it seems this is not supported on WASAPI still in some cases...)
Title: Re: AGS 3.6.0 - Beta 7
Post by: Julius Dangerous on Tue 14/06/2022 16:35:31
Well done!  (nod)
Title: Re: AGS 3.6.0 - Beta 7
Post by: Baguettator on Tue 14/06/2022 17:02:20
@Crimson Wizard : Thanks for the fix, I will try it in a proper release :)
Title: Re: AGS 3.6.0 - Beta 7
Post by: Dualnames on Tue 14/06/2022 22:53:21
No other options fix the issue, we tried em all.

I had this issue on my implementation of SDL for Strangeland, specifically on the backbuffer [meaning when the sounds start/loop] so I forwarded 1 bitrate ahead [4092 samples]. Not sure if that helps in any way. I also primarily used SDL mixer for the audio things.
Title: Re: AGS 3.6.0 - Beta 7
Post by: Dualnames on Tue 14/06/2022 22:53:53
Quote from: Snarky on Tue 14/06/2022 15:38:02
Quote from: Dualnames on Tue 14/06/2022 12:42:02
https://steamcommunity.com/app/1346360/discussions/0/3416557114763335804/?tscn=1655196272
This kind of a weird issue, I'm not sure I understand the problem here, to fully answer this.

Christ, the whining! "Nausea" because the cursor updates at 40 fps. (roll)

Old Skies actually runs at 60 fps, same as Unavowed.
Title: Re: AGS 3.6.0 - Beta 7
Post by: Snarky on Wed 15/06/2022 07:19:55
Looking at the other posts of the person reporting this, it seems to be something of an idiosyncratic obsession. Adventure games generally don't require quick mouse movements or reaction times, so while it might be nice to refresh the cursor more frequently (though that also seems to open up a vast new scope for bugs, if the cursor isn't where the script thinks it is/was), it should hardly be a high priority. I mean, plenty of people play shooters just fine in 60fps.

Using the OS cursor strikes me as very undesirable unless you fully control its appearance, and at that point you're back to needing to hook into the script (e.g. to vary the cursor depending on mouse button input or mouseover).
Title: Re: AGS 3.6.0 - Beta 7
Post by: Dave Gilbert on Thu 16/06/2022 16:23:32
Another user just reported the "crackling audio" bug. He said the "It is a very typical noise when, for example, the source and playback device do not have the same sampling rate." The sounds for Old Skies (and all our games for the last 16 years) are exported at 44100kz, and most PCs are set to play at 48000 by default, but it's never been a problem before.

edit: The user tested Blackwell Epiphany and did not encounter the problem, so it is probably something introduced in a later version of AGS.
Title: Re: AGS 3.6.0 - Beta 7
Post by: Dualnames on Thu 16/06/2022 16:27:02
This user's OS is Windows 10, and his soundcard is "Soundblaster ZxR" and he's using "Voicemeeter Potatoe" for sound controls [whatever that means].
EDIT: 2nd case [the one reported by Dave, also Blackwell Epiphany is on 3.5.1.13 so naturally the issue is not there]
Title: Re: AGS 3.6.0 - Beta 7
Post by: Crimson Wizard on Fri 17/06/2022 17:14:13
Bump.

Quote from: Crimson Wizard on Fri 10/06/2022 10:20:23
Have anything tried running latest 3.6.0 on linux in fullscreen mode? Trying this on a linux virtual machine results in a completely black window with no video or audio or reaction to input, regardless of the chosen renderer; so I am wondering if that's vm or engine's problem.
Title: Re: AGS 3.6.0 - Beta 7
Post by: eri0o on Fri 17/06/2022 23:51:16
I booted from a live USB on Ubuntu 22.04, and installed the .deb from the GitHub release. It did not install sdl2, but I manually installed it - I may have installed the deb wrong though.

But anyway, I went to try some games. The game works (no black screen), but whenever it exits, it's giving me the following error on command line:
corrupted double-linked lists
Aborted (core dumped)

Other than this, the window is weird, like, when I move it it's drawing tracks on the screen... It may be something about Nouveau, but I need to figure how to install Ubuntu in this computer without losing my windows drive before I can install the real Nvidia driver on this machine.

Oh, right, full screen works fine.
Title: Re: AGS 3.6.0 - Beta 7
Post by: Dualnames on Sat 18/06/2022 02:20:41
Do textboxes support unicode? Meaning can I write something in a textbox, and provided the font exists, have it displayed properly? What i mean specifically, is let's say i have a font on a textbox that displays greek characters, can i write in greek in the game on said textbox or no?
Title: Re: AGS 3.6.0 - Beta 7
Post by: Crimson Wizard on Sat 18/06/2022 05:51:52
Quote from: Dualnames on Sat 18/06/2022 02:20:41
Do textboxes support unicode? Meaning can I write something in a textbox, and provided the font exists, have it displayed properly? What i mean specifically, is let's say i have a font on a textbox that displays greek characters, can i write in greek in the game on said textbox or no?

It should, if I remember correctly.

If you are scripting a custom textbox (using a label or drawing surface), then you should utilize the new "on_text_input" callback, as "on_key_press" cannot handle full unicode range:
https://github.com/adventuregamestudio/ags-manual/wiki/Globalfunctions_Event#on_text_input
Title: Re: AGS 3.6.0 - Beta 7
Post by: Dualnames on Sat 18/06/2022 11:53:17
That's awesome, one problem however, even though I have it set to false, which means the new key should be enabled.

Code (AGS) Select
function on_text_input(int ch)
{
QuitGame(0);
}



This callback never gets executed, unless it needs to be in globalscript. I assume me pressing any key on a textbox would trigger this.
EDIT: Even in globalscript it doesn't.
Title: Re: AGS 3.6.0 - Beta 7
Post by: eri0o on Sat 18/06/2022 12:13:31
Did you enable it in General Settings?
Title: Re: AGS 3.6.0 - Beta 7
Post by: Dualnames on Sat 18/06/2022 12:54:26
Yes. If we're talking about the same thing!
Title: Re: AGS 3.6.0 - Beta 7
Post by: Dualnames on Sat 18/06/2022 12:59:47
Also meanwhile a user of Old Skies, is running into this error:

Initializing audio
SDL : ERROR: DEBUG: Audio target 'dsound' not available
Failed to initialize audio backend: Audio target 'dsound' not available
Audio is disabled

That's as much as I can gather.
"Dunno if it has a name, it was packed with my old headset from Beyerdynamics.   Or is it just some sort of converter? I have no idea from such things.  It's still weird for me though that it only happens on this AGS version as it seems?"


Whereas, they are using an external soundcard connected via USB on their PC. Tried a bunch of settings on the audio device, but no luck."
Title: Re: AGS 3.6.0 - Beta 7
Post by: eri0o on Sat 18/06/2022 13:03:05
Can you tell which Operating System? And how it's being run? Also, dsound is not a default, they may have set it through a config or they have a SDL environment variable that is hijacking the default.

Btw, Native Linux doesn't run with our SDL2 I think, it will run with the sdl2 from Steam. At least I remember in my Linux computer Steam injected an environment variable that did this redirect. This is important when trying to figure out a bug in SDL.

Edit: sdl2 will accept dsound now in it's next release: https://github.com/libsdl-org/SDL/issues/5818
Title: Re: AGS 3.6.0 - Beta 7
Post by: Crimson Wizard on Sat 18/06/2022 13:13:46
Quote from: Dualnames on Sat 18/06/2022 11:53:17
This callback never gets executed, unless it needs to be in globalscript. I assume me pressing any key on a textbox would trigger this.

No, it does not trigger by the textbox, as textbox steals the key presses. As I mentioned, you should be using that If you are scripting a custom textbox (using a label or drawing surface) (not using default one).
Title: Re: AGS 3.6.0 - Beta 7
Post by: Dualnames on Sat 18/06/2022 13:34:33
The log is the same with "default" set on audio device, it reverts to "directsound"

pasting their acsetup.cfg
Code (AGS) Select

[graphics]
driver=OGL
filter=StdScale
fullscreen=desktop
game_scale_fs=proportional
game_scale_win=round
refresh=0
render_at_screenres=0
vsync=0
window=default
windowed=0
[language]
translation=
[misc]
antialias=1
cachemax=131072
shared_data_dir=
user_data_dir=
[mouse]
auto_lock=0
speed=1.5
[sound]
driver=
enabled=1
usespeech=1
Title: Re: AGS 3.6.0 - Beta 7
Post by: Dualnames on Sat 18/06/2022 14:24:15
Meanwhile on the "on_text_input(int ch)" front, it seems to work, but it's not capturing all keys. Specifically, for example greek alphabet/happens partially on korean too.

Code (AGS) Select

function on_text_input(int ch)
{
player.SayBackground(String.Format("%d",ch));
}


Shows nothing on the majority of the key presses. For instance typing "αβγο" which would be A->B->G->O doesn't show any number on that say command.
Thoughts?

Title: Re: AGS 3.6.0 - Beta 7
Post by: Crimson Wizard on Sat 18/06/2022 15:21:18
Quote from: Dualnames on Sat 18/06/2022 14:24:15
Meanwhile on the "on_text_input(int ch)" front, it seems to work, but it's not capturing all keys. Specifically, for example greek alphabet/happens partially on korean too.

Code (AGS) Select

function on_text_input(int ch)
{
player.SayBackground(String.Format("%d",ch));
}


Shows nothing on the majority of the key presses. For instance typing "αβγο" which would be A->B->G->O doesn't show any number on that say command.

I would have to make a test game and investigate this.
Could you tell which keyboard layout do you use on your system?
Title: Re: AGS 3.6.0 - Beta 7
Post by: Dualnames on Sat 18/06/2022 16:01:43
qwerty, I've installed Greek and Korean, and used both mine and the onscreen keyboard, windows 10.
Title: Re: AGS 3.6.0 - Beta 7
Post by: eri0o on Sat 18/06/2022 23:18:41
Quote from: Dualnames on Sat 18/06/2022 14:24:15
Meanwhile on the "on_text_input(int ch)" front, it seems to work, but it's not capturing all keys. Specifically, for example greek alphabet/happens partially on korean too.

Code (AGS) Select

function on_text_input(int ch)
{
player.SayBackground(String.Format("%d",ch));
}


Shows nothing on the majority of the key presses. For instance typing "αβγο" which would be A->B->G->O doesn't show any number on that say command.
Thoughts?

I set here to greek and got 913, 914, 915 and 927 forÎ'Î'Î"Ο, and then 945, 946, 947 and 959 for αβγο. Below the keyboard I used in Win10. Is this the one you have set?

Spoiler
(https://i.imgur.com/kdvBDAa.png)
[close]
Title: Re: AGS 3.6.0 - Beta 7
Post by: Crimson Wizard on Sun 19/06/2022 07:48:48
@Dualnames, also, to double check, since I cannot remember if you mentioned if the game is set to unicode mode:
- General Settings -> Text format -> should be Unicode
WARNING: if it's not, make sure to make a backup of your game, because switching to unicode will reencode and resave most game files.

if you're using translations, they all also need to have a utf-8 Encoding option in TRS, because translations switch the engine between ascii and utf-8 modes for backwards compatibility.
(actually, I wonder if i should disable this if game is already utf-8, as it's difficult to imagine why you would use ascii translation in a unicode game, other than by mistake)

More detailed info here:
https://adventuregamestudio.github.io/ags-manual/UpgradeTo36.html#unicode-support
Title: Re: AGS 3.6.0 - Beta 7
Post by: Dualnames on Sun 19/06/2022 11:17:17
@eri0o Yes!

@CrimsonWizard Also yes, it's already set there.

Does the script API and compatibility need to be at 3.6.0? It's set to 3.5.1 atm.

EDIT: eri0o if it's small can u send me over that project where u tested the thingie, to see if it works on my end? If it does, it's an error on my end, if it doesn't there's something else.
Title: Re: AGS 3.6.0 - Beta 7
Post by: Crimson Wizard on Sun 19/06/2022 11:30:04
Quote from: Dualnames on Sun 19/06/2022 11:17:17
Does the script API and compatibility need to be at 3.6.0? It's set to 3.5.1 atm.

Hmm, no, I don't think that matters. Unicode mode lets it have proper codes, and "Use old key input mode" (true or false) defines whether on_text_input is called at all.

What about text display, will it show up correctly if you just display the string of Greek/Korean text on screen?
Title: Re: AGS 3.6.0 - Beta 7
Post by: Dualnames on Sun 19/06/2022 11:32:54
Yes, everything else works perfect! It works when it replaces english text [via the translation] it also works if i type greek characters into a label on the editor as well.
Title: Re: AGS 3.6.0 - Beta 7
Post by: Baguettator on Sun 19/06/2022 13:27:30
Hi again ! I created a new translation file (in the editor), and I saw that the texts inside it were badly displayed. Each éèÉ etc... was displayed badly.

I'm still using the Unicode format. Any idea ? I never got such problems before (I'm using AGS 3.6.0.25)
Title: Re: AGS 3.6.0 - Beta 7
Post by: Crimson Wizard on Sun 19/06/2022 13:32:45
Quote from: Baguettator on Sun 19/06/2022 13:27:30
Hi again ! I created a new translation file (in the editor), and I saw that the texts inside it were badly displayed. Each éèÉ etc... was displayed badly.

How is the file saved (what encoding), does your text editor have options to display in different encodings and which is active?
Title: Re: AGS 3.6.0 - Beta 7
Post by: Baguettator on Sun 19/06/2022 13:34:26
It seems that my file is in UTF-8. I use Notepad (I don't know if it's the same name in english, it's the basic program in Windows).
Title: Re: AGS 3.6.0 - Beta 7
Post by: Crimson Wizard on Sun 19/06/2022 14:18:23
Quote from: Baguettator on Sun 19/06/2022 13:34:26
It seems that my file is in UTF-8. I use Notepad (I don't know if it's the same name in english, it's the basic program in Windows).

Is your game itself made in unicode format, where are these texts coming from (script, properties)?
Could you upload a translation file, just to understand what we are talking about?
Title: Re: AGS 3.6.0 - Beta 7
Post by: Baguettator on Sun 19/06/2022 14:47:04
Well, I repeated the operation, and... it worked ?!

Will look if it happens again. I don't what hapened before...! Sorry :(
Title: Re: AGS 3.6.0 - Beta 7
Post by: Crimson Wizard on Sun 19/06/2022 15:07:58
I actually recommend using Notepad++ (https://notepad-plus-plus.org/), i believe it works better than regular windows notepad.
Title: Re: AGS 3.6.0 - Beta 7
Post by: SinSin on Sun 19/06/2022 21:32:47
Congrats to all who are a part of this 👏
Title: Re: AGS 3.6.0 - Beta 7
Post by: Baguettator on Tue 21/06/2022 18:29:31
@Crimson Wizard : are you going to update properly AGS 3.6 soon ? Or I have to use your fix you gave me before ?
Title: Re: AGS 3.6.0 - Beta 7
Post by: Crimson Wizard on Tue 21/06/2022 18:40:25
Quote from: Baguettator on Tue 21/06/2022 18:29:31
@Crimson Wizard : are you going to update properly AGS 3.6 soon ? Or I have to use your fix you gave me before ?

You could use a "temp build" with a fix, as it is exactly same program, only in between "official" versions.

The next update will be exclusively bug fixes, I think it will happen later on this week.
Title: Re: AGS 3.6.0 - Beta 7
Post by: LameNick on Tue 21/06/2022 20:58:30
Quote from: Crimson Wizard on Fri 17/06/2022 17:14:13
Bump.

Quote from: Crimson Wizard on Fri 10/06/2022 10:20:23
Have anything tried running latest 3.6.0 on linux in fullscreen mode? Trying this on a linux virtual machine results in a completely black window with no video or audio or reaction to input, regardless of the chosen renderer; so I am wondering if that's vm or engine's problem.

I'm not sure if this is still relevant or if I fully understood the question- I compiled the Tumbleweed demo with some mp3 music included in AGS-3.6.0.27-Beta7 for Windows and ran it under Kubuntu 20.04 system in fullscreen mode and everything went smoothly..

If it would help to test anything else in Kubuntu, let me know.
Title: Re: AGS 3.6.0 - Beta 8
Post by: Crimson Wizard on Wed 22/06/2022 01:51:21
Updated to Beta 8
(use download links in the first post)

Editor:
- Added "Help" option to the editor pane's tab context menu.
- Dialog scripts now too can open help topics for keywords or script functions under cursor on F1.
- Fixed not showing correct help topics for several panels on F1.

Engine:
- Added "multitasking" option to config in "[misc]" category, that defines the starting multitasking mode (may later be changed by SetMultitaskingMode in script).
- Added stubs for agsshell plugin (a contemporary cross-platform variant of ags_shell).
- Fixed characters switching to a wrong loop unnecessarily if a current walking directional loop does not have as many frames as the previous one (regression since 3.6.0.6).
- Fixed GUI controls don't update immediately when game translation changes.
- Fixed saving of dynamic sprites and screenshots to a file (or a savegame).
- Fixed certain OGG clips stuck in loading forever.
- Fixed sound clips getting stuck in a playback state near the end if their size is a multiple of 65536.
- Fixed some clips reporting a large negative number as their length (should report 0 instead if it cannot calculate one for whatever reason)
- Fixed multitasking mode persisting if the game was switched from windowed to real fullscreen mode (even though it's not supposed to work in exclusive fullscreen).
- Fixed Direct3D renderer not able to restore an exclusive fullscreen mode after switching out from the game window.
- Fixed game not reacting to system close commands when stuck in script, which made it impossible to close the "hanging" game by usual means (other than terminating the process).
- Fixed number of occasional crash cases on game exit.
Title: Re: AGS 3.6.0 - Beta 8
Post by: Dave Gilbert on Wed 22/06/2022 15:03:22
Quote- Dialog scripts now too can open help topics for keywords or script functions under cursor on F1.

Nothing to add but "Yessssssssssss!" Been hoping for this one! Thanks!
Title: Re: AGS 3.6.0 - Beta 8
Post by: Crimson Wizard on Thu 23/06/2022 14:16:08
So, unfortunately there was still an annoying sound bug in the recent update, related to crossfading tracks; I'll be releasing a next update quite soon, maybe in the end of this week (want to wait for a couple of days more to see if there are more problems found). Meanwhile there's this temporary build with fixes:

https://cirrus-ci.com/task/4541835971395584
Title: Re: AGS 3.6.0 - Beta 8
Post by: Crimson Wizard on Sat 25/06/2022 18:54:56
Am I imagining things, or have someone reported a mouse not moving in fullscreen on Linux a short while ago?

I've reinstalled a newer build on Ubuntu on a virtual machine, and the previous problem of fullscreen not displaying anything is gone, but now I have a different issue: the mouse cursor not moving. Curiously enough, mouse clicks (and keys) work. This is fixed by alt-tabbing out and back. Could be something related to vm though, as it sometimes has issues with mouse grab.
Title: Re: AGS 3.6.0 - Beta 9
Post by: Crimson Wizard on Tue 28/06/2022 03:20:02
Updated to Beta 9
(use download links in the first post)

Engine:
- Fixed a script linking problem in games made with 3.6.0 alpha which used Button.Animate() with new parameters.
- Fixed MP3 sounds not reporting their length properly.
- Fixed sound clips not stopping by command if they had a crossfade enabled.
- Fixed scheduled sound fadeout effect was not cancelled by skipping a cutscene (a very old bug from early 3.*).
- Fixed false positive detection of a script hung in a do..while loop that could stop the game.

Android:
- Fixed AGS Player (universal launcher) crashing when launching any game (regression since 3.6.0.18).
- In AGS Player fixed Credits option not showing anything.
Title: Re: AGS 3.6.0 - Beta 9
Post by: Baguettator on Tue 28/06/2022 10:20:14
Hi there ! I playtested my game, and I thought about some things :

Suggestions :

- Would it be possible to make "Slider_OnClick" functions to allow 2 parameters like "Buttons_OnClick" functions ? (so "Slider_OnClick(GUIControl *control, MouseButton *button"). If it's not a big problem, it will allow to simplify the code when we make our own sliders and arrows, gathering all of these controls into 1 function (and not 3). At least for me, it would be great :)

- Any way to add a parameter for list boxes that allow to "cut" the text of the items if they are too long (out of the listbox) ? And without "changing" the real text of these items (like the items are always the full text, but the listbox displays only what it fits into the box). Could be nice to allow a true/false option for this.

Problems :

- it seems that the "_" symbol doesn't allow to correctly find the "keyword" we are writing into the editor. For example, if I have to write into the editor my variable "is_bright", when I write "is_", it should appear in the list and select my variable (so then I just press enter and it's done). I mean for "autocompletion". Since 3.6, it doesn't understand the "_" symbol. Maybe other symbols do the same problem, I don't know.

- When I write "int p=player.Room", the word "Room" becomes in blue, because it's like the editor considers that we are talking about the struct "Room". Normally, it should stay in black, because it's not the struct, but the part of the "player" struct.

I hope my english is well understable :)
Title: Re: AGS 3.6.0 - Beta 9
Post by: Snarky on Tue 28/06/2022 10:40:56
Nice work on the new Beta!  (nod)

Given that AGS 3.6.0 has been in public testing for over a year now and we're at Beta 9, is it safe to assume any further changes in this release will be limited to bugfixes that are either regressions or critical, so that it can at some point become the official release? Or are there still changes that "must" be done before you can finalize it?

It seems to me that at this point it would be best to defer new features, other improvements, and fixing minor, long-standing bugs until the next release.
Title: Re: AGS 3.6.0 - Beta 9
Post by: eri0o on Tue 28/06/2022 14:00:46
In my head beta to stable is mostly about serious bugs being fixed and less (but not necessarily zero) regressions. This is usually accomplished by more and more people using it - which is hard to grasp since we no longer collect statistics in the Editor, we depend on people actually writing here.

If people are using it, since it's safe to assume we are not going back to Allegro4 backend, then it's mostly about making sure the manual is updated regards the changes at this point.
Title: Re: AGS 3.6.0 - Beta 9
Post by: Crimson Wizard on Tue 28/06/2022 14:57:57
On current situation.

The 3.6.0 seem to be stable enough to make games. There are few known regressions since 3.5.* related to move from Allegro4 to SDL2 backend library and new audio library, related primarily to sounds, but I think these are "edge cases" and won't affect everyone. Some of these might still be possible to fix within 3.6.0. Other bugs which were found and fixed recently were mostly oversights made during last feature additions.

From looking around and talking to users, I know that at least 3 people/teams are making commercial games with it:
- Wadjet Eye (Dave Gilbert, Dualnames, etc) are making their new game with 3.6.0: https://www.adventuregamestudio.co.uk/forums/index.php?topic=59868.0
- Grundislav is making his new game "Rosewater" in 3.6.0 (I learnt this because he was reporting bugs).
- Stranga's "Ashina: The Red Witch" (at least the demo was made in 3.6.0): https://www.adventuregamestudio.co.uk/forums/index.php?topic=59052.0
Perhaps there are more.


@Baguettator, at this point we try to not add any new functionality to 3.6.0, unless it's absolutely required to cover some "gaps" in the already planned tasks, which we missed earlier. Fixing mistakes is the priority now.

Quote from: Baguettator on Tue 28/06/2022 10:20:14
- Would it be possible to make "Slider_OnClick" functions to allow 2 parameters like "Buttons_OnClick" functions ? (so "Slider_OnClick(GUIControl *control, MouseButton *button"). If it's not a big problem, it will allow to simplify the code when we make our own sliders and arrows, gathering all of these controls into 1 function (and not 3).

There's no Slider_OnClick right now, there's OnChange which is somewhat a different thing. I guess the point is to support "OnClick" event in all controls? I may open this as a feature suggestion for the future.

Quote from: Baguettator on Tue 28/06/2022 10:20:14
- Any way to add a parameter for list boxes that allow to "cut" the text of the items if they are too long (out of the listbox) ? And without "changing" the real text of these items (like the items are always the full text, but the listbox displays only what it fits into the box). Could be nice to allow a true/false option for this.

This is already implemented, and I think it was done following your own request some time ago. The option is called "GUI Controls clip their contents" in "General Settings" -> "Visual". It makes all the gui controls to visually cut their texts if they expand beyond their borders. This is actually a default behavior in all the game templates now.


Quote from: Baguettator on Tue 28/06/2022 10:20:14
- it seems that the "_" symbol doesn't allow to correctly find the "keyword" we are writing into the editor. For example, if I have to write into the editor my variable "is_bright", when I write "is_", it should appear in the list and select my variable (so then I just press enter and it's done). I mean for "autocompletion". Since 3.6, it doesn't understand the "_" symbol. Maybe other symbols do the same problem, I don't know.

- When I write "int p=player.Room", the word "Room" becomes in blue, because it's like the editor considers that we are talking about the struct "Room". Normally, it should stay in black, because it's not the struct, but the part of the "player" struct.

Looks like these are mistakes within autocomplete feature, I shall open a bug report for these in our tracker.
Title: Re: AGS 3.6.0 - Beta 9
Post by: Baguettator on Tue 28/06/2022 18:10:36
Quote from: Crimson Wizard on Tue 28/06/2022 14:57:57
There's no Slider_OnClick right now, there's OnChange which is somewhat a different thing. I guess the point is to support "OnClick" event in all controls? I may open this as a feature suggestion for the future.

Oh sorry, I wanted to write "Slider_OnChange". But I didn't realize that it's an "OnChange" function, and not a "OnClick". There would be no needs to make the "OnChange" function working with 2 parameters ? (control and mousebutton)

OK, I understand that you need to fix the errors instead of making new improvements. :)

Thanks for answering !
Title: Re: AGS 3.6.0 - Beta 9
Post by: Crimson Wizard on Tue 28/06/2022 18:25:11
Quote from: Baguettator on Tue 28/06/2022 10:20:14
- Would it be possible to make "Slider_OnClick" functions to allow 2 parameters like "Buttons_OnClick" functions ? (so "Slider_OnClick(GUIControl *control, MouseButton *button"). If it's not a big problem, it will allow to simplify the code when we make our own sliders and arrows, gathering all of these controls into 1 function (and not 3).

Quote from: Baguettator on Tue 28/06/2022 18:10:36
Oh sorry, I wanted to write "Slider_OnChange". But I didn't realize that it's an "OnChange" function, and not a "OnClick". There would be no needs to make the "OnChange" function working with 2 parameters ? (control and mousebutton)

I think it would be best if you described your actual situation, like what are you trying to accomplish in your game. That would make it easier to think of a good solution.
Title: Re: AGS 3.6.0 - Beta 9
Post by: Baguettator on Tue 28/06/2022 19:06:20
I would like to "merge" the functions for 3 controls : the custom slider and the customs arrows I made for scrolling a list box. As there are many listboxes in my game, I would like to minimize the number of functions in global script. Merging would allow to do that in one single function, instead of 3 : 1 arrow for Scrolling up, 1 arrow for scrolling down, 1 slider for scrolling up or down. For me it's just an optimization for the script (less functions, less lines etc...).

I can't do that because the "onchange" functions need only 1 parameter, and the "onclick" functions need 2 parameters. So I can't apply a 2 parameters function for a slider (the game crashes and says "1 parameter intended").
Title: Re: AGS 3.6.0 - Beta 9
Post by: Crimson Wizard on Tue 28/06/2022 19:19:06
Quote from: Baguettator on Tue 28/06/2022 19:06:20
I would like to "merge" the functions for 3 controls : the custom slider and the customs arrows I made for scrolling a list box. As there are many listboxes in my game, I would like to minimize the number of functions in global script. Merging would allow to do that in one single function, instead of 3 : 1 arrow for Scrolling up, 1 arrow for scrolling down, 1 slider for scrolling up or down. For me it's just an optimization for the script (less functions, less lines etc...).

Hm, no, it would be incorrect to change the event function only for that purpose. The solution here is to modify the editor and engine and allow to put event handlers in different scripts, not only global script.
Alternatively, there's a plan to let connecting functions to events in script: this way one would be able to create complex gui setups dynamically.

I guess at this moment you may still merge all arrow buttons in one event handler, and all list sliders in another event handler.
Title: Re: AGS 3.6.0 - Beta 9
Post by: Baguettator on Thu 30/06/2022 17:33:11
Well it could be useful to allow the difference between left-click and right-click in a slider, couldn't it ?

I have also 1 request, but I know that it's not really your plans to make new improvements :

Could it be possible to add new informations in the Slider struct ? Like the left corner's position (x, y, in the screen, or from the slider itself) of the handle. Also maybe a Y Offset ? And allow negative offsets ?

In my game, the sliders are custom, I use a rectangle for the slider background and a square for the handle. The problem is when value=0 (or value=max), half of the handle isout of the slider. So I need to use a transparent image for the slider, use a button for the real background of the slider, calculate how much the handle is out from the slider, resize the slider so that at value=0 (or value=max) the handle fit perfectly to the borders of the real background (the button's sprite)... And then place the arrows (buttons too) just on top and below the real background of the slider. This way I manage to create a true custom slider that fit perfectly. But it's a lot of work, it could be easier. Like if we can define that the handle's borders can't be out of the slider. Or give it offsets ? Also, being able to know the x,y coordinates of the handle could be useful to generate automatically the custom sliders' sprites at game_start, especially if they use the same images, but not at the same sizes.

Maybe I don't know how to make a good custom slider :) Well, I know it could be out of this thread because it looks like a technical question, but it's mainly a request - until someone tells me that there is an other already existing solution (sorry eri0o for always saying me that I'm out of this thread :( ).

I also encountered problems with the last 3.6 version: I'm playing MP3 audioclips, using the old audio functions (PlayClip or something like that), and at one moment, I heard like a distorsion sound for about 5 seconds, then the music played, but 1 tone lower...!!!
Title: Re: AGS 3.6.0 - Beta 9
Post by: Crimson Wizard on Thu 30/06/2022 17:52:29
Quote from: Baguettator on Thu 30/06/2022 17:33:11
Maybe I don't know how to make a good custom slider :) Well, I know it could be out of this thread because it looks like a technical question, but it's mainly a request - until someone tells me that there is an other already existing solution (sorry eri0o for always saying me that I'm out of this thread :( ).

At this point my advice is to script your own slider. For example, you could use buttons for slider elements, or raw drawing (DrawingSurface, DynamicSprite). That way you may design literally anything, and script any behavior. People were using raw drawing to create custom controls for years, there were modules made with custom text boxes, scrolling chats, and so on. But yes, this is a topic for Technical Questions section.

Quote from: Baguettator on Thu 30/06/2022 17:33:11
I also encountered problems with the last 3.6 version: I'm playing MP3 audioclips, using the old audio functions (PlayClip or something like that), and at one moment, I heard like a distorsion sound for about 5 seconds, then the music played, but 1 tone lower...!!!

As usual, we would need to know details. What precisely version of AGS, what clip, what was the script command, and so on. We won't be able to do anything without knowing detailed information.
Title: Re: AGS 3.6.0 - Beta 9
Post by: Baguettator on Fri 01/07/2022 15:41:41
OK, I will gather informations and tell you what happenned exactly :)

About sliders, OK I understand, my question was if it was possible to get more options for the handle offsets, maybe it's not planned for now.

Few bugs, probably :

- If my handle is 50*50 pixels, when the slider value is minimal, the handle is perfectly 25 pixels out from the slider background. If the slider value is maximal, the handle is only at 21 pixels out from the slider background. There is always a 4 pixels "offset" when the value is maximal. Strange ?

- the LisBox.RowCount value seems bugged.When I launch my game, I add items in my listbox (for example 7 items). The gui where my listbox is is not visible yet. If I display the rowcount value, it's 0 ! then I make the gui visible, and display again the value : 5 ! ( the right value !) is it a bug that the listboxes' row count value are not set up propely until they appear at screen ?
Title: Re: AGS 3.6.0 - Beta 9
Post by: Crimson Wizard on Fri 01/07/2022 19:52:27
Quote from: Baguettator on Fri 01/07/2022 15:41:41
- the LisBox.RowCount value seems bugged.When I launch my game, I add items in my listbox (for example 7 items). The gui where my listbox is is not visible yet. If I display the rowcount value, it's 0 ! then I make the gui visible, and display again the value : 5 ! ( the right value !) is it a bug that the listboxes' row count value are not set up propely until they appear at screen ?

This appeared to be an old bug (reproduced as early as AGS 3.2.1), but will be fixed now.

Quote from: Baguettator on Fri 01/07/2022 15:41:41
About sliders, OK I understand, my question was if it was possible to get more options for the handle offsets, maybe it's not planned for now.

No, nothing else is planned for 3.6.0. Right now there's a HandleOffset property for sliders which creates a horizontal offset, it may be both positive and negative.
Changing anything there would require a good design plan on how control should behave. Frankly, I doubt this will be done in AGS 3.* versions, maybe within experimental "AGS 4" branch.

Quote from: Baguettator on Fri 01/07/2022 15:41:41
- If my handle is 50*50 pixels, when the slider value is minimal, the handle is perfectly 25 pixels out from the slider background. If the slider value is maximal, the handle is only at 21 pixels out from the slider background. There is always a 4 pixels "offset" when the value is maximal. Strange ?

Please tell what is the width of the slider itself?

Overall this is probably because of how handle position is calculated. From my memory, the slider's width is divided by value range, and that's how handle positions are set up.
For instance, if you have values 0-10, this means 11 positions. If your slider is 110 pixels wide, that would mean a position each 10 pixels, distributed along all the slider's width. If slider is 100 pixels wide, that would mean 9 pixels for position and so on. On top of that AGS may add some extra tweaks to create offsets/margins for a handle. This may result in slightly different offsets; the larger the graphics the larger this difference may be (in absolute pixel value).
Title: Re: AGS 3.6.0 - Beta 9
Post by: Baguettator on Fri 01/07/2022 21:59:07
Quote from: Crimson Wizard on Fri 01/07/2022 19:52:27
Please tell what is the width of the slider itself?

Overall this is probably because of how handle position is calculated. From my memory, the slider's width is divided by value range, and that's how handle positions are set up.
For instance, if you have values 0-10, this means 11 positions. If your slider is 110 pixels wide, that would mean a position each 10 pixels, distributed along all the slider's width. If slider is 100 pixels wide, that would mean 9 pixels for position and so on. On top of that AGS may add some extra tweaks to create offsets/margins for a handle. This may result in slightly different offsets; the larger the graphics the larger this difference may be (in absolute pixel value).

The slider has the same width as the handle. My slider is vertical : so the max value is up. Min value is down. The strange thing is that the handle seems to be always with 4 pixels offset when it's max value. Could you reproduce the same problem with your own tests ? My handle is a square, the same width as the slider background.
Title: Re: AGS 3.6.0 - Beta 9
Post by: Crimson Wizard on Fri 01/07/2022 23:10:08
Quote from: Baguettator on Fri 01/07/2022 21:59:07
The slider has the same width as the handle. My slider is vertical

Well, then, please tell what it's height. I need to know the slider's size, most importantly the size along which the handle is moving to reproduce this and investigate. Also Min and Max values, just in case.
Since you mentioned slider is vertical, this 4px offset, is it vertical or horizontal?
Title: Re: AGS 3.6.0 - Beta 9
Post by: Baguettator on Sat 02/07/2022 21:23:14
Quote from: Crimson Wizard on Fri 01/07/2022 19:52:27
This appeared to be an old bug (reproduced as early as AGS 3.2.1), but will be fixed now.

Will it be in the next update ?

About the slider :

Arrow buttons, Handle : 50*50
Slider width:50
Slider Max value : 7
I tried these situations :

-slider height=200
-slider height=273
- slider height=259

I always place the arrow buttons so that at max and min values, the handle is placed just next to the buttons corners.

In each case, there were 4 pixels between the arrow button (up) and the handle when it's in the max value position.

It seems to be a bug ?
Title: Re: AGS 3.6.0 - Beta 9
Post by: Crimson Wizard on Sun 03/07/2022 18:34:58
Quote from: Baguettator on Sat 02/07/2022 21:23:14
About the slider :

Arrow buttons, Handle : 50*50
Slider width:50
Slider Max value : 7
I tried these situations :

-slider height=200
-slider height=273
- slider height=259

I always place the arrow buttons so that at max and min values, the handle is placed just next to the buttons corners.

In each case, there were 4 pixels between the arrow button (up) and the handle when it's in the max value position.

That's just how AGS calculates the slider positions, it has strange math, it has been like that since ancient times.

There's a "handle range" value that tells in which range the handle can move. This range is calculated as "width - 4" for horizontal and "height - 4" for vertical sliders.
When calculating current position of the vertical slider the formula is "current_pos = (int)(((float)(MaxValue - Value) * (float)handle_range) / (float)(MaxValue - MinValue))".
In addition the handle position is always shifted 2 or 4 pixels to the right or down from the slider's left or top edge (depending on orientation). It's 2 extra pixels for low-resolution games and 4 pixels for high resolution games (640x400 and above).
The handle's graphic is then centered around this position.

For example, if vertical slider has height 200, min value of 0 and max of 7, then:
- handle range = 200 - 4 = 196

- the position at minimal value will be = ((7 - 0) * 196) / (7 - 0) = 196
but there's also +4 pixel offset for a high res game (I'll just assume your is high res, because you have large sliders), so it's = 200.
The sprite handle is then centered around slider's Y 200.

- the position at maximal value will be =((7 - 7) * 196) / (7 - 0) = 0
but there's also +4 pixel offset, so it's = 4.
The sprite handle is then centered around slider's Y 4. This is where the 4 pixels come from in your case.

Title: Re: AGS 3.6.0 - Beta 9
Post by: Baguettator on Sun 03/07/2022 18:50:28
Wow that's strange !!

Is it planned to change it ? Or there is a reason for that kind of "maths" to exist ? (I believe yes, because why to do difficult when you can do easy).

About my audio problems I told before, could you have a look if the PlayMp3File function works normally ? My code uses this function, I don't do anything excepting playing MP3 files normally, and I encounter "randomly" the bug while the files are played 1 tone under the original.

Also, the Audio.Play function works like before ? Because in the 3.5 versions, I didn't write parameters (I did myaudio.Play()), and it played once normally. Now the same audio files are playing several times, and I didn't change the code ! As you worked on audio before (as I saw in this thread), maybe things have changed a bit ?
Title: Re: AGS 3.6.0 - Beta 9
Post by: Crimson Wizard on Sun 03/07/2022 19:33:02
Quote from: Baguettator on Sun 03/07/2022 18:50:28
Is it planned to change it ? Or there is a reason for that kind of "maths" to exist ? (I believe yes, because why to do difficult when you can do easy).

I have no idea why it was made like that, it could be a random attempt to make it look in certain way.
No, there were no plans to change how gui look like, at least not in 3.6.0, because changing this now may break looks for someone else who already adjusted to this behavior; also rushing things may cause us missing something. Maybe this will be changed in the future versions, but this has to be well thought through, how the sliders should look, work, and which parameters to use. It's probably not the only thing that could've been adjusted too.

Quote from: Baguettator on Sun 03/07/2022 18:50:28
About my audio problems I told before, could you have a look if the PlayMp3File function works normally ? My code uses this function, I don't do anything excepting playing MP3 files normally, and I encounter "randomly" the bug while the files are played 1 tone under the original.

I cannot tell what does 1 tone down means... Could you give an example of mp3 file, or record how it sounds in some media player and inside a game for comparison?

Quote from: Baguettator on Sun 03/07/2022 18:50:28
Also, the Audio.Play function works like before ? Because in the 3.5 versions, I didn't write parameters (I did myaudio.Play()), and it played once normally. Now the same audio files are playing several times, and I didn't change the code ! As you worked on audio before (as I saw in this thread), maybe things have changed a bit ?

Nothing was supposed to change in script commands. But according to AudioClip.Play, if you dont pass any parameters, then the default values for this clip/audio type will be used. Please check what your clip properties and audio type properties say in the editor.
Title: Re: AGS 3.6.0 - Beta 9
Post by: Baguettator on Mon 04/07/2022 17:24:37
OK, no problem for sliders, my code deals really well with that :)

1 tone down is about the "pitch" of the music. I could send you my project so that you can test and see.

Also I encountered again the strange sound, like a train slowing quickly... Strange...

Any update of AGS 3.6 with the fix for ListBox.RowCount bug ?
Title: Re: AGS 3.6.0 - Beta 9
Post by: Crimson Wizard on Mon 04/07/2022 17:52:38
Quote from: Baguettator on Mon 04/07/2022 17:24:37
1 tone down is about the "pitch" of the music. I could send you my project so that you can test and see.

Yes, please.

Quote from: Baguettator on Mon 04/07/2022 17:24:37
Any update of AGS 3.6 with the fix for ListBox.RowCount bug ?

It has been fixed, if you like you may download the latest build here:
https://cirrus-ci.com/task/5111025316921344
Title: Re: AGS 3.6.0 - Beta 9
Post by: Baguettator on Fri 08/07/2022 06:30:52
Hi,

Also I thought about a thing : would it be possible to make the slider's handle clickable even "out" from the slider's height ?

If my handle's image is 50*50 pixels, at min value or at max value, the slider is 25 pixels out from the slider (+/- 4 pixels, according to the strange maths in AGS  ;) ). The problem is that if I click on the handle, but the click is on the 25 pixels "out" from the slider, the handle doesn't react. Even if you click on it, and even if you have chosen the pixel-perfect collision.

Of course, if the handle is within the slider (not at min/max value), it works perfectly by clicking everywhere on it.
Title: Re: AGS 3.6.0 - Beta 9
Post by: Crimson Wizard on Sat 09/07/2022 04:48:47
Quote from: Baguettator on Fri 08/07/2022 06:30:52
Also I thought about a thing : would it be possible to make the slider's handle clickable even "out" from the slider's height ?

This was the intended behavior, but got broken few months ago, will be fixed in the next update.

Quote from: Baguettator on Fri 08/07/2022 06:30:52Even if you click on it, and even if you have chosen the pixel-perfect collision.

Please note that pixel-perfect click detection does not work on guis at the moment.
Title: Re: AGS 3.6.0 - Beta 10
Post by: Crimson Wizard on Sat 09/07/2022 06:33:18
Updated to Beta 10
(use download links in the first post)

Editor:
- Editor no longer errors and fails when opening a game project with some script files missing.
- Fixed editor displaying unhandled exception if the script which user is trying to open was missing. Instead it will now open a blank script.
- Fixed a recently imported sprite could be displayed incorrectly scaled up in the room editor for high-resolution games, if the "Allow relative asset resolutions" was enabled in General Settings, and the sprite 0 had "Resolution" property set to "Low".
- Fixed script autocomplete for function calls was mistreating commas in strings and inline comments as if they were separating actual parameters.
- Fixed script autocomplete was not displaying members of extended structs if the parent struct was declared in another header.
- Fixed script autocomplete was not working for enum names.
- Fixed structs and enums were not highlighted if declared inside a script's body.
- Fixed crash in TextWindow GUI preview.

Engine:
- Fixed AGS_EngineInitGfx plugin callback was not called during OpenGL renderer initialization.
- Fixed ListBox.RowCount reporting 0 if called before the control was displayed once.
- Fixed ListBox was trying to draw double border (in hi-res games) outside of the control's clipping rectangle.
- Fixed Slider's handle not reacting to mouse clicks when partially outside the slider's box.
Title: Re: AGS 3.6.0 - Beta 10
Post by: Baguettator on Sun 10/07/2022 22:39:10
Hi !

I found minor bugs in the last version :

- the functions for specific controls (functions like that : function my function (this Button*)) don't appear in the list of the editor (at the top of the script). It was not a problem in previous versions

- the labels seem to cut the letters at their top border, even if the option in General Settings is false ("GUIControl cut their content").

- is there any reason for the DrawString function is not as good as the way texts are displayed in labels ? With my font (GorriSans), texts in labels are perfectly displayed, and when I use the DrawString function, the letters are "bold" and not as precise.
Title: Re: AGS 3.6.0 - Beta 10
Post by: Crimson Wizard on Sun 10/07/2022 23:03:07
Quote from: Baguettator on Sun 10/07/2022 22:39:10
- the functions for specific controls (functions like that : function my function (this Button*)) don't appear in the list of the editor (at the top of the script). It was not a problem in previous versions

What are these functions, where and how are they declared?

Quote from: Baguettator on Sun 10/07/2022 22:39:10
- the labels seem to cut the letters at their top border, even if the option in General Settings is false ("GUIControl cut their content").

Please, give some details... what is the font, which parameters do you use, what is the label's parameters?

Quote from: Baguettator on Sun 10/07/2022 22:39:10
- is there any reason for the DrawString function is not as good as the way texts are displayed in labels ? With my font (GorriSans), texts in labels are perfectly displayed, and when I use the DrawString function, the letters are "bold" and not as precise.

Depends on what do you draw upon. If the font is anti-aliased, and you draw on a surface without alpha channel, then the anti-aliasing will be lost.
Title: Re: AGS 3.6.0 - Beta 10
Post by: Baguettator on Mon 11/07/2022 06:31:41
Quote from: Crimson Wizard on Sun 10/07/2022 23:03:07
Quote from: Baguettator on Sun 10/07/2022 22:39:10
- the functions for specific controls (functions like that : function my function (this Button*)) don't appear in the list of the editor (at the top of the script). It was not a problem in previous versions

What are these functions, where and how are they declared?

For example, I have these two functions declared in the script .asc :

Code (ags) Select
function Prise_Objectif(int typesalle, Button *bouton)
function PionFouille(this Button*)


In the list of the script (the one who gathers ALL the functions of the script, at the top of the editor), normally, I should able to see :

PriseObjectif
Button::PionFouille

But the second one doesn't appear. And all the functions linked to a struct that is not created in the script (all the "standard" ones, like Button, GuiControl, ListBox etc...) don't appear in the list.

Quote from: Crimson Wizard on Sun 10/07/2022 23:03:07
Quote from: Baguettator on Sun 10/07/2022 22:39:10
- the labels seem to cut the letters at their top border, even if the option in General Settings is false ("GUIControl cut their content").

Please, give some details... what is the font, which parameters do you use, what is the label's parameters?

Sorry, the font is Gorri Sans, the label parameters are standard, the thing is that probably I need to add a vertical offset to the font so the top of the letters won't be cut by the label top edge. But if I didn't choose the "cut content for Guicontrol" option in General Settings, that's not intended to be cut ?

Quote from: Crimson Wizard on Sun 10/07/2022 23:03:07
Quote from: Baguettator on Sun 10/07/2022 22:39:10
- is there any reason for the DrawString function is not as good as the way texts are displayed in labels ? With my font (GorriSans), texts in labels are perfectly displayed, and when I use the DrawString function, the letters are "bold" and not as precise.

Depends on what do you draw upon. If the font is anti-aliased, and you draw on a surface without alpha channel, then the anti-aliasing will be lost.

Perfect, I didn't know about it ! thanks !
Title: Re: AGS 3.6.0 - Beta 10
Post by: Crimson Wizard on Mon 11/07/2022 07:02:06
Quote from: Baguettator on Mon 11/07/2022 06:31:41
And all the functions linked to a struct that is not created in the script (all the "standard" ones, like Button, GuiControl, ListBox etc...) don't appear in the list.

Are you speaking of standard AGS functions or the custom extenders linked to standard structs?
I will note just in case that the builtin functions should not be in this list on top, as this list is meant to jump to the code, and these functions are not in game script but in the engine.


Quote from: Baguettator on Mon 11/07/2022 06:31:41
Sorry, the font is Gorri Sans, the label parameters are standard, the thing is that probably I need to add a vertical offset to the font so the top of the letters won't be cut by the label top edge. But if I didn't choose the "cut content for Guicontrol" option in General Settings, that's not intended to be cut ?

The label is not supposed to cut anything without "clip contents", but my guess is that the font renderer may prevent anything from being drawn in negative relative coordinates (above and to the left from text's starting drawing position).

On the question why it is drawn too high, I quickly experimented with this font (downloaded it here (https://www.dafont.com/gorrisans.font)), and noticed that it cuts a pixel or two from top if it has "TTF font adjustment" set to "Resize ascender...", but it seems fine if this option is set to "Do nothing". Is this the effect that you are experiencing?


Title: Re: AGS 3.6.0 - Beta 10
Post by: Baguettator on Mon 11/07/2022 07:53:32
I'm speaking about the custom extenders linked to standard structs !

QuoteThe label is not supposed to cut anything without "clip contents", but my guess is that the font renderer may prevent anything from being drawn in negative relative coordinates (above and to the left from text's starting drawing position).

On the question why it is drawn too high, I quickly experimented with this font (downloaded it here), and noticed that it cuts a pixel or two from top if it has "TTF font adjustment" set to "Resize ascender...", but it seems fine if this option is set to "Do nothing". Is this the effect that you are experiencing?

I think it cuts the negative positions.

I will test the "Do nothing" parameter, and I will let you know :)
Title: Re: AGS 3.6.0 - Beta 10
Post by: Crimson Wizard on Mon 11/07/2022 12:16:04
Probably fixed the extender functions not showing up in the list:
https://cirrus-ci.com/task/6733627856781312
Title: Re: AGS 3.6.0 - Beta 10
Post by: Laura Hunt on Sun 17/07/2022 21:42:00
I'm having an issue with text properties apparently not saving their text encoding properly. I'll try to explain step by step as thoroughly as I can.

Context:
- I'm using AGS 3.6.0.30, Beta 10.
- My game is in ASCII/ANSI, and I've never switched it to Unicode.
- I'm not using translations. This is text written directly in the editor.
- All letters with accents display properly elsewhere in the game. I only have issues if they're in a custom text property string.

I have a name with an accent ("Lucía") in a text property whose value I define via an auxiliary script like this:

Code (ags) Select
object[27].SetTextProperty(OBJ_ITEMNAME, "A photograph of Lucía.");

(OBJ_ITEMNAME is a constant whose value is "obj_itemname"; I always do this so that autocomplete will work for custom properties.)

When I start my game, Lucía is displayed as Luc?a.

However, if I delete the "í" and write it again, it is now displayed properly. I rebuild all files just to be sure, and save my game.

But when I start up AGS and run my game again, the issue is there again.


(Unrelated: I had the same issue as Baguettator with fonts being cut at the top of labels, and switching the TTF font adjustment value to "Do nothing" did indeed fix it.)
Title: Re: AGS 3.6.0 - Beta 10
Post by: Crimson Wizard on Sun 17/07/2022 22:51:24
Quote from: Laura Hunt on Sun 17/07/2022 21:42:00
When I start my game, Lucía is displayed as Luc?a.

However, if I delete the "í" and write it again, it is now displayed properly. I rebuild all files just to be sure, and save my game.

But when I start up AGS and run my game again, the issue is there again.

Please tell, how do you display it precisely?

Does it display correctly in the editor, or it gets broken in both text editor and game?

Could it be that while in game you restore some previously made save, which has this property value stored in an incorrect way?

PS. I rather recommend switching to Unicode mode regardless, as that might resolve all text problems now and in the future.
Title: Re: AGS 3.6.0 - Beta 10
Post by: greg on Mon 18/07/2022 00:30:07
Hi, I just upgraded to beta 10 (from beta 5).  When I look at my views in the editor, I see that many frames now have a frame-link sound "-1 [unknown]."  Previously, none of these frames had any frame-linked sound.

Here's a screenshot: https://drive.google.com/file/d/18GTGxBbdxTIg0ZFl4XgkqQ5Exk0T6LDo/view?usp=sharing (https://drive.google.com/file/d/18GTGxBbdxTIg0ZFl4XgkqQ5Exk0T6LDo/view?usp=sharing).

When the affected views play, they don't interfere with other sounds that are playing or generate any error messages (either in AGS or in warnings.log).
Title: Re: AGS 3.6.0 - Beta 10
Post by: Crimson Wizard on Mon 18/07/2022 00:44:27
Quote from: greg on Mon 18/07/2022 00:30:07
Hi, I just upgraded to beta 10 (from beta 5).  When I look at my views in the editor, I see that many frames now have a frame-link sound "-1 [unknown]."  Previously, none of these frames had any frame-linked sound.

I recall there had been an incorrect frame sound ID problem quite long ago, much earlier than 3.6.0 betas. But I cannot think of any change between beta 5 and 10 that would affect frame sound ID property.

Do you still have a previous version of your game's project? It might be useful for testing this issue.
Title: Re: AGS 3.6.0 - Beta 10
Post by: greg on Mon 18/07/2022 03:44:21
QuoteDo you still have a previous version of your game's project? It might be useful for testing this issue.

Yes, I have the beta 5 version of the project.  When I load it in the beta 5 editor, though, I see that the frame-linked sound ID problem ("-1 [unknown]") is there as well.  So apparently the issue had already been there, but I didn't notice it until installing beta 10.
Title: Re: AGS 3.6.0 - Beta 10
Post by: Crimson Wizard on Mon 18/07/2022 04:07:49
@greg, I think this may be fixed by editing Game.agf in any text editor and doing "replace all":
what : <Sound>-1</Sound>
replace to: <Sound>0</Sound>
Title: Re: AGS 3.6.0 - Beta 10
Post by: Laura Hunt on Mon 18/07/2022 04:16:07
Quote from: Crimson Wizard on Sun 17/07/2022 22:51:24
Please tell, how do you display it precisely?

I've done some more testing, and it turns out it doesn't have to do specifically with custom text properties. Any extended characters in any non-room scripts will display the same issue.

So if I simply do player.Say("My name is Lucía"); in the Global Script, it will get displayed as "My name is Luc?a".

If I change anything in that script, even if it's just adding a commented line like //this is a comment, the issue is fixed temporarily untl the next time I open the engine.

As to your questions:

Quote from: Crimson Wizard on Sun 17/07/2022 22:51:24Does it display correctly in the editor, or it gets broken in both text editor and game?

It displays correctly in the editor. It's only broken in-game.

Quote from: Crimson Wizard on Sun 17/07/2022 22:51:24Could it be that while in game you restore some previously made save, which has this property value stored in an incorrect way?

There isn't a save system implemented yet, so every time the game runs, it runs from scratch. I'm not saving or loading anything.

Quote from: Crimson Wizard on Sun 17/07/2022 22:51:24PS. I rather recommend switching to Unicode mode regardless, as that might resolve all text problems now and in the future.

That's not really possible now, because I started working on this game with AGS 3.5.1 and all the fonts I'm using for this game use windows-1252 extended ASCII encoding. Changing fonts at this stage of the project is not really an option.
Title: Re: AGS 3.6.0 - Beta 10
Post by: Crimson Wizard on Mon 18/07/2022 04:55:26
Quote from: Laura Hunt on Mon 18/07/2022 04:16:07
I've done some more testing, and it turns out it doesn't have to do specifically with custom text properties. Any extended characters in any non-room scripts will display the same issue.

So if I simply do player.Say("My name is Lucía"); in the Global Script, it will get displayed as "My name is Luc?a".

If I change anything in that script, even if it's just adding a commented line like //this is a comment, the issue is fixed temporarily untl the next time I open the engine.

When you say "next time I open the engine", do you mean "editor"?

Overall, this sounds as the problem is in reading the scripts from the file and/or writing them back to file. As when compiling the game editor probably uses the scripts in memory if available, so when you edit the script, the version in memory gets fixed, but if they are not memory and loaded from the file - then a broken version is used.

So, two things should be tested: how the script is saved and how it's loaded. Can you open the script in a separate text editor and see what encoding is it saved in, and if the letter is correct there?

Additionally, do you use any editor plugins, or any extra tools, which may affect a script file?
Title: Re: AGS 3.6.0 - Beta 10
Post by: Laura Hunt on Mon 18/07/2022 05:12:34
Quote from: Crimson Wizard on Mon 18/07/2022 04:55:26
Quote from: Laura Hunt on Mon 18/07/2022 04:16:07
I've done some more testing, and it turns out it doesn't have to do specifically with custom text properties. Any extended characters in any non-room scripts will display the same issue.

So if I simply do player.Say("My name is Lucía"); in the Global Script, it will get displayed as "My name is Luc?a".

If I change anything in that script, even if it's just adding a commented line like //this is a comment, the issue is fixed temporarily untl the next time I open the engine.

When you say "next time I open the engine", do you mean "editor"?

Yes. I save my game, close AGS, I open AGS again, load my game, and the issue is back.

Quote from: Crimson Wizard on Mon 18/07/2022 04:55:26Overall, this sounds as the problem is in reading the scripts from the file and/or writing them back to file. As when compiling the game editor probably uses the scripts in memory if available, so when you edit the script, the version in memory gets fixed, but if they are not memory and loaded from the file - then a broken version is used.

The interesting thing is that if I switch to Unicode, the wrong character being displayed is ^, not ?. So it will display Luc^a rather than Luc?a. It's almost as if the engine is not able to render or access the extended ASCII characters after 127 for some reason, but only for those specific scripts. Room scripts work fine.

Quote from: Crimson Wizard on Mon 18/07/2022 04:55:26So, two things should be tested: how the script is saved and how it's loaded. Can you open the script in a separate text editor and see what encoding is it saved in, and if the letter is correct there?

Notepad++ confirms all the scripts are ANSI. Everything looks correct there.

Quote from: Crimson Wizard on Mon 18/07/2022 04:55:26Additionally, do you use any editor plugins, or any extra tools, which may affect a script file?

Nothing. No plugins or extras, just script modules (rellax, tween and my own auxiliary scripts).
Title: Re: AGS 3.6.0 - Beta 10
Post by: Crimson Wizard on Mon 18/07/2022 05:31:43
Could you send me a script that causes the problems, and a font?
Also, what is the locale for non-unicode programs set on your system; and what locale is mentioned at the top of the Game.agf, where it sais "encoding"?


Quote from: Laura Hunt on Mon 18/07/2022 05:12:34
The interesting thing is that if I switch to Unicode, the wrong character being displayed is ^, not ?. So it will display Luc^a rather than Luc?a. It's almost as if the engine is not able to render or access the extended ASCII characters after 127 for some reason

This depends on whether the font has the character in a slot, which unicode index corresponds to that letter.
Title: Re: AGS 3.6.0 - Beta 10
Post by: Laura Hunt on Mon 18/07/2022 05:51:36
Quote from: Crimson Wizard on Mon 18/07/2022 05:31:43
Could you send me a script that causes the problems, and a font?

I'll PM you the link in a second.

Quote from: Crimson Wizard on Mon 18/07/2022 05:31:43
Also, what is the locale for non-unicode programs set on your system;

English-US.

Quote from: Crimson Wizard on Mon 18/07/2022 05:31:43and what locale is mentioned at the top of the Game.agf, where it sais "encoding"?

Windows-1252.

Just to double check, I did a quick test importing the same fonts in a game made with AGS 3.5.1, and I don't seem to have any issues there.


Edit: I changed my system locale for non-unicode programs to Spanish just to check if the issue would still happen, and it didn't make a difference.
Title: Re: AGS 3.6.0 - Beta 10
Post by: greg on Mon 18/07/2022 12:51:19
Quote@greg, I think this may be fixed by editing Game.agf in any text editor and doing "replace all":
what : <Sound>-1</Sound>
replace to: <Sound>0</Sound>

Thank you, that resolved the issue!
Title: Re: AGS 3.6.0 - Beta 10
Post by: Crimson Wizard on Mon 18/07/2022 14:30:05
@LauraHunt, here's the fixed build:
https://cirrus-ci.com/task/6597896589017088
Title: Re: AGS 3.6.0 - Beta 10
Post by: Laura Hunt on Mon 18/07/2022 15:19:19
Quote from: Crimson Wizard on Mon 18/07/2022 14:30:05
@LauraHunt, here's the fixed build:
https://cirrus-ci.com/task/6597896589017088

Works like a charm, thank you!
Title: Re: AGS 3.6.0 - Beta 10
Post by: Crimson Wizard on Mon 18/07/2022 19:04:02
Updated with fixed Mouse.IsButtonDown
https://cirrus-ci.com/build/6534401537343488
Title: Re: AGS 3.6.0 - Beta 11
Post by: Crimson Wizard on Mon 18/07/2022 23:06:24
[deleted]
Title: Re: AGS 3.6.0 - Beta 11
Post by: Pax Animo on Tue 19/07/2022 12:19:05
The download links are not working for me.
Title: Re: AGS 3.6.0 - Beta 11
Post by: Crimson Wizard on Tue 19/07/2022 12:24:00
Quote from: Pax Animo on Tue 19/07/2022 12:19:05
The download links are not working for me.

Fixed now.
Title: Re: AGS 3.6.0 - Beta 11
Post by: Pax Animo on Tue 19/07/2022 14:48:02
I see there are changes to Key mod flags and I've read the gihub document.
I'm confused and now have an issue where any key is pressed now brings up a save game interface.

EDIT: The save interface simply pops back up after closing it and pressing another key.
[imgzoom]https://imgur.com/0a3AwOtl.png[/imgzoom]

This is what i'd be expecting to happen which worked prior to the update.

Code (ags) Select
function on_key_press(eKeyCode keycode, int mod)
{
  if (player.Animating == false && bAbilityBar1.Visible) {
  //
    if (keycode == eKey1 && gTargetPortrait.Visible) {
    //
     .....
    }
  }
}
Title: Re: AGS 3.6.0 - Beta 11
Post by: Crimson Wizard on Tue 19/07/2022 16:08:50
@PaxAnimo, do you have a call to SaveGameDialog anywhere in the script? If yes, please post it here. Or you don't and it just appears for no reason?

Also please tell if you have the "Use old-style keyboard handling" in the general Settings set to true or false? (it's in Backwards Compatibility)

EDIT: Oh, I actually see, it appears on any key...
Title: Re: AGS 3.6.0 - Beta 11
Post by: Pax Animo on Tue 19/07/2022 16:23:24
I do not have any call to SaveGameDialog, appears for no reason.

I have "Use old-style keyboard handling" set to false. (I've now set it to true and this seems to be working correctly)

It was happening on almost any key, apart from, return/ctrl/shit/arrows and F key's, possibly a few others.
Title: Re: AGS 3.6.0 - Beta 11
Post by: Crimson Wizard on Tue 19/07/2022 16:27:19
I will have to remake the update and upload again later when I fix this.

Restored old links for now.
Title: Re: AGS 3.6.0 - Beta 10
Post by: eri0o on Tue 19/07/2022 16:43:37
Erh, just a guess, in game_run, if agskey is 0 we could skip everything in check_keyboard_controls.

Because if usetup.key_save_game is not set, it will be 0, and then agskey will match in some cases?
Title: Re: AGS 3.6.0 - Beta 10
Post by: Crimson Wizard on Tue 19/07/2022 16:45:55
Quote from: eri0o on Tue 19/07/2022 16:43:37
Erh, just a guess, in game_run, if agskey is 0 we could skip everything in check_keyboard_controls.

The "no key" case is already skipped. But I'm using "CompatKey" for special controls, and it happens to be 0 in some cases when the normal key value is not 0.
Title: Re: AGS 3.6.0 - Beta 10
Post by: Pax Animo on Tue 19/07/2022 17:11:51
Another issue I've encountered in the beta 11,

When switching rooms in the editor the main background is not loading and has to be reset each load via the background pull down menu.
Title: Re: AGS 3.6.0 - Beta 11
Post by: Crimson Wizard on Tue 19/07/2022 19:19:08
[deleted]
Title: Re: AGS 3.6.0 - Beta 11
Post by: Pax Animo on Tue 19/07/2022 19:54:49
Nice and quick previous fixes.

Came across something a bit odd in the view editor, the loops are now centre rather than left alignment as before,

(https://imgur.com/kwPKbVQl.png)
Title: Re: AGS 3.6.0 - Beta 11
Post by: Crimson Wizard on Tue 19/07/2022 20:02:20
Alright, I will have to fix more
Title: Re: AGS 3.6.0 - Beta 11
Post by: Crimson Wizard on Tue 19/07/2022 21:22:50
Fixed above bugs and reuploaded Beta 11 again, but this is probably the last quick fix, because I'm abusing releases. If there are more bugs found, I'll be fixing them later.

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

Editor:
- Added zoom control on Character pane. On View panel the animation preview is now scaling along with the loops.
- Fixed editor silently enabling all available Build Targets when upgrading a pre-3.4.0 project. This could be very inconvenient as there are several of them supported now.
- Fixed scripts were preloaded using incorrect encoding when opening a ANSI/ASCII project.
- Fixed editor was not preventing from entering Character's and AudioClip's ScriptName too long for the engine to handle.
- Fixed View animation preview stopping at frame 100 (if loop contains over 100 frames).
- Fixed script autocomplete sometimes was not updated right after opening a script.
- Fixed extender methods not showing up in the function combolist in the script editor.

Script API:
- Key mod flags are now included packed in the Wait* functions return value.
Please refer to update article in the manual: https://github.com/adventuregamestudio/ags-manual/wiki/Globalfunctions_Wait#global-functions-wait

Engine:
- Fixed Wait* functions returning incorrect mouse button values when skipped by the mouse click.
Title: Re: AGS 3.6.0 - Beta 11
Post by: Pax Animo on Wed 20/07/2022 00:26:38
Hey, just an idea.

I'm planning on developing my current project whilst keeping up to date with new engine builds so if you ever need a pre release beta tester, if I may be of help, give me a shout.
Title: Re: AGS 3.6.0 - Beta 11
Post by: Dave Gilbert on Fri 22/07/2022 15:30:15
Quote- Dialog scripts now too can open help topics for keywords or script functions under cursor on F1.

Took awhile to get around to testing this. Pressing F1 in the dialog script works just fine when it involves built-in AGS commands (it opens up the manual's definition of the function as expected), but for custom functions it just opens up the manual and nothing else. When I am in other scripts (room scripts, modules, and the like), I can right click on a command and select "go to definition" to send me to the declaration of the function. Is it possible to enable this for dialog scripts?
Title: Re: AGS 3.6.0 - Beta 11
Post by: Crimson Wizard on Fri 22/07/2022 20:05:10
Quote from: Dave Gilbert on Fri 22/07/2022 15:30:15When I am in other scripts (room scripts, modules, and the like), I can right click on a command and select "go to definition" to send me to the declaration of the function. Is it possible to enable this for dialog scripts?

I may look into this later today.
Title: Re: AGS 3.6.0 - Beta 11
Post by: Crimson Wizard on Sat 23/07/2022 02:55:23
Quote from: Dave Gilbert on Fri 22/07/2022 15:30:15When I am in other scripts (room scripts, modules, and the like), I can right click on a command and select "go to definition" to send me to the declaration of the function. Is it possible to enable this for dialog scripts?

So, I looked into this, and apparently the full and proper support of autocomplete, keyword highlighting and "go to definition" in dialogs would require to rewrite like a half of the script editor.

Right now the dialog editor is made like a very stripped copy-paste version of the script editor, with some essential things not implemented. I found it is more or less possible to share most menu and context menu commands, and have a basic support for "Go to definition", but that "basic support" won't work for all symbols. Namely, it won't work for any local variables and their members (the reasons will be difficult to explain here), and maybe something else.

For example, if you have a struct "MyStruct" declared somewhere, with members "int a" and "int b", and in dialog script you type:
Code (ags) Select

    MyStruct ms;
    ms.a = 10;

then "Go to definition" will work on "MyStruct", but won't work neither on "ms", nor "a".

Local variables are also not working with autocomplete at all in dialog. For example, typing "player." will open autocomplete list for Character's members, but having "Character *ch;" and typing "ch." won't open any autocomplete.

Long story short, if I add these commands now, they will be working with a number of exceptions.

To do this properly, we'd have to create a new parent class of editor, which has all the autocomplete, and searching for definitions supported correctly, and then derive both Dialog pane and Script pane from it. As 3.6.0 is closing the completion, making big changes like that is not desired.


EDIT: I've made an experimental version that shares most of the Edit menu and context menu commands between regular script and dialog editors, if anyone likes to try:
https://cirrus-ci.com/task/6417042428395520
Title: Re: AGS 3.6.0 - Beta 11
Post by: vga256 on Fri 29/07/2022 21:20:22
I am not sure if this is a bug, or is historically how AGS works, so I apologize if this turns out to be a scripting error or a case of incorrect expectations.

I'm using the latest beta, and I noticed that when I run:


Object *roomObject = Object.GetAtRoomXY(testDropPosition.x, testDropPosition.y);
if (roomObject != null)
    Display("Found object!");


if the roomObject's "Clickable" property is set to false, no object is found at that location. If the roomObject's Clickable property is set to true, an object is found as expected.

This behaviour does not appear to be mentioned anywhere in the documentation, so I'm wondering if I've either mis-scripted something, this is historically how AGS has worked, or if I've hit a bug with the beta. Happy to share the project source if that helps to replicate.
Title: Re: AGS 3.6.0 - Beta 11
Post by: Crimson Wizard on Fri 29/07/2022 22:11:43
Quote from: vga256 on Fri 29/07/2022 21:20:22
if the roomObject's "Clickable" property is set to false, no object is found at that location. If the roomObject's Clickable property is set to true, an object is found as expected.

Yes it's a default AGS behavior, it's exactly the same with any other type of object. Also afaik it does not show @OVERHOTSPOT@ for nonclickable objects.

The solution have been to remember old value, set Clickable, check, and then revert Clickable to old value.

Maybe we may change this in the future versions, like, providing a "test_clickable" parameter to this function, or something.
Title: Re: AGS 3.6.0 - Beta 11
Post by: vga256 on Sat 30/07/2022 14:47:38
Thanks for the clarification.
Title: Re: AGS 3.6.0 - Beta 12
Post by: Crimson Wizard on Sun 31/07/2022 22:44:43
Updated to Beta 12
(use download links in the first post)

Again, unplanned, this update amends both script API and engine plugin API. The script API changes are small, more like "filling the gaps", where it was trivial.
The plugin api changes are related to font plugin and drawing support.

Editor:
- Fixed "Goto Definition" not working for Enums and Defines (macros).

Script API:
- Added AudioChannel.SeekMs(), complementing PositionMs (as the Seek() function interprets position differently depending on the audio format).
- PlayVideo() now supports an option to play both game's and video's audio track simultaneously.
An updated information on PlayVideo may be found here: https://github.com/adventuregamestudio/ags-manual/wiki/Multimedia#playvideo
(this will be compiled to a manual eventually)

Engine:
- Added SpriteFont plugin to the list of builtins, for ports that use ones. SpriteFont plugin is updated to support custom "Clifftop Games" font variants.
- Added "--background" command line option which forces the game to continue running when in background (aka multitasking mode).
- Fixed AudioChannel.Position/PositionMs could show doubled values for short repeating clips.
- Fixed AudioChannel.Seek and Position are not working correctly for WAV clips (still not working for MOD and MIDI clips).

Engine Plugin API:
- Added IAGSEngine::GetGameInfo() function which returns information about the game, such as its title and GUID.
- Added new render callback AGSE_POSTROOMDRAW, for handling drawing inside the room above all room objects.
- Added IAGSFontRenderer2 interface, expanding the original font renderer interface, improving font plugins support.
- Added ReplaceFontRenderer2() and NotifyFontUpdated() functions.

The new IAGSFontRenderer2 looks like this:
Code (cpp) Select

class IAGSFontRenderer2 : IAGSFontRenderer {
  virtual int GetVersion();
  virtual const char *GetRendererName();
  virtual const char *GetFontName(int fontNumber);
  virtual int GetFontHeight(int fontNumber);
  virtual int GetLineSpacing(int fontNumber);
}

and was primarily added to let font plugins to return font's height and linespacing without utilitizing GetTextHeight.
Title: Re: AGS 3.6.0 - Beta 12
Post by: Pax Animo on Mon 01/08/2022 02:11:23
Heya,

I'm having an issue with beta 11 which involves dialogue scripts, *untested in beta 12

The issue is all dialogue scripts are wiped within the // Dialog script file,  (thank god for backups) as at the moment it's happening randomly but it tends to be happening more often
while editing anything within dialogue scripts.

I'm trying to pin point what triggers this to happen so for now my explanation is rather vague.
Title: Re: AGS 3.6.0 - Beta 12
Post by: Dave Gilbert on Thu 04/08/2022 21:10:13
This just happened to me as well! I don't know what caused it.
Title: Re: AGS 3.6.0 - Beta 12
Post by: Crimson Wizard on Thu 04/08/2022 21:17:30
Quote from: Pax Animo on Mon 01/08/2022 02:11:23
The issue is all dialogue scripts are wiped within the // Dialog script file,  (thank god for backups) as at the moment it's happening randomly but it tends to be happening more often
while editing anything within dialogue scripts.

The Dialogs Editor seem completely broken now.
When I save game and reload, sometimes few last options seem to dissapear.
When I close dialog and reopen within same session - options duplicate.

I don't know if these all are related or different errors.

So at least the latest 3.6.0 releases are not usable (at least if your game has dialogs).
Title: Re: AGS 3.6.0 - Beta 12
Post by: Crimson Wizard on Thu 04/08/2022 22:16:49
There's a temp build with a fix, will be available for download here (in like 20-30 mins from now):
https://cirrus-ci.com/task/6198532477550592

This fixes script and dialog editor's initializations, which had been broken by some unrelated change back in Beta 11.
It definitely fixes the dialog options duplication, and I hope will also fix other strange things happening to dialogs.

EDIT: considering the seriousness of these bugs, I will make a proper update later today.
Title: Re: AGS 3.6.0 - Beta 13
Post by: Crimson Wizard on Fri 05/08/2022 00:50:22
Updated to Beta 13
(use download links in the first post)

This is an emergency hotfix. It fixes the bugs with the dialog editor, when it was duplicating options every time you open a panel. Also *hopefully* fixes the problem with disappearing dialog scripts (I was not able to reproduce that exact issue myself, only seen something similar). Still please keep an eye on dialogs and report if something is unusual (and please make regular backups).

Editor:
- Fixed Dialog and Script panel initialization mistakes that were causing a number of strange errors (regression since 3.6.0.31).
- Fixed Image and View properties in various objects were allowing negative values.
- Fixed some of the object previews (at least GUI) could crash if user entered a non-existing sprite's number as an Image property.

Script API:
- Added File.WriteRawInt() to complement ReadRawInt().



On the topic of the 3.6.0 release, I'm not planning to add anything else here, only fix reported bugs; and there are couple of tasks regarding documentation left.
And this issue with fonts in game templates: https://www.adventuregamestudio.co.uk/forums/index.php?topic=60120.0
Title: Re: AGS 3.6.0 - Beta 13
Post by: Dave Gilbert on Fri 05/08/2022 02:22:56
Thanks so much! Will dutifully check it out in the morning.
Title: Re: AGS 3.6.0 - Beta 13
Post by: Pax Animo on Fri 05/08/2022 02:43:08
Quote from: Crimson Wizard on Fri 05/08/2022 00:50:22
Updated to Beta 13
(use download links in the first post)

(I was not able to reproduce that exact issue myself, only seen something similar). Still please keep an eye on dialogs and report if something is unusual (and please make regular backups).

Thank you for the fix.

It's certainly a tricky one to duplicate, I'll keep posted of any further issues.
Title: Re: AGS 3.6.0 - Beta 13
Post by: Crimson Wizard on Thu 11/08/2022 10:39:43
Another issue found: when engine is playing MP3 music from the full game package it may skip past the end and continue playing audio.vox contents, as if it were one big MP3 file. This is a funny effect, when you start one MP3 clip, but it keeps playing all of them in order.

Following temp build fixes it (will post a proper update later):
https://cirrus-ci.com/task/6254162487803904
Title: Re: AGS 3.6.0 - Beta 14
Post by: Crimson Wizard on Mon 15/08/2022 13:55:42
Updated to Beta 14
(use download links in the first post)

Editor:
- Fixed importing SCI fonts.

Script API:
- Extended Screen.ScreenToRoomPoint() with an optional "restrictToViewport" argument, which lets to choose whether tests over empty place result in conversion through the default viewport or a null pointer.
NOTE: this by default helps to prevent null pointer errors if the player clicks outside of the room view.

Engine:
- Fixed ShakeScreen does not work with Software renderer.
- Fixed audio may fail to initialize, if game's config has one driver set, while SDL_AUDIODRIVER enviroment variable has another.
- Fixed MP3 clips do not stop at the end (nor rewind), and continue to play next MP3 files found in a audio.vox.
- Fixed loading pre-2.55 games (2.50 - 2.54 to be precise, as the current engine still cannot load anything earlier than 2.5).
- Fixed on_key_press callback causing errors in some very old games (probably pre-2.60).
- Fixed restoring legacy savegame format.

Compatibility:
- Support Label.TextAlignment with legacy alignment constants for pre-3.5.0 games made with the custom engine from "Clifftop Games".
- Support native resolution hack for games made with "Clifftop Games" custom engine, where 640x400 games are run as 640x360.
Title: Re: AGS 3.6.0 - Beta 14
Post by: eri0o on Mon 15/08/2022 15:04:08
Hey, the tag is correct, but the name of the release here should be 34 instead of 33 : https://github.com/adventuregamestudio/ags/releases/tag/v.3.6.0.34
Title: Re: AGS 3.6.0 - Beta 14
Post by: tservo on Thu 18/08/2022 21:55:34
Hello I am curious if anyone else has a problem with 3.60 on android namely no mouse cursor or touch input working.Version 3.51 works perfect. Thanks wanted to make sure its not just me.  3.60beta 14 android 11.
Title: Re: AGS 3.6.0 - Beta 14
Post by: Crimson Wizard on Thu 18/08/2022 23:58:34
Quote from: tservo on Thu 18/08/2022 21:55:34
Hello I am curious if anyone else has a problem with 3.60 on android namely no mouse cursor or touch input working.Version 3.51 works perfect. Thanks wanted to make sure its not just me.  3.60beta 14 android 11.

Hello. I just tried latest android build (3.6.0 beta 14), and everything works fine. I have an old simple device with Android 5.1, if that matters.

Please tell, are you running games using the game launcher (aka "AGS Player") or compiling your own game apks for Android?
When you say "there's no cursor" do you mean there's actually no cursor image on screen right after you run the game?
Does this happen with particular games, or virtually any?
Title: Re: AGS 3.6.0 - Beta 14
Post by: tservo on Fri 19/08/2022 00:21:28
I am using the ags launcher. the games start up but then no matter where i press on the screen ( i have show spots enabled to see where i press) nothing happens. the games that show an actual cursor or mouse with v3.51 show nothing on screen in 3.60 at the start screens . it happens with all games and games made to run specifically in 3.60 only as well. 3.51 works almost flawless on dozens of games using android 11.  the backbutton works bringing up keyboard and special keys and i can exit that way. it is as if the player doesn't register any inputs. i tried the settings in preferences no difference. thanks for responding.  oh and it is the same with beta 13 or before.i also tried debug and release apks  same thing.
Title: Re: AGS 3.6.0 - Beta 14
Post by: eri0o on Mon 22/08/2022 14:02:26
@tservo, can you be specific at which device you have where this is happening? I need to be able to reproduce it.

I do have a test in mind I could make for you to try.
Title: Re: AGS 3.6.0 - Beta 14
Post by: tservo on Mon 22/08/2022 20:55:42
My device is one plus 10 Nord 5g with Android 11.ags ver 3.51 works great all input touches work. Ags player 3.60 no inputs registered at start screen on any games.i have some games that require 3.60 that ags 3.51 cannot play. The games start ok but again no inputs register and no mouse cursor appears   thank you for helping
Title: Re: AGS 3.6.0 - Beta 14
Post by: eri0o on Tue 23/08/2022 02:47:18
@tservo, if you have time, can you try this apk: AGS-3.6.0.34-release-experimental.apk (https://github.com/ericoporto/ags/releases/download/v.3.6.0.20.afix/AGS-3.6.0.34-release-experimental.apk) ?
Title: Re: AGS 3.6.0 - Beta 14
Post by: tservo on Tue 23/08/2022 04:18:45
Hello I uninstalled the v3.60 i had on android and installed this experimental ver. Good news is 3.51 games and 3.60 games load and play and the mouse cursor is showing and the left mouse button click with one finger touch now works but the rmb hold one finger use 2nd finger is not responding or working.  i tried a bunch of games that switch icons with rmb and none respond to the hold finger use 2nd finger. looks like something still prevents that. thank you again for fixing some of it .
Title: Re: AGS 3.6.0 - Beta 14
Post by: eri0o on Tue 23/08/2022 09:10:11
Right click is not implemented in this version, this is using the regular SDL touch->mouse convertion, which simply doesn't have it. I also did not understand previously if you were using only touch screen or if you had any additional device connected to your phone - like a Bluetooth mouse, or a Wacom/Samsung S-Pen.
Title: Re: AGS 3.6.0 - Beta 14
Post by: Crimson Wizard on Tue 23/08/2022 13:40:32
Quote from: eri0o on Tue 23/08/2022 09:10:11
Right click is not implemented in this version

You probably mentioned this earlier, but I missed or forgot. Does this mean that AGS 3.5 could emulate right click on Android, but 3.6 cannot? If so, this is a problem that should be documented. Could you open a ticket describing this situation, and what prevents from having similar functionality?
Title: Re: AGS 3.6.0 - Beta 14
Post by: eri0o on Tue 23/08/2022 14:29:48
Is it alright to add in #1716 (https://github.com/adventuregamestudio/ags/issues/1716) ? The general gist is there's no touch handling at all in AGS, and we rely on the default touch->mouse translation from SDL2. I believe it's better to design the API/behavior in a way that touch directly can be handled by the game developer, as in #1538 (https://github.com/adventuregamestudio/ags/issues/1538) and later figure this other behavior, so that it doesn't conflict, as I believe it's more important to enable proper touch support.

Essentially
Title: Re: AGS 3.6.0 - Beta 14
Post by: Crimson Wizard on Tue 23/08/2022 14:40:30
Quote from: eri0o on Tue 23/08/2022 14:29:48I believe it's better to design the API/behavior in a way that touch directly can be handled by the game developer, as in #1538 (https://github.com/adventuregamestudio/ags/issues/1538) and later figure this other behavior, so that it doesn't conflict, as I believe it's more important to enable proper touch support.

But right now there's no proper touch API, as you point out, while the missing ability to simulate right click makes "AGS Player" unusable for a large list of games, which will defeat its purpose to a significant degree. The 3.6.0 version was supposed to keep the behavior as much as possible, while switching to SDL2. It's clear that touch API won't get in 3.6.0, and not known when it will be added; therefore in my opinion it is logical to add a right click emulation to 3.6.0 if there is a technical opportunity for that.

I may look into this too, if you don't want to hack around this emulation and focus on the future things. But I'll have to learn how touch events work, and how does "touch->mouse translation" in SDL work.

If, after the touch API is designed and integrated, it will be found that the emulated controls somehow conflict with it, then these emulated controls could be adjusted again, as touch API will have a priority.
Title: Re: AGS 3.6.0 - Beta 15
Post by: Crimson Wizard on Thu 01/09/2022 07:09:27
Updated to Beta 15
(use download links in the first post)

Editor:
- "Attach game data to exe" setting's default value is now "false". This is to encourage users to have separate exe and data. Binding data to exe may cause troubles, for instance anti-viruses do not like AGS games because of this.
- The TextWindow edges now have distinct names in the dropdown list of the property grid.
- Fixed in dialogs numbers inside names were incorrectly highlighted as numeric values.
- Fixed error in dialog scripts occurring when the digit is a part of a character name.
- Fixed in dialogs character's script name on a regular script line was styled like a character's dialog name.

Script API:
- Added Mouse.AutoLock property that toggles automatic mouse lock inside the game window.

Engine:
- Fixed pressing '`' key for showing console did not work if the "new key handling mode" was enabled.
- Fixed calling System.Log in script would cause previous log messages overwritten in the game console.
- Fixed Ctrl+Alt was not working for toggling mouse lock.




I think this may be the last Beta update. There are couple of minor things that are currently missing, like some Android config options are not doing anything anymore (perhaps they may be hidden temporarily). If no serious problems are found soon, I'll make this a "Release Candidate" version.

There are 2 known missing functionalities, but these are not often used, and at the same time difficult to fix because they depend on libraries. So, in my opinion, we may leave them for the future patches.
These functionalities are:
1) AudioChannel.Position and Seek are not working for MIDI and MOD clips. These are clip type specific commands that allow to position playback not by time but by beat/pattern. PositionMs and SeekMs are working though.
2) AVI videos were discontinued, because they were using Windows-only system feature to play. Today it's recommended to use OGV videos with AGS anyway.
Title: Re: AGS 3.6.0 - Beta 15
Post by: Pax Animo on Thu 01/09/2022 19:19:06
ALT+ENTER for full screen toggle has stopped working for me with this build.
Title: Re: AGS 3.6.0 - Beta 15
Post by: Crimson Wizard on Thu 01/09/2022 19:37:21
I made a typo, and it became Shift + Enter
Title: Re: AGS 3.6.0 - Beta 15
Post by: Crimson Wizard on Thu 01/09/2022 22:06:56
Okay, I reuploaded the fixed build again (same links).
Title: Re: AGS 3.6.0 - Beta 15
Post by: Pax Animo on Thu 01/09/2022 22:21:58
Quote from: Crimson Wizard on Thu 01/09/2022 22:06:56
Okay, I reuploaded the fixed build again (same links).

Great, I'd never of gotten use to  "Shift + Enter"  ;)
Title: Re: AGS 3.6.0 - Beta 15
Post by: Pax Animo on Fri 02/09/2022 19:34:56
Bit of a tricky one to explain, I'll add a screeny too,

It's a problem with the properties panel with GUI's, when switching between buttons and labels via the pull down menu it seems to get stuck in the wrong properties screen, my only way out of this is to restart the editor.

(https://imgur.com/fEdcTtp.pngl)

As you see just under properties i should be in the main GUI properties but I'm not, I'm in bEngineering properties.

(https://imgur.com/1YE558v.pngl)

Again I should be in button3 properties but I'm stuck in gTasks properties.

Note: only happens via the drop down menu, clicking the buttons and labels on the main editor screen correctly changes the properties window.

Title: Re: AGS 3.6.0 - Beta 15
Post by: eri0o on Fri 02/09/2022 21:40:31
erh, I tried this under VS debugger and propertyObjectCombo_SelectedIndexChanged is not firing at all for me. I don't understand why yet.

Edit: created an issue in the bug tracker (https://github.com/adventuregamestudio/ags/issues/1760) to register this.
Title: Re: AGS 3.6.0 - Beta 15
Post by: Crimson Wizard on Fri 02/09/2022 22:43:51
So, apparently this only happens if you have some Color Theme enabled; does not happen with default theme.
Title: Re: AGS 3.6.0 - Beta 15
Post by: Pax Animo on Sat 03/09/2022 16:03:12
Hey,

Not sure if you're aware by now as i see your looking into this issue but there also seems to be a similar issue with hotspots pull down menu.

(https://imgur.com/ZQjBPvY.pngl)
Title: Re: AGS 3.6.0 - Beta 15
Post by: Crimson Wizard on Mon 05/09/2022 13:05:15
There's a build with the property list fixed, and also couple of more unrelated fixes:
https://cirrus-ci.com/task/4682187336318976
Title: Re: AGS 3.6.0 - Beta 15
Post by: rongel on Fri 16/09/2022 11:10:33
I just updated to the latest 3.6.0, a big thanks to everyone who is involved in it!

I have one issue: The audio panning does not work anymore with stereo clips. There was some discussion about the topic earlier:

Quote from: Crimson Wizard on Wed 27/04/2022 06:39:17
Yes, Panning is not working within the sound library again (not sure if it worked before).

EDIT: It's confirmed that with the new sound library the Panning does not work for stereo clips, only works for mono clips, allegedly according to the OpenAL specification.
We need to investigate of the available solutions.
Opened ticket: https://github.com/adventuregamestudio/ags/issues/1637

EDIT2 According to the OpenAL specs:
https://openal.org/documentation/OpenAL_Programmers_Guide.pdf (page 21)
Quote
Buffers containing more than one channel of data will be played without 3D spatialization.
This basically means that stereo wave is not positioned by OpenAL in 3D space, only mono wave is.

In 3.5.1 version stereo clips worked fine when panning. I can change the clips that require panning to mono, but ofcourse it would be great to have that functionality back again. Any news about this issue? Should I just go with the mono versions?

+ One small extra gripe, but I also miss the yellow auto brace highlight when writing code. Other than that, everything seems great!
Title: Re: AGS 3.6.0 - Beta 15
Post by: Crimson Wizard on Fri 16/09/2022 13:33:51
Quote from: rongel on Fri 16/09/2022 11:10:33
In 3.5.1 version stereo clips worked fine when panning. I can change the clips that require panning to mono, but ofcourse it would be great to have that functionality back again. Any news about this issue? Should I just go with the mono versions?

Overall, the stereo sounds and panning seem to contradict each other, because stereo already defines by itself which track to play from which direction.
The panning of stereo clips that was implemented in the old engines was not a real "panning", technically, but a balance shift, which is a different kind of effect. This may be proved by making a stereo clip that has two different tracks in two channels: when panning in 3.5.1 (and earlier) you will notice that one track will loose the volume while other will gain it, instead of moving whole combined clip in the 2D space.

I don't think that this will be restored in this version; it may be restored in the later updates (patches) if it's found that this is necessary for backward compatibility when running old games. Additionally this "balance" effect may also be implemented properly on its own, with respective command, at some point in the future.

As for properly panning the stereo sounds, this may only be achieved by converting them to mono, either when you create assets, or by the engine itself; although in the latter case the problem is that engine will need to know when the sound is supposed to be panned. If there's no such indication, then it might have to do so dynamically when the clip is commanded to pan, which might add to the program's CPU load.

Quote from: rongel on Fri 16/09/2022 11:10:33
+ One small extra gripe, but I also miss the yellow auto brace highlight when writing code. Other than that, everything seems great!

Can you clarify this? We've upgraded the library behind the script editor, and some things may still not be fully restored, but I think it's a matter of adding a fix or two.
Title: Re: AGS 3.6.0 - Beta 15
Post by: rongel on Fri 16/09/2022 14:58:34
Ok, thanks for the detailed answer CW!

I'll switch to mono sounds when there's panning involved. There could be a mention of stereo sounds not working with panning in the Upgrading to AGS 3.6 page: https://adventuregamestudio.github.io/ags-manual/UpgradeTo36.html. Also, there could be a mention of this in the manual in the AudioChannel.Panning section. At first I thought that the panning was broken, when my sounds stopped working.

QuoteCan you clarify this? We've upgraded the library behind the script editor, and some things may still not be fully restored, but I think it's a matter of adding a fix or two.

This issue was mentioned before by greg, I think he explained it quite well:
Quote2. The editor no longer automatically highlights matching braces as I type.  Instead, after typing the brace, I need to press Ctrl+B to highlight the corresponding brace.  Is that intended?

So the editor used to highlight the matching brace as yellow automatically when typing. If there was too many braces, the editor highlighted the extra brace red. This made it easy to see if the braces match or not. Hope this makes it more clear!
Title: Re: AGS 3.6.0 - Beta 15
Post by: eri0o on Sat 17/09/2022 21:00:37
Can you point me to a version that had this said brace highlighting? I just tested the latest 3.5.1 and it doesn't have it afaict.
Title: Re: AGS 3.6.0 - Beta 15
Post by: Crimson Wizard on Sat 17/09/2022 22:20:13
Quote from: eri0o on Sat 17/09/2022 21:00:37
Can you point me to a version that had this said brace highlighting? I just tested the latest 3.5.1 and it doesn't have it afaict.

It works for me in 3.5.1. EDIT: to clarify, this works with the round braces around function parameters, not curved braces around a block of code.

For example, if you type "func(asd)" the braces will be highlighted yellow the moment you place second brace. If you type "func(asd))" the third brace will be highlighted with red.
Title: Re: AGS 3.6.0 - Beta 15
Post by: eri0o on Sun 18/09/2022 01:02:40
@rongel, can you tell me if this version of braces highlighting (https://cirrus-ci.com/task/4856325006950400) works for you? (you can get the AGS compressed archive by clicking in Archive)
Title: Re: AGS 3.6.0 - Beta 15
Post by: rongel on Sun 18/09/2022 09:48:36
Ok, here's more testing results. And by the way, I'm using Windows 7 at the moment (working on my older laptop for a awhile). Normally I use Win 10 (I believe it behaved in a similiar way). Also the highlighting works in the dialog editor, but not in the script editor.

AGS 3.5.1.21

Script editor:
- Round braces working
- Curvy braces NOT working

Dialog editor:
- Round braces working
- Curvy braces working

AGS 3.6.0.35

Script editor:
- Round braces NOT working
- Curvy braces NOT working

Dialog editor:
- Round braces working
- Curvy braces working

eri0o's version

Script editor:
- Round braces kind of working: Works only when typing the brace, then typing another item next to it and deleting it by backspace
- Curvy braces kind of working: Works only when typing the brace, then typing another item next to it and deleting it by backspace

Dialog editor:
- Round braces kind of working: When typing the first brace, it gets instantly highlighted as red, typing the second brace highlights them yellow
- Curvy braces kind of working: When typing the first brace, it gets instantly highlighted as red, typing the second brace highlights them yellow
Title: Re: AGS 3.6.0 - Beta 15
Post by: eri0o on Sun 18/09/2022 10:29:41
I made so that it doesn't require typing, whenever the cursor is near a brace it will highlight a pair, matching is yellow, non-matching is red, typing or not. Need to check why this is not the observed behavior.

Edit: Manage to find and fix the difference between script editor and dialog editor in my version, a build is here (https://cirrus-ci.com/task/6609347248652288), under archive.

Edit2: Made a new version here (https://cirrus-ci.com/task/5247456857292800) that skips the brace matching when typing the first { or ( character, so it's only red when later you place the typing cursor on an unmatched brace, but not while typing, to be more similar to the previous behavior.
Title: Re: AGS 3.6.0 - Beta 15
Post by: rongel on Mon 19/09/2022 07:01:56
Thanks for the new versions eri0o! The checking of the braces (cliking next to them) is a handy feature. I still miss the automatic highlighting when typing in the script editor, now it works only in the dialog editor. To make them behave in a same way would be logical.
Title: Re: AGS 3.6.0 - Beta 15
Post by: arj0n on Wed 21/09/2022 16:29:24
a small typo in the warning message when a character LoseInventory (item) while this item is not in character's inventory:

(https://dam1976.home.xs4all.nl/AGS/editor%20warning%20typo/2022_09_21_17_06_33_An_error_has_occurred.png)

AGS Editor versions checked, typo is present:
Title: Re: AGS 3.6.0 - Beta 15
Post by: greg on Sun 25/09/2022 15:30:51
Hi, I noticed a regression in AudioChannel.PositionMs after the recent updates to AudioChannel.Seek() and AudioChannel.SeekMs().

Specifically, right after calling ch.Seek(pos) or ch.SeekMs(pos) and in the game cycle after the call, ch.PositionMs equals 0 rather than pos.

Here's my test:

// Context:
// aAudioClip is an ogg file.
// My game speed is 80, so Wait(40) is roughly 500 ms.
// MsgLog() is a custom function that writes the output to the console and a log file.

AudioChannel* ch = aAudioClip.Play();
Wait(40);
MsgLog(String.Format("PositionMs: %d", ch.PositionMs));  // ch.PositionMs is ~500 (487), as expected
Wait(80);
MsgLog(String.Format("PositionMs: %d", ch.PositionMs));  // ch.PositionMs is ~1500 (1486), as expected
Wait(40);
ch.SeekMs(8000);
MsgLog(String.Format("PositionMs: %d", ch.PositionMs));  // ch.PositionMs is 0, should be 8000
Wait(1);
MsgLog(String.Format("PositionMs: %d", ch.PositionMs));  // ch.PositionMs is 0, should be ~8000
Wait(1);
MsgLog(String.Format("PositionMs: %d", ch.PositionMs));  // ch.PositionMs is 8000, as expected

Wait(40);
MsgLog(String.Format("PositionMs: %d", ch.PositionMs));  // ch.PositionMs is ~8500 (8533), as expected

Thanks,
Greg
Title: Re: AGS 3.6.0 - Beta 15
Post by: Crimson Wizard on Mon 26/09/2022 04:36:41
@greg, there's a temp build with this fixed (hopefully):
https://cirrus-ci.com/task/5434752730660864

also fixed several other minor problems. I think we'll have a proper new update soon.
Title: Re: AGS 3.6.0 - Beta 15
Post by: greg on Tue 27/09/2022 02:18:10
Thanks, CW!  That fixed it.
Title: Re: AGS 3.6.0 - Beta 15
Post by: selmiak on Tue 27/09/2022 22:11:14
what do I do with the files in the web folder when I want to have the game be playing in browser on itch? Zip it up and upload it? upload the files individually? any more settings to set? is there a manual for that somewhere?
Title: Re: AGS 3.6.0 - Beta 15
Post by: eri0o on Tue 27/09/2022 23:59:43
@selmiak I wrote a little about it on the topic for the web port here (https://www.adventuregamestudio.co.uk/forums/engine-development/ags-engine-web-port/) in the forums.

I haven't added anything specific in the manual are there may be differences in the manual. If you ask for clarifications in the topic I can try to improve it there in the web port topic. Theoretically, zipping and uploading to itch.io should suffice.
Title: Re: AGS 3.6.0 - Beta 15
Post by: selmiak on Wed 28/09/2022 00:06:03
well, if that is enough I need no more manual  :-D
but I'll read up some more in the topic as well :)
Title: Re: AGS 3.6.0 - Beta 15
Post by: Crimson Wizard on Mon 03/10/2022 20:52:48
Quote from: rongel on Sun 18/09/2022 09:48:36AGS 3.6.0.35

Script editor:
- Round braces NOT working
- Curvy braces NOT working

It's interesting, that I found that braces highlighting does work in 3.6.0.35, but it depends on some circumstances.
For instance, if you have curved braces after round ones, the round ones are not highlighted (if you retype them).

I don't remember what happened when I tried this last time (where round braces did not work at all, or so it seemed), but this is all quite confusing.
Title: Re: AGS 3.6.0 - Beta 15
Post by: Crimson Wizard on Fri 07/10/2022 00:25:37
Updated to RC 1
The update is posted in a new forum thread here:
https://www.adventuregamestudio.co.uk/forums/ags-engine-editor-releases/ags-3-6-0-release-candidate-rc1

Changes since the last beta:

Editor:
- Expanded UI color theme format, support global color options and allow missing entries.
- In Preferences replaced "Import Color Theme" with a "Open Theme Folder", as a temporary solution for managing theme files.
- Fixed autocomplete crashing the editor if there was an import declared with type and variable having identical names, and user tries to type that variable's name and a dot to access its members.
- Fixed matching or mismatching braces were not highlighted consistently at all times in regular and dialog scripts.
- Fixed object selection combobox on a property grid was not working correctly if any color theme is applied.
- Fixed blurry sprites in the sprite list (usually happened with high-res sprites).
- Fixed editor plugins might cause errors if calling Script.SaveToDisk() (e.g. SpeechCenter plugin).

Engine:
- Added missing "DrawSprite" function for "agsblend" plugin stubs.
- Fixed loading pre-3.5.0 games on big endian systems.
- Fixed parser's textbox not drawn on the correct position in dialog options.
- Fixed AudioChannel.PositionMs incorrectly returning 0 right after Seek.
- Fixed voice-over becoming disabled if Game.ChangeSpeechVox() was called again with the active vox's name.
- Fixed ListBox.FillSaveGameList() for games with custom save extension.
- Fixed Overlay.SetText() could lead to errors and unexpected behavior.
- Fixed overlays drawn as textwindows could be displayed with offset after restoring a save (again).
- Fixed Software renderer displaying a game frame misaligned in fullscreen, if there are black side borders.
- Fixed mouse cursor could leave the game screen on some systems, and mouse.x, y values reporting offscreen coordinates.

Android:
- Implemented two touch-to-mouse control scheme (selectable in config), for one finger emulating LMB only, and for two fingers emulating LMB and RMB.
- Support relative motion speed setting for touch-to-mouse emulation.
- Fixed on-screen keyboard wasn't printing characters.

OSX:
- Restored Ctrl+LMB working as a RMB on Mac.
Title: Re: AGS 3.6.0 - Beta 15
Post by: Baguettator on Sun 09/10/2022 12:13:57
Hi and congrats for the new release ! I tested a few times and the new visuals things are very appreciated ! As for the other features :)

I probably already ask the question, but I want to (re)ask it in case of some plans could have changed, because AGS development seems to be in a good mood : is AGS editor going to work with PNG files for functions like DrawImage or DynamicSprites.CreateFromFile ? As far as I know, CreateFromFile can't use alphachannels, and sometimes it is a problem.

Another question was in my mind : is it convenient if we get the possibility to have items in listboxes that are cut if the items' text is too long, ending with a "..." ? It could be very nice to have this feature independantly of the "Guicontrol cut their content" option, because for listboxes it's a special case.

Again for listboxes : could we have directly in the editor a way to "change" the visuals for their arrows ? And eventually for a slider to scroll them ? It could minimize the scripting, because for now we have to script and create tons of buttons for that.

Again and again : thanks for all your work on AGS, it's really a very nice thing :)
Title: Re: AGS 3.6.0 - Beta 15
Post by: Crimson Wizard on Sun 09/10/2022 13:09:53
Quote from: Baguettator on Sun 09/10/2022 12:13:57is AGS editor going to work with PNG files for functions like DrawImage or DynamicSprites.CreateFromFile ? As far as I know, CreateFromFile can't use alphachannels, and sometimes it is a problem.

This is of course a good idea to switch to/support using PNGs everywhere, so likely in the future.

Quote from: Baguettator on Sun 09/10/2022 12:13:57Another question was in my mind : is it convenient if we get the possibility to have items in listboxes that are cut if the items' text is too long, ending with a "..." ? It could be very nice to have this feature independantly of the "Guicontrol cut their content" option, because for listboxes it's a special case.

Again for listboxes : could we have directly in the editor a way to "change" the visuals for their arrows ? And eventually for a slider to scroll them ? It could minimize the scripting, because for now we have to script and create tons of buttons for that.

I don't know, but all of the above is possible to implement by scripting custom list box controls, using DrawingSurface (without any extra buttons too).