Author Topic: AGS 3.5.0 - alpha 12 - next WIP version  (Read 27338 times)

Crimson Wizard

  • Local Moderator
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Lifetime Achievement Award Winner
    • Crimson Wizard worked on a game that won an AGS Award!
    •  
    • Crimson Wizard worked on a game that was nominated for an AGS Award!
Re: AGS 3.5.0 - alpha 11 - next WIP version
« Reply #240 on: 23 Feb 2019, 12:27 »
Ok so soon here's another small update, but it has critical bug fixes from AGS 3.4.3 patch 1, and also an important ammendments to new Room Viewport & Camera API.

AGS 3.5.0 - Alpha 11


Zip archive: http://www.mediafire.com/file/l6rtpsjq94fo5m1/AGS-3.5.0-alpha11.zip/file


Changes since 3.5.0 alpha 10:

- Have merged critical bug fixes from AGS 3.4.3 Patch 1

Editor:
 - Fixed few mistakes when converting interaction scripts from very old games (regression)

Script API
- Moved new room camera and viewport API into API version v3.5.0.7 (was v3.5.0).
- All functions that find room objects under screen coordinates are now being clipped by the viewport (fail if there's no room viewport at these coordinates).
  This refers to: GetLocationName, GetLocationType, IsInteractionAvailable, Room.ProcessClick, GetWalkableAreaAt and all of the GetAtScreenXY functions (and corresponding deprecated functions).
- Added Character.GetAtRoomXY, Hotspot.GetAtRoomXY, Object.GetAtRoomXY, Region.GetAtScreenXY, replaced GetWalkableAreaAt with GetWalkableAreaAtScreen and added GetWalkableAreaAtRoom.

Please take a notice: if this new behavior breaks your game, either switch to using GetAtRoomXY functions, or switch down to Script API Level v3.5.0 in General Settings.



KNOWN ISSUES:

- Reported by Snarky: need to find out which components need to be added to use AGS 3.5.0 on fresh Windows installation.
- Some weird sprite scaling bug in the room editor described in the posts above. According to user reports it may be fixed by restarting the editor. Unfortunately I was still unable to reproduce it on my own...
And of course the ones noted at github issue tracker: https://github.com/adventuregamestudio/ags/issues?q=is%3Aissue+is%3Aopen+label%3Abug


EDIT: I had to reupload the package because of the small but serious bug. Download link is the same.
« Last Edit: 23 Feb 2019, 13:41 by Crimson Wizard »

Monsieur OUXX

  • Mittens Half Initiate
    • I can help with proof reading
    • I can help with translating
    • I can help with voice acting
Re: AGS 3.5.0 - alpha 11 - next WIP version1
« Reply #241 on: 27 Feb 2019, 16:28 »
I'm worried by the clipping behaviour but I don't know if it's justified or not.
 

Crimson Wizard

  • Local Moderator
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Lifetime Achievement Award Winner
    • Crimson Wizard worked on a game that won an AGS Award!
    •  
    • Crimson Wizard worked on a game that was nominated for an AGS Award!
Re: AGS 3.5.0 - alpha 11 - next WIP version1
« Reply #242 on: 27 Feb 2019, 18:51 »
I'm worried by the clipping behaviour but I don't know if it's justified or not.

I was planning to post detailed explanation but did not find time yet.
This change may complicate certain actions a little bit, but also makes interaction between screen and room more logical (especially now when you may have custom viewport and camera sizes, room camera scaling, and maybe even rotation in the future).

IMHO there are following common situations where you would like to find an object using some coordinates.

1) You are processing player's input and need to find an object or location under or near mouse coordinates. In this case only what you see on screen (or rather inside room viewport) is important, and clipping won't bother you (it will even help you if your viewport is smaller than the game screen).

2) You want to find an object or location that may be located anywhere in the room, even outside the visible area, using screen coordinates (dummy example: you want to find nearest object and move them to the mouse coordinates).
This is where new ScreenToRoom function comes to use. Such function would be useful even in old AGS, but the coordinates conversion was very simple then (adding or subtracting result of GetViewportX/Y) so we did not have it built-in.
It works like this:
Code: Adventure Game Studio
  1. Object *FindNearestObject(int mousex, int mousey)
  2. {
  3.     Point *roompt = Screen.ScreenToRoomPoint(mousex, mousey);
  4.     Object *obj = null;
  5.     for (int i = 0; i < MAX_OBJECTS; i++)
  6.     {
  7.         // continue searching using room coordinates roompt.x and roompt.y
  8.     }
  9.     return obj;
  10. }
  11.  

In an extreme case, if you want to use screen coordinates that are (or may be) outside of the visible screen, you may explicitly "pass" the point through the main viewport:
Code: Adventure Game Studio
  1. Viewport *viewport = Screen.Viewport;
  2. Point *roompt = viewport.ScreenToRoomPoint(-1000, -1000, false); // "false" here means "no clipping"
  3. // this will find room coordinates that are at (-1000,-1000) screen coords if seen through main viewport
  4.  

3) You want to find some object or location relative to another object or location (like player character). This is where all the new GetAtRoomXY functions come useful (and that's the reason they were added).
For example:
Code: Adventure Game Studio
  1. Hotspot *h = Hotspot.GetAtRoomXY(player.x - 20, player.y); // check if there's a hotspot 20 pixels away from player
  2. int walk = GetWalkableAreaAtRoom((player.x, player.y); // find walkable area under player's feet
  3.  


If you find any case that is not covered please report and we'll fix it.
« Last Edit: 27 Feb 2019, 19:27 by Crimson Wizard »

Monsieur OUXX

  • Mittens Half Initiate
    • I can help with proof reading
    • I can help with translating
    • I can help with voice acting
Re: AGS 3.5.0 - alpha 11 - next WIP version1
« Reply #243 on: 28 Feb 2019, 08:01 »
Thanks! I didn't see that there was a "clipping=false" extra parameter in order to disable it. So it's perfect.

I was worried that people would have to rack their brains to tell the difference between a return value that means "there's nothing there in the room at the coordinates you asked -- outside of the viewport" and a return value that means "you asked for coordinates outside of the viewport but I'm teling you that there's nothing there at the force-clipped coordinates at the boundary of the viewport" -- thus causing human mistakes.

All is well.
 

Crimson Wizard

  • Local Moderator
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Lifetime Achievement Award Winner
    • Crimson Wizard worked on a game that won an AGS Award!
    •  
    • Crimson Wizard worked on a game that was nominated for an AGS Award!
Re: AGS 3.5.0 - alpha 11 - next WIP version1
« Reply #244 on: 28 Feb 2019, 11:41 »
I was worried that people would have to rack their brains to tell the difference between a return value that means "there's nothing there in the room at the coordinates you asked -- outside of the viewport" and a return value that means "you asked for coordinates outside of the viewport but I'm teling you that there's nothing there at the force-clipped coordinates at the boundary of the viewport" -- thus causing human mistakes.

If you need to distinguish "no viewport"/"no room object" you may first do "Viewport.GetAtScreenXY()" and that will return Viewport* or null.

I want to underline that unless you are explicitly changing room viewport you normally should not be bothered about all this, since by default viewport is covering whole screen, as before. So you need to solve additional issues either if you have custom viewport (then you should be prepared), or if you want to use screen coordinates outside of the visible screen area for some reason (which is not a common thing to do).

And yes, games compiled with older script API (or in older AGS) will work as before.

Ghost

  • AGS Baker
  • Here, I light candles.
    • Ghost worked on a game that won an AGS Award!
    •  
    • Ghost worked on a game that was nominated for an AGS Award!
Re: AGS 3.5.0 - alpha 11 - next WIP version1
« Reply #245 on: 01 Mar 2019, 09:59 »
Just to let you know, AGS has never been this sexy. And this comes from a man who refused to go beyond "the last CJ build" for a decade. Good stuff there, especially the camera functionality should be fun to play around with!

Crimson Wizard

  • Local Moderator
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Lifetime Achievement Award Winner
    • Crimson Wizard worked on a game that won an AGS Award!
    •  
    • Crimson Wizard worked on a game that was nominated for an AGS Award!
Re: AGS 3.5.0 - alpha 12 - next WIP version1
« Reply #246 on: 20 Mar 2019, 21:39 »
I think we are approaching beta stage, but it's not just there yet, some planned cruicial functionality has still not been added. Maybe soon...

AGS 3.5.0 - Alpha 12

WARNING: some things were changed in room format again. Please make a full backup of your project before upgrading to this version and report if you notice anything wrong with how your rooms are saved and loaded in the editor and run within the game.


Zip archive: http://www.mediafire.com/file/316cf1e4z4z24de/AGS-3.5.0-alpha12.zip/file


Changes since 3.5.0 alpha 11:

Common features:
 - Deprecated relative assets resolutions: now sprites, rooms and fonts are considered to match game's resolution by default and not resized, unless running in backwards-compatibility mode.

Editor:
 - Added "Allow relative asset resolutions" option to "Backwards Compatibility" section. Disabled by default, it makes game treat all sprites and rooms resolution as real one.
 - Sprites have "Real" resolution type by default. "Low" and "High resolution" are kept for backwards compatibility only. When importing older games resolution type will be promoted to "Real" whenever it matches the game.
 - Added MaskResolution property to Rooms. It ranges from 1:1 to 1:4 and lets you define the precision of Hotspot, Regions and Walkable Areas relative to room background.
   Warning: if you change this to lower precision (e.g. from 1:1 to 1:2) your mask may loose some pixels!
 - Added "Default room mask resolution" to General Settings, which value will be applied to any room opened for editing in this game for the first time.
 - Removed "Fonts designed for high resolution" option from General Settings. Instead added individual SizeMultiplier property to Fonts.
   NOTE: this is mostly useful for bitmap fonts. When using TTF you better just reimport them with higher point size.
 - Fixed property pane displaying properties for room object when the character editor is active - if you changed character's StartingRoom outside of room editor.
 - Fixed script compiler could leave extra padding inside the compiled scripts filled with random garbage if script strings contained escaped sequences like "\n" (this was not good for source control).
 - Fixed crash when editor was updating file version in compiled EXE but failed and tried to report about that.

Script API
 - Added Screen.RoomToScreenPoint, which returns the point on screen corresponding to the given room coordinates relative to the main viewport.
 - Added SkipCutscene() and eSkipScriptOnly cutscene mode. This lets you skip cutscene by your own script rather than using automatic conditions.
 - Deprecated DrawingSurface.UseHighResCoordinates. Also, assigning it will be ignored if game's "Allow relative asset resolutions" option is disabled.

Engine:
 - Improved performance of hardware-accelerated renderers by not preparing a stage bitmap for plugins unless any plugin hooked for the particular drawing events.
 - Reimplemented FRead and FWrite plugin API functions, should now work in 64-bit mode too.
 - Completely removed old and unsupported record/replay functionality.
 - Fixed potential bug which could cause DoOnceOnly tokens to be read incorrectly from a savedgame.
 - Fixed DynamicSprite.SaveToFile() not appending ".bmp" if no extension was specified.
 - Fixed IsMusicVoxAvailable() not working correctly in old games which use 'music.vox'.
 - Added Scavenger's palgorithms plugin to the list of builtins, for ports that use ones.


KNOWN ISSUES:

- Reported by Snarky: need to find out which components need to be added to use AGS 3.5.0 on fresh Windows installation.
- Some weird sprite scaling bug in the room editor described in the posts above. According to user reports it may be fixed by restarting the editor. Unfortunately I was still unable to reproduce it on my own...
And of course the ones noted at github issue tracker: https://github.com/adventuregamestudio/ags/issues?q=is%3Aissue+is%3Aopen+label%3Abug





Just to let you know, AGS has never been this sexy. And this comes from a man who refused to go beyond "the last CJ build" for a decade. Good stuff there, especially the camera functionality should be fun to play around with!

I think it is safe to tell now, I believe we are one step away from implementing multiple cameras, which may already be trivial except for defining where character speech should appear on screen, and maybe some other quirks which I could miss. This is not 100%, but I will definitely try to add this if time constraints won't prevent me.

Meanwhile, a small teaser of hard-coded cameras in a old test version :):
Spoiler: ShowHide
« Last Edit: 20 Mar 2019, 22:04 by Crimson Wizard »