flat assembler
Message board for the users of flat assembler.
Index
> Tutorials and Examples > better opengl example (hex game+ai) |
Author |
|
MHajduk 10 Nov 2013, 20:52
One thing that could make this game more interesting would be an option to play against the computer. Now, as I understood, it is a version for two human players.
Another thing that could be improved is automatic update of the view when the application window is changing its size - when you drag the window border in one direction (inwards) and after that you immediately start to drag it in the opposite direction (outwards) keeping the left mouse button pressed all the time you may see such an image: |
|||
10 Nov 2013, 20:52 |
|
tthsqe 10 Nov 2013, 21:18
OK, the window size thing is easy to change, but writing some (decent) ai is not a piece of cake. Hex is also hard. If we are to keep things simple, I could try a Monte Carlo tree search, but I bet it will produce close to random play in the beginning.
|
|||
10 Nov 2013, 21:18 |
|
MHajduk 10 Nov 2013, 21:27
I agree that the game tree may be huge in size like a chess game tree. It may grow expotentially as the number of fields grows. BTW, is the hex game board somehow strictly "normalized" in size?
|
|||
10 Nov 2013, 21:27 |
|
tthsqe 12 Nov 2013, 03:40
What do you mean by 'normalized in size'?
I can say that if the board is NxN in size then each row needs 2(N+1) bits, so 15 is the largest size if each row is to fit in a dword. |
|||
12 Nov 2013, 03:40 |
|
MHajduk 12 Nov 2013, 17:38
I meant whether the hex game has a constant number of fields on the board (like chess for example) or it's just a question of an arbitrary choice of the game creator.
I read in Wikipedia that the hex game can be played on boards with various numbers of fields, so the game isn't "normalized" in the aforementioned meaning. |
|||
12 Nov 2013, 17:38 |
|
tthsqe 17 Nov 2013, 10:33
oh, I finally get what you mean by 'fields'. You can play it on a board of any size MxN. 15x15 should be interesting for both computers and humans. If the starting position is empty,
if M != N, shorter color has a winning stategy if M = N or the position is symmetric, first color has a winning strategy |
|||
17 Nov 2013, 10:33 |
|
tthsqe 20 Nov 2013, 07:40
I got some ai working in the hex game now. The two levels are '(1)random' and '(2)monte carlo'. Level 2 does sometimes produce good moves and can consistently beat Level 1.
|
|||
20 Nov 2013, 07:40 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.