Forums Tyrant

Automatic deck optimization - leftylink's thread page 4 (locked)

216 posts

Flag Post

I can compile without warnings now. Found one .. ehrm… Mistake:
In cards.cpp in line 49 is a comparison between unsigned and signed int.
“if(card→m_set > != -1)”
I suppose that should be something like “if(card→m_set > 0)” or m_set should be an int!

l8er
Herethios

Edit I updated my Patch 2 Branch. All Compiler Warnings should be removed.

 
Flag Post
Originally posted by Herethios:

I can compile without warnings now. Found one .. ehrm… Mistake:
In cards.cpp in line 49 is a comparison between unsigned and signed int.
“if(card→m_set > != -1)”
I suppose that should be something like “if(card→m_set > 0)” or m_set should be an int!

l8er
Herethios

Edit I updated my Patch 2 Branch. All Compiler Warnings should be removed.

Oooo I see a pull request. Still busy today, but took a look and things look good. I will give the pull request a proper treatment over the weekend, probably (twill be the first pull request I deal with on any repo I own). I may have to ask you to make it so that your patches don’t apply the whitespace changes they currently are applying…

After this I guess we can compile with -Werror.

Looks like Card::m_set should either take on a default value of 0 if no set, or be made an int.

 
Flag Post

I had a further look earlier on and cause the compiler cannot change the variable into a smaller type, it will have changed it into a long. (Next bigger chance) But i suppose an int will be big enough! Then the rest can stay as it is!

 
Flag Post

-Does anyone use Dev C++? I used VS2010 so far, but I am trying to get Dev C++ to work with this Project. Any hints or tips ? -

Stuff that.. testing QT Creator now!

Edit: and guess what! Working nicely! removed two more warnings. Could Actually start doing something usefull now. But: no more Time left..

 
Flag Post

If it is manageable, do you think you could implement an extension to the use of cards of the ownedcards.txt so that the optimizer could use up to 10 copies of a reward card, although you only have 1 copy.
For example: You have 2 Splitjaws, but assume that there is a better deck against the enemy deck with 3 or more splitjaws. But you won’t see this deck, because the optimizer only counts your 2 copies.

In my opinion, since the introduction of the component selling feature gold is not a problem at all for most of the old players. They could easily buy extra copies of a reward card.
This extension should only work for cards from the reward tab of the cards.xml. Maybe you should exclude the tournament rewards, because the can’t be bought with gold. Reward cards gained from missions are mostly unique i think so no problem there. The bulk of the reward cards can be bought from the reward tab of the store.

I hope other players and you leftylink will think this is a good idea.
(P.S. i also posted this text in commonkey’s thread. I don’t know how you guys handle things with each other)

 
Flag Post

I can create an interface in C# and .NET, if someone is interested.

 
Flag Post

Small announcements:

I added a small fix to the XML parsing code that will cause it to NOT choke on the ` character in raids.xml. Now, removing the ` character is completely optional!

I merged in all of Herethios’s compiler warning fixes and added the -Werror flag to the Makefile (causes compilation to FAIL if there are any warnings). There were no warnings on my development machines, but if you find any because of platform differences, feel free to point them out to me.

Yes, all branches are rebased.

Probably the next item on my list is “on Kill”, but I think I am waiting on more information on its mechanics before diving into the implementation.

Now to reply to a few posts:


Originally posted by KevinChan2:

In Automatic deck optimization:

tyrant_optimize.exe SzMBLeCIIGMBInEFJw “Xeno Domination 1” -o -s -r climb 100000 > result.txt


(omitted)
win%: 70.806 (70806 out of 100000)

In SimTyrant v1.105:

Wins 3170/5000 63.4%
Link: http://haileon.com/SimTyrantJS?deck1=SzMBLeCIIGMBInEFJw&surge=1&ordered=1&mission=318&sims=5000

I don’t know whether this is bug, so I post a report here.

I think this is a significant discrepancy, and that you should figure out a minimal set of cards (possibly a subset of cards used here) that cause this discrepancy, and we should talk.


Originally posted by commonkey:

Thunor: you can use card IDs instead of name. So for example in Custom.txt:

bla: Dracorex, pip [864], Orbo

is a valid deck. 864 is the id for pip, you can find all the IDs in cards.xml

Thank you commonkey. I am updating my first post to indicate this.
Psst, we should talk about merging my changes sometime…


Originally posted by Herethios:

Hey Leftylink!

I started to remove some Compiler Warnings.. Thy hurt my eyes! ;) I don’t know my way around on github, so please check wheter I have done anything wrong or not! I have more changes wich I have not put on github yet, because after changing xml.cpp my pull request said 60 changes! I suppose that qould be into master and not into leftylink…

I am used to Clearcase! First Time I am trying to help on a github project!

Greets
Herethios

Yeah, it’s because I rebased the branch since you cloned it. No matter, I’ve merged your changes in. Thanks for your help!


Originally posted by Kassiopeia:

If it is manageable, do you think you could implement an extension to the use of cards of the ownedcards.txt so that the optimizer could use up to 10 copies of a reward card, although you only have 1 copy.

You are right that this is useful. I’m not sure this is a job for tyrant_optimize to handle, though. More likely this job can be done by a small script that reads cards.xml and ownedcards.txt and output an ownedcards.txt with 10 copies of any gold-buyable reward card. Then you simply use that new ownedcards.txt instead. Because I feel like this functionality is better implemented externally, it is really low priority for me to implement right now, but I will consider it if someone writes it and submits a pull request.


Originally posted by Kaeel:

I can create an interface in C# and .NET, if someone is interested.

Oh, I’m sure someone is interested, as evidenced by conversations earlier in this thread. Anyone is free to contribute whatever they want; that is one of the good parts of open source. There are various options available for making this GUI, and it is made easy by the fact that the command-line options already complete control over all of this tool’s functionality. Of course, the previous point means that for me personally, a GUI would simply make this tool harder to use and use up unnecessary resources as well, a double whammy! I have no interest in providing a GUI or including it on my repo, but that still should not stop you from creating one if you feel like it.

 
Flag Post

Thanks Leftylink for all the work you put into this! Quick question since I am not a git expert: How do I deal with git error messages like this (caused in this case by the “-lboost_chrono” required on Windows)?

error: Your local changes to the following files would be overwritten by merge: Makefile

Simply moving that file out of the way does unfortunately not seem to help.

 
Flag Post

Hello I’m trying to find an optimized deck that uses my ownercards.txt cards against “Mission 65”.

I understand that the correct command for that would be:



img824.imageshack.us/img824/6310/errorgg.png

But I’m getting that Error. Any help? Thank you!

 
Flag Post

sorry for 2ble posting

 
Flag Post

Hello I’m trying to find an optimized deck that uses my ownercards.txt cards against “Mission 65”.

Why not use the following command?

tyrant_optimize.exe PsID+q “Mission 65” -o climb 1000 > result.txt

(PsID+q means Lord of Tartarus + Microgen(10); You can substitude with any decks that you can spam.)

Although the initial winrate is low, it will be improved very quickly using the cards in ownedcards.txt

 
Flag Post
Originally posted by KevinChan2:

Hello I’m trying to find an optimized deck that uses my ownercards.txt cards against “Mission 65”.

Why not use the following command?

tyrant_optimize.exe PsID+q “Mission 65” -o climb 1000 > result.txt

(PsID+q means Lord of Tartarus + Microgen(10); You can substitude with any decks that you can spam.)

Although the initial winrate is low, it will be improved very quickly using the cards in ownedcards.txt

Thank you I have discovered that you need to use an initial deck. This program is AMAZING!!! Thanks for the help and respect to the author!

I’m still new to tyrant and I don’t understand one thing: what does “in order” applied to decks mean? I just tought you get random order while playing, don’t you?

 
Flag Post

You have a choice which cards to play of the 3 you get. ‘In order’ means that the sim tries to play the order as given. So if the ordered deck is Fortifier, Microgen, Sabre, Tiamat, etc and the initial draw is Microgen, Sabre and Tiamat, then the sim will play Microgen. If the sim is not in order, it may play Microgen, Sabre and Tiamat with equal chance.

 
Flag Post
Originally posted by Aapje:

You have a choice which cards to play of the 3 you get. ‘In order’ means that the sim tries to play the order as given. So if the ordered deck is Fortifier, Microgen, Sabre, Tiamat, etc and you the initial draw is Microgen, Sabre and Tiamat, then the sim will play Microgen. If the sim is not in order, it may play Microgen, Sabre and Tiamat with equal chance.

Thanks for the reply!

 
Flag Post

Hey Lefty!

If I get it right, I would have to be a collaborator in your Repository in order to work on your code without cloning it. I suppose I could now delete my repo and clone it again in order to get your werror branch. After my changes I can send you a pull request again and Bingo!

Correct?!?!

Greets Herethios

 
Flag Post
Originally posted by grrrmpf:

Thanks Leftylink for all the work you put into this! Quick question since I am not a git expert: How do I deal with git error messages like this (caused in this case by the “-lboost_chrono” required on Windows)?

error: Your local changes to the following files would be overwritten by merge: Makefile

Simply moving that file out of the way does unfortunately not seem to help.

The solution is obviously to become a git expert. It will make your life much better.
But actually:
git stash; (do whatever you need to do); git stash pop


Originally posted by Herethios:

Hey Lefty!

If I get it right, I would have to be a collaborator in your Repository in order to work on your code without cloning it. I suppose I could now delete my repo and clone it again in order to get your werror branch. After my changes I can send you a pull request again and Bingo!

Correct?!?!

Greets Herethios

You don’t have to delete your repo, though you can if you want. You can just add my repo as a remote (remote add leftylink git://github.com/leftylink/tyrant_optimize.git) and get whatever branches you want from it. Please keep in mind that I still rebase my branches, though. I guess I should stop doing that sometime.

Anyway, send a pull request whenever you like.

 
Flag Post
Originally posted by leftylink:

Updates

Tue Dec 18 09:14:21 UTC 2012 Announced two small fixes: No more choking on ` character in raids.xml, and fix all compiler warnings.

I’ve waited tables a couple of times in my life—at the same place, which was a pretty nice restaurant. (Not $100 per person, but high-quality.) They had a thorough, excellent training program. One instructor made an off-hand remark that has always stuck with me. He said, “You can judge the quality of a restaurant based on its bathrooms. If a company cares about its customers, the bathrooms will be great.” (He—and other people—also said that you can tell how much a company cares about its employees based on the bathrooms it provides for the employees.) Bathrooms are not necessary for making good food, and clean bathrooms do not cook a steak properly. Nevertheless, my experience says that it is generally true that bad bathrooms equals bad food. Bottom line: bathrooms are not necessary for good food, but they probably send an accurate signal about a restaurant’s quality.

I know this is a weird story, but we all know I am weird person, so let’s just move on. In the announcement above, you took the time to make code that compensates for someone else’s error. Furthermore, anyone that can use your program has the skills to remove the offending character. Taking the time to code around these stray characters wasn’t necessary, but you did it anyway. Based on the bathroom analogy above, I think it is just another indicator of the quality of your work.

So, thank you. That was a long and weird way to tell you that you are doing a good job and many people appreciate the effort you put into cleaning the bathroom removing parsing errors that you didn’t create.


(And guys, lift the ****ing lid when you are in a public toilet. Yeah, I mean you: you lazy, barbaric, inconsiderate, disgusting, disease-spreading moron.)

 
Flag Post

PM’ed you with some code to print intermediate results.

 
Flag Post
Originally posted by leftylink:

Got it. A diff would’ve been better (but I made one myself). Will take a closer look at it and decide what I want to do with it in the coming days…

Yeah sorry. Git and me don’t get along so well.

 
Flag Post

Hi.
Would it be possible, that in case when there is no ownedcards.txt in dir -r paramater would work? Just to shuffle cards to get better result?
Or to make some shuffle parameter?
Workaround is to put only deck’s cards into ownedcards.txt but it is quite long process :).

 
Flag Post
Originally posted by ltdata123:

Hi.
Would it be possible, that in case when there is no ownedcards.txt in dir -r paramater would work? Just to shuffle cards to get better result?
Or to make some shuffle parameter?
Workaround is to put only deck’s cards into ownedcards.txt but it is quite long process :).

The -o flag and -r flag are unrelated. It should work with/without a ownedcards.txt.

 
Flag Post
Originally posted by tibia_fry:
Originally posted by KevinChan2:

Hello I’m trying to find an optimized deck that uses my ownercards.txt cards against “Mission 65”.
http://img824.imageshack.us/img824/6310/errorgg.png

Why not use the following command?

tyrant_optimize.exe PsID+q “Mission 65” -o climb 1000 > result.txt


(PsID+q means Lord of Tartarus + Microgen(10); You can substitude with any decks that you can spam.)

Although the initial winrate is low, it will be improved very quickly using the cards in ownedcards.txt


Thank you I have discovered that you need to use an initial deck. This program is AMAZING!!!


Hello,
I get a similar error message as seen on the Screenshot from tibia_fry, even though the id is different and the id also varies what ever I try.
I tried KevinChan’s command and it also did not work.
I thought that my cards.xml was the problem, but I can use it with commonkeys version.
Maybe someone has got an idea, otherwise I will just use commonkeys version for the time being. (Btw. I downloaded the already compiled version)
Thank you in advance
 
Flag Post
Originally posted by leftylink:

  • Can't use "Kogoth, the Consumer", "Kapak, the Deceiver" or "Pip, Epic Arbiter" in Custom.txt. Yeah, it sucks. Sorry. Your three options are to use deck hashes, to change Kogoth, Kapak, and Pip's names in cards.xml, or to use ID notation in Custom.txt. For example, notate Pip as "Pip[864]" and tyrant_optimize will understand that you mean the card with ID 864 (who happens to be Pip, Epic Arbiter).

Right now, when T_O recommends Pip, Epic Arbiter, the output says "Pip, Epic Arbiter", which is completely logical. But, I often take the output of simulations and use them as input for other simulations. Then, of course, Pip, Epic Arbiter will epically arbiter me on the head. Idea: for cards with commas in their name, instead of outputting Pip, Epic Arbiter, output something like Pip[864] or some other representation that T_O will accept as input. In fact, would "Pip Epic Arbiter[864]" work? Sorry for not testing.

Just a thought.

 
Flag Post

What’s mean by threads in -t (which default is 4)? I dont understand it.

 
Flag Post
Originally posted by whitegluejacky:

What’s mean by threads in -t (which default is 4)? I dont understand it.

http://en.wikipedia.org/wiki/Multithreading_(computer_architecture)

It’s a way to speed up code execution. But it depends on your machine. If you have a 4 core machine, you might be able to get away with 8 if it hyperthreads. In general, I stick with threads=(# of cores)-1. Leaves one core free for me to watch porn movies.