Home    LittleBigPlanet 2 - 3 - Vita - Karting    LittleBigPlanet 3    [LBP3] Help!!
#1

Artificial Intelligence!

Archive: 6 posts


I wanted to make a computer opponent in my tic-tac-toe level but I never had experience in AI programming, so I was wondering where I would start considering that I want to work on other AI projects.2017-06-18 18:29:00

Author:
DyMonkie
Posts: 3


So here's the chance for our logic puzzle freaks to betray secrets and help our new friend! 2017-06-18 19:23:00

Author:
CuriousSack
Posts: 3981


If you want an unbeatable AI that can calculate all the possible moves, the best solution would be to make a binary algorithmic system but I have never delved too deep into that and it takes some knowledge to make it work correctly, any tiny mistake and the whole thing fails basically.

I'm lazy so I would never even attempt the method previously mentioned. What I would do is to use tags to map out the board conditions. The AI should know which ones of the 9 squares that are available and by analyzing the taken ones, be able to play accordingly. You need to set up rules. For example; if 2 squares in a row are taken, the third square should be highlighted for the AI, thus prioritized. The more rules you add the smarter the AI will become. You basically need to learn a bunch of tags and selectors how to play tic-tac-toe.
2017-06-19 09:51:00

Author:
blacksackman
Posts: 234


This goes for any other board game right?2017-06-19 20:33:00

Author:
DyMonkie
Posts: 3


Pretty much, yes. Some are harder and some are easier. I'd label tic-tac-toe as an easier one due to the simplicity of the game.2017-06-19 23:04:00

Author:
blacksackman
Posts: 234


Tic Tac Toe is actually very easy to make an unbeatable ai. You could do a variety of different things such as counting each possible line for X's and O's (8 lines) for 2 either. There's also just go for middle if it's not taken. Basically the order should be:
0. Is the middle taken (optional): If no, put it on middle
1. Can my opponent win: if yes, block them.
2. Is there a free corner: If yes, take one.
3. Is there a free spot: If yes, take one.
2017-06-20 13:04:00

Author:
koltonaugust
Posts: 1382


LBPCentral Archive Statistics
Posts: 1077139    Threads: 69970    Members: 9661    Archive-Date: 2019-01-19

Datenschutz
Aus dem Archiv wurden alle persönlichen Daten wie Name, Anschrift, Email etc. - aber auch sämtliche Inhalte wie z.B. persönliche Nachrichten - entfernt.
Die Nutzung dieser Webseite erfolgt ohne Speicherung personenbezogener Daten. Es werden keinerlei Cookies, Logs, 3rd-Party-Plugins etc. verwendet.