Text Visibility Advice - Hard to read over detailed backgrounds

Started by Bavolis, Fri 01/12/2017 03:46:21

Previous topic - Next topic

Bavolis

Yes I'm still posting in beginner because I still consider myself a duct-tape and staples dev when it comes to anything more complex than the basics.

The problem:

I go nuts with tiny details in my backgrounds which makes the text extremely hard to read in some cases. Because my spoken language is gibberish, text comprehension is critical. Changing font and color is not doing it for me because some rooms will contrast well, but others still cause problems. I love the old Lucas style of text above the head and I have set up speech animations on the actual characters instead of the portrait style. I'm wondering if anybody has run into this problem before and how they solved it. My perfect world solution would be having the code always render a 50% transparent black box beneath the text that would shape itself to always fit the shape of the dialog.

I'm considering trying a font with a black block background, but I can see that causing a lot of weird problems in the long run.

Any ideas? Talk to me like I'm a zoo chimp when it comes to coding. :)

Khris

This is possible; for instance there's a speech bubble module available on a french AGS forum.
The downside is that one can no longer use built-in speech, which means dialog scripts like
Code: ags
roger: blah
npc: blah

have to be turned into
Code: ags
 cRoger.S("blah");
 cNpc.S("blah");


Here's the custom speech function used by that:
Code: ags
function S(this Character*, String message) {
  // TODO: implement semi-transparent background
  this.Say(message); // call actual AGS function for now
}


This function can now do arbitrary things to display the text.

Bavolis

Thanks for the quick suggestions! I'm going to look into these. :)

So Phylactere (the french word balloon one) is *almost* perfect. It does exactly what I want display-wise and the game looks much more professional. In fact, I want to go back and rework the game to use this and ship with it. However, I've got one tricky stumbling block - it doesn't recognize the following format:

cOsirus.Say("&13 This line has an audio linked to it");

The &13 displays in the actual line rather than reading it as an audio file. Browsing/translating that French thread, they seem to have come up with a solution, but it's not working for me. One of the scripters suggested adding a specific code (posted below this paragraph) into the Phylactere definition and it seems to remove the &13 from the display, but it still doesn't play the audio. I thought maybe they were trying to simply have the line run as long as the length of the audio and put a cOSirus.Say("&13"); in front of the Phylactere line, but it waits for the audio to finish to move on, so that's not working. Obvious to say, I'm way out of my league here, but hopefully somebody has an idea what I'm doing wrong? I'm to the point where I'd be willing to drop the spoken audio and just go with the text because it makes the game much easier to understand.

Code: ags
 String voice = ""; 
  if (str.StartsWith ("&")) { 
    int i = 1; 
    while (str.Chars [i]> = '0' && str.Chars [i] <= '9') i ++; 
    if (i> 1) { 
      voice = str.Substring (0, i); 
      str = str.Substring (i, str.Length-i); 
    } 
  }



Either way, thanks for the lead in the right direction. The core of my problem is solved here.

Bavolis

Experimenting with it a bit tonight, I can play a sound effect style file of the speech instead instead of the traditional one and then stop it before the next line, which works, but man the thought of doing that for 1000+ lines is a bit daunting.

Slasher

Quote from: Khris on Fri 01/12/2017 11:29:16
This is possible; for instance there's a speech bubble module available on a french AGS forum.
afaik someone has tweaked the Phylactere module to now accept speech...

Snarky

Oh, you just want a square background behind the text? I thought you meant like a strip of black for each line. Then that's pretty easy.

Phylactere has a problem with semi-transparent (black) backgrounds in 32-bit games, though. I've been working on a replacement module that works correctly in 32 bit. I was going to do a bit more work on it before the initial release, but I suppose I can put out a temp version. Stay tuned...

Bavolis

Definitely staying tuned. :)

The transparent background isn't as big of a deal as the sound files not playing. It looks pretty great even with a solid background in the bubbles. But yes, the transparency did have some weird neon pixel behavior with the artwork behind it.

Bavolis

Quote from: Slasher on Sat 02/12/2017 08:07:06
afaik someone has tweaked the Phylactere module to now accept speech...

Do you remember reading that here? I found the main discussion thread which had the code I pasted above, but it doesn't seem to solve the problem.



Bavolis

This is working flawlessly for what I need - well done!

Now the only issue I have is a corrupt memory error with one room after my upgrade to 3.4. The oldest room that's gone through the most AGS upgrades, of course.

SMF spam blocked by CleanTalk