Pages: 1 2
Author Topic: Collisions  (162,292 Views)
Offline (Unknown gender) Josh @ Dreamland

Prince of all Goldfish
Developer
Joined: Feb 2008
Posts: 2,950
View profile
Posted on: March 26, 2010, 10:05:17 PM
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?
Offline (Unknown gender) RetroX

Master of all things Linux
Contributor
Joined: Apr 2008
Posts: 1,055
View profile
Reply #1 Posted on: March 26, 2010, 11:05:27 PM
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.
Offline (Unknown gender) Josh @ Dreamland

Prince of all Goldfish
Developer
Joined: Feb 2008
Posts: 2,950
View profile
Reply #2 Posted on: March 26, 2010, 11:25:41 PM
Luda was just remarking about how easy that'd be to implement. He doesn't feel like signing on right now, though. *shrug*
Offline (Unknown gender) Rusky

Resident Troll
Joined: Feb 2008
Posts: 954
View profile WWW
Reply #3 Posted on: March 26, 2010, 11:34:28 PM
How about collision_polygon? It'd be just as easy, and you could give sprites polygonal masks rather than just squares.
Offline (Unknown gender) Josh @ Dreamland

Prince of all Goldfish
Developer
Joined: Feb 2008
Posts: 2,950
View profile
Reply #4 Posted on: March 27, 2010, 12:02:16 AM
*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.
Offline (Unknown gender) RetroX

Master of all things Linux
Contributor
Joined: Apr 2008
Posts: 1,055
View profile
Reply #5 Posted on: March 27, 2010, 12:25:37 AM
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?
Offline (Unknown gender) Josh @ Dreamland

Prince of all Goldfish
Developer
Joined: Feb 2008
Posts: 2,950
View profile
Reply #6 Posted on: March 27, 2010, 12:30:34 AM
min(x,y,z) = min(x,min(y,z))
Offline (Unknown gender) RetroX

Master of all things Linux
Contributor
Joined: Apr 2008
Posts: 1,055
View profile
Reply #7 Posted on: March 27, 2010, 01:16:35 AM
Quote from: Josh @ Dreamland on March 27, 2010, 12:30:34 AM
min(x,y,z) = min(x,min(y,z))
for up to 64 arguments?
Offline (Unknown gender) Josh @ Dreamland

Prince of all Goldfish
Developer
Joined: Feb 2008
Posts: 2,950
View profile
Reply #8 Posted on: March 27, 2010, 01:17:07 AM
For as many as you like.
Offline (Unknown gender) RetroX

Master of all things Linux
Contributor
Joined: Apr 2008
Posts: 1,055
View profile
Reply #9 Posted on: March 27, 2010, 01:20:46 AM
Quote from: Josh @ Dreamland on March 27, 2010, 01:17:07 AM
For as many as you like.
How can you manage this with cstdarg?  Or was it something else
Offline (Unknown gender) serprex

Smooth ER
Developer
Joined: Apr 2008
Posts: 106
View profile WWW
Reply #10 Posted on: March 27, 2010, 02:14:22 AM
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
Offline (Unknown gender) kkg

Member
Joined: Nov 2009
Posts: 84
View profile
Reply #11 Posted on: March 27, 2010, 08:55:24 AM
I thought Box2D only supported convex polygons, and not concave polygons D:

Correct me if I'm wronggggg
Offline (Unknown gender) score_under

Member
Joined: Aug 2008
Posts: 308
View profile
Reply #12 Posted on: March 27, 2010, 12:36:29 PM
Quote from: RetroX on March 27, 2010, 01:20:46 AM
Quote from: Josh @ Dreamland on March 27, 2010, 01:17:07 AM
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.
Offline (Unknown gender) Josh @ Dreamland

Prince of all Goldfish
Developer
Joined: Feb 2008
Posts: 2,950
View profile
Reply #13 Posted on: March 27, 2010, 12:59:33 PM
I think he's remembering the good ol' days when I was satisfied just to have 4x as many as Mark.
Offline (Unknown gender) TheExDeus

Developer
Joined: Apr 2008
Posts: 1,860
View profile
Reply #14 Posted on: March 27, 2010, 01:10:52 PM
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.
Pages: 1 2