• Content count

  • Joined

  • Last visited

Community Reputation

103 Neutral

About Mercenarey

  • Rank
  1. I made a BaseCollisionObject because I want it to be a base for both 2D and 3D collision. Im developing an RTS atm, and the world is rendered in 3D, while the collision system will run in 2D. So instead of CollisionObject it will be Collision2DObject and Collision3DObject. Also, I wished to isolate the duplication of MoveObject's interface in the BaseClass. A MoveObject does not necessarily have to be in the collisionsystem. It can be a light or a camera. Notice that BaseCollisionObject is *not* a base class of MoveObject. The diamond symbolizes an aggregation, not inheritance.
  2. Quote:Original post by SiS-Shadowman Quote:Original post by Mercenarey As for the case of 'alot', why isn't that good enough for you? Don't you trust me to evaluate what I need? You are asking for the right algorithm (or if quadtrees are of use) for collision detection, yet you don't see that it highly depends on the number of objects in the scene... No I wasn't. I asked how it is done with Quadtrees when used with a dynamic system. Ok guys, this is my last reply on this thread, this nitpicking leads nowhere.
  3. Quote:Original post by phresnel But you only see the worst expected behaviour in us. Again, you need a lesson in empathy. o/ I don't see the worst expected behaviour in people, not even here. But when I see bad behaviour, I recognize it.
  4. Quote:Original post by Mercenarey Quote:Original post by phresnel Lastly: You are an ingrate person without manners for which investing time is not worth the effort. Go help yourself and seek enlightenment in the vastness of your own infinity. You are the one dishing out google lessons, and you call me without manners?? That is not the kind of "effort" I want anyway, so maybe you should think about that next time you give "advice" in the form of google lessons, that don't even lead anywhere. Just so you know, I edited my last post to include a reply to your flame. As for the case of 'alot', why isn't that good enough for you? Don't you trust me to evaluate what I need?
  5. Quote:Original post by phresnel Firstly: your thread was done right after the first reply. Your original question was Quote:Has it been done with dynamic collision detection, where you have to take velocities into consideration, when finding nearby objects? I expected some kind of pointer as to how. Most people come here because they need a problem solved. Quote:Original post by phresnel Secondly: What mature help do you expect for such a vague problem descriptions that says "alot" if there are infinite definitions of "alot" (ranging from 3 to INF). For some definitions of "alot", a list is superiour. For other definitions of "alot", a bounding volume hierarchy is better. When did you ever play an RTS with 3 units? Quote:Original post by phresnel Thirdly: You are not the one who decides when a thread is closed. That is why I said: "I was done with this thread". Did you notice the "I"? You can stay here and argue the "alot" as long as you want, I just choose to stop now. Quote:Original post by phresnel Lastly: You are an ingrate person without manners for which investing time is not worth the effort. Go help yourself and seek enlightenment in the vastness of your own infinity. You are the one dishing out google lessons, and you call me without manners?? That is not the kind of "effort" I want anyway, so maybe you should think about that next time you give "advice" in the form of google lessons, that don't even lead anywhere.
  6. Quote:Original post by theOcelot Maybe other OO languages, but C++ is not really an OO language. It just supports OOP, among other paradigms. In fact its multi-paradigm-ness is one of its strengths: I don't have to use just OOP in my C++ program. I can use a mix of OOP and whatever else, as it fits the problem. C++ is an OO language with backwards compatability to C.
  7. I was done with this thread, as I believe that we more or less covered it. But I can't notice - which I also notice around on other threads - this mad fight for being right. If it isn't achieved on one front, a new one is simply opened. Or some detail is taken and blown completely out of proportions. Why is that? What the hell is the relevance of discussing the number of collisions, to solving the problem I pose (Even after I say 'alot', lol)? Even if in some scenarios, it would be overkill with so and so many objects, there will exist some, where it is relevant with spatial partitioning. I advise that you argue to solve the problem posed, instead of arguing for the sake of arguing.
  8. Quote:Original post by phantom OOP is not a language; OOP is a design and modeling paradigm. C++ is not an OO language; it is multi-paradigm. OOP is possible in C, you just have to write code the compiler would take care of for you in in something like C++. OOP also has a tendancy to fail horribly in cases where you need high data throughput as instead of designing for the data people design towards objects (ie struct Particle vs chunks of memory for each particle). Functional better expresses concurreny systems due to lack of global side effects, something which is becoming increasingly common in games. OOA and OOD are design and modelling paradigms, OOP is not. OOP stands for "Object Oriented Programming", and is a programming paradigm "that uses "objects" – data structures consisting of data fields and methods" ( It is not strictly a programming language itself, but is usually carried out in one. But that is going into extreme semantics IMO. For all rational purposes, you can chain together C++ (and other OO-languages) and OOP.
  9. Quote:Original post by frob I hate quoting myself, but it looks like it must be done: Quote:Usually it is easier and faster to keep dynamic objects in a list. It takes a lot of work to keep a moving spatial tree current, but sometimes it makes sense.For moving objects, it is almost always the best option to go with a simple list. Unless you have hundreds of moving objects (which I doubt) then the overhead of managing a dynamic spatial tree will be far greater than the cost of queries. That is why most of the current literature and research covers either static spatial trees or massive offline solutions. The other case (small real-time solutions) simply aren't necessary in the general case. I have potentially alot of moving objects. I am working on an RTS. I agree, that the Quadtree is overkill, and wayyy too hard to keep up-to-date with dynamic objects, and that is why I will go with the cell system instead.
  10. The answer is yes, OOP is better than procedural languages. The procedual language has nothing but a tiny amount of speed over OO-languages like C++. Games get very complex, and to manage this complexity, you need good abstraction, and OOP does that the best nowadays. I would never advice a procedural language over an OO one, not even for speed.
  11. My solution will be to drop the quadtree. It gets too complicated, when neighbouring quads of differing resolutions need to interact. Instead I will go with a cell system, with cells big enough to make sure, that only objects in neighbouring cells need to be considered, that means cells big enough to contain the maximum object and it's maximum velocity times two, to make sure that an object two cells away cannot intervene.
  12. Quote:Original post by phresnel Then, about static/dynamic intersection: Consider that you have a velocitiy, so you prolly have linear movement, i.e. you have a moving bounding box or bounding sphere. You could hence use the bounding sphere enriched with time, forming a ... cylinder. I don't think that a cylinder is wasteful. No it is not. But what do you propose then? That I take each object every timestep, create a cylinder (I would call a capsule since a cylinder does not have rounded ends) from it and put it back into the tree? What happens with response, if one object bounces or slides off another and therefore changes direction in the middle of the timestep? That is gonna be some funky looking capsules, and you cannot up-front anticipate what collision is going to happen. So you see, it is not only not wasteful, it is also impossible. Quote:Original post by phresnel Also, the wiki-page contains many pointers to open source physics engines. Have you thought about studying what they do? I looked at Box2D and they use the static method. So yes, I did exactly that. Quote:Original post by phresnel As you probably don't want to collide walls with houses... The techniques used with quadtrees, that I have seen, use timesteps and then do an overlap test. They move the scene forward, test for intersection (statically), and if there is collision, they resolve it. I want to do a dynamic test, where I move the entire scene forward with velocities, find the first collision, resolve the collision (often resulting in a changing velocity-vector), then move forward to next collision etc. Those are dramatically different approaches. I was then asking if it was possible to combine the spatial partitioning technique of quadding - which I have only seen done with timestep+static - with a dynamic test. And then I got the reply from you, which I found severely lacking in respect.
  13. Phresnel: Thanks for the google lesson. Now, can you point to me anywhere in your two links, where my problem is considered? Your wiki-link says the following about spatial partitioning: "Alternative algorithms are grouped under the spatial partitioning umbrella, which includes octrees, binary space partitioning (or BSP trees) and other, similar approaches. If one splits space into a number of simple cells, and if two objects can be shown not to be in the same cell, then they need not be checked for intersection. Since BSP trees can be precomputed, that approach is well suited to handling walls and fixed obstacles in games. These algorithms are generally older than the algorithms described above." But how can you know, by just looking at cells in a dynamic system, that they will not potentially intersect, when velocities are involved? Exactly. What they treat is static collision detection, I don't have problems with that. Can you point me to ONE SINGLE resource in your google search link, that treats the problem at hand? No, I dont think so. The problem is "spatial partitioning" and "moving collision detection" (I use dynamic instead of moving when I search), not "moving collision detection" alone. [Edited by - Mercenarey on August 11, 2010 6:38:45 AM]
  14. My biggest problem is how to make certain, that I get all objects, that may influence, just from the tree alone (not looking at each neighbouring object's radius/velocity). I thought of making a temporary sphere around the object-in-question, with a radius corresponding to the object radius+velocity+object-max-radius+object-max-velocity, and then do a standard static query, since such a sphere would cover the entire possible area of colliding objects. But the problem is, that if I have to every time test with max-velocity, that the temporary sphere will be alot bigger than what is necessary. So how is the problem of finding the relevant neighbours in the tree, while taking their possible velocities into consideration, without querying an excessive area? I don't suppose there are some sources on it? I have looked around alot on the internet the last days.
  15. Sorry for the late reply from me. After a week or so with no reply, I gave up on this thread. Yes, sadly I have to admit, that what you pointed out was exactly my problem :) I created a new structure like this: Here BaseCollisionObject will have to replicate what is needed of the Base-/MoveObject interfaces. In return I get a completely independent CollisionObject, that can take the place of the old RenderObject.