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 775565
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T19:18:38+00:00 2026-05-14T19:18:38+00:00

Im implementing a pool billiard game in Java and it all works fine. It

  • 0

Im implementing a pool billiard game in Java and it all works fine. It is a multiplayer game, but nevertheless, it should also be possible to play it alone. For this purpose I’m trying to implement a simple KI. At the moment, the KI choose just randomly a direction and a random intensity of the impulse (don’t know the correct english word for that). Of course this AI is very poor and unlikely to ever challenge a player.

So i thought about improving the KI, but there are several hard to solve problems. First I thought of just choosing the nearest ball and to try to put it directly into the nearest hole. This isn’t that bad, but if there other balls in the line between, it isn’t really working anymore. Additionally this dosn’t solve te problem of calculating the intensity of the impulse.

So are there any general advice? Or any ideas? Best practices?

  • 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-05-14T19:18:38+00:00Added an answer on May 14, 2026 at 7:18 pm

    How much CPU time and memory does it take to calculate the results of one “move” of the game? Can you afford to analyze more than one move? If it’s relatively cheap to do, just pick N random directions/impulses, calculate the results and pick the best one. You may eliminate some “tricky” cases, when ball goes to pocket after too many collisions. Also, to simplify, you can limit the simulation time for each move (i.e. don’t wait until all the balls stop, just calulate the first T seconds).

    This way, you can have computer players of different level – the higher N (and T) correspond to higher play level.

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

Sidebar

Related Questions

I am implementing a worker pool in Java. This is essentially a whole load
When implementing Serializable interface, in Java, we need to set it's serialVersionUID long. Is
I'm implementing a memory pool in C for a real time application. A container
Is there a known algorithm for implementing a connection pool? If not what are
I'm implementing several JavaSE applications on single server. Is it possible to setup a
I'm implementing a Non-Blocking HTTP server in Java and decided to use pure Java
I am implementing a monitoring and administrative MQ API using the WebSphereMQ java PCF
What is the good design pattern for implementing one connection (or generally resource) pool?
I was wondering what the best technique for implementing a DB connection pool for
I am trying to Write two Java programs implementing the FTP server with responses

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.