Most Up To Date Pokémon Simulator

Pokémon Online is the most popular, accurate, and complete Pokémon battle simulator out there. Open source, it's currently available in 11 languages, on your computer or your Android device. It hosts more than a million battles per month. Download the latest version and enjoy competitive battles across all six generations in real time against trainers from around the world!

Download
v 2.4.2


How to run from the source

Discussion in 'Developer's Den' started by coyotte508, Nov 10, 2010.

  1. coyotte508

    coyotte508 Administrator Administrator

    Messages:
    6,305
    Mac, Linux & Raspberry Pi Tutorials

    This tutorial is aimed to people without knowledge of git and compiling. People who know their way around can just go to https://github.com/po-devs/pokemon-online and use their favorite tools.

    Installs

    First, install the Qt SDK: http://qt-project.org/downloads (Windows 32 bits wtih mingw)
    Then, install the latest MinGW: http://sourceforge.net/projects/min...20111118/mingw-get-inst-20111118.exe/download. Don't forget to select C++ compiler in the things to install.
    Then, replace the contents of C:/QtSdk/mingw by the contents of C:/MinGW


    Then install Git Bash: (read under here before the installation) http://code.google.com/p/msysgit/

    (Take the latest download).

    During the installation of Git Bash, you'll be asked two things where you shouldn't take the first option. For those, take the option in those screens:

    [​IMG]

    [​IMG]
    Choose to check out as is, commit as is.

    Downloading the source

    Open git bash. It'd really help if you had some linux experience, or followed a quick tutorial on terminal commands.

    Anyway here is a brief summary of the basics:


    • Use pwd to show the current directory
    • Use ls to show the files in the current directory
    • Use cd xxx to go in the xxx directory
    • Use cd ../ to go one directory up (and ../../ to go two directories up, ...)
    • When you've typed the beginning of a command or a file path you can press TAB to have it auto completed.
    • You can press the Up arrow and the Down arrow to navigate through commands history

    So you can move around your Folders. Once you've found a suitable place to put the source folder, stop moving. (The source folder will be created within the current folder)

    And type:

    Code (text):
    1. git clone git://github.com/po-devs/pokemon-online.git
    You can also add a space and then a custom name for the source folder if you don't like pogeymon-online.

    The download'll proceed...

    Once it's finished, you don't really need to use git bash anymore (except to update the source).

    Compiling and Running

    Run Qt Creator. Open PokemonOnline.pro

    Right click on a project in the list of the editor and select build to build it. Build, in that order:


    • Utilities
    • PokemonInfo
    • Server

    Then right click on the Server project and select "Run" to run it. You may have to make it the current project in order to run it (go in the projects tab, and select it, then go back in the editing tab)

    Updating the Server

    Go in git bash, go in the source folder (pokemon-online) and type git pull. If you made script changes it may fail, in that case do:
    Code (text):
    1. git stash
    2. git pull
    3. git stash apply
    There are other ways to do it if you're more experienced with git :). It's just recommended to back up the tiers.xml and scripts.js files before updating.

    Running the Server in a Debugger

    Make the Server the active project in Qt Creator. And instead of running it, press F5. Then if it crashes you'll have a backtrace and you can screenshot it to report a crash

    Note: All that can be done for the client too. Just compile BattleManager and then Teambuilder instead of Server. And if you succeed having crashes for the Teambuilder, you can report them too.
    Last edited: Nov 9, 2013
  2. Iyyzhun

    Iyyzhun New Member

    Messages:
    3
    sorry but some pic s are dead

    i was installing the git.but i don't know which choice should i take. the pic s are dead.

    so ....
  3. coyotte508

    coyotte508 Administrator Administrator

    Messages:
    6,305
    The pics aren't dead.

    Anyway, when the title is "Adjusting your path environment", choose "Run Git from the Windows Command Prompt" (2nd choice)

    And when it's "Configuring the line ending conversions", choose "Checkout as-is, commit as-is" (3rd option) :)
  4. Blastcore

    Blastcore Developer

    Messages:
    763
    I was compling the Server and got a "mingw32-make.exe2 stopped working.
  5. DRWS

    DRWS New Member

    Messages:
    78
    I've followed the instructions to the letter, as well as tried other clients such as TortoiseGit, but every time I try it hangs at "Cloning into pogeymon-online". Any idea what the problem might be?
  6. coyotte508

    coyotte508 Administrator Administrator

    Messages:
    6,305
    Sourceforge is slow, so you should wait for like 15 minutes (do something else during that time), if nothing happens still then post again.
  7. DRWS

    DRWS New Member

    Messages:
    78
    It's been a couple hours.
  8. coyotte508

    coyotte508 Administrator Administrator

    Messages:
    6,305
    use this instead then: git://github.com/coyotte508/pokemon-online.git

    I'll permanently move to github maybe for the git repository, provided other developers agree.
  9. DRWS

    DRWS New Member

    Messages:
    78
    It still didn't work until I told it to use the HTTP protocol instead, which I couldn't do previously because Sourceforge doesn't support Git over HTTP. Thanks!
  10. coyotte508

    coyotte508 Administrator Administrator

    Messages:
    6,305
    You could have registered an account at sourceforge and used ssh to transfer, actually.
  11. coyotte508

    coyotte508 Administrator Administrator

    Messages:
    6,305
    Note: In the soon future, maybe you will need C++0x capabilities to compile it.

    See secret tag in OP on how to do it easily.
    Last edited: Sep 8, 2011
  12. Blastcore

    Blastcore Developer

    Messages:
    763
    I'm more dead. Why we would need C++0x?
  13. Coordinator Sahil

    Coordinator Sahil New Member

    Messages:
    71
    Why Qt sdk takes so much time to install.Even after 1 hour it was just 4 %
  14. Lamperi

    Lamperi I see what you did there Super Moderator

    Messages:
    2,646
    It downloads the stuff from the internet (if you are using the network installer). 1-2GB might take a long time on slower network connections.
  15. Coordinator Sahil

    Coordinator Sahil New Member

    Messages:
    71
    So,is there any way to make it a bit fast?
  16. Lamperi

    Lamperi I see what you did there Super Moderator

    Messages:
    2,646
    Get a faster Internet.
  17. Coordinator Sahil

    Coordinator Sahil New Member

    Messages:
    71
    Okay finaly i installed it but m stuck at this step "Compiling and Running" Please help
  18. Lamperi

    Lamperi I see what you did there Super Moderator

    Messages:
    2,646
    What did you do?
  19. Coordinator Sahil

    Coordinator Sahil New Member

    Messages:
    71
    Actually I am not getting how to run,can someone please upload screenshots?
  20. 100kv

    100kv Guest

    It's pretty straightforward. Just right click on Server, and click Run (it has that green play icon).


    I'm having some problems compiling and running too. When I build Teambuilder I get 3 errors:

    c:\qtsdk\mingw\bin\..\lib\gcc\mingw32\4.4.0\include\c++\cwchar:159: error: '::swprintf' has not been declared
    c:\qtsdk\mingw\bin\..\lib\gcc\mingw32\4.4.0\include\c++\cwchar:166: error: '::vswprintf' has not been declared
    and
    c:\QtSDK\Desktop\Qt\4.7.4\mingw\include\QtCore\qhash.h:225: error: invalid operands of types 'const BattleEnum' and 'BattleEnum' to binary 'operator=='

    I tried using the MinGW 4.6, following coyotte's instructions, but I also end up with this error:

    Running build steps for project Teambuilder...
    Configuration unchanged, skipping qmake step.
    Could not start process "mingw32-make.exe"
    Error while building project Teambuilder (target: Desktop)
    When executing build step 'Make'

    This applies for every project I try to compile (not just Teambuilder).

    EDIT:
    I was able to fix the above problem. Originally I just created a shortcut for the new MinGW, but when I created a hard copy into Qt/MinGW it worked fine.

    However, now I'm getting various errors building Teambuilder...

    EDIT 2:
    I was able to run Teambuilder project successfully. I had to comment out "<<<<<<<" and "========" from channel.cpp, and also build BattleManager project first. Thanks to Lamperi
    Last edited by a moderator: Oct 24, 2011
  21. Lamperi

    Lamperi I see what you did there Super Moderator

    Messages:
    2,646
    The ""<<<<<<<", "========" lines mean that the GIT had a conflict while merging files, and couldn't automatically merge/combine them.

    Between "<<<<<<<<" and "========" is "your" version of the code, and "========", ">>>>>>>>" the other version of the code. You should then merge them by hand, such a way that the code does what it should do.
  22. Blastcore

    Blastcore Developer

    Messages:
    763
    Haven't PO moved to Github? o.O
  23. Viderizer

    Viderizer Admin/Developer

    Messages:
    277
    Yes.

  24. Wiz

    Wiz New Member

    Messages:
    5
    You should do something about that "secret" tag in the OP. What's in there is essential for compiling the latest versions.
  25. coyotte508

    coyotte508 Administrator Administrator

    Messages:
    6,305
    Actually not, the latest version's been made compatible with gcc 4.4 for windows users. I deleted the secret tag.
  26. Wiz

    Wiz New Member

    Messages:
    5
    I guess I did something wrong then. gcc 4.4 didn't work for me - it resulted in a segmentation fault when compiling. And gcc 4.6 would give me linker errors. Then I compiled the qt libraries and qt creator with gcc 4.6, and now PO compiles without errors.
  27. coyotte508

    coyotte508 Administrator Administrator

    Messages:
    6,305
    Oh right. It's because you can't use qt 4.8.0 with gcc 4.4 if you enable c++0x, you have to use qt 4.7.4. Since I erased the links... I'd be grateful if you could tell me where you got the working gcc 4.6!
  28. Wiz

    Wiz New Member

    Messages:
    5
  29. Kata

    Kata Senior Of Team Rocket

    Messages:
    2
    Sorry coyotee your method not working i dont know why ?
  30. coyotte508

    coyotte508 Administrator Administrator

    Messages:
    6,305
    I updated the guide slightly to take in account the new mingw (thanks wiz!)
  31. kupo

    kupo New Member

    Messages:
    63
    How do you fix an -lzip error on windows? Compiling from qt on windows gives an lzip error :x
  32. coyotte508

    coyotte508 Administrator Administrator

    Messages:
    6,305
    It should find the zip files (bin/zip.dll and bin/zlib1.dll). Can you give the whole compiling output and your Teambuilder.pro file?
  33. kupo

    kupo New Member

    Messages:
    63
    Last edited: Jul 1, 2012
  34. coyotte508

    coyotte508 Administrator Administrator

    Messages:
    6,305
    And are the files bin/zip.dll and bin/zlib1.dll there?
  35. kupo

    kupo New Member

    Messages:
    63
    Just checked, yes both are there.
  36. coyotte508

    coyotte508 Administrator Administrator

    Messages:
    6,305
    Disable the shadow build in your project options, and rebuild everything.
  37. kupo

    kupo New Member

    Messages:
    63
    Did that, and now we get no zlip errors, but we do get these:
    C:\Users\Steven\Desktop\qtpo\pokemon-online\src\Teambuilder\serverchoicemodel.cpp:-1: In member function 'virtual QVariant ServerChoiceModel::headerData(int, Qt::Orientation, int) const':
    C:\Users\Steven\Desktop\qtpo\pokemon-online\src\Teambuilder\serverchoicemodel.cpp:113: error: 'InitialSortOrderRole' is not a member of 'Qt'
  38. coyotte508

    coyotte508 Administrator Administrator

    Messages:
    6,305
    Yes, I'm sorry, you're going to have to update to Qt 4.8.

    You'll also have to get the custom MinGW because Qt 4.8 doesn't work with the current one with C++0X (it's all explained in the OP)
  39. Blastcore

    Blastcore Developer

    Messages:
    763
    I hope you don't get the same issues as i do. :(
  40. StevoDuhHero

    StevoDuhHero New Member

    Messages:
    12
    I built the whole project and I got this: http://pastebin.com/ezvTJwzN as my compile output.

Share This Page