Python Forum
Adding a single player mode to my wxOthello game
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Adding a single player mode to my wxOthello game
#9
I like your idea, SheeppOSU. I'll try to find a way to implement it. In the mean time, I created a desirability/priority map that was able to win in a game against me. I don't know if that's saying much since I'm a little rusty and may have picked up a few bad habits play testing the game, but here is the new priority map:
# These nested lists map various levels of desirability to different areas of the gameboard
# where 0 is most desirable, 1 is more desirable than 0 and so on. The nines in the center are
# already occupied at the start of the game and their values aren't relevant here. The center
# spaces (early game) are marked with desirability values 0 and 1. Midgame is 2, 3 and 4 with
# the approches to the corners set to 1 to make the bot take those areas if at all possible
# regardless of circumstances, and the corners being most desirable are marked with 0, with
# 5 and 6 used for the buffers with the edge buffer given a value of 5 and the middle buffer
# given a value of 6. This is actually the map that beat me.
priorityMap = [[0,5,1,2,2,1,5,0],
               [5,6,4,3,3,4,6,5],
               [1,4,0,1,1,0,4,1],
               [2,3,1,9,9,1,3,2],
               [2,3,1,9,9,1,3,2],
               [1,4,0,1,1,0,4,1],
               [5,6,4,3,3,4,6,5],
               [0,5,1,2,2,1,5,0]]
Maybe the feature that SheeppOSU suggested is what would give the bot the edge needed to defeat even a master of the game. However, It would just make the capture that got it the most pieces possible with the most strategically valuable move. The way difficulty is determined is by varying the likelihood of the bot making a 'mistake;' a randomly selected move from the set of all possible valid moves. The more mistakes it makes, the easier it is to beat. I just want to make the max difficulty or better yet, something slightly lower than max difficulty to always be a challenge for my mom; even when she gets good at the game. I don't know how familiar any of you are with Othello game strategy, but it's much more than just selecting the move that gets you the most pieces in the short term. The player that gets control of the edges and a corner can turn a board covered in their opponents color against their opponent as 1) they are practically guaranteed to have a move available to them and 2) they can start capturing their opponents pieces en masse in a huge cascade where a single move could well capture dozens of pieces.

The reason occasional random moves are such an effective way to control difficulty is because just one mistake by the bot; especially in the early to mid game can lose it the game while still keeping the rest of the gameplay challenging--provided it uses good strategy.
Reply


Messages In This Thread
RE: Adding a single player mode to my wxOthello game - by keames - Apr-21-2019, 04:00 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [PyGame] adding mouse control to game flash77 7 614 May-21-2024, 01:05 AM
Last Post: XavierPlatinum
  get a game to run in full screen mode agencyclearly 1 441 May-12-2024, 11:23 AM
Last Post: menator01
  Creating a “Player” class, and then importing it into game onizuka 4 3,183 Sep-01-2020, 06:06 PM
Last Post: onizuka
  Adding an inventory and a combat system to a text based adventure game detkitten 2 7,041 Dec-17-2019, 03:40 AM
Last Post: detkitten
  Adding persistent multiple levels to game michael1789 2 2,497 Nov-16-2019, 01:15 AM
Last Post: michael1789
  Can a player play game created with Python without installing Python? hsunteik 3 5,437 Feb-23-2017, 10:44 AM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020