Patch:Demo mode

From KeenWiki
Jump to: navigation, search

This page contains patches relating to two interlinked subjects, the demo switch and demo mode. It is not to be confused with the demos that play automatically in the game or the demo sign sprite..

The demo switch is an executable switch that sets the game to 'demo mode' when used. The -demo switch is used by running the game with the string \demo on the command line (E.g. Keen4e.exe \demo.) or adding -demo to the batch file for mods. (E.g. ck4patch.exe Keen4e.exe -demo.) It should be noted that the '\' or '-' is not usually necessary for the switch to work but is best kept since under rare circumstances it may be needed.

A number of changes occur when in demo mode. Firstly the main menu and all its options are disabled; while the game will play demos including the 'star wars story screen' pressing any key will start a new game in normal mode instead. While playing the game the player cannot escape to the main menu and thus save\load games or quit. (The only way to exit is to crash the game.)

Additionally the game will end when level 2 is completed, the player dies or enters their bored animation. All cheats are also disabled by default.

This page is divided into two sections. The first deals with demo mode itself and what makes it different from regular game mode. The second section deals with the demo switch, its text and effects.


Demo mode

Demo mode always on

These patches make the game always set the demo switch so that the game automatically goes into demo mode. The patches do this by skipping the check and simply going to setting the variable.

Patch: Disable demo switch
#demo always on -Keen 4
%patch $3E82 $EB $0E
#demo always on -Keen 5
%patch $3E7C $EB $0E
#demo always on -Keen 6
%patch $3CAB $EB $0E


Difficulty of demo mode game

By default the demo mode game will always have a difficulty of 2

This patch changes the default difficulty of demo mode. By default this is 2, or normal difficulty. 1 is easy, 3 is hard and other values may cause unexpected problems. The first value is for levels started after the first game started, the second for the first game started only.

Patch: Difficulty of demo mode
#Difficulty of demo mode -Keen 4
%patch $3EF6 $0002W
#First game
%patch $5209 $0002W
#Subsequent games
#Difficulty of demo mode -Keen 5
%patch $3EF0 $0002W
#First game
%patch $5203 $0002W
#Subsequent games
#Difficulty of demo mode -Keen 6
%patch $3D1F $0002W
#First game
%patch $5012 $0002W
#Subsequent games


What level ends the game

By default winning level 2 will cause the game to end and go to the high scores. If the $75 is set to $90 $90 then winning any level will end the demo game.

Patch: Keen 4
#Specify level that must be beaten to win game (default is 2)
%patch $6B54 $02 $75


Complete levels to win

By tweaking this code a little bit, it can be used to end the game after a certain level is beaten. More than one level can be the 'win' level, see Patch:Jump conditions. Using this patch makes the game win unless the third patch is removed.

Patch: Keen 4
#MAKE GAME END AFTER LEVEL X
#Always check to see if level X was beat, even if not in demo mode.
%patch $6B4E $90 $90
#Specify level that must be beaten to win game (default is 2)
%patch $6B54 $02 $75
#Win the game instead of going to high scores
%patch $6B57 $EB $99
#Enable demo parameter by default (Not necessary)
%patch $3E90 $90 $90


Demo mode doesn't end game if Keen is bored

If Keen starts reading a book in demo mode the game will end and go to the high scores. This patch prevents that from happening.

Patch: Don't end game if Keen reads
#Don't end game if Keen reads - Keen 4
%patch $BC68 $EB


Demo mode doesn't disable Main Menu at startup

This patch stops demo mode from skipping the Main Menu, instead treating it like an ordinary game. Keen will still not be able to bring up the Main Menu once he starts a game however.

Patch: Demo mode doesn't disable Main Menu
#Demo mode doesn't skip menu - Keen 4
%patch $51F8 $EB $21


Demo mode doesn't disable cheats and Main Menu ingame

This patch changes things so that the 'normal' cheats (That is the 'boss' and BAT cheats.) aren't disabled. (Other cheats aren't affected.) This also stops demo mode from blocking the Main Menu ingame.

Patch: Keen 4
#Demo mode doesn't disable cheats
%patch $7971 $EB


Demo switch

Switch text

This is the text required to 'activate' the switch. Making this '$00' will cause the switch to always be active. Text should be all in capitals.

Patch: Demo switch text
#Keen 4
%patch $3E83 $01CEW
#Text called from
%patch $2F03E "DEMO" $00
#Keen 5
%patch $3E7D $017EW
#Text called from
%patch $304BE "DEMO" $00
#Keen 6
%patch $3CAC $0112W
#Text called from
%patch $30E42 "DEMO" $00


What switch changes

The demo switch sets the demo variable to 1. If this is changed then demo will no longer automatically enable demo mode. It can however be used to change other variables instead.

Patch: Set variable with -demo switch
#Set variable with -demo switch - Keen 4
%patch $3E94 $7A72W $0001W
#Set variable with -demo switch - Keen 5
%patch $3E8E $6F72W $0001W
#Set variable with -demo switch - Keen 6
%patch $3CBD $75AEW $0001W


Disable demo switch

These patches disables the demo switch entirely meaning it can never be used. It skips the switch check and variable change.

Patch: Disable demo switch
#Disable demo switch -Keen 4
%patch $3E82 $EB $14
#Disable demo switch -Keen 5
%patch $3E7C $EB $14
#Disable demo switch -Keen 6
%patch $3CAB $EB $14