tag:blogger.com,1999:blog-1371197537362446588.post3548964167706335337..comments2023-05-10T02:49:10.916-07:00Comments on Psychotic Pspeaks: Power Up - Discoveries in CollisionPsyPsofthttp://www.blogger.com/profile/06586372773166399296noreply@blogger.comBlogger16125tag:blogger.com,1999:blog-1371197537362446588.post-5462926352059312702012-08-17T13:28:54.225-07:002012-08-17T13:28:54.225-07:00Hi Timothy. I'd love a nosey at that! If I don...Hi Timothy. I'd love a nosey at that! If I don't get the time to properly implement it into Power Up I'll definitely give it a go with my next effort. Any chance you could send a bit to my email address? It's psychoticpsoftware@gmail.com<br />Cheers man!PsyPsofthttps://www.blogger.com/profile/06586372773166399296noreply@blogger.comtag:blogger.com,1999:blog-1371197537362446588.post-60824530309835574702012-08-13T11:26:01.485-07:002012-08-13T11:26:01.485-07:00It's been quite some time since I originally l...It's been quite some time since I originally left this comment, but in that time I've rummaged through XNA and put together a decent polygonal collision detection system. The reason why I mention it here is that I found it to be easier than I originally thought it would be.<br /><br />I found that doing it had two huge benefits over bounding box collision detected. The first is that I could just create a subclass to my polygon class that had constraints to make it a rectangle only, so I could effectively do bounding box collision anyway. The other benefit was that now I could rotate my "bounding box" collision. To illustrate that benefit, check out the three missiles fired from the player ship in the last screenshot of the post. When they rotate so as not to be horizontal, the bounding box gets a lot bigger than it should. With the polygonal rectangle, it just rotated with the object.<br /><br />If you want, I can send you the code to look at. It should be very easy to implement into just about any 2D game.Timothy Lochnerhttps://www.blogger.com/profile/02543950238712857762noreply@blogger.comtag:blogger.com,1999:blog-1371197537362446588.post-31069356756326651872012-07-10T00:58:52.044-07:002012-07-10T00:58:52.044-07:00Agreed. It's really just a balance between mak...Agreed. It's really just a balance between making it work and getting it done in a reasonable timeline. I reckon I'll take this path with the collision on this game then toward the rnd I'll go back through everything in it and make sure it's all as tight as it can be.PsyPsofthttps://www.blogger.com/profile/06586372773166399296noreply@blogger.comtag:blogger.com,1999:blog-1371197537362446588.post-54383520832981375562012-07-06T20:16:10.009-07:002012-07-06T20:16:10.009-07:00Mind you I'm just starting with XNA as well, b...Mind you I'm just starting with XNA as well, but can't you use more than one type of collision detection? Like use the less intensive box type collision detection for power ups and better, more intensive detection for ships?<br />What you did seems pretty fair, though. I wouldn't complain to much if that's what is used in the final game. I definitively know the one about not wanting to rewrite code. Spending hours on something just to dump it all sucks. But then again, I would go great lengths to make the program play better. Trying to be (close to) perfect is crazy!Anonymoushttps://www.blogger.com/profile/16107138361599396969noreply@blogger.comtag:blogger.com,1999:blog-1371197537362446588.post-65945472734612320152012-06-22T09:53:22.262-07:002012-06-22T09:53:22.262-07:00Well I am no longer working on it, I do hope to on...Well I am no longer working on it, I do hope to one day get to finish it. You can still play the current version. Its not the easiest of projects but it is fun. <br />http://evac-game.com/RARoadkillhttps://www.blogger.com/profile/16697136123668345885noreply@blogger.comtag:blogger.com,1999:blog-1371197537362446588.post-32754481617851588962012-06-22T06:16:52.257-07:002012-06-22T06:16:52.257-07:00Yeah. I'm thinking about doing just that for c...Yeah. I'm thinking about doing just that for certain baddies. Think I'll do another few collision passes before I'm done with this game eh. ;)<br /><br />Thanks for the comment. Would love to see your 3D space game. Was thinking about doing one someday myself. Wouldn't know where to begin at this point though, so we'll see.PsyPsofthttps://www.blogger.com/profile/06586372773166399296noreply@blogger.comtag:blogger.com,1999:blog-1371197537362446588.post-3310976014107929412012-06-22T06:15:05.147-07:002012-06-22T06:15:05.147-07:00Glad to hear that collision with 2D and 3D games i...Glad to hear that collision with 2D and 3D games is so similar. I'm sure that knowledge will come on rather useful later on. Interesting that you can just make really low poly versions for 3D collision. Makes perfect sense really.<br /><br />I'm actually quite looking forward to getting into playing with Unity. My coding needs work first though, Think I'd better learn to walk before I can run and do a couple of more c# intensive projects first. That way, Hopefully I'll be able to make something a little more cool and unique once I hit anything like Unity than I would if I were just playing with what's already there.<br /><br />Thanks for reading the post and for commenting. :)PsyPsofthttps://www.blogger.com/profile/06586372773166399296noreply@blogger.comtag:blogger.com,1999:blog-1371197537362446588.post-13445600991875394192012-06-21T09:14:43.746-07:002012-06-21T09:14:43.746-07:00Hey, thanks for the twitter follow, always nice to...Hey, thanks for the twitter follow, always nice to meet other game dev. <br /><br />I spent my senior year in college working on a 3d space sim game in xna. Collision is a huge pain in xna at time. Sounds like you have a good solution going here for your game.<br /><br />bounding boxes have always served me well when working in 2d. unless you end up with more complex sprites. Then you might have to use multiple bounding boxes or go with a different collision method.RARoadkillhttps://www.blogger.com/profile/16697136123668345885noreply@blogger.comtag:blogger.com,1999:blog-1371197537362446588.post-60737570633368146282012-06-19T15:55:57.772-07:002012-06-19T15:55:57.772-07:00Hello! First of all thanks for the twitter follow....Hello! First of all thanks for the twitter follow. Looks like we have very similar blogs going.<br /><br />You mentioned Unity; well I'm developing for Android with Unity and I can tell you that doing per-polygon collision is usually not the way to go. Far too CPU expensive on mobile. But similar to the problem you're having, box colliders just aren't good enough in many cases.<br /><br />The solutions are remarkably similar to the ones you've gotten here for 2D. One is use a bunch of box colliders to make a blocky form that is roughly the right shape. The other is to make a second, very low poly version of the mesh, turn of its renderer and make it a child of the high poly object. You then use the low object for collision detection; if you've done a good job of creating an object that is much simpler, but the right shape, you're good to go.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-1371197537362446588.post-77495797795679897822012-06-19T11:05:53.787-07:002012-06-19T11:05:53.787-07:00Thanks! I'm building up quite a library of coo...Thanks! I'm building up quite a library of cool stuff to experiment with. This is definitely one. I love that it doesn't even look at the pixels until the bounding boxes have been tested. Seems so obviousnow but I hadn't even considered that!!PsyPsofthttps://www.blogger.com/profile/06586372773166399296noreply@blogger.comtag:blogger.com,1999:blog-1371197537362446588.post-18863423438424995282012-06-19T11:00:48.519-07:002012-06-19T11:00:48.519-07:00Yeah. I'll bet that was annoying. I find that ...Yeah. I'll bet that was annoying. I find that in current gen 3D games collision has to be spot on. I know people who use Unity to make games and they're pretty much using the actual environments as their own collision. Sounds pricey but I know they're a lot cleverer than me. I'm sure they've figured out some really smart ways of quantizing it all. Lol, maybe one day I'll get to that point but for now I'm happy with my little spaceships and boxes.<br /><br />Thanks for reading and commenting on this. ...Makes it all worthwhile. :DPsyPsofthttps://www.blogger.com/profile/06586372773166399296noreply@blogger.comtag:blogger.com,1999:blog-1371197537362446588.post-30080502271246010442012-06-19T10:22:17.118-07:002012-06-19T10:22:17.118-07:00Another method is to use bitmap masks. You load up...Another method is to use bitmap masks. You load up or calculate the masks while loading and creating ur sprites and then use those masks to check overlapping areas. Check out this link: http://www.gamedev.net/page/resources/_/technical/game-programming/collision-detection-r735.aubykhanhttps://www.blogger.com/profile/16685389631451496385noreply@blogger.comtag:blogger.com,1999:blog-1371197537362446588.post-90945719161079236472012-06-19T08:07:09.855-07:002012-06-19T08:07:09.855-07:00Interesting read.
Simple collision will usually su...Interesting read.<br />Simple collision will usually suffice for simple flash games, however, for products you want to put on the market collision has to be tightened up to some degree. The way you've proposed of tackling the problem would probably work for the shoot-em-up style game you're making, but i don't think it would work for more complex games.<br /><br />Good examples of bad collision include shooting through the windows on the Ford Nucleon style cars in Fallout 3 and I think some clutter objects in Modern Warfare 2's "Trailer Park" map.<br /><br />(The first time I tried to fire at Arkansas the minefield sniper through that car window in Fallout 3, I got really ticked off when the bullet hit the car's collision box and blew the car up.)Bryn's Therapisthttps://www.blogger.com/profile/16921181173170423029noreply@blogger.comtag:blogger.com,1999:blog-1371197537362446588.post-9577514296673936842012-06-16T23:50:01.405-07:002012-06-16T23:50:01.405-07:00Hiya. Thanks for the comment. Good to know it'...Hiya. Thanks for the comment. Good to know it's being read. ;) This sounds like another really good suggestion and something I'll look into.<br /><br />Other good ideas have included multiple boxes for more complex enemy shapes, detecting pixel collision only after the boxes have collided and splitting the screen into quadrands to quantise the game's attention on what collides with what.<br /><br />Polygonal work is something I've never tried so might take some intensive study, but the same applies to all the other ideas really too. I reckon I'll probably tune this simple method I'm currently using as best as I can for this game, then look into a few more interesting ones for my next game.PsyPsofthttps://www.blogger.com/profile/06586372773166399296noreply@blogger.comtag:blogger.com,1999:blog-1371197537362446588.post-79664087212797686992012-06-16T23:48:31.143-07:002012-06-16T23:48:31.143-07:00This comment has been removed by the author.PsyPsofthttps://www.blogger.com/profile/06586372773166399296noreply@blogger.comtag:blogger.com,1999:blog-1371197537362446588.post-6556889305876559782012-06-15T01:48:50.042-07:002012-06-15T01:48:50.042-07:00I don't know if the libraries you're using...I don't know if the libraries you're using can do what I'm about to suggest, but at least it can be something to help you come to a new solution that might be better. <br /><br />Instead of box collision (too simple) or pixel-perfect collision (too much processing) you could try poly collision. The idea is that you use a polygonal shape over your game sprite, instead of a box. You can cut away those corners and make a shape that is still simple (6 sides ain't so bad) but better reflects the shape of your sprite.Timothy Lochnerhttps://www.blogger.com/profile/02543950238712857762noreply@blogger.com