Jump to content
  • Advertisement
Sign in to follow this  
Syed Jawad

Need a heuristic for drop four game

This topic is 4956 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Advertisement
Well, computing the evaluation should be fast too so you don't want any too complex functions. Something like taking a weighted sum of how many and how long non-blocked rows the players have on board could be a start.. Maybe add some bonus to having balls closer the center. And learn the weights from millions of repeated games.

Share this post


Link to post
Share on other sites
Use the search button at the top of the screen.. Alvaro (I think it was him) had determined a way to tell who should win any given position by examining the board (i.e. no game tree required).

Will

Share this post


Link to post
Share on other sites
Quote:
Original post by RPGeezus
Use the search button at the top of the screen.. Alvaro (I think it was him) had determined a way to tell who should win any given position by examining the board (i.e. no game tree required).

Yeah, it probably was me. But it's not true that you don't need a tree. Once you get to a position where no new threats can be created, I have a mechanism to know exactly who will win, and no search is required. But in the early stages of the game, my ideas only give you an indication of what type of threats matter and which don't.

http://www.gamedev.net/community/forums/topic.asp?topic_id=225611&whichpage=1

I strongly disagree with speed being the most important factor here. No reasonable ammount of seaching is going to let you know that in this position
_ _ _ _ _ _ _
_ _ _ _ _ _ _
_ _ _ _ _ _ _
_ _ _ 1 1 _ _
_ _ _ 2 1 _ _
_ _ 2 1 2 _ _
player number 1 will win easily.

Share this post


Link to post
Share on other sites
Man, I just wrote a Connect Four game in Computer Science 3 class in TrueBASIC over a month ago, wewt! :)

I'm not exactly sure what you mean by heuristic.. just a way of doing things? What I did for it was I basically just gave each "cell" an ID, using a formula (it was something like id = y*6 + x, where 6 was the number of cells per row).

To see if anyone won, what I did was I went through each x,y pair and did some checking to see whether there was a vertical win, horizontal win, or diagonal. Basically just have a variable for the number_in_a_row_so_far and increase the X value by 1 and check if there's another one of the player's tokens there and if so increase the number_in_a_row_so_far and yeah.. you get the idea.

Hope this was somewhere in the ballpark of what you requested.

Share this post


Link to post
Share on other sites
drop four has been solved already and rules for perfect play of the player playing first exist.

Share this post


Link to post
Share on other sites
I did not know that, where is good information that we can post here, where we can learn more about that.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!