Wednesday, September 24, 2008

Step 2: Setting up obstacles

After getting the spiral section to move itself correctly and update it's rotation dynamically, I was on to setting up obstacles. I had a few ideas on how I was going to do this. One was that I would integrate a certain material on the spiral, and "link" the obstacle model to the preset material's position. After figuring that the said solution seemed a bit over engineered, I looked at the problem from a different angle.

Modeling one huge spiral and using that in the game would be impractical and not dynamic enough. Due to this, I create my spiral in sections. Each section is the same spiral model with 3 blades, and each section is connected seamlessly to the next. So one section spirals down, you negotiate all it's obstacles. Then, unknown to the player, the next section spirals down and the cycle continues. Then the "used up" section, once out of view, get's relocated to the top and cycles down once again.

So the solution I came up with was to simply position the obstacles correctly on the spiral, then set the spiral as it's parent which in action takes care of their movement, as any child follows it's parent. Positioning all the obstacles was as simple as positioning the first obstacle, then using it's position and rotation, spiral the obstacles around the spiral.

Now I just load the obstacles onto a spiral and let it do it's thing. Now this just leaves some obstacle systems to detect a collision with my character.

Friday, August 29, 2008

Step 1: Getting the spiral to move correctly

Screw Dynamics

Screws are close to the simplest type of machine, it's even classified as a simple machine. When you crank a screw around into say, wood, it vertically translates the blades on the screw up, therefore vertically translating the whole thing down into the wood.

The problem is that I'm not driving a screw into some material, I'm spinning a screw so a character can run on it. This means I need the blades to stay horizontally static. This can me a little hard to understand, but for now just take my word for it.

The Problem
I had to figure out how to keep those blades horizontally still while the whole screw rotated around. At first I was trying to calculate the time it should take for the screw to move horizontally in the given distance using the blade mesh and some odd trig. When I got screwy values, I realized I was over-thinking this problem and there must be a simpler way. So I posted a thread on gamedev.net and sure enough someone was helpful and solved my problem.

The Solution
So, what needs to take place to keep the spiral's blades horizontally static is the spiral needs to move down as it rotates. The hard part is how much to move the spiral down every second. This distance is found by calculating the distance between one blade and the next, technically exactly one period around. Basically this equals the height of the the spiral divided by the number of blades. So if rotating n revolutions per second, one needs to translate ( n * horizontal blade distance) per second. This provided what seemed like correct results.

WOOT! I figured it out! Right?

Well as it happened the blades were mostly static but I could notice them moving slightly. I scratched my head a little and went back to an idea I had before. When the spiral completes a loop it translates back to it's starting point. At this point I wasn't doing anything to the rotation, and therefor it kept incrementing from the last loop. This caused the blades to offset slightly. After every loop I reset the rotation to zero, and now it works perfectly!

Moving On
Now that I've got the spiral moving correctly, I can move on to positioning the character according the the spiral mesh's materials. I also need to start thinking about positioning obstacles and what systems are going to be needed.

Tuesday, August 26, 2008

Intro


Ride the Spiral
"Reaching out to Embrace the Random" - Tool

Overview:
Ride the Spiral is a rhythmic puzzle game based on the Tool song Lateralus and a Fusion Frenzy mini-game called Twisted System. The main character will be thrown into a twisting spiral screw on which he'll have to run and avoid obstacles as they spin towards him. The spiral is composed of regions that have their own special qualities. These regions are called lines of reason, and each line of reason will define it's own gameplay, obstacle avoidance technique, look, and overall experience.