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

#221
AGS Engine & Editor Releases / AGS 3.3.4
Sun 12/07/2015 17:50:30
AGS 3.3.4 released


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

Released: 14th July 2015

Previous version: AGS 3.3.3 forum thread


Changes since version 3.3.3:

Features:
- Removed 10,000 symbols limit in scripts.
- Added Character.Thinking and Character.ThinkingFrame script properties.
- Added Papagayo voice lip sync support.
- Find/Replace dialog now remembers the state of "Case sensitive" checkbox.
- Engine now scans all available files in search of game data, only giving standard names
  a priority.

Bug Fixes:
- Fixed Editor crash in case of lip sync data parsing error.
- Fixed Find/Replace dialog skipped the first word in the script being searched through.
- Fixed an order of cycling through fields on Find/Replace dialog.
- Restored letterboxed game's viewport behavior for larger (and scrolling) rooms.
- Fixed Hq2x and Hq3x filter rendering when the display resolution requires side borders.
- Fixed Hq2X and Hq3x filters leaving graphic artifacts on letterbox borders.
- Fixed wrong screen settings could be applied in particular cases when requested gfx filter
  could not be found or failed to initialize.
- Gfx filter name supplied in command line is case-insensitive now.
- Do not disable both digital sound and MIDI music if only one of these failed to initialize.
- Fixed MIDI music refuses to start if digital sound is disabled.
- Fixed division by zero in AlMP3 library code, that could cause crash when seeking in MP3
  audio clip.
- Removed an advise to contact Chris Jones displayed in case of error.

Compatibility:
- Permissive emulation of pre-AGS 3.1.1 "option-on/off" commands in dialog script, that do
not stop game execution if a wrong option number is supplied.

NOTE: has the MI 9-verb template updated to 1.5 RC2.
#222
I was contacted by a representative of a team, which is making a list of 2d game engines:
http://www.slant.co/topics/341/~what-are-the-best-2d-game-engines

He asked me if I can give him a summary of pros and cons of AGS.
I do not feel like doing this only by myself, because I am not a game developer and have a rather "narrow" view on the program.
Could you help me in making a list of most important points so that I could send it back to them?

EDIT: replied sent; if you want to add more cons and pros, register at their webpage and do it yourself:
http://www.slant.co/topics/341/viewpoints/66/~what-are-the-best-2d-game-engines~adventure-game-studio
#223
Editor Development / AGS 3.3.4 Preparation
Tue 02/06/2015 22:05:14
Here's the test (pre-release) build of the following 3.3 update. Its main purpose (aside from bug fixes) was the removal of script symbol limits, that caused trouble to some of the projects recently. Since this is a critical issue for some game developers, it was decided to move this feature down to 3.3.4 instead of making people wait till 3.4.0 becomes a stable version.

Download ZIP: http://www.mediafire.com/download/okm7413oaayy0io/AGS-3.3.4.zip
This is not a full installation package; the contents must be copied over latest public version AGS 3.3.3.

Includes features:
* Script symbol limit removed (ws 10.000 symbols);
* Papagayo lip sync support added (request by AGD2, who basically needed symbol limit and Papagayo to complete their game);

Noteable bug fixes:
* Restored original behavior for games with letterbox option (letterbox by design) where rooms with greater height should not have borders displayed over them (was broken in 3.3.3 or 3.3.2).
* Fixed Hq2x and Hq3x filters not working properly if the selected screen resolution includes side-borders (a very old bug).


The purpose of this build is to let people test if the script symbol limit removal works for them and no compilation problems arise.

I would also like to know if there are other critical issues that prevent a game developer complete his/her game in 3.3 version. If there are such problems, we could be adding fixes here.
#224
There was this wonderful opening music in "7 days a Skeptic", that also played in a later sequence and under more grim circumstances. You can listen to this in following walkthrough videos:
https://youtu.be/VVRP_IL24Ec?t=57
https://youtu.be/Gfzt8c2nE2o?t=490

I could not find if its mentioned anywhere in credits; but then I found what this music is, totally by accident.
http://www.youtube.com/watch?v=XNggnmks85k

Such things happen (wtf)
#225
There is a request by Radiant: http://www.adventuregamestudio.co.uk/forums/index.php?issue=556.0
What he is asking is to let game developers include certain files into compiled game package and read (but not write) them at runtime. As far as I can guess, this is to ensure they are always present and not e.g. occasionally deleted or modified by players.

From the engine's side this is a very simple task, because AGS already has a working method to read anything from a package which may be utilized.
This method works this way: engine can look for the file in the package, and if it is not found there, then it will look for stand-alone file into directory.

Script-wise this may be achieved introducing new function:
Code: ags

static File* File.OpenResource(String name, optional enum priority);

Where "priority" is either "Game file" or "Directory". This is precisely like internal resource manager works in AGS.


On the Editor's side, most easier would be to use same method as with Speech: introduce new folder, e.g. "Resources", and automatically pack all the folder contents into game.
Pro: this method is very simple and straightforward.
Con: this method requires game dev to work outside of the Editor.

Alternative solution would be to add a new node in the Project Tree and let users fill it with file names. The files should still be copied localy, I think, similar to how AudioCache works.

There was also a question, whether we may need to have a script objects for such resources to access them in script by script names, e.g.:
Code: ags

File* f = rDataFile.Open();
String rDataFile.Filename;
// etc

I was playing with this idea for some time, but did not make up my mind fully yet. For now it looks for me like not giving much benefit.


Does anyone have any thoughts about the issue?
#226
We are looking for users opinion on what properties are edited first most often in AGS.
There is a way to make them selected on the property panel when you open the object for editing. Thus you can immediately see that property on screen (if the list is so long that it requires scrolling) and also start typing property value right away.

If you have any ideas on that, please state it here.

I suggest making a table like this:





TypeProperty
General SettingsGame Name
CharacterName
Walkable AreaArea specific view

Etc
#227
The main problem of custom speech was that it cannot be binded with standard Say commands in game script and speech lines in Dialog script. You cannot make the engine call your custom functions, you have to do that yourself by manualy placing their calls.
Not only that takes more time, but also you cannot take advantage of otherwise automatic features, such as character animation, voice playback and speech skipping: you have to code these yourself.

The most logical (in my opinion) solution would be to add support for speech callbacks, which work in a similar way as custom dialog options rendering: you give your functions predefined names and engine calls them instead of built-in speech processing.

There was already some discussion about this a while ago: http://www.adventuregamestudio.co.uk/forums/index.php?topic=48518.0
Since then I changed my mind a bit though.

My proposal is to support at least two callbacks. We may later extend them, as well as the contents of the callback parameter.

Code: ags

function speech_start(SpeechRenderingInfo *info);

This is called before displaying a speech. User should set up some of the SpeechRenderingInfo properties to initialize the speech overlay

Code: ags

function speech_render(SpeechRenderingInfo *info);

This is called when the speech requires a repaint (default - only once). Here the user should get a drawing surface and do paint operations.

The contents of SpeechRenderingInfo might be:
Code: ags

struct SpeechRenderingInfo
{
  //
  // the Overlay settings
  //
  attribute int X; // the X co-ordinate of the top-left corner of the dialog options
  attribute int Y; // the Y co-ordinate of the top-left corner of the dialog options
  attribute int Width;  // the width of the dialog options
  attribute int Height; // the height of the dialog options
  attribute bool HasAlphaChannel; // should the drawing surface have alpha channel
  readonly attribute DrawingSurface* Surface; // the surface that the speech is rendered to
  
  //
  // Speech data
  //
  readonly attribute Character *SpeakingChar; // the character who is talking
  readonly attribute String     Text; // the text to display
  readonly attribute int        VoiceID; // the id of the voice file (taken from "&CHARXXXX" part of the speech text)
};



I would like to propose game developers to consider if they will be able to implement their actual custom speech using this system. Are there any other callbacks and/or speech data that would be required?
#228
AGS Engine & Editor Releases / AGS 3.3.3
Mon 15/12/2014 18:36:20
AGS 3.3.3 released


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

Released: 31th December 2014

Previous version: AGS 3.3.2 forum thread


This is a very small release, containing only couple of changes and bug fixes.


Changes since version 3.3.2:

Features:
* "Number dialog options" game setting now let you choose between "Disable", "Keyboard shortcuts only" and "Draw numbers and use keyboard shortcuts" instead of being just "on"/"off". Default for new projects is "Disable", but when importing old projects "off" value is interpreted as "Keyboard shortcuts only", because that is how it worked in previous versions of AGS.
* The built-in shortcut for showing runtime information has been changed from "Ctrl + V" to "Ctrl + Alt + V".

Bug Fixes:
* Fixed division by zero and color value overflow cases in alpha blender.
* Fixed voice audio breaking playing on very rare occasions when clip format is OGG or MP3. The fix is imperfect, and there's very short pause occuring at same point of playback. The voice will continue playing though.
* Fixed character walking in hi-res games when the destination has negative Y coordinate.
* Fixed black borders not drawn in screen corners by Direct3D renderer.

Compatibility:
* Corrected interpretation for games made with AGS 3.0 - 3.2 to let them assign empty loop in SetObjectFrame().

Engine log:
* Do not log out supported gfx modes twice if the secondary color depth is equal to primary one (e.g. for 8-bit games).
#229
There was a request by abstauber to add functions which set active dialog option and run some option; also the one that forces custom options to redraw.
http://www.adventuregamestudio.co.uk/forums/index.php?issue=542.0
http://www.adventuregamestudio.co.uk/forums/index.php?issue=532.0

He needed that because he was making a dialog options controlled by keyboard.

If I understand the situation right, the actual problem is that there are no events for key press and timed update (tick) related to custom dialog options, that would have RenderingInfo as parameter (DialogOptionsRenderingInfo is not accessible from normal function). There is one for mouse click, though (dialog_options_mouse_click), and the one called "dialog_options_get_active", which is practically "on mouse move" event.

What I propose is to add two more optional event handlers:

1. A timed updated event -- dialog_options_update / dialog_options_tick / dialog_options_repexec, or something like that.
2. A key press event -- dialog_options_key_press.

Both will get DialogOptionsRenderingInfo as parameter.
Current active option may be then set with DialogOptionsRenderingInfo.ActiveOptionID from dialog_options_key_press.
Timed update event may be used for any changes to GUI over time.

Last but not least, introducing a DialogOptionsRenderingInfo.Update() function will help to redraw GUI when required, thus supporting special timed effects. This may be called from either *_key_press or *_repexec event handlers, depending on situation.

#230
There's a game setting called "Number dialog options" (in "Dialogs" section).
The description sais:
Quote
Dialog options become numbered bullet points, and the numeric keys can be used to select them
However, the numeric keys choose options regardless of whether this option is on or off.
May this be considered a bug?

EDIT: I think that depends on whether it is valid to use these numeric keys with custom dialog rendering.
#231
Hereby I state a proposal to add a bunch of clicking/interacting simulating functions to AGS, based on past user problems and suggestions.
E.g. this: http://www.adventuregamestudio.co.uk/forums/index.php?topic=48445.0

Mouse.Click(MouseButton)
Fires mouse click event. This should not do any extra tests, just make a click, as if human pressed mouse button.
For instance, this will also skip cutscenes and call on_mouse_click function.
Because of how AGS works this click will run only after current script has ended.
The click is performed at current mouse coordinates. Why: the on_mouse_click scripts use mouse.x and mouse.y to know where the click occured. If we let user define coordinates as well, the logic will be broken, so it is of little use.

ProcessClick -> Room.ProcessClick(x, y, mode)
Move global ProcessClick() function to Room class (as static method). This is not only further OO-ing, but will also make it more clear for users that this simulates only clicks on room contents (e.g. not on GUI).

GUI.ProcessClick(x, y, MouseButton)
Static method.
Simulates a mouse click on screen, but affects only GUI, as opposed to old (Room.)ProcessClick.
This should simulate click on GUI frames and their controls at given position.

GUI.Click(MouseButton), GUIButton.Click(MouseButton)
Object method.
Triggers OnClick event on GUI or GUIButton, if it is present. Compareable to RunInteraction.
Because of how AGS works the event functions will run only after current script has ended. RunInteraction() does the same. You may, however, queue multiple Clicks.
#232
I experience this exception with the new compiler when building a game based on "9-verb MI" template:

Code: csharp

public void WriteViews(IViewFolder folder, Game game)
{
    if (writer == null)
    {
        throw new CompileError("Could not write views: Invalid stream (NULL)");
    }
    foreach (View view in views)
    {
        short numLoops = (short)view.Loops.Count; <--------- HERE
        writer.Write(numLoops);


Exception is: System.NullReferenceException; cause: 'view' object is null.
It appears that 'views' collection may contain null-pointers. In the case of "9-verb MI", the first non-null View is under #9.

It also appears that 'game.ViewCount' returns the number of the highest View ID, not the real number of views, therefore 'views' collection may be very large, yet contain only few actual View objects.

UPD.
The way this was done in AGS.Native:
Code: cpp

int viewCount = AGS::Types::FolderHelper::CountViews(AGS::Types::FolderHelper::GetRootViewFolder(game));

Also views were converted using some kind of helper:
Code: cpp

AGS::Types::FolderHelper::ViewFolderProcessing ^del = 
    gcnew AGS::Types::FolderHelper::ViewFolderProcessing(ConvertViewsToDTAFormat);
AGS::Types::FolderHelper::ForEachViewFolder(folder, game, del);

for each (View ^view in folder->Views)
{
<...>


I think this is because views always keep their ID, even if some were deleted, unlike Characters, etc.
#233
Whenever a forum member is assigned a newly created forum group, he cannot access issue tracker even though I explicitly enable access to that group in admin settings.
This begins to be frustrating, because many new groups were added recently. :(
#234
I am not an expert in sound formats, therefore I ask for help about this one.

I have this interesting WAV file, the interesting part is that it plays in any media player I have, it is played by built-in player in AGS editor, but cannot be played by AGS engine. Also, Audacity software fails to open it.

http://www.mediafire.com/download/mfgiv7b1fhxddhs/Vivaldi-Spring-remake.wav

Can someone check this file out and tell what problem may that be? Is there a program that could convert it to a more common format?
#235
AGS Engine & Editor Releases / AGS 3.3.2
Sun 28/09/2014 18:31:02
AGS 3.3.2 released


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

Released: 28th September 2014

Previous version: AGS 3.3.0 forum thread


A special note regarding this release:
Spoiler
AGS 3.3.0 had several minor updates, but the main version number was not increased, which was a mistake on my part. This caused some people not notice some of the latest updates.
The 3.3.2 has the version number increased.
I intentionally list both changes since latest 3.3.0 update (aka hotfix-3) and changes since the very first 3.3.0 release made in february 2014. Latter should help those who've missed these intermediate updates.
We'll try to keep changing version number properly in the future.
[close]
A special note regarding version number:
Spoiler
Why 3.3.2 and where's AGS 3.3.1?
AGS 3.3.1 was a WIP (work-in-progress) version that was discontinued and renamed into AGS 3.4.0 (still WIP), because of the number and quality of new features. To avoid confusion with that 3.3.1, this new update is called 3.3.2.
[close]


Changes since version 3.3.0:
(most of these were included in updates 3.3.0-hotfix1, 3.3.0-hotfix-2, 3.3.0-update1 and 3.3.0-hotfix-3)


Features:
* Reimplemented alternate display modes, now side-borders and top/bottom borders should work properly for all game and screen resolutions. There are still certain limitations to which resolutions AGS can use; these will be removed in following releases (see AGS 3.4.0 alpha).
* Added config option to run pre-3.1.0 lo-res games in hi-res mode.
Some of the older games could be run in distinct lo-res (320x200/240) and hi-res (640x400/480) modes. They could use different graphics (e.g. fonts) depending on this mode. (Noteable example are first parts of Blackwell series) This was useful back then because old AGS did not have any scaling filters.
Newer engines do not have (and do not need) this capability, but with this option you may force 3.3.2 engine to run lo-res game in hi-res.
NOTE: this is only important if you run old games with new interpreter (on Windows or other platforms). You do not need this to develop your own games.
To enable this option, manually put these lines in the acsetup.cfg:
Code: text

[override]
upscale=1



Bug Fixes:
* Fixed Editor crashing when user types "#define" in script.
* Fixed error in game compilation after user moves item folders up or down in the project tree.
* Fixed bug which could make Character.Transparency and Object.Transparency properties return
  slightly incorrect values.
* Fixed bug that could let user to load corrupted savedgame, which in turn could cause more trouble.
* Provided error handling for several exceptional cases on graphics mode initialization (program
  should at least close normally, showing comprehensible error message).
* Fixed crash in legacy built-in inventory screen (called with InventoryScreen script function).
* Fixed a rare bug in script interpreter that could cause misinterpretation of value provided by plugin.
* Fixed "--setup" command line argument not working if it is not the first argument.
* Fixed WinSetup dialog not sized properly when larger fonts (DPI) option is used in
  Windows display settings.

Engine log:
* Write the game data version and the list of supported graphic modes to the log.

Manual:
* Fixed Speech.VoiceMode example.



Changes that correct things broken by the superseding 3.3.0 updates:
(you do not need to know these if you upgrade from the very first 3.3.0 release, or even older versions)

Bug Fixes:
* Restored letterboxed-by-design game mode (broken in 3.3.0 update-1).
* Fixed misinterpreted 320x200 resolution type when running very old games (broken in 3.3.0 update-1).
#236
AGS 3.4.0.6 (Alpha) - Builder Patch

Download 3.4.0.6 (alpha) as a .zip archive

Download Linux build package
(unarchive into Editor directory to enable building game for Linux)

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

Debug symbols (for developers):
http://www.mediafire.com/download/jwu9jg3hm0bwlmo/PDB_3_4_0_6.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.0 after saving with this version.

Last updated: 28th of July, 2015
Includes all changes from AGS 3.3.3 release
The differences from 3.4.0.5 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.

NEWSwitch 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
NEW

  • 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.
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, 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".

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.



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"



Contributors
Spoiler

Alan v. Drake
ChamberOfFear
Crimson Wizard
cellproductions
Gurok
monkey_05_06
Tzachs
salty-horse
[close]
#237
UPD: this was a test version, for more recent version check this thread: http://www.adventuregamestudio.co.uk/forums/index.php?topic=51050.0
//-----------------------------------------------------------------


Okay, this took ridiculously long time because of different reasons (some of which were rather irrational), but I finally seem to be generally content with the code and got every backwards-compatible thingie working in my custom resolutions rewrite.

This is the latest 3.3.1 branch (soon be renamed to 3.4.0.0 actually) with the free display resolutions, made for your test and comments.
http://www.mediafire.com/download/bbn1krqj636ib8z/AGS-3.3.1-a2-free-resolutions.zip
UPD with custom resolutions:
http://www.mediafire.com/download/9w1astxw1ocadv1/AGS-3.3.1-a2-custom-gameres.zip

Source code in my personal repository: https://github.com/ivan-mogilko/ags-refactoring/tree/feature-custom-gameres

The package is not complete and its contents should be copied over
Gurok's 3.3.1 alpha 2 release.

Please, do not use this for your actual game development, this has passed only limited amount of testing.

I must explain following:
1. This does not have custom game resolutions yet. These are very easy to add, and I'll probably do that following day for the sake of test; however I would like to make a them a separate pull request in our repository, because they are, in essence, a separate feature.
Now does.
2. I must say sorry about this, but this version still has old built-in winsetup :embarrassed:. Although I declared my intentions to make a stand-alone utility, I met few problems that would require additional investigation on my side, and I just could not yet find free time to look into that; while winsetup code was practically ready since the last Custom Resolutions build, only requiring some fixing.
Also I was getting weary of this addition takng so long, so I decided to limit the changes at this point.


The main intention of this test build is to:
1. Ensure that free resolutions still work at least as good as in last Custom Res. build.
2. Ensure that people are generally happy with visual setup. The one I did for CR build had a weird resolution selection for windowed mode. For this time I used Snarky's commentary as a basis.


There are changes to the configuration file and visual setup dialog. I'll start with the latter.

Here how it looks like now:
Spoiler

Displaying full set of options after pressed "Advanced" button:


Displaying the contents of "graphics modes" list:


Displaying the contents of "scaling" list:


As you may notice, the scaling is both for increasing and decreasing size, but has only integer factors in the selection.
The available factors are determined by calculating maximal fit in whether chosen full screen mode, or your current desktop (for windowed mode).
The downscale factors actually treat 320x200 game as minimum, so you won't be able to select a downscale factor for 320x200 or 320x240 games.
[close]


As for configuration file, it allows to do more precise setup, including even bordered window mode (visual setup can't do that at the moment) and different scaling factors for width and height.
All graphics mode settings are now placed under "[graphics]" section in configuration file. Following is the working example with all the possible options:

Code: text

[graphics]
driver = D3D9
windowed = 1
screen_def = explicit
screen_width = 1920
screen_height = 1080
match_device_ratio = 0
filter = linear
filter_scaling = max
filter_scaling_x = max
filter_scaling_y = max
game_frame = center
vsync = 1


What does these mean:
- driver (DX5, D3D9) - which gfx driver (renderer) to use
- windowed (0, 1) - play fullscreen or in window
- screen_def (explicit, scaling, max) - how the screen (window) size is determined:
  = explicit - requires exact screen width & height values
  = scaling - tries to make screen equal to game size scaled by filter (best for windowed mode)
  = max - sets to your desktop resolution
- screen_width, screen_height - which screen size to use if screen_def = explicit, ignored otherwise
- match_device_ratio - an auxiliary option, instead of using width and height, looks for the nearest mode that keeps your desktop aspect ratio
- filter - gfx filter name, depends on gfx driver; one filter was renamed:
  = DX5: stdscale, hq2x, hq3x
  = D3D9: stdscale, linear
- filter_scaling (any integer number, or "max") - defines a uniform scaling factor for the filter; positive numbers mean upscale, negative numbers mean downscale, 0 or "max" means maximal integer factor fitting in the window.
- filter_scaling_x, _y - these are not really useful, but may be just little fun to play with; they allow you to define different scaling factor for width & height of the picture; they override "filter_scaling" option
- game_frame (offset, center, stretch, proportional) - defines how the game is positioned inside the window (and fullscreen):
  = offset - in theory needs x,y coordinates, but currently just places picture at the top-left corner; not really useful, just for completeness
  = center - the picture scaled by filter is positioned at the screen center
  = stretch - the picture is scaled by filter, then stretch to fit the whole screen
  = proportional - the picture is scaled by filter, then stretched to fit the maximum of the screen while keeping game's aspect ratio.
- vsync (0, 1) - vertical sync.


As you may notice, the scaling options do not allow non-integer factors. This is not a problem of implementation, just the design choice. If there will be a real need to use non-integer factors, I would simply change the option parsing to read floats; however, I am not sure this will be demanded.
#238
Editor Development / "API version" switch
Mon 15/09/2014 14:04:03
This issue was created in the early days of open source development:
http://www.adventuregamestudio.co.uk/forums/index.php?issue=303.0

I want to bring it up again.

Reason / problem: we are inserting new stuff to script API header and removing something old. Both can break existing projects, or popular templates and script modules.
Spoiler

For example, recently added Character.FaceDirection breaks 9-verb MI template.
[close]
Solution: a per-module and/or global switch which defines API version.

Idea is to put API items in question in following blocks (pseudo-code):
Code: ags

#ifdef API_VERSION >= 3.4.0
int NewFunction();
#endif

#ifdef API_VERSION < 2.7.2
int OldFunction();
#endif


The compiler will have API version set for each module (ideally). These blocks will be processed only if condition is met, otherwise ignored.

There should be a global property in General Settings to define default API version (the highest for the new projects), and, preferrably, individual property for every script module. (Maybe rooms too).

#ifdef STRICT. The "STRICT" macro has been used to separate new OO-style classes and methods from old non-OO-style functions. Problem is that it has too much stuff hidden under itself (several iterations of API change), and sometimes the distinction is preferred.

#ifver. The "ifver"/"ifnver" macros allow to check current Editor's version. They are useful to provide backwards compatibility in script modules. However, they cannot be effectively used in API header, because, well, the Editor version is always the same, while some modules might need to be compiled with different API version.
#239
There's a wiki page, but it's rarely updated, also not sure if people will guess to look in there first:
http://www.adventuregamestudio.co.uk/wiki/Open_Source_Games

IMPORTANT: Many of these games use older versions of AGS. The latest AGS v3.* versions have full backwards compatibility support, can import and compile older projects, but this often it requires changing "compatibility" options in General Settings. These are described in this section of the manual:
https://adventuregamestudio.github.io/ags-manual/GeneralSettings.html#backwards-compatibility
In addition, there's a serie of articles addressing an upgrade of an older game to a newer version of AGS:
https://adventuregamestudio.github.io/ags-manual/UpgradingFromPreviousVersion.html
If you know which version the game was made in, you may try to sequentially upgrade it (although that might take much more effort than switching a compatibility option).

IMPORTANT: Remember to do "Build" -> "Rebuild all files" after the opening a project: that will recompile and resave all the rooms in the new format.
(Of course you also might have to fix scripts in rooms during this)



LIST UPDATED 30 June 2023:

* "A Suspicious Date": https://github.com/alkhimey/MAGS-May-19
* "AGS Awards client" (networking code!): https://bitbucket.org/agsa/ags-awards-source/src/master/
* "Aeronuts" (adventure + top-down fighter mini-game): http://shatten.sonores.de/wp-content/uploads/2014/09/AeroNuts_OSS.7z
* "Art of Dying", arcade, distributed with the source: http://www.adventuregamestudio.co.uk/forums/index.php?topic=49687.0
(Source code is available here: http://gamejolt.com/games/the-art-of-dying/21047)
* "Byte of the Draculator II": http://www.vanwijst.com/games/swarm/draculator_source.zip
* "Black Cauldron Remake" distributed with the source (last time I checked): http://www.classic-retro-games.com/Black-Cauldron_118.html
* "Cargo": https://github.com/SpookyFM/Cargo
* "Cart Life", a sim / management game: https://github.com/gondur/cartlife_src
* "Cameras Tech Demo" (technical demo): https://github.com/ivan-mogilko/ags-camdemo
* "Cat Ventures" (uses python scripts for generating Rooms): https://github.com/juanmcasillas/CatVentures
* "Demo Quest", an ancient demo game, uses deprecated script: https://github.com/adventuregamestudio/ags-demo-quest
* "Dungeon Hands" (card game): https://github.com/ericoporto/DungeonHands
* "Eternally Us" distributed with the source: http://www.adventuregamestudio.co.uk/site/games/game/1303/
* "Hell Puppy" (arcade): https://github.com/VacaRoxa/dogfromhell
* "ICBM", a sim-game, distributed with the source:  https://gamejolt.com/games/icbm/57197
* "Last & Furious" (top-down racing): https://github.com/ivan-mogilko/ags-lastfurious
* "Oceanspirit Dennis", a big collection of joke games by various authors: https://www.adventuregamestudio.co.uk/forums/adventure-related-talk-chat/the-oceanspirit-omnibus/
* "Open Quest" (a simple demo game made in 2007): https://www.dropbox.com/s/3g01fjudw71xuld/OpenQuest_AGS.zip?dl=0
* "Read A Book": https://github.com/karjonas/Read-A-Book
* "Rescue Mission": https://github.com/ConeRX/RescueMission
* "Space Pool Alpha": http://www.kweepa.org/step/ags/games/SpacePool.zip
* "The 4th Wall": https://github.com/hewills/the4thwall
* "Three Little Pigs Remediation": https://github.com/KostisMon/Three-Little-Pigies--Remediation
* "Wilfred 2088": https://github.com/hewills/Wilfred-2088
* "WOO" (a base building sim purely run by AI), made in v2.72: https://www.mediafire.com/file/juwgcjolmdd/Woo_project_1_2_4_272.zip/file


Also for the record:
Spoiler
#240
Recently I was digging through archives and found my first attempt to make a "real" game in AGS, somewhere in 2007-2008. All what is left is a bunch of half-finished cutscenes and this video I made to show it to some friends :)
http://www.mediafire.com/download/cuuyjjfkdphx1wd/Thomas.avi (2 mb)
SMF spam blocked by CleanTalk