Page 1 of 1

About bots in Master

PostPosted: 24 May 2018, 09:59
by Prot
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?

Re: About bots in Master

PostPosted: 24 May 2018, 12:20
by Prot
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.

Re: About bots in Master

PostPosted: 24 May 2018, 17:12
by pastdue
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"
   }
}

Re: About bots in Master

PostPosted: 29 May 2018, 13:41
by Prot
I open bugreport, and record the video where describe in detail the problem.
http://developer.wz2100.net/ticket/4791

Re: About bots in Master

PostPosted: 29 May 2018, 17:30
by Berserk Cyborg
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.

Re: About bots in Master

PostPosted: 29 May 2018, 17:39
by pastdue
@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.

Re: About bots in Master

PostPosted: 07 Jul 2018, 16:18
by MIH-XTC
Prot wrote:Also i notices thats autogame now is not working

Because of that, i cannot run AI Tournament on master, and hard to test bots.



This is why I stopped developing AI/stats. When default AI was switched to Nullbot sometime around January autogame stopped working meaning we can't easily run balanced simulations any more. That's how all the stat testing was performed.

Autogame is specific to Nexus (I think). It's at the bottom of Nexus.slo

Re: About bots in Master

PostPosted: 07 Jul 2018, 20:49
by WZ2100ModsFAn
MIH-XTC wrote:
Prot wrote:Also i notices thats autogame now is not working

Because of that, i cannot run AI Tournament on master, and hard to test bots.



This is why I stopped developing AI/stats. When default AI was switched to Nullbot sometime around January autogame stopped working meaning we can't easily run balanced simulations any more. That's how all the stat testing was performed.

Autogame is specific to Nexus (I think). It's at the bottom of Nexus.slo

Nexus is going to be converted now

viewtopic.php?f=35&t=14372

are they going to keep the auto game cheat code in the ai's javascript?