Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Topics - Crimson Wizard

#181
AGS Engine & Editor Releases / AGS 3.4.0
Thu 15/09/2016 21:10:25
AGS 3.4.0 released
Final release number: 3.4.0.12







Released: 15th September 2016

Previous stable version: AGS 3.3.5 forum thread


A minute of attention for those who did not have a chance to check 3.4.0 during its development:
AGS 3.4.0 contains a big load of changes, which may take a while to explore. The following (read-only) topic is created to make getting used to it easier:
http://www.adventuregamestudio.co.uk/forums/index.php?topic=52499.0

Also, please, read "Upgrading to AGS 3.4" topic in the manual that comes with this version. It contains important information on most notable new features and few potential problems you may encounter when upgrading older projects.

Another important note on upgrading your project to latest 3.4.0 (read under spoiler):
Spoiler

AGS 3.4.0 now has a "Script API version" and "Script compatibility level" switches, which determine a range of built-in script functions you may use in your game (also called Script API).
"Script API Version" defines the TOP limit, or the latest version of scripting your game uses.
"Script compatibility level" defines the BOTTOM limit, or which OLD functions should still be available.

When you upgrade your game project from the older versions (3.3.* and lower), the Editor automatically sets "Script compatibility level" corresponding to the version of AGS this project was last saved in. This is done for backward compatibility. But you can change that anytime. Be prepared, however, that you may have to fix certain parts of your script. Usually necessary fixes are limited to renaming functions. Also, it is suggested to do "Rebuild all files" after you change any of those two switches.
[close]



What is new in 3.4.0

Common features:
- Added support for building game for multiple platforms (Windows and Linux options are maintained now).
- Added custom game resolutions.
- Added extended WFN font support (up to 256 characters).
- Made custom property values modifiable at runtime.
- Removed limit on custom properties number (was 30 properties per project), increased maximal property name and value length.
- Removed limit on GUI Control number (was 30 per GUI), increased maximal control name length.
- Removed limit on script modules number (was 50).
- Added Locked property to room Objects.
- Added Padding property for TextWindow GUI.

Editor features:
- New splash screen.
- Exposed Clickable property for room Objects in the Editor.
- Exposed TintLuminance property for room Regions in the Editor.
- Added "Close all tabs" command for the pane's context menu.
- Added Preferences option "Prompt dialog on closing multiple tabs".
- The sprite editor now highlights drop targets when you drag sprites around.

Editor Plugin API:
- Exposed GUI Panes to plugin API.

Engine features:
- Added support for any runtime display resolution (now restricted only by your system specifics).
- Added support for vertical sync in Direct3D rendering mode.
- Made engine try to use all implemented graphic renderers in the order of priority, if user selection failed to initialize.
- Rised default sprite cache limit for desktop platforms to 100 MB (was 20).
- Game writes latest translation and mouse speed setting to config file on exit.

Scripting features:
- Added managed user structs; although currently limited to containing only non-pointer variables in them.
- Added support for dynamic arrays in non-managed structs.
THERE ARE KNOWN ISSUES:
Spoiler

It was found that dynamic arrays in struct do not work when you make an array of those struct, for example:
Code: ags

struct MyStruct
{
    int dynamic_array[];
};

MyStruct single_object; // <--- this will work
MyStruct arr_of_structs[10]; // <--- this won't work

Such array caused troubles which were too complicated to fix in time, and require more time to investigate. A decision was made to block creation of arrays of structs, containing dynamic arrays. If you try to declare one in your script you will get an error. Hopefully this restriction will be raised in the future updates.
[close]
- Added support for dynamic array as return value of the struct's member function.
- Added support for static extender functions.
- Added "do..while" kind of loop, in addition to previously existing "while".
- Added "for" operator and related loop construct.
- Added "switch" and "case" operators and related branching construct.
- Added "break" and "continue" operators working in any loop or switch.
- Added missing compound assignment operators (*=, /=, and so on).
- Made preprocessor macros usable in definition of another macro.
- Added "#region" and "#endregion" preprocessor commands.

Script API:
- Added Script API version switch to the project's General Settings. For every supported API version a "SCRIPT_API_vXXX" macro is introduced, where XXX are version numbers.
- Added Script Compatibility Level switch to General Settings. For every compatible version a "SCRIPT_COMPAT_vXXX" macro is introduced.
- Added AudioChannel.Speed property.
- Added CharacterDirection enum and optional "direction" parameter for Character.ChangeRoom().
- Added Character.FaceDirection().
- Added Character.DestinationX and Character.DestinationY properties.
- Added RunActiveOption() and Update() member functions to the DialogOptionsRenderingInfo type.
- Extended Dialog Options API: added support for dialog_options_repexec() and dialog_options_key_press() functions to improve handling of the custom dialog options; added related compatibility project option and support for "NEW_DIALOGOPTS_API" macro in scripts.
- Added game.dialog_options_highlight_color variable.
- Added File.Seek() function and File.Position property.
- Added IsInteractionAvailable() method to Hotspot, Object and Character types.
- Added Game.AudioClipCount property and Game.AudioClips[n] array.
- Added Game.IsPluginLoaded().
- Added GUIControl.ZOrder property.
- Added GUI.Click() and Button.Click() functions which call OnClick event handler of corresponding GUI or button.
- Added GUI.ProcessClick() function that processes click on GUI only, similarily to how old ProcessClick processed click on room objects only.
- Added Mouse.Click() function to simulate mouse click on screen.
- Added Room.GetProperty() to substitute global GetRoomProperty().
- Added Room.ProcessClick() to substitute global ProcessClick().
- Added SetProperty() and SetTextProperty() functions to Room, InventoryItem, Hotspot, Object and Character types.
- Added optional "luminance" parameter to Region.Tint() and Region.TintLuminance readonly property.
- Added SetAmbientLightLevel() to set global light level for anything in the room.
- Added Character.SetLightLevel() and Object.SetLightLevel() functions to set individual light levels. Negative light levels can be used in 8-bit games to produce darkening effect.
- Added System.RuntimeInfo property which returns a short description of current graphics mode, scaling filter and enabled game resources.

Editor bug fixes:
- Fixed Undo history was deleted when an Editor panel changes its docked state.
- Fixed crashes under certain circumstances when a script editor is closed.
- Fixed crash if selecting a character without a normal view in the room editor.
- Fixed Ctrl+Tab did not work for the first time when cycling through opened editor tabs.
- Fixed "Go to Line..." command did not always move cursor to correct line. Also, do not select that line.
- Made the project completely rebuild itself whenever "Enable Debug Mode" value in the General Settings differs from the setting used for the last build, to prevent inconsistency in compiled scripts.
- Fixed a crash when trying to run game setup from the Editor while "Compiled" folder does not exist.
- Fixed project items could sometimes get incorrectly arranged inside the folder.
- Fixed writing faulty timestamps in project file on some occasions that could spoil usage of file versioning control.
- Fixed Help window positioning on multi-monitor desktop.
- Fixed error in autocomplete occuring when there is a single-line comment in the end of the script.
- Fixed incorrect compiler parsing of a static function call inside array index brackets.
- Fixed compilation of struct member functions having name identical to existing global function.
- Fixed compilation of structs having members with names identical to non-basic types, global variables and game entities (such as characters, GUI, etc).
- Corrected few error messages related to struct's function declaration.
- Fixed compiler reporting errors as "runtime errors" under certain circumstances.

Engine bug fixes:
- Fixed result of using transparency parameter of the DrawingSurface.DrawImage() in 32-bit games when drawing opaque sprites over surfaces with alpha channel.
- Fixed DynamicSprite.CopyTransparencyMask() was overwriting magic transparent pixels on destination with alpha values from mask.
- Fixed the speech portrait position was not adjusted for character walking between its lines, when BasedOnCharacterPosition portrait placement is used.
- Fixed occasional pathfinding failure on straight lines with complex walkable areas.
- Fixed using '[' special character in Display-like commands discarded all of the backslashes before it (e.g. "\\[" should now print \[ as expected).
- Fixed WAVE audio not looping after restoring a game
- Fixed a bug that caused MP3 clip continuously increase its base volume if the directional volume modifier was applied.
- Fixed queued audio clips did not update their volume when default audio type volume changes.

WinSetup:
- Added support for "default_translation_name" option in the "[language]" section of the config file.





Thanks to everyone who contributed to and tested this version!



#182
I've spent the last two weeks trying to make myself work on some future feature I wanted to add to AGS, and even though I managed to force myself to make some progress, I realized again that I do not really want to do this.

I know I have tried to quit several times already, but I usually waited for too long, having the stress and desperation fill up to the point when I experience another breakdown and burst into another tantrum. I do not want for this to happen again.
I know that some people think that I do a good thing with this project, but I am not sure if that's true. I honestly do not get anything positive from it. There were few bright moments, but they were quickly fading away. There is no pleasure, no feeling of accomplishment, nothing. Regardless of what I do, it never feels like work is done, quite contrary, it feels like the destination is not any closer.
This may be irrational, because obviously some problems were solved, but when I try to tell this to myself, it somehow does not work.

I was trying to understand what keeps me working on this program, but in the end it seems that it is nothing good. Maybe it is the silly pride, which does not let me acknowledge the defeat; or maybe it is not the pride, but fear of failure... Somehow it happened that I never was able to complete any project in my life... like at all... I kept quitting all the time. And perhaps I am also afraid of searching for a new work, because I do not believe in myself anymore after failing so many times. Even thinking about doing something else makes me feel so bad because I do not believe that I can do anything.

But really, this is a choice between trying something different and forcing the same thing over and over again until I get completely insane. I had so many plans, and half-made work that I hoped to put into the engine, which would be a real pain to throw out, but I must let it go, because the more I keep myself bound to this work, the harder it will be to recover after I finally quit.
#183
AGS 3.3.5 - Patch 7 released



Released: 10th September 2016

Previous version: AGS 3.3.4 forum thread



Please, read the information under "spoiler" if you are new to 3.3.5 before using it
Spoiler

Since 3.3.5 AGS does not allow to write any files into other path rather than "$SAVEGAMEDIR$"
(personal user saves directory) or "$APPDATADIR$" (all-users game data directory). If you attempt to open
file for writing using relative path without location tag, the filepath will be automatically remapped to
$APPDATADIR$ location.

Because of that, for backwards compatibility reasons, when you try to open file for reading using relative path
without location tag, AGS will first look for that file in $APPDATADIR$, and only if no matching file is
found there, then the game installation directory will be checked.

To force opening file in the game installation directory (for reading) a new location tag was introduced:
"$INSTALLDIR$". When using this tag you will explicitly tell AGS to look in and only in the game's
installation directory. However, if you try opening file for writing at such location, that will result in
failure.

Players are now allowed to set up their own custom path in game setup, where the game
saves & data will be written. This is done in the game setup program.
This works as if $SAVEGAMEDIR$ and $APPDATADIR$ were redirected to custom location.
Redirection is done internally by the engine, you do not need to add anything to your game scripts to make it work.

Conceptually, AGS is gradually leaning towards using only "symbols of file locations" rather than actual,
explicit locations on the filesystem.

Furthermore, game setup will now write config file into game saves location, rather than game's installation directory.
If config file is present in the game installation folder, then it is used as "default" read-only config file.
The config in saves folder overrides default one.
This way it should be totally safe to install AGS games into C:/Program Files, without having administrative rights.
[close]
Also check "Upgrading to AGS 3.3" AND "Upgrading to AGS 3.3.5" topics in the manual that comes with this version. They contain important information on few potential problems you may encounter.


Changes in the Patch 7:

Editor:
- Fixed "Check for updates" feature, which should now be compatible with the new website.

Engine:
- Allow to run game without mouse installed (game won't abort).
- Fixed SetSavegameDirectory() to be compliant with the new script path rules. Now if you pass a save directory without specifying $MYDOCS$ tag, the directory will be created as a subdirectory of default saves path. If the player has configured a custom save path, SetSavegameDirectory() will properly keep subdirectories after remapping paths.
- Fixed missing slash after special directory token in the script file paths could cause a creation of directory outside of permitted location.
- Fixed plugins with dot (".") in their name failed to load (regression).
- Fixed display gamma forcedly reapplied every time save is restored.


Changes in the Patch 6:

Editor:
- Fixed properties buttons dissapearing from the Properties panel if the object was selected while the panel was not visible.

Engine:
- Fixed Display script functions displaying different text if there is any variadic text formatting function called in repeatedly_execute(). (regression)
- Fixed text formatting functions did not parse "%%" format properly. (regression)

Templates updated:
- Sprite 2008 was fixed in "Default Game" template (transparent area was not really transparent).


Changes in the Patch 5 (relevant for Linux users mainly):

Linux port:
- Fixed user's allegro.cfg was ignored.


Changes in the Patch 4:

Compiler:
- Fixed crash occuring when there is an incomplete declaration in the end of script.

Engine:
- Engine will fall back to using default system paths if it failed using player-defined custom save path for any reason.
- Fixed engine displaying same warning twice if the loaded game was compiled for higher version of AGS.

WinSetup:
- Only let player choose actually existing folders for custom save paths.


Changes in the Patch 3:

Engine:
- Fixed "datafile" config option was ignored.
- Fixed "datadir" config option was never used when searching for possible game location
  (this was broken for several years!).
- Fixed Game.FileName property return empty string.
- Fixed built-in console making Direct3D9 graphics driver crash in 16-bit games.

Templates updated:
Reverted Verb Coin template to version 1.7.2, because the newer 2.0.0 version is bugged and it is not known if it can be correctly used at all.


Changes in the Patch 2 (relevant for Linux users mainly):
Engine:
- Fixed program compilation on big-endian systems.
- Fixed program compilation with GCC 6.


Changes in the Patch 1:

Engine:
- Added support for $INSTALLDIR$ location tag in the filepaths used in the script.
- Fixed game could not find files in the current directory when run from the Editor.

WinSetup:
- Fixed error that could occur if choosed custom save path contained "%" symbol.
- Read correct game's resolution from game data instead of config file.
- Do not write all default config contents to user config, save only options that are set by setup program.


What's new in 3.3.5:

Editor Features:
- Path to resource's (sprite, audio) source file is now saved as relative one if the file is
  located inside game project's folder.
- Removed arbitrary limit of the script imports (was 50000).
- Script allows struct member qualifiers to be in any order.
- Better detection of integer constants overflow in script.
- Removed arbitrary limit of integer default value of +/-32000. Integer values are now limited
  by correct 32-bit values (-2147483648 to 2147483647).
- Support for negative constants in enums.
- Better folding markers and indentation guides in script editor.

Editor Bug Fixes:
- Fixed compiler crash if unknown keyword used after "readonly".
- Fixed compiler did not properly report incorrect type of dynamic array in function declaration.
- Fixed compiler did not report proper type name in case of syntax error sometimes.
- Fixed mouse cursor flicker above the script editor.

Engine Features:
- Removed unconfigurable mouse cursor's acceleration (Windows).
- Support for mouse cursor speed control (works in fullscreen mode only by defau;t): may be defined in configuration and changed in script.
- A config option for keeping consistent cursor speed relative to user's desktop resolution.
- Support for locking mouse inside window: automatic lock is enabled in configuration, and user
  may use Ctrl+Alt combination to lock/release mouse at any time.
- Restricted writing game files to special system directories
  (game is forbidden to write files into installation directiory or by absolute path).
  For old games unsafe paths are remapped.
- Support for player defined saves & game file directory.
- -v/--version command line argument makes engine display its version and bail.

Engine Bug Fixes:
- Fixed crash if screenshot is taken while game window was minimized or moving.
- Fixed alpha blend did not work properly for speech portrait if blinking frame did not have alpha channel.
- Fixed Display and Say script commands were displaying text for minimal amount of time under certain conditions.
- Fixed legacy audio functions did not start digital music playback if MIDI driver failed to initialize.
- Fixed game was run in smallest possible window if graphics driver failed to initialize fullscreen mode.
- Fixed "--help" command line argument not working all times depending on its order.
- Fixed engine did not always properly closed application window when running debug build.

Script API:
- Supported late_repeatedly_execute_always() callback in script, called after game has updated, but
  before it is drawn.
- Added Mouse.ControlEnabled (readonly) and Mouse.Speed properties.
- Added System.HasInputFocus property which tells if game currently has focus or runs at background.

Cosmetics & convenience:
- Clarified disabled MIDI option name in WinSetup.
- Extended information displayed if graphics driver failed to initialize.
- Clarified error messages for running unsupported games.


Templates updated:
Empty and Default Game templates were converted to 32-bit ones. You may still downgrade them to 16 and 8-bit after creating the game project of course.
Default Game template has its save system fixed, as explained in this thread.
#185
Recently I was asked by Sledgy if I can help translate Editor to Russian language (from the technical side). This made me think that there might be other languages people would like to see the Editor translated to. But it currently has no direct localization support.

What are potential possibilities to add such support to the the application?
I had certain experience with localizing C# programs using resources tables, but it is hard for me to deduce whether AGS Editor is suitable for same technique.
Also, how viable it is, in theory, to have strings downloaded from the external file? (which could be edited by anyone without even having to commit to repository)
#186
AGS 3.3.5 - Patch 5 & 6 released



Released: 22th August 2016

Previous version: AGS 3.3.4 forum thread



Please, read the information under "spoiler" if you are new to 3.3.5 before using it
Spoiler
Since 3.3.5 AGS does not allow to write any files into other path rather than "$SAVEGAMEDIR$"
(personal user saves directory) or "$APPDATADIR$" (all-users game data directory). If you attempt to open
file for writing using relative path without location tag, the filepath will be automatically remapped to
$APPDATADIR$ location.

Because of that, for backwards compatibility reasons, when you try to open file for reading using relative path
without location tag, AGS will first look for that file in $APPDATADIR$, and only if no matching file is
found there, then the game installation directory will be checked.

To force opening file in the game installation directory (for reading) a new location tag was introduced:
"$INSTALLDIR$". When using this tag you will explicitly tell AGS to look in and only in the game's
installation directory. However, if you try opening file for writing at such location, that will result in
failure.

Players are now allowed to set up their own custom path in game setup, where the game
saves & data will be written. This is done in the game setup program.
This works as if $SAVEGAMEDIR$ and $APPDATADIR$ were redirected to custom location.
Redirection is done internally by the engine, you do not need to add anything to your game scripts to make it work.

Conceptually, AGS is gradually leaning towards using only "symbols of file locations" rather than actual,
explicit locations on the filesystem.

Furthermore, game setup will now write config file into game saves location, rather than game's installation directory.
If config file is present in the game installation folder, then it is used as "default" read-only config file.
The config in saves folder overrides default one.
This way it should be totally safe to install AGS games into C:/Program Files, without having administrative rights.
[close]
Also check "Upgrading to AGS 3.3" AND "Upgrading to AGS 3.3.5" topics in the manual that comes with this version. They contain important information on few potential problems you may encounter.



Changes in the Patch 6:

Editor:
- Fixed properties buttons dissapearing from the Properties panel if the object was selected while the panel was not visible.

Engine:
- Fixed Display script functions displaying different text if there is any variadic text formatting function called in repeatedly_execute(). (regression)
- Fixed text formatting functions did not parse "%%" format properly. (regression)

Templates updated:
- Sprite 2008 was fixed in "Default Game" template (transparent area was not really transparent).


Changes in the Patch 5 (relevant for Linux users mainly):

Linux port:
- Fixed user's allegro.cfg was ignored.


Changes in the Patch 4:

Compiler:
- Fixed crash occuring when there is an incomplete declaration in the end of script.

Engine:
- Engine will fall back to using default system paths if it failed using player-defined custom save path for any reason.
- Fixed engine displaying same warning twice if the loaded game was compiled for higher version of AGS.

WinSetup:
- Only let player choose actually existing folders for custom save paths.


Changes in the Patch 3:

Engine:
- Fixed "datafile" config option was ignored.
- Fixed "datadir" config option was never used when searching for possible game location
  (this was broken for several years!).
- Fixed Game.FileName property return empty string.
- Fixed built-in console making Direct3D9 graphics driver crash in 16-bit games.

Templates updated:
Reverted Verb Coin template to version 1.7.2, because the newer 2.0.0 version is bugged and it is not known if it can be correctly used at all.


Changes in the Patch 2 (relevant for Linux users mainly):
Engine:
- Fixed program compilation on big-endian systems.
- Fixed program compilation with GCC 6.


Changes in the Patch 1:

Engine:
- Added support for $INSTALLDIR$ location tag in the filepaths used in the script.
- Fixed game could not find files in the current directory when run from the Editor.

WinSetup:
- Fixed error that could occur if choosed custom save path contained "%" symbol.
- Read correct game's resolution from game data instead of config file.
- Do not write all default config contents to user config, save only options that are set by setup program.


What's new in 3.3.5:

Editor Features:
- Path to resource's (sprite, audio) source file is now saved as relative one if the file is
  located inside game project's folder.
- Removed arbitrary limit of the script imports (was 50000).
- Script allows struct member qualifiers to be in any order.
- Better detection of integer constants overflow in script.
- Removed arbitrary limit of integer default value of +/-32000. Integer values are now limited
  by correct 32-bit values (-2147483648 to 2147483647).
- Support for negative constants in enums.
- Better folding markers and indentation guides in script editor.

Editor Bug Fixes:
- Fixed compiler crash if unknown keyword used after "readonly".
- Fixed compiler did not properly report incorrect type of dynamic array in function declaration.
- Fixed compiler did not report proper type name in case of syntax error sometimes.
- Fixed mouse cursor flicker above the script editor.

Engine Features:
- Removed unconfigurable mouse cursor's acceleration (Windows).
- Support for mouse cursor speed control (works in fullscreen mode only by defau;t): may be defined in configuration and changed in script.
- A config option for keeping consistent cursor speed relative to user's desktop resolution.
- Support for locking mouse inside window: automatic lock is enabled in configuration, and user
  may use Ctrl+Alt combination to lock/release mouse at any time.
- Restricted writing game files to special system directories
  (game is forbidden to write files into installation directiory or by absolute path).
  For old games unsafe paths are remapped.
- Support for player defined saves & game file directory.
- -v/--version command line argument makes engine display its version and bail.

Engine Bug Fixes:
- Fixed crash if screenshot is taken while game window was minimized or moving.
- Fixed alpha blend did not work properly for speech portrait if blinking frame did not have alpha channel.
- Fixed Display and Say script commands were displaying text for minimal amount of time under certain conditions.
- Fixed legacy audio functions did not start digital music playback if MIDI driver failed to initialize.
- Fixed game was run in smallest possible window if graphics driver failed to initialize fullscreen mode.
- Fixed "--help" command line argument not working all times depending on its order.
- Fixed engine did not always properly closed application window when running debug build.

Script API:
- Supported late_repeatedly_execute_always() callback in script, called after game has updated, but
  before it is drawn.
- Added Mouse.ControlEnabled (readonly) and Mouse.Speed properties.
- Added System.HasInputFocus property which tells if game currently has focus or runs at background.

Cosmetics & convenience:
- Clarified disabled MIDI option name in WinSetup.
- Extended information displayed if graphics driver failed to initialize.
- Clarified error messages for running unsupported games.


Templates updated:
Empty and Default Game templates were converted to 32-bit ones. You may still downgrade them to 16 and 8-bit after creating the game project of course.
Default Game template has its save system fixed, as explained in this thread.
#187
I do not remember if this was addressed before, but the AGS Editor's "Check for updates" feature is not working.

This command was expecting to get some information from "http://www.adventuregamestudio.co.uk/updatecheck.php", which page no longer exists.

Is it possible/wanted to revive this? If not we should remove or at least hide this command from the menu.
#188
Few years back we were trying out if the anonymous information feature still works in the Editor:
http://www.adventuregamestudio.co.uk/forums/index.php?topic=48339.0

It is still in the program, and debugging tells that server still returns positive answer (positive in the sense that the addressed page at least exists). However neither of the developers, let alone other people, have a way to see the gathered data, which makes it mostly useless.

For those who do not know, AGS sends, and server database is supposed to store following data:

- OS name and version;
- .NET Framework version installed (most high version, I think);
- Version of AGS Editor being used;
- Current resolution of your primary display;
- IP address server received data from;
- Current date & time.

AGS sends this info about once in a month, unless you disable this by unchecking an option in Editor's Preferences.

Now, other than IP address these values held no private information, and could potentially be very insteresting to know, at least for developers.

So, my two questions are:
1) Does the database still work (is this info actually gathered, and not just discarded)?
2) Is it potentially possible to print the database query somewhere on the website?
The raw content won't be very convenient, but something like following tables:
- Count of each operating system in defined date range (I dunno, 2-4 years, for instance);
- Count of each version of AGS used in same date range;
- Count of each display resolution type.
#189
Editor Development / Post-3.4.0 development
Tue 02/08/2016 00:26:56
With 3.4.0 almost out, it is time to mark out further development and say few words about past experience.

My biggest considerations regarding the past development are: lack of clear priorities and dissipation of efforts.

* I am very much saddened by the fact that the project did not, and still does not have any guidance or participation of experience game developers who would at least give advise on course of improvement for editor and engine. Even when some insights or comments are made by such developers on forums, they are so sporadic, and so lack emphasizing, that they become lost in the lists of issues. Like with this patched games problem (aka loading old saves), for example: I believe we could try address this issue months if not years ago, if there was a strong expression of how important that is earlier. When my attention was brought to this I found myself stuck in the 3.4.0 finalizing process, which I could not complete for a very long time.

* The biggest practical problem was development of two versions at once: improving existing stable version and working on the new version. On several occasions I had to spend many weeks updating and fixing old version, instead of finalizing new features and moving forward.

* It was always dissapointing for me to see other contributors willing to apply lots of effort and spend time on something that I did not consider much important while there were other more interesting and worthy tasks. For example, I know that it took Gurok several approaches to complete and fix implementation of "for" and "switch" commands in script, while both were no more than convenience ways to do loops and "ifs", rather than something completely new; at the same time there is a great need for full user managed structs support, and similar advanced improvements that would truly enhance AGS scripting.

========================================================================

Current situation is that we are still in a dire lack of human/time resources. That is why I have to follow advice given by Nick Sonneveld and change the way I work on AGS from now on.

* The development will be done in one branch only. There won't be any distinct updates of the previous versions, except for serious bug fixes (patches).
* Features will only be accepted into development branch in a working state, even if partial, but the implemented part should already be working, otherwise it should not be accepted. There should no more be any "experimental", raw stuff in the developed version, when we have no idea how long it takes to make it work. In other words: the feature may be limited, but at least must be working in said limits.
* We will set up a list of "milestones": features of big importance and high priority. As soon as at least one such feature is put into the repository in complete state, we create a "checkpoint" and start preparing MAJOR release. No more features will be added to this new version after checkpoint, only finalizing/fixing existing ones.
* If no "milestone" feature is found in development branch, but certain average amount of time has passed (2 - 4 months?) and we have something good in there, fixes or features, we create a "checkpoint" and start preparing MINOR release.
* I frankly and sincerely be deaf to people asking me to add "little more" into the version, especially to the previous version. I realize people sometimes want little additions to complete their games, but working on such requests distracted me greatly in the past and made me loose time I'd rather use more efficiently.


PS. Other than all this, I am still rather pessimistic about whole thing.
Also I really want to make a game myself :-(.
#190
AGS 3.3.5 - Patch 4 released



Released: 26th July 2016

Previous version: AGS 3.3.4 forum thread



Please, read the information under "spoiler" if you are new to 3.3.5 before using it
Spoiler

Since 3.3.5 AGS does not allow to write any files into other path rather than "$SAVEGAMEDIR$"
(personal user saves directory) or "$APPDATADIR$" (all-users game data directory). If you attempt to open
file for writing using relative path without location tag, the filepath will be automatically remapped to
$APPDATADIR$ location.

Because of that, for backwards compatibility reasons, when you try to open file for reading using relative path
without location tag, AGS will first look for that file in $APPDATADIR$, and only if no matching file is
found there, then the game installation directory will be checked.

To force opening file in the game installation directory (for reading) a new location tag was introduced:
"$INSTALLDIR$". When using this tag you will explicitly tell AGS to look in and only in the game's
installation directory. However, if you try opening file for writing at such location, that will result in
failure.

Players are now allowed to set up their own custom path in game setup, where the game
saves & data will be written. This is done in the game setup program.
This works as if $SAVEGAMEDIR$ and $APPDATADIR$ were redirected to custom location.
Redirection is done internally by the engine, you do not need to add anything to your game scripts to make it work.

Conceptually, AGS is gradually leaning towards using only "symbols of file locations" rather than actual,
explicit locations on the filesystem.

Furthermore, game setup will now write config file into game saves location, rather than game's installation directory.
If config file is present in the game installation folder, then it is used as "default" read-only config file.
The config in saves folder overrides default one.
This way it should be totally safe to install AGS games into C:/Program Files, without having administrative rights.
[close]
Also check "Upgrading to AGS 3.3" AND "Upgrading to AGS 3.3.5" topics in the manual that comes with this version. They contain important information on few potential problems you may encounter.



Changes in the Patch 4:

Compiler:
- Fixed crash occuring when there is an incomplete declaration in the end of script.

Engine:
- Engine will fall back to using default system paths if it failed using player-defined custom save path for any reason.
- Fixed engine displaying same warning twice if the loaded game was compiled for higher version of AGS.

WinSetup:
- Only let player choose actually existing folders for custom save paths.


Changes in the Patch 3:

Engine:
- Fixed "datafile" config option was ignored.
- Fixed "datadir" config option was never used when searching for possible game location
  (this was broken for several years!).
- Fixed Game.FileName property return empty string.
- Fixed built-in console making Direct3D9 graphics driver crash in 16-bit games.

Templates updated:
Reverted Verb Coin template to version 1.7.2, because the newer 2.0.0 version is bugged and it is not known if it can be correctly used at all.


Changes in the Patch 2 (relevant for Linux users mainly):
Engine:
- Fixed program compilation on big-endian systems.
- Fixed program compilation with GCC 6.


Changes in the Patch 1:

Engine:
- Added support for $INSTALLDIR$ location tag in the filepaths used in the script.
- Fixed game could not find files in the current directory when run from the Editor.

WinSetup:
- Fixed error that could occur if choosed custom save path contained "%" symbol.
- Read correct game's resolution from game data instead of config file.
- Do not write all default config contents to user config, save only options that are set by setup program.


Changes since version 3.3.4:

Editor Features:
- Path to resource's (sprite, audio) source file is now saved as relative one if the file is
  located inside game project's folder.
- Removed arbitrary limit of the script imports (was 50000).
- Script allows struct member qualifiers to be in any order.
- Better detection of integer constants overflow in script.
- Removed arbitrary limit of integer default value of +/-32000. Integer values are now limited
  by correct 32-bit values (-2147483648 to 2147483647).
- Support for negative constants in enums.
- Better folding markers and indentation guides in script editor.

Editor Bug Fixes:
- Fixed compiler crash if unknown keyword used after "readonly".
- Fixed compiler did not properly report incorrect type of dynamic array in function declaration.
- Fixed compiler did not report proper type name in case of syntax error sometimes.
- Fixed mouse cursor flicker above the script editor.

Engine Features:
- Removed unconfigurable mouse cursor's acceleration (Windows).
- Support for mouse cursor speed control (works in fullscreen mode only by defau;t): may be defined in configuration and changed in script.
- A config option for keeping consistent cursor speed relative to user's desktop resolution.
- Support for locking mouse inside window: automatic lock is enabled in configuration, and user
  may use Ctrl+Alt combination to lock/release mouse at any time.
- Restricted writing game files to special system directories
  (game is forbidden to write files into installation directiory or by absolute path).
  For old games unsafe paths are remapped.
- Support for player defined saves & game file directory.
- -v/--version command line argument makes engine display its version and bail.

Engine Bug Fixes:
- Fixed crash if screenshot is taken while game window was minimized or moving.
- Fixed alpha blend did not work properly for speech portrait if blinking frame did not have alpha channel.
- Fixed Display and Say script commands were displaying text for minimal amount of time under certain conditions.
- Fixed legacy audio functions did not start digital music playback if MIDI driver failed to initialize.
- Fixed game was run in smallest possible window if graphics driver failed to initialize fullscreen mode.
- Fixed "--help" command line argument not working all times depending on its order.
- Fixed engine did not always properly closed application window when running debug build.

Script API:
- Supported late_repeatedly_execute_always() callback in script, called after game has updated, but
  before it is drawn.
- Added Mouse.ControlEnabled (readonly) and Mouse.Speed properties.
- Added System.HasInputFocus property which tells if game currently has focus or runs at background.

Cosmetics & convenience:
- Clarified disabled MIDI option name in WinSetup.
- Extended information displayed if graphics driver failed to initialize.
- Clarified error messages for running unsupported games.


Templates updated:
Empty and Default Game templates were converted to 32-bit ones. You may still downgrade them to 16 and 8-bit after creating the game project of course.
Default Game template has its save system fixed, as explained in this thread.
#191
I would like to post a a first prototype of the planned feature that would let games load older saved games with different (presumably less) content.
As pretty much known this was an unending trouble for game developers who prefer to patch and update their published games, because currently AGS is unable to load old saved game if some of the game content has changed since: almost any game object you see in your project tree, as well as number of script variables; the exceptions are very few.

The most recent related discussion was in this thread, posting here just for information:
http://www.adventuregamestudio.co.uk/forums/index.php?topic=53504.0

Some time ago I wrote a pretty much detailed explanation of what we ideally need (from my point of view) on the new issue tracker here:
http://adventuregamestudio.myjetbrains.com/youtrack/issue/AGS-4

(IIRC you do not have to be registered on tracker and may just login as Guest to read the post. Just in case, there is an explanation of how you can also use some of your existing web accounts found in this post: http://www.adventuregamestudio.co.uk/forums/index.php?topic=52737.0)


What is written in that tracker ticket is not "set in stone" yet, just a first outline that could be corrected along with the development progress and future discussion. Also I found that some things I mentioned there will be very difficult to implement in the current AGS.

To make things simplier, I will briefly explain the general points below.

==================================================================

Problem

When it comes to loading saves from previous game version, it is not really a serious problem of how to load the different (amount of) data, provided save format properly describes itself.
The real problems come AFTER that, and these are:

Problem 1. Finding matching entities. Unless items have unique identifiers that do not depend on their order in the entity list, it is impossible to tell whether saved game contains same entities as current game. We can only rely on game developer's sanity and discipline here. To solve matching problem we need to ensure that every entity type in game has an ID, that can be number, or string, but regardless of that it should not depend on its order of arrangement inside project (nor change with one). We also need to make such ID being written to save game with every entity, obviously. In such case, when save is loaded, we do not blindly copy, for example, first saved character data into first game's character, but find the character with matching ID in the current game assets, and copy restored data in there.
Now, at this moment many (most, I think) entities in AGS has a distinct property that could be used as a unique ID -- it is their Script Name. Unfortunately, not every entity has this property written into the game file when game is compiled, and none write it to save.
So, the course of action should be this: find which game entities have a distinct ID and make use of it, then find which entities do not have acceptable property and implement such thing.

Problem 2. Deciding what to do when there is no match. So we have found matching characters in the older save, and copied data to existing ones in our game, but now there is a new character that is not even mentioned in the save. Naturally, it keeps all its state it had before running save restoration. Default action could be to reset such character to its initial state, as described in the game (AGS does not support such thing now, unfortunately, and it may require quite some work to make it possible without lots of redundant game file reading). But what if that does not work for game logic? Game developer can have other ideas to where this character should appear if you loaded pre-patched savegame.
Similar but even more awkward problem rises when the character was removed in the update. Default action could be to just discard such non-existing entity, but what if player was in the middle of solving some puzzle related to that character? Certainly there should be a way to fix the game state, which cannot be done automatically; this is something where only author of the game knows what to do.
This means that regardless of whether we have default means of dealing with situations like that or not, AGS should support special script function(s) that is/are called after game is loaded to let gamedev script proper reaction to game content changes.
This also means that there should probably be methods to copy one entity over another manually, for example, if there ID was changed, deliberately or by mistake, or simply because of unusual game plot update.


==================================================================

This is, in a nutshell, my general proposal. The aims and solutions I described above are ideal, which may not be easy to achieve at once, but some steps can be taken today.


Prototype

What do I have now, is a prototype version, that has following features:

1. It has a completely rewritten save format, which I was forced to do, because the existing one is a bit messy and also do not always let to know how many items are saved in there exactly (it sometimes relies on current game's content, and other assumptions). This version can still LOAD old save format, but it only write game saves in the new one.

2. The engine is taught to load saves containing LESS entities than the game. In such case it just restores what is available, and does not do anything with the rest.

3. The game scripts support new function with the predefined name of "resolve_restored_game". This function is called every time the save data was loaded, but before game actually starts to run again.
The function can be put into any script (similarily to game_start, etc), and defined like:
Code: ags

function resolve_restored_game(LoadedSaveInfo *info)
{
}


4. LoadedSaveInfo is a new built-in script type, which purpose is to describe save contents and potential conflicts (non matching issues). At this time it has only several properties telling number of entities. Here's its definition:
Spoiler

Code: ags

builtin managed struct LoadedSaveInfo {
  /// Gets/sets whether save restoration should be cancelled
  import attribute bool CancelRestore;
  /// Gets whether information on save contents is currently valid
  readonly import attribute bool Valid;
  /// Gets number of audio types in save
  readonly import attribute int AudioTypeCount;
  /// Gets number of audio clips in save
  readonly import attribute int AudioClipCount;
  /// Gets number of characters in save
  readonly import attribute int CharacterCount;
  /// Gets number of dialogs in save
  readonly import attribute int DialogCount;
  /// Gets number of GUIs in save
  readonly import attribute int GUICount;
  /// Gets number of buttons in save
  readonly import attribute int ButtonCount;
  /// Gets number of labels in save
  readonly import attribute int LabelCount;
  /// Gets number of inventory windows in save
  readonly import attribute int InvWindowCount;
  /// Gets number of sliders in save
  readonly import attribute int SliderCount;
  /// Gets number of text boxes in save
  readonly import attribute int TextBoxCount;
  /// Gets number of list boxes in save
  readonly import attribute int ListBoxCount;
  /// Gets number of inventory items in save
  readonly import attribute int InventoryCount;
  /// Gets number of mouse cursors in save
  readonly import attribute int MouseCursorCount;
  /// Gets number of views in save
  readonly import attribute int ViewCount;
};

[close]

Primitive example of use:
Spoiler

Code: ags

function resolve_restored_game(LoadedSaveInfo *info)
{  
  File *f = File.Open("$SAVEGAMEDIR$/save.info", eFileWrite);
  f.WriteRawLine("Just loaded saved game with the following contents:");
  f.WriteRawLine(String.Format("info.AudioClipCount = %d", info.AudioClipCount));
  f.WriteRawLine(String.Format("info.CharacterCount = %d", info.CharacterCount));
  f.WriteRawLine(String.Format("info.DialogCount = %d", info.DialogCount));
  f.WriteRawLine(String.Format("info.LabelCount = %d", info.LabelCount));
  f.Close();
  
  if (info.CharacterCount != Game.CharacterCount) {
    AbortGame("OMG, save character count is %d, game character count is %d", info.CharacterCount, Game.CharacterCount);
  }
}

[close]

5. In the project settings there is now a switch called "Save games compatibility". It currently has two options:
- "Load saves with 100% matching content" (this is backwards compatible option, or for those game authors who do not want to bother supporting old saves)
- "Load saves with less or equal content" (this enables new behavior).

So, basically, what this allows you to do: you can, for example, check number of characters in LoadedSaveInfo and seeing that it is less than current number in your game, deduce which characters need to be fixed up (last X in the list). Or do something else, depending on the kind of your game update.

DOWNLOAD LINK: http://www.mediafire.com/download/ojc8g6557d8xdak/AGS-LoadOldSaves-Prototype1.zip
WIP source branch:
https://github.com/ivan-mogilko/ags-refactoring/commits/feature--loadoldgamesave

WARNING: this is an experimental version of AGS. It is created on top of latest 3.4.0, but DO NOT use it to create your actual games yet, because if something will change during further development, I will NOT support compatibility with this experimental version.


I would really love to know peoples opinion on this, mainly opinion on solution design.
#192
AGS 3.4.0 (RC2) released







Released: 22th August 2016

Previous stable version: AGS 3.3.5 forum thread


A minute of attention for those who did not have a chance to check 3.4.0 during its development:
AGS 3.4.0 contains a big load of changes, which may take a while to explore. The following (read-only) topic is created to make getting used to it easier:
http://www.adventuregamestudio.co.uk/forums/index.php?topic=52499.0

Also, please, read "Upgrading to AGS 3.4" topic in the manual that comes with this version. It contains important information on most notable new features and few potential problems you may encounter when upgrading older projects.

Another important note on upgrading your project to latest 3.4.0 (read under spoiler):
Spoiler

AGS 3.4.0 now has a "Script API version" and "Script compatibility level" switches, which determine a range of built-in script functions you may use in your game (also called Script API).
"Script API Version" defines the TOP limit, or the latest version of scripting your game uses.
"Script compatibility level" defines the BOTTOM limit, or which OLD functions should still be available.

When you upgrade your game project from the older versions (3.3.* and lower), the Editor automatically sets "Script compatibility level" corresponding to the version of AGS this project was last saved in. This is done for backward compatibility. But you can change that anytime. Be prepared, however, that you may have to fix certain parts of your script. Usually necessary fixes are limited to renaming functions. Also, it is suggested to do "Rebuild all files" after you change any of those two switches.
[close]



What is new in 3.4.0

Common features:
- Added support for building game for multiple platforms (Windows and Linux options are maintained now).
- Added custom game resolutions.
- Added extended WFN font support (up to 256 characters).
- Made custom property values modifiable at runtime.
- Removed limit on custom properties number (was 30 properties per project), increased maximal property name and value length.
- Removed limit on GUI Control number (was 30 per GUI), increased maximal control name length.
- Removed limit on script modules number (was 50).
- Added Locked property to room Objects.
- Added Padding property for TextWindow GUI.

Editor features:
- New splash screen.
- Exposed Clickable property for room Objects in the Editor.
- Exposed TintLuminance property for room Regions in the Editor.
- Added "Close all tabs" command for the pane's context menu.
- Added Preferences option "Prompt dialog on closing multiple tabs".
- The sprite editor now highlights drop targets when you drag sprites around.

Editor Plugin API:
- Exposed GUI Panes to plugin API.

Engine features:
- Added support for any runtime display resolution (now restricted only by your system specifics).
- Added support for vertical sync in Direct3D rendering mode.
- Made engine try to use all implemented graphic renderers in the order of priority, if user selection failed to initialize.
- Rised default sprite cache limit for desktop platforms to 100 MB (was 20).
- Game writes latest translation and mouse speed setting to config file on exit.

Scripting features:
- Added managed user structs; although currently limited to containing only non-pointer variables in them.
- Added support for dynamic arrays in non-managed structs.
THERE ARE KNOWN ISSUES:
Spoiler

It was found that dynamic arrays in struct do not work when you make an array of those struct, for example:
Code: ags

struct MyStruct
{
    int dynamic_array[];
};

MyStruct single_object; // <--- this will work
MyStruct arr_of_structs[10]; // <--- this won't work

Such array caused troubles which were too complicated to fix in time, and require more time to investigate. A decision was made to block creation of arrays of structs, containing dynamic arrays. If you try to declare one in your script you will get an error. Hopefully this restriction will be raised in the future updates.
[close]
- Added support for dynamic array as return value of the struct's member function.
- Added support for static extender functions.
- Added "do..while" kind of loop, in addition to previously existing "while".
- Added "for" operator and related loop construct.
- Added "switch" and "case" operators and related branching construct.
- Added "break" and "continue" operators working in any loop or switch.
- Added missing compound assignment operators (*=, /=, and so on).
- Made preprocessor macros usable in definition of another macro.
- Added "#region" and "#endregion" preprocessor commands.

Script API:
- Added Script API version switch to the project's General Settings. For every supported API version a "SCRIPT_API_vXXX" macro is introduced, where XXX are version numbers.
- Added Script Compatibility Level switch to General Settings. For every compatible version a "SCRIPT_COMPAT_vXXX" macro is introduced.
- Added AudioChannel.Speed property.
- Added CharacterDirection enum and optional "direction" parameter for Character.ChangeRoom().
- Added Character.FaceDirection().
- Added Character.DestinationX and Character.DestinationY properties.
- Added RunActiveOption() and Update() member functions to the DialogOptionsRenderingInfo type.
- Extended Dialog Options API: added support for dialog_options_repexec() and dialog_options_key_press() functions to improve handling of the custom dialog options; added related compatibility project option and support for "NEW_DIALOGOPTS_API" macro in scripts.
- Added game.dialog_options_highlight_color variable.
- Added File.Seek() function and File.Position property.
- Added IsInteractionAvailable() method to Hotspot, Object and Character types.
- Added Game.AudioClipCount property and Game.AudioClips[n] array.
- Added Game.IsPluginLoaded().
- Added GUIControl.ZOrder property.
- Added GUI.Click() and Button.Click() functions which call OnClick event handler of corresponding GUI or button.
- Added GUI.ProcessClick() function that processes click on GUI only, similarily to how old ProcessClick processed click on room objects only.
- Added Mouse.Click() function to simulate mouse click on screen.
- Added Room.GetProperty() to substitute global GetRoomProperty().
- Added Room.ProcessClick() to substitute global ProcessClick().
- Added SetProperty() and SetTextProperty() functions to Room, InventoryItem, Hotspot, Object and Character types.
- Added optional "luminance" parameter to Region.Tint() and Region.TintLuminance readonly property.
- Added SetAmbientLightLevel() to set global light level for anything in the room.
- Added Character.SetLightLevel() and Object.SetLightLevel() functions to set individual light levels. Negative light levels can be used in 8-bit games to produce darkening effect.
- Added System.RuntimeInfo property which returns a short description of current graphics mode, scaling filter and enabled game resources.

Editor bug fixes:
- Fixed Undo history was deleted when an Editor panel changes its docked state.
- Fixed crashes under certain circumstances when a script editor is closed.
- Fixed crash if selecting a character without a normal view in the room editor.
- Fixed Ctrl+Tab did not work for the first time when cycling through opened editor tabs.
- Fixed "Go to Line..." command did not always move cursor to correct line. Also, do not select that line.
- Made the project completely rebuild itself whenever "Enable Debug Mode" value in the General Settings differs from the setting used for the last build, to prevent inconsistency in compiled scripts.
- Fixed a crash when trying to run game setup from the Editor while "Compiled" folder does not exist.
- Fixed project items could sometimes get incorrectly arranged inside the folder.
- Fixed writing faulty timestamps in project file on some occasions that could spoil usage of file versioning control.
- Fixed Help window positioning on multi-monitor desktop.
- Fixed error in autocomplete occuring when there is a single-line comment in the end of the script.
- Fixed incorrect compiler parsing of a static function call inside array index brackets.
- Fixed compilation of struct member functions having name identical to existing global function.
- Fixed compilation of structs having members with names identical to non-basic types, global variables and game entities (such as characters, GUI, etc).
- Corrected few error messages related to struct's function declaration.
- Fixed compiler reporting errors as "runtime errors" under certain circumstances.

Engine bug fixes:
- Fixed result of using transparency parameter of the DrawingSurface.DrawImage() in 32-bit games when drawing opaque sprites over surfaces with alpha channel.
- Fixed DynamicSprite.CopyTransparencyMask() was overwriting magic transparent pixels on destination with alpha values from mask.
- Fixed the speech portrait position was not adjusted for character walking between its lines, when BasedOnCharacterPosition portrait placement is used.
- Fixed occasional pathfinding failure on straight lines with complex walkable areas.
- Fixed using '[' special character in Display-like commands discarded all of the backslashes before it (e.g. "\\[" should now print \[ as expected).
- Fixed WAVE audio not looping after restoring a game
- Fixed a bug that caused MP3 clip continuously increase its base volume if the directional volume modifier was applied.
- Fixed queued audio clips did not update their volume when default audio type volume changes.

WinSetup:
- Added support for "default_translation_name" option in the "[language]" section of the config file.


TODO
- The Manual was updated, but needs a little rereading/testing.
- Some of the game templates should be properly updated, although they could be used with minor amount of manual fixes.
- Demo Game should be tested and probably upgraded to 3.4.0.


#193
AGS 3.3.5 - Patch 2 & 3 released


Please, read "Upgrading to AGS 3.3" AND "Upgrading to AGS 3.3.5" topic in the manual that comes with this version before upgrading your game project to 3.3.0 - 3.3.5! It contains important information on few potential problems you may encounter.

Released: 17th June 2016

Previous version: AGS 3.3.4 forum thread



Please, read the information under "spoiler" if you are new to 3.3.5 before using it
Spoiler

Since 3.3.5 AGS does not allow to write any files into other path rather than "$SAVEGAMEDIR$"
(personal user saves directory) or "$APPDATADIR$" (all-users game data directory). If you attempt to open
file for writing using relative path without location tag, the filepath will be automatically remapped to
$APPDATADIR$ location.

Because of that, for backwards compatibility reasons, when you try to open file for reading using relative path
without location tag, AGS will first look for that file in $APPDATADIR$, and only if no matching file is
found there, then the game installation directory will be checked.

To force opening file in the game installation directory (for reading) a new location tag was introduced:
"$INSTALLDIR$". When using this tag you will explicitly tell AGS to look in and only in the game's
installation directory. However, if you try opening file for writing at such location, that will result in
failure.

Players are now allowed to set up their own custom path in game setup, where the game
saves & data will be written. This is done in the game setup program.
This works as if $SAVEGAMEDIR$ and $APPDATADIR$ were redirected to custom location.
Redirection is done internally by the engine, you do not need to add anything to your game scripts to make it work.

Conceptually, AGS is gradually leaning towards using only "symbols of file locations" rather than actual,
explicit locations on the filesystem.

Furthermore, game setup will now write config file into game saves location, rather than game's installation directory.
If config file is present in the game installation folder, then it is used as "default" read-only config file.
The config in saves folder overrides default one.
This way it should be totally safe to install AGS games into C:/Program Files, without having administrative rights.
[close]


Changes in the Patch 3:

Engine:
- Fixed "datafile" config option was ignored.
- Fixed "datadir" config option was never used when searching for possible game location
  (this was broken for several years!).
- Fixed Game.FileName property return empty string.
- Fixed built-in console making Direct3D9 graphics driver crash in 16-bit games.

Templates updated:
Reverted Verb Coin template to version 1.7.2, because the newer 2.0.0 version is bugged and unknown if can be correctly used at all.


Changes in the Patch 2 (relevant for Linux users mainly):
Engine:
- Fixed program compilation on big-endian systems.
- Fixed program compilation with GCC 6.


Changes in the Patch 1:

Engine:
- Added support for $INSTALLDIR$ location tag in the filepaths used in the script.
- Fixed game could not find files in the current directory when run from the Editor.

WinSetup:
- Fixed error that could occur if choosed custom save path contained "%" symbol.
- Read correct game's resolution from game data instead of config file.
- Do not write all default config contents to user config, save only options that are set by setup program.


Changes since version 3.3.4:

Editor Features:
- Path to resource's (sprite, audio) source file is now saved as relative one if the file is
  located inside game project's folder.
- Removed arbitrary limit of the script imports (was 50000).
- Script allows struct member qualifiers to be in any order.
- Better detection of integer constants overflow in script.
- Removed arbitrary limit of integer default value of +/-32000. Integer values are now limited
  by correct 32-bit values (-2147483648 to 2147483647).
- Support for negative constants in enums.
- Better folding markers and indentation guides in script editor.

Editor Bug Fixes:
- Fixed compiler crash if unknown keyword used after "readonly".
- Fixed compiler did not properly report incorrect type of dynamic array in function declaration.
- Fixed compiler did not report proper type name in case of syntax error sometimes.
- Fixed mouse cursor flicker above the script editor.

Engine Features:
- Removed unconfigurable mouse cursor's acceleration (Windows).
- Support for mouse cursor speed control (works in fullscreen mode only by defau;t): may be defined in configuration and changed in script.
- A config option for keeping consistent cursor speed relative to user's desktop resolution.
- Support for locking mouse inside window: automatic lock is enabled in configuration, and user
  may use Ctrl+Alt combination to lock/release mouse at any time.
- Restricted writing game files to special system directories
  (game is forbidden to write files into installation directiory or by absolute path).
  For old games unsafe paths are remapped.
- Support for player defined saves & game file directory.
- -v/--version command line argument makes engine display its version and bail.

Engine Bug Fixes:
- Fixed crash if screenshot is taken while game window was minimized or moving.
- Fixed alpha blend did not work properly for speech portrait if blinking frame did not have alpha channel.
- Fixed Display and Say script commands were displaying text for minimal amount of time under certain conditions.
- Fixed legacy audio functions did not start digital music playback if MIDI driver failed to initialize.
- Fixed game was run in smallest possible window if graphics driver failed to initialize fullscreen mode.
- Fixed "--help" command line argument not working all times depending on its order.
- Fixed engine did not always properly closed application window when running debug build.

Script API:
- Supported late_repeatedly_execute_always() callback in script, called after game has updated, but
  before it is drawn.
- Added Mouse.ControlEnabled (readonly) and Mouse.Speed properties.
- Added System.HasInputFocus property which tells if game currently has focus or runs at background.

Cosmetics & convenience:
- Clarified disabled MIDI option name in WinSetup.
- Extended information displayed if graphics driver failed to initialize.
- Clarified error messages for running unsupported games.


Templates updated:
Empty and Default Game templates were converted to 32-bit ones. You may still downgrade them to 16 and 8-bit after creating the game project of course.
Default Game template has its save system fixed, as explained in this thread.
#194
So, there is this problem which I need an advice (and possibly help too) with.

We ship number of game templates along with AGS Editor. When we upgrade Editor, some templates may refuse to compile and need certain fixes (like switching backward compatibility option, or renaming script functions).

How do I organize this process?
Should I report this in the template thread and wait until template maintainer fixes it? What if they never do that - should I remove template from the package to let users download templates on their own if they want to go with the trouble fixing it themselves?

The worst thing is that I am already so overwhelmed with various tasks, that I keep forgetting things. The templates are not part of the Editor nor engine, they are contributions by other people, so I am logically not the one who should be caring about these. While I am trying to ensure that there is always a compatibility switch, and sometimes even make Editor turn this switch automatically if it loads an old game project/template, that does not always work (for example, currently we are lacking a proper script API version selector, so there is no way to fine-tune the version of script functions game is using).
#195
I was worrying that knowing about new AGS (Editor) release may be a bit tricky for a person who visits the website. They need to either check "Download AGS" section, where the version is displayed in a very small font, and may not be noticed at the first glance, or login to forums and check whether there is a new topic in the "AGS Engine & Editor Releases".

Would that be possible to add an actual "News" section to the website to post announcements about new releases with links to forum thread (and maybe something else, like AGS Awards, or what you find appropriate)?
#196
I am trying to enhance the looks and work of winsetup for 3.4.0. I had done some additions to winsetup earlier, in one of the previous updates (http://www.adventuregamestudio.co.uk/forums/index.php?topic=51050.msg636517910#msg636517910), but later realized they complicate things instead of improving them (in attempt to give user more options).
I would like to give another version for testing before we make final 3.4.0 release. There were certain changes to how setup works, which hopefully make it a bit simplier.

The engine for testing may be downloaded here: http://www.mediafire.com/download/5ruoaw094t4oau4/acwin_3.4.0.7-improve-winsetup.zip

So, what has changed.
First thing to mention is that now you are not restricted to only one scaling factor when you choose filters with fixed scaling (Hq2x, Hq3x). If you choose higher scaling, that they do not support themselves, the game will be scaled by these filters as much as they can do, but then the filter result is additionally scaled to target amount using simpliest nearest-neighbour technique.
This was indeed technically possible before if you checked "Stretch to fit screen" option, but setup did not give you way to choose higher "even" scaling (e.g. x4, x5). Now it does.

Now, here is the main change in the setup window, the two separate options ("Stretch to fit screen" and "Keep aspect ratio") are going to be merged with Scaling option:

This is because they are, in basic sense, another type of game scaling.


Choosing game size in Windowed mode is done, as before, using only two options - Filter and Scaling, but Scaling now has little more selection:


"Best round scaling" is what "Max fit" was before - it means that the game is scaled up by maximal "round" value that fits in screen.
"Standard filter scaling" only available for filters with fixed scaling, and means it will use strictly their scaling.
"Stretch to whole screen" means game will be stretched up as much as fits in the computer screen. It may appear distorted this way, if game's aspect ratio is different from your current monitor settings.
"Stretch, keep game's aspect ratio" - will stretch game up, but keeping width/height proportions. In Fullscreen this may (or may not) produce black borders either at top/bottom or left/right (but not both).


Choosing game size in Fullscreen mode is still done using Mode, Filter and Scaling, but this time Scaling has only "special" choices:


As you may notice, when setting up Fullscreen mode, Scaling has only choices that scale game up as much as possible in three ways (max round scale factor, stretch and proportional stretch), plus the fixed filter's scaling left just in case.
This is done so because I believe that in common case the users will want game to take most of the screen, if they chose to run it Fullscreen anyway.



I would really love to know people's opinion on this, because there is not much left to be done for 3.4.0, and now it's a chance to improve something in setup before the release.

Also, do all of the option names sound clear? I could rename them if there are better alternatives.
#197
Editor Development / AGS 3.4.0.7 - Almost Beta
Thu 05/05/2016 18:53:56
AGS 3.4.0.7 - Almost Beta

Download 3.4.0.7 (Almost Beta) as a .zip archive

No-MP3 Engine (Windows):
http://www.mediafire.com/download/hc7436dy30p59ww/AGS-3.4.0.7-noMP3.zip


Linux build package -- Download here and unpack into Editor's program folder

Source code: https://github.com/adventuregamestudio/ags/tree/develop-3.4.0

Debug symbols (for developers):
http://www.mediafire.com/download/e9z2y1d5qd2pvw2/AGS-3.4.0.7-PDB.zip


Previous alphas:
Spoiler

ACHTUNG!
This is a development version of AGS 3.4.0.
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 3.3.* after saving with this version.

Last updated: 5th of May, 2016
Includes all content from AGS 3.3.5 (Patch 1) version
The differences from 3.4.0.6 are marked with NEW sign.


Common features

Custom game resolutions
Make your game in any sensible or non-sensible resolutions, such as 1280x720, 1920x1080 or, heck, 233x856.
A proof that weird res work too:
Spoiler


[close]

Game resolution is now set not by simple drop-down list, but with a slightly more advanced dialog.
Spoiler



Select "Resolution" option and click on "..." button



In the dialog either choose one of the presets, or type in your own width & height, then press OK.
[close]


Extended WFN Font Support

Support was added for extended characters in WFN fonts (those with codes 128 - 255).

Papagayo lip sync

Support was added for Papagayo lip-sync format. The use is similar to Pamela lip-syncing (see "Lip sync" topic in the manual for more information).

Changed system limits


ItemOld limitNew limitComments
Custom properties30unlimited
Custom property name and value lengths20 / 500unlimited
Controls on GUI30unlimited
GUI name length20unlimited
Script modules50unlimited
Script symbols per script10,000unlimited


Engine

Free display resolutions

Run AGS games in literally any resolution your computer supports, with or without black borders. (Nearly) unlimited scaling up and down is supported. Run those old 320x200 games in 1920x1080 HD.
New Winsetup will help you to set things up.

Known issues so far:
- Do not expect magic from downscaling. When you shrink hi-res game more than 1.5-2 times down it becomes barely recognizeable (and font unreadable).
- There's a weird issue with mouse movement when you run a low-res game unscaled in a large fullscreen window. I am still looking into fixing this.

Full Screen VSync for Direct3D

This feature was previously available (but always on) in Draconian editions of AGS. With AGS 3.3.1, it has been integrated into the mainline builds. It's now possible to toggle VSync using the "Vertical sync" checkbox in Winsetup.exe. If it's checked, the game starts with vertical sync turned ON. In DirectX 5 mode, you can still toggle this by setting System.VSync to true/false. In DirectX 9 mode, the System.VSync property is now read-only (as opposed to being useless previously).

Improvements

  • In 32-bit games DrawingSurface.DrawImage() now properly applies overall transparency when drawing opaque sprites over surfaces with alpha channel.
  • DynamicSprite.CopyTransparencyMask() now does not overwrite transparency on destination with opaqueness from mask.
  • Engine will now try to use all available graphic renderers in an order of priority, if the previous ones fail.
    (Now Direct3D will be tried if Software renderer was requested by user but failed.)

Bug Fixes

  • The engine now moves the portrait with the speaking character when using BasedOnCharacterPosition if the speaking character moves between calls to Say
  • Fixed occasional pathfinding failure on straight lines with complex walkable areas (reported here)
  • Printing [ no longer consumes all of the backslashes before it (e.g. "\\[" should now print \[ as expected)
  • Fixed crash that could occur when the screenshot is taken while game window is moved, minimized or restored
  • Fixed WAVE audio not looping after restoring a game
  • Fixed a bug that caused MP3 clip continuously increase its base volume if the directional volume modifier was applied.



Scripting

For statement

In addition to a while loop, you can now use a for loop in AGS script. The syntax is:
Code: ags
for([initialisation];[condition];[increment])
{
    [loop body]
}

Examples:
Code: ags
for(player.x = 0; player.x < 100; player.x++)
    Wait(1);

Code: ags
for(int i = 10; i > 0; i--)
    Display("i = %d", i);


Break statement

You can now break out of loops using the break statement. For example:
Code: ags
i = length - 1;
while(i >= 0)
{
    if(page[i] == target)
        break;
    i--;
}

Will halt the loop when a match is found or leave i as -1 if there was no match.

Continue statement

You can now continue to the next iteration of a loop using the continue statement. For example:
Code: ags
for(x = 0; x < 100; x++)
{
    if(x % 2 == 0)
        continue;
    Display("%d", x);
}

Will display only odd numbers between 0 and 100.

Do...While loops

The Do...While loop construct is now supported. For example:
Code: ags
x = 1;
do
{
    x++;
    Display("%d", x);
} while(x < 1);

Unlike While, Do...While runs the loop iteration *before* evaluating the condition. The loop above will run once.

Switch statement

Added support for "switch" statement. Strings and other variable types are allowed to be checked in switch condition.
Standard case statement features like fallthrough and break are also supported.

Example:
Spoiler
Code: ags

String x = "a";

switch(x)
{
case "a":
    Display("X is A");
case "b": // fall-through
    Display("X is B");
    break;
case "c":
    Display("X is C");
case "d": // fall-through
default: // fall-through
    Display("X is D");
}
[close]



Dynamic Arrays in Structs

Dynamic arrays are now permitted inside structs.
Spoiler

You can declare a struct like so:
Code: ags

struct DieRoll
{
    int BaseModifier;
    int DieCount;
    int Dice[ ];
    import function GetTotalValueOfRoll();
};

function PrepareDice()
{
    DieRoll a;

    a.DieCount = 3;
    a.Dice = new int[a.DieCount];
    a.Dice[0] = 6; // d6
    a.Dice[1] = 6; // d6
    a.Dice[2] = 8; // d8
    ...
}

And the dynamic array "Dice" can be initialised and used like any other dynamic array.
[close]

Dynamic arrays returned by Struct member Function.

It is now possible to define a member function of a struct, that returns dynamic array.
Spoiler

Code: ags

struct MyClass
{
	int Max;
	int Arr[];
	
	import void  InitArray(int max);
	import int[] GetArray();
	import int   GetArrayLength();
};

void MyClass::InitArray(int max)
{
	this.Max = max;
	this.Arr = new int[this.Max];
	int i;
	for (i = 0; i < this.Max; i++)
		this.Arr[i] = i;
}

int[] MyClass::GetArray()
{
	return this.Arr;
}

int MyClass::GetArrayLength()
{
	return this.Max;
}

function game_start() 
{
	MyClass my_obj;
	my_obj.InitArray(5);
	int get_arr[] = my_obj.GetArray();
	int i;
	for (i = 0; i < my_obj.GetArrayLength(); i++)
		Display("#%i = %i", i, get_arr[i]);
}

[close]

Managed User Structs

In AGS parlance, a managed struct is a struct that can be created dynamically. You must use pointers to refer to them (similar to built-in types like Region or Hotspot). You declare them with the keyword "managed" and construct new instances with "new", like so:
Code: ags

managed struct Point
{
    int X;
    int Y;
};

Point *GetPosition()
{
    Point *result;

    result = new Point;
    result.X = 30;
    result.Y = 40;

    return result;
}

Important: Managed structs are currently VERY limited in that they can't contain pointers (including dynamic arrays). It is hoped that this restriction will be lifted in the future.

#define Improvements

#define can now refer to other #define'd constants. Like VC++, #define symbol expansion only needs to make sense at the time of reference. Also like VC++, the order of previously defined constants isn't important, making stuff like this possible:
Code: ags

#define RED    GREEN
#define BLUE   456
#define GREEN  BLUE
Display("%d", RED); // Prints 456
#undef BLUE
#define BLUE  123
Display("%d", RED); // Prints 123

Note: To prevent circular references, a #define cannot refer to itself or anything previously used to expand the #define symbol.

Static extender functions

You can now declare the first parameter of a function as a static identifier that corresponds to a struct, e.g.
Code: ags
function AbsInt(static Maths, int value)
{
    if(value < 0)
        value = 0 - value;
     
    return(value);
}

This works in the same way as the normal extender method syntax (e.g. this Character *) but for static methods. The above code will define a new method in the static Maths called AbsInt. You can then import it in a header:
Code: ags
import function AbsInt(static Maths, int value);

And then use it elsewhere in your code just like it were a built-in Maths function:
Code: ags
int x = Maths.AbsInt(-3);


Extra Assignment Operators

The following C-style assignment operators are now supported:
*=   (Multiply by and assign)
/=   (Divide by and assign)
&=   (Bitwise AND and assign)
|=   (Bitwise OR and assign)
^=   (Bitwise XOR and assign)
<<=  (Bitshift left and assign)
>>=  (Bitshift right and assign)

Code Regions

This was previously available in Draconian editions of AGS. You can define an arbitrary region for code folding in your script like so:
Code: ags
#region MyRegion
do stuff;
do stuff;
do stuff;
#endregion MyRegion

The AGS editor will allow you to fold and unfold this region as though it were a code block. This has no effect on compiled code.

Bug Fixes

  • Better warning when trying to compile a function declaration in a struct
  • Struct member methods with the same name as a global method (e.g. AbortGame) no longer cause a variable already defined error
  • Better error message when a struct member method is declared twice in the same struct
  • Fixed incorrect compiler parsing of a static function call inside array index brackets.
E.g:
Code: ags

int i = array[Game.GetColorFromRGB(0, 0, 0)]; // there was parse error after '['





Script API

Direction parameter for Character.ChangeRoom

This feature was previously available Draconian editions of AGS. The Character.ChangeRoom function now looks like this:
Code: ags
Character.ChangeRoom(int room, optional int x, optional int y, optional CharacterDirection direction)

Where CharacterDirection is a new built-in enum defined for facings (eDirectionUp, eDirectionUpLeft and so forth).

Character.DestinationX and Character.DestinationY

Two new read-only properties that can be used to determine where a character is currently heading (via a Walk command). If the character is currently stationary, these values are the same as Character.x and Character.y, respectively.

Character.FaceDirection

This function lets you to turn character to particular direction using new Direction enum (eDirectionUp, eDirectionUpLeft and so forth).

Global functions moved to Room class
GetRoomProperty ---> Room.GetProperty
ProcessClick -> Room.ProcessClick

GetRoomProperty is now Room.GetProperty to match Room.GetTextProperty.
The old ProcessClick is now Room.ProcessClick. An original ProcessClick only performed clicks on the room regions and objects, now its purpose is emphasized by moving it to the Room struct.
You may need to fix your scripts if you use any of these, or disable "Enforce object-based scripting" option in Game Settings.

IsInteractionAvailable() for Other Types

This is another feature from Draconian editions of AGS. The IsInteractionAvailable() method can now be called on Hotspots, Objects and Characters.

Audio Clips API

There are two new properties for dealing with audio clips in this version.
Code: ags
Game.AudioClipCount

Retrieves the number of clips and
Code: ags
Game.AudioClips[n]

Allows you to access a particular audio clip.

AudioChannel.Speed.
The new property used to get or set audio clip's playback speed. The value is defined in clip's milliseconds per second; 1000 is default, meaning 1000 of clip's ms in 1 real second (scale 1:1). Set < 1000 for slower play and > 1000 for faster play.
NOTE: currently implemented for MP3 and OGG only.
NOTE: the engine will also map "AudioChannel.SetSpeed" function to this property, therefore you can run Gord10's "Self" game using new interpreter (e.g. on Linux).

Plugin API

There is now a new function that can be used to detect whether a plugin has been loaded:
Code: ags
Game.IsPluginLoaded(const string name)

Where name is the filename of the plugin

Improved Custom Dialog Options rendering

Following callbacks are now supported for custom dialog options rendering:

Code: ags

  // runs each tick when dialog options are on screen
  void dialog_options_repexec(DialogOptionsRenderingInfo *info);
  // runs when user pressed a key while dialog options are on screen
  void dialog_options_key_press(DialogOptionsRenderingInfo *info, eKeyCode key);


Additionally following items added to DialogOptionsRenderingInfo struct:
Code: ags

  bool RunActiveOption(); // runs the active dialog option (defined with ActiveOptionID property)
  void Update(); // forces dialog options to redraw itself ("dialog_options_render" callback will be called)


--- ATTENTION, breaking changes! ---
* You must now explicitly run active option, even if you use mouse controls.
* You must now explicitly reset active option if the mouse is not above options UI
* The "dialog_options_get_active" callback is now NOT called, at all. It is supported only for backwards compatibility when running old games.
You will need to slightly change the logic of your script. In most cases it will be enough to simply rename "dialog_options_get_active" to "dialog_options_repexec".


Following are two examples of making custom dialog options with the new script system:

1. Classic mouse controls
Spoiler

int dlg_opt_color = 14;
int dlg_opt_acolor = 13;
int dlg_opt_ncolor = 4;

function dialog_options_get_dimensions(DialogOptionsRenderingInfo *info)
{
    // Create a 200x200 dialog options area at (50,100)
    info.X = 50;
    info.Y = 100;
    info.Width = 200;
    info.Height = 200;
}

function dialog_options_render(DialogOptionsRenderingInfo *info)
{
    info.Surface.Clear(dlg_opt_color);
    int i = 1,  ypos = 0;
    // Render all the options that are enabled
    while (i <= info.DialogToRender.OptionCount)
    {
        if (info.DialogToRender.GetOptionState(i) == eOptionOn)
        {
            if (info.ActiveOptionID == i) info.Surface.DrawingColor = dlg_opt_acolor;
            else info.Surface.DrawingColor = dlg_opt_ncolor;
            info.Surface.DrawStringWrapped(5, ypos, info.Width - 10,
                    eFontFont0, eAlignLeft, info.DialogToRender.GetOptionText(i));
            ypos += GetTextHeight(info.DialogToRender.GetOptionText(i), eFontFont0, info.Width - 10);
        }
        i++;
    }
}

function dialog_options_repexec(DialogOptionsRenderingInfo *info)
{
    info.ActiveOptionID = 0;
    if (mouse.y < info.Y || mouse.y >= info.Y + info.Height ||
        mouse.x < info.X || mouse.x >= info.X + info.Width)
    {
        return; // return if the mouse is outside UI bounds
    }

    int i = 1, ypos = 0;
    // Find the option that corresponds to where the player clicked
    while (i <= info.DialogToRender.OptionCount)
    {
        if (info.DialogToRender.GetOptionState(i) == eOptionOn)
        {
            ypos += GetTextHeight(info.DialogToRender.GetOptionText(i), eFontFont0, info.Width - 10);
            if ((mouse.y - info.Y) < ypos)
            {
                info.ActiveOptionID = i;
                return;
            }
        }
        i++;
    }
}

function dialog_options_mouse_click(DialogOptionsRenderingInfo *info, MouseButton button)
{
    info.RunActiveOption();
}

[close]

2. Keyboard controls
Spoiler

int dlg_opt_color = 14;
int dlg_opt_acolor = 13;
int dlg_opt_ncolor = 4;

function dialog_options_get_dimensions(DialogOptionsRenderingInfo *info)
{
    // Create a 200x200 dialog options area at (50,100)
    info.X = 50;
    info.Y = 100;
    info.Width = 200;
    info.Height = 200;
    info.ActiveOptionID = 1; // set to first option
}

function dialog_options_render(DialogOptionsRenderingInfo *info)
{
    info.Surface.Clear(dlg_opt_color);
    int i = 1,  ypos = 0;
    // Render all the options that are enabled
    while (i <= info.DialogToRender.OptionCount)
    {
        if (info.DialogToRender.GetOptionState(i) == eOptionOn)
        {
            if (info.ActiveOptionID == i) info.Surface.DrawingColor = dlg_opt_acolor;
            else info.Surface.DrawingColor = dlg_opt_ncolor;
            info.Surface.DrawStringWrapped(5, ypos, info.Width - 10,
                    eFontFont0, eAlignLeft, info.DialogToRender.GetOptionText(i));
            ypos += GetTextHeight(info.DialogToRender.GetOptionText(i), eFontFont0, info.Width - 10);
        }
        i++;
    }
}

function dialog_options_key_press(DialogOptionsRenderingInfo *info, eKeyCode keycode)
{
    if (keycode == eKeyUpArrow && info.ActiveOptionID > 1)
        info.ActiveOptionID = info.ActiveOptionID - 1;
    if (keycode == eKeyDownArrow && info.ActiveOptionID < info.DialogToRender.OptionCount)
        info.ActiveOptionID = info.ActiveOptionID + 1;
    if (keycode == eKeyReturn || keycode == eKeySpace)
        info.RunActiveOption();
}
[close]

Dialog Options

The highlight colour for dialog options (default rendering) is no longer hard coded as yellow (14). You can use:
Code: ags
game.dialog_options_highlight_color = xxx;

And set the dialog options highlight colour to whatever you like. The default is 14.

GUIControl.ZOrder

New property of a GUIControl (button, label, etc) lets you to get its current ZOrder or even change one at runtime.

File.Seek and File.Position

New function File.Seek allows to set new position in the opened file stream, related to either beginning, end or last position, while File.Position property lets you to get its current value.

Mouse clicking simulation

Mouse.Click(MouseButton)
This function fires mouse click event at current mouse position (at mouse.x / mouse.y).
So you can do following:
Code: ags

    Mouse.SetPosition(100, 100);
    Mouse.Click(eMouseLeft);

This will simulate user click at (100,100).

GUI.Click(MouseButton) and Button.Click(MouseButton)
Run the OnClick event handler for the GUI or Button, if there is one.
Code: ags

    btnStart.OnClick(eMouseLeft); // simulate user press on a button


GUI.ProcessClick(int x, int y, MouseButton))
Performs default processing of a mouse click at the specified co-ordinates on GUI, somewhat similar to old ProcessClick but affects only interface (GUI and any child controls).
Code: ags

    GUI.ProcessClick(50, 120, eMouseRight); // simulate user click with right mouse button on GUI


Custom property values can be set at runtime

The related script functions are added to all classes that supported GetProperty() and GetTextProperty(), that is - Room, InventoryItem, Hotspot, Object and Character:
Code: ags

  /// Sets an integer custom property associated with this room.
  static bool SetProperty(const string property, int value);
  /// Sets a text custom property associated with this room.
  static bool SetTextProperty(const string property, const string value);

They return 'true' if the property value was changed, or 'false' if such property does not exist, or property type is incorrect (like setting text value for integer property).

NOTE: Room, Hotspots and room Objects property values are reset to defaults when ResetRoom() is called.

Improvements to Tinting functions to make various tinting methods and properties compliant.
(This should be compatible with Draconian Edition scripts)

Region.Tint() script function now has optional luminance parameter
Code: ags
void Tint(int red, int green, int blue, int amount, int luminance = 100);


New SetAmbientLightLevel() script function.
Code: ags

  /// Sets an ambient light level that affects all objects and characters in the room.
  void SetAmbientLightLevel(int light_level);


New Character.SetLightLevel and Object.SetLightLevel script functions
Code: ags

  /// Sets the individual light level for this character.
  import function SetLightLevel(int light_level);


Negative light levels can be used in 8-bit games to produce darkening effect.
This applies to Ambient, Character and Object light level functions (it already worked with Region.LightLevel).

System.RuntimeInfo
This property returns a string, which contains runtime information, same as you were getting when pressed Ctrl+V (Ctrl+Alt+V - since AGS 3.3.3).



Editor

Building for multiple platforms
The Editor can now build for several different platforms. This is configured with this new option in General Settings (Compiler -> Build target platforms):



Select the platforms you like to build the game for by pressing on "drop down" button to the right and checking or unchecking items in the list:



"DataFile" builds a game data file, and cannot be unchecked. Other targets may be selected in any combination.
More platforms will be added in time.
Note, this only affects doing full build (Build -> Build EXE / Rebuild all files). When running in test mode only Windows version is built always.

The "Compiled" folder has changed. Now each platform has its own subdirectory: "Windows", "Linux", etc. To distribute your game - pack/copy contents of corresponding folder(s).

More properties to set for game objects
Padding for Text GUI Windows
Text GUI windows now have a padding property which lets you control how much space appears between the border and the text inside a text GUI window. Previously, this value was hardcoded as 3 pixels. It now defaults to 3 pixels.
Spoiler
[close]
Clickable for Room Objects is now exposed in the editor.
Spoiler
[close]
TintLuminance for Room Regions to set all tint parameters at design time.

Editor Plugin API
Exposed GUI Panes to plugin API.

Various improvements

  • Added "Close all tabs" command for the pane's context menu.
  • Added Preference option "Prompt dialog on closing multiple tabs".
NEW

  • Allow room objects to be locked like GUI controls (by toggling Locked property)

Bug Fixes

  • Undo history will no longer be deleted when a tab changes its docked state
  • Fixed crashes under certain circumstances when a script editor is closed
  • Fixed crash if selecting a character without a normal view in the room designer
  • Ctrl+Tabbing now works the first time when cycling through open editor tabs
  • Go to Line... now goes to the correct line and doesn't select it
  • The project is now completely rebuilt whenever Enable Debug Mode in General Settings differs from the setting used for the last build
  • The sprite editor now highlights drop targets when you drag sprites around
  • Fixed a crash when trying to run game setup from editor while "Compiled" folder does not exist.
  • Fixed project items could sometimes get incorrectly arranged inside the folder.
  • Fixed writing faulty timestamps in project file on some occasions that could spoil usage of file versioning control.
  • Fixed Help window positioning on multi-monitor desktop.
NEW

  • Fixed error in autocomplete occuring when there is a single-line comment in the end of the script.



WinSetup
Improvements
* You can now make actual language name displayed instead of "Game Default" if you put following line in the "[language]" section of acsetup.cfg:
Code: text

default_translation_name = "British"

#198
AGS 3.3.5 - Patch 1 released


Please, read "Upgrading to AGS 3.3" AND "Upgrading to AGS 3.3.5" topic in the manual that comes with this version before upgrading your game project to 3.3.0 - 3.3.5! It contains important information on few potential problems you may encounter.

Released: 27th April 2016

Previous version: AGS 3.3.4 forum thread



Please, read the information under "spoiler" if you are new to 3.3.5 before using it
Spoiler

Since 3.3.5 AGS does not allow to write any files into other path rather than "$SAVEGAMEDIR$"
(personal user saves directory) or "$APPDATADIR$" (all-users game data directory). If you attempt to open
file for writing using relative path without location tag, the filepath will be automatically remapped to
$APPDATADIR$ location.

Because of that, for backwards compatibility reasons, when you try to open file for reading using relative path
without location tag, AGS will first look for that file in $APPDATADIR$, and only if no matching file is
found there, then the game installation directory will be checked.

To force opening file in the game installation directory (for reading) a new location tag was introduced:
"$INSTALLDIR$". When using this tag you will explicitly tell AGS to look in and only in the game's
installation directory. However, if you try opening file for writing at such location, that will result in
failure.

Players are now allowed to set up their own custom path in game setup, where the game
saves & data will be written. This is done in the game setup program.
This works as if $SAVEGAMEDIR$ and $APPDATADIR$ were redirected to custom location.
Redirection is done internally by the engine, you do not need to add anything to your game scripts to make it work.

Conceptually, AGS is gradually leaning towards using only "symbols of file locations" rather than actual,
explicit locations on the filesystem.

Furthermore, game setup will now write config file into game saves location, rather than game's installation directory.
If config file is present in the game installation folder, then it is used as "default" read-only config file.
The config in saves folder overrides default one.
This way it should be totally safe to install AGS games into C:/Program Files, without having administrative rights.
[close]


Changes in the Patch 1:

Engine:
- Added support for $INSTALLDIR$ location tag in the filepaths used in the script.
- Fixed game could not find files in the current directory when run from the Editor.

WinSetup:
- Fixed error that could occur if choosed custom save path contained "%" symbol.
- Read correct game's resolution from game data instead of config file.
- Do not write all default config contents to user config, save only options that are set by setup program.


Changes since version 3.3.4:

Editor Features:
- Path to resource's (sprite, audio) source file is now saved as relative one if the file is
  located inside game project's folder.
- Removed arbitrary limit of the script imports (was 50000).
- Script allows struct member qualifiers to be in any order.
- Better detection of integer constants overflow in script.
- Removed arbitrary limit of integer default value of +/-32000. Integer values are now limited
  by correct 32-bit values (-2147483648 to 2147483647).
- Support for negative constants in enums.
- Better folding markers and indentation guides in script editor.

Editor Bug Fixes:
- Fixed compiler crash if unknown keyword used after "readonly".
- Fixed compiler did not properly report incorrect type of dynamic array in function declaration.
- Fixed compiler did not report proper type name in case of syntax error sometimes.
- Fixed mouse cursor flicker above the script editor.

Engine Features:
- Removed unconfigurable mouse cursor's acceleration (Windows).
- Support for mouse cursor speed control (works in fullscreen mode only by defau;t): may be defined in configuration and changed in script.
- A config option for keeping consistent cursor speed relative to user's desktop resolution.
- Support for locking mouse inside window: automatic lock is enabled in configuration, and user
  may use Ctrl+Alt combination to lock/release mouse at any time.
- Restricted writing game files to special system directories
  (game is forbidden to write files into installation directiory or by absolute path).
  For old games unsafe paths are remapped.
- Support for player defined saves & game file directory.
- -v/--version command line argument makes engine display its version and bail.

Engine Bug Fixes:
- Fixed crash if screenshot is taken while game window was minimized or moving.
- Fixed alpha blend did not work properly for speech portrait if blinking frame did not have alpha channel.
- Fixed Display and Say script commands were displaying text for minimal amount of time under certain conditions.
- Fixed legacy audio functions did not start digital music playback if MIDI driver failed to initialize.
- Fixed game was run in smallest possible window if graphics driver failed to initialize fullscreen mode.
- Fixed "--help" command line argument not working all times depending on its order.
- Fixed engine did not always properly closed application window when running debug build.

Script API:
- Supported late_repeatedly_execute_always() callback in script, called after game has updated, but
  before it is drawn.
- Added Mouse.ControlEnabled (readonly) and Mouse.Speed properties.
- Added System.HasInputFocus property which tells if game currently has focus or runs at background.

Cosmetics & convenience:
- Clarified disabled MIDI option name in WinSetup.
- Extended information displayed if graphics driver failed to initialize.
- Clarified error messages for running unsupported games.


Templates updated:
Empty and Default Game templates were converted to 32-bit ones. You may still downgrade them to 16 and 8-bit after creating the game project of course.
Default Game template has its save system fixed, as explained in this thread.
#199
Experimental build which supports changing game resolution at runtime.
Based on 3.4.0.6.

Current commands: Alt + Enter - switches from window to fullscreen and back.

Download: http://www.mediafire.com/download/vgyqp0i1e4eyjqt/acwin_3.4.0.6--changeres.zip
Source branch: https://github.com/ivan-mogilko/ags-refactoring/tree/feature--dynamic-gfx-mode

PS. Regarding the merge of 3.3.5 to 3.4.0, I must apologize for the delay. I know I was making promises and then did not keep them. But the work continues.
#200
AGS Engine & Editor Releases / AGS 3.3.5
Sat 26/03/2016 01:39:40
AGS 3.3.5 released


Please, read "Upgrading to AGS 3.3" AND "Upgrading to AGS 3.3.5" topic in the manual that comes with this version before upgrading your game project to 3.3.0 - 3.3.5! It contains important information on few potential problems you may encounter.

Released: 26th March 2016

Previous version: AGS 3.3.4 forum thread



Please, read before using
This update adds a serious change that may be not noticeable at first (and many players will probably not notice it at most times).
The change was discussed at: http://www.adventuregamestudio.co.uk/forums/index.php?topic=52897.0

Since 3.3.5 AGS does not allow to write any files into other path rather than "$SAVEGAMEDIR$" (personal user saves directory) or "$APPDATADIR$" (all-users game data directory). An attempt to open file for writing at any other path from script will make engine automatically remap the path to $APPDATADIR$. If your game is built in Debug mode, it will also print a warning into "warnings.log".

At the same time the players are allowed to set up their own custom path to write game saves & data in. This basically works as remapping $SAVEGAMEDIR$ and $APPDATADIR$ to custom location. Game script will be "unaware" of this, and work as usual.

Conceptually, AGS is gradually leaning towards using only "symbols of file locations" rather than actual, explicit locations.

Furthermore, winsetup will now write config file into game saves location, rather than game's installation directory. If config file is present in the game installation folder, then it is used as "default" read-only config file. The config in saves folder overrides default one.
This way it should be totally safe to install any AGS game into C:/Program Files, without having administrative rights, or even have it installed on device with read-only access.


Changes since version 3.3.4:

Editor Features:
- Path to resource's (sprite, audio) source file is now saved as relative one if the file is
  located inside game project's folder.
- Removed arbitrary limit of the script imports (was 50000).
- Script allows struct member qualifiers to be in any order.
- Better detection of integer constants overflow in script.
- Removed arbitrary limit of integer default value of +/-32000. Integer values are now limited
  by correct 32-bit values (-2147483648 to 2147483647).
- Support for negative constants in enums.
- Better folding markers and indentation guides in script editor.

Editor Bug Fixes:
- Fixed compiler crash if unknown keyword used after "readonly".
- Fixed compiler did not properly report incorrect type of dynamic array in function declaration.
- Fixed compiler did not report proper type name in case of syntax error sometimes.
- Fixed mouse cursor flicker above the script editor.

Engine Features:
- Removed unconfigurable mouse cursor's acceleration (Windows).
- Support for mouse cursor speed control (works in fullscreen mode only by defau;t): may be defined in configuration and changed in script.
- A config option for keeping consistent cursor speed relative to user's desktop resolution.
- Support for locking mouse inside window: automatic lock is enabled in configuration, and user
  may use Ctrl+Alt combination to lock/release mouse at any time.
- Restricted writing game files to special system directories
  (game is forbidden to write files into installation directiory or by absolute path).
  For old games unsafe paths are remapped.
- Support for player defined saves & game file directory.
- -v/--version command line argument makes engine display its version and bail.

Engine Bug Fixes:
- Fixed crash if screenshot is taken while game window was minimized or moving.
- Fixed alpha blend did not work properly for speech portrait if blinking frame did not have alpha channel.
- Fixed Display and Say script commands were displaying text for minimal amount of time under certain conditions.
- Fixed legacy audio functions did not start digital music playback if MIDI driver failed to initialize.
- Fixed game was run in smallest possible window if graphics driver failed to initialize fullscreen mode.
- Fixed "--help" command line argument not working all times depending on its order.
- Fixed engine did not always properly closed application window when running debug build.

Script API:
- Supported late_repeatedly_execute_always() callback in script, called after game has updated, but
  before it is drawn.
- Added Mouse.ControlEnabled (readonly) and Mouse.Speed properties.
- Added System.HasInputFocus property which tells if game currently has focus or runs at background.

Cosmetics & convenience:
- Clarified disabled MIDI option name in WinSetup.
- Extended information displayed if graphics driver failed to initialize.
- Clarified error messages for running unsupported games.


Templates updated:
Empty and Default Game templates were converted to 32-bit ones. You may still downgrade them to 16 and 8-bit after creating the game project of course.
Default Game template has its save system fixed, as explained in this thread.
SMF spam blocked by CleanTalk