Beispiel #1
0
        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);
            }
        }
Beispiel #2
0
        public void E1M8Boss()
        {
            using (var resource = CommonResource.CreateDummy(WadPath.Doom1))
            {
                var demo = new Demo(@"demos\e1m8_boss_test.lmp");
                demo.Options.GameMode = resource.Wad.GameMode;
                var players = DoomTest.GetDefaultPlayers(demo.Options);
                var cmds    = Enumerable.Range(0, Player.MaxPlayerCount).Select(i => new TicCmd()).ToArray();
                var game    = new DoomGame(players, resource, demo.Options);

                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(0xb01c44f9u, (uint)lastMobjHash);
                Assert.AreEqual(0x1a4918bbu, (uint)aggMobjHash);
                Assert.AreEqual(0xa7bac3ceu, (uint)lastSectorHash);
                Assert.AreEqual(0xda0067d0u, (uint)aggSectorHash);
            }
        }
Beispiel #3
0
        public void Map07Boss()
        {
            using (var resource = CommonResource.CreateDummy(WadPath.Doom2))
            {
                var demo    = new Demo(@"demos\map07_boss_test.lmp");
                var players = DoomTest.GetDefaultPlayers(demo.Options);
                var cmds    = Enumerable.Range(0, Player.MaxPlayerCount).Select(i => new TicCmd()).ToArray();
                var game    = new DoomGame(players, resource, demo.Options);

                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(0x4c4e952fu, (uint)lastMobjHash);
                Assert.AreEqual(0x56d1d836u, (uint)aggMobjHash);
                Assert.AreEqual(0x44469690u, (uint)lastSectorHash);
                Assert.AreEqual(0x1b989de0u, (uint)aggSectorHash);
            }
        }
Beispiel #4
0
        public void SilentCrusherTest()
        {
            using (var content = GameContent.CreateDummy(WadPath.Doom2, @"data\silent_crusher_test.wad"))
            {
                var demo = new Demo(@"data\silent_crusher_test.lmp");
                var cmds = Enumerable.Range(0, Player.MaxPlayerCount).Select(i => new TicCmd()).ToArray();
                var game = new DoomGame(content, 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(0xee31a164u, (uint)lastMobjHash);
                Assert.AreEqual(0x1f3fc7b4u, (uint)aggMobjHash);
                Assert.AreEqual(0x6d6a1f20u, (uint)lastSectorHash);
                Assert.AreEqual(0x34b4f740u, (uint)aggSectorHash);
            }
        }
Beispiel #5
0
        public void LocalDoorTest()
        {
            using (var resource = CommonResource.CreateDummy(WadPath.Doom2, @"data\localdoor_test.wad"))
            {
                var demo = new Demo(@"data\localdoor_test.lmp");
                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(0x9d6c0abeu, (uint)lastMobjHash);
                Assert.AreEqual(0x7e1bb5f2u, (uint)aggMobjHash);
                Assert.AreEqual(0xfdf3e7a0u, (uint)lastSectorHash);
                Assert.AreEqual(0x0a0f1980u, (uint)aggSectorHash);
            }
        }
Beispiel #6
0
        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);
            }
        }
Beispiel #7
0
        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);
            }
        }
Beispiel #8
0
        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);
            }
        }
Beispiel #9
0
        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);
            }
        }
Beispiel #10
0
        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);
            }
        }
Beispiel #11
0
        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);
            }
        }
Beispiel #12
0
        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);
            }
        }
Beispiel #13
0
        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);
            }
        }
Beispiel #14
0
        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);
            }
        }
Beispiel #15
0
        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);
            }
        }
Beispiel #16
0
        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);
            }
        }
Beispiel #17
0
        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);
            }
        }
Beispiel #18
0
        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);
            }
        }
Beispiel #19
0
        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);
            }
        }
Beispiel #20
0
        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);
            }
        }
Beispiel #21
0
        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);
            }
        }
Beispiel #22
0
        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);
            }
        }
Beispiel #23
0
        public void Altdeath()
        {
            using (var content = GameContent.CreateDummy(WadPath.Doom2))
            {
                var demo = new Demo(@"data\altdeath_test.lmp");
                var cmds = Enumerable.Range(0, Player.MaxPlayerCount).Select(i => new TicCmd()).ToArray();
                var game = new DoomGame(content, demo.Options);
                game.DeferedInitNew();

                var lastMobjHash = 0;
                var aggMobjHash  = 0;

                while (true)
                {
                    if (!demo.ReadCmd(cmds))
                    {
                        break;
                    }

                    game.Update(cmds);
                    lastMobjHash = DoomDebug.GetMobjHash(game.World);
                    aggMobjHash  = DoomDebug.CombineHash(aggMobjHash, lastMobjHash);
                }

                Assert.AreEqual(0xf598b1d9u, (uint)lastMobjHash);
                Assert.AreEqual(0x9f716cfau, (uint)aggMobjHash);
            }
        }
Beispiel #24
0
        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);
            }
        }
Beispiel #25
0
        public void PlatformTest()
        {
            using (var resource = CommonResource.CreateDummy(WadPath.Doom2, @"data\platform_test.wad"))
            {
                var demo = new Demo(@"data\platform_test.lmp");
                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(0x3da2f507u, (uint)lastMobjHash);
                Assert.AreEqual(0x3402f715u, (uint)aggMobjHash);
                Assert.AreEqual(0xc71b4d00u, (uint)lastSectorHash);
                Assert.AreEqual(0x2fb8dd00u, (uint)aggSectorHash);
            }
        }
Beispiel #26
0
        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);
            }
        }
Beispiel #27
0
        public void Map06Crusher()
        {
            using (var resource = CommonResource.CreateDummy(WadPath.Doom2))
            {
                var demo    = new Demo(@"demos\map06_crusher_test.lmp");
                var players = DoomTest.GetDefaultPlayers(demo.Options);
                var cmds    = Enumerable.Range(0, Player.MaxPlayerCount).Select(i => new TicCmd()).ToArray();
                var game    = new DoomGame(players, resource, demo.Options);

                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(0x302bc4e3u, (uint)lastMobjHash);
                Assert.AreEqual(0xe4050462u, (uint)aggMobjHash);
                Assert.AreEqual(0x3ce914d8u, (uint)lastSectorHash);
                Assert.AreEqual(0x549ea480u, (uint)aggSectorHash);
            }
        }
Beispiel #28
0
        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);
            }
        }
Beispiel #29
0
        public void ShotgunTest()
        {
            using (var content = GameContent.CreateDummy(WadPath.Doom2, @"data\shotgun_test.wad"))
            {
                var demo = new Demo(@"data\shotgun_test.lmp");
                var cmds = Enumerable.Range(0, Player.MaxPlayerCount).Select(i => new TicCmd()).ToArray();
                var game = new DoomGame(content, 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(0x3dd50799u, (uint)lastHash);
                Assert.AreEqual(0x4ddd814fu, (uint)aggHash);
            }
        }
Beispiel #30
0
        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);
            }
        }