Automatic deck optimization - leftylink's thread
(locked)

I submitted my first patches to commonkey’s tyrant_optimize on November 11th. Since then, I went on to make many other changes to it, including ANP (to make the best raid decks ever) and conquest battleground effects (to make the ultimate conquest tool).

I have been called many things since then. Some hailed me as a hero, or “master programmer” (I’m really not). It makes my heart swell to see my name posted in Fansite comments, though I would say the one more deserving of the credit is commonkey. Others decried my actions, claiming I ruined conquest, and indeed the entire game of Tyrant. That’s too bad, but it’s just fine.

Was I right in releasing this code to the public? Did I act correctly in opening this Pandora’s Box? I’m not sure. I do know that as a coder, I am a supporter of open source. I have benefitted from being able to peruse Moraku’s and Netrat’s source code for their respective simulators, and I use other open source software on a daily basis. And it certainly would not have felt right to keep my improvements to myself and friends only. So I did what I felt was right.

Whether what I did was right or not, I no longer have the time to support such an endeavor. Just as I took the torch from commonkey, I think it is time to pass the torch back on to the next contributor, whoever that may be. commonkey seems to be working on his own repo again, and there has been a little bit of extra work done by andor. Because of the distributed nature of git, everyone who forked my repository on github has a complete copy of all changes I have made, so anyone can pick up where I left off.

I may be back in a few months, but until then, it has been a pleasure serving you. It’s time for me to disappear from the spotlight, back into the shadows (where some have argued that I operate best), and make way for other coders with enormous potential.

for quests when i try to run it the optimizer isn’t recognizing the quests (ex: Step 13). I downloaded the XML file and put it in the same folder as the other files. Is there something else i’m supposed to do?

for quests when i try to run it the optimizer isn’t recognizing the quests (ex: Step 13). I downloaded the XML file and put it in the same folder as the other files. Is there something else i’m supposed to do?

Did you compile the binary itself? The quests version is not distributed as a binary, so you have to build it yourself.

for quests when i try to run it the optimizer isn’t recognizing the quests (ex: Step 13). I downloaded the XML file and put it in the same folder as the other files. Is there something else i’m supposed to do?

Did you compile the binary itself? The quests version is not distributed as a binary, so you have to build it yourself.

for quests when i try to run it the optimizer isn’t recognizing the quests (ex: Step 13). I downloaded the XML file and put it in the same folder as the other files. Is there something else i’m supposed to do?

Did you compile the binary itself? The quests version is not distributed as a binary, so you have to build it yourself.

nope how do you do this

Most of the relevant information is the first post, if you are having problems with that, I can’t help you too much from here. If you are still interested, you can shoot me a PM and I will see what we can do.

Step by step guide to compile leftylink’s tyrant_optimize on Windows

Some background knowledge You can skip this if you just want instructions.Leftylink’s code is developed for *nix type systems (which all versions of Windows are not), so you are gonna have to install a toolset that will provide some of the necessary libraries and headers. In this guide, I use mingw-9.5.exe, a self-extracting archive, which includes a nifty tool called “git” that will retrieve all the code we need and “wget” which will get the xml files.

Note that messing with any of the defaults WILL change this process, and I will not cover in what ways those changes will mess stuff up

Open a command prompt. For most Windows iterations, it can be found by clicking on the Start Menu → All Programs → Accessories → Command Prompt. See the first image below for a sample command prompt (yours should look similar).

Now type “C:\MinGW\set_distro_paths.bat”. This command tells your command prompt where to search for some of the files and libraries that will be used.

Now, type “cd tyrant_optimize”. The previous command created this folder and “cd” means “Change directory”, so we are literally opening that folder.

Type “git checkout leftylink-integration”. This is the branch that you want at the current moment in time (likely to change in the future).

Now we need to make a change to the Makefile. Type in "sed -i "s/-lboost_filesystem/-lboost_filesystem -lboost_chrono/" Makefile". This will add -lboost_chrono to the LDFLAGS, which is necessary for Windows users.

Type in “mkdir obj”. This creates a folder (inexplicably) needed for compilation. (That’s a slight dig a leftylink. :P )

Type “make”. You will see a bunch of text flow back you on the screen. This is normal (and expected). The very last thing you should see is something close to “g++ -o tyrant_optimize obj/cards.o obj/deck.o obj/read.o obj/sim.o obj/tyrant.o obj/tyrant_optimize.o obj/xml.o -lboost_system -lboost_thread -lboost_filesystem -lboost_chronos”. If you see something else, post a screenshot and let us help you. (Google is your friend if you don’t know what a screenshot is.)

Somehow i must have compiled an odd binary… it will optimize decks but only without the -o flag because i suppose it cannot read ownedcards.txt (which in this case contained only 3 cards to avoid a looong error output)

me@M1530:~/optimizer$ ./tyrant_optimize “ogre-spam” “ogre-spam” climb 100 -o -s
" does not seem to be a valid card.d “2” does not seem to be a valid card.
" does not seem to be a valid card.ard "
Error in file ownedcards.txt, the card “1” does not seem to be a valid card.
optim: read.cpp:269: void read_owned_cards(Cards&, std::map<unsigned int, unsigned int>&): Assertion `beg != tok.end()’ failed.
Aborted (core dumped)

i got a huge list of warnings as well while making the binary http://pastebin.com/vJDtn9pc i had to create obj/ and to change gnu++11 into gnu++0x.
i’m on ubuntu 12.04

the gnu++0x is because ubuntu is packing the older gcc. the 0x standard is very close to the 11 standard, so it won’t matter other than editing the makefile.

As for the huge warnings, yes that is normal.

And the issue with ownedcards.txt might be a formatting issue more than anything. It is working for me just fine, and im on Mint 13 which is based on Ubuntu 12.04.

Your guide is great. I got it working.
Notes: Point 10. My last line had a different order, and also had the -lboost_chrono in the line, which you didnt add.
Point 11. Wouldnt do https links, so changed it to http instead and it worked.

Problems: Currently having a problem where it wont let me put in a new deck into custom decks if i want to fight it. I have to ‘edit’ a previous deck (by changing the card, but keeping the deck name)
Am I doing something wrong?

think i discovered a bug. Clone experiment doesn’t work on Mission 229. The program just crashes; however, it works fine in numerous other cases. I tried the other missions and it worked fine. I can use other effects like toxic on 229 and it works.

Your guide is great. I got it working.
Notes: Point 10. My last line had a different order, and also had the -lboost_chrono in the line, which you didnt add.
Point 11. Wouldnt do https links, so changed it to http instead and it worked.

Problems: Currently having a problem where it wont let me put in a new deck into custom decks if i want to fight it. I have to ‘edit’ a previous deck (by changing the card, but keeping the deck name)
Am I doing something wrong?

Very good points. For point 10, the order might be off, it’s really not a big deal, as long as it’s close, and you don’t see some sort of error. And, https shouldn’t work, I dunno why I had that there.

I dunno the exact format of Custom.txt that does work, so leftylink would probably be a better person to answer that.

Your guide is great. I got it working.
Notes: Point 10. My last line had a different order, and also had the -lboost_chrono in the line, which you didnt add.
Point 11. Wouldnt do https links, so changed it to http instead and it worked.

Problems: Currently having a problem where it wont let me put in a new deck into custom decks if i want to fight it. I have to ‘edit’ a previous deck (by changing the card, but keeping the deck name)
Am I doing something wrong?

Just guessing but do not use TAB between deck name and deck description, only spaces.

I’m wondering how you feel about this idea: an option that starts the optimizer with climb 100, then switches to climb 1000 once 80% is reached and then climb 10000 when 95% is reached. In my experience, when optimizing against an unknown deck without much of a clue what to use as an counter, this method is the quickest way to find a good counter, but I have to manage it by hand now.

Secondly, I’m wondering if you can make a presumably very simple addition: an option to cut off the sim at a certain percentage (or ANP value). Sometimes I just want a decent deck quickly instead of the best deck slowly.

I should rename them in cards.xml AND in every deck it uses them AND in ownedcards.xml ?
Compilation seems to be working for Ubuntu 12.10 though libboost needed some added stuff:
libboost-system1.49-dev
libboost-thread1.49-dev
libboost-filesystem1.49-dev

Hey, do you like games? So do we — that’s what makes Kongregate the best source of free games online. We have thousands upon thousands of free online games, from both one-man indies and large studios, rated and filtered so you can play the best of the best. Read more »