Pages: 1 2 »
  Print  
Author Topic: Collisions  (Read 34326 times)
Offline (Male) Josh @ Dreamland
Posted on: March 26, 2010, 05:05:17 pm

Prince of all Goldfish
Developer
Location: Pittsburgh, PA, USA
Joined: Feb 2008
Posts: 2950

View Profile Email
Luda is back!

He offered to take up collisions again today, which is good news for the project. Luda wrote the original system used in R3, which I implemented rather poorly (no collision event), but it has since been over a year and it is safe to say we're both "on top of shit."

He apparently has hatched a plan for improving collisions to operate in O(n*log n) rather than O(n**2) like most systems. I'm not sure what time GM operates in, but frankly, who gives a crap; Luda's were faster than Mark's last time. (At least, as far as I can tell. I thought Mark was supposed to be an expert on collisions?)

Anyway, I'm personally tickled pink. Luda learned not long after making the original system that he could improve it by using integers instead of bytes (somehow that wasn't common knowledge at the time, now it's so obvious...), and with his new Quad Tree idea, we should be cooking with gas.

Also, I'd like to remind everyone that DLLs are also part of the equation now. These systems are the two things that everyone concurred are all that's left to set ENIGMA and GM apart. Let's hope we don't blow this, eh?
« Last Edit: March 26, 2010, 09:13:10 pm by Josh @ Dreamland » Logged
"That is the single most cryptic piece of code I have ever seen." -Master PobbleWobble
"I disapprove of what you say, but I will defend to the death your right to say it." -Evelyn Beatrice Hall, Friends of Voltaire
Offline (Male) RetroX
Reply #1 Posted on: March 26, 2010, 06:05:27 pm

Master of all things Linux
Contributor
Location: US
Joined: Apr 2008
Posts: 1055
MSN Messenger - classixretrox@gmail.com
View Profile Email
Would it be possible to implement collision_triangle at some point, once the GM functions are done?  That seems to be pretty much the only one that's missing.
Logged
My Box: Phenom II 3.4GHz X4 | ASUS ATI RadeonHD 5770, 1GB GDDR5 RAM | 1x4GB DDR3 SRAM | Arch Linux, x86_64 (Cube) / Windows 7 x64 (Blob)
Quote from: Fede-lasse
Why do all the pro-Microsoft people have troll avatars? :(
Offline (Male) Josh @ Dreamland
Reply #2 Posted on: March 26, 2010, 06:25:41 pm

Prince of all Goldfish
Developer
Location: Pittsburgh, PA, USA
Joined: Feb 2008
Posts: 2950

View Profile Email
Luda was just remarking about how easy that'd be to implement. He doesn't feel like signing on right now, though. *shrug*
Logged
"That is the single most cryptic piece of code I have ever seen." -Master PobbleWobble
"I disapprove of what you say, but I will defend to the death your right to say it." -Evelyn Beatrice Hall, Friends of Voltaire
Offline (Male) Rusky
Reply #3 Posted on: March 26, 2010, 06:34:28 pm

Resident Troll
Joined: Feb 2008
Posts: 954
MSN Messenger - rpjohnst@gmail.com
View Profile WWW Email
How about collision_polygon? It'd be just as easy, and you could give sprites polygonal masks rather than just squares.
Logged
Offline (Male) Josh @ Dreamland
Reply #4 Posted on: March 26, 2010, 07:02:16 pm

Prince of all Goldfish
Developer
Location: Pittsburgh, PA, USA
Joined: Feb 2008
Posts: 2950

View Profile Email
*doesn't see difference between collision_polygon and collision_triangle*
Would take an extra five lines of code.

I was thinking about just writing a wrapper to Box2D, really. Would take care of most such needs. Luda had started working on an engine that allowed for several polygon-based collisions...
I'm more concerned with bitmasks for GM-simulation purposes (Can't really think of a time where a quad wouldn't cut it that Box2D wouldn't be favorable).

Also, 1337th post in Announcements.
Logged
"That is the single most cryptic piece of code I have ever seen." -Master PobbleWobble
"I disapprove of what you say, but I will defend to the death your right to say it." -Evelyn Beatrice Hall, Friends of Voltaire
Offline (Male) RetroX
Reply #5 Posted on: March 26, 2010, 07:25:37 pm

Master of all things Linux
Contributor
Location: US
Joined: Apr 2008
Posts: 1055
MSN Messenger - classixretrox@gmail.com
View Profile Email
Random question that goes somewhat along with collision_polygon: how did you manage to get max() and min() working (they're marked as done on the list) without a separate variable for the number of arguments?  Was it because of the parser adding them in?
Logged
My Box: Phenom II 3.4GHz X4 | ASUS ATI RadeonHD 5770, 1GB GDDR5 RAM | 1x4GB DDR3 SRAM | Arch Linux, x86_64 (Cube) / Windows 7 x64 (Blob)
Quote from: Fede-lasse
Why do all the pro-Microsoft people have troll avatars? :(
Offline (Male) Josh @ Dreamland
Reply #6 Posted on: March 26, 2010, 07:30:34 pm

Prince of all Goldfish
Developer
Location: Pittsburgh, PA, USA
Joined: Feb 2008
Posts: 2950

View Profile Email
min(x,y,z) = min(x,min(y,z))
Logged
"That is the single most cryptic piece of code I have ever seen." -Master PobbleWobble
"I disapprove of what you say, but I will defend to the death your right to say it." -Evelyn Beatrice Hall, Friends of Voltaire
Offline (Male) RetroX
Reply #7 Posted on: March 26, 2010, 08:16:35 pm

Master of all things Linux
Contributor
Location: US
Joined: Apr 2008
Posts: 1055
MSN Messenger - classixretrox@gmail.com
View Profile Email
min(x,y,z) = min(x,min(y,z))
for up to 64 arguments?
Logged
My Box: Phenom II 3.4GHz X4 | ASUS ATI RadeonHD 5770, 1GB GDDR5 RAM | 1x4GB DDR3 SRAM | Arch Linux, x86_64 (Cube) / Windows 7 x64 (Blob)
Quote from: Fede-lasse
Why do all the pro-Microsoft people have troll avatars? :(
Offline (Male) Josh @ Dreamland
Reply #8 Posted on: March 26, 2010, 08:17:07 pm

Prince of all Goldfish
Developer
Location: Pittsburgh, PA, USA
Joined: Feb 2008
Posts: 2950

View Profile Email
For as many as you like.
Logged
"That is the single most cryptic piece of code I have ever seen." -Master PobbleWobble
"I disapprove of what you say, but I will defend to the death your right to say it." -Evelyn Beatrice Hall, Friends of Voltaire
Offline (Male) RetroX
Reply #9 Posted on: March 26, 2010, 08:20:46 pm

Master of all things Linux
Contributor
Location: US
Joined: Apr 2008
Posts: 1055
MSN Messenger - classixretrox@gmail.com
View Profile Email
For as many as you like.
How can you manage this with cstdarg?  Or was it something else
Logged
My Box: Phenom II 3.4GHz X4 | ASUS ATI RadeonHD 5770, 1GB GDDR5 RAM | 1x4GB DDR3 SRAM | Arch Linux, x86_64 (Cube) / Windows 7 x64 (Blob)
Quote from: Fede-lasse
Why do all the pro-Microsoft people have troll avatars? :(
Offline (Female) serprex
Reply #10 Posted on: March 26, 2010, 09:14:22 pm
Smooth ER
Developer
Joined: Apr 2008
Posts: 106

View Profile WWW
It's called parsing. You parse the fold into multiple calls. Get it? Because you parse it. Also inlining makes it nice. But you don't parse for that
Logged
Offline (Male) kkg
Reply #11 Posted on: March 27, 2010, 03:55:24 am

Member
Location: Australia
Joined: Nov 2009
Posts: 84
MSN Messenger - kamikazigames@gmail.com
View Profile Email
I thought Box2D only supported convex polygons, and not concave polygons D:

Correct me if I'm wronggggg
Logged
PC: Core i7-2600 @ 3.8ghz | 4x 4gb G.Skill RipjawZ DDR3-2000 | GTX580 | Win7 x64
Time is the greatest teacher, however it kills every single one of its pupils.
Offline (Unknown gender) score_under
Reply #12 Posted on: March 27, 2010, 07:36:29 am

Member
Joined: Aug 2008
Posts: 308

View Profile
For as many as you like.
How can you manage this with cstdarg?  Or was it something else
Wait, do C compilers not support more than 64 arguments? Nothing about the calling convention is actually preventing them.
Logged
Offline (Male) Josh @ Dreamland
Reply #13 Posted on: March 27, 2010, 07:59:33 am

Prince of all Goldfish
Developer
Location: Pittsburgh, PA, USA
Joined: Feb 2008
Posts: 2950

View Profile Email
I think he's remembering the good ol' days when I was satisfied just to have 4x as many as Mark.
Logged
"That is the single most cryptic piece of code I have ever seen." -Master PobbleWobble
"I disapprove of what you say, but I will defend to the death your right to say it." -Evelyn Beatrice Hall, Friends of Voltaire
Offline (Unknown gender) TheExDeus
Reply #14 Posted on: March 27, 2010, 08:10:52 am

Developer
Joined: Apr 2008
Posts: 1860

View Profile
If you use min(x,y,z) = min(x,min(y,z)) then there is no limit to the number of arguments (as it uses only 2). It just makes more calls with every argument.

edit: It would seem to be slow, but I think you can make everything as via-ass as possible and still get 500% speed increase over GM.
Logged
Pages: 1 2 »
  Print