Dear mobile game devs. When I play games like that, I always wonder if it’s the physics engine that’s actually random and produces the result?

Or is the result calculated before the animation happens, and dictates the animation?

I’ve always wondered. I have some notion of programming, but from far back, and I’ve been scratching my head long enough about this.

Thanks in advance.

  • tal@lemmy.today
    link
    fedilink
    arrow-up
    28
    arrow-down
    1
    ·
    8 months ago

    In theory, it could do either – there’s no way of knowing from just looking at a screenshot – but I’d assume that normally, it’s simulating the physics and looking at where the ball winds up to determine the score, and that if the physics engine is deterministic, that any variation from launch to launch in a pachinko simulator would come from slightly varying launch speed and angle.

    If you can manage to get a ball stuck in a game, or if the game can fire multiple balls simultaneously, then I’d say that’d be consistent with it just simulating the physics and determining the outcome from where the ball winds up.

    I don’t really know what the benefit to computing a result in advance would be, unless one has a model that optimizes for player engagement or something.

    • fidodo@lemmy.world
      link
      fedilink
      English
      arrow-up
      3
      ·
      8 months ago

      One thing I’d watch out for as a developer is that players might find a setup to get max points every time, so I’d fuzz the plunger input to make it more random.

      • fidodo@lemmy.world
        link
        fedilink
        English
        arrow-up
        2
        ·
        8 months ago

        In this mini game you have fine control of the plunger, so it’s not just 7 bucket animations but also thousands of launch powers and ricochets you need to account for. I’ve played this game, you can reliably and finely adjust where the ball falls with the plunger, but the ricochets off the bumpers are so aggressive it’s impossible to get a consistent result, plus there could be fuzzing on the plunger input.