Rabbit/Butterfly - GameSalad Tic-Tac-Toe with computer opponent (Arcade link now working)

ArmellineArmelline Member, PRO Posts: 5,397
edited May 2015 in Announce Your Game!

Thought I'd spend a few hours today seeing how difficult it is to add a computer opponent to tic-tac-toe made in GameSalad.

If you manage to beat the computer (or it doesn't recognise a win by the computer) please screen shot it and mail it to me at support@armelline.com - it'll mean I need to fix the AI! I'm pretty sure I missed at least one computer win condition. Once I'm sure the AI is unbeatable I'll add easier difficulties!

http://arcade.gamesalad.com/games/130847

Edit: The version originally posted didn't work in Arcade. After some serious troubleshooting, this seems to be down to Arcade flat out failing to run the tableColSum function. I've removed it and published a new version, but if I've missed a tableColSum anywhere (it was used a lot) things will still break. Let's find out!

Comments

  • ArmellineArmelline Member, PRO Posts: 5,397

    A video in the meantime:

  • ant_ladant_lad Member Posts: 222

    Wow, this is a game I came here to make

  • UtopianGamesUtopianGames Member Posts: 5,692

    Nice work :)

  • ArmellineArmelline Member, PRO Posts: 5,397

    Thanks for the feedback!

    Can't figure out why it's skipping conditions in Arcade. Perhaps it's time to do a bit of a condensing and cleanup of the logic and see if it's still a problem then.

    @BlackClockGS any insight onto major differences between how projects are run in Creator/on device and in the Arcade?

  • HopscotchHopscotch Member, PRO Posts: 2,782

    @Armelline, which version did you publish with?

    In the past, inactive/commented out rules would still be executed in the HTML5 build and cause these inconsistencies.

    I am not sure if, or to what extent, this is still the case in the current version, I have not tested it, but have not noticed any problems in the last build.

  • ArmellineArmelline Member, PRO Posts: 5,397
    edited May 2015

    @Hopscotch said:
    Armelline, which version did you publish with?

    In the past, inactive/commented out rules would still be executed in the HTML5 build and cause these inconsistencies.

    I am not sure if, or to what extent, this is still the case in the current version, I have not tested it, but have not noticed any problems in the last build.

    I've been using 0.13.13, but I don't have any inactive rules that I'm aware of.

    It seems to be completely failing to complete some fairly basic rules at a few points. I vaguely suspect it has to do with the tableColSum function - that doesn't seem to be getting run anywhere.

    Edit: Yes, it definitely seems to be to do with tableColSum - I just switched it out in one place that place is no longer failing. Now to just find and replace it in all the other places it's used and see if that fixes the rest of the problems...

    Edit 2: I see there's already a bug submitted regarding (probably) this issue by you @Hopscotch. Seems they're not in a hurry to fix this bug :D

    Let's try this again, with (hopefully) all the tableColSum's removed:

    http://arcade.gamesalad.com/games/130847

    Fingers crossed it works this time!

  • HopscotchHopscotch Member, PRO Posts: 2,782

    @Armelline, yes, the tableColSum does not work in HTML5 and I posted the bug long time ago. Forgot about that one.

  • JSprojectJSproject Member Posts: 730

    @Armelline said:
    Thought I'd spend a few hours today seeing how difficult it is to add a computer opponent to tic-tac-toe made in GameSalad.

    If you manage to beat the computer (or it doesn't recognise a win by the computer) please screen shot it and mail it to me at support@armelline.com - it'll mean I need to fix the AI!

    Computer beaten on the 3rd attempt, the two first were draws - screenshot sent, gl :)

  • HopscotchHopscotch Member, PRO Posts: 2,782

    Very nice project by the way @Armelline!

    Publishing on the arcade is really great at the moment, apart from minor shortcomings like the above tableColSum bug and the fact that audio volume settings get ignored.

  • ArmellineArmelline Member, PRO Posts: 5,397
    edited May 2015

    Computer beaten on the 3rd attempt, the two first were draws - screenshot sent, gl :)

    I thought for a moment that was a big mistake being made by the computer, but it looks like it's this damn tableColSum again making it fail to spot that column needs blocking. Well found and thank you! Fix incoming!

    Edit: Should be fixed now!

    @Hopscotch said:
    Very nice project by the way Armelline!

    Thanks! Was a fun little project for a Saturday afternoon after walking the dogs!

  • Braydon_SFXBraydon_SFX Member, Sous Chef, Bowlboy Sidekick Posts: 9,273

    Awesome project - can't beat it!

  • ArmellineArmelline Member, PRO Posts: 5,397

    @Braydon_SFX Thanks!

    Well now that's fixed, time to start thinking about next steps. I'll add extra difficulties to this first I think - currently the computer (should) always play a perfect game, making it impossible to beat. Adding a couple of easier difficulties shouldn't be particularly tricky. After that it's on to a more complex board game. Think chess is still a fair way off, though...

    One thing I found particularly interesting doing this is that GameSalad can run through these logic trees blisteringly fast. I actually had to deliberately slow it down at points, and even now it plays too quickly - the computer moves sometimes before I've even mentally registered my own move.

  • ant_ladant_lad Member Posts: 222

    Try a single player game of Go next?

  • ArmellineArmelline Member, PRO Posts: 5,397

    @ant_lad said:
    Try a single player game of Go next?

    just thinking about that makes my brain hurt.

  • zweg25zweg25 Member Posts: 738

    Looks great! Can't beat it! How about connect four next? :smile:

  • ArmellineArmelline Member, PRO Posts: 5,397
    edited May 2015

    @zweg25 said:
    Looks great! Can't beat it! How about connect four next? :smile:

    As connect 4 is also a solved game, it might be an interesting challenge. However, for my next computer opponent I think I'll specifically go for an "imperfect" one that is beatable and plays a little more randomly than the unforgiving one in my tic-tac-toe game.

    I'm strongly leaning towards Quarto as my next adventure into GameSalad AI.

    On a slightly different note, I don't have any specific intention to release the project file for Rabbit/Butterfly, but if people are interested I could talk through it and demonstrate how the computer player was achieved.

  • ant_ladant_lad Member Posts: 222

    I would love that. I would even pay for it i you could talk me through creating different difficulties

  • ArmellineArmelline Member, PRO Posts: 5,397

    Updated with 5 difficulty settings. Hopefully I didn't break it! You can change the difficulty at any time.

    http://arcade.gamesalad.com/games/130847

    That's all I plan for this game, unless it turns out I broke it putting the difficulties in.

  • clee2005clee2005 http://Donkeysoft.caMember, PRO Posts: 194

    @Armelline I've run into issues with HTML5/Arcade versions of all my games. They appear to work at first, then it seems that state degrades as the games start to behave oddly. I've submitted one of my projects for GS to have a look at, but haven't heard anything further (couple of weeks ago).

    Bottom line is that if you are experiencing differences in Arcade, I wouldn't spend too much time trying to sort it out. I think it's something GS needs to sort.

  • clee2005clee2005 http://Donkeysoft.caMember, PRO Posts: 194

    Ok update! I just heard from GS and they found some issues with the HTML5 engine. Differences from the Android and iOS engines. They have made the changes and are planning on updating the Arcade servers soon.

    I'm very impressed with the turn around from GS. Shows that they are paying attention. The difference for my project was table manipulation. Apparently there were places where rows were being deleted that didn't exist, and values being put into columns where the types didn't match. This doesn't crash the iOS/Android engines, but the HTML5 engine doesn't like it and would exhibit odd behaviours.

  • RiveraonlineRiveraonline Member Posts: 54

    smart game!!!

  • ArmellineArmelline Member, PRO Posts: 5,397

    @clee2005 Thanks for the update! Hopefully they take this opportunity to fix the tableColSum bug too!

    @Riveraonline Thanks!

  • robertkdalerobertkdale USAMember Posts: 912

    @Armelline Thanks for sharing!

  • ArmellineArmelline Member, PRO Posts: 5,397

    I always half-intended to release the project file for this for people to look at and play with, but never did as the rules restricted how I could do so far too much for it to be worth it.

    The rule preventing me from creating a new thread to post the project file for this has now been relaxed, so I'm contemplating doing so.

    Is there any interest in how this was done? It's not particularly clever, but might be of interest to some.

  • MarcMySaladMarcMySalad Member Posts: 158

    @Armelline said:
    I always half-intended to release the project file for this for people to look at and play with, but never did as the rules restricted how I could do so far too much for it to be worth it.

    The rule preventing me from creating a new thread to post the project file for this has now been relaxed, so I'm contemplating doing so.

    Is there any interest in how this was done? It's not particularly clever, but might be of interest to some.

    @Armelline Yes it would be intersting to look at

  • ArmellineArmelline Member, PRO Posts: 5,397
    edited August 2015

    Forgot all about this. Will throw it up on GSHelper soon (for free), so keep your eyes peeled!

  • UtopianGamesUtopianGames Member Posts: 5,692
    edited August 2015

    ...

  • Chrisbar62596Chrisbar62596 Member Posts: 7

    How were you able to make the AI

  • ArmellineArmelline Member, PRO Posts: 5,397

    Tic tac toe is a solved game, so you just need to have the computer run through the steps listed on the wiki page:

    https://en.wikipedia.org/wiki/Tic-tac-toe

  • fmakawafmakawa Member Posts: 567

    @armelline, Can't seem to find it on GSHelper. Did you eventually put it up? Trying to wrap my head around AI so looking for as many examples as I can.

Sign In or Register to comment.