Wheelchair Stunts development

Now Iv'e done all the 'trying stuff out' I need to get on. There is a stack of refactoring to do which I'll do as I go but I need to get the game stuff in there.

 

Tonight, I made a start on the selecting of your character and dropping the guy into the ramp. It's pretty much a key part. There will be probably 5 selectable characters along the top of the screen which you can drag down and place on the ramp, slide up and down till your happy with the position and let him go.

 

I think this will involve a Player object that docks to the top of the screen that can be dragged to a point where it then becomes an actual Chair which you continue to drag down onto the ramp.

 

I've already tested the dragging of my wheelchair object but it has a major issue, well  2 major issues. As the back wheel is heavier it rotates over to this side so is difficult to drop where you want it. Also, because of the elasticity in the wheel joints, if you catch a wheel on the corner of the ramp or somewhere it gets left behind until it can spring back or if you slam it down to hard you get the wheels splaying all over the place.

Worse though, is the tunneling effect if you drag the chair to fast. It's possible to drag it right through the ramp. These need sorting pdq!

 

 

 

Player selection

Had a great idea to solve the issues dragging the chair around. Create a single block with a fully rendered wheelchair texture applied. This solves the problem with weight and rotation over to the heavy side and it also solves the issue with bumping into the scenery and the wheels springing off. 

So, now im dragging the avatar of the player down off the menu bar which I destroy and replace with a physics block textured to look like a chair then when it collides with the ramp I destroy that and create the full wheelchair object in its place. Lovely.

Still the tunneling issue exists which Im to resolve at some point. Seen an article about using impulse to move the object in the direction of the mouse rather than drag the obejct to where the mouse pointer is. Sounds interesting but need to try it out.

More refactoring

Everything is on hold! Im refactoring everything. My base classes arn't right and not flexible enough, in fact the more I look at it, its a bit of a mess.

The thing with a physics engine is that your objects only exist in a virtual world so any object you create just goes of and does its own thing. You need to link it to a graphical element, easy done but I need a more cleaner separation of the 2 so I can create world objects with a polygon object attached or a polygon object that is not part of the physics world but derive from the same polygon base. Im not able to do this right now, my world ojects are too tightly linked to their visual element and I need to fix that.

 

Coming together - stage1

Big refactoring project pretty much done and is a lot cleaner now. 

I can have a canvas object that can exist on the screen and can interact with the mouse, I can also create a physics body that inherits the same polygon base or exist on its own. 

I can drag them about if needed or not and I any object that I create can broadcast its own events back up to the application manager.

Should have got this in place a lot earlier in honesty and using the Angry Nerds project as my base perhaps wasn't the best idea as these object were too specialised but non the less it's been an interesting exercise.

Just a few steps away now from the basic game mechanics of dragging charaters down onto the ramp and shooting them off. This will be a significant stage and then it will be on to making a game from it and polishing.

Wasn't too bothered about the 'shiny' stuff when I started but now I'm really in the zone with this and aiming to get a pretty slick game completed even if it is **it! 

It's not working

Something happenend! 

I'm battling with the frame rates and update cycles and its just isn't happening! Never a problem with Angry Nerds but with WS its all over the place. Im getting this horrible stutter randomly and have tried a whole bunch of stuff to fix but its just not right and I'm not happy with it.

Have slowed the silverlight rendering down to 30fps and adjusted the world.step timing to match. It's 'ok' but I'm at the stage where I'm considering the dreaded 'Unity'.

Actually, I don't mean 'dreaded', I've looked at some examples and tutorials and it looks ok, in fact its downloaded and installed and on my other monitor as I type this. So, I'm going to give it a go and open a new chapter in my game dev languages/toolkits.

68000 assembler

AMOS (A compiled Amiga basic)

C

Flash

Silverlight

 

Apart from the first 3 I need to actually finish one of these so Unity it is and hopefully Wheelchair Stunts is still a goer. 

As a side note, I've also just seen a Wii U Party minigame that is remarkably like WS that is in 3D. Subconciously this may be the reason for the switch to Unity, I don't know. However it is remarkably similar. Its skateboards and you have to gauge how far up the ramp to start your run, except for the wheelchairs and the jumps, its exactly the same!

Correction, It's all working beautifully

As much as I enjoyed playing about with Unity, it wasn't really doing it for me! I started to miss the actual coding. I loved developing my own objects and watching them work, I enjoyed figuring out the solutions to the problems thrown in my way and I really missed doing stuff like making an object explode and working out how to break it apart and fly off in different directions!

So, I re visited this frame rate thing. There are plenty of silverlight games out there so it must be possible.

One thing I learned from unity was how unity used deltatime to keep the phsics update in time with your game frame rate. I looked deeped into some of the farseer silverlight demos and lo and behold I find a class named GameTime and its used to make fixed or variable frame rate world updates.

 

So, I borrowed this and implemented a version of my own and used to control my world updates. I also set the Silverlight container's MaxFrameRate to match. After some trial and error, 30fps seems to be about right with variable timestep.

 

 

 

Fixed vs Variable frame rate

Sorting out the framerate and world updates has improved everything. It's running nice and smooth now and has put me back on track.

One problem has occurred. My objects are bouncing around off each other and collapsing bizarrely. At the end of my runway I have a pyramid of blocks. I know these are stacked correctly but are just collapsing under each other. Was a real headache but It turned out to be the variable framerate! if I switched to fixed frame rate the problem goes away.

 

What to do.

In the end it was simple enough. Setup the scene in fixed then when all the objects are down switch it to variable to play. Thats fixed it although I still don't really know why.

Game mechanics revisited

Not having worked on stunts for some time and now with my game timings all sorted, I needed to look at the game mechanics a fresh.

First thing was to redo the chair. No longer is it a box on wheels, it now has a base and a back and is more chair like. Secondly, I needed a new object. Up until now world objects had a screen object that was the same size and shape. Ive modified my polyobject to have a different sized and shape screen object from the world object. This allows me to skin an object to allow things to go behind it.

 

Next, a driver. I was going to just have a skin that looks like it has one but I really want a separate guy in the seat that can move and fall out. Keeping him from falling out will form part of the game.

Adding the stunt driver

The driver is just a rectangle stood on its end and sits on the seat of the chair. I would have loved it be unattached and did some tests with it as it was but at first he just keeps pinging off.

Was a real headscratcher until I just noticed hes colliding with the rear wheel! So after some repositioning, althought he sits nicely he just falls off on the ramp.

 

So Ive attached him with a revolute joint by his arse to the seat. This works really well albeit a bit 'floppy'. Hes all over the place. So I restricted his angle of movement by +- 10 degrees and added a motor so he can now lean forward and back.

 

I was hoping that I could get him to lean during flight to affect the pitch and yaw ( we need to do somersaults of course) but it wasnt particularly effective.

 

Ive added some controls now so I can apply brake and lean. More testing..