Technical Machine: A Pokemon bot

Discussion in 'Past-Gen Discussion' started by david stone, Oct 2, 2011.

  1. Chou Toshio

    Chou Toshio @Fighting Necktie
    is a Forum Moderatoris a Community Contributoris an Artist Alumnusis a Smogon Media Contributor Alumnusis a Contributor Alumnusis a Battle Server Moderator Alumnus
    Moderator

    Joined:
    Aug 16, 2007
    Messages:
    7,907
    dang, all the old replays are down :(
  2. david stone

    david stone Fast-moving, smart, sexy and alarming.
    is a Site Staff Alumnusis a Smogon IRC AOp Alumnusis a Programmer Alumnusis a Super Moderator Alumnusis a Researcher Alumnusis a Contributor Alumnusis a Battle Server Moderator Alumnus

    Joined:
    Aug 3, 2005
    Messages:
    5,150
    I've made some pretty extensive advancements to Technical Machine's performance. It is now able to search 4 turns ahead, averaging about 10 seconds per turn (down from it taking 20 minutes). Now searching 5 turns ahead is feasible, as it takes about 10 minutes. I have several more optimizations that I could add, but Technical Machine has finally reached the point where memory access is not the bottleneck.

    Previously, what slowed TM down the most was simply accessing memory. I've spent a lot of time optimizing my data structures to minimize this cost, and now it hardly shows up in my profiling. The majority of the time now is spent on evaluating positions, which will likely prove harder to optimize. However, some of the optimizations I have planned involve limiting the amount of positions that I have to evaluate at all, so those types of optimizations will always be general-purpose speed up that will work regardless of which part of the routine is slow.

    Now that 5 turns is in reach (which was my original goal), this is what I plan to do going forward:

    1) Add support for Pokemon Showdown. This step should be fairly straightforward. I already have the basis for new simulators in Technical Machine, and I have an idea for how I will implement this.

    2) Add full support for generation 5. Technical Machine right now could probably engage in generation 5 battles, but just wouldn't be as good at them. I still have a few mechanics I need to add in. Mostly, though, I need to improve my ability to take in new types of statistics. This part of the code is almost done, and once it is, Technical Machine will support any metagame that we have usage statistics for. It will also be easily to incorporate other formats of data other than what Antar puts out right now.

    3) Have Technical Machine fine tune its own evaluation constants. Right now, it's using a very rough approximation that I put together years ago. I only tuned it once to slightly reduce the value of Stealth Rock, which lead to a dramatic improvement in Technical Machine's ability to evaluate. I know there is still much room for improvement here, but I also know that not I or any other human is capable of tuning them to the degree that Technical Machine is. Therefore, I will be adding an evolutionary algorithm that will automatically change those constants as Technical Machine battles, making it get smarter the more it plays.

    4) ???

    5) Skynet

    Some other ideas that I have, but I don't know when I will implement them, involving automatic logging of battles. Technical Machine currently doesn't log anything. I hope to automatically save TM's logs and possibly upload them to my site for evaluation. I am not sure yet how anonymized I will make the logs.
  3. Arcticblast

    Arcticblast improsin + bapongbas gg,,,,,,
    is a Forum Moderatoris a Community Contributoris a Tiering Contributoris a Battle Server Moderator Alumnusis a SPL Winner
    Other Metas Leader

    Joined:
    Nov 29, 2008
    Messages:
    4,713
    lol

    Battle logging actually sounds like a pretty good idea. Being able to look at battles that Technical Machine has been in would not only help you fix bugs / fine tune prediction, but could also provide the opponent with a battle log with which they can evaluate their performance.

    As for anonymity, usernames (sans TM) and chat messages could be removed, although that sort of conflicts with my second point about logging.
  4. Baka Ki Eru Dogura

    Baka Ki Eru Dogura

    Joined:
    Sep 23, 2012
    Messages:
    53
    sounds cool, but
    how can i battle Technical Machine?
  5. david stone

    david stone Fast-moving, smart, sexy and alarming.
    is a Site Staff Alumnusis a Smogon IRC AOp Alumnusis a Programmer Alumnusis a Super Moderator Alumnusis a Researcher Alumnusis a Contributor Alumnusis a Battle Server Moderator Alumnus

    Joined:
    Aug 3, 2005
    Messages:
    5,150
    You'd have to compile Technical Machine right now; there are no pre-built binaries at this point. Technical Machine also only runs on Pokemon Online version 1, and I don't know if anyone is running any servers that old.

    I am, however, currently working on Pokemon Showdown support.
  6. WinstonShnozwick

    WinstonShnozwick

    Joined:
    Jul 13, 2011
    Messages:
    486
    I still use pokemon online, will Technical machine be able to be used on it when it is finished? I'd much rather prefer doing ai battles (single player) without having to require an internet connection (for something like showdown)
  7. Umbreon Dan

    Umbreon Dan 〉λ=
    is a CAP Contributor Alumnus

    Joined:
    Oct 19, 2008
    Messages:
    3,199
    there's no reason you couldn't run a pokemon showdown! server on your local machine, with or without an internet connection.
  8. Zenigata

    Zenigata

    Joined:
    Sep 5, 2013
    Messages:
    2
    Two questions: What exactly is necessary to implement data for pokemon from generation 6 and beyond? Does the AI need to be tweaked or is it just required that one adds new pokemon?

    Secondly, is there any way to contact you, David Stone? I have some questions to ask in private.
  9. david stone

    david stone Fast-moving, smart, sexy and alarming.
    is a Site Staff Alumnusis a Smogon IRC AOp Alumnusis a Programmer Alumnusis a Super Moderator Alumnusis a Researcher Alumnusis a Contributor Alumnusis a Battle Server Moderator Alumnus

    Joined:
    Aug 3, 2005
    Messages:
    5,150
    I almost have Pokemon Showdown working. Technical Machine can log into a server and I can watch the chat. I just have to add a library that gives it the ability to make an HTTP POST request to authenticate. The next step after that is finishing up my "other generation" support. Most of it is not too much work, and a lot of it is already done.

    You can always just send me a private message on here.
    Houndoomsday likes this.
  10. Silone

    Silone

    Joined:
    Oct 3, 2013
    Messages:
    1
    Hi I just joined and wondering Can you update it so we can use it on PO v.2? I was thinking it can be a client script but Ill just try to use yours instead of making my own
  11. MagikaripIsOP

    MagikaripIsOP

    Joined:
    Jul 22, 2013
    Messages:
    172
    This is great

Users Viewing Thread (Users: 0, Guests: 0)