Author Topic: AGS 3.4.1 - RC 3 (new release candidate)  (Read 42430 times)

Dave Gilbert

  • Mittens Vassal
  • Hi. Our names are FRIGGING ADORABLE.
    • Lifetime Achievement Award Winner
    • Dave Gilbert worked on a game that won an AGS Award!
    •  
    • Dave Gilbert worked on a game that was nominated for an AGS Award!
Re: AGS 3.4.1 - Beta 5 -- new unstable version
« Reply #80 on: 22 Jun 2017, 12:11 »
Hah. Awesome. Getting closer at least!

Seriously. Thank you for this. Sorry this is such a tricky problem!

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.4.1 - Beta 5 -- new unstable version
« Reply #81 on: 22 Jun 2017, 12:44 »
I brought this on myself.

AGD2

Re: AGS 3.4.1 - Beta 5 -- new unstable version
« Reply #82 on: 22 Jun 2017, 14:55 »
Another thing I noticed is that pressing the Tilde (~) key to bring up the console results in a blank white console with no text in it. This happens for all three graphics drivers (D3D. OpenGL, and software).

Also, in addition to ogg vorbis speech audio files not playing, .ogv theora movie files aren't playing either when I run the compiled game from my Compiled/Windows directory. Strangely enough theora movies do play if I hit F5 to test the game from the editor. But ogg vorbis speech files don't play on either occassion.

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.4.1 - Beta 5 -- new unstable version
« Reply #83 on: 22 Jun 2017, 19:14 »
The problem with tinting is that there is no precise formula of what AGS is using in the code.
Software renderer uses Allegro blenders for tinting, but part of their implementation is written in ASM, which I do not know too well.
Direct3D uses shaders, but we only have them in compiled form (machine code). Perhaps if Chris Jones added original shader program text, but I am not seeing it anywhere in repositories.
I only know for certain that they work with HSV color instead of RGB. But for everything else I have to make guesses.

This is my current result so far:

Top is Direct3D, bottom is OpenGL.

At first I was changing only Hue part, and thought I got it right, you may see that in Roger's head and arms. But his white/grey body requires Saturation shift too (I guess), but most direct approach did not work well yet. It looks like there is a color "overflow" somewhere, but can't find mistake atm.

For the reference, this is my shader program:

Code: C++
  1. #version 130
  2. out vec4 gl_FragColor;
  3. uniform sampler2D textID;
  4. uniform vec3 tintHSV;       // this is HSV of a tint color (converted from RGB)
  5. uniform vec3 tintAmnTrsLum; // this is tint's Amount, custom Translucence and tint's Luminocity (last two are not used yet)
  6.  
  7. // Two functions which convert between HSV and RGB, I copied them from some tutorial
  8. vec3 rgb2hsv(vec3 c)
  9. {
  10.         vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);
  11.         vec4 p = mix(vec4(c.bg, K.wz), vec4(c.gb, K.xy), step(c.b, c.g));
  12.         vec4 q = mix(vec4(p.xyw, c.r), vec4(c.r, p.yzx), step(p.x, c.r));
  13.         float d = q.x - min(q.w, q.y);
  14.         float e = 1.0e-10;
  15.         return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x);
  16. }
  17.  
  18. vec3 hsv2rgb(vec3 c)
  19. {
  20.         vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);
  21.         vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);
  22.         return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);
  23. }
  24.  
  25. // Main process
  26. void main()
  27. {
  28.         vec2 coords = gl_TexCoord[0].xy;
  29.         vec4 src_col = texture2D(textID, coords); // this is the original sprite color
  30.         vec3 src_hsv = rgb2hsv(src_col.xyz); // we convert original sprite color to HSV
  31.  
  32.         // Here we change Hue, and I **think** that this part is correct;
  33.         // although maybe not very optimized with the if/else
  34.         if (abs(tintHSV.x - src_hsv.x) > 0.5)
  35.                 src_hsv.x = fract(src_hsv.x + (tintHSV.x + 1.0 - src_hsv.x) * tintAmnTrsLum.x);
  36.         else
  37.                 src_hsv.x = abs(fract(src_hsv.x + (tintHSV.x - src_hsv.x) * tintAmnTrsLum.x));
  38.         // Here I tried to change Saturation same way, but it did not work well yet
  39.         src_hsv.y = src_hsv.y + (tintHSV.y - src_hsv.y) * tintAmnTrsLum.x;
  40.  
  41.         // Final color is a combination of the transformed color and original Alpha (because we must keep same sprite's shape)
  42.         vec3 new_col = hsv2rgb(vec3(src_hsv.x, src_hsv.y, src_hsv.z));
  43.         gl_FragColor = vec4(new_col, src_col.w);
  44. }
  45.  
« Last Edit: 22 Jun 2017, 19:27 by Crimson Wizard »

Scorpiorus

  • 100101101010b
Re: AGS 3.4.1 - Beta 5 -- new unstable version
« Reply #84 on: 22 Jun 2017, 19:30 »
I've just found two shader source files in the repository that seem related to tinting.
Or is there any additional source code that's missing?

https://github.com/adventuregamestudio/ags/blob/master/Engine/resource/tintshader.fx
https://github.com/adventuregamestudio/ags/blob/master/Engine/resource/tintshaderLegacy.fx

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.4.1 - Beta 5 -- new unstable version
« Reply #85 on: 22 Jun 2017, 19:32 »
I've just found two shader source files in the repository that seem related to tinting.
Or is there any additional source code that's missing?

https://github.com/adventuregamestudio/ags/blob/master/Engine/resource/tintshader.fx
https://github.com/adventuregamestudio/ags/blob/master/Engine/resource/tintshaderLegacy.fx

Oh crud, that's it. I mistook them for "fxo", which is compiled format.
I'll take a look, thank you!

Argh, if I'd just notice them in time that would save me couple of days...
« Last Edit: 22 Jun 2017, 19:34 by Crimson Wizard »

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.4.1 - Beta 5 -- new unstable version
« Reply #86 on: 22 Jun 2017, 20:54 »
Ok, thanks goodness, this seem be working now:





EDIT: Build download:
http://www.mediafire.com/file/ovoayko4qfe7p2m/acwin-3.4.1--opengl--tinting.zip

I will make a proper new release after fixing few more bugs.
« Last Edit: 22 Jun 2017, 21:04 by Crimson Wizard »

Scorpiorus

  • 100101101010b
Re: AGS 3.4.1 - Beta 5 -- new unstable version
« Reply #87 on: 22 Jun 2017, 21:21 »
Awesome!
And great work with implementing and polishing the OpenGL graphics renderer!
I sense it may well become a primary renderer, seeing as people are starting to have issues with using the 9th version of Direct3D API on the recent versions of MS Windows, somewhat similar to how it was with DirectDraw in the past.

Dave Gilbert

  • Mittens Vassal
  • Hi. Our names are FRIGGING ADORABLE.
    • Lifetime Achievement Award Winner
    • Dave Gilbert worked on a game that won an AGS Award!
    •  
    • Dave Gilbert worked on a game that was nominated for an AGS Award!
Re: AGS 3.4.1 - Beta 5 -- new unstable version
« Reply #88 on: 22 Jun 2017, 21:25 »
Just tested tinting and it works perfectly in OpenGL!

Tinted dark!


Tinted purple!


Tinted yellow!


Many thanks. :)

Dave Gilbert

  • Mittens Vassal
  • Hi. Our names are FRIGGING ADORABLE.
    • Lifetime Achievement Award Winner
    • Dave Gilbert worked on a game that won an AGS Award!
    •  
    • Dave Gilbert worked on a game that was nominated for an AGS Award!
Re: AGS 3.4.1 - Beta 5 -- new unstable version
« Reply #89 on: 23 Jun 2017, 22:12 »
So I just got some new music and the issue I reported before has definitely resurfaced. Newly imported music will NOT play unless I select "rebuilt all files" first. This definitely didn't happen before.

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.4.1 - Beta 5 -- new unstable version
« Reply #90 on: 24 Jun 2017, 23:19 »
Build with OpenGL supporting both tinting and light levels: http://www.mediafire.com/file/0cseqkeom9jtsva/acwin-3.4.1--opengl--tinting2.zip

That was scary to find out that those were not implemented, but OpenGL covers most of drawing now. There is still one function that does not work in OpenGL, which is supposed to clear black screen. I think that may be an issue only when ShakeScreen is used.

Now I will be addressing other bugs reported above.
« Last Edit: 24 Jun 2017, 23:21 by Crimson Wizard »

Dave Gilbert

  • Mittens Vassal
  • Hi. Our names are FRIGGING ADORABLE.
    • Lifetime Achievement Award Winner
    • Dave Gilbert worked on a game that won an AGS Award!
    •  
    • Dave Gilbert worked on a game that was nominated for an AGS Award!
Re: AGS 3.4.1 - Beta 5 -- new unstable version
« Reply #91 on: 25 Jun 2017, 00:04 »
Hm. I use shakescreen quite often in Unavowed, and I haven't seen any problems.

Thanks again for your hard work!

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.4.1 - Beta 5 -- new unstable version
« Reply #92 on: 25 Jun 2017, 00:23 »
Hm. I use shakescreen quite often in Unavowed, and I haven't seen any problems.

I think someone reported this in yours bugs thread couple of days ago, that there are black lines remaining on screen after shaking, or something like that.

Anyway, I think you need to have black borders to see a difference (run fullscreen without stretching game to max somehow, for example).

EDIT: Hmm, actually, disregard that. OpenGL does viewport clipping, so nothing from the game could be drawn over black borders.
« Last Edit: 25 Jun 2017, 00:32 by Crimson Wizard »

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.4.1 - Beta 5 -- new unstable version
« Reply #93 on: 25 Jun 2017, 05:01 »
Also, in addition to ogg vorbis speech audio files not playing, .ogv theora movie files aren't playing either when I run the compiled game from my Compiled/Windows directory. Strangely enough theora movies do play if I hit F5 to test the game from the editor.

This is the same problem as we had with FLIC videos after upgrade of Allegro library. It cannot read the video file if it is embedded in EXE. Temporary workaround is to place the file near game's exe.


EDIT: this build should have OGV fixed, hopefully -
http://www.mediafire.com/file/h6pfs813w7sc57t/acwin-3.4.1--theora-fixed.zip
« Last Edit: 25 Jun 2017, 06:28 by Crimson Wizard »

AGD2

Re: AGS 3.4.1 - Beta 5 -- new unstable version
« Reply #94 on: 25 Jun 2017, 10:48 »
Yes, I can confirm that the latest acwin.exe fixes the issue with Theora videos not playing. Thanks!

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.4.1 - Beta 5 -- new unstable version
« Reply #95 on: 27 Jun 2017, 12:31 »
Does it make sense to save windowed/fullscreen mode to config if it was changed in game? I have certain doubts of whether that will be convenient. One case is if there is an in-game menu where you can change it, but another is when user toggles it using key combination. Currently there is no way to distinguish these.

Why do people toggle mode at all?
« Last Edit: 27 Jun 2017, 13:57 by Crimson Wizard »

monkey0506

  • SEND PIZZA.
    • Best Innovation Award Winner 2017, for his work to help AGS games reach the widest possible audience - through popular distribution platforms (Steam, Galaxy) as well as other operating systems (Android, Linux)
Re: AGS 3.4.1 - Beta 5 -- new unstable version
« Reply #96 on: 27 Jun 2017, 13:47 »
I may toggle a game to a window from fullscreen if I want quick/easy access to my music player, Facebook, or something else which is distracting me from my distractions. I may wish to switch back to fullscreen for a more immersive experience though.

Personally, I don't think it should be persisted across save games, if that's what you're asking, but it does make sense to save that setting to the configuration file.

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.4.1 - Beta 5 -- new unstable version
« Reply #97 on: 27 Jun 2017, 13:57 »
Personally, I don't think it should be persisted across save games, if that's what you're asking, but it does make sense to save that setting to the configuration file.

No, I mean configuration of course!

monkey0506

  • SEND PIZZA.
    • Best Innovation Award Winner 2017, for his work to help AGS games reach the widest possible audience - through popular distribution platforms (Steam, Galaxy) as well as other operating systems (Android, Linux)
Re: AGS 3.4.1 - Beta 5 -- new unstable version
« Reply #98 on: 27 Jun 2017, 14:43 »
I figured that's what you meant, but just clarifying. :)

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.4.1 - Beta 6 -- new unstable version
« Reply #99 on: 27 Jun 2017, 16:20 »
AGS 3.4.1 Beta 6
http://www.adventuregamestudio.co.uk/releases/betas/AGS-3.4.1-Beta6/AGS-3.4.1-beta-6.zip
(also updated first post)

Changes since Beta 5:

Editor:
 - 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.

Script:
 - Fixed few cases of possible compiler crashing when there is an unfinished statement in the end of the script (by Gurok).
 
Script API:
 - 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:
 - Made Tint and LightLevel work with OpenGL. NOTE: you need OpenGL 3.0 or higher support for these to work (you probably have it if your system's last update is not older than year 2008).
 - Fixed OpenGL had one extra row and column of black pixels displayed if "RenderAtScreenResolution" is disabled. (this was a recurring problem, that hopefully fixed for good)
 - Engine now tries to get voice files from the Speech folder first, and speech.vox later, when quick-run from the Editor.
 - Engine saves last Windowed and RenderAtScreenResolution mode states to user config file.
 - Fixed voice-over cannot be found if it is MP3 or OGG type.
 - Fixed audio clip could not be found in some cases if its bundled in audio.vox and game is quick-run from the Editor.
 - Fixed Theora OGV videos not playing if compiled into game EXE.
 - Fixed plugin API's function BlitSpriteTranslucent for software driver (by Scorpiorus).
 - Fixed in-game mouse cursor was restricted to the left-top corner of the screen during execution of game_start() script function.


Known issues still:

- In Direct3D mode, if RenderAtScreenResolution is OFF, the game misses one rightmost column and bottom row of pixels (since it is still stretched to proper rectangle, this might also cause minor image distortion). I know approximately where this bug is coming from, but could not yet find a correct way to fix it.
« Last Edit: 27 Jun 2017, 16:31 by Crimson Wizard »