Show Posts

You can view here all posts made by this member. Note that you can only see posts made in areas to which you currently have access.


Topics - Crimson Wizard

Pages: [1] 2 3 ... 10
1
Following package contains latest prebuilt libraries:
https://www.dropbox.com/s/4p6nw6waqwat6co/ags-prebuilt-libs.zip?dl=0

- for the Windows engine 3.4.1 (built with VS2008)
- for the Windows engine of master branch (built with VS2015).
- for the Editor of master branch (.NET 4.0 compatible third-party assemblies that need to be copied to References folder)


We probably may find a better place to host these later.

2
Site & Forum Reports / AGS Error reports
« on: 28 May 2017, 15:48 »
Hello.

There is a "send report" feature in AGS Editor; user may press a button on error message form to send report to server.
Report is sent to: http://www.adventuregamestudio.co.uk/errorReport.php

Is this feature still works on server side, and is it possible to read sent reports? Right now this functionality seem to be completely useless, because developers cannot access these reports.

3
General Discussion / Babylon.js game framework
« on: 25 May 2017, 01:46 »
I've never programmed for Web in any way, except for some experiments with HTML and jscript (I think?) more than a decade ago, but recently a former co-worker suggested that I could learn a WebGL framework called Babylon.js to occasionally aid him with some stuff.

Babylon.js is a framework written in TypedScript (which is a kind of JavaScript extension) which works with HTML5 and WebGL. Basically it is a thing to create 3D scenes and games, presentations, etc. This framework is open source too, and 100% free (from what I saw). Their website even have a "sandbox" where you may try out some smaller scripts before making a bigger project.

I do not remember if I ever programmed in JavaScript before, which is a shame I guess; the language appeared to be easy and pleasant to use. There is a very good JS refernce provided by Mozilla, and if you know at least any C-like or other scripting language (even AGS script :) ) you should get into it in no time.
Of course one would have to learn a bit about working with 3D space first, even if you want to make 2D games there (I believe latter should be possible, although I haven't found orthogonal (2D) camera preset yet).

Compared to Unity3D, it does not provide any IDE (Editor). Although you may use some tool to work with JavaScript, like Visual Studio, or another, but that's not required (you may use just a text editor). To run your game you need just an up-to-date browser (you may even create standalone version and run offline if you download Babylon engine files from their site).
This has natural advantages and disadvantages. I think it is easier to create quick prototypes, because you do not need to install Editor and C# tools. On other hand, lack of default visual editor may make more advanced scenes harder to work with. Depends on how you do things, I guess.



Anyway, I spent few days doing tutorials and created this don't-yet-know-what-is-it prototype:
https://www.dropbox.com/s/y6fdo428ugsuass/hexmap-test.zip?dl=0

This is just an HTML file, you need to be online to run it because it references Babylon engine from their website. But all my script is right in HTML's body and may be viewed in any text editor. It's a bit mess for now, because I haven't tried to organize it properly, splitting into js files etc. It does not do much for now anyway.

Controls are:
* hold LMB and move mouse to rotate camera
* same with CTRL - move camera
& Mouse wheel - zoom in/out.
* A/S - rise and lower map tiles under cursor
* SPACE - set "marker" thingie on the tile under cursor.
* F5 - restart (obviously)

4
Engine Development / How large FLIC movies can be?
« on: 15 May 2017, 21:11 »
I've met another trouble with removing hacks from AGS to be able to update it keep every port with latest version of Allegro. I described it here: https://github.com/adventuregamestudio/ags/issues/407

In short, there is only one way that will work on all platforms for now: to load up whole FLI movie into memory and play it that way. How good is that? Depends on how large flics are. Is there any limit for them?

Alternatives are:
- patch Windows version of Allegro and let it play FLI from custom game package. But other ports will work only if FLI video is lying in game directory as external file. This effectively breaks all the existing games with FLI videos, until someone rips FLI out of package.
- find another library that plays FLI and add its as a new dependency to AGS.
- copy whole FLI player into AGS.

5
Engine Development / OpenGL renderer for Windows
« on: 10 May 2017, 23:24 »
I finally seem to make OpenGL work in any display mode under Windows:
http://www.mediafire.com/file/9gm6xt1d88xt45k/acwin-3.4.1-opengl.zip
http://www.mediafire.com/file/vh847jgpeqt6wq7/acwin-3.4.1-opengl2.zip
http://www.mediafire.com/file/5qsa7vi6d1ra27e/acwin-3.4.1-opengl3.zip


"OpenGL" should be available in drivers list in winsetup.

I believe understand making scenes in 3D better now... and also learnt that with 3D it is so much easier to do a lot of unnecessary and duplicating operations, with coordinate translations and camera positioning countering each other. Until you change something you do not notice that.


If I can find time, I may try to make it work on Linux too, because Linux port was suffering from lack of hardware-accelerated renderer all those years.

6
Engine Development / Giving away the control on project
« on: 01 May 2017, 20:50 »
So, I was not following the thread I myself started for a while, and I do not attend AGS chats (not even sure how many of them are). But from what I know from discussion on github, Alan decided to make next version of AGS stripped of legacy stuff (obsolete features, script commands, and so on).

There may be an argue on what should be considered obsolete and removed, but that's not the point of my post.
The point is that do not want to be the one who controls the project and determines its goals anymore. Putting this simply, I do not want to keep being responsible for this. Think what you want about it; but I am tired and full of doubts.

Currently, the list of repository management is as following:

Administrators (these can add/remove other people and do some highest administration tasks): JJS, me, Nick Sonneveld.
Committers (these can push changes to the code without having to make pull requests): me, Gurok, monkey0506, BigMC, tzachs.

I could add Alan to committers and let him do as he plans. I could also add anyone else, if that would be wanted.

For myself, I would like to retain release-3.4.1 branch, where I finish making AGS 3.4.1.

7
I was trying to upgrade AGS Editor project to MSVS2015, because C# contributors are very restricted with the old VS2008 projects; then I found out that VS2015 does require C++ projects to target .NET 4.0 by default.

We still have C++ component in the editor, AGS.Native.dll. I experimented a bit, trying to build it with .NET 2.0 or 3.5, but it did not work, because of conflicts between 2.0 Framework and new modern CRT libraries (or so it seems).
I found few unclear answers in the web, which hint that it may be still possible to do, but all this look pretty unguaranteed.


Sorry for all the tech details, I'll get straight to the point.

According to the web, Windows XP still support .NET 4.0 (not 4.5 though), but only if you have Service Pack 3 installed. SP2 support was dropped by Microsoft back in early 2010-ies.

So I wonder, is there anyone who still uses XP SP2 without possibility to upgrade to SP3? What are the chances such AGS users exist?

8
Seriously, does it? It will soon be FIVE years as I work on it, and haven't yet reach much of the goals we set up when we started. It is still old tech, still mostly software drawing, still no unicode support, and so on and so on.
And project is practically dead. with nearly zero organization, no planning, and no one willing to contribute.

Am I using my time for good purpose, or just wasting it? The efficiency of my work here is incredibly low. People are leaving for other better engines all the time.

For example, there is this Adventure Creator for Unity. I think it was made by people who once worked on AGS games:



It already has much much more than AGS.

And what I do seem to be simply stupid.

Yes, maybe I can try to force some more stuff in AGS, but what's the point? I will never be able to do anything even closely as good.


I think, the only reason why I am still here was that always felt the urge to prove that I can do something good. Since I was failing to reach the defined goals, it kept backfiring. In the end, I feel like I gained nothing from this work, except for endless frustration and despair.

I need to find some other work to put my efforts to, where I would be more productive.

9
Adventure Related Talk & Chat / New demo game for AGS?
« on: 12 Apr 2017, 15:18 »
This was brought to attention in the past year that current Demo Game, which is distributed with AGS, is very much outdated, incomplete, not much suitable as demo due its complexity, and also, frankly, not the best quality (like, graphics). I keep adding it to the installer following tradition, but seriously, do many people actually play it, or use it as an example for their first game?

With the good quality games being released regularly, and many members of the forum participating in competitions of various kinds, would anyone like to make a new demo game for AGS? or suggest an existing ones? (It obviously must be open-source game)

On the other hand, maybe we should just stop including demo game with AGS? I would actually like to stop using DemoGame regardless, because of the reasons I mentioned above. I fear it rather puzzles than helps.

For those that like an idea of creating a new game, I believe it should possess following qualities:

1) It should be suitable for showcasing, thus:
  • Not too short/primitive, but not too long; players should be able to complete it in one go;
  • No hard puzzles, this game is for show, not puzzling players;
  • Good visuals and audio, does not matter if low-res though;
  • Should include most notable features of AGS and adventure game;

2) It should be suitable to refer to as "good practice", thus:
  • Well-written script;
  • Using up-to-date script API (no obsolete commands);
  • Thoroughly documented: comments in code, optionally a document with further explanation.

10
AGS 3.4.1 - Beta 7 released
Current release number: 3.4.1.7




ACHTUNG!
This is a BETA version of AGS 3.4.1.
Please back up any games before opening them in this version of AGS.
If you save your project, your game will NOT be able to open in previous versions.


Released: 21th August 2017

Previous stable version: AGS 3.4.0 forum thread


This release is brought to you by:

- Alan v. Drake
- ChamberOfFear
- Crimson Wizard
- Gurok
- monkey0506
- Ryan O'Connor (one bug fix contribution)
- Scorpiorus (improvements to plugin drawing system)


This version is almost feature-frozen, but it may still take some time to polish and add a minor thing or two. Any kind of major addition will have to go into future version(s).

What is new in 3.4.1

Common features:
 - Upgraded Windows version of AGS with Allegro v4.4 library (previously v4.2).
 - Implemented "RenderAtScreenResolution" game setting. When enabled, characters and objects are scaled in screen pixels rather than game pixels. (NOTE: it was always enabled for Direct3D in the past, but now you can set it to your liking)
 - Implemented VerticalOffset and LineSpacing properties for fonts.
 - Removed limit on Dialog Topics (was 500 topics per game).
 - Removed length limit on the names of Inventory, GUI and GUI Controls.
 - Removed length limit on the names of Hotspots and Objects.
 - Removed length limit on event handler names.

Editor:
 - Removed legacy game compiler.
 - Raw compiled game data is now saved in "Compiled\Data" folder, as opposed to just "Compiled".
 - The speech.vox file is now not recompiled if game is quick-run (using F5). Engine is supposed to find newer files in the Speech folder.
 - Editor can now import games older than 2.72, and newer too (3.*) if you have extracted data files from compiled executable.
 - ScriptAPIVersion and ScriptCompatibilityLevel settings now have "Highest" option, which is meant for automatically enabling newest script API when upgrading old project in a newer editor.
 - Added new "Default Setup" pane, which works similarily to "General Settings" and lets you configure default values for game setup.
 - Added "Font Height (pixels)" readonly property to the Font's pane, which works for both WFN and TTF fonts and may be used as a reference.
 - Made Editor correctly detect modern versions of MS Windows for display on About dialog and when sending anonymous statistics.
 - New application icon to comply with 3.4.0 splash screen.
 - Fixed #ifver and #ifnver not working properly if version number had only one component (major version).
 - Few improvements to the game compilation made in hope to reduce occasional data corruption.

Script:
 - Fixed local variables not working in the switch's case expressions.
 - Fixed Strings in switch, making them compare by value again.
 - Fixed compiler mistakes caused by the use of objects of empty type (that is - struct without any variables in it).
 - Fixed few cases of possible compiler crashing when there is an unfinished statement in the end of the script.

Script API:
 - A new parameter StopMovementStyle is added to following functions: LockView, LockViewAligned, LockViewFrame, LockViewOffset, UnlockView. This parameter can be eStopMoving (default) or eKeepMoving.
 - DynamicSprite.CreateFromFile and SaveToFile now support path tokens and comply to the new file path rules (no writing files to the game's installation directory).
 - Added missing readonly properties to get Lighting/Tinting parameters for Character and Object: HasExplicitLight, HasExplicitTint, LightLevel, TintBlue, TintGreen, TintRed, TintSaturation, TintLuminance.
 - Added Mouse.SelectPreviousMode() and Mouse.IsModeEnabled(CursorMode) functions.
 - Added readonly properties to get Button's animation state: Button.Animating, Button.Frame, Button.Loop, Button.View.
 - Added GetFontHeight(FontType) and GetFontLineSpacing(FontType) functions.
 - Added setter for System.Windowed property, letting to change it at runtime, switching between windowed and fullscreen modes.
 - Added System.RenderAtScreenResolution property to change sprite rendering mode at runtime.

Engine:
 - Added OpenGL renderer to Windows version.
 - Added support for switching between fullscreen and windowed modes at runtime using Alt+Enter key combination.
 - All supported hardware-accelerated graphic drivers (Direct3D and OpenGL) now run every game in 32-bit display mode by default, and convert game's graphics on load if that is required. This fixes loss of green hue precision in 16-bit games and allows to run 8-bit games, although latter is only partially supported: there are color mismatches and dynamic palette cycling is not working.
 - Partial support for plugins drawing on screen for hardware-accelerated renderers (Direct3D, OpenGL).
 - Added support for global configuration file, which works as configuration for all games and overrides default game's config file. Individual game user's config overrides global one in its turn. Global config's location is platform-dependent.
 - Implemented separate config option for game's shared data path, to keep it distinct from user-defined saves path.
 - Engine saves last Windowed and RenderAtScreenResolution mode states to the user config file.
 - Engine no longer writes and reads gamma level in saves, meaning that gamma keeps its current value when restoring a saved game.
 - Removed arbitrary limit on number of sprites rendered at the same time for hardware-accelerated renderers (Direct3D and OpenGL) (was 75), and another limit imposed on drawing entries for all drivers (was 200).
 - Engine now tries to get voice files from the Speech folder first, if one exists, and speech.vox later when quick-run from the Editor.
 - Fixed Speech.VoiceMode not returning correct values when speech.vox is not enabled/present.
 - Fixed AdjustVolumeWithScaling character's property not working with the new audio system.
 - Fixed volume drop was not applied to audio clips which begin playing during speech voice-over.
 - Fixed Game.SetAudioTypeSpeechVolumeDrop did not affect currently playing clips until next voice-over begins.
 - Fixed Game.TranslationFilename returning "default" instead of empty string if no translation is set.
 - Fixed engine was trying to locate "My Documents" folder on Windows Vista and higher even though it did not need it, and reporting internal error if such folder was not found, even though "Saved Games" folder is used instead.
 - Added missing stubs for agsjoy plugin.

WinSetup:
 - Fixed display mode selection was missing certain items.




KNOWN ISSUES, TODOs and other notes (to be updated)

- Need to update Manual.
- Need to test that mobile ports work with this version.
- When using Direct3D, game misses 1 bottom row and 1 rightmost column of pixels of game image when "Render sprites at screen resolution" is OFF. This also might cause slight image distortion.
- When running game in OpenGL fullscreen system cursor is visible when over black borders.

11
Editor Development / AudioClip ID
« on: 29 Mar 2017, 22:44 »
It's a pity that the audio clips in the renewed audio system couldn't be referenced by numbers without complicated methods, so IMO the current AGS versions are broken and thus I refuse to use the recent versions.

First of all, since AGS 3.4.0 there is Game.AudioClips array where you can access audio clips by numeric index. You can even modify that index in project by reordering items by dragging them around. The caveat there is that clips do not have explicit ID (other than script name), so it is never displayed anywhere, but in theory it may be added similarily how characters etc display theirs (although characters and other items cannot have their ids altered, so there will be a confusing discrepancy).

Regarding the rest, I disagree with two things.

I do not agree that the method to index audio clips are complicated, it is just about creating an array of AudioClip references in script. This way you could even have same audio clip in two or more lists to choose from with different algorithms if wanted. There are script modules for making playlists with random shuffle and stuff. Of course, all this comes at the cost of extra scripting.
But that's one thing.


I always had a disagreement with having a global numeric resource ID for such purposes. In my opinion this comes from a misconception between order of resources in the project, which should not be user's bother at all, and order of resources in use list(s). Respectively, at one hand there is a unique ID of a resource in game (which can even be string), and an ID of a resource's order in list. One belongs to resource - and used as a unique reference, another belongs to the list - and used to set up certain algorithm.

The only real issue IMO is that currently you have to write these lists in script instead of using some quicker GUI method.


Since sprites, audio clips, and other game items (I think all or most of them) may already be arranged in subfolders, including reordering in subfolder (although that does not always lead to changing their existing ID, or maybe even never), the potential method could be to allow to reference them by the order in the subfolder. In other words - treating such subfolder as an ordered list.

What that would require -
1) Make sure that the order in subfolder is strictly maintained as the game project is saved and loaded. (I think it already does, but double check is needed)
2) Display the zero-based index of an item in subfolder (?)
3) Save subfolders into game in some way.
4) Design syntax for referencing such subfolders in script.

That's generally my opinion, and how I would approach this if I were to work on this.

But that's also is a "quick solution", using only the existing entities. Because for more universal approach, I would rather suggest separate list of resources (just a big stash) and "use lists" (strictly ordered in some arbitrary way), and make able to drag resource items (which are unique) into the use lists (which contain copyable references).

12
AGS 3.4.0 - Patch 4 released
Current release number: 3.4.0.16








Released: 28th March 2017

Previous stable version: AGS 3.3.5 forum thread


A minute of attention for those who are new for 3.4.0 version:
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 older projects to latest 3.4.0 (read under spoiler):
Add spoiler tag for Hidden:
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.


KNOWN ISSUES:
- Strings do not work with switch/case script commands as intended. They were supposed to be compared by value, but are instead compared as pointers.
- Local variables do not work as switch's "case" expression.
This worked in some early BETA versions, but was broken at some point. We plan to fix this in the future updates.



Changes in the Patch 4:

Editor:
- Improved Font preview, now it displays all 256 supported characters and resizes itself to accomodate these on the grid properly.
- Fixed game compilation on systems which have Japanese ANSI or similar locale as default locale for non-Unicode applications.
- Fixed Linux binaries were not copied to the Compiled folder if AGS Editor is installed to "C:/Program Files" and run in a non-administrator mode.
 
Engine:
- Fixed toggling mouse lock in window with Ctrl+Alt did not work all the time.



Changes in the Patch 3:

Common bug fixes:
- Fixed program crash in Engine and Editor when loading/importing a game that contains file with name longer than 50 characters.

Editor bug fixes:
- Do not copy hidden and system files into final directories when building the game.



Changes in the Patch 2:

Script API:
- Extended the list of System.OperatingSystem possible return values; now supports eOSAndroid, eOSiOS, eOSPSP

Editor bug fixes:
- Fixed incorrect Unicode-to-ANSI string conversion during game compilation which caused text containing non-latin characters become random mess in game, even if game fonts complied to the proper ANSI codepage.

Engine bug fixes:
- Fixed mouse cursor stuck at the left border of the screen when using OpenGL renderer (Android & iOS ports).
- Fixed InventoryScreen() script function caused game to crash if particular resources are not available.
- Fixed built-in inventory screen not working with Direct3D and OpenGL renderers.
- Fixed obsolete gfxfilter names are printed when using --help argument.

Cosmetics & convenience:
- Corrected error message displayed when engine cannot get write access to the disk (e.g. no more telling to not run from CD on Android).
 
Manual:
- Added information on static extenders.



Changes in the Patch 1:

Editor:
- Fixed #if(n)ver preprocessor directive failed to properly compare versions if the current and required versions have different number of digits.

Engine:
- Returned support for some older config options related to graphics mode, so that the engine would be able to use old config files.
- Fixed graphics mode initialization failure in certain less common setup cases, such as when requested window size was larger than current desktop resolution, or when the final mode appeared smaller than the precalculated one.
- Fixed couple of memory leaks occuring when saved game is restored.
- Fixed rare crash when restoring a game while having unreleased DrawingSurface pointers.
- Fixed compilation in C++11 mode.

WinSetup:
- Fixed "native game resolution" mode choice was not properly restored when loading config file.



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:
Add spoiler tag for Hidden:
It was found that dynamic arrays in struct do not work when you make an array of those struct, for example:
Code: Adventure Game Studio
  1. struct MyStruct
  2. {
  3.     int dynamic_array[];
  4. };
  5.  
  6. MyStruct single_object; // <--- this will work
  7. MyStruct arr_of_structs[10]; // <--- this won't work
  8.  
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.
- 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!




13
We were reported this problem:
http://www.adventuregamestudio.co.uk/forums/index.php?issue=813.0

In short, whenever the user compiles the project, following error reported by AGS:
Quote
Unexpected error: The output byte buffer is too small to contain the encoded data, encoding 'Japanese (Shift-JIS)' fallback 'System.Text.InternalEncoderBestFitFallb ack'.
Parameter name: bytes
This error comes from .NET Framework during the compilation and printed on the output pane. Unfortunately such messages do not contain full call stack, so I cannot tell which operation failed exactly.

I was not able to reproduce this. I tried installing Japanese IME locale and compiling several projects, both existing ones and newly created.

Have anyone ever seen an error like that?

14
AGS Engine & Editor Releases / AGS 3.4.0 - Patch 3
« on: 25 Feb 2017, 16:41 »
AGS 3.4.0 - Patch 3 released
Current release number: 3.4.0.15







Released: 25th February 2017

Previous stable version: AGS 3.3.5 forum thread


A minute of attention for those who are new for 3.4.0 version:
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 older projects to latest 3.4.0 (read under spoiler):
Add spoiler tag for Hidden:
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.


KNOWN ISSUES:
- Strings do not work with switch/case script commands as intended. They were supposed to be compared by value, but are instead compared as pointers. This worked in some early BETA versions, but was broken at some point. This hopefully will be fixed in one of the future updates.


Changes in the Patch 3:

Common bug fixes:
- Fixed program crash in Engine and Editor when loading/importing a game that contains file with name longer than 50 characters.

Editor bug fixes:
- Do not copy hidden and system files into final directories when building the game.



Changes in the Patch 2:

Script API:
- Extended the list of System.OperatingSystem possible return values; now supports eOSAndroid, eOSiOS, eOSPSP

Editor bug fixes:
- Fixed incorrect Unicode-to-ANSI string conversion during game compilation which caused text containing non-latin characters become random mess in game, even if game fonts complied to the proper ANSI codepage.

Engine bug fixes:
- Fixed mouse cursor stuck at the left border of the screen when using OpenGL renderer (Android & iOS ports).
- Fixed InventoryScreen() script function caused game to crash if particular resources are not available.
- Fixed built-in inventory screen not working with Direct3D and OpenGL renderers.
- Fixed obsolete gfxfilter names are printed when using --help argument.

Cosmetics & convenience:
- Corrected error message displayed when engine cannot get write access to the disk (e.g. no more telling to not run from CD on Android).
 
Manual:
- Added information on static extenders.


Changes in the Patch 1:

Editor:
- Fixed #if(n)ver preprocessor directive failed to properly compare versions if the current and required versions have different number of digits.

Engine:
- Returned support for some older config options related to graphics mode, so that the engine would be able to use old config files.
- Fixed graphics mode initialization failure in certain less common setup cases, such as when requested window size was larger than current desktop resolution, or when the final mode appeared smaller than the precalculated one.
- Fixed couple of memory leaks occuring when saved game is restored.
- Fixed rare crash when restoring a game while having unreleased DrawingSurface pointers.
- Fixed compilation in C++11 mode.

WinSetup:
- Fixed "native game resolution" mode choice was not properly restored when loading config file.



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:
Add spoiler tag for Hidden:
It was found that dynamic arrays in struct do not work when you make an array of those struct, for example:
Code: Adventure Game Studio
  1. struct MyStruct
  2. {
  3.     int dynamic_array[];
  4. };
  5.  
  6. MyStruct single_object; // <--- this will work
  7. MyStruct arr_of_structs[10]; // <--- this won't work
  8.  
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.
- 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!




15
I believe this is brought on forums every now and then, this is the earliest thread I found that gives a working solution, so I'd mention this for a reference here:
http://www.adventuregamestudio.co.uk/forums/index.php?topic=35731.0

So, what is this all about. Imagine you want to create an Overlay having very particular width, precisely to let your text fit in. What do you do?
Basic example:
Code: Adventure Game Studio
  1. function MakeOverlay(String s, int x, int y, FontType font, int color, int wait)
  2. {
  3.     int width = GetTextWidth(s, font);
  4.     Overlay *o = Overlay.CreateTextual(x, y, width, font, color, s);
  5.     Wait(wait);
  6. }
  7.  

That looks correct, right? Well, it should be. However, when you run the game, you find out that your text is split into more lines than you expected. Try calling this example with a short line, like "Welcome!". You may end up having "Welco" on one line and "me!" on another (depends on font).

Why the heck does it happen?

This is because when you call GetTextWidth - a correct width of text is calculated, however when AGS splits line for drawing (on overlay, on label, Display function, Say function, DrawStringWrapped function, etc), it does additional and undocumented changes to the width parameter:

1) First of all, it decreases width by (2 * padding) pixels, where padding is a specific value which depends on the type of GUI used for display (like TextWindow).
If no GUI is used for Display function (by default), then padding = 3.
Some functions do not do this, like DrawStringWrapped, because it is drawn raw on a DrawingSurface. But even then, there is another thing:

2) When calculating how many characters fit into single line, AGS does a small mistake in condition:
Code: C++
  1. // otherwise, see if we are too wide
  2. else if (wgettextwidth_compensate(theline, fonnt) >= wii) {
  3.  
Notice '>=' sign. It means that even if the text fits into the width precisely, it will still will be split at that point, resulting in at least 2 lines where 1 would be enough.

In other words, to work around this issue, you script should look like:
Code: Adventure Game Studio
  1. function MakeOverlay(String s, int x, int y, FontType font, int color, int wait)
  2. {
  3.     int width = GetTextWidth(s, font);
  4.     width = width + 2*3 + 1; // 2*3 is double default padding, and 1 pixel is to counter wrong condition
  5.     Overlay *o = Overlay.CreateTextual(x, y, width, font, color, s);
  6.     Wait(wait);
  7. }
  8.  


I think something must be done here. I am not yet sure what. There is no problem in modifying calculations, because we know how to detect old games and process them differently to keep backwards compatibility. Fixing the condition in line-split function is easy, but I am not sure how to deal with the padding.


EDIT
What I mean about padding. We certainly cannot remove it out of equation, because then the text will be drawn over TextWindow borders, and such. But then there should be two things:
1) Firstly, it should be clearly documented that overlay's and display window's "width" - that is not just text width, but text width + padding.
2) Secondly, user must have means to get that padding somehow, to use it when arranging stuff on screen.


PS
While I am at this, there is another known issue that you should use "width + 1" in the call to GetTextHeight. Probably because of same line splitting mistake.

16
I was making a small test game in 3.2.1 and then also running it in 3.4.0, and I noticed something very strange. I was playing a short sound clip very often, so often that it usually started to play again  (on a separate channel) when the previous playback was still playing.

In 3.2.1 the sounds played perfectly, but in 3.4.0 it was "jagged", there were jumps and cut-offs.

When I lowered the frequency with which the sound is restarted, they seem to work same way in both versions.

Have anyone noticed same differences? When did this start to happen?

17
Modules & Plugins / MODULE: TypedText 0.7.0
« on: 12 Feb 2017, 22:53 »
DOWNLOAD TypedText 0.7.0 (beta version) MODULE PACK
Archive contains modules: TypedText, TypedTextHelper and TypedTextDrawing.
DOWNLOAD Demo Game

Latest source code may be found here
Git cloning address: https://ivan-mogilko@bitbucket.org/ivan-mogilko/ags-script-modules.git
Demo Game git cloning address: https://ivan-mogilko@bitbucket.org/ivan-mogilko/ags-script-demos.git

Module supports AGS 3.2.1 and higher


Introduction

TypedText module provides means for displaying continiously typed text, also known as typewriter style display. Letter appears by letter with certain delay in between.

A while ago I was scripting a typing text animation for a game project; later I found out that there is already Phemar's Typewriter module, but it did not allow the kind of behavior that the project required, so I continued with my own script.
Now I found some free time to rewrite that script in a cleaner way and make an actual script module of it. But I also copied few things from Phemar's module, to make TypedText suitable for the needs of people who used Phemar's module before.

The general peculiarity of this module, and also what makes it different from existing one, is that it is based on a Type (struct), and objects of that type, instead of a Function. This leads to following effects:
1. You can have multiple typed text animations simultaneously.
2. Since objects keep their states in them, you may have both blocking and non-blocking typed texts.
3. Having an object with exposed interface (public functions and properties) make it possible to alter its behavior on fly, as well as override it, and use it to create your own custom typewriters.


Using an object may be more complicated than using a single function, and require time to study it, so I added TypedTextHelper module with number of "helper" functions to make it easier to start using TypedText in your project. Also those functions may be just what you need if standart behavior is enough. This is why I will explain their use before going into detail about TypedText itself.

But first I need to quickly clarify on some concepts.


TypedText concepts

TypedText simulates continious text typing, letter by letter. When doing so it passes several states:

Inactive - this is when it has no text set whatsoever.
Typing text - this is when it is in process of typing text.
Waiting for reader - this is when all text was fully typed and displayed on screen, but settings demand TypedText to wait a little longer to give human an opportunity to finish reading the text.
Idling - this is when typing and waiting is complete, and TypedText is not going to do anything else.

NOTE: Helper functions, such as those that display TypedText on Overlays, rely on "waiting for reader" state to know when typed text should be removed from screen.

TypedText has a concept of the flashing caret. Depending on setup, it may flash last typed letter, or draw certain symbol behind typed text (like '_', for example).
The caret, if enabled, commences to flash whenever delay between two typed letters is greater than caret's waiting timer. This timer resets when next letter is typed. This also means that when all  the text was already typed, caret will then flash endlessly (so long as TypedText is on screen).

Keeping the above in mind, TypedText relies on following parameters:

Typing delay - how many game ticks to wait after each typed letter.
Typing delay style - this concept is copied from Phemar's module, and defines delay behavior for spaces and caret-returns in the text (are they same, slower than usual or faster than usual),
Caret depiction - is the caret is depicted anyway, and how: this may be flashing last letter, or specific string drawn in the end, or even a sprite - for the advanced TypedText implementations.
Caret flash times - how long caret stays on screen and stays hidden when it flashes.
Text reading time - how much time, in game ticks, is spent on reading 1 letter: this parameter is used to calculate average reading time of a text.

Finally, extended variants of TypedText also support sound that is played whenever next letter was typed.


Using TypedTextHelper

TypedTextHelper module requires TypedText module to present above it in the modules list.

It provides a number of functions to run typed text blocking or non-blocking, in a number of ways: on a Button, on a Label, or on an Overlay.

Because TypedText has a significant number of parameters, many of which are supposed to stay same for the most of the time in game, I thought it would be very inconvenient to put all of those parameters into functions. Instead, TypedTextHelper has a special preset system.
This works pretty simple actually: you setup least changing properties as a preset under certain ID, and then use that preset ID when starting typed text on Label, or Overlay; this makes all of that preset's parameters to be used for that instance of text typing.

Following are preset functions you may use:

Code: Adventure Game Studio
  1. /// Set general parameters for the specified preset
  2. TypewriterPreset.SetGeneral(int preset, int delay_min, int delay_max, TypedDelayStyle style, int read_time = 12);
  3. /// Set caret parameters for the specified preset
  4. TypewriterPreset.SetCaret(int preset, int flash_on_time, int flash_off_time, TypedCaretStyle style, String caret_str, int caret_sprite = 0);
  5. /// Set sound parameters for the specified preset
  6. TypewriterPreset.SetSounds(int preset, AudioClip *type_sound, AudioClip *caret_sound, AudioClip *end_sound);
  7. TypewriterPreset.SetSoundArray(int preset, AudioClip *type_sounds[], int type_sound_count,
  8.                                  AudioClip *caret_sound, AudioClip *end_sound);
  9.  

Maximal number of presets is determined with TYPEDTEXTHELPER_MAXPRESETS constant in the module header. It is 8 by default, but you may increase it if you need more.
Maximal number of sounds that you may assign for preset and each typewriter is determined with TYPEDTEXTRENDER_MAXSOUNDS contant.

Best place to set preset's parameters is "game_start" function, but you may change them anytime by using same preset ID.

After you set up at least one preset, you may begin using helper functions. All of them are made as extender functions, which means you first type object (Button, Label, Character) pointer name, then call the function from it, like:

Code: Adventure Game Studio
  1. // NOTE: preset is optional, and will be 0 if you don't type anything
  2. /// Print TypedText as a text on button
  3. SomeButton.Typewriter(String text, BlockingStyle bs, int preset = 0);
  4. /// Print TypedText as a text on label
  5. SomeLabel.Typewriter(String text, BlockingStyle bs, int preset = 0);
  6.  

The only difference is Overlay static extender (static extenders is a new thing since AGS 3.4.0), where you do not use overlay's pointer, but just "Overlay" word:
Code: Adventure Game Studio
  1. // NOTE: preset is optional, and will be 0 if you don't type anything
  2. /// Print TypedText as a text on created overlay
  3. Overlay.Typewriter(int x, int y, int color, FontType font, String text, BlockingStyle bs, int preset = 0);
  4.  
If you are working in pre-3.4.0, you will have to use non-extender function for overlays, called TypewriteOnOverlay, but it works essentially same, and has same parameters (except it is not called from Overlay).


If you run these functions with eBlock, they will display typed text inside of them, and return when typing (and waiting) state has finished.
If you run them with eNoBlock, they will return back immediately, but typed text will work on a background, updated from repeatedly_execute inside the module.

You may run only one blocking typed text at the same time.
Maximal simultaneous non-blocking typed texts is determined by TYPEDTEXTHELPER_MAXTYPEWRITERS constant in the module header. It is 8 by default, but you may increase it if you need more.


Each of those helper functions return unique ID of typewriter. If you want to control that typewriter, such as detect when it stops typing, or be able to cancel it, store this ID in a variable for later. You may then use this ID with TypewriterRunners static functions and properties:

Code: Adventure Game Studio
  1. /// Get number of currently running typewriters
  2. int TypewriterRunners.ActiveCount;
  3. /// Get number of maximal supported typewriters that can run simultaneously
  4. int TypewriterRunners.MaxCount;
  5. /// Get whether given typewriter ID is currently running (use unique ID as an array index)
  6. bool TypewriterRunners.IsActive[];
  7. /// Get whether given typewriter ID is blocking (use unique ID as an array index)
  8. bool TypewriterRunners.IsBlocking[];
  9. /// Stop typewriter under given ID
  10. void Cancel(int id);
  11.  

The principal example:
Code: Adventure Game Studio
  1. int tw_id = SomeButton.Typewriter(text, eNoBlock);
  2.  
  3. <... later ...>
  4.  
  5. if (TypewriterRunners.IsActive[tw_id])
  6.   TypewriterRunners.Cancel(tw_id); // interrupt typewriter if it was still running
  7.  


Using TypedText directly

If above helper functions do not do what you like, you may create and use objects of TypedText struct, or any derived structs, directly.

TypedText struct's purpose is to calculate timing and  basic state of the text. It does not draw anything on screen on its own, but calculates and tells how the text should look like at any given moment, letting you to use that information as you see fit. In other words, it tells what is happening, but does not tell you how it should look (and sound) like.


Setting up TypedText is fairly straighforward, here are its configuration properties:
Code: Adventure Game Studio
  1. /// Base delay (in ticks) between every typing event
  2. import attribute int              TypeDelay;
  3. /// Bounds for random base delay
  4. import attribute int              TypeDelayMin;
  5. import attribute int              TypeDelayMax;
  6. import attribute TypedDelayStyle  TypeDelayStyle;
  7. /// Time (in ticks) the caret stays shown
  8. import attribute int              CaretFlashOnTime;
  9. /// Time (in ticks) the caret stays hidden
  10. import attribute int              CaretFlashOffTime;
  11. /// Time (in ticks) given to read one text character
  12. import attribute int              TextReadTime;
  13.  
  14.  
  15. /// Whitespace/caret-return delay style defines relation of special case
  16. /// delays to the base type delay.
  17. /// Idea is conforming to the Phemar's Typewriter module.
  18. enum TypedDelayStyle
  19. {
  20.   /// wait for the same amount of time as after regular letters
  21.   eTypedDelay_Uniform = 0,
  22.   /// wait twice as long after whitespaces
  23.   eTypedDelay_LongSpace,
  24.   /// wait twice as less after whitespaces
  25.   eTypedDelay_ShortSpace,
  26.   /// randomly choose a style every time
  27.   eTypedDelay_Mixed
  28. };
  29.  


And its control methods are:
Code: Adventure Game Studio
  1.  
  2. /// Gets/sets paused state
  3. import attribute bool             Paused;
  4.  
  5. /// Clears all text and resets all timers
  6. import void                       Clear();
  7. /// Sets new string, resets all timers and commences typing
  8. import void                       Start(String text);
  9. /// Skips all the remaining typing
  10. import void                       Skip();
  11.  
  12. /// Update typed text state, advancing it by single tick
  13. import void                       Tick();
  14.  


Since you are using TypedText yourself, you need to be continiously checking its state in repeating function:
Code: Adventure Game Studio
  1. /// Full string that has to be typed
  2. readonly import attribute String  FullString;
  3. /// Part of string that is supposed to be shown at current time
  4. readonly import attribute String  CurrentString;
  5. /// Part of string that was 'typed' during latest update
  6. readonly import attribute String  LastTyped;
  7.  
  8. /// Tells whether TypedText has active content to process or display
  9. readonly import attribute bool    IsActive;
  10. /// Tells whether TypedText is in process of typing text
  11. /// (return FALSE if either no text is set, or text is already fully typed)
  12. readonly import attribute bool    IsTextBeingTyped;
  13. /// Tells whether TypedText is waiting for the text to be read by player
  14. /// (return FALSE when reading timer has ran out, regardless of other states)
  15. readonly import attribute bool    IsWaitingForReader;
  16. /// Tells whether TypedText is currently idling, either not having a content,
  17. /// or after finishing all the required actions (typing & waiting for reader)
  18. readonly import attribute bool    IsIdle;
  19. /// Tells whether caret should be currently displayed
  20. readonly import attribute bool    IsCaretShown;
  21.  
  22. /// Gets if the new character was just typed
  23. readonly import attribute bool    EvtCharTyped;
  24. /// Gets if the text has just ended being typed
  25. readonly import attribute bool    EvtFinishedTyping;
  26.  


One of the simpliest examples for using TypedText is this:
Code: Adventure Game Studio
  1. // in GlobalScript.asc
  2. TypedText my_tt;
  3.  
  4. function game_start()
  5. {
  6.     // Config typed text to your liking
  7.     my_tt.TypeDelay = 4;
  8.     my_tt.CaretFlashOnTime = 4;
  9.     my_tt.CaretFlashOffTime = 4;
  10. }
  11.  
  12. // Calling TypeSay will start typed text
  13. function TypeSay(string s)
  14. {
  15.     my_tt.Start(s);
  16. }
  17.  
  18. function repeatedly_execute()
  19. {
  20.     if (my_tt.IsIdle)
  21.     {
  22.         my_tt.Clear(); // clear the text, stop timers ticking, etc
  23.     }
  24.     else if (my_tt.IsActive)
  25.     {
  26.         my_tt.Tick(); // update TT
  27.         String text_to_show = my_tt.CurrentString;
  28.         if (my_tt.IsCaretShown)
  29.             text_to_show = text_to_show.Append("_"); // append caret symbol to the end of the text
  30.         player.Saybackground(text_to_show); // print TT's current text as a player's background speech
  31.     }
  32. }
  33.  


Using TypewriterRender and its subtypes

There is a number of extended types provided by the module, which add bit more functionality. First is struct TypewriterRender, which extends TypedText, and other structs extend TypewriterRender further.

As was mentioned above, TypedText does not draw anything on its own, only calculates the text's state. TypewriterRender does not do much too, but it adds few more properties and serves rather like a base class for actual visualizing:
Code: Adventure Game Studio
  1. /// Caret display style
  2. import attribute TypedCaretStyle CaretStyle;
  3. /// A string (or single character) that represents typewriter caret
  4. import attribute String          CaretString;
  5.  
  6. /// The only sound to play when a character is typed
  7. import attribute AudioClip *     TypeSound;
  8. /// Array of sounds to choose at random when a character is typed
  9. readonly import attribute AudioClip *TypeSounds[];
  10. /// Number of typing sounds registered
  11. readonly import attribute int    TypeSoundCount;
  12. /// Sound to play when the line break is met
  13. import attribute AudioClip *     CaretSound;
  14. /// Sound to play when the typewriter finished typing text
  15. import attribute AudioClip *     EndSound;
  16.  
  17. /// Sets the array of sounds to play at random when character is typed
  18. import void                      SetRandomTypeSounds(AudioClip *sounds[], int count);
  19.  
  20.  
  21. /// Style of the caret displayed during typing
  22. enum TypedCaretStyle
  23. {
  24.   /// No caret display
  25.   eTypedCaret_None = 0,
  26.   /// Flash last character
  27.   eTypedCaret_LastChar,
  28.   /// Draw separate caret at the next assumed character location
  29.   eTypedCaret_Explicit
  30. };
  31.  


The actual workers are inheriting types: TypewriterButton, TypewriterLabel, TypewriterOverlay. They have respective properties to set up an object they will print text on (or from which perspective), as well as their own overwritten Clear, Start and Tick methods.

Using them you will avoid necessity to draw text yourself:
Code: Adventure Game Studio
  1. // in GlobalScript.asc
  2. TypewriterLabel my_tt_label;
  3.  
  4. function game_start()
  5. {
  6.     my_tt_label.TypeOnLabel = lblTypewriter; // put your actual label's name here
  7.     my_tt_label.TypeDelay = 4;
  8.     my_tt_label.CaretFlashOnTime = 4;
  9.     my_tt_label.CaretFlashOffTime = 4;
  10.     my_tt_label.CaretStyle = eTypedCaret_LastChar; // make last char flash
  11.     my_tt_label.TypeSound = aTypewriterTyping; // set sound to play
  12. }
  13.  
  14. // Calling TypeOnLabel will start typed text
  15. function TypeOnLabel(string s)
  16. {
  17.     my_tt_label.Start(s);
  18. }
  19.  
  20. function repeatedly_execute()
  21. {
  22.     if (my_tt_label.IsIdle)
  23.         my_tt_label.Clear(); // remove text when done typing & waiting for the reader
  24.     else if (my_tt_label.IsActive)
  25.         my_tt_label.Tick(); // update text
  26.     // notice that you do not need to point where to print the text anymore,
  27.     // TypewriterLabel already knows that and does printing for you
  28. }
  29.  


Using TypedTextDrawing

TypedTextDrawing is an advanced struct, extending TypewriterRender, that lets you draw typed text on DrawingSurface. This means you may have typewriter text on literally anything that can give drawing surfaces or have assigned image: room and GUI backgrounds, objects, character frames even (crazy).
Besides, TypedTextDrawing is the only one of the provided types that can draw caret as a sprite.

TypedTextDrawing is located in its own separate module (of same name) and requires TypedText module to work (but not TypedTextHelper).

Setting TypedTextDrawing up is very similar to setting other TypedText subtypes, but you also need to set up its position on DrawingSurface, text color and font, and optionally background color.

What is more important to remember, you must explicitly call Draw function, because you need to pass DrawingSurface pointer to its drawing. It cannot store DrawingSurface once for use later, because that goes against rules of using drawing surfaces (they have to be released right after every use).

Here is some example, that draws typed text on a room's backround
Code: Adventure Game Studio
  1. // in GlobalScript.asc
  2. TypedTextDrawing tt_draw;
  3. DynamicSprite *roomBkg; // will keep saved room background
  4.  
  5. function game_start()
  6. {
  7.     tt_draw.TypeDelay = 4;
  8.     tt_draw.CaretFlashOnTime = 4;
  9.     tt_draw.CaretFlashOffTime = 4;
  10.     tt_draw.CaretStyle = eTypedCaret_Explicit; // draw caret
  11.     tt_draw.CaretSprite = 1010; // put your sprite number here
  12.     tt_draw.TypeSound = aTypewriterTyping; // set sound to play
  13.    
  14.     tt_draw.X = 40;
  15.     tt_draw.Y = 40;
  16.     tt_draw.Width = Room.Width - 80;
  17.     tt_draw.Height = Room.Height - 80;
  18.     tt_draw.Font = eFontText;
  19.     tt_draw.TextAlign = eAlignCentre;
  20. }
  21.  
  22. function RestoreRoomBkg()
  23. {
  24.     // Restore original room background
  25.     DrawingSurface *ds = Room.GetDrawingSurfaceForBackground();
  26.     ds.DrawImage(0, 0, roomBkg.Graphic);
  27.     ds.Release();
  28. }
  29.  
  30. // Calling TypeOnDS will start typed text
  31. function TypeOnDS(string s)
  32. {
  33.     if (roomBkg == null)
  34.     {
  35.         roomBkg = DynamicSprite.CreateFromBackground();
  36.     }
  37.     else
  38.     {
  39.         RestoreRoomBkg();
  40.     }
  41.     tt_draw.Start(s);
  42. }
  43.  
  44. function repeatedly_execute()
  45. {
  46.     if (tt_draw.IsIdle)
  47.     {
  48.         tt_draw.Clear();
  49.         RestoreRoomBkg();
  50.     }
  51.     else if (tt_draw.IsActive)
  52.     {
  53.         tt_draw.Tick(); // update TT
  54.         DrawingSurface *ds = Room.GetDrawingSurfaceForBackground();
  55.         tt_draw.Draw(ds);
  56.         ds.Release();
  57.     }
  58. }
  59.  




Other script modules by me:
DragDrop module
KeyListener

18
Editor Development / AGS 3.4.1 - Early BETA
« on: 08 Feb 2017, 00:35 »
After 3.4.0 was released we decided that releases should be made more often, and after several months passed we should just gather what we have made and publish that as a new version.

What I am posting here is a relatively "raw" early beta version of 3.4.1. This is why I am not making this as a "proper" beta release yet, but as some kind of pre-beta, meant for public testing.
When we find and fix serious problems, I will feature-freeze it and release it more officially.
Speaking of features, they may still be added as testing goes on, but I would not count on that much. Personally I would like to focus on getting existing things to work correctly as a first priority.

Feature-wise this 3.4.1 release is going to be rather small, especially compared to the gigantic 3.4.0 list. Personally I spent most of the time refactoring the code and improving some internal functionality; if not for other contributors the list would be half as small.


Uploaded AGS 3.4.1 - Early Beta 2:

Download as ZIP archive

Mirror:
Download from Mediafire

Please, remember this is still a non-stable release, intended for tests only. Use at your own risk.


This release is brought to you by:

- Alan v. Drake
- Crimson Wizard
- Gurok
- monkey0506


What's new in 3.4.1

Common features:
- Upgraded AGS with Allegro v4.4 library (previously was Allegro v4.2). Now Windows version works with same library as all other ports (Linux etc). This is experimental at this point, so watch out for any weirdities (although hopefully there should not be any). From my knowledge, the primary effect should be fixed Alt key, but that requires testing.
- Implemented "RenderAtScreenResolution" game setting. When enabled, characters and objects are scaled in screen pixels rather than game pixels, which can make them look more hi-res than the rest of the game. In the game project this property has following values: Enabled, Disabled, User-defined. The first two lock the scaling to respective style. The last one enables a checkbox in the winsetup which lets player to adjust this setting to their liking.
  Currently this mode works only in Direct3D. OpenGL renderer (on Android and iOS) had its own setting for the long time, but at the moment it is not connected, which is something to be fixed.
- Fonts now have VerticalOffset property (per each font separately). This is a number of pixels by which any line of text should be moved either up (negative offset) or down (positive offset). This is a workaround for some TTF fonts not aligned properly when drawn on screen in game. Note that this property works for all fonts, just in case.
- Implemented LineSpacing property for the fonts. This lets you set up default spacing for every font. Value is in pixels, and determines how much the Y coordinate should increase before printing next line of text. "0" has special meaning that makes AGS use font's height for spacing (which is also backwards-compatible).
  NOTE: line-spacing is not a distance between bottom of first line and top of second, but distance between top of first line and top of second.

 
Editor:
- Removed old game compiler. Most of 3.4.0 users are now using new one anyway (probably most people do not even know what's the difference and how to switch between them), and there was only one serious bug found in the new one, which is already fixed.
- Compiled game data is now first saved to "Compiled\Data" folder (before being copied to "Compiled\Windows", "Linux" and so on), as opposed to just "Compiled". This will supposedly make folder structure cleaner. Now if you want to ship any custom files with your game, add them to "Compiled\Data" and they should be included into every version.
- Editor should now import games older than 2.72, and actually newer too (3.*), if you have extracted data files from compiled executable. This should be tested, but will work in theory. This change will make it unnecessary to import pre-2.72 projects to 2.72 before loading them up in latest editor.
- ScriptAPIVersion and ScriptCompatibilityLevel settings now have "Highest" option, which is meant for automatically enabling new script API when loading old project in a newer editor. Previous versions of AGS (before 3.4.0) did this naturally, but with introduction of those two API switches, it is possible to "lock" your project at certain API level by selecting particular variant for those properties. Usually you'd want to have both on Highest now, only changing them if you need to compile old scripts.
- Added new "Default setup" panel, which works just as "General Settings" and lets you configure default options of game setup. Currently the page is rather a dummy, with just couple of options available, but more could be added later.
- Added "Font Height (pixels)" readonly property to the Font's pane, to be used as a reference (e.g. when setting LineSpacing).

Script
- Fixed Strings in switch, making them compare by value again.
- Fixed compiler mistakes caused by the use of objects of empty type (that is - struct without any variables in it).

Script API:
- Stopping movement is now optional when (Un)LockView functions are called. A new parameter StopMovementStyle is added to following functions: LockView, LockViewAligned, LockViewFrame, LockViewOffset, UnlockView. This parameter can be eStopMoving (default) or eKeepMoving.
- Added missing readonly properties to get Lighting/Tinting parameters for Character and Object: HasExplicitLight, HasExplicitTint, LightLevel, TintBlue, TintGreen, TintRed, TintSaturation, TintLuminance.
- Added Mouse.SelectPreviousMode() and Mouse.IsModeEnabled(CursorMode) functions.
- Added readonly properties to get Button's animation state: Button.Animating, .Frame, .Loop, .View.
- GetFontHeight(FontType) and GetFontLineSpacing(FontType) script functions.


Engine:
- AGS supports switching between fullscreen and windowed modes at runtime using Alt+Enter key combination. Note: functionality may currently be buggy and requires testing & fixing.
- AGS now supports "global config", that is config for all games. This was added by request of Linux users, but also works on Windows (although currently you can only create and edit it by hand). Idea is that AGS reads 3 config files, with every next file overriding matching settings from the previous ones:
  * acsetup.cfg located in the game's folder (default config);
  * global config
  * writable per-game config
  The location of configs depends on system:
  Linux:
    >> user's global config: $XDG_DATA_HOME/ags/acsetup.cfg
    >> user's game config: $XDG_DATA_HOME/ags/GAMENAME/acsetup.cfg
  Windows:
    >> user's global config: %USERPROFILE%/Saved Games/.ags/acsetup.cfg
    >> user's game config: %USERPROFILE%/Saved Games/GAMENAME/acsetup.cfg
- Fixed Speech.VoiceMode not returning correct values when speech.vox is not enabled/present.
- Fixed AdjustVolumeWithScaling character's property not working with the new audio system (since 3.2, I guess).
( -- something unusual -- )
- AGS now won't read gamma level from the saved game, which means that if you altered gamma slider and then restored previously saved game, gamma should stay the same. The reasoning behind this is that display's gamma is exclusively a user setting rather than part of the game. There is a caveat however: if gamma is controlled by GUI slider, slider will get its position from the save game, meaning that it should be corretly scripted to update from actual gamma value upon game restoration. Of course this will make things tad more complicated for game developer, and also break existing games if they are run on a new engine, but this was a choice in dilemma between having a temporarily desynchronized gamma slider (it will sync back as soon as player touches it), and annoyed player who changed gamma and suddenly gets it back whenever restoring an older save. I am open for suggestions how to improve this, if there will be any.


19
AGS Engine & Editor Releases / AGS 3.4.0 - Patch 2
« on: 05 Feb 2017, 21:34 »
AGS 3.4.0 - Patch 2 released
Current release number: 3.4.0.14







Released: 6th February 2017

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):
Add spoiler tag for Hidden:
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.


KNOWN ISSUES:
- Strings do not work with switch/case script commands as intended. They were supposed to be compared by value, but are instead compared as pointers. This worked in some early BETA versions, but was broken at some point. This hopefully will be fixed in one of the future updates.


Changes in the Patch 2:

Script API:
- Extended the list of System.OperatingSystem possible return values; now supports eOSAndroid, eOSiOS, eOSPSP

Editor bug fixes:
- Fixed incorrect Unicode-to-ANSI string conversion during game compilation which caused text containing non-latin characters become random mess in game, even if game fonts complied to the proper ANSI codepage.

Engine bug fixes:
- Fixed mouse cursor stuck at the left border of the screen when using OpenGL renderer (Android & iOS ports).
- Fixed InventoryScreen() script function caused game to crash if particular resources are not available.
- Fixed built-in inventory screen not working with Direct3D and OpenGL renderers.
- Fixed obsolete gfxfilter names are printed when using --help argument.

Cosmetics & convenience:
- Corrected error message displayed when engine cannot get write access to the disk (e.g. no more telling to not run from CD on Android).
 
Manual:
- Added information on static extenders.


Changes in the Patch 1:

Editor:
- Fixed #if(n)ver preprocessor directive failed to properly compare versions if the current and required versions have different number of digits.

Engine:
- Returned support for some older config options related to graphics mode, so that the engine would be able to use old config files.
- Fixed graphics mode initialization failure in certain less common setup cases, such as when requested window size was larger than current desktop resolution, or when the final mode appeared smaller than the precalculated one.
- Fixed couple of memory leaks occuring when saved game is restored.
- Fixed rare crash when restoring a game while having unreleased DrawingSurface pointers.
- Fixed compilation in C++11 mode.

WinSetup:
- Fixed "native game resolution" mode choice was not properly restored when loading config file.



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:
Add spoiler tag for Hidden:
It was found that dynamic arrays in struct do not work when you make an array of those struct, for example:
Code: Adventure Game Studio
  1. struct MyStruct
  2. {
  3.     int dynamic_array[];
  4. };
  5.  
  6. MyStruct single_object; // <--- this will work
  7. MyStruct arr_of_structs[10]; // <--- this won't work
  8.  
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.
- 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!




20
Engine Development / Direct3D issues list
« on: 04 Feb 2017, 19:28 »
What are the known Direct3D renderer issues at the moment?
Fixing them is very important, because most of them are probably not related to Direct3D as a system, but to how AGS uses it. In other words, 1) they may be not that difficult to fix, 2) they may affect other hardware accelerated renderers (OpenGL, for instance, which is currently used only by mobile ports, but may be used by desktop versions in the future).
Also, I believe that game should not depend on single renderer, that is dangerous in the sense that it may make it unplayable on certain systems.

KNOWN ISSUES:

1. Imperfect sprite scaling (also known as super-sampling). FIXED in 3.4.1 by introducing sprite scaling switch
Explained here: http://www.adventuregamestudio.co.uk/forums/index.php?topic=53972.0
This is already fixed in the development version, and solution will be included to the new upcoming beta version.

2. Color distortion. FIXED in 3.4.1 by launching games in 32-bit display mode
Mentioned here: http://www.adventuregamestudio.co.uk/forums/index.php?topic=40132.msg532501#msg532501 (but screenshots are no longer available).
What is that and how can I see that (under which conditions)?

3. Supports only up to 75 sprites (character and objects) displayed at the same time.FIXED in 3.4.1
Mentioned here: http://www.adventuregamestudio.co.uk/forums/index.php?topic=51823.msg636508899#msg636508899
This is a ridiculous problem that can be fixed in no time.

4. 8-bit games do not work with Direct3D.
This is a critical problem for 8-bit games (if the software renderer cannot work on a system for some reason). Not certain how difficult, but there may be ways to make it work though.

5. IgnoreWalkbehinds property does not work properly in Direct3D mode
This is because it makes objects arranged in a non-sensical z-order on screen. I think, in theory it may be possible to make it work with a certain hack, but I'd rather won't bother unless only in the sake of supporting old games which use it to run with D3D and OpenGL.

6. Another restriction of 200 displayed sprite entries. FIXED in 3.4.1
Similarly should be very easy to remove the limit, although that is unclear if AGS games ever may have that many separate objects on screen.

7. 8-bit sprites are not converted 100% accurately (in non-8bit games), compared to software renderer.
Cause is currently unknown.

8. BlitSprite* plugin API functions do not work with hardware-accelerated renderer. FIXED in 3.4.1
Details and possible solutions:
http://www.adventuregamestudio.co.uk/forums/index.php?topic=25665.msg636554785#msg636554785



Do you know any other problems that prevent you to use Direct3D for your games?

Pages: [1] 2 3 ... 10