This is an archived, read-only copy of the United-TI subforum , including posts and topic from May 2003 to April 2012. If you would like to discuss any of the topics in this forum, you can visit Cemetech's Your Projects subforum. Some of these topics may also be directly-linked to active Cemetech topics. If you are a Cemetech member with a linked United-TI account, you can link United-TI topics here with your current Cemetech topics.

This forum is locked: you cannot post, reply to, or edit topics. Project Ideas/Start New Projects => Your Projects
Author Message
axcho


Active Member


Joined: 09 Nov 2004
Posts: 555

Posted: 29 Mar 2006 04:54:20 pm    Post subject:

What do you think about making a ragdoll fighing game for the calculator? It could be in assembly, using just linear math (multiplication and some division). The nice thing about using the Verlet method is that it doesn't require trigonometry! We can also avoid square roots if we can tolerate some springiness in the limbs. And collision detection won't be too big of a problem if we can ignore collisions between certain limbs, and only test between enemies when they are close enough (Special bullet-time feature when you get within striking distance of your opponent! Razz ).

If you know of any good line-drawing routines I could use, let me know. I guess the ragdolls could just be thin stick figures. Instead of sound effects when the sticks hit, the screen could shake and maybe have some particle or plasma effects in the background (using cellular automata or something).

Why not? I mean, if we can do N in TI-BASIC, we can do ragdoll physics in z80! Razz
Back to top
CoBB


Active Member


Joined: 30 Jun 2003
Posts: 720

Posted: 29 Mar 2006 05:40:11 pm    Post subject:

My intuition says it's not feasible, although it's probably borderline. It's not hard to do in theory, but it's a big question whether it can be done fast enough.

Let's see... In each frame, you have to update every particle (there are at least six per player), check for collisions (at least six items per player -> 36 pairs to check plus the boundaries of the arena), calculate their impact and draw lines (at least five per player plus the heads). So at a mere 10 fps we have 550000 clock cycles to do all this (50000 cycles are needed to update the screen). The coordinates need to be at least 16-bit wide (you need at least 8 bits of subpixel accuracy for Newtonian physics to work at all, and it even might not be enough; I used 12 for Death Rally and 16 for the y coordinate in Acelgoyobis, otherwise gravity just wouldn't work). This means about 1000 clock cycles per multiplication or division. Deducting about 50000 cycles for all the drawing operations we're down to about 500 multiplications and divisions altogether, let's say 450 if we account for additions and subtractions as well. That might be enough.
Back to top
alexrudd
pm me if you read this


Bandwidth Hog


Joined: 06 Oct 2004
Posts: 2335

Posted: 29 Mar 2006 08:50:45 pm    Post subject:

Go for it. I know I can't.
Back to top
CoBB


Active Member


Joined: 30 Jun 2003
Posts: 720

Posted: 30 Mar 2006 01:45:03 am    Post subject:

Well, here's an excellent long-term goal to motivate your learning. Neutral
Back to top
axcho


Active Member


Joined: 09 Nov 2004
Posts: 555

Posted: 30 Mar 2006 01:45:51 am    Post subject:

Each ragdoll will ideally have 11 nodes. When they are out of striking distance from each other, there will only be 11 pairs each to check, since I am only going to enforce collision checks between each bone and its parent bone. When they are close enough, we have... bullet-time!

I think there will be 2 division operations per node (1 for length adjustments and 1 for collision detection), for 2*2*11=44 per frame when the ragdolls are far away. When they are close, well, there's a maximum of 44+2*11*11=286 divisions per frame (probably less since I can stop checking collisions after a specified number of hits). For multiplication, I'm getting something like 10 or more per node. It looks like it might be possible...
Back to top
CoBB


Active Member


Joined: 30 Jun 2003
Posts: 720

Posted: 30 Mar 2006 05:01:59 am    Post subject:

axcho wrote:
When they are out of striking distance from each other, there will only be 11 pairs each to check...

Isn't that 10? 4 for the arms, 4 for the legs and 2 for the torso.
Back to top
elfprince13
Retired


Super Elite (Last Title)


Joined: 11 Apr 2005
Posts: 3500

Posted: 30 Mar 2006 08:45:17 am    Post subject:

Neutral thats some in intense calculator gaming.
Back to top
alexrudd
pm me if you read this


Bandwidth Hog


Joined: 06 Oct 2004
Posts: 2335

Posted: 30 Mar 2006 12:33:25 pm    Post subject:

CoBB wrote:
axcho wrote:
When they are out of striking distance from each other, there will only be 11 pairs each to check...

Isn't that 10? 4 for the arms, 4 for the legs and 2 for the torso. [post="73446"]<{POST_SNAPBACK}>[/post]
Head?
Back to top
CoBB


Active Member


Joined: 30 Jun 2003
Posts: 720

Posted: 30 Mar 2006 01:15:22 pm    Post subject:

I believed the head to be firmly mounted to the torso. If it is a distinct particle, then there are 12 particles and 11 pairs per player. Since the figure is a tree (graph-wise), it always has n-1 edges (bones) if it consists of n nodes/particles.
Back to top
axcho


Active Member


Joined: 09 Nov 2004
Posts: 555

Posted: 30 Mar 2006 04:13:53 pm    Post subject:

In the original Ragdoll Masters, the head is a separate node. This makes a big difference in the controls because your head is what you accelerate with the arrow keys! I'll experiment with various skeletal and control systems before settling on one, of course. I think I'll make a Flash version first.

I just drew a picture of the ragdoll, and there are 11 nodes and 10 bones, plus a circle for the head.

2 for the two feet
2 for the two knees
1 for the hips
2 for the two hands
2 for the two elbows
1 for the shoulders
1 for the head

That adds up to 11 nodes! Each one has a bone attached to it, which in the head's case is actually a circle, which calls for a different collision detection method. It would be a lot easier to have headless ragdolls...

[EDIT]
I've been playing Ragdoll Masters on different settings, and I noticed that there is actually no collision detection within one ragdoll! All the limbs of one ragdoll can overlap. Instead, the joints each have a preferred angle which they settle into. I think that means I can cut down on collision detection even more, though I'm not sure of the best way to implement the 'memory' joints without trigonometry.

I also realized that I don't have to check collisions between ragdolls twice; all it takes would be one sweep through. The sweep would probably be arranged so important collisions are tested first, like those that inflict damage, so it can stop testing once both ragdolls have scored a hit (not much point in testing for blocking if you are already hit somewhere else). It's unlikely that you would be damaging two places at the same instant anyway.


Last edited by Guest on 30 Mar 2006 08:03:08 pm; edited 1 time in total
Back to top
IAmACalculator
In a state of quasi-hiatus


Know-It-All


Joined: 21 Oct 2005
Posts: 1571

Posted: 31 Mar 2006 07:48:30 am    Post subject:

You're making a clone of Ragdoll Masters? This could be interesting. ASM or basic? Or have you not decided yet?
Back to top
CoBB


Active Member


Joined: 30 Jun 2003
Posts: 720

Posted: 31 Mar 2006 08:40:23 am    Post subject:

axcho wrote:
Instead, the joints each have a preferred angle which they settle into. I think that means I can cut down on collision detection even more, though I'm not sure of the best way to implement the 'memory' joints without trigonometry.

I'd say invisible springs.
Back to top
axcho


Active Member


Joined: 09 Nov 2004
Posts: 555

Posted: 31 Mar 2006 03:28:18 pm    Post subject:

This is most definitely going to be in assembly!

Quote:
I'd say invisible springs.
I don't know much about invisible springs. Could you explain how that would work? Are they extra limbs that are not drawn and don't respond to collisions?

I've been thinking that maybe ragdolls with fewer joints (straight arms and legs) would be a good alternative if more detailed skeletons are too slow. Also, for the heads, I've decided to use 4x4 sprites that can be customized and displayed with an XOR, probably. At that size, jointed limbs probably wouldn't even look very different from straight ones.

Here are the global settings that I will probably use:
Gravity
Air Resistance
Hit Recoil (from hitting an opponent)
Wall Recoil (from hitting the walls)
Springiness (of limbs)
Flexibility (of joints)

They would be settings in the options screen, and maybe powerups as well. I want to come up with some better names for them though...

Tell me if you have ideas for more settings or better names.
Back to top
CoBB


Active Member


Joined: 30 Jun 2003
Posts: 720

Posted: 31 Mar 2006 04:19:28 pm    Post subject:

axcho wrote:
I don't know much about invisible springs. Could you explain how that would work? Are they extra limbs that are not drawn and don't respond to collisions?

Basically yes. There would be additional constraints that would make certain points converge to certain distances (e. g. between the ends of the neighbouring limbs). That's not much different from bone constraints, there is just an additional constant that would determine the speed of this convergence, effectively the stiffness of the figure.
Back to top
Brazucs
I have no idea what my avatar is.


Super Elite (Last Title)


Joined: 31 Mar 2004
Posts: 3349

Posted: 31 Mar 2006 09:34:47 pm    Post subject:

Topic splitted from here.

Last edited by Guest on 31 Mar 2006 09:41:27 pm; edited 1 time in total
Back to top
Liazon
title goes here


Bandwidth Hog


Joined: 01 Nov 2005
Posts: 2007

Posted: 31 Mar 2006 09:43:49 pm    Post subject:

wow, i'm just confused. axcho, you're just amazing. I hope this works out okay.
Back to top
Fr0stbyte124


Advanced Newbie


Joined: 26 Jan 2006
Posts: 98

Posted: 31 Mar 2006 11:40:33 pm    Post subject:

I think air resistance would be negligable, and real people don't typically bounce when they fall to the ground, so you can treat gravity and floor landing as special case. Think crumpling. Laughing
Back to top
axcho


Active Member


Joined: 09 Nov 2004
Posts: 555

Posted: 01 Apr 2006 12:43:08 am    Post subject:

I was originally planning to have no recoil from the walls (like Ragdoll Masters), but I thought it might be fun to have the option to bounce off the walls like in the animation Rou Bo. Boundary collisions would have to be handled separately anyway, so the default setting would be recoil from your opponent and none from the walls.

Air resistance would be easy to implement, and it would probably be fun to customize as well. It might also be important in preventing your motion from becoming too erratic and fast, though I won't know until I test it.

Quote:
wow, i'm just confused. axcho, you're just amazing. I hope this works out okay.
Thanks, Liazon. But what are you confused about?

Another issue that I have kind of been ignoring is that of the AI. I'm not sure how it will work and still be fast enough. If it doesn't work out though, at least it will still be fun with multiplayer.
Back to top
Liazon
title goes here


Bandwidth Hog


Joined: 01 Nov 2005
Posts: 2007

Posted: 01 Apr 2006 10:38:30 am    Post subject:

Quote:
But what are you confused about?


axcho wrote:
Each ragdoll will ideally have 11 nodes. When they are out of striking distance from each other, there will only be 11 pairs each to check, since I am only going to enforce collision checks between each bone and its parent bone. When they are close enough, we have... bullet-time!

I think there will be 2 division operations per node (1 for length adjustments and 1 for collision detection), for 2*2*11=44 per frame when the ragdolls are far away. When they are close, well, there's a maximum of 44+2*11*11=286 divisions per frame (probably less since I can stop checking collisions after a specified number of hits). For multiplication, I'm getting something like 10 or more per node. It looks like it might be possible...
[post="73443"]<{POST_SNAPBACK}>[/post]


Last edited by Guest on 01 Apr 2006 10:38:44 am; edited 1 time in total
Back to top
Super Speler
Super Awesome Dude


Calc Guru


Joined: 28 Nov 2005
Posts: 1391

Posted: 01 Apr 2006 01:25:15 pm    Post subject:

What would look cool is if you were to have no air resistance and only friction from ground... bouncing off walls and the ground would never be cooler looking.
Back to top
Display posts from previous:   
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
    » Goto page 1, 2, 3, 4  Next
» View previous topic :: View next topic  
Page 1 of 4 » All times are UTC - 5 Hours

 

Advertisement