1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Guest, PO has ceased our separate tiering and adopted Smogon tiers for SM. More information and updates here.

    Dismiss Notice

Simulating Matches Offline

Discussion in 'Development General' started by GamesfreakSA, Nov 26, 2015.

  1. GamesfreakSA

    GamesfreakSA New Member

    Joined:
    Nov 26, 2015
    Messages:
    2
    Likes Received:
    1
    Hello,

    I want to simulate matches offline using randomly generated Pokémon and movesets for the purpose of training an AI and collecting data. I decided to use Pokémon Online's source code so I don't have to personally implement all of the moves, items, and Pokémon. I've been poking through the source code and am having trouble finding where the actual battle logic is located - a lot of it seems to be tied very closely to qt. The code should be commented a bit better, in my opinion. Is there a command line client?
     
    Last edited: Nov 26, 2015
    Pumone likes this.
  2. wfe

    wfe The Anima Is Watching...

    Joined:
    Nov 24, 2015
    Messages:
    9
    Likes Received:
    1
    PO Trainer Name:
    wfe
    I don't think there is a command line client or it would've been released with PO for developers. Also if you want an AI battle to collect data then use the battlescripts plugin on the client itself. As for offline Simulation, I don't think that's possible.
     
  3. GamesfreakSA

    GamesfreakSA New Member

    Joined:
    Nov 26, 2015
    Messages:
    2
    Likes Received:
    1
    Hm, okay. Is it possible to use client side scripting, along with two clients open, to have them repeatedly generate new teams and then battle eachother?
     
  4. Nightfall Alicorn

    Nightfall Alicorn Left Pokémon Online, most likely not coming back.

    Joined:
    Oct 15, 2013
    Messages:
    491
    Likes Received:
    171
    PO Trainer Name:
    Nightmare Moon
    You can battle offline against an AI.
    - Run server.exe in the folder PO is installed.
    - Open PO client and connect to "localhost".
    - Open another tab and connect to "localhost" with different name.
    - Make some battle script with intelligence and insert it in plugins.
    - Have save logs enabled when battle starts.

    Personally, making an AI is very difficult since depending what moves and conditions occur, you would need to write every condition so the AI knows how to respond each situation unique situation.
     
  5. wfe

    wfe The Anima Is Watching...

    Joined:
    Nov 24, 2015
    Messages:
    9
    Likes Received:
    1
    PO Trainer Name:
    wfe
    That would work but what if he meant for if his PC was offline?
     
  6. Fuzzysqurl

    Fuzzysqurl baa baa mareep I do what I want Server Owner Developer I do what I want Server Owner Developer

    Joined:
    Sep 12, 2012
    Messages:
    2,096
    Likes Received:
    967
    This question makes no sense when combined with the solution Nightfall posted earlier.
    ~~~~

    As far as battle logic, you've got some key files that involve most of it. battle.cpp controls most of the battle, while items/moves/berries/abilities.cpp control specific mechanics. Not entirely sure what you need specifically though. If you want random pokemon/moves you can enable Challenge Cup and it will do it.

    You could also look around and try to find the "Shanai" project. It used like 17 different pokemon, one of each type, and only allowed certain moves/abilities. This was to be used to train an AI to look for super effective moves or something. The project was abandoned years ago though.
     
  7. Pumone

    Pumone Member

    Joined:
    Aug 30, 2015
    Messages:
    61
    Likes Received:
    13
    I really like the idea of battling against an AI bot...actually I love playing with 2 windows open against myself, obviously this has no predictions, but it's funny to see how battles end =)

    I created type based teams to use like "bosses" and I fight them with my personal team.

    I start with a low level pokemon and every battle gives me levels up or something like that. This game would beat every other simulator if had AI battles.
     
  8. Pumone

    Pumone Member

    Joined:
    Aug 30, 2015
    Messages:
    61
    Likes Received:
    13