Precalculated ball physics system

Started by
1 comment, last by Multiverse 18 years, 1 month ago
Hi there, I know this sounds like it shoud be in the maths/physics forum, but I'm interested in the design of the system rather than the actual physics. Basically I'm creating a billiards game, and due to the limited processing power available (im making it on a mobile phone, hence I'm using java) I want to precalculate all the physics so that the calculations don't have to be done at run time (i.e. when the balls are moving). My problem is how/where do I store the precalculated data, and how do I use the data for the shot? I figure I need some kind of event class that can store event information such as ball-ball collision, movement vector after collision, time of event etc. Now, should the balls store their own list of events, and react to them when they update? or should there be a seperate class that stores all the events and sends messages to the balls when an event occurs? Is there another way to do it? Do you know which system would be more efficient/accurate? I heard that Jimmy White's snooker precalculated all the physics, which is where i got the idea from. Does anyone know how it was done in that game? And are there any articles on creating such a system? Thanks in advance.
Advertisement
So, your precalculated physics creates a script for each ball. That seems like a good idea. Now the question is how do you execute the scripts? Does each ball update its motion each frame according to its script, or does each ball continue its current motion until it gets a message telling it to change. Either way will probably work and I can't think of any obvious reason to choose one over the other. I would probably choose the former because I am not a big fan of message systems.
John BoltonLocomotive Games (THQ)Current Project: Destroy All Humans (Wii). IN STORES NOW!
thanks for the reply JB. I havn't had time to try to implement this yet, since I've been working on other things (mobile development is a bit of a minefield, but thats another story), if I do eventually manage to get time to do this I'll post here with some info on how I did it and how well it turned out.

Unlesss someone has anything else to add? ;)

This topic is closed to new replies.

Advertisement