About bots in Master

Discuss the future of Warzone 2100 with us.

About bots in Master

Postby Prot » 24 May 2018, 09:59

After a long period I decided to test the last master and I had some comments about bots.

First, I noticed that by default, a bot in alphabetical order is connected to the created game instead of Nexus.
Secondly, it was a bad idea to make the icons of the difficulty level same looks like.

Here look, who will be able to quickly understand what bot at what level of difficulty?
wz_bots.png


And at last, i not enable any debug, but i have some trash output in console, it's looks like output tooltips under the mouse pointer.:
Code: Select all
Играет красиво
Starts disadvantaged
Играет красиво
Нажмите, чтобы изменить ИИ
Нажмите, чтобы изменить ИИ
Нажмите, чтобы изменить ИИ
Нажмите, чтобы изменить сложность
Нажмите, чтобы изменить сложность
Нажмите, чтобы изменить сложность
Начать с преимуществом
Нет запрещённых приёмов
Играет красиво
Нажмите, чтобы изменить ИИ
Нажмите, чтобы изменить ИИ
Нажмите, чтобы изменить ИИ
Нажмите, чтобы изменить сложность
Нажмите, чтобы изменить сложность


Should I create bug reports for each item?
User avatar
Prot
Trained
Trained
 
Posts: 145
Joined: 29 Nov 2010, 12:41

Re: About bots in Master

Postby Prot » 24 May 2018, 12:20

Also i notices thats autogame now is not working, for example, i move my tests/configs from 3.2.3 and run in master, and they don't work as i planned:
Code: Select all
$ cat .local/share/warzone2100-master/tests/metacity.json
{
    "challenge": {
        "bases": 1,
        "difficulty": "Normal",
        "map": "Metacity-T1",
        "maxPlayers": 4,
        "powerLevel": 3,
        "scavengers": "false",
        "version": 2,
        "alliances": 2
    },
    "player_0": {
      "position": 1,
        "team": 0,
      "ai": "multiplay/skirmish/blank.js"
    },
    "player_1": {
      "position": 0,
        "team": 0,
        "difficulty": "Hard",
      "ai": "multiplay/skirmish/bc-master/auto_green.js"
    },
    "player_2": {
      "position": 5,
        "team": 1,
        "difficulty": "Hard",
      "ai": "multiplay/skirmish/nb_generic.js"
    },
    "player_3": {
      "position": 6,
        "team": 1,
        "difficulty": "Hard",
      "ai": "multiplay/skirmish/semperfi.js"
    }
}


It supposed to be fight between BoneCrusher vs Nullbot and SemperFi-js, and it works in 3.2.3, but in master i got on position 5 and 6 - BoneCrushers-master.
I think this is affected what I described in the first. Bot priority in some alphabetical order only.

Because of that, i cannot run AI Tournament on master, and hard to test bots.
User avatar
Prot
Trained
Trained
 
Posts: 145
Joined: 29 Nov 2010, 12:41

Re: About bots in Master

Postby pastdue » 24 May 2018, 17:12

The errant tooltip debug output should be fixed with: 10101fc19838e67a5d7b8e82a3437df1752fe582

There does appear to be something odd about the autogame functionality - please file a bug report on that one.

EDIT: What's blank.js?

EDIT[2]: Actually, I partially take back what I said above. If I use a different test JSON (as I don't have the Metacity map), autogame seems to work:
Code: Select all
{
   "challenge": {
      "bases": 1,
      "difficulty": "Normal",
      "map": "Sk-Rush",
      "maxPlayers": 4,
      "powerLevel": 3,
      "scavengers": "false",
      "version": 2,
      "alliances": 2
   },
   "player_0": {
      "position": 1,
      "team": 0,
      "difficulty": "Hard",
      "ai": "multiplay/skirmish/semperfi.js"
   },
   "player_1": {
      "position": 0,
      "team": 0,
      "difficulty": "Hard",
      "ai": "multiplay/skirmish/nb_turtle.js"
   },
   "player_2": {
      "position": 2,
      "team": 1,
      "difficulty": "Hard",
      "ai": "multiplay/skirmish/nb_generic.js"
   },
   "player_3": {
      "position": 3,
      "team": 1,
      "difficulty": "Hard",
      "ai": "multiplay/skirmish/semperfi.js"
   }
}
pastdue
Code contributor
Code contributor
 
Posts: 83
Joined: 13 Aug 2017, 17:44

Re: About bots in Master

Postby Prot » 29 May 2018, 13:41

I open bugreport, and record the video where describe in detail the problem.
http://developer.wz2100.net/ticket/4791
User avatar
Prot
Trained
Trained
 
Posts: 145
Joined: 29 Nov 2010, 12:41

Re: About bots in Master

Postby Berserk Cyborg » 29 May 2018, 17:30

I think something else is happening. In my opinion, the AI names are being incorrectly set, however, the scripts are still the bot you specified in the .json test files. I used the json test file you had above on the Metacity map and came to this conclusion because player 6 only uses rockets and spams twin-MG and builds the HMG tower like crazy around oil it just captured before it reseaches rocket technology. Of which is signature Semperfi-js behavior.

Similarily, I did an autogame on the map Startup with Cobra vs Nullbot and Nullbot was incorrectly named "Cobra". Still, I can spot the difference in style between Nullbot and Cobra quite easily. Also, by switching into the suspected Nullbot player via the debug menu, we can enter "!nb who" and it will output personality information if it is indeed a Nullbot.

pastdue wrote:What's blank.js?
Probably an empty JS script to simulate a spectator or closed player slot.
User avatar
Berserk Cyborg
Code contributor
Code contributor
 
Posts: 554
Joined: 26 Sep 2016, 19:56

Re: About bots in Master

Postby pastdue » 29 May 2018, 17:39

@Prot: Can you reproduce this with the JSON test file I posted above? (I can't.)

Scratch that. I can reproduce the bot player name not matching what's expected.
But the actual script is the desired bot. (I was checking the script contexts, not the Players tab.)

Here's the issue:
- hostCampaign calls getAIName to set the player name based on the AI name
- getAIName uses NetPlay.players[player].ai to query the AI name
- But when this happens, NetPlay.players[player].ai is default-initialized to 0 (as there's a different loading path being used later for loading autogame scripts).

This probably needs to be cleaned up so we can properly set the player name based on the bot. (I'm not sure why the unique loading path is being used for scripts in autogames vs regular UI-set matches.)
The right bot script is being loaded - it's just that the player display name isn't being properly set.
pastdue
Code contributor
Code contributor
 
Posts: 83
Joined: 13 Aug 2017, 17:44


Return to Development