AGS Draconian Edition 3.4.11 r10 (December 31, 2017)

Started by Alan v.Drake, Mon 26/09/2011 01:24:41

Previous topic - Next topic

sonneveld

#81
Oh I meant for the draconian edition.
edit: found it! https://github.com/AlanDrake/Adventure-Game-Studio

subspark

QuoteOh I meant for the draconian edition.
Of course. How silly of me. Sorry mate.

sonneveld

Quote from: subspark on Sun 29/04/2012 09:54:54
QuoteOh I meant for the draconian edition.
Of course. How silly of me. Sorry mate.
Heh, it's all good. No worries.

Icey

Why not make a GUI with only the Inv window on it. Then place it the location of the other inv window that's given you the problem.

subspark

QuoteWhy not make a GUI with only the Inv window on it. Then place it the location of the other inv window that's given you the problem.
Because it's not the inv windows that is giving me the problem. It's the way AGS is rendering the inventory item's sprites. It's not able to render the alpha correctly or at all and this has always been a hindrance to us.
Does anyone have an example of obviously alpha blended inv items (drop shadow perhaps) displaying correctly within the Inventory GUIControl rectangle?

Thanks for everybody's help so far. :smiley:

monkey0506


subspark

Monkey, if you see this, jump back on Messenger.
I believe you may be able to help us in a private troubleshoot. ;-D

I will post back results as we make them and will detail a final resolution (if any) to this likely specific issue of ours.

Thanks again, kind peeps.

DoorKnobHandle

I tested the inv item with alpha channel problem in a new 32-bit game.

When you use an image without alpha channel as gui background, put an inv window control on there and put an inv item with alpha channel in that, it doesn't work at all. The alpha channel of the inv item is ignored.

As you guys have pointed out, when you put an image with alpha channel as gui background, it does work - well, kinda.

This is what I'm getting:



The semi-transparent black circle loos right only in the middle, we have some ugly artifacts around the edges...

Any further ideas? Anything we're doing wrong?

subspark

Indeed, what is happening is the alpha of the inventory item is cutting through the GUI background graphic. Alpha or not, the background graphic is suffering from a 2-bit cookie cutter essentially.
This occurs both on the one GUI (with inventory) and two separate ones (inventory isolated).

I've tested all the visibility modes under both scenarios and nothing will preserve that alpha from eating through the background.
I assume by design most might have been lucky not to have noticed this problem? In our case, our GUI is made to toggle on and off in order to reveal the black lower half of the screen during action/cut scenes.

I suppose can say with great confidence now that this is indeed a rendering issue alone or in combination with something erroneous we're doing here on our end. How to correct the problem is my greater concern.
Might I succeed in encouraging somebody with engine-level experience to take a deeper look? Alan, Calin, JJS or Sonneveld... I'm looking at you! :-*

Eric

I believe I had this same problem here. Khris suggested a way to make it work, but I was never able to do so.

If you guys come up with a solution, let me know! The workaround I eventually used is ham-fisted and not as aesthetically pleasing.

monkey0506

Do this.

- Create a new GUI.
- Set its background color to 0.
- Set its border color to 0.
- Set its background graphic to a COMPLETELY TRANSPARENT sprite WITH ALPHA CHANNEL.
- Add an InvWindow control.
- ???
- Profit.

subspark

You're not wrong, Monkey. After much fiddling we eventually did this as a workaround.  We didn't need any new bitmaps to do so either. However, this being a fundamental flaw in the natural functioning of the engine, we thought it had been problematic enough to bring to the front of the table.
Reaching this workaround was cryptic enough to catch us scratching our heads. Some may have been more perceptive. Our GUI works as originally desired now and for those struggling with the same headache, our solution is detailed below.

Because AGS does not currently draw alpha correctly over a bitmap in the same GUI, any graphics must be isolated into a separate GUI like so:


Our gAction gui is frequently toggled on and off depending of gameplay events. In order to bind the visibility of gActionBackdrop to gAction so that they are both toggled together we use just one line of code:


Code: ags
gActionBackdrop.Visible = gAction.Visible;




Note: This code goes in repeatedly_execute either in the global script or, in our case, higher up the execution chain in its own script.

Then as if by magic, to the end-user it works essentially the same way.

Monsieur OUXX

#93
Hey subspark I'm working on a little addition to your branch. Being a complete git newbie I failed to check-out the project using git, so I just downloaded it as an archive to run my tests. When the time to check in comes, I'll try to make it not too painful ;)
 

monkey0506

Not saying it doesn't need to be/warrant a fix, just that the impression being given was that it was impossible to accomplish. AGS isn't perfect, sure, but there's very little that you actually can't do with it. ;)

Calin Leafshade

From my experimentation in my AGS days of yore I think i found that this is basically AGS trying to save memory. AGS will create a surface with the lowest possible bit depth to accommodate its internal needs. That is to say that if the background isnt 32bit, then the surface wont be either thus not allowing the correct blending.

subspark

Quotethe impression being given was that it was impossible
Impressions aren't given. They're received. :P But I do get your point Monkey. As impossible as it seemed to us, I'm actually just simply glad that we finally discovereed the root of the anomoly.

In retrospect, it really is a minor problem that was always there in peripheral vision like a small splinter in the eyeball white. 8-0

Alan v.Drake

So... you guys spent all this time coming up with workarounds instead of fixing the source yourselves ?  (roll)

- Alan

subspark

Don't look at me good sir. I can't even cook up alphabet soup!!

Alan v.Drake

Ok guys, if you make me a pretty dropdown menu with the available system resolutions on the setup, I will make them work. Deal ?

- Alan

SMF spam blocked by CleanTalk