0
$\begingroup$

I am trying to automate the throw of a ball in a game in order to get "Excellent Throw".

To achieve an "Excellent" throw, you need to hit the center of the shrinking target circle when it's at its smallest size. The mechanics involve:

Target Circle: When you encounter a Pokémon, a target circle appears around it, which shrinks and expands. The size of this circle determines the throw bonus:

Large Circle: "Nice" throw

Medium Circle: "Great" throw

Small Circle: "Excellent" throw

Timing: The key to getting an "Excellent" throw is to release the Poké Ball when the target circle is at its smallest.

Accuracy: You need to aim for the center of the target circle to hit the Pokémon accurately.

Examples:

enter image description here

enter image description here

What I would normally do is:

1. Initialize game screen capture.
2. Detect and track the target circle's size.
3. Calculate the optimal release time when the circle is at its smallest.
4. Aim for the center of the circle.
5. Simulate the throw with appropriate speed and trajectory.

The thing is I would need to adjust these for each pokemon, since each one has a different circle. So I was wondering if ML would be preferable in this case scenario and more specifically if RL would be the more preferable choice.

The reward would be of course reading from the screen capture "Excellent!" after the throw.

$\endgroup$
2
  • $\begingroup$ Why are you worried about need to adjust your algo for each pokemon? The same algo should apply to each appeared pokemon universally once it detects its appearance on the screen. Also note your reward is sparse and binary at the very end of throw assuming the algo only has one chance to throw for each pokemon. $\endgroup$
    – cinch
    Commented Aug 2 at 23:47
  • $\begingroup$ @cinch Because different pokemon have different circles size and distance. The problem is not so much with the circle size but with the distance of the pokemon, so I would need to adjust the velocity of the swipe. Not necessarily binary the reward since I could also provide also rewards with lesser values. Miss: -1 Normal throw: 0 Nice throw: 1 Great throw: 2 Excellent throw: 3 $\endgroup$
    – zaxunobi
    Commented Aug 18 at 9:39

1 Answer 1

0
$\begingroup$

Yes this is indeed a very plausible approach ! Mind however, that RL is not very sample efficient, so you need a lot of runs for try and error. So it essentially boils down to the question whether you can provide/simulate a sufficient amount of samples to train the RL agent. If so, then I would recommend you to go with a very simple Q-learning approach. No deep neural networks are needed here.

$\endgroup$
1
  • $\begingroup$ I could provide samples as I am playing. I was thinking basically to start with random throws and adjust the aim and velocity as I go accordingly to the Q-table. $\endgroup$
    – zaxunobi
    Commented Aug 18 at 9:44

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .