Closed DanielBullimore closed 4 years ago
dividing the length of solar year by number of planets would cause eclipses. Not certain but Fibonacci might help ?
a 3,4,7,11 based fib sequence would not have any eclipses in a 4 planet system but maybe taking the solar system description too literal
However if we benchmark two machines A and B. A scored 1000ms loop, B scored 400ms but both machines also scored a 5 planet system. Then we divide both scores by 5 to get a planetary cycle: (Machine A) 1000/5=200ms Cycle (Machine B) 400/5=80ms Cycle; Thus our developers can book an interrupt in "Cycles" on both machines confident that it will be executed in a timely and graceful fashion.
After close consideration, I am thinking every system should have the same number of planets. Dynamic solar systems would make programming needlessly complex for developers who implement the OoMutiny framework. And the bench marked loop timings will still provide tailored performance to individual machines.
Also modeling fib sequences for the different planetary denominations is a total time burner. 3,4,7,11 works lets run it.
My Current version of OGameLoop UML
Sanity check passed
I've had to implement the four planet arrays with in a multi-dimensional called threads. I've done that so I can iterate through it without using the name of a planet etc... This way I can put all 4 threads through one loop as. Better than writing 4 of every logic statement.
Priority: 1
Depends:
Description:
Stable Loop, executes queued interrupts between drawing the "world". Drawing the world involves redrawing all the rendered objects to synchronize their GUI state with their programmatic states. Interrupts are generated by events and are intended to ether act (small immediate animations) or solve (change a instances properties). I envision the loop+interrupt relationship working like an appointment book, except the book is kept by the sun at the center of a solar system.
That suns line of sight is static
The sun only sees interrupts by appointment, but they must be on time
Each page of an appoint book is normally divided into denominated appointment slots. For our sun those slots are its planets
More than one Interrupt can queue on a single planet appointment slot
Interrupts can not queue on the planet furthest from the sun, that slot draws the world
The planets distances from the sun is determined by a benchmark run before the sun ever existed
Each time a planet crosses the suns line of sight, the sun executes one interrupt.
A solar year ends when the most distant planet crosses the suns line of sight it redraws the world (one frame)
As a result the sun can now deal with one off interrupts on a priority basses. A four planet solar system will see its closest planet 4 times before it sees its most distant planet once (complete iteration of the stable loop). Highest priority interrupts go on the closest planet and lower priority on more distant ones. As a cool side effect an HID interrupt on planet 1 might set an interrupt on planet 2 which could be executed before the solar year ends. It also allows 3 intensity settings for high frequency repeating interrupts.
So what I'm trying to do here is remove the time in exact milliseconds from the framework. The number of milliseconds each iteration of the game loop takes is dynamic per machine it benchmarks. So developers implementing my OoMutiny framework couldn't book an interrupt in 67milliseconds if a benchmark determined a 1000 millisecond loop because it wouldn't ever be executed. However if we benchmark two machines A and B. A scored 1000ms solar year (complete loop, 1 frame), B scored 400ms . Then we divide those scores by three to get the first planets cycles per solar year, divide by 4 to get planet 2, 7 for planet 3... Thus our developers can book an interrupt in "Cycles" on both machines confident that it will be executed in a timely and graceful fashion regardless of an individual client machines computing power. Real time can be derived in a Cycles per second benchmark. This one system quickly provides:
UML:
Properties:
Methods: