Author Topic: Rendering of dialog. Under or above GUIs?  (Read 1127 times)

Monsieur OUXX

  • Mittens Half Initiate
    • I can help with proof reading
    • I can help with translating
    • I can help with voice acting
Rendering of dialog. Under or above GUIs?
« on: 20 Apr 2015, 09:51 »
I've always found it odd that character speech was rendered on top of GUIs. I suspect this choice was made randomly along the years -- Like, the function "RenderDialog" being written just below "RenderGUIs" (fictional function names!) in the C++ code, by cheer chance, by CJ one night while he was drowning his sorrow in whiskey on a rocking chair under the full moon.

- How hard would it be to swap them?
- Would that make sense? I think it would. Dialogs are part of the "inner" game while GUIs are out of it. They are meta, if I may say so.


 

Gurok

  • Rottwheelers
  • When life hands you lemons, combine them with the mop
    • I can help with AGS tutoring
    • Best Innovation Award Winner 2016, for improving and extending the AGS scripting language
    • I can help with proof reading
    • I can help with scripting
    • Gurok worked on a game that won an AGS Award!
    •  
    • Gurok worked on a game that was nominated for an AGS Award!
Re: Rendering of dialog. Under or above GUIs?
« Reply #1 on: 20 Apr 2015, 10:45 »
Okay, #1 problem, it's not all one process right now. Character speech is rendered on top of GUIs, but character portraits are rendered beneath them. This is because while the _displayspeech function renders portraits, it merely sets up the text overlays involved.

I don't think it's a matter of swapping them. I think it would involve some restructuring, but speech should be able to take a z-index just like GUIs can. By extension, this means speech should become one big overlay and overlays should be able to take z-indices just like GUIs can. The compositing functions for GUIs and overlays would need to be merged.

I'm not saying I'm prepared to do it, but if I did, it would be a major rework. The speech code in particular is just a mess of conditions that should really be broken up and reorganised (if only to eliminate confusing variables in the function).

It would also be possible for the engine to have a global setting that tells it to render out the speech inside the _displayspeech function (similar to how the portrait is currently blitted there). We might also have an alternate setting that forces the creation of an overlay for the portrait instead of blitting it in the speech function. That seems hacky though and far less flexible than z-indices.

Your reasoning makes sense, but people use AGS to do strange things. Recently, I wanted to use a GUI to "fade out" the screen underneath and then draw speech over the top. That's a situation where the reverse order makes more sense.

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: Rendering of dialog. Under or above GUIs?
« Reply #2 on: 20 Apr 2015, 11:07 »
Yes, I believe, configurable screen layers is a way to go. This way we could have dialog overlay between two GUI layers, if we would like.
But, indeed, its a matter of significantly reworking program design.

UPD. Perhaps, there might be a switch as a temporary solution. But I can't tell for certain if it is easy to add, without some research first.
« Last Edit: 20 Apr 2015, 11:16 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: Rendering of dialog. Under or above GUIs?
« Reply #3 on: 20 Apr 2015, 12:55 »
Oh yes please, a switch ;)