Author |
Message |
|
kalan_vod
Advanced Member
Joined: 04 Sep 2005 Posts: 446
|
Posted: 08 Apr 2006 01:39:57 am Post subject: |
|
|
Brazucs wrote:
Maybe I was imagining it or it is a different one? |
|
Back to top |
|
|
axcho
Active Member
Joined: 09 Nov 2004 Posts: 555
|
Posted: 09 Apr 2006 10:59:00 pm Post subject: |
|
|
For some reason I was expecting a bigger response to my Flash ragdoll prototype... Maybe you all missed it? |
|
Back to top |
|
|
elfprince13 Retired
Super Elite (Last Title)
Joined: 11 Apr 2005 Posts: 3500
|
Posted: 09 Apr 2006 11:23:17 pm Post subject: |
|
|
wheeee!!!! Im a birdy!!
fun game. I bet you could do that in z80 asm |
|
Back to top |
|
|
IAmACalculator In a state of quasi-hiatus
Know-It-All
Joined: 21 Oct 2005 Posts: 1571
|
Posted: 10 Apr 2006 06:48:50 am Post subject: |
|
|
Yeah, though the legs seem kinda rigid to me. No matter how hard I hit them, they spring back. |
|
Back to top |
|
|
Weregoose Authentic INTJ
Super Elite (Last Title)
Joined: 25 Nov 2004 Posts: 3976
|
Posted: 10 Apr 2006 07:56:08 am Post subject: |
|
|
I'm surprised that no one has provided this yet. |
|
Back to top |
|
|
IAmACalculator In a state of quasi-hiatus
Know-It-All
Joined: 21 Oct 2005 Posts: 1571
|
Posted: 10 Apr 2006 09:39:29 am Post subject: |
|
|
Wow...that is so cool! |
|
Back to top |
|
|
Brazucs I have no idea what my avatar is.
Super Elite (Last Title)
Joined: 31 Mar 2004 Posts: 3349
|
Posted: 10 Apr 2006 11:26:17 am Post subject: |
|
|
Thanks a lot, Goose... I just missed my biology recitation playing that |
|
Back to top |
|
|
AlienCC Creative Receptacle!
Know-It-All
Joined: 24 May 2003 Posts: 1927
|
Posted: 10 Apr 2006 07:58:00 pm Post subject: |
|
|
Brazucs wrote: Thanks a lot, Goose... I just missed my biology recitation playing that [post="75034"]<{POST_SNAPBACK}>[/post]
Now, its not really fair to blame him for a lack of self-control.
--AlienCC |
|
Back to top |
|
|
Weregoose Authentic INTJ
Super Elite (Last Title)
Joined: 25 Nov 2004 Posts: 3976
|
Posted: 10 Apr 2006 08:50:40 pm Post subject: |
|
|
No offense taken... I remember getting an entire computer lab hooked on that back in middle school!
Last edited by Guest on 09 Jul 2006 06:54:23 pm; edited 1 time in total |
|
Back to top |
|
|
Brazucs I have no idea what my avatar is.
Super Elite (Last Title)
Joined: 31 Mar 2004 Posts: 3349
|
Posted: 10 Apr 2006 08:55:37 pm Post subject: |
|
|
AlienCC wrote: Brazucs wrote: Thanks a lot, Goose... I just missed my biology recitation playing that [post="75034"]<{POST_SNAPBACK}>[/post]
Now, its not really fair to blame him for a lack of self-control.
--AlienCC
[post="75093"]<{POST_SNAPBACK}>[/post]
Hence the , lol... |
|
Back to top |
|
|
Madskillz
Active Member
Joined: 02 Jan 2004 Posts: 608
|
Posted: 10 Apr 2006 10:03:51 pm Post subject: |
|
|
axcho, I liked it, I was playing that for a bit would be sweet to see some ragdoll effects in a fighting game for the calc.
By the way, I really like the bush one, that was just plain fun to do. |
|
Back to top |
|
|
axcho
Active Member
Joined: 09 Nov 2004 Posts: 555
|
Posted: 14 Apr 2006 07:20:34 pm Post subject: |
|
|
Quote: Yeah, though the legs seem kinda rigid to me. No matter how hard I hit them, they spring back. That is because of the angle of the springs. The only way to get around that would be to have springs with different flexibility values. Right now you can only change all of them at once.
In case you are wondering, I'm trying to visit UTI less frequently, as in only on the weekends. Anyway, I'll see if I can work some more on this project soon. |
|
Back to top |
|
|
elfprince13 Retired
Super Elite (Last Title)
Joined: 11 Apr 2005 Posts: 3500
|
Posted: 14 Apr 2006 08:57:14 pm Post subject: |
|
|
axcho wrote: In case you are wondering, I'm trying to visit UTI less frequently, as in only on the weekends. Anyway, I'll see if I can work some more on this project soon.
it would probably be beneficiary to my grades if I did the same.....oh well.....Im fine with the occasional B+ |
|
Back to top |
|
|
aforsy the leaping penguin
Active Member
Joined: 13 Jul 2004 Posts: 653
|
Posted: 15 Apr 2006 01:16:43 pm Post subject: |
|
|
well, this looks like it could be the next "everyone's playing it in english class" game! looks sweet |
|
Back to top |
|
|
Arcane Wizard `semi-hippie`
Super Elite (Last Title)
Joined: 02 Jun 2003 Posts: 8993
|
Posted: 15 Apr 2006 06:19:53 pm Post subject: |
|
|
axcho wrote: Quote: Yeah, though the legs seem kinda rigid to me. No matter how hard I hit them, they spring back. That is because of the angle of the springs. The only way to get around that would be to have springs with different flexibility values. Right now you can only change all of them at once.[post="75610"]<{POST_SNAPBACK}>[/post] "flex" should be adjustable per joint/node in the skeleton, is that what you mean, or might that be possible isntead? |
|
Back to top |
|
|
axcho
Active Member
Joined: 09 Nov 2004 Posts: 555
|
Posted: 15 Apr 2006 10:06:53 pm Post subject: |
|
|
Quote: "flex" should be adjustable per joint/node in the skeleton, is that what you mean, or might that be possible isntead? That's pretty much what I meant. Though it isn't really per joint, since it doesn't keep track of angles, only the positions of nodes.
[EDIT]
Okay, I've been thinking of ideas for the game. One thing I thought of is having special abilities that can be activated for a limited time by pressing a button, like the bullet time in Madness Interactive. They would work by temporarily changing the connections and other properties of the nodes. Before each game you would choose one power to use.
(hard limbs damage softer limbs)
Stretchy - limbs become very long and springy.
Metallic - limbs become hard, heavy and rigid.
Cannon - head becomes hard and separate from body.
Swarm - all nodes become loose points connected by springs to head.
I would really appreciate your suggestions or ideas for more abilities.
Last edited by Guest on 16 Apr 2006 02:55:07 pm; edited 1 time in total |
|
Back to top |
|
|
Fr0stbyte124
Advanced Newbie
Joined: 26 Jan 2006 Posts: 98
|
Posted: 21 Apr 2006 07:43:02 pm Post subject: |
|
|
It looks pretty cool. Do you think you could make the source available? I'm curious what all Verlet integration can do.
(Also, with your other demo with the balls, the physics look wrong because you need to conserve momentum and kinetic energy. It ends up being this:)
Code: v1(m1-m2) + 2*m2*v2
V'1 = -------------------
m1 + m2
v2(m2-m1) + 2*m1*v1
V'2 = -------------------
m1 + m2
Of course, v1 and v2 are the vector velocities perpendicular to the collision. The tangent vetor is unchanged. |
|
Back to top |
|
|
axcho
Active Member
Joined: 09 Nov 2004 Posts: 555
|
Posted: 22 Apr 2006 07:24:55 pm Post subject: |
|
|
Here's the source code for my ragdoll simulation. There's some more code scattered around for the buttons and such, but the important stuff is here.
Code: // Ragdoll Physics Engine
// using Verlet integration
// by Alex Cho Snyder
// axchos@yahoo.com
// April 2, 2006
stop();
// set up the global settings
_global.gravity = 0.3;
_global.speed = 5;
_global.drag = 0.96;
_global.flex = 0.3;
// create a pen to draw the ragdoll
createEmptyMovieClip("pen",1);
attachMovie("Head","head",2);
// create a keyboard listener
user = new Object();
Key.addListener(user);
// store frequent keys
var pressed = Key.isDown;
var UP = Key.UP;
var DOWN = Key.DOWN;
var LEFT = Key.LEFT;
var RIGHT = Key.RIGHT;
var ESC = Key.ESCAPE;
var escaping = false;
var settings = true;
// ragdoll nodes
var nodes = 6;
var x = new Array(nodes);
var y = new Array(nodes);
var xo = new Array(nodes);
var yo = new Array(nodes);
var root = new Array(nodes);
var rest = new Array(nodes);
var sproot = new Array(nodes);
var sprest = new Array(nodes);
// set the positions
for (var i = 0; i < nodes; i++) {
x[i] = 225 + int(100*Math.random());
y[i] = 150 + int(100*Math.random());
xo[i] = 225 + int(100*Math.random());
yo[i] = 150 + int(100*Math.random());
}
// connections
root[0] = 0; // shoulders
root[1] = 0; // hips
root[2] = 0; // arm
root[3] = 0; // arm
root[4] = 1; // leg
root[5] = 1; // leg
// bone length
rest[0] = 0; // neck
rest[1] = 30*30; // torso
rest[2] = 40*40; // arm
rest[3] = 40*40; // arm
rest[4] = 60*60; // leg
rest[5] = 60*60; // leg
// spring connections
sproot[0] = 4; // shoulder to leg
sproot[1] = 3; // hip to arm
sproot[2] = 1; // arm to hip
sproot[3] = 2; // arm to arm
sproot[4] = 5; // leg to leg
sproot[5] = 0; // leg to shoulder
// spring length
sprest[0] = 100*100; // shoulder to leg
sprest[1] = 50*50; // hip to arm
sprest[2] = 50*50; // arm to hip
sprest[3] = 70*70; // arm to arm
sprest[4] = 70*70; // leg to leg
sprest[5] = 100*100; // leg to shoulder
// main loop
_root.onEnterFrame = function() {
// toggle settings and springs display
if (pressed(ESC)) {
escaping = true;
} else if (escaping) {
escaping = false;
settings = !settings;
if (settings) {
gotoAndStop(2);
} else {
gotoAndStop(3);
}
}
// update the positions
for (var i = 0; i < nodes; i++) {
var n = x[i] + drag*(x[i] - xo[i]);
xo[i] = x[i];
x[i] = n;
n = y[i] + drag*(y[i] - yo[i]) + gravity;
yo[i] = y[i];
y[i] = n;
}
// move head with arrow keys
if (pressed(UP)) {
y[0] -= speed;
}
if (pressed(DOWN)) {
y[0] += speed;
}
if (pressed(LEFT)) {
x[0] -= speed;
}
if (pressed(RIGHT)) {
x[0] += speed;
}
// spring joints into position
for (var i = 0; i < nodes; i++) {
var xd = x[sproot[i]] - x[i];
var yd = y[sproot[i]] - y[i];
var dlength = sprest[i]/(xd*xd + yd*yd + sprest[i]) - 0.5;
x[i] -= flex*xd*dlength;
y[i] -= flex*yd*dlength;
x[sproot[i]] += flex*xd*dlength;
y[sproot[i]] += flex*yd*dlength;
}
// enforce bone constraints
for (var i = 1; i < nodes; i++) {
var xd = x[root[i]] - x[i];
var yd = y[root[i]] - y[i];
var dlength = rest[i]/(xd*xd + yd*yd + rest[i]) - 0.5;
x[i] -= xd*dlength/2;
y[i] -= yd*dlength/2;
x[root[i]] += xd*dlength/2;
y[root[i]] += yd*dlength/2;
}
// enforce boundaris
for (var i = 0; i < nodes; i++) {
if (x[i] < 0) {
xo[i] = x[i];
x[i] = 0;
} else if (x[i] > 550) {
xo[i] = x[i];
x[i] = 550;
}
if (y[i] < 0) {
yo[i] = y[i];
y[i] = 0;
} else if (y[i] > 400) {
yo[i] = y[i];
y[i] = 400;
}
}
// put head on shoulders
head._x = x[0] + (x[0] - x[1])/3;
head._y = y[0] + (y[0] - y[1])/3;
// draw the lines
pen.clear();
for (var i = 0; i < nodes; i++) {
pen.lineStyle(10, 0x999999);
pen.moveTo(x[i], y[i]);
pen.lineTo(x[root[i]], y[root[i]]);
}
// draw the springs
if (settings) {
for (var i = 0; i < nodes; i++) {
pen.lineStyle(2, 0x00FFFF);
pen.moveTo(x[i], y[i]);
pen.lineTo(x[sproot[i]], y[sproot[i]]);
}
}
}
gotoAndStop(2);
Also, thanks for the equations. I'm not sure if I will change the program though. The whole point is that it is an incrementally more accurate simulation of real physics. The final mode is still a few steps away from including energy conservation concepts. |
|
Back to top |
|
|
axcho
Active Member
Joined: 09 Nov 2004 Posts: 555
|
Posted: 04 Jun 2006 06:52:01 pm Post subject: |
|
|
I found Jim e's line drawing routine.
I haven't forgotten about this project. I'll probably start on it once I finish N - so maybe in a few weeks.
I'm trying to decide how to do multiplayer. Should it be by link cable or by sharing a calculator, or both? Also, should there be character customization so you can spend points to change the shape of your ragdoll? I'm thinking it might be easier to have unlockable characters instead (or special powers).
Please post your suggestions here. |
|
Back to top |
|
|
Liazon title goes here
Bandwidth Hog
Joined: 01 Nov 2005 Posts: 2007
|
Posted: 04 Jun 2006 07:44:19 pm Post subject: |
|
|
Jim e's line routine looks extremely useful for this project. So i'm guessing the 40% faster version means you can't use an interrupt for a timer or greyscale?
Last edited by Guest on 04 Jun 2006 07:44:42 pm; edited 1 time in total |
|
Back to top |
|
|
|