jump to navigation

Kiriki: Hint September 14, 2010

Posted by Romário Rios in planetkde-luizromario.
trackback

This feature was developed some months ago, intended to ship with SC 4.5. But I unfortunately lost the freeze deadline, so it ended up being postponed.

Anyway, after creating a demo for Kiriki, I started working on the hint feature, very common in another games. In this case, I used Kiriki’s AI itself to give the hint, asking it how would it play and, then, showing it to the used instead of actually playing.

Without further ado, here’s how it is:

Hint action at Game menu

There it is, the hint action.

Dialog warning that you won’t make it into the high score list if you take a hint.

DIE

Here’s a hint for which die to roll…

Row, row

…and here’s a hint for which row to select.

That’s it. If you want to test it, take the patch here and apply it. Thanks to everyone who helped me.

Cya.

Comments»

1. Richard Hartmann - September 14, 2010

Personally, I will never use the hint feature, but I think you should add a checkbox to disable this warning permanently as well as a way to re-enable it in the options.

Romário Rios - September 15, 2010

I don’t think that that’s a good idea because, if another user after the current user and the current user used hint, the former wouldn’t know that he wouldn’t go to high scores if he used hint. Besides, that warning will appear only once per game.

Richard Hartmann - September 15, 2010

User accounts exist for a reason and it should be painfully obvious that receiving hints will disable highscores, anyway.

Of course, it’s your application and thus your call to make.

2. The User - September 14, 2010

Is the AI perfect or heuristical?

luizromario - September 14, 2010

It can’t be perfect, since there’s no way for it to know what number will a roll of a die bring; given the environment at the moment, the computer will choose the probably best play.

The User - September 14, 2010

Perfect = the AI always chooses the option with the highest expected final score, and the expected gets computed exactly.

Romário Rios - September 14, 2010

So, no. Again, I don’t think it’s possible, since it’s a dice game, so, the next scenario is not predictable.

The User - September 15, 2010

A perfect AI would always choose the the option with the highest expected value (http://en.wikipedia.org/wiki/Expected_value) for its points. This is defenitely theoretically possible, the game is finite, but it may need some computing power, although I think a lot of stuff could be precomputed (e.g. the expected value for each of the 2^13 possibilities of free categories). An example for a heuristic would be “try to get the maximum number of points divised by the theoretic maximum for the selected field for this round”. Hmm, maybe this approach is also perfect, but you would have to prove it, I do not think so.

Romário Rios - September 15, 2010

Hm… that’s right, but the AI does not seem to be perfect, as it only analyses the current round, not how it would affect the oncoming rounds. And it also does not choose the best option in the round sometimes.

3. Daniel - September 15, 2010

No, it can not know the outcome, but still it could be optimal given what is known.
So what “The User” is asking… even though the AI might be mistaken, will it give you the *best possible* hint in all situations or would it in theory be possible to chose another action which has a higher expected outcome, with the same information given?

Romário Rios - September 15, 2010

Yes, it is possible (and obvious sometimes) to choose a better option than the AI chooses.

The User - September 15, 2010

Thank for the information.🙂

Of course the AI could also get informed about the state of the random-number-generator.😀😀

Romário Rios - September 15, 2010

Something like a “God’s hint”. That would be cool.😀

4. Inge Wallin - September 15, 2010

Seems a little buggy, since that set of dice actually is a *small* straight. 🙂

Romário Rios - September 15, 2010

All the five dice are in sequence, how could that be a small straight? Well, actually it’s _also_ a small straight, but it’s a large straight too.

The User - September 15, 2010

Small = 12345 Large = 23456😉

Romário Rios - September 15, 2010

Not really: http://en.wikipedia.org/wiki/Yahtzee#Lower_section

>Large Straight: Five sequential dice (1-2-3-4-5 or 2-3-4-5-6)


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: