05 April 2016, 12:52 | #1 |
Fernando Cabrera
Join Date: Oct 2013
Location: Spain
Posts: 106
|
Hardware collision detection in Amiga games?
Hi everyone! How do you think collision detection was mainly done in Amiga games? Do you think hardware collision detection was a common way to do it? I believe it was mainly done by software (using AABB in some cases maybe?) but I'm just guessing... what do you think?
Thanks in advance! |
05 April 2016, 13:17 | #2 |
Registered User
Join Date: Nov 2010
Location: South Wales
Age: 47
Posts: 944
|
Didn't hardware detection collisions only work with sprites and most of the time bobs were used due to the limited number of sprites ?
|
05 April 2016, 13:29 | #3 |
Fernando Cabrera
Join Date: Oct 2013
Location: Spain
Posts: 106
|
Basically, hardware collision detection can be used between sprite pairs, between those pairs and both playfields and between the playfields themselves. It's a little more complicated than that, though .
Last edited by nandius_c; 05 April 2016 at 15:01. |
05 April 2016, 17:21 | #4 |
Registered User
Join Date: Sep 2008
Location: Germany
Age: 49
Posts: 138
|
Additionally there is the 'blitter zero flag' but I don't know if that was used by any game in the past.
I remember that there was a thread here on eab with a quite interesting discussion about this question. AFAIR the outcome was that most people did a more or less sophisticated comparison of the objects rectangles. |
05 April 2016, 17:27 | #5 | |
Fernando Cabrera
Join Date: Oct 2013
Location: Spain
Posts: 106
|
Quote:
|
|
05 April 2016, 17:43 | #6 | |
Registered User
Join Date: Jul 2015
Location: The Netherlands
Posts: 3,436
|
Quote:
If you ask me, the problem with using the Blitter for collision checks is not just performance though, you also get (unless you make smaller collision masks) pixel-perfect collision detection and this is usually not what you really want*. In most 16 bit and later games players get a bit more leeway than that. *) Ironically, in my experience a lot of people say they do want pixel perfect collisions when playing a game but then go on to complain about games which use such methods saying they are unfairly difficult |
|
05 April 2016, 17:55 | #7 | |
Fernando Cabrera
Join Date: Oct 2013
Location: Spain
Posts: 106
|
Quote:
Personally, I don't like the idea of "wasting" Blitter DMA time for checking collisions (something that can be done with the CPU) though I understand that's not always the best solution. And I absolutely agree with you: most players don't want pixel-perfect collision detection. |
|
05 April 2016, 18:06 | #8 |
Registered User
Join Date: Nov 2010
Location: South Wales
Age: 47
Posts: 944
|
Think what payers want is pixel perfect collision detection with platforms and background etc but not with enemies
|
05 April 2016, 20:03 | #9 |
Amigan
Join Date: Feb 2012
Location: London
Posts: 1,316
|
|
05 April 2016, 20:51 | #10 |
Lemon. / Core Design
Join Date: Mar 2016
Location: Tier 5
Posts: 1,213
|
Always used bounding box to bounding box collision checks in my games
|
05 April 2016, 23:34 | #11 | |
Fernando Cabrera
Join Date: Oct 2013
Location: Spain
Posts: 106
|
Quote:
|
|
05 April 2016, 23:40 | #12 |
Fernando Cabrera
Join Date: Oct 2013
Location: Spain
Posts: 106
|
|
06 April 2016, 00:17 | #13 |
J.M.D - Bedroom Musician
Join Date: Apr 2014
Location: los angeles,ca
Posts: 3,590
|
A friend of mine hardcore gamer might point you as Evil for that - ok, usually more than it is not needed but in some case bounding box was executed VERY badly as in team 17 or Tiertex stuff...
|
06 April 2016, 23:00 | #14 | |
Moderator
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 5,650
|
Quote:
The problem is you get the result too late Or at least I would want collisions to be detected before drawing, say, a non-exploded enemy, so that I can instead draw the exploded one. If you don't check before moving stuff, you get 1 frame lag on detection. If you want pixel-perfect collision detection, this or sprite collision is the only real way to do it. (Sprite collision also reports 1 frame too late.) Just do a bounding box check first and if that collides, do the pixel-perfect check else not. You can make life easier by setting up the playfields, sprites or bitplanes in a way that will make it easy and a little faster. In many cases this means that if graphics are already drawn you have some adjustments to do to the graphics. You get a better result if the specs are laid down before drawing starts, although you may get around it with the palette remap feature of DPaint. If you're not making a shooter or other game with lots of sprites/bobs moving, this is the most accurate method. ~ Otherwise bounding boxes work okay for regular shapes, only make it a little bit smaller than the sprite to avoid false positives. The player sprite is the most important one to not get false positives on. For small bullets you can do a bit test in the relevant bitplanes or in the mask bitplane of the player sprite. Just remember that objects moving at speeds of close to the width of the target can skip past the target! (This is valid for all forms of collision detection.) This means that framerate is a factor, as with Xenon 2's or Project X's abysmal collision detection because with each framerate decrease, the objects have to move that much faster per second. For relatively regular objects, you can also use radius. All it takes is a multiplication table and the rule of Pythagoras, only the distance you check against is the radius squared to avoid the square root. It's faster than a bounding box check. Under no circumstances must you allow another object to move influenced by the movement of the player sprite, before checking collisions. That would not be a serious flaw, that would be a failed game design. /rant This makes me want to code another game!! Argh |
|
07 April 2016, 00:30 | #15 | ||||
Fernando Cabrera
Join Date: Oct 2013
Location: Spain
Posts: 106
|
Quote:
Quote:
Quote:
Quote:
Thank you, sensei! |
||||
07 April 2016, 02:46 | #16 |
pixels
Join Date: May 2014
Location: Australia
Age: 53
Posts: 476
|
Back when we started working on Amiga games in the 80's we had two methods of collision detection.
- Box method - Colour (usually dark, not magenta as shown the image) Not sure which was most efficient but the colour pixel method was more accurate. The Box method with some tweaking worked well had ten options in the custom editor with no collision as one of the options.. |
07 April 2016, 11:40 | #17 |
Lemon. / Core Design
Join Date: Mar 2016
Location: Tier 5
Posts: 1,213
|
For collision with the backgrounds, we flagged each 16x16 block with it's collision type ie. Solid, No Collision, Solid from above (for platforms you could jump up through but land on top of)
We then had slope tables for background blocks (16 bytes) defining the height at each horizonal pixel (for slopes etc.). It worked pretty well, and obviously was quick to process, as we didn't need to check lots of bounding boxes against the player, and enemies etc.. |
07 April 2016, 22:25 | #18 | |
Fernando Cabrera
Join Date: Oct 2013
Location: Spain
Posts: 106
|
Quote:
P.D: sorry to ask but... which game are those graphics from? |
|
07 April 2016, 23:54 | #20 |
Phone Homer
Join Date: Jun 2006
Location: 5150
Posts: 5,808
|
I wouid guess for backgrounds just boxing a map exitior in reverse any other is only useful for enemy+enemy.
or when math check correct then do blit check for 100% shape check. I never liked the idea of colour collision was it ever used in a commercial game? Last edited by Retro1234; 08 April 2016 at 01:46. |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Collision detection: 2 doubts | nandius_c | Coders. Asm / Hardware | 6 | 30 November 2014 00:53 |
Games that actually used the Amiga hardware | amiga | Retrogaming General Discussion | 54 | 27 February 2010 17:36 |
what games need 'full' collision level ? | kirk | support.WinUAE | 25 | 07 February 2010 02:01 |
original amiga games and hardware for sale | cookieninja | MarketPlace | 1 | 12 September 2006 15:37 |
FS: Lots of Amiga hardware and games and apps | ungi | MarketPlace | 9 | 16 June 2006 20:48 |
|
|