Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7942667
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T00:02:36+00:00 2026-06-04T00:02:36+00:00

This is my first question here, if I did something wrong, tell me… I’m

  • 0

This is my first question here, if I did something wrong, tell me…

I’m currently making a draughts game in Java. In fact everything works except the AI.
The AI is at the moment single threaded, using minimax and alpha-beta pruning. This code works, I think, it’s just very slow, I can only go 5 deep into my game tree.

  1. I have a function that recieves my mainboard, a depth (starts at 0) and a maxdepth. At this maxdepth it stops, returns the player’s value (-1,1 or 0) with the most pieces on the board and ends the recursive call.
  2. If maxdepth isn’t reached yet, I calculate all the possible moves, I execute them one by one, storing my changes to the mainboard in someway.
  3. I also use alpha-beta pruning, e.g. when I found a move that can make the player win I don’t bother about the next possible moves.
  4. I calculate the next set of moves from that mainboard state recursively. I undo those changes (from point 2) when coming out of the recursive call. I store the values returned by those recursive calls and use minimax on those.

That’s the situation, now I have some questions.
I’d like to go deeper into my game tree, thus I have to diminish the time it takes to calculate moves.

  1. Is it normal that the values of the possible moves of the AI (e.g. the moves that the AI can choose between) are always 0? Or will this change if I can go deeper into the recursion? Since at this moment I can only go 5 deep (maxdepth) into my recursion because otherwise it takes way too long.
  2. I don’t know if it’s usefull, but how I can convert this recursion into a multithreaded recursion. I think this can divide the working time by some value…

Can someone help me with this please?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T00:02:38+00:00Added an answer on June 4, 2026 at 12:02 am

    1. Is it normal that the values of the possible moves of the AI (e.g. the moves that the AI can choose between) are always 0?

    Sounds strange to me. If the number of possible moves is 0, then that player can’t play his turn. This shouldn’t be very common, or have I misunderstood something?

    If the value you’re referring to represents the “score” of that move, then obviously “always 0” would indicate that all move are equally good, which obviously doesn’t make a very good AI algorithm.

    2. I don’t know if it’s usefull, but how I can convert this recursion into a multithreaded recursion. I think this can divide the working time by some value…

    I’m sure it would be very useful, especially considering that most machines have several cores these days.

    What makes it complicated is your “try a move, record it, undo it, try next move” approach. This indicates that you’re working with a mutable data structure, which makes it extremely complicated to paralellize the algorithm.

    If I were you, I would let the bord / game state be represented by an immutable data structure. You could then let each recursive call be treated as a separate task, and use a pool of threads to process them. You would get close to maximum utilization of the CPU(s) and at the same time simplify the code considerably (by removing the whole restore-to-previous-state code).

    Assuming you do indeed have several cores on your machine, this could potentially allow you to go deeper in the tree.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

this is my first question here so I hope I can articulate it well
this is my first question here :) I know that I should not check
This is my first question here so try to make my best so you
Greetings to all! This is my first question here on stackoverflow. I have a
Ok, I need help. This is my first question here. Background: I am working
this is my first question to stackoverflow so here it goes... I use cruise
this is my first question.. so, here we go. i have a site, 100%
Sorry, this's my first time to ask a question here. So, I don't have
Here's my HTML. Apologies for formatting - this is my first-ever question! <div id=Template>
This is my first time here so I hope I post this question at

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.