Eastern Fringe Forums

game tree design problem
Page 1 of 1

Author:  JensenBreck [ Tue Nov 07, 2017 11:08 pm ]
Post subject:  game tree design problem

I have a tree node class, which holds a game board, and which can plot possible next moves, and functions which produce the next n rows of moves for a node. Each time a move is generated a new node is created, the game board is copied to this new node, and then the move is taken, leaving the original node's board untouched.

This however, is very slow. Is there a way that, perhaps using a static game board in the node class, I could just take moves as I create children, and then undo the moves as when returning to the original node. I keep a stack full of previous moves and can undo moves, but I'm not sure whether what I'm thinking of is possible since I would later need to search the tree and assess the board states, which would involve retaking the moves at each node. Another concern is whether this would even be any faster.

Any idea?

Please help.

I didn't find the right solution from the Internet.

References http://www.cplusplus.com/forum/general/34775/

whiteboard animation videos

Page 1 of 1 All times are UTC - 8 hours
Powered by phpBB® Forum Software © phpBB Group