示例#1
0
        public void MementoMoriDemo3()
        {
            using (var resource = CommonResource.CreateDummy(WadPath.Doom2, WadPath.MementoMori))
            {
                var demo    = new Demo(resource.Wad.ReadLump("DEMO3"));
                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(0x2c3bf1e3u, (uint)lastMobjHash);
                Assert.AreEqual(0x40d3fc5cu, (uint)aggMobjHash);
                Assert.AreEqual(0xdc871ca2u, (uint)lastSectorHash);
                Assert.AreEqual(0x388e5e4fu, (uint)aggSectorHash);
            }
        }
示例#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);
            }
        }
示例#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);
            }
        }
示例#4
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);
            }
        }
示例#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);
            }
        }
示例#6
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);
            }
        }
示例#7
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);
            }
        }
示例#8
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);
            }
        }
示例#9
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);
            }
        }
示例#10
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);
            }
        }
示例#11
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);
            }
        }
示例#12
0
        public void TntDemo3()
        {
            using (var resource = CommonResource.CreateDummy(WadPath.Tnt))
            {
                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(0xb289efaeu, (uint)lastMobjHash);
                Assert.AreEqual(0x08d04ef6u, (uint)aggMobjHash);
                Assert.AreEqual(0x8ab75d90u, (uint)lastSectorHash);
                Assert.AreEqual(0x08d5fbb0u, (uint)aggSectorHash);
            }
        }
示例#13
0
        public void Doom2Demo2()
        {
            using (var resource = CommonResource.CreateDummy(WadPath.Doom2))
            {
                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(0x45384a05u, (uint)lastMobjHash);
                Assert.AreEqual(0xde6d3531u, (uint)aggMobjHash);
                Assert.AreEqual(0x49c96600u, (uint)lastSectorHash);
                Assert.AreEqual(0x82f0e2d0u, (uint)aggSectorHash);
            }
        }
示例#14
0
        public void Doom1Demo4()
        {
            using (var resource = CommonResource.CreateDummy(WadPath.Doom1))
            {
                var demo = new Demo(resource.Wad.ReadLump("DEMO4"));
                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(0x89d50ff6u, (uint)lastMobjHash);
                Assert.AreEqual(0xb1a634c8u, (uint)aggMobjHash);
                Assert.AreEqual(0x8a94e89au, (uint)lastSectorHash);
                Assert.AreEqual(0x2e1bf98du, (uint)aggSectorHash);
            }
        }
示例#15
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);
            }
        }
示例#16
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);
            }
        }
示例#17
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);
            }
        }
示例#18
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);
            }
        }
示例#19
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);
            }
        }
示例#20
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);
            }
        }
示例#21
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);
            }
        }
示例#22
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);
            }
        }
示例#23
0
        public void ShotgunTest()
        {
            using (var resource = CommonResource.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(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(0x3dd50799u, (uint)lastHash);
                Assert.AreEqual(0x4ddd814fu, (uint)aggHash);
            }
        }
示例#24
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);
            }
        }
示例#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);
            }
        }
示例#26
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);
            }
        }
示例#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);
            }
        }
示例#28
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);
            }
        }
示例#29
0
        public void Doom2()
        {
            using (var resource = CommonResource.CreateDummy(WadPath.Doom2))
            {
                {
                    var demo = new Demo(resource.Wad.ReadLump("DEMO1"));
                    Assert.AreEqual(11, demo.Options.Map);
                    Assert.AreEqual(0, demo.Options.ConsolePlayer);
                    Assert.AreEqual(true, demo.Options.PlayerInGame[0]);
                    Assert.AreEqual(false, demo.Options.PlayerInGame[1]);
                    Assert.AreEqual(false, demo.Options.PlayerInGame[2]);
                    Assert.AreEqual(false, demo.Options.PlayerInGame[3]);
                }

                {
                    var demo = new Demo(resource.Wad.ReadLump("DEMO2"));
                    Assert.AreEqual(5, demo.Options.Map);
                    Assert.AreEqual(0, demo.Options.ConsolePlayer);
                    Assert.AreEqual(true, demo.Options.PlayerInGame[0]);
                    Assert.AreEqual(false, demo.Options.PlayerInGame[1]);
                    Assert.AreEqual(false, demo.Options.PlayerInGame[2]);
                    Assert.AreEqual(false, demo.Options.PlayerInGame[3]);
                }

                {
                    var demo = new Demo(resource.Wad.ReadLump("DEMO3"));
                    Assert.AreEqual(26, demo.Options.Map);
                    Assert.AreEqual(0, demo.Options.ConsolePlayer);
                    Assert.AreEqual(true, demo.Options.PlayerInGame[0]);
                    Assert.AreEqual(false, demo.Options.PlayerInGame[1]);
                    Assert.AreEqual(false, demo.Options.PlayerInGame[2]);
                    Assert.AreEqual(false, demo.Options.PlayerInGame[3]);
                }
            }
        }
示例#30
0
        public void TntBloodDemo3()
        {
            using (var resource = CommonResource.CreateDummy(WadPath.Doom2, WadPath.TntBlood))
            {
                var demo    = new Demo(resource.Wad.ReadLump("DEMO3"));
                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(0x9d24c7d8u, (uint)lastMobjHash);
                Assert.AreEqual(0xd37240f4u, (uint)aggMobjHash);
                Assert.AreEqual(0xf3f4db97u, (uint)lastSectorHash);
                Assert.AreEqual(0xa0acc43eu, (uint)aggSectorHash);
            }
        }