Advertisement

Need a heuristic for drop four game

Started by February 13, 2005 08:31 AM
12 comments, last by alex_myrpg 20 years ago
Hi, just need a good heuristic for drop four ball game. So that i can have a better evaluation of the board. thanks
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.
Advertisement
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
------------------http://www.nentari.com
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.

Alvaro, I never ceased to be amazed by that solution. Absolutely brilliant. Now do one for chess! :D lol.


Will
------------------http://www.nentari.com
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.
Website (with downloads of my games)
Blog (updates on current projects)
Seeds of Time Online has returned!
Advertisement
Minimax with alpha beta pruning
-Lucas
drop four has been solved already and rules for perfect play of the player playing first exist.
I did not know that, where is good information that we can post here, where we can learn more about that.
-Lucas
clicky

This topic is closed to new replies.

Advertisement