In case anyone's wondering, I haven't given up on Grapnel 2. It's approaching finals week and I've got a lot of grading to do. Right after that I have some family business to attend to. But then it'll be summer and I'll have a lot more time to work on this.
In the mean time, I'm trying to figure out what to do with the game. I don't really like how the new physics are working. I might just use the same physics as Grapnel 1 but leave the extra bits in just for the graphics. It seems like a bit of a waste though.
Thursday, May 3, 2012
Sunday, March 18, 2012
Control
The control scheme's been throwing me off. The physics code works fine until I try and get it to react to the mouse. Nothing I've tried works very well.
My first thought was to have the mouse control the rotation of the center joint of the character. (The character is made up of three points with a single joint at the middle point.) Doing that interferes with the rest of the physics code though. I can't really tell how it feels to play because of that. (Verlet physics isn't great at handling rotational constraints.)
My second try was to just move either the hands or feet towards the mouse. That works better, especially with a bit of code to prevent the center of mass from moving. Unfortunately, it makes the rope really springy when you move the mouse around. It's too hard to play.
For a third try, I went back to the original method of just adding a force towards the mouse. Applying the force to the hands or feet works fairly well, but doesn't give much control over doing flips and the like.
For the moment, I'm trying to apply a force on the hand or feet towards the mouse, and a force on the joint away from the mouse. This should give the player some ability to flip without making the rope too bouncy or other such errors. Now I've just got to get the numbers right.
Using the Verlet physics does miss one thing though. Raising your arms should increase your moment of inertia, which makes you spin more slowly. The Verlet ragdoll model doesn't track moment of inertia explicitly, and I don't know if it works implicitly. I suppose it doesn't matter too much, since you'd probably want to control both the arms and legs to really take advantage of something like that.
Posted by Sepia Mage (a.k.a. MagiMaster, ArchMageOmega) at 9:29 PM 0 comments
Labels: grapnel, physics, video games
Saturday, March 17, 2012
More Physics
I've been working on the physics today. I think I'm going to stick with Verlet integration, but add a few more details. The player is now represented by 3 points instead of just the 1. Now I need to figure out how to handle the controls. With Verlet integration, just moving the points around to point at the mouse causes the player to go flying around without much control.
I want the mouse to control the arm when the player isn't on the rope, and then apply a bit of rotational friction to the feet to allow the player to do flips. Then, when they're swinging around, the mouse should control the feet to allow them to build up some momentum to move forward.
Conservation of momentum is important, but tricky. I suppose I don't need it to be perfect, but flying around by shaking the mouse should be discouraged. :P
Posted by Sepia Mage (a.k.a. MagiMaster, ArchMageOmega) at 7:45 PM 0 comments
Labels: grapnel, physics, video games
Friday, March 16, 2012
Grapnel Physics and Grapnel 2 Graphics
I wouldn't have expected it, but Inkscape is actually really good for pixel art.
For Grapnel 2, I'm currently imagining multiple areas to swing through, differing in graphics and the mix of traps to dodge. For the moment, I'm working on the classic Temple zone. I'll add others once everything else is working.
Anyway, here's what graphics I've got so far. It's enough to get started at least. The arms and the body are separated so they can rotate individually. They look a lot better when put together.



Now I've got to work out how to handle the physics of someone swinging around on a line.
The physics in Grapnel 1 was actually pretty simple. I used Verlet integration and treated the rope as a stiff spring if it was being stretched (and nonexistent if it wasn't). With gravity and a small acceleration towards the mouse cursor, IIRC, that's about all there is to it.
In Grapnel 2, I want to get rid of the artificial acceleration. Instead, I'm going to make the mouse control the torque applied between the arm and the body. That should give a much more realistic (and hopeful more interesting) control mechanic. It should also allow me to give bonuses for doing flips and such.
Posted by Sepia Mage (a.k.a. MagiMaster, ArchMageOmega) at 5:49 PM 0 comments
Labels: graphics, grapnel, physics, video games