zapper

Are you new to 6502, NES, or even programming in general? Post any of your questions here. Remember - the only dumb question is the question that remains unasked.

Moderator: Moderators

Post Reply
User avatar
never-obsolete
Posts: 403
Joined: Wed Sep 07, 2005 9:55 am
Location: Phoenix, AZ
Contact:

zapper

Post by never-obsolete »

is it possible to have 2 zappers connected and in use at the same time. i don't see why not, but i don't have a dev-cart to mess around with.
. That's just like, your opinion, man .
Celius
Posts: 2159
Joined: Sun Jun 05, 2005 2:04 pm
Location: Minneapolis, Minnesota, United States
Contact:

Post by Celius »

I am not certain, but I think that the zapper has to be in controller port 2. I could be wrong though. If not, I think it could be possible, I just don't think you could shoot 2 places at once, because there is one place for it to be read.
User avatar
Memblers
Site Admin
Posts: 3902
Joined: Mon Sep 20, 2004 6:04 am
Location: Indianapolis
Contact:

Post by Memblers »

It can work in either port, the only game that uses both at once is Chiller. I've played it like that before, many years ago.
User avatar
never-obsolete
Posts: 403
Joined: Wed Sep 07, 2005 9:55 am
Location: Phoenix, AZ
Contact:

Post by never-obsolete »

It can work in either port, the only game that uses both at once is Chiller. I've played it like that before, many years ago.
never heard of that one before, i'm gonna have to look into it. thanks.

now the wiki says to blank the screen and only place white where the object is. now is this done with name tables or sprites, or does it not matter?

im tinkering with the idea of a 2 player shooter similar to area 51 where the player is on a set track and enemies just kinda pop up. im just trying to make sure that the basic concept it possible before i throw together a tech demo
. That's just like, your opinion, man .
User avatar
tokumaru
Posts: 12106
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Post by tokumaru »

never-obsolete wrote:now the wiki says to blank the screen and only place white where the object is. now is this done with name tables or sprites, or does it not matter?
It doesn't matter, whatever is easier for you to code. The only thing the light gun does is detect the presence or absence of light.

A good tip is to show a completely black screen before placing a white sprite at the place you are testing for a hit, and confirm that the gun detected black for that frame. If you don't, a player can just point the gun to a lightbulb and every shot will be considered a hit. So I heard.

I think that the idea of a 2-player lightgun game is great!
Celius
Posts: 2159
Joined: Sun Jun 05, 2005 2:04 pm
Location: Minneapolis, Minnesota, United States
Contact:

Post by Celius »

Yeah, I always thought it was only one at a time... Oh well! That's cool that you can do that.

I think it would also be cool to have a 2 player light gun game. But I think it would be really cool to have a game where you use the controller most of the time, but then there'll be a part where you can use two light guns. It would be cool if there was a 3Dish game where you were on a space ship, while the computer was piloting, you could be the gunner. That would be cool.
User avatar
Memblers
Site Admin
Posts: 3902
Joined: Mon Sep 20, 2004 6:04 am
Location: Indianapolis
Contact:

Post by Memblers »

tokumaru wrote: If you don't, a player can just point the gun to a lightbulb and every shot will be considered a hit. So I heard.
It's not true. It detects light at the frequency of the television's horizontal refresh (15khz I think). It won't work on higher-freq stuff like PC monitors or some newer types of TVs.

This also means you need to continually poll the controller port, at least once per scanline. While you're at it, if you want to, you can time & count the blank polls and know which scanline the gun was pointed at. :)

I never wrote my zapper game, just a little zapper test.
Last edited by Memblers on Fri Jun 08, 2007 4:30 pm, edited 1 time in total.
User avatar
never-obsolete
Posts: 403
Joined: Wed Sep 07, 2005 9:55 am
Location: Phoenix, AZ
Contact:

Post by never-obsolete »

i was playing call of duty 3 on the wii and i got to thinking i could use the joypad/zapper combo a lot like the wiimote/nunchuck. i couldn't really come up with a good idea for that other than a fps, so a 2 player shoot-em up seemed more practical. though with a 4-score, 2 joypads, and 2 zappers i might be able come up with something cool. i definately would need a dev-cart for that so i could constantly test it on the hardware.
. That's just like, your opinion, man .
Celius
Posts: 2159
Joined: Sun Jun 05, 2005 2:04 pm
Location: Minneapolis, Minnesota, United States
Contact:

Post by Celius »

For my raycaster that I'll make some day (I need to get a few more things together), I was thinking that the player would move with the controller, and shoot with the gun. All you would really do with the controller is move, so you could hold that in one hand, and hold the gun in the other. I think it would be cool if it could be pulled off correctly. It would be somewhat of a programming nightmare to have to count scanlines along with the raycasting.
bunnyboy
Posts: 449
Joined: Thu Oct 27, 2005 1:44 pm
Location: CA
Contact:

Post by bunnyboy »

It's not true.
Not true for incandescent, tho I do have a flourescent light that will trigger the Zapper. No idea how fast the light is supposed to be switching but it works fairly consistently.
couldn't really come up with a good idea for that other than a fps
Doesn't Gotcha! (paintball game) use Zapper and controller? It was like dpad to pan left/right and Zapper to shoot the people and items.

For detection without scanline counting you might be able to do something like a binary search tree of the screen. Start with half screen white, then each frame cut the amount of white in half. Depending on the accuracy you want it should take ~4-6 frames. Might be too much of a distraction or it might look really cool having the white area zoom to your target.
User avatar
tokumaru
Posts: 12106
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Post by tokumaru »

Celius wrote:It would be somewhat of a programming nightmare to have to count scanlines along with the raycasting.
You can easily stop the raycasting for a while to check for hits, no problem with that. Why'd you want to keep raycasting if all you are displaying is white boxes on black backgrounds? =) You may want keep processing input and movement though, so that motion does not look "choppy", but raycasting is a graphical process, unnecessary if you are not showing the graphics.

BTW, I also thought that a similar controlling method could be used in a raycaster... but I promissed myself I'll only get back to my raycaster when I finish (or get really close to) my Sonic engine.
Celius
Posts: 2159
Joined: Sun Jun 05, 2005 2:04 pm
Location: Minneapolis, Minnesota, United States
Contact:

Post by Celius »

Do you need to display white boxes on black backgrounds? Why can't you just turn the sprites completely white for the moment of the shot? The player will probably go "Oh, that's just supposed to be the flash of the gun or something." So it wouldn't look so bad. I wouldn't keep raycasting, I'd just stop for a frame, and use that frame to check for a hit.

And would it be bad to just check if the trigger is pulled at the beggining of a frame rather than for every scanline while raycasting? I doubt someone will pull the trigger mid-frame, and let go before the beggining of the next frame. And when I say check at the beggining of a frame, I mean check to see whether or not you are going to dedicate that frame to checking for zapper hits. I think it would be good.

It would be better to have the gun, because in games like Doom, where the enemy was on a different elevation than you, you couldn't aim up or down, you could just aim left and right, which I think is very limited. I don't know if you are planning to have more a more 3D variation on raycasting that allows for stairs or anything like that, but if you are, the gun would be a good way to go.
User avatar
tokumaru
Posts: 12106
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Post by tokumaru »

Celius wrote:Why can't you just turn the sprites completely white for the moment of the shot?
I've never programmed for the lightgun, but you are probably right... just turing the sprites that compose a target all white might do the trick...
It would be better to have the gun, because in games like Doom, where the enemy was on a different elevation than you, you couldn't aim up or down, you could just aim left and right, which I think is very limited.
That always annoyed me too. I guess that moving with the keypad while shooting with the gun would make it all very dynamic... but there is a problem. Lightgun games check if you hit a target, and register that hit immediately, while in games like Doom, they usually simulate a projectile actually moving through the level until it hits something. Of course, one can always ignore that and go with the lightgun method, which is much simpler even, instead of having to handle one more object withing the level. But then there'd be no support for playing without the gun, I guess.
I don't know if you are planning to have more a more 3D variation on raycasting that allows for stairs or anything like that
Man, I wish. But doing the math with paper and pencil (just a figure of speech, of course I used the PC for that! :) ) I came to the conclusion that only the basic method with fixed-height walls is doable within the avaliable time. But if I have some really good idea on how to do the more 3D version until the time I start working on this thing again, of course I'll try it.
User avatar
oRBIT2002
Posts: 643
Joined: Sun Mar 19, 2006 3:06 am
Location: Gothenburg/Sweden

Post by oRBIT2002 »

I've always wondered how they did it in "Gumshoe". There are tons of objects on the screen at once, is it just all a very timed CPU-loop?
tepples
Posts: 22345
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Post by tepples »

Cycle-timed Y position detection (white screen, timing from sprite 0 to the hit) allows the search to be narrowed down to plus or minus about 15 scanlines. Then a binary (as opposed to linear) search reduces the number of frames needed to narrow down which object was hit.
Post Reply