[UPDATE] Crap Out!! Dice Game. MP3 SUPPORT!! [v1.1.7]

The Partridge Family were neither partridges nor a family. Discuss.
Zionich
Posts: 24
Joined: December 11th, 2012, 12:57 am

Re: Crap Out!! My new Dice Game. [v1.0.6]

Post by Zionich » February 26th, 2013, 4:54 pm

Love it.

User avatar
thetoddfather
Posts: 338
Joined: October 1st, 2012, 9:53 pm
Location: Canada

Re: Crap Out!! My new Dice Game. [v1.0.6]

Post by thetoddfather » February 27th, 2013, 5:12 pm

Thanks so much Zionich! I'm glad you liked it!

albinopapa
Posts: 4373
Joined: February 28th, 2013, 3:23 am
Location: Oklahoma, United States

Re: Crap Out!! My new Dice Game. [v1.0.6]

Post by albinopapa » February 28th, 2013, 3:28 am

I like the game, and would like to know how you did the AI. Not the code, but the logic. Did you have to list all the possibilities and have it choose one based on what the highest score would be? Very well done, however it was done.
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com

User avatar
thetoddfather
Posts: 338
Joined: October 1st, 2012, 9:53 pm
Location: Canada

Re: Crap Out!! My new Dice Game. [v1.0.6]

Post by thetoddfather » February 28th, 2013, 5:55 pm

First off albinopapa, thank-you so much for the positive feedback. Hope you keep enjoying it! I am probably going to add some new bells and whistles here shortly. New colors for dice to be unlocked and such. Sound effects... Just to make it a little more complete feeling. Personally, I love this game, and still play it with my son and dad, and it's good for some laughs, especially when you throw in some CPU players to compete with.

The AI is also something I need to tweak slightly, although I am very proud of how it handles things as well as how it 'appears' to handle things. For me, I am a huge fan of when AI looks or acts kinda organic. And that was what I was going for. A thinking, pondering, unpredictable CPU guy lol.

The current version of AI goes through a few steps. It gets fed the exact random die rolls that human players have to use. Then it examines them.

First it looks for a straight (1,2,3,4,5,6), worth 1,500 and a re-roll. Then it moves on to 3 of a kind. This is one thing I need to tweak because it doesn't care about the value of those three of a kinds. Where a human would probably leave 3 twos down if they could just take a 1, for the sake of odds of getting a better 3 of a kind, the computer will not discriminate. It takes 3OAKind no matter what.

After it's looked for those it decides if it wants to keep taking counters or not. Generally speaking it will not because this is the best strategy IMHO, for playing to win. Take the fewest counters worth the highest score so you can roll as many die as possible to get 3OAKind. So, MOST of the time he leaves counters (1s and 5s) down if he gets 3 of a kind on the first roll, so he has a small chance at another 3 of a kind and a bigger chance at rolling at least ONE counter and not crapping out.

If he has less than 3 die to roll, he always takes any counter he can.

In short, I didn't have to list every possibility, no, but then it gets crazy when he's approaching 10,000 too because he can't go over and his strategy shifts a little, so he'll stay sometimes sooner than he would normally.

There are a lot of possibilities for how he will play his turn because I love not knowing what an AI player will do, and hate predictable AI. I'd rather play against unpredictable, interesting AI than to play against predictable, insanely good AI. Not sure if that answers your question. Feel free to ask more if I didn't. To some that don't understand the game well, he may even appear to be stupid, when in fact, his strategy is pretty solid.

albinopapa
Posts: 4373
Joined: February 28th, 2013, 3:23 am
Location: Oklahoma, United States

Re: Crap Out!! My new Dice Game. [v1.0.6]

Post by albinopapa » March 1st, 2013, 9:17 am

I suppose that is how I play as well, I try to give myself the most points with the most dice left to roll again to give myself a better chance of getting 3 or 4 of a kind. Played 3 times when I first downloaded the program. Lost the first one due to learning curve, then won the next two from good rolls and some luck.

If you mean that you added a delay to make it seem like the CPU is thinking, it sure fooled me. I was sure because of the 34MB file and the amount of delay on some of the turns the CPU had, it was using the same method a chess game AI was using. I would have to say that the AI does have a nice balance of risk. Does take some chances with "piggy-backing", but not always. This is how I feel I was able to win the last two games. I would leave the AI with very few die to "piggy-back". Like I said, it didn't always take the bait.
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com

User avatar
thetoddfather
Posts: 338
Joined: October 1st, 2012, 9:53 pm
Location: Canada

Re: Crap Out!! My new Dice Game. [v1.0.6]

Post by thetoddfather » March 1st, 2013, 6:21 pm

Hahahaha, yes indeed there is a coded delay in reaction for the AI. In fact, play the battle royal of a game with 5 CPU players and you'll probably see that they are slightly quicker thinkers to reduce game time. If I took the delay out entirely you wouldn't even be able to see the CPU's moves they would go by so quickly. So, your comments mean a lot to me because your reaction was exactly what I was aiming for when I wrote the AI. To appear to be taking the time to analyze every possibility and making an informed decision. Which, to a very large degree that's exactly what is happening, hopefully more so in future versions, but todays computers are so fast you could write the dictionary of possibilities and it would be done in a split second anyway.

So, I added in something that makes him ponder the universe a little between decisions. He is very quick to see certain things. He spots and takes three of a kind like nobody's business. But other decisions he weighs a little more heavily.

I wish I was good at network programming so I could make it multiplayer and I could have a round or two with people like you on here. That would be amazing.

User avatar
thetoddfather
Posts: 338
Joined: October 1st, 2012, 9:53 pm
Location: Canada

Re: [UPDATE] Crap Out!! Dice Game. [v1.1.0]

Post by thetoddfather » November 1st, 2013, 9:13 pm

New version up for download :)

Updated version to 1.1.0. The game now includes stats so you can see your career games played, wins, losses and highest ever roll. It also keeps track of the stats for the computer as well. Secondly, there is now a new second level AI that is more intelligent than the old one. The old AI is die 1, the new more intelligent one is die two when asked for AI level.

User avatar
chili
Site Admin
Posts: 3948
Joined: December 31st, 2011, 4:53 pm
Location: Japan
Contact:

Re: [UPDATE] Crap Out!! Dice Game. [v1.1.4]

Post by chili » November 3rd, 2013, 9:27 am

This one slipped past me in my hiatus. Gotta check it out :)

Edit:

I totally played this game as a kid with my family, we called it 10,000 or some dumb shit. Nice clean interface toddfather, I rather enjoy this. I would totally throw a round with you if you got networking running. It's not as hard as you think, and this kind of game is ideal because typical latency is not an issue. You should seriously consider implementing network play.
Chili

User avatar
SlevinKelevra
Posts: 80
Joined: September 9th, 2013, 12:58 am
Location: Germany

Re: [UPDATE] Crap Out!! Dice Game. [v1.1.4]

Post by SlevinKelevra » November 3rd, 2013, 2:49 pm

Great job!!
Carpe noctem

User avatar
thetoddfather
Posts: 338
Joined: October 1st, 2012, 9:53 pm
Location: Canada

Re: [UPDATE] Crap Out!! Dice Game. [v1.1.4]

Post by thetoddfather » November 3rd, 2013, 8:57 pm

I would love to Chili but I know nothing about networking. I'd put in the time to learn but maybe you could point me to a good place to start? Or anyone else that would know some good tutorials or books that would help me to get this game networked fast?

SlevinKelevra, thanks bro!

Just uploading a new version with a few refinements and a fix for how games played / Win Percentage is calculated.

Post Reply