Beispiel #1
0
        private void RunNextExperiment()
        {
            var experimentFile = AllFiles().FirstOrDefault(name => !IsDone(name));

            if (experimentFile == null)
            {
                MessageBox.Show($"Experiment je hotovy, dekujeme za ucast");
                return;
            }

            var game = MapEditorScene.LoadEvolutionSaveFile(experimentFile);

            var arena = new ArenaScene(_gameManager, game);

            arena.GameFinishedCallback = () => {
                MarkDone(experimentFile);
                MessageBox.Show(
                    "Konec hry, prosím vyplňte automaticky otevřený dotazník a poté restartujte hru pro pokračování.");
                var url =
                    $"https://docs.google.com/forms/d/e/1FAIpQLSeSebCnhzSgrgoaNBf5xaJLegkT-Oir0t2RTHBj3ektaOYZJQ/viewform?usp=pp_url&entry.627128578&entry.1173552081={experimentFile}";
                System.Diagnostics.Process.Start(url);
            };

            game.AssignAiControllers(new PlayerController(arena, game),
                                     new MctsController(game, 1000));

            LoadNewScene(arena);
        }
Beispiel #2
0
        public void LoadEvolutionSave(int index)
        {
            var game = LoadEvolutionSaveFile(Constants.BuildEvoSavePath(1));

            var arenaScene = new ArenaScene(_gameManager, game);

            game.MobManager.Teams[TeamColor.Red]  = new PlayerController(arenaScene, game);
            game.MobManager.Teams[TeamColor.Blue] = new MctsController(game, 1000);

            LoadNewScene(arenaScene);
        }
Beispiel #3
0
        private void DoContinue()
        {
            if (_game == null)
            {
                Utils.Log(LogSeverity.Warning, nameof(TeamSelectionScene),
                          "Failed to start a game, no controllers selected.");
                return;
            }

            if (_teamSize > Math.Min(_game.Map.RedStartingPoints.Count, _game.Map.BlueStartingPoints.Count))
            {
                Utils.Log(LogSeverity.Error, nameof(TeamSelectionScene),
                          "Not enough starting positions, decrease team size or add them in the map editor (Ctrl-R).");
                return;
            }

            if (_leftController != null && _rightController != null)
            {
                var arena = new ArenaScene(_gameManager, _game);

                const TeamColor t1 = TeamColor.Red;
                const TeamColor t2 = TeamColor.Blue;

                _game.MobManager.Teams[t1] = _leftController.Item2(_game, arena);
                _game.MobManager.Teams[t2] = _rightController.Item2(_game, arena);

                _game.PrepareEverything();

                LoadNewScene(arena);
            }
            else
            {
                Utils.Log(LogSeverity.Warning, nameof(TeamSelectionScene),
                          "Failed to start a game, no controllers selected.");
            }
        }