5

I want to test some card game tactics against each other, my goal is to know witch tactic would be better in real live. To do this I made a simulation, but I don't know if I made a good one. So I would like to know how to create a good simulation.

You can’t simulate every factor that is pressed in real life, for example bluffing. There are also some factors that can be eliminate, I eliminated as many as possible. The factors that are left, like bluffing, are out of scope. It's impossible to simulate those.

I use my simulation project to compare some tactics against each other. This way you can see what tactic you could use against an other tactic. The downside of this is that you only can use this if you know the tactic of the other player. When you don't know what tactic you can use against it, then you need to have a computer to test it. So you only can use this project to review your playing style.

This question is not about creating a “god tactic”, but it is about writing good simulation software that can be used to simulate for example card games. So I would like to know how you can make a good simulation:

  • What do I need to take along?
  • How could you know that your simulation is a good simulation?
  • How should I process situations? Generate for example some random hands, or try all possibilities.
Laurence
  • 1,815
  • 4
  • 22
  • 35
  • Could you maybe rewrite your question to a more general approach? I would like to know more about how you could make a good simulation. – Dagob Jan 02 '13 at 08:17

4 Answers4

4

Answers to your three questions:

  1. Factors like cards sticking together and different shuffle techniques shouldn't really matter. I assume you would model the shuffling by using a pseudorandom noise source (like rand()) to randomize the order of the cards. Most shuffling techniques are probably good enough that that's a perfectly sufficient model for your purposes.

  2. I don't know the game well enough to know how simply the strategies can be described. The test that you described should answer the question of which of those tactics will win when they go head-to-head. If those are the only two strategies, and they are simple enough that they can be completely implemented, then yes, your test will tell you which is better. If this game is like most such games and involves lots of different strategies and subtleties, then knowing which of these two strategies will win when the two go head-to-head probably won't tell you much about which is actually the better strategy.

  3. I basically covered this in my answer to your second question, but if you have programmed the tactics 100% correctly, then the results of the bot face-off will be useful in that they will tell you which of those two strategies will win more often when they go head-to-head. I think that in most games like this, though, that alone does not tell you much about how good the strategy is overall. Again, I don't know enough about this game to say with certainty, but if the game involves many possible strategies, the test probably won't tell you much that's super useful.

David
  • 1,429
  • 8
  • 8
2

You can't prove anything using this kind of simulation. All you're really leaning is that simulation A is better than B, but not how they would work in the real world or against other strategies.

You can get some general idea of what might work better or worse, but that's about it.

ddyer
  • 1,792
  • 19
  • 26
  • 2
    You don't even know that. If you have one run with simulation A versus simulation B with A winning, then you only now, that Simulation A won one time. This could be, because simulation A is superior or just by accident. Those runs are [non-deterministic](http://en.wikipedia.org/wiki/Deterministic_algorithm#What_makes_algorithms_non-deterministic.3F). You have to repeat them and do some statistics. – Enno Gröper Jan 06 '13 at 11:55
1

My answer is not based on research, it is how I think of simulating tactics in a small scope.

This is how I made my simulation:

The first thing that you need to do is making sure you can implement the tactics that you want to compare. If there is no way you can program them, then there is no way you could test them on your own.

Write the test scope down, you could expand your project every time you have a new idea. When you do that you are creating a project that never will finish. So mark what you want to do and consider every option. Bluffing is a good example. It's almost impossible to implement a bluff simulation, you could calculate how much chance you have to win, but a normal person bluffs for example when he thinks that other persons will pass or that he will win. It is a lot of work to implement “feelings” in a program. Not every one has the same feelings about bluffing. But you could make different bluff sets (feelings) and let the bot use them with every tactic. This will be a lot of work, in my case this was not worth it.

Find out how you want to compare the tactics. Do you want to know how much % change you have to win? Or do you want to do some random games for some other reason?

There are more dialects of every game, find out what set of rules you want to follow. Implement those rules. The simulation will be incorrect when you don't do this.

Implement all tactics, and use the same functions as much as possible. This way you're testing the core functions automatically. With this approach you can be done sooner and you will find bugs that you never would been found.

Test the system. Testing is a very important with simulating. One small problem can cause a wrong result. Walk over your code with a debugger to know if it does the ride thing. Make a "debug mode", show in this mode the results of every game and review them. Also let other persons review how the games are played.

Laurence
  • 1,815
  • 4
  • 22
  • 35
0

In your more details request you ask:

What is important?

How can you make a good simulation?

How do you know it is relevant in a real live situation.

The answer to the first question can only be answered by expert at the game; creating AI is not an easy task and to create great AI you need to know all the strategies in the game and you need to program those strategies in. Then you either need to know when to use those strategies or in the case of what you are trying to determine have the computer cycle through all the combinations.

Make a good simulations depends a lot on what you are trying to achieve. You could go with the Chess method and have the AI play out all the possible scenarios and choose the best ones. This would in effect remove the strategies from the game entirely but it also might come up with some new ones; but good chess programs use opening books and what-not. To simulate real life you would probably want to use some combination of strategies and playing out all the possible moves depending on the situation.

Also, you say that you can't bluff, but that is not necessarily true. If it is a strategy in the game then you should probably program bluffing in and attempt to program in a response to bluffing. If you are going to do that you would need to implement a bluffing skill and detect bluffing skill and also a bluffing percentage. With that you could also learn how often bluffing could be useful for a given real life skill level. If you do implement bluffing you probably want to be able to run your simulation with it on or off.

To test you simulator, and insure it is accurate to real life, I would advise having the computer face off all the know combinations/results and insure that the results are the same as what you would see in real life. After that start cycling through but ramp up testing slowly just run a few strategies at first and check the results, then add in a few more. If you put all the strategies in from the get-go you will have a very hard time finding out that one of them doesn't work correctly.

Community
  • 1
  • 1
Anthony Nichols
  • 1,586
  • 2
  • 25
  • 50
  • But how would you implement bluffing then? You could make a few types of bluffing, but there are so many reasons why someone would bluff in a certain situation. Besides that, In real live there are a lot of other reasons why you would bluff. For example: you could detect something he does when he is “lying”. I know a very good bod needs to have a “bluffing implementation”. But when you really want to implement that, you will have a lot of work to make a good implementation. I guess you need to do a long study about bluffing to detect a playing style. – Laurence Jan 08 '13 at 18:08
  • very true - I don't know the specifics on the game you are referring to, but if you do some research on Poker AI you should be able to find some good info and be able use that as a starting point if/when you decide to add bluffing into the mix. – Anthony Nichols Jan 09 '13 at 05:28