selgus, on Fri Jan 1, 2010 3:57 PM, said:
I haven't released it yet, so still a WIP. It uses the 3D endpoints of a grid to generate fractal lines that make up the 3D viewport mountains (player/missiles along with playfield graphics).
That sounds impressive. Anything you can show already?
Mine also updates the calculations every 3rd frame (so 20Hz), though the display is rendered every frame. I do the viewport calculation in 1/60th, HUD updates 1/60th and then game logic the last 1/60th.
I've developed a quite nice scheduling algorithm for my demo. I splits the off-screen processing into several tasks (e.g. clear buffer, plot all lines). Each task gets a worst case processing time (TIM64T values). Some tasks are split into repeated sub tasks (e.g plot a line), because they don't fit into VBLANK or Overscan time as a whole.
The scheduler is pretty simple. It checks if there is enough time for the next task and runs it if there is. If the task has subtasks, the time checked is the time required for a single subtask. The scheduler is called twice each frame (VBLANK and Overscan).
Normal tasks do their job and increase the task number.
Task with subtasks, iterate those subtasks as long as there is enough time left. They increase the task number after all subtasks are processed.
When all tasks are done the task loop starts again.
I'm currently using 1K of RAM for doing the double buffered 3D viewport and the fractal structures, and the 256 byte RAM windows for the HUD structures... though the original plan was to create my own banking selection on Harmony, to allow exactly what the game would need.
That would work with the bankswitching I am using too.
I am using 2x768 bytes for the frame buffer and plan to use the remaining extra 2x256 bytes other stuff.