Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#12964 closed defect (fixed)

AGS: Wrong font used for police report in Kathy Rain

Reported by: criezy Owned by: criezy
Priority: normal Component: Engine: AGS
Version: Keywords:
Cc: Game:


When playing Kathy Rain in ScummVM, a different font is used for the police report compared to the original game. However the font used in ScummVM is the same one as used with the standalone AGS executable. So the difference may be due to some changes made by the Kathy Rain developer.

The attached screenshots show the police report with the modified AGS used by the original game, the standalone AGS, and ScummVM, all using the same datafiles.

The source code for the modified AGS engine used by Kathy Rain is available at

Reproduction steps

  1. Load the attacked save game
  2. Click on the bookshelf behind the desk and select "Search Files"


Kathy Rain from Steam (mac version)
ScummVM 07ce31ec (earlier versions crash due to bug #12948)

Attachments (4)

original game.png (463.7 KB ) - added by criezy 3 years ago.
scummvm.png (723.3 KB ) - added by criezy 3 years ago.
standalone AGS.png (693.8 KB ) - added by criezy 3 years ago.
kathyrain.006 (770.5 KB ) - added by criezy 3 years ago.

Change History (12)

by criezy, 3 years ago

Attachment: original game.png added

by criezy, 3 years ago

Attachment: scummvm.png added

by criezy, 3 years ago

Attachment: standalone AGS.png added

by criezy, 3 years ago

Attachment: kathyrain.006 added

comment:1 by Thunderforge, 3 years ago

Are you loading from the launcher or in-game? I’m wondering if this is a duplicate of #12945

comment:2 by criezy, 3 years ago

That is interesting. I was loading the game from the launcher. But when loading it from inside the game I do indeed get the correct font (same as the original game)!

That means we do something better than the standalone AGS, as with that one I was obviously loading from inside the game, and still got the wrong font.

That could point to something that the ags_sprite_font plugin does, since this is the main piece of code that the Kathy Rain developer changed, and in ScummVM we integrated those changes in a special version of the plugin used for Kathy Rain (and Whispers of a Machine). But the standalone AGS does not have those changes. And maybe this plugin does some initialisation when starting the game, but not when loading from the launcher... That is only a wild guess tough.

comment:3 by criezy, 3 years ago

And I have now verified that AGSSpriteFont::SetVariableSpriteFont gets called a number of time when starting Kathy Rain, but it does not get called when loading a savegame from the launcher!

The calls come from RunTextScript(_G(gameinst), "game_start"); that is called from start_game().

  * frame #0: AGS3::Plugins::AGSSpriteFont::AGSSpriteFont::SetVariableSpriteFont(params) at ags_sprite_font.cpp:116:2
    frame #1: AGS3::Plugins::AGSSpriteFont::AGSSpriteFont::execMethod(name, params) at ags_sprite_font.h:39:2
    frame #2: AGS3::Plugins::AGSSpriteFont::AGSSpriteFontClifftopGames::execMethod(name, params) at ags_sprite_font_clifftop.h:33:2
    frame #3: AGS3::Plugins::PluginMethod::operator(params)(AGS3::Plugins::ScriptMethodParams&) const at plugin_base.h:205:8
    frame #4: AGS3::call_function(method, object=nullptr, numparm=2, parms) at script_runtime.cpp:183:10
    frame #5: AGS3::ccInstance::Run(curpc=31885) at cc_instance.cpp:998:17
    frame #6: AGS3::ccInstance::CallScriptFunction(funcname="game_start", numargs=0, params=nullptr) at cc_instance.cpp:342:15
    frame #7: AGS3::RunScriptFunctionIfExists(sci, tsname="game_start", numParam=0, params=nullptr) at script.cpp:364:32
    frame #8: AGS3::RunTextScript(sci, tsname="game_start") at script.cpp:413:14
    frame #9: AGS3::start_game() at game_start.cpp:89:2
    frame #10: AGS3::initialize_start_and_play_game(override_start_room=0, loadSaveGameOnStartup=-1) at game_start.cpp:125:3
    frame #11: AGS3::initialize_engine(startup_opts) at engine.cpp:1226:2
    frame #12: AGS::AGSEngine::run() at ags.cpp:190:2

However when loading a savegame from the launcher we do not get there as start_game() is not called.

In initialize_start_and_play_game() it first calls start_game_load_savegame_on_startup(), and then calls start_game() only if a savegame was not loaded.

I am wondering if the calls to the "game_start" scripts should be move from start_game() to initialize_start_and_play_game() so that they happen before the call to start_game_load_savegame_on_startup()...

This is something we might need to discuss with the AGS developers as I have no idea if such a change would be a good idea and how it might impacts other games.

comment:4 by criezy, 3 years ago

It is expected that the "game_start" scripts are not run on a reload.

We could hack the engine to run those on a reload for Kathy Rain, and cross our fingers that it does not introduce other issues, but the easiest solution seems to be to disable loading from the launcher for this game.

comment:5 by criezy, 3 years ago

And we also have the same issue in Whispers of a Machine.

comment:6 by criezy, 3 years ago

Owner: set to criezy
Resolution: fixed
Status: newclosed

I have now disabled loading from the launcher for those two games.

comment:7 by Thunderforge, 3 years ago

I hope this is only a temporary solution. I would really hate to permanently lose the ability to load from the launcher.

comment:8 by criezy, 3 years ago

Unfortunately there may not be a better solution.

I did experiment a bit with forcing executing the game_start script when loading from the launcher, which does get the correct fonts, but it also introduces other issues in both Kathy Rain and Whispers of a machine. Unless I missed something in my analysis of the issue, the game was just not designed with the load savegame on startup feature and is not really compatible with it.

Note: See TracTickets for help on using tickets.