public void TntDemo3() { using (var resource = CommonResource.CreateDummy(WadPath.Tnt)) { var demo = new Demo(resource.Wad.ReadLump("DEMO3")); var players = DoomTest.GetDefaultPlayers(); var cmds = players.Select(player => player.Cmd).ToArray(); var world = new World(resource, demo.Options, players); var lastMobjHash = 0; var aggMobjHash = 0; var lastSectorHash = 0; var aggSectorHash = 0; while (true) { if (!demo.ReadCmd(cmds)) { break; } world.Update(); lastMobjHash = DoomDebug.GetMobjHash(world); aggMobjHash = DoomDebug.CombineHash(aggMobjHash, lastMobjHash); lastSectorHash = DoomDebug.GetSectorHash(world); aggSectorHash = DoomDebug.CombineHash(aggSectorHash, lastSectorHash); } Assert.AreEqual(0xb289efaeu, (uint)lastMobjHash); Assert.AreEqual(0x08d04ef6u, (uint)aggMobjHash); Assert.AreEqual(0x8ab75d90u, (uint)lastSectorHash); Assert.AreEqual(0x08d5fbb0u, (uint)aggSectorHash); } }
public void Doom2Demo3_Final2() { using (var resource = CommonResource.CreateDummy(WadPath.Doom2)) { var demo = new Demo(resource.Wad.ReadLump("DEMO3")); demo.Options.Version = GameVersion.Final2; var players = DoomTest.GetDefaultPlayers(); var cmds = players.Select(player => player.Cmd).ToArray(); var world = new World(resource, demo.Options, players); var lastMobjHash = 0; var aggMobjHash = 0; var lastSectorHash = 0; var aggSectorHash = 0; while (true) { if (!demo.ReadCmd(cmds)) { break; } world.Update(); lastMobjHash = DoomDebug.GetMobjHash(world); aggMobjHash = DoomDebug.CombineHash(aggMobjHash, lastMobjHash); lastSectorHash = DoomDebug.GetSectorHash(world); aggSectorHash = DoomDebug.CombineHash(aggSectorHash, lastSectorHash); } Assert.AreEqual(0x6daadf6du, (uint)lastMobjHash); Assert.AreEqual(0xdfba83c6u, (uint)aggMobjHash); Assert.AreEqual(0xfe1f6052u, (uint)lastSectorHash); Assert.AreEqual(0x6f6e779eu, (uint)aggSectorHash); } }
public void TntDemo1() { using (var resource = CommonResource.CreateDummy(WadPath.Tnt)) { var demo = new Demo(resource.Wad.ReadLump("DEMO1")); var players = DoomTest.GetDefaultPlayers(); var cmds = players.Select(player => player.Cmd).ToArray(); var world = new World(resource, demo.Options, players); var lastMobjHash = 0; var aggMobjHash = 0; var lastSectorHash = 0; var aggSectorHash = 0; while (true) { if (!demo.ReadCmd(cmds)) { break; } world.Update(); lastMobjHash = DoomDebug.GetMobjHash(world); aggMobjHash = DoomDebug.CombineHash(aggMobjHash, lastMobjHash); lastSectorHash = DoomDebug.GetSectorHash(world); aggSectorHash = DoomDebug.CombineHash(aggSectorHash, lastSectorHash); } Assert.AreEqual(0x428a3538u, (uint)lastMobjHash); Assert.AreEqual(0x7bd7efb1u, (uint)aggMobjHash); Assert.AreEqual(0x5da0944cu, (uint)lastSectorHash); Assert.AreEqual(0x9a9aa180u, (uint)aggSectorHash); } }
public void PlutoniaDemo3_Final2() { using (var resource = CommonResource.CreateDummy(WadPath.Plutonia)) { var demo = new Demo(resource.Wad.ReadLump("DEMO3")); demo.Options.GameVersion = GameVersion.Final2; var cmds = Enumerable.Range(0, Player.MaxPlayerCount).Select(i => new TicCmd()).ToArray(); var game = new DoomGame(resource, demo.Options); game.DeferedInitNew(); var lastMobjHash = 0; var aggMobjHash = 0; var lastSectorHash = 0; var aggSectorHash = 0; while (true) { if (!demo.ReadCmd(cmds)) { break; } game.Update(cmds); lastMobjHash = DoomDebug.GetMobjHash(game.World); aggMobjHash = DoomDebug.CombineHash(aggMobjHash, lastMobjHash); lastSectorHash = DoomDebug.GetSectorHash(game.World); aggSectorHash = DoomDebug.CombineHash(aggSectorHash, lastSectorHash); } Assert.AreEqual(0xa69f484fu, (uint)lastMobjHash); Assert.AreEqual(0xa62991cbu, (uint)aggMobjHash); Assert.AreEqual(0x796a4b06u, (uint)lastSectorHash); Assert.AreEqual(0xfa506444u, (uint)aggSectorHash); } }
public void Doom2Demo2() { using (var resource = CommonResource.CreateDummy(WadPath.Doom2)) { var demo = new Demo(resource.Wad.ReadLump("DEMO2")); var players = DoomTest.GetDefaultPlayers(); var cmds = players.Select(player => player.Cmd).ToArray(); var world = new World(resource, demo.Options, players); var lastMobjHash = 0; var aggMobjHash = 0; var lastSectorHash = 0; var aggSectorHash = 0; while (true) { if (!demo.ReadCmd(cmds)) { break; } world.Update(); lastMobjHash = DoomDebug.GetMobjHash(world); aggMobjHash = DoomDebug.CombineHash(aggMobjHash, lastMobjHash); lastSectorHash = DoomDebug.GetSectorHash(world); aggSectorHash = DoomDebug.CombineHash(aggSectorHash, lastSectorHash); } Assert.AreEqual(0x45384a05u, (uint)lastMobjHash); Assert.AreEqual(0xde6d3531u, (uint)aggMobjHash); Assert.AreEqual(0x49c96600u, (uint)lastSectorHash); Assert.AreEqual(0x82f0e2d0u, (uint)aggSectorHash); } }
public void PlutoniaDemo3() { using (var resource = CommonResource.CreateDummy(WadPath.Plutonia)) { var demo = new Demo(resource.Wad.ReadLump("DEMO3")); demo.Options.Version = GameVersion.Final2; var players = DoomTest.GetDefaultPlayers(); var cmds = players.Select(player => player.Cmd).ToArray(); var world = new World(resource, demo.Options, players); var lastMobjHash = 0; var aggMobjHash = 0; var lastSectorHash = 0; var aggSectorHash = 0; while (true) { if (!demo.ReadCmd(cmds)) { break; } world.Update(); lastMobjHash = DoomDebug.GetMobjHash(world); aggMobjHash = DoomDebug.CombineHash(aggMobjHash, lastMobjHash); lastSectorHash = DoomDebug.GetSectorHash(world); aggSectorHash = DoomDebug.CombineHash(aggSectorHash, lastSectorHash); } Assert.AreEqual(0xa69f484fu, (uint)lastMobjHash); Assert.AreEqual(0xa62991cbu, (uint)aggMobjHash); Assert.AreEqual(0x796a4b06u, (uint)lastSectorHash); Assert.AreEqual(0xfa506444u, (uint)aggSectorHash); } }
public void ShotgunTest() { using (var resource = CommonResource.CreateDummy(WadPath.Doom2, @"data\shotgun_test.wad")) { var demo = new Demo(@"data\shotgun_test.lmp"); var players = DoomTest.GetDefaultPlayers(); var cmds = players.Select(player => player.Cmd).ToArray(); var world = new World(resource, demo.Options, players); var lastHash = 0; var aggHash = 0; while (true) { if (!demo.ReadCmd(cmds)) { break; } world.Update(); lastHash = DoomDebug.GetMobjHash(world); aggHash = DoomDebug.CombineHash(aggHash, lastHash); } Assert.AreEqual(0x3dd50799u, (uint)lastHash); Assert.AreEqual(0x4ddd814fu, (uint)aggHash); } }
public void Map01() { using (var content = GameContent.CreateDummy(WadPath.Doom2)) { var options = new GameOptions(); options.Skill = GameSkill.Hard; options.Map = 1; options.Players[0].InGame = true; var cmds = Enumerable.Range(0, Player.MaxPlayerCount).Select(i => new TicCmd()).ToArray(); var game = new DoomGame(content, options); game.DeferedInitNew(); var tics = 350; var aggMobjHash = 0; for (var i = 0; i < tics; i++) { game.Update(cmds); aggMobjHash = DoomDebug.CombineHash(aggMobjHash, DoomDebug.GetMobjHash(game.World)); } Assert.AreEqual(0xc108ff16u, (uint)DoomDebug.GetMobjHash(game.World)); Assert.AreEqual(0x3bd5113cu, (uint)aggMobjHash); } }
public void Map11Nomonsters() { using (var content = GameContent.CreateDummy(WadPath.Doom2)) { var options = new GameOptions(); options.Skill = GameSkill.Medium; options.Map = 11; options.NoMonsters = true; options.Players[0].InGame = true; var cmds = Enumerable.Range(0, Player.MaxPlayerCount).Select(i => new TicCmd()).ToArray(); var game = new DoomGame(content, options); game.DeferedInitNew(); var tics = 350; var aggMobjHash = 0; var aggSectorHash = 0; for (var i = 0; i < tics; i++) { game.Update(cmds); aggMobjHash = DoomDebug.CombineHash(aggMobjHash, DoomDebug.GetMobjHash(game.World)); aggSectorHash = DoomDebug.CombineHash(aggSectorHash, DoomDebug.GetSectorHash(game.World)); } Assert.AreEqual(0x21187a94u, (uint)DoomDebug.GetMobjHash(game.World)); Assert.AreEqual(0x55752988u, (uint)aggMobjHash); Assert.AreEqual(0xead9e45bu, (uint)DoomDebug.GetSectorHash(game.World)); Assert.AreEqual(0x1397c7cbu, (uint)aggSectorHash); } }
public void PlatformTest() { using (var resource = CommonResource.CreateDummy(WadPath.Doom2, @"data\platform_test.wad")) { var demo = new Demo(@"data\platform_test.lmp"); var players = DoomTest.GetDefaultPlayers(); var cmds = players.Select(player => player.Cmd).ToArray(); var world = new World(resource, demo.Options, players); var lastMobjHash = 0; var aggMobjHash = 0; var lastSectorHash = 0; var aggSectorHash = 0; while (true) { if (!demo.ReadCmd(cmds)) { break; } world.Update(); lastMobjHash = DoomDebug.GetMobjHash(world); aggMobjHash = DoomDebug.CombineHash(aggMobjHash, lastMobjHash); lastSectorHash = DoomDebug.GetSectorHash(world); aggSectorHash = DoomDebug.CombineHash(aggSectorHash, lastSectorHash); } Assert.AreEqual(0x3da2f507u, (uint)lastMobjHash); Assert.AreEqual(0x3402f715u, (uint)aggMobjHash); Assert.AreEqual(0xc71b4d00u, (uint)lastSectorHash); Assert.AreEqual(0x2fb8dd00u, (uint)aggSectorHash); } }
public void E1M1() { using (var content = GameContent.CreateDummy(WadPath.Doom1)) { var options = new GameOptions(); options.Skill = GameSkill.Hard; options.Episode = 1; options.Map = 1; options.Players[0].InGame = true; var cmds = Enumerable.Range(0, Player.MaxPlayerCount).Select(i => new TicCmd()).ToArray(); var game = new DoomGame(content, options); game.DeferedInitNew(); var tics = 350; var aggMobjHash = 0; var aggSectorHash = 0; for (var i = 0; i < tics; i++) { game.Update(cmds); aggMobjHash = DoomDebug.CombineHash(aggMobjHash, DoomDebug.GetMobjHash(game.World)); aggSectorHash = DoomDebug.CombineHash(aggSectorHash, DoomDebug.GetSectorHash(game.World)); } Assert.AreEqual(0x66be313bu, (uint)DoomDebug.GetMobjHash(game.World)); Assert.AreEqual(0xbd67b2b2u, (uint)aggMobjHash); Assert.AreEqual(0x2cef7a1du, (uint)DoomDebug.GetSectorHash(game.World)); Assert.AreEqual(0x5b99ca23u, (uint)aggSectorHash); } }
public void LocalDoorTest() { using (var resource = CommonResource.CreateDummy(WadPath.Doom2, @"data\localdoor_test.wad")) { var demo = new Demo(@"data\localdoor_test.lmp"); var players = DoomTest.GetDefaultPlayers(); var cmds = players.Select(player => player.Cmd).ToArray(); var world = new World(resource, demo.Options, players); var lastMobjHash = 0; var aggMobjHash = 0; var lastSectorHash = 0; var aggSectorHash = 0; while (true) { if (!demo.ReadCmd(cmds)) { break; } world.Update(); lastMobjHash = DoomDebug.GetMobjHash(world); aggMobjHash = DoomDebug.CombineHash(aggMobjHash, lastMobjHash); lastSectorHash = DoomDebug.GetSectorHash(world); aggSectorHash = DoomDebug.CombineHash(aggSectorHash, lastSectorHash); } Assert.AreEqual(0x9d6c0abeu, (uint)lastMobjHash); Assert.AreEqual(0x7e1bb5f2u, (uint)aggMobjHash); Assert.AreEqual(0xfdf3e7a0u, (uint)lastSectorHash); Assert.AreEqual(0x0a0f1980u, (uint)aggSectorHash); } }
public void PainElementalTest_Final2() { using (var resource = CommonResource.CreateDummy(WadPath.Doom2, @"data\painelemental_test.wad")) { var demo = new Demo(@"data\painelemental_test_final2.lmp"); demo.Options.GameVersion = GameVersion.Final2; var cmds = Enumerable.Range(0, Player.MaxPlayerCount).Select(i => new TicCmd()).ToArray(); var game = new DoomGame(resource, demo.Options); game.DeferedInitNew(); var lastHash = 0; var aggHash = 0; while (true) { if (!demo.ReadCmd(cmds)) { break; } game.Update(cmds); lastHash = DoomDebug.GetMobjHash(game.World); aggHash = DoomDebug.CombineHash(aggHash, lastHash); } Assert.AreEqual(0x6984f76fu, (uint)lastHash); Assert.AreEqual(0x50ba7933u, (uint)aggHash); } }
public void Doom1SharewareDemo3() { using (var resource = CommonResource.CreateDummy(WadPath.Doom1Shareware)) { var demo = new Demo(resource.Wad.ReadLump("DEMO3")); var cmds = Enumerable.Range(0, Player.MaxPlayerCount).Select(i => new TicCmd()).ToArray(); var game = new DoomGame(resource, demo.Options); game.DeferedInitNew(); var lastMobjHash = 0; var aggMobjHash = 0; var lastSectorHash = 0; var aggSectorHash = 0; while (true) { if (!demo.ReadCmd(cmds)) { break; } game.Update(cmds); lastMobjHash = DoomDebug.GetMobjHash(game.World); aggMobjHash = DoomDebug.CombineHash(aggMobjHash, lastMobjHash); lastSectorHash = DoomDebug.GetSectorHash(game.World); aggSectorHash = DoomDebug.CombineHash(aggSectorHash, lastSectorHash); } Assert.AreEqual(0x893f32d2u, (uint)lastMobjHash); Assert.AreEqual(0x22b21b86u, (uint)aggMobjHash); Assert.AreEqual(0xfef34aafu, (uint)lastSectorHash); Assert.AreEqual(0xa881ce6fu, (uint)aggSectorHash); } }
public void PlutoniaDemo1_Final2() { using (var resource = CommonResource.CreateDummy(WadPath.Plutonia)) { var demo = new Demo(resource.Wad.ReadLump("DEMO1")); var players = DoomTest.GetDefaultPlayers(); var cmds = players.Select(player => player.Cmd).ToArray(); var world = new World(resource, demo.Options, players); var lastMobjHash = 0; var aggMobjHash = 0; var lastSectorHash = 0; var aggSectorHash = 0; while (true) { if (!demo.ReadCmd(cmds)) { break; } world.Update(); lastMobjHash = DoomDebug.GetMobjHash(world); aggMobjHash = DoomDebug.CombineHash(aggMobjHash, lastMobjHash); lastSectorHash = DoomDebug.GetSectorHash(world); aggSectorHash = DoomDebug.CombineHash(aggSectorHash, lastSectorHash); } Assert.AreEqual(0x919a2c10u, (uint)lastMobjHash); Assert.AreEqual(0x50740a10u, (uint)aggMobjHash); Assert.AreEqual(0x67f448a4u, (uint)lastSectorHash); Assert.AreEqual(0x7cbaf2f8u, (uint)aggSectorHash); } }
public void Doom1Demo3() { using (var resource = CommonResource.CreateDummy(WadPath.Doom1)) { var demo = new Demo(resource.Wad.ReadLump("DEMO3")); var players = DoomTest.GetDefaultPlayers(); var cmds = players.Select(player => player.Cmd).ToArray(); var world = new World(resource, demo.Options, players); var lastMobjHash = 0; var aggMobjHash = 0; var lastSectorHash = 0; var aggSectorHash = 0; while (true) { if (!demo.ReadCmd(cmds)) { break; } world.Update(); lastMobjHash = DoomDebug.GetMobjHash(world); aggMobjHash = DoomDebug.CombineHash(aggMobjHash, lastMobjHash); lastSectorHash = DoomDebug.GetSectorHash(world); aggSectorHash = DoomDebug.CombineHash(aggSectorHash, lastSectorHash); } Assert.AreEqual(0xcdce0d85u, (uint)lastMobjHash); Assert.AreEqual(0x9e5f7780u, (uint)aggMobjHash); Assert.AreEqual(0x553d0ec9u, (uint)lastSectorHash); Assert.AreEqual(0x9991bb03u, (uint)aggSectorHash); } }
public void PlutoniaDemo2() { using (var resource = CommonResource.CreateDummy(WadPath.Plutonia)) { var demo = new Demo(resource.Wad.ReadLump("DEMO2")); var players = DoomTest.GetDefaultPlayers(); var cmds = players.Select(player => player.Cmd).ToArray(); var world = new World(resource, demo.Options, players); var lastMobjHash = 0; var aggMobjHash = 0; var lastSectorHash = 0; var aggSectorHash = 0; while (true) { if (!demo.ReadCmd(cmds)) { break; } world.Update(); world.Options.GameTic++; // To avoid desync due to revenant missile. lastMobjHash = DoomDebug.GetMobjHash(world); aggMobjHash = DoomDebug.CombineHash(aggMobjHash, lastMobjHash); lastSectorHash = DoomDebug.GetSectorHash(world); aggSectorHash = DoomDebug.CombineHash(aggSectorHash, lastSectorHash); } Assert.AreEqual(0x5d8b0a25u, (uint)lastMobjHash); Assert.AreEqual(0x780eb548u, (uint)aggMobjHash); Assert.AreEqual(0x027a2765u, (uint)lastSectorHash); Assert.AreEqual(0xdc23992bu, (uint)aggSectorHash); } }
public void Doom1Demo4() { using (var resource = CommonResource.CreateDummy(WadPath.Doom1)) { var demo = new Demo(resource.Wad.ReadLump("DEMO4")); var players = DoomTest.GetDefaultPlayers(); var cmds = players.Select(player => player.Cmd).ToArray(); var world = new World(resource, demo.Options, players); var lastMobjHash = 0; var aggMobjHash = 0; var lastSectorHash = 0; var aggSectorHash = 0; while (true) { if (!demo.ReadCmd(cmds)) { break; } world.Update(); lastMobjHash = DoomDebug.GetMobjHash(world); aggMobjHash = DoomDebug.CombineHash(aggMobjHash, lastMobjHash); lastSectorHash = DoomDebug.GetSectorHash(world); aggSectorHash = DoomDebug.CombineHash(aggSectorHash, lastSectorHash); } Assert.AreEqual(0x89d50ff6u, (uint)lastMobjHash); Assert.AreEqual(0xb1a634c8u, (uint)aggMobjHash); Assert.AreEqual(0x8a94e89au, (uint)lastSectorHash); Assert.AreEqual(0x2e1bf98du, (uint)aggSectorHash); } }
public void Doom1SharewareDemo3() { using (var resource = CommonResource.CreateDummy(WadPath.Doom1Shareware)) { var demo = new Demo(resource.Wad.ReadLump("DEMO3")); var players = DoomTest.GetDefaultPlayers(); var cmds = players.Select(player => player.Cmd).ToArray(); var world = new World(resource, demo.Options, players); var lastMobjHash = 0; var aggMobjHash = 0; var lastSectorHash = 0; var aggSectorHash = 0; while (true) { if (!demo.ReadCmd(cmds)) { break; } world.Update(); lastMobjHash = DoomDebug.GetMobjHash(world); aggMobjHash = DoomDebug.CombineHash(aggMobjHash, lastMobjHash); lastSectorHash = DoomDebug.GetSectorHash(world); aggSectorHash = DoomDebug.CombineHash(aggSectorHash, lastSectorHash); } Assert.AreEqual(0x893f32d2u, (uint)lastMobjHash); Assert.AreEqual(0x22b21b86u, (uint)aggMobjHash); Assert.AreEqual(0xfef34aafu, (uint)lastSectorHash); Assert.AreEqual(0xa881ce6fu, (uint)aggSectorHash); } }
public void Doom2Demo1() { using (var resource = CommonResource.CreateDummy(WadPath.Doom2)) { var demo = new Demo(resource.Wad.ReadLump("DEMO1")); var players = DoomTest.GetDefaultPlayers(); var cmds = players.Select(player => player.Cmd).ToArray(); var world = new World(resource, demo.Options, players); var lastMobjHash = 0; var aggMobjHash = 0; var lastSectorHash = 0; var aggSectorHash = 0; while (true) { if (!demo.ReadCmd(cmds)) { break; } world.Update(); lastMobjHash = DoomDebug.GetMobjHash(world); aggMobjHash = DoomDebug.CombineHash(aggMobjHash, lastMobjHash); lastSectorHash = DoomDebug.GetSectorHash(world); aggSectorHash = DoomDebug.CombineHash(aggSectorHash, lastSectorHash); } Assert.AreEqual(0x8541f2acu, (uint)lastMobjHash); Assert.AreEqual(0xe60b0af3u, (uint)aggMobjHash); Assert.AreEqual(0x3376327bu, (uint)lastSectorHash); Assert.AreEqual(0x4140c1c2u, (uint)aggSectorHash); } }
public void ChainsawTest() { using (var resource = CommonResource.CreateDummy(WadPath.Doom2, @"data\chainsaw_test.wad")) { var demo = new Demo(@"data\chainsaw_test.lmp"); var cmds = Enumerable.Range(0, Player.MaxPlayerCount).Select(i => new TicCmd()).ToArray(); var game = new DoomGame(resource, demo.Options); game.DeferedInitNew(); var lastHash = 0; var aggHash = 0; while (true) { if (!demo.ReadCmd(cmds)) { break; } game.Update(cmds); lastHash = DoomDebug.GetMobjHash(game.World); aggHash = DoomDebug.CombineHash(aggHash, lastHash); } Assert.AreEqual(0x5db30e69u, (uint)lastHash); Assert.AreEqual(0xed598949u, (uint)aggHash); } }
public void PlutoniaDemo2() { using (var resource = CommonResource.CreateDummy(WadPath.Plutonia)) { var demo = new Demo(resource.Wad.ReadLump("DEMO2")); var cmds = Enumerable.Range(0, Player.MaxPlayerCount).Select(i => new TicCmd()).ToArray(); var game = new DoomGame(resource, demo.Options); game.DeferedInitNew(); var lastMobjHash = 0; var aggMobjHash = 0; var lastSectorHash = 0; var aggSectorHash = 0; while (true) { if (!demo.ReadCmd(cmds)) { break; } game.Update(cmds); lastMobjHash = DoomDebug.GetMobjHash(game.World); aggMobjHash = DoomDebug.CombineHash(aggMobjHash, lastMobjHash); lastSectorHash = DoomDebug.GetSectorHash(game.World); aggSectorHash = DoomDebug.CombineHash(aggSectorHash, lastSectorHash); } Assert.AreEqual(0x5d8b0a25u, (uint)lastMobjHash); Assert.AreEqual(0x780eb548u, (uint)aggMobjHash); Assert.AreEqual(0x027a2765u, (uint)lastSectorHash); Assert.AreEqual(0xdc23992bu, (uint)aggSectorHash); } }