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.

  • JakenVeina@lemm.ee
    link
    fedilink
    English
    arrow-up
    10
    ·
    10 months ago

    If the animations look realistic, it’s almost certainly not predetermined. That’s by far the simplest way to get the desired effect. However, that doesn’t mean it’s fair. It could easily use a real physics engine, but still subtly rig the system. For example, bounces off of the pins could have an elasticity factor of 0.4 for bounces towards the big prize, but 0.5 for bounces away from it. Or maybe the hitboxes on the center pins are just a little bit bigger. Stuff that will noticably affect the large-scale statistics, but that you’re not gonna notice with your eyes.

    • infinitepcg@lemmy.world
      link
      fedilink
      arrow-up
      2
      ·
      10 months ago

      If the animations look realistic, it’s almost certainly not predetermined

      You could do a perfectly realistic simulation, record the path for each outcome and then play one of them.

      Or, if the physics simulation is deterministic, you could store a set of starting positions and their outcomes.