Jibble

Author Topic: TEMPLATE: Tumbleweed Verbs 1.1 Last update: 3rd August 2018  (Read 10431 times)

abstauber

  • Cavefish
  • Posts: 2,048
  • still mowing the lawn
    • abstauber worked on a game that won an AGS Award!
    •  
    • abstauber worked on a game that was nominated for an AGS Award!
@Babar: Sorry about the broken link, I've just fixed it.

@Monsieur OUXX: Your changes seem to make a lot of sense, but unfortunately your pull request does not compile (yet)
Quote
GlobalScript.asc(54): Error (line 54): '.AdjustLanguage' is not a public member of 'Verbs'. Are you sure you spelt it correctly (remember, capital letters are important)?

Monsieur OUXX

  • Posts: 3,553
  • Mittens Half Initiate
    • I can help with proof reading
    • I can help with translating
    • I can help with voice acting
your pull request does not compile (yet)

Weird. I made sure I never committed without compiling and testing first.
How do pull requests work? Do you see the state of the code at the time I did the pull request, or do you see the current state of the cloned respository and the branch it contains?
 

abstauber

  • Cavefish
  • Posts: 2,048
  • still mowing the lawn
    • abstauber worked on a game that won an AGS Award!
    •  
    • abstauber worked on a game that was nominated for an AGS Award!
I downloaded your last commit from Aug 18th (dedfd488392cf46dad0af3dbe2ddde97eb44c1d f) and tried it to compile it with AGS. Since then I still didn't find the time review all the changes and probably find a fix for the remaining bugs.

That also raises the question: do I need merge this borked pull request and fix the bugs in the master branch or do I have to work in your repo to make it happen?

Crimson Wizard

  • Posts: 8,794
    • 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!
That also raises the question: do I need merge this borked pull request and fix the bugs in the master branch or do I have to work in your repo to make it happen?

Sorry for barging in the discussion; technically both ways are viable, usually this is rather an organizational question.
Also, a while ago Github has allowed such feature as letting the owner of target repository to add commits directly to pull request branch, if the PR creator has ticked this option. Personally I cannot tell if it's the case not having necessary permissions there.

BTW this reminds me, Monsieur OUXX, have you noticed my comment to your pull request?
https://github.com/dkrey/ags_tumbleweed/pull/1#issuecomment-411395083

abstauber

  • Cavefish
  • Posts: 2,048
  • still mowing the lawn
    • abstauber worked on a game that won an AGS Award!
    •  
    • abstauber worked on a game that was nominated for an AGS Award!
Quote
Sorry for barging in the discussion
I was actually hoping you would do that :D
Thanks for the clarification, I guess I just need to wait until Mathieu replies. Maybe in the meantime I find time to do a full code review, since this pull request is quite a biggie.
In any case the #error command will find its way into the template (nod)

Monsieur OUXX

  • Posts: 3,553
  • Mittens Half Initiate
    • I can help with proof reading
    • I can help with translating
    • I can help with voice acting
Sorry guys I had a crazy month (I think the other people in my game project have probably hired bounty hunters to get me by now). I'll check out my code and the state of the pull, as well as CW's comment asap.
 

abstauber

  • Cavefish
  • Posts: 2,048
  • still mowing the lawn
    • abstauber worked on a game that won an AGS Award!
    •  
    • abstauber worked on a game that was nominated for an AGS Award!
Quote
I'll check out my code and the state of the pull, as well as CW's comment asap.
(wtf)

Hehe, no worries. I was able to find some time fixing your bugs and to merge your changes. Thanks for the tedious work of refactoring all this stuff (nod)

Anyone dares to test this right from the repo as well?
« Last Edit: 06 Nov 2018, 16:13 by abstauber »

abstauber

  • Cavefish
  • Posts: 2,048
  • still mowing the lawn
    • abstauber worked on a game that won an AGS Award!
    •  
    • abstauber worked on a game that was nominated for an AGS Award!
Here's the new beta, compiled as a template for your convenience :)
I've been testing it for a bit now, but I couldn't find anything odd yet. But since so much has changed code wise, it would be great if anyone else could have a look.

Changes (mostly by Monsieur Ouxx)
- cleaned up the global script (moved the remaining GUI actions to the options menu module)
- Localisation of the GUI elements is handled a bit different internally
- It's possible to change the GUIs being used by the template
- Some more refactoring, the template throws errors if a module is missing.

Here it is:
http://shatten.sonores.de/wp-content/uploads/2018/11/tumbleweed_12_beta.zip

Monsieur OUXX

  • Posts: 3,553
  • Mittens Half Initiate
    • I can help with proof reading
    • I can help with translating
    • I can help with voice acting
So I'm not forgetting that I need to review the pull request, but in the meantime I'm having a weird issue. thanks to Khris it's been narrowed down to AGS apparently not being very good at having a sprite with alpha AND a transparency > 0 used as a GUI background.

I'm trying to set the custom dialogs GUI background to a black background with a slight transparency. Everything below failed :

- I tried with a fully black image (no alpha) and eDialogGui_bg_img_transparency set to 20, the background does not appear at all.
- I tried with a sprite imported from a PNG containing an all-black image with alpha (the black is 20% transparent) and  and eDialogGui_bg_img_transparency set to 0, now it's the font outline that goes cuckoo.
- I tried with the same semi-transparent PNG sprite and eDialogGui_bg_img_transparency set to -1. Now it's the transparency rendering that's all over the place (some pixels become fully transparent while some others are fully opaque).

What is the proper way?
 

Snarky

  • Global Moderator
  • Posts: 6,750
  • Private Insultant
    • I can help with proof reading
    • I can help with translating
There is no proper way. There's a bug in AGS: rendering is broken for GUIs with alpha-transparent backgrounds and content (including text) with alpha-transparency.

The workaround is to use two GUIs; one for the background and one on top (with the background set to COLOR_TRANSPARENT) for the content.

abstauber

  • Cavefish
  • Posts: 2,048
  • still mowing the lawn
    • abstauber worked on a game that won an AGS Award!
    •  
    • abstauber worked on a game that was nominated for an AGS Award!
Maybe I don't get it, but if it's about a GUI background with different alpha levels... that works and it's already implemented in the template.
Code: Adventure Game Studio
  1.   // Background
  2.   // set bg_img_transparency to -1 if you're using 32-bit graphics and
  3.   // want to preserve the alpha channel  
  4.   CustomDialogGui.DialogGuiOptions[eDialogGui_bg_img]                = 122;
  5.   CustomDialogGui.DialogGuiOptions[eDialogGui_bg_img_scaling]        = 0;
  6.   CustomDialogGui.DialogGuiOptions[eDialogGui_bg_img_transparency]   = -1;
  7.   CustomDialogGui.DialogGuiOptions[eDialogGui_bg_color]              = 0;
  8.  

When you work with an alpha transparent PNG, you actually don't want AGS to interfere with it, you do it all in the image file.

Quote
- I tried with a sprite imported from a PNG containing an all-black image with alpha (the black is 20% transparent) and  and eDialogGui_bg_img_transparency set to 0, now it's the font outline that goes cuckoo
Just set eDialogGui_bg_img_transparency to -1 and you should be fine.

Crimson Wizard

  • Posts: 8,794
    • 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!
There is no proper way. There's a bug in AGS: rendering is broken for GUIs with alpha-transparent backgrounds and content (including text) with alpha-transparency.

This was supposed to be fixed long ago! If it's still not working please do bug report, otherwise I won't know about it.

abstauber

  • Cavefish
  • Posts: 2,048
  • still mowing the lawn
    • abstauber worked on a game that won an AGS Award!
    •  
    • abstauber worked on a game that was nominated for an AGS Award!
There is no proper way. There's a bug in AGS: rendering is broken for GUIs with alpha-transparent backgrounds and content (including text) with alpha-transparency.

This was supposed to be fixed long ago! If it's still not working please do bug report, otherwise I won't know about it.

Here's proof that it works  8-) The frame is 100% opaque, the background is semi transparent, the scroll arrows render correctly as does the font outline.


Monsieur OUXX

  • Posts: 3,553
  • Mittens Half Initiate
    • I can help with proof reading
    • I can help with translating
    • I can help with voice acting

  CustomDialogGui.DialogGuiOptions[eDialogGui_bg_img_transparency]   = -1;

OK. I don't know what I'm doing wrong. When importing the PNG, should I say "yes" to "use alpha?" and should I select "leave transparency as-is"?
 

abstauber

  • Cavefish
  • Posts: 2,048
  • still mowing the lawn
    • abstauber worked on a game that won an AGS Award!
    •  
    • abstauber worked on a game that was nominated for an AGS Award!

  CustomDialogGui.DialogGuiOptions[eDialogGui_bg_img_transparency]   = -1;

OK. I don't know what I'm doing wrong. When importing the PNG, should I say "yes" to "use alpha?" and should I select "leave transparency as-is"?

Yep.
Also make sure to check the option "GUI alpha rendering style" in the general settings. It has to be set to Proper Alpha Blending".

Here's the source image from the template, if you import this one, you can be sure that it works.


https://raw.githubusercontent.com/dkrey/ags_tumbleweed/master/assets/gui/dialog_background.png

tzachs

  • Posts: 1,246
  • Parking Goat- games that goats like!
    • I can help with translating
    • tzachs worked on a game that was nominated for an AGS Award!
Maybe you're using an older version of AGS (from before the fix)?

Monsieur OUXX

  • Posts: 3,553
  • Mittens Half Initiate
    • I can help with proof reading
    • I can help with translating
    • I can help with voice acting
PROBLEM SOLVED.

From the start I was focusing on "GUI alpha rendering style", but it was actually "Sprite alpha rendering style" that caused the issue.
I'm not sure if it was because of the background sprite I was using OR if it was because of the font I'm using, that contains semi-transparent pixels, causing the outline to go crazy when the blending failed (unfortunately it went so crazy that I failed to visually identify it as only the outline)

Anyways now that everything is set to "proper alpha blending", everything seems to work as expected.

Thanks!!!
This is the thing that took me the most time on the short game I'm making :D *sigh of relief*