Jump to content

  • Log In with Google      Sign In   
  • Create Account

We need your feedback on a survey! Each completed response supports our community and gives you a chance to win a $25 Amazon gift card!


Wizuriel

Member Since 18 Jul 2012
Offline Last Active Nov 22 2012 05:21 PM

Topics I've Started

Creating a frontend for a game

09 November 2012 - 04:23 PM

Ahoy.

So after some painful months and much help from people in this thread I know have AI for my quoridor game that appears to play right and only takes 3-5min to make a turn (still working on it). Meanwhile my next big thing would be going from C# and a consol application to actually putting in on my website.

Originally my plan was just to rewrite everything in Javascript, but yeah I really don't want to do that unless it really is the best way. My other thought would be to just use a ton of AJAX to communicate how the game is going from the backend to javascript on the front end to display the results, but been finding so far that has been very messy trying to communicate my objects to JS.

So was hoping people might have some suggestions

Designing AI for Quoridor

30 August 2012 - 11:08 PM

Hello.

I'm attempting to learn programming and web development and for my latest project I'm attempting to program the board game Quoridor. For those that don't know the game; basic idea is Quoridor is played on a 9x9 board, first pawn that reaches the opposite side of the board wins. During your turn you can either move or place a wall (you have 10 walls), each wall blocks 2 squares.

So right now I have the an A* search that lets my AI finding the fastest path and I use the A* search to make sure no wall placed in illegal spots (an illegal wall would completely block a player from being able to reach the end). My problem is trying to do the wall placing AI.

My first attempt was kind of a state machine. After 3 turns (so if both pawns move only they are at the middle of the board) I do a check which pawn is closer to their goal. If the player is closer I try putting a wall on every path of their best route (or the first best route that A* returns, I do check multiple ones but only return the first best one) and put the wall where the players movement is increased the most compared to how it affects the AI. If the AI is closer to the goal than I just get the AI to move.

Now the problem with this is the AI kind of stupidly and quickly runs out of walls, and doesn't place them in the best spot (since It's just going off the best route, the walls don't line up right to really slow the player, its too direct). Also one of the biggest strategies in Quoridor is placing walls defensively so your opponent can't cut off your best path (something I have no idea how to even begin to code).

So I'm now trying to think of a different way of approaching this problem. I'm kind of interested with trying a genetic algorithm / neural network to try and predict moves and act accordingly, but for the life of me I can't think how to condense the data down to even start to do that. So kind of hoping someone can point me in a better direction.

Creating a hidden object game in html5 (pseudo code)

29 July 2012 - 05:42 PM

Hello.

I'm trying to create a reasonable simple hidden object (where is Waldo/Wally type game) and having some trouble creating a plan of action to create this.

What I want to do is have a starmap and ask Users to find a specific Zodiac. When a user clicks a star it should shown to be clicked and once the user believes they have the right stars selected can submit it to check if they are right or not.

My plan is to have a blank starmap and set it as the background image. I know I can use jquery to bind mouse clicks over the image. My idea than was to have a list of the correct pixle positions and check if the users click was within x radius of the right spot to verify they clicked a star. My problem is how to show the user clicked something. Right now the only way I can think of doing that is have a different image map of each star selected (plan is just to colour them in) and the rest of the map set as transparent and just overlap the background image with a selected star image (so as they keep getting overlapped the stars should be shown to be coloured in).

In a nutshell my Pseudo code is
[source lang="plain"]pick random zodiac.Set blank star map as background imagedo{ if mouse click { send server the spot clicked check if spot is within X of any stars (list of correct positions) if user clicked a star highlight/deselect star //insert idea here how to highlight star } if user submits { check if right starts selected If true than game isDone if not inform user their selection is wrong }} while (isDone == false)[/source]


So just wondering if this would be the best way to go, if there is a more efficient way?

PARTNERS