My First Game - TicTacToe

Hi Everyone,

I’ve completed the unity 3d course and am now starting on a few simple games on my own to further my skills. This is my first one and a great starting game. Nice simple game that we all know. The UI is based on a Unity tutorial I found on line, I’ve added my own AI so that you can play against the computer or get the computer to play against its self. I did a lot of reading and learnt a lot in putting together the AI which is based on the minimax algorithm.

http://gamebucket.io/game/3aaef430-dc92-4743-afd1-98180528c3b9

Have fun.

Cheers
Mike

3 Likes

Hey @Mike_Heggie, congrats! How cool is that - it’s great to see members of the community creating their own games during and after the course. Well done.

I managed to not get beaten on the hardest level, even letting the AI go first - thankfully! Equally, I didn’t win…

One minor suggestion… the AI plays it’s go literally as soon as I have clicked, whilst I appreciate I am playing against a computer that has already calculated every possibly move and wants to destroy me, to give me a sense of hope as a player, it might be nice if there was just a fraction of a delay before the AI placed it’s token! :wink:

Hi Rob,

Thanks for checking out my game and providing some feedback. Sorry for the delay in replying, I’ve been off on holiday.

I understand and agree with your comment, at higher difficulty levels there is even a delay in displaying your own move while the AI is working out its move. I’m currently working on another project, a space invaders clone, in developing that I’ve learnt about yield, which might have been an acceptable solution to building in a delay before the AI starts thinking about its move.

Thanks again for your feedback.

Cheers
Mike

1 Like

More than welcome Mike, be nice to see your space shooter as you progress with it :slight_smile:

Very impressive with an AI and that you can change the dificulty. Well done!
Do you have any good links or recommendations on learning “AI”?

Hi, thanks for checking out my game.

The AI is an implementation of the MiniMax algorithm, MiniMax itself is pretty easy to implement it simply steps through every possible move available by recursively calling itself. Because of the recursion debugging can be a pain though. Took a while of playing around with different versions before I really got it.

One of the best explanations I found was:

A google search on MiniMax, or tic tac toe AI will turn up dozens of results.

Cheers
Mike

1 Like

Privacy & Terms