Home  | Login  | Register  | Help  | Play 

RE: Flash Q&A Thread 4

 
Logged in as: Guest
  Printable Version
All Forums >> [Gaming Community] >> [Legends and Lore] >> Artists of Legend >> Art Academy >> RE: Flash Q&A Thread 4
Page 6 of 30«<45678>»
Forum Login
Message << Older Topic   Newer Topic >>
8/30/2007 18:02:05   
somebody621
Member

Hey, Eragon, can you describe your system to me?
Post #: 126
8/30/2007 18:58:19   
flsg
Member

somebody621: did you received my PM? lol
I think it works like that:
he gets the x and y limits of the mc(so a rectangle collision). by calculating the x and y positions, he gets the direction. Then he does the same thing to another mc. Then he calculates to see if the x and y coordinates(of the limits) are bigger/smaller than the other mc's. If they do, there's a collision.
AQ  Post #: 127
8/30/2007 21:31:28   
EragonZZZZ
Member

Nopes. Not even close :P
My system took a lot of mathy stuff and a bit of eyeballing to see if it would work. Thus far, it's pretty damn sweet.
However, it's made for an art-based game, so it's based on doing accurate collision detection on VERY irregular shapes.

Take Object1 and Object2
(suppose both are longer than they are wide..works both ways, but this is easier to explain)

Define 3 coordinates for each: one is the center of the MC, one is the center of the top half, and one is the center of the bottom half.

Define 2 radii for each: one is the average of the MC height and width. This number corresponds to the center point, forming a large imaginary circle.
The other is: ((obj1.Width + obj1.Height) / 4) * (obj1.Width / obj1.Height). This corresponds to all three points, forming three smaller imaginary circles.

Since testing between circles is so easy, all the code proceeds to do is check if the circles are intersecting.
I *think* I'll refer to a collision as when four..maybe three...or more little circles (in total) register a 'hit' with a bit circle.

Here's a nice little diagram of this in action:
Here ya go.
I'm aware that this *may* hit trouble with:
-Large objects vs small objects
-Lag? So far, no stress tests have been run..but early demos show no change in framerate. At all.
-Objects that barely fill their alloted volume (dimensions)..think a giant L...ton of blank space :P

No stealy my method!
jk..but credit if you use it, please?

NOTE: So the game doesn't explode, I'm going to use several 'cheats' to make sure EVERY object isn't tested against EVERY object in-game...if you're 1000 feet away, i KNOW you aren't touching me.
AQ  Post #: 128
8/30/2007 21:55:13   
somebody621
Member

If you want I can explain my rectangle-rectangle SAT. It's actually extremely simple. It's probably a little more accurate, but it will require predefining. However, there are many more advantages.

-The ability to correctly resolve a collision.
-Your method has the work increase by a whole ton when you add more and more objects. Mine also has the work increase exponentially, but by not as much.
Post #: 129
8/30/2007 22:22:11   
EragonZZZZ
Member

Nah, thanks man, but I prefer to keep all my code my own...tis how I learn?
I've looked at rectangle-rectangle SAT. I've read the metanet tutorial on it, too ^_^

See, they needed to resolve collisions correctly. My game will have some physics in it, but it won't need to worry about resolving a collision with what I have in mind :P
Also, I failed to mention that mine does show various degrees of overlap...all I gotta do is interpret them :D

Yeah, I can see why yours would require a bit less work. I'm still a fan of mine though lol.
Although I wouldn't mine you explaining what yours checks. :P
AQ  Post #: 130
8/31/2007 7:39:51   
Burning Raven
Member
 

hmm you guys do know your stuff! I might need to ask for some help with scripting with my games but in the mean time add my name to the list!
~Raeven
AQ  Post #: 131
8/31/2007 15:42:50   
flsg
Member

eragon: don't you think the bitmap-level collision code I gave you was more accurate and less laggy? lol
anyway your method is very original
burning raven: why do most people today hire someone to do their job? lol if it's your game, code it yourself

_____________________________

My flash gallery
my game thread

flsg, proud old member of AQ(still playing :O)
AQ  Post #: 132
8/31/2007 17:40:52   
EragonZZZZ
Member

Oh yeah, I'm using that concept for the terrain :P
However, for what I wanted to happen with object/object collision, it didn't work. Just wasn't practical :P
But I've recently tested mine out.

-No optimization...every object is involved.
-30+ objects on stage.
-Objects are complex vector art. No primitives.
-Every object tests against every other object (well..I lied...small optimization, if obj1 tests on obj2, obj2 doesn't test on obj1. But very simple optimization).
-465 collisions checked per frame.
-No lag; remained at a constant 18 fps.

Albeit...each added object increases the load drastically...framerate dipped below 9 with 50 objects D:<

Thanks...I suppose original is a sort of compliment x_x




< Message edited by EragonZZZZ -- 8/31/2007 18:05:43 >
AQ  Post #: 133
8/31/2007 23:01:30   
Burning Raven
Member
 

Flsg: well I didn't say I was hiring you to code the game I said I may need some help in the codding of the game as the biggest thing I have codded myself without a tutorial is something moving with the WASD keys and thats not what I kneeded :P so if I get stuck on a line of script for a inventory or elemental resistances I will come to you guys for help not say DO IT! DO MY SCRIPT NOW!!
~Raven
AQ  Post #: 134
8/31/2007 23:21:40   
flsg
Member

Burning Raven: ok sorry if I misunderstood your meaning. Lots of people today hire some guys to do ALL the works for them...they don't even try to do something...
AQ  Post #: 135
8/31/2007 23:52:16   
Burning Raven
Member
 

Flsg: not your fault by the sounds of things a lot of people just come here ask for written scripts and leave so its understandable!
~Raven
AQ  Post #: 136
9/1/2007 1:19:43   
EragonZZZZ
Member

What is it about flash that encourages people to ask for code straight up?
(not you raven, this is musing)

Here, Newgrounds...my gosh, everywhere people are like
"If you give me script that would be great ^.^"

And I'm like
"If you stopped asking and learned for yourself that would be great ^.^"
AQ  Post #: 137
9/1/2007 13:47:32   
The Illusive Man
Member

Eragon - so true. Tutorials that give you copy and paste code is not great, because people are limited to what's on the internet. I learnt partly through tutorials, but instead of copying and pasting it, i copied it by typing it. That gave a better grounding. I also tried to understand it as i did it. I think that is how to use a tutorial properly.

Any comments on that?
Post #: 138
9/1/2007 14:05:41   
somebody621
Member

d(^_^) Great way. Meh. Eragon, you should find a way to stop your collision system from behing O(n^2). In other words, you need some kind of broad phase collision detection. Some good ones are sweep and prune, a quadtree, and a grid.
Post #: 139
9/1/2007 17:51:05   
flsg
Member

somebody621: sorry for being annying but do you think the help I need from you is possible?
althorne: lol great way to learn and remember at the same time. At least you know what you're writing when you do that
AQ  Post #: 140
9/1/2007 18:31:45   
EragonZZZZ
Member

Althorne wins a cookie.

And somebody...I AM implementing that, dur. I'd be shamed as a programmer if I didn't D:

O(n^2) is on the list of "big things not to perform at runtime"

I'm probably using a variant of grid. What I'm doing is saying that if object two is inside an invisible rectangle around object one, then do a collision test.
Either that or getting the distance from object1 to object2 using Pythagorean theorem. Which do ya think is going to give me less lag? I'm guessing the invisible rectangle one.
AQ  Post #: 141
9/1/2007 19:10:24   
somebody621
Member

Actually, if you implement it correctly, bounding circles are more efficient than bounding rectangles. What you do is test the square of the sum of radii against the squared distance of the two circles.
Post #: 142
9/1/2007 19:36:32   
EragonZZZZ
Member

Hahaha...how do you think the main method works? Thats exactly how :D
AQ  Post #: 143
9/1/2007 21:31:55   
flsg
Member

wow it seems that we're the only one here now...XD
AQ  Post #: 144
9/2/2007 3:06:18   
The Illusive Man
Member

I took a day of computering yesterday for most of the day lol.

And eragon - your code is way over my head. That's why i'm not saying anything :) Yours too flsg
Post #: 145
9/2/2007 11:15:16   
EragonZZZZ
Member

Wait, day OF or day OFF?

They actually mean totally different things.
(day of, all day...day off, not all day)

And lol, you'll catch on quickly if I know you. No worries.
flsg, where IS your code? I haven't seen any recently.

(wow, the population of this thread has dwindled to about 3-4 members...cool...its like our dev thread ^_^)
AQ  Post #: 146
9/2/2007 12:50:26   
The Illusive Man
Member

grrr - these forums pick up every typo (i usually do to...) - I mean off. I was on the internet a grand total of 5 minutes in the morning, and 5 minutes in the evening.
Post #: 147
9/2/2007 13:06:40   
flsg
Member

eragon: why should I show it? lol
I'm not going to paste all my project's code on the forum >_<
AQ  Post #: 148
9/2/2007 16:43:23   
EragonZZZZ
Member

I mean I haven't seen/heard of any code. I'm not asking you to post

code


I'm talking about the fact that you've not mentioned hide nor hair of what your project is actually for or about or whatnot :D
AQ  Post #: 149
9/2/2007 18:12:33   
flsg
Member

I'm not some other guys, who'd make a thread for a certain project that they didn't even start yet XD
you'll know what it is once I think it's good enough to get released
AQ  Post #: 150
Page:   <<   < prev  4 5 [6] 7 8   next >   >>
All Forums >> [Gaming Community] >> [Legends and Lore] >> Artists of Legend >> Art Academy >> RE: Flash Q&A Thread 4
Page 6 of 30«<45678>»
Jump to:



Advertisement




Icon Legend
New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts




Forum Content Copyright © 2018 Artix Entertainment, LLC.

"AdventureQuest", "DragonFable", "MechQuest", "EpicDuel", "BattleOn.com", "AdventureQuest Worlds", "Artix Entertainment"
and all game character names are either trademarks or registered trademarks of Artix Entertainment, LLC. All rights are reserved.
PRIVACY POLICY


Forum Software © ASPPlayground.NET Advanced Edition