adventuregamestudio / ags

AGS editor and engine source code
Other
695 stars 158 forks source link

Unnecessary font anti-aliasing in older games? #820

Open ghost opened 5 years ago

ghost commented 5 years ago

I noticed this recently when testing changes to alfont using previously mentioned 1271.Maniac Mansion Mania game as an example.

Game download: https://www.maniac-mansion-mania.com/index.php/en/spiele/komplettloesungen/episoden/219-lg-episode-16-meteor-family-die-rehr-des-meteoriten.html

If you run the original game executable (windows) the TTF fonts are crisp and pixel-perfect, however when running same game with current 3.5.0 engine some of the letters are blurry. They are also more thick by comparison.

I did some debugging and found out that game has "antialias fonts" option enabled (OPT_ANTIALIASFONTS = 25). When I turned it off in the code the fonts start looking exactly like they did in original exe.

Which makes me wonder, either new engine incorrectly sets "antialias fonts" option, or font antialiasing got broken somewhere between these versions.

ivan-mogilko commented 3 years ago

After long testing and experimenting with AGS 2.7, I found out that in the old engines text anti-aliasing did not work with the "lucas-arts" and "sierra-style without background" speech styles, when the speech is displayed on a transparent rect above character's head. It works with same fonts and game settings if the speech is "sierra-style with background".

My guess is that this was because the alpha channel (required for anti-aliasing) was lost somehow when text was drawn on a transparent surface. But it's no longer lost in the modern engine.

Potentially this may be emulated, but I'm not sure if it's a right thing to give an effort to... An alternative could be to add a config option that toggles text anti-aliasing on and off.