Best way to create a Computer Player/ bot

The title says it all: what is the best way to create a non-computer player?

I plan to do this for a basic pool game, (you know, the one with the magic 8 ball :laughing:). I have made the sprites, but not the code yet.

-NetMinderNo.9Apps

Taken literally, best to ask your "god/creator".....

non-computer user = user

1 Like

@TIMAI2 LOL. I meant a Computer player.

My wife made a couple of non-computer users a bunch of years ago, but then they transformed into computer users and we can't get them out of the house now.

Regarding Billiards, here is the trigonometry part for ball bounce angles:

Making this game multi-user will be challenging if the different users have devices with different shapes. The angles might be different across devices, so one device's opinion of a shot might differ from other devices' opinions of that shot.

1 Like

were you not involved ?

1 Like

It was dark.

1 Like

@ABG, Thanks for the references. And also for the jokes. It made my day. :smile:

@TIMAI2, to address your response...

Regarding the differences between different game modes (single player, single v. bot, single v. multi bots, and multiplayer) and the differences between AI, bots, ncps and cps, look at this site.

It's based on the definitions for the eng. language, but I thought it might apply here too (well, since I kinda mixed them up lol). As for my game, I want it to have

  • a solo (Practice) mode,
  • a solo vs bot (Competition) mode,
  • a 2 player (1v1 competition) mode, and
  • a Tournament mode. (multiple team games with a final result, either best out of a number or by brackets)

I also might add a mode for teams (like 4v4). It all depends on what can get done.

I'm making this for my cousins back in NY, (we all have kindles) and I think (repeat I think) that the sizing won't truly be a problem. I could always have it made to a fixed ratio, like 16:9. Problem is that the Kindle doesn't support the companion app, so testing will happen in 2 phases. (might work fine on tablet, then bug on kindle)

Any suggestions? Anybody? Or any examples?

Extending a pool game across devices will require programming some showmanship into the other devices, to listen for a report by the device just used for a shot, and using the details of that shot to drive each devices' Sprites and Balls to mimic what the original shot looked like.

That includes:

  • placement (X,Y,Direction) of balls and sprites before the shot,
  • angle, speed, radius of the pool cue from the cue ball
  • successive movement of each ball, including bounces off other balls and edges, including final positions.

You will also need friction in your code, otherwise the balls will roll forever.

@ABG Thanks. I'll take those things into account.