this post was submitted on 02 Feb 2024
73 points (95.1% liked)

Ask Lemmy

26890 readers
1752 users here now

A Fediverse community for open-ended, thought provoking questions

Please don't post about US Politics. If you need to do this, try [email protected]


Rules: (interactive)


1) Be nice and; have funDoxxing, trolling, sealioning, racism, and toxicity are not welcomed in AskLemmy. Remember what your mother said: if you can't say something nice, don't say anything at all. In addition, the site-wide Lemmy.world terms of service also apply here. Please familiarize yourself with them


2) All posts must end with a '?'This is sort of like Jeopardy. Please phrase all post titles in the form of a proper question ending with ?


3) No spamPlease do not flood the community with nonsense. Actual suspected spammers will be banned on site. No astroturfing.


4) NSFW is okay, within reasonJust remember to tag posts with either a content warning or a [NSFW] tag. Overtly sexual posts are not allowed, please direct them to either [email protected] or [email protected]. NSFW comments should be restricted to posts tagged [NSFW].


5) This is not a support community.
It is not a place for 'how do I?', type questions. If you have any questions regarding the site itself or would like to report a community, please direct them to Lemmy.world Support or email [email protected]. For other questions check our partnered communities list, or use the search function.


Reminder: The terms of service apply here too.

Partnered Communities:

Tech Support

No Stupid Questions

You Should Know

Reddit

Jokes

Ask Ouija


Logo design credit goes to: tubbadu


founded 1 year ago
MODERATORS
 

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.

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 9 points 9 months ago (3 children)

The cheapest way to do this is to let the animation (the physics simulation) determine the result.

Picking a bin for the ball to go into, then working backward from that to an animation that looks like it’s following the same physics at other animations, is far more computational work.

Therefore, my money is on the animation determines the result. Now, it may be pre-determined from parameters, but that doesn’t mean it’s predictable, due to a concept called “computational irreducibility”.

[–] [email protected] 2 points 9 months ago (1 children)

You could very easily just project the last bounce, and if it's going to go into the good spot, cheat and adjust the path, based on predetermined odds. It wouldn't be hard at all to turn a 1 in 7 chance if the physics would be uniformly distributed without cheating into 1 in 700.

[–] [email protected] 1 points 9 months ago

True. I think this happens with pinball recall for lumosity. The level you’re on isn’t correlated to the number of bumpers on the board, but to path length. I figure they just try paths until one’s sufficiently long to be a challenge to the player.

Unfortunately it has the opposite effect. I look at the board and my eyes instantly calculate all the paths and one’s the longest. No working memory required on my part. And that longest path is where the ball’s coming in 90% of the time. It sucks.

load more comments (1 replies)