Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (475)
Games in Android Showcase (106)
games submitted by our members
Games in WIP (530)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  question about collision detection in classic "old" arcade shootemup games  (Read 2448 times)
0 Members and 1 Guest are viewing this topic.
Offline zulo

Junior Member




Java games rock!


« Posted 2005-07-13 15:32:13 »

hey

I have been playing some arcade games lately in the mame emulator and I have noticed a detail in some of the arcade shootemup games,
example "Cyvern". Its a game where you controle a dragon cyborg and the action in this game is just awesome. From the start theres tons of explotions
and the firepower is extreme. When i play these games i almost feel the power and destruction Smiley ( cyvern is from 1998 so its not that old, and its a japanese game)

anyway.. i have noticed in almost all of these arcade games when theres tons of bullets coming towards the player ship,not every bullet get you killed. I wonder if this is this coded so that not every bullet will hit the player or is it a glitch?

Since the screen is practically filled up with enemy bullets coming in the direction of the player ship at any moment in these games it would make it hard if every bullet would hit even if it looks like its going to hit. I guess the game looks more cool with tons of bulllets but it would be impossible to play if every bullet hit the players ship.

I am planning on making such an arcade game, for mobile phones, and I want to make it like these old type shootemups with tons of explotions etc.. But how would I go about making the bullet system? Would you just skip collision detection on some bullets randomly?
Offline oNyx

JGO Coder


Medals: 1


pixels! :x


« Reply #1 - Posted 2005-07-13 17:20:07 »

Eh... no. The player just has a tiny hitbox.

Some newer games allow you to enable a hitbox marker (eg hellsinker or perfect cherry blossoms [both pc]).

弾幕 ☆ @mahonnaiseblog
Offline Orangy Tang

JGO Kernel


Medals: 56
Projects: 11


Monkey for a head


« Reply #2 - Posted 2005-07-13 18:04:57 »

What oNyx said. Rumour has it that the hit box in Ikaruga is only two pixels wide. Shocked The bullets also tend to have smaller hit boxes than the graphics would suggest. This is generally a good thing as you can throw lots of bullets against the player and they'll tend to feel like they escaped by the skin of their teeth, rather than most western shooters where the overly accurate collision tends to make it seem unfair or unlucky.

[ TriangularPixels.com - Play Growth Spurt, Rescue Squad and Snowman Village ] [ Rebirth - game resource library ]
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline swpalmer

JGO Coder




Where's the Kaboom?


« Reply #3 - Posted 2005-07-13 23:45:56 »

It's interesting to note that computer technology has moved backwards in this area.

The Commodore 64, Atari 400/800 and other machines of the early 80's had hardware that detected when any pixels of a sprite overlapped with another sprite or a foreground pixel.

The Amiga computer in the late 80's early 90's had the same feature in the hardware sprites and the custom blitter chip would do a similar detection when blitting with a bitmask.

So it used to be that pixel-perfect collisions were detected for "free" by the graphics hardware.  Now we have to resort to clumsy and inaccurate hit boxes...  though as Zulo mentioned they have some advantages.

Offline Orangy Tang

JGO Kernel


Medals: 56
Projects: 11


Monkey for a head


« Reply #4 - Posted 2005-07-14 00:29:56 »

You could do that with occulsion queries, but you'd need a GF3 or later for that to work.  Tongue

[ TriangularPixels.com - Play Growth Spurt, Rescue Squad and Snowman Village ] [ Rebirth - game resource library ]
Offline oNyx

JGO Coder


Medals: 1


pixels! :x


« Reply #5 - Posted 2005-07-14 02:45:32 »

Its not really a technical issue. Its a design decision. Using a smaller hitbox allows way more bullets... not because you saved cpu time... instead its because you basically have then more space. The alternative solution would be useing a tiny player sprite. But that would be visually less pleasing... therefore there are tiny hitboxes.

弾幕 ☆ @mahonnaiseblog
Offline swpalmer

JGO Coder




Where's the Kaboom?


« Reply #6 - Posted 2005-07-14 02:53:07 »

I don't get it.

How does the size of the hit box have anything to do with the amount of bullets on the screen?  You don't care if the bullets overlap - right?

Offline oNyx

JGO Coder


Medals: 1


pixels! :x


« Reply #7 - Posted 2005-07-14 04:13:31 »

Y'know... the player needs to be able to survive it.

A tiny sprite + ppcol OR a tiny hitbox... both allow more bullets on the screen.

Something like that+ppcol=instant death

(Never played a newer shoot em up?)

弾幕 ☆ @mahonnaiseblog
Offline Bombadil

Senior Member





« Reply #8 - Posted 2005-07-14 09:05:24 »

It's interesting to note that computer technology has moved backwards in this area.
(..)
So it used to be that pixel-perfect collisions were detected for "free" by the graphics hardware.  Now we have to resort to clumsy and inaccurate hit boxes...  though as Zulo mentioned they have some advantages.

That's so true.

I'm still wondering how we could have such hardware pixel-perfect collision with OpenGL for example. Kev talked about  it in another thread (he thought about stencil buffer etc), but unfortunately we didn't find any solution so far.
Offline Orangy Tang

JGO Kernel


Medals: 56
Projects: 11


Monkey for a head


« Reply #9 - Posted 2005-07-14 11:19:55 »

I'm still wondering how we could have such hardware pixel-perfect collision with OpenGL for example. Kev talked about  it in another thread (he thought about stencil buffer etc), but unfortunately we didn't find any solution so far.
Two ways I could see:

With Occulsion Queries:
1. Render sprite 1 into stencil buffer
2. Render sprite 2 with drawing to only succeed on matching sprite 1's stencil value
3. Use occulsion query while rendering sprite 2 to see if any pixels get rendered (overlap!)

Without:
1. Clear framebuffer to black
2. Render sprite 1 into stencil buffer
3. Render sprite 2 with drawing to only succeed on matching sprite 1's stencil value. Set to draw white fragments.
4. Grab rendered area and minimise down to a single pixel with auto mipmap generation
5. Read back lowest mipmap's pixel value. Anything > 0 is a collision.

Overall, painfully complex and its going to be rather slow as you have to read data the wrong way over the AGP bus. Tongue

[ TriangularPixels.com - Play Growth Spurt, Rescue Squad and Snowman Village ] [ Rebirth - game resource library ]
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline swpalmer

JGO Coder




Where's the Kaboom?


« Reply #10 - Posted 2005-07-14 20:23:17 »

Y'know... the player needs to be able to survive it.

A tiny sprite + ppcol OR a tiny hitbox... both allow more bullets on the screen.

Something like that+ppcol=instant death

(Never played a newer shoot em up?)

Err.. I never considered sloppy collision detection to be the solution to such things.  Make each hit do less damage or something...    It all depends on the situation though... the idea of a hit box makes sense when you don't want some trivial pixels .. like some silly antenna sticking out of your ship to cause the whole ship to explode when it is hit.

But, that looked like it was supposed to be instant death anyway Smiley

Offline Orangy Tang

JGO Kernel


Medals: 56
Projects: 11


Monkey for a head


« Reply #11 - Posted 2005-07-14 21:06:09 »

Y'know... the player needs to be able to survive it.

A tiny sprite + ppcol OR a tiny hitbox... both allow more bullets on the screen.

Something like that+ppcol=instant death

(Never played a newer shoot em up?)

Err.. I never considered sloppy collision detection to be the solution to such things.  Make each hit do less damage or something...    It all depends on the situation though... the idea of a hit box makes sense when you don't want some trivial pixels .. like some silly antenna sticking out of your ship to cause the whole ship to explode when it is hit.

But, that looked like it was supposed to be instant death anyway Smiley
It's not sloppy, just generous. And that wave is perfectly survivable (practically run of the mill for most good shooters).

Likewise the traditional bullet hell shooter is a one-hit-kills affair. Practically none of them actually have an 'analog' health bar, as it tends to detract from the fun of bullet dodging.

[ TriangularPixels.com - Play Growth Spurt, Rescue Squad and Snowman Village ] [ Rebirth - game resource library ]
Offline tortoise

Junior Member




<3 Shmups


« Reply #12 - Posted 2005-07-26 18:27:46 »

tiny hitboxes for the player are the norm for the genre. It's not too uncommon to have a single point for a hitbox. Getting to know your hitbox so you can weave through tight bullets is essential to mastering the game.
Offline kevglass

JGO Kernel


Medals: 120
Projects: 23
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #13 - Posted 2005-07-26 18:31:17 »

Quote
1. Clear framebuffer to black
2. Render sprite 1 into stencil buffer
3. Render sprite 2 with drawing to only succeed on matching sprite 1's stencil value. Set to draw white fragments.
4. Grab rendered area and minimise down to a single pixel with auto mipmap generation
5. Read back lowest mipmap's pixel value. Anything > 0 is a collision.

This is the one I thought about, but reading back over the bus is just too annoying. Be nice to be able to do the comparison on the card so how :/

Kev

Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

pw (11 views)
2014-07-24 01:59:36

Riven (9 views)
2014-07-23 21:16:32

Riven (11 views)
2014-07-23 21:07:15

Riven (12 views)
2014-07-23 20:56:16

ctomni231 (42 views)
2014-07-18 06:55:21

Zero Volt (38 views)
2014-07-17 23:47:54

danieldean (32 views)
2014-07-17 23:41:23

MustardPeter (34 views)
2014-07-16 23:30:00

Cero (49 views)
2014-07-16 00:42:17

Riven (50 views)
2014-07-14 18:02:53
HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54

HotSpot Options
by Roquen
2014-05-06 15:03:10

Escape Analysis
by Roquen
2014-04-29 22:16:43

Experimental Toys
by Roquen
2014-04-28 13:24:22
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!