Package net.mtrop.doom.demo
Class Demo
java.lang.Object
net.mtrop.doom.demo.Demo
- All Implemented Interfaces:
Iterable<Demo.Tic[]>
,BinaryObject
This class is an abstract representation of a DEMO lump in Doom.
It stores player controls per game tic, since everything else is deterministic,
all things equal.
The method readBytes(InputStream)
will read until it detects the end of the DEMO
information.
- Author:
- Matthew Tropiano
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.mtrop.doom.object.BinaryObject
BinaryObject.InlineScanner<BO extends BinaryObject>, BinaryObject.Reflect, BinaryObject.Scanner<BO extends BinaryObject>, BinaryObject.Shared, BinaryObject.Transformer<BO extends BinaryObject>
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Minimum maximum players in Boom (according to Boom source code).static final byte[]
Boom Demo Signaturestatic final int
Compatibility flag: All boss types can trigger tag 666 at ExM8.static final int
Compatibility flag: Blazing doors make double closing sounds.static final int
Compatibility flag: Use Doom's sound code behavior.static final int
Compatibility flag: Use Doom's stairbuilding method.static final int
Compatibility flag: Dead players can exit levels.static final int
Compatibility flag: Use Doom's movement clipping code.static final int
Compatibility flag: Use Doom's floor motion behavior.static final int
Compatibility flag: Use Doom's respawn code.static final int
Compatibility flag: Use Doom's linedef trigger modelstatic final int
Compatibility flag: Tagged doors don't trigger special lighting.static final int
Compatibility flag: Monsters get stuck on doortracks.static final int
Compatibility flag: Some objects never hang over tall ledges.static final int
Compatibility flag: Objects don't fall under their own weight.static final int
Compatibility flag: God mode isn't absolute (can still be killed by telefrag).static final int
Compatibility flag: Powerup cheats are not infinite duration.static final int
Length of compatibility flags.static final int
Compatibility flag: Lost souls get stuck behind walls.static final int
Compatibility flag: 2S middle textures do not animate.static final int
Compatibility flag: Pain Elementals limited to 21 lost souls.static final int
Compatibility flag: Monsters don't give up pursuit of targets.static final int
Compatibility flag: Sky is unaffected by invulnerability.static final int
Compatibility flag: Lost souls don't bounce off flat surfaces.static final int
Compatibility flag: Monsters randomly walk off of moving lifts.static final int
Compatibility flag: Any monster can telefrag on MAP30.static final int
Compatibility flag: Arch-Vile resurrects invincible ghosts.static final int
Compatibility flag: Linedef effects still work with sector tag = 0.static final int
Compatibility Level Boom v2.0static final int
Compatibility Level Boom v2.01static final int
Compatibility Level Boom v2.02static final int
Compatibility Level PrBoom Currentstatic final int
Compatibility Level Doom v1.2static final int
Compatibility Level Doom v1.666static final int
Compatibility Level Doom v1.9static final int
Compatibility Level DOSDoomstatic final int
Compatibility Level Final Doomstatic final int
Compatibility Level LxDoom 1.4.Xstatic final int
Compatibility Level MBFstatic final int
Compatibility Level PrBoom v2.03bstatic final int
Compatibility Level PrBoom v2.1.0static final int
Compatibility Level PrBoom v2.1.1-2.2.6static final int
Compatibility Level PrBoom v2.3.Xstatic final int
Compatibility Level PrBoom v2.4.0static final int
Compatibility Level Ultimate Doomstatic final byte
Demo terminal byte.static final int
Demo insurance - attempt fix.static final int
Demo insurance - no correction.static final int
Demo insurance - only attempt fix during recording.static final int
Maximum players.static final byte[]
MBF Demo Signaturestatic final byte
Demo play mode byte (Alt.static final byte
Demo play mode byte (Deathmatch).static final byte
Demo play mode byte (Single/co-op).static final int
Length of option flag chunk in Boom DEMOs.static final byte
Demo skill byte (easy).static final byte
Demo skill byte (hard).static final byte
Demo skill byte (medium).static final byte
Demo skill byte (very easy).static final byte
Demo skill byte (very hard).static final int
Demo version 1.2 byte.static final int
Demo version 1.4 byte.static final int
Demo version 1.5 byte.static final int
Demo version 1.666 byte.static final int
Demo version 1.9 byte.static final int
Demo version Boom.static final int
Demo version Boom v2.01.static final int
Demo version Boom v2.02.static final int
Demo version 1.9 byte.static final int
Demo version LxDoom.static final int
Demo version MBF.static final int
Demo version PrBoom v2.1.X.static final int
Demo version PrBoom v2.2.X.static final int
Demo version PrBoom v2.3.X.static final int
Demo version PrBoom v2.4.X.static final int
Demo version PrBoom v2.5.0.X. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a single tic for a set of players.boolean
Gets if push/pull objects are enabled.boolean
getCompatibilityFlag
(int flag) Gets a compatibility flag setting.int
Gets the demo's stored compatibility level.int
Gets what kind of "demo insurance" this is set for.boolean
Gets if helper dogs jump.boolean
Gets if helper dogs are enabled.boolean
Gets if the friction specials are enabled.boolean
Gets if helper monkeys are enabled.boolean
Gets if player bobbing is enabled.boolean
Gets if weapon recoil is enabled.int
Gets the episode that this demo is for.boolean
Is fast monsters set for this demo?boolean
Gets if old BSP methods are forced.int
Gets the follow distance of allied CPU friends.int
Gets the game mode that this demo is for.int
double
int
getMap()
boolean
Gets if monster backing is enabled.boolean
Gets if monsters are susceptible to environmental friction.boolean
Gets if monster infighting is enabled.boolean
Is monster respawning set for this demo?boolean
Gets if monsters avoid hazardous areas.boolean
Gets if monsters remember their last target.boolean
Is "no monsters" set for this demo?int
int
Gets the random seeding number that this demo uses.int
getSkill()
Gets the skill level that this demo is for.getTic
(int tic) Gets a demo Tic at a particular gametic, first player only.getTic
(int tic, int player) Returns a Tic at a particular gametic.int
int
Gets the version of Doom that with which this demo was made.int
Gets the player viewpoint index that this demo is being played back from.iterator()
void
readBytes
(InputStream in) Reads from anInputStream
and sets this object's fields.void
reset()
Resets the contents of this demo.void
setAllowPushers
(boolean allowPushers) Sets if push/pull objects are enabled.void
setCompatibilityFlag
(int flag, boolean value) Sets a compatibility flag setting.void
setCompatibilityLevel
(int compatibilityLevel) Sets the demo's stored compatibility level.void
setDemoInsurance
(int demoInsurance) Sets what kind of "demo insurance" this is set for.void
setDogsJump
(boolean dogsJump) Sets if helper dogs jump.void
setEnableDogs
(boolean enableDogs) Sets if helper dogs are enabled.void
setEnableFriction
(boolean enableFriction) Sets if the friction specials are enabled.void
setEnableMonkeys
(boolean enableMonkeys) Sets if helper monkeys are enabled.void
setEnablePlayerBobbing
(boolean enablePlayerBobbing) Sets if player bobbing is enabled.void
setEnableWeaponRecoil
(boolean enableWeaponRecoil) Sets if weapon recoil is enabled.void
setEpisode
(int episode) Sets the episode that this demo is for.void
setFastMonsters
(boolean fast) Sets if fast monsters are set for this demo.void
setForceOldBSP
(boolean forceOldBSP) Sets if old BSP methods are forced.void
setFriendFollowDistance
(int friendFollowDistance) Sets the follow distance of allied CPU friends.void
setGameMode
(int mode) Sets the game mode that this demo is for.void
setHelperCount
(int helperCount) Sets how many helpers are spawned.void
setMap
(int map) Sets the map/mission number that this demo is for.void
setMonsterBacking
(boolean monsterBacking) Sets if monster backing is enabled.void
setMonsterFriction
(boolean monsterFriction) Sets if monsters are susceptible to environmental friction.void
setMonsterInfighting
(boolean monsterInfighting) Sets if monster infighting is enabled.void
setMonsterRespawn
(boolean respawn) Sets if monster respawning is set for this demo.void
setMonstersAvoidHazards
(boolean monstersAvoidHazards) Sets if monsters avoid hazardous areas.void
setMonstersRememberTarget
(boolean monstersRememberTarget) Sets if monsters remember their last target.void
setNoMonsters
(boolean nomonsters) Sets the "no monsters" flag for this demo.void
setRandomSeed
(int randomSeed) Sets the random seeding number that this demo uses.void
setSkill
(int skill) Sets the skill level that this demo is for.void
setVersion
(int version) Sets the version of Doom that with which this demo was made.void
setViewpoint
(int viewpoint) Sets the player viewpoint index that this demo is being played back from.toString()
void
writeBytes
(OutputStream out) Writes this object to anOutputStream
.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.mtrop.doom.object.BinaryObject
fromBytes, readFile, toBytes, writeFile, writeFile
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
VERSION_12
public static final int VERSION_12Demo version 1.2 byte.- See Also:
-
VERSION_14
public static final int VERSION_14Demo version 1.4 byte.- See Also:
-
VERSION_15
public static final int VERSION_15Demo version 1.5 byte.- See Also:
-
VERSION_1666
public static final int VERSION_1666Demo version 1.666 byte.- See Also:
-
VERSION_19
public static final int VERSION_19Demo version 1.9 byte.- See Also:
-
VERSION_FINALDOOM
public static final int VERSION_FINALDOOMDemo version 1.9 byte.- See Also:
-
VERSION_BOOM
public static final int VERSION_BOOMDemo version Boom.- See Also:
-
VERSION_BOOM201
public static final int VERSION_BOOM201Demo version Boom v2.01.- See Also:
-
VERSION_BOOM202
public static final int VERSION_BOOM202Demo version Boom v2.02.- See Also:
-
VERSION_LXDOOM
public static final int VERSION_LXDOOMDemo version LxDoom.- See Also:
-
VERSION_MBF
public static final int VERSION_MBFDemo version MBF.- See Also:
-
VERSION_PRBOOM210
public static final int VERSION_PRBOOM210Demo version PrBoom v2.1.X.- See Also:
-
VERSION_PRBOOM220
public static final int VERSION_PRBOOM220Demo version PrBoom v2.2.X.- See Also:
-
VERSION_PRBOOM230
public static final int VERSION_PRBOOM230Demo version PrBoom v2.3.X.- See Also:
-
VERSION_PRBOOM240
public static final int VERSION_PRBOOM240Demo version PrBoom v2.4.X.- See Also:
-
VERSION_PRBOOM250
public static final int VERSION_PRBOOM250Demo version PrBoom v2.5.0.X.- See Also:
-
SKILL_VERY_EASY
public static final byte SKILL_VERY_EASYDemo skill byte (very easy).- See Also:
-
SKILL_EASY
public static final byte SKILL_EASYDemo skill byte (easy).- See Also:
-
SKILL_MEDIUM
public static final byte SKILL_MEDIUMDemo skill byte (medium).- See Also:
-
SKILL_HARD
public static final byte SKILL_HARDDemo skill byte (hard).- See Also:
-
SKILL_VERY_HARD
public static final byte SKILL_VERY_HARDDemo skill byte (very hard).- See Also:
-
MODE_NORMAL
public static final byte MODE_NORMALDemo play mode byte (Single/co-op).- See Also:
-
MODE_DEATHMATCH
public static final byte MODE_DEATHMATCHDemo play mode byte (Deathmatch).- See Also:
-
MODE_ALTDEATH
public static final byte MODE_ALTDEATHDemo play mode byte (Alt. Deathmatch).- See Also:
-
DEMO_INSURANCE_NONE
public static final int DEMO_INSURANCE_NONEDemo insurance - no correction.- See Also:
-
DEMO_INSURANCE_FIX
public static final int DEMO_INSURANCE_FIXDemo insurance - attempt fix.- See Also:
-
DEMO_INSURANCE_RECORD_ONLY
public static final int DEMO_INSURANCE_RECORD_ONLYDemo insurance - only attempt fix during recording.- See Also:
-
DEMO_END
public static final byte DEMO_ENDDemo terminal byte.- See Also:
-
COMPLEVEL_DOOM_12
public static final int COMPLEVEL_DOOM_12Compatibility Level Doom v1.2- See Also:
-
COMPLEVEL_DOOM_1666
public static final int COMPLEVEL_DOOM_1666Compatibility Level Doom v1.666- See Also:
-
COMPLEVEL_DOOM_19
public static final int COMPLEVEL_DOOM_19Compatibility Level Doom v1.9- See Also:
-
COMPLEVEL_UDOOM
public static final int COMPLEVEL_UDOOMCompatibility Level Ultimate Doom- See Also:
-
COMPLEVEL_FINAL_DOOM
public static final int COMPLEVEL_FINAL_DOOMCompatibility Level Final Doom- See Also:
-
COMPLEVEL_DOSDOOM
public static final int COMPLEVEL_DOSDOOMCompatibility Level DOSDoom- See Also:
-
COMPLEVEL_BOOM
public static final int COMPLEVEL_BOOMCompatibility Level Boom v2.0- See Also:
-
COMPLEVEL_BOOM201
public static final int COMPLEVEL_BOOM201Compatibility Level Boom v2.01- See Also:
-
COMPLEVEL_BOOM202
public static final int COMPLEVEL_BOOM202Compatibility Level Boom v2.02- See Also:
-
COMPLEVEL_LXDOOM
public static final int COMPLEVEL_LXDOOMCompatibility Level LxDoom 1.4.X- See Also:
-
COMPLEVEL_MBF
public static final int COMPLEVEL_MBFCompatibility Level MBF- See Also:
-
COMPLEVEL_PRBOOM_203B
public static final int COMPLEVEL_PRBOOM_203BCompatibility Level PrBoom v2.03b- See Also:
-
COMPLEVEL_PRBOOM_210
public static final int COMPLEVEL_PRBOOM_210Compatibility Level PrBoom v2.1.0- See Also:
-
COMPLEVEL_PRBOOM_211_226
public static final int COMPLEVEL_PRBOOM_211_226Compatibility Level PrBoom v2.1.1-2.2.6- See Also:
-
COMPLEVEL_PRBOOM_23X
public static final int COMPLEVEL_PRBOOM_23XCompatibility Level PrBoom v2.3.X- See Also:
-
COMPLEVEL_PRBOOM_240
public static final int COMPLEVEL_PRBOOM_240Compatibility Level PrBoom v2.4.0- See Also:
-
COMPLEVEL_CURRENT_PRBOOM
public static final int COMPLEVEL_CURRENT_PRBOOMCompatibility Level PrBoom Current- See Also:
-
COMPFLAG_TELEFRAG
public static final int COMPFLAG_TELEFRAGCompatibility flag: Any monster can telefrag on MAP30.- See Also:
-
COMPFLAG_DROPOFF
public static final int COMPFLAG_DROPOFFCompatibility flag: Some objects never hang over tall ledges.- See Also:
-
COMPFLAG_VILEGHOST
public static final int COMPFLAG_VILEGHOSTCompatibility flag: Arch-Vile resurrects invincible ghosts.- See Also:
-
COMPFLAG_PAINLIMIT
public static final int COMPFLAG_PAINLIMITCompatibility flag: Pain Elementals limited to 21 lost souls.- See Also:
-
COMPFLAG_LOSTSOULWALLS
public static final int COMPFLAG_LOSTSOULWALLSCompatibility flag: Lost souls get stuck behind walls.- See Also:
-
COMPFLAG_BLAZECLOSESOUND
public static final int COMPFLAG_BLAZECLOSESOUNDCompatibility flag: Blazing doors make double closing sounds.- See Also:
-
COMPFLAG_DOORLIGHT
public static final int COMPFLAG_DOORLIGHTCompatibility flag: Tagged doors don't trigger special lighting.- See Also:
-
COMPFLAG_DOOMTRIGGERMODEL
public static final int COMPFLAG_DOOMTRIGGERMODELCompatibility flag: Use Doom's linedef trigger model- See Also:
-
COMPFLAG_GOD
public static final int COMPFLAG_GODCompatibility flag: God mode isn't absolute (can still be killed by telefrag).- See Also:
-
COMPFLAG_FALLOFF
public static final int COMPFLAG_FALLOFFCompatibility flag: Objects don't fall under their own weight.- See Also:
-
COMPFLAG_DOOMFLOORMOTION
public static final int COMPFLAG_DOOMFLOORMOTIONCompatibility flag: Use Doom's floor motion behavior.- See Also:
-
COMPFLAG_SKYINVUL
public static final int COMPFLAG_SKYINVULCompatibility flag: Sky is unaffected by invulnerability.- See Also:
-
COMPFLAG_PURSUIT
public static final int COMPFLAG_PURSUITCompatibility flag: Monsters don't give up pursuit of targets.- See Also:
-
COMPFLAG_DOORSTUCK
public static final int COMPFLAG_DOORSTUCKCompatibility flag: Monsters get stuck on doortracks.- See Also:
-
COMPFLAG_STAYLIFT
public static final int COMPFLAG_STAYLIFTCompatibility flag: Monsters randomly walk off of moving lifts.- See Also:
-
COMPFLAG_DEADPLAYEREXIT
public static final int COMPFLAG_DEADPLAYEREXITCompatibility flag: Dead players can exit levels.- See Also:
-
COMPFLAG_BUGGYSTAIRS
public static final int COMPFLAG_BUGGYSTAIRSCompatibility flag: Use Doom's stairbuilding method.- See Also:
-
COMPFLAG_INFCHEAT
public static final int COMPFLAG_INFCHEATCompatibility flag: Powerup cheats are not infinite duration.- See Also:
-
COMPFLAG_ZEROTAGS
public static final int COMPFLAG_ZEROTAGSCompatibility flag: Linedef effects still work with sector tag = 0.- See Also:
-
COMPFLAG_DOOMCLIPPING
public static final int COMPFLAG_DOOMCLIPPINGCompatibility flag: Use Doom's movement clipping code.- See Also:
-
COMPFLAG_DOOMRESPAWN
public static final int COMPFLAG_DOOMRESPAWNCompatibility flag: Use Doom's respawn code.- See Also:
-
COMPFLAG_BUGGYSOUND
public static final int COMPFLAG_BUGGYSOUNDCompatibility flag: Use Doom's sound code behavior.- See Also:
-
COMPFLAG_666
public static final int COMPFLAG_666Compatibility flag: All boss types can trigger tag 666 at ExM8.- See Also:
-
COMPFLAG_SOULBOUNCE
public static final int COMPFLAG_SOULBOUNCECompatibility flag: Lost souls don't bounce off flat surfaces.- See Also:
-
COMPFLAG_MASKEDANIM
public static final int COMPFLAG_MASKEDANIMCompatibility flag: 2S middle textures do not animate.- See Also:
-
COMPFLAG_LENGTH
public static final int COMPFLAG_LENGTHLength of compatibility flags.- See Also:
-
OPTION_FLAGS_LENGTH
public static final int OPTION_FLAGS_LENGTHLength of option flag chunk in Boom DEMOs.- See Also:
-
MAX_PLAYERS
public static final int MAX_PLAYERSMaximum players.- See Also:
-
BOOM_MIN_MAXPLAYERS
public static final int BOOM_MIN_MAXPLAYERSMinimum maximum players in Boom (according to Boom source code).- See Also:
-
MBF_SIGNATURE
public static final byte[] MBF_SIGNATUREMBF Demo Signature -
BOOM_SIGNATURE
public static final byte[] BOOM_SIGNATUREBoom Demo Signature
-
-
Constructor Details
-
Demo
public Demo()Creates a new, blank demo with default values. One player. -
Demo
public Demo(int players) Creates a new, blank demo with default values and a set amount of players.- Parameters:
players
- the amount of players that this tracks.
-
-
Method Details
-
reset
public void reset()Resets the contents of this demo. -
getPlayers
public int getPlayers()- Returns:
- the amount of players in this demo.
-
getVersion
public int getVersion()Gets the version of Doom that with which this demo was made. See the VERSION macros for the important values. This affects how the demo is exported if written to an output stream of some kind.- Returns:
- the version value.
-
setVersion
public void setVersion(int version) Sets the version of Doom that with which this demo was made. See the VERSION macros for the important values.This affects how the demo is exported if written to an output stream of some kind.
- Parameters:
version
- the version value.- Throws:
IllegalArgumentException
- if version is outside the range 0 to 255.
-
getSkill
public int getSkill()Gets the skill level that this demo is for. See the SKILL macros for the important values.- Returns:
- the skill level value.
-
setSkill
public void setSkill(int skill) Sets the skill level that this demo is for. See the SKILL macros for the important values.- Parameters:
skill
- the skill level value.- Throws:
IllegalArgumentException
- if skill is outside the range 0 to 4.
-
getEpisode
public int getEpisode()Gets the episode that this demo is for.Doom 2, Hexen, and Strife do not have episodes, so this is 1 for those games.
- Returns:
- the episode number.
-
setEpisode
public void setEpisode(int episode) Sets the episode that this demo is for.Doom 2, Hexen, and Strife do not have episodes, so this is 1 for those games.
- Parameters:
episode
- the episode number.- Throws:
IllegalArgumentException
- if episode is outside the range 0 to 255.
-
getMap
public int getMap()- Returns:
- the map/mission number that this demo is for.
-
setMap
public void setMap(int map) Sets the map/mission number that this demo is for.- Parameters:
map
- the map number.- Throws:
IllegalArgumentException
- if map is outside the range 0 to 255.
-
getGameMode
public int getGameMode()Gets the game mode that this demo is for. See the MODE constants.- Returns:
- the game mode value.
-
setGameMode
public void setGameMode(int mode) Sets the game mode that this demo is for. See the MODE constants.- Parameters:
mode
- the game mode value.
-
getMonsterRespawn
public boolean getMonsterRespawn()Is monster respawning set for this demo?- Returns:
- true if so, false if not.
-
setMonsterRespawn
public void setMonsterRespawn(boolean respawn) Sets if monster respawning is set for this demo.- Parameters:
respawn
- true if so, false if not.
-
getFastMonsters
public boolean getFastMonsters()Is fast monsters set for this demo?- Returns:
- true if so, false if not.
-
setFastMonsters
public void setFastMonsters(boolean fast) Sets if fast monsters are set for this demo.- Parameters:
fast
- true if so, false if not.
-
getNoMonsters
public boolean getNoMonsters()Is "no monsters" set for this demo?- Returns:
- true if so, false if not.
-
setNoMonsters
public void setNoMonsters(boolean nomonsters) Sets the "no monsters" flag for this demo.- Parameters:
nomonsters
- true if so, false if not.
-
getMonstersRememberTarget
public boolean getMonstersRememberTarget()Gets if monsters remember their last target.- Returns:
- true if so, false if not.
-
setMonstersRememberTarget
public void setMonstersRememberTarget(boolean monstersRememberTarget) Sets if monsters remember their last target.- Parameters:
monstersRememberTarget
- true if so, false if not.
-
getEnableFriction
public boolean getEnableFriction()Gets if the friction specials are enabled.- Returns:
- true if so, false if not.
-
setEnableFriction
public void setEnableFriction(boolean enableFriction) Sets if the friction specials are enabled.- Parameters:
enableFriction
- true if so, false if not.
-
getEnableWeaponRecoil
public boolean getEnableWeaponRecoil()Gets if weapon recoil is enabled.- Returns:
- true if so, false if not.
-
setEnableWeaponRecoil
public void setEnableWeaponRecoil(boolean enableWeaponRecoil) Sets if weapon recoil is enabled.- Parameters:
enableWeaponRecoil
- true if so, false if not.
-
getAllowPushers
public boolean getAllowPushers()Gets if push/pull objects are enabled.- Returns:
- true if so, false if not.
-
setAllowPushers
public void setAllowPushers(boolean allowPushers) Sets if push/pull objects are enabled.- Parameters:
allowPushers
- true if so, false if not.
-
getEnablePlayerBobbing
public boolean getEnablePlayerBobbing()Gets if player bobbing is enabled.- Returns:
- true if so, false if not.
-
setEnablePlayerBobbing
public void setEnablePlayerBobbing(boolean enablePlayerBobbing) Sets if player bobbing is enabled.- Parameters:
enablePlayerBobbing
- true if so, false if not.
-
getDemoInsurance
public int getDemoInsurance()Gets what kind of "demo insurance" this is set for. See the DEMO_INSURANCE constants.- Returns:
- the demo insurance value.
-
setDemoInsurance
public void setDemoInsurance(int demoInsurance) Sets what kind of "demo insurance" this is set for. See the DEMO_INSURANCE constants.- Parameters:
demoInsurance
- the new demo insurance value.
-
getRandomSeed
public int getRandomSeed()Gets the random seeding number that this demo uses.- Returns:
- the seed number.
-
setRandomSeed
public void setRandomSeed(int randomSeed) Sets the random seeding number that this demo uses.- Parameters:
randomSeed
- the new seed value.
-
getFriendFollowDistance
public int getFriendFollowDistance()Gets the follow distance of allied CPU friends.- Returns:
- the follow distance that was set.
-
setFriendFollowDistance
public void setFriendFollowDistance(int friendFollowDistance) Sets the follow distance of allied CPU friends.- Parameters:
friendFollowDistance
- the new follow distance.- Throws:
IllegalArgumentException
- if the distance is outside the range 0 to 999.
-
getMonsterInfighting
public boolean getMonsterInfighting()Gets if monster infighting is enabled.- Returns:
- true if so, false if not.
-
setMonsterInfighting
public void setMonsterInfighting(boolean monsterInfighting) Sets if monster infighting is enabled.- Parameters:
monsterInfighting
- true if so, false if not.
-
getEnableDogs
public boolean getEnableDogs()Gets if helper dogs are enabled.- Returns:
- true if so, false if not.
-
setEnableDogs
public void setEnableDogs(boolean enableDogs) Sets if helper dogs are enabled.- Parameters:
enableDogs
- true if so, false if not.
-
getEnableMonkeys
public boolean getEnableMonkeys()Gets if helper monkeys are enabled.- Returns:
- true if so, false if not.
-
setEnableMonkeys
public void setEnableMonkeys(boolean enableMonkeys) Sets if helper monkeys are enabled.- Parameters:
enableMonkeys
- true if so, false if not.
-
getDogsJump
public boolean getDogsJump()Gets if helper dogs jump.- Returns:
- true if so, false if not.
-
setDogsJump
public void setDogsJump(boolean dogsJump) Sets if helper dogs jump.- Parameters:
dogsJump
- true if so, false if not.
-
getMonsterBacking
public boolean getMonsterBacking()Gets if monster backing is enabled.- Returns:
- true if so, false if not.
-
setMonsterBacking
public void setMonsterBacking(boolean monsterBacking) Sets if monster backing is enabled.- Parameters:
monsterBacking
- true if so, false if not.
-
getMonstersAvoidHazards
public boolean getMonstersAvoidHazards()Gets if monsters avoid hazardous areas.- Returns:
- true if so, false if not.
-
setMonstersAvoidHazards
public void setMonstersAvoidHazards(boolean monstersAvoidHazards) Sets if monsters avoid hazardous areas.- Parameters:
monstersAvoidHazards
- true if so, false if not.
-
getMonsterFriction
public boolean getMonsterFriction()Gets if monsters are susceptible to environmental friction.- Returns:
- true if so, false if not.
-
setMonsterFriction
public void setMonsterFriction(boolean monsterFriction) Sets if monsters are susceptible to environmental friction.- Parameters:
monsterFriction
- true if so, false if not.
-
getHelperCount
public int getHelperCount()- Returns:
- how many helpers are spawned.
-
setHelperCount
public void setHelperCount(int helperCount) Sets how many helpers are spawned.- Parameters:
helperCount
- the amount of helpers.
-
getForceOldBSP
public boolean getForceOldBSP()Gets if old BSP methods are forced.- Returns:
- true if so, false if not.
-
setForceOldBSP
public void setForceOldBSP(boolean forceOldBSP) Sets if old BSP methods are forced.- Parameters:
forceOldBSP
- true if so, false if not.
-
getViewpoint
public int getViewpoint()Gets the player viewpoint index that this demo is being played back from. Zero is player 1.- Returns:
- the corresponding viewpoint index.
-
setViewpoint
public void setViewpoint(int viewpoint) Sets the player viewpoint index that this demo is being played back from. Zero is player 1.- Parameters:
viewpoint
- the new viewpoint index.- Throws:
IllegalArgumentException
- if viewpoint is outside the range 0 to 255.
-
getCompatibilityLevel
public int getCompatibilityLevel()Gets the demo's stored compatibility level. Only useful if this is a Boom-format Demo. See the COMPLEVEL constants for more info.- Returns:
- the current compatibility level.
-
setCompatibilityLevel
public void setCompatibilityLevel(int compatibilityLevel) Sets the demo's stored compatibility level. This affects how the demo is exported if written to an output stream of some kind. See the COMPLEVEL constants for more info.- Parameters:
compatibilityLevel
- the new level.
-
getCompatibilityFlag
public boolean getCompatibilityFlag(int flag) Gets a compatibility flag setting.- Parameters:
flag
- the flag index (see COMPATFLAG constants).- Returns:
- true if set, false if not.
- Throws:
ArrayIndexOutOfBoundsException
- ifflag
is less than 0 or greater than or equal to 32.
-
setCompatibilityFlag
public void setCompatibilityFlag(int flag, boolean value) Sets a compatibility flag setting. This affects how the demo is exported if written to an output stream of some kind.- Parameters:
flag
- the flag to set (see COMPATFLAG constants).value
- true to set, false to unset.- Throws:
ArrayIndexOutOfBoundsException
- ifflag
is less than 0 or greater than or equal to 32.
-
getTicCount
public int getTicCount()- Returns:
- how many game tics were recorded in this demo.
-
getLength
public double getLength()- Returns:
- how many seconds this demo lasts (approximate).
-
getTic
Returns a Tic at a particular gametic.- Parameters:
tic
- the tic index.player
- the player index.- Returns:
- the corresponding Tic or null if out of range.
- Throws:
ArrayIndexOutOfBoundsException
- ifplayer
is out of range.
-
getTic
Gets a demo Tic at a particular gametic, first player only.- Parameters:
tic
- the tic index.- Returns:
- the corresponding Tic or
null
if out of range. - See Also:
-
addTic
Adds a single tic for a set of players. If the amount of tics to add does not equal the number of players,- Parameters:
tics
- the set of tic data to add for one player.- Throws:
IllegalArgumentException
- if the amount of tics to add is not equal to the number of players.
-
iterator
-
readBytes
Description copied from interface:BinaryObject
Reads from anInputStream
and sets this object's fields. Only reads the amount of bytes that it takes to read a single instance of the object. Note that not every object may have a consistent length!- Specified by:
readBytes
in interfaceBinaryObject
- Parameters:
in
- theInputStream
to read from.- Throws:
IOException
- if a read error occurs.
-
writeBytes
Description copied from interface:BinaryObject
Writes this object to anOutputStream
.- Specified by:
writeBytes
in interfaceBinaryObject
- Parameters:
out
- theOutputStream
to write to.- Throws:
IOException
- if a write error occurs.
-
toString
-