Jump to content
IGNORED

Working on a space invaders game...


tschak909

Recommended Posts

I just realised something.. Due to the fact that my display list changes (blank lines trick), I need to find another way to draw the star playfield... And I believe the only thing I can do to pull that off at this point is to do a VCOUNT kernel..but am looking for a way to trigger said kernel every horizontal scanline, how could I do this? or is there a better way?

 

-Thom

Link to comment
Share on other sites

I just realised something.. Due to the fact that my display list changes (blank lines trick), I need to find another way to draw the star playfield... And I believe the only thing I can do to pull that off at this point is to do a VCOUNT kernel..but am looking for a way to trigger said kernel every horizontal scanline, how could I do this? or is there a better way?

 

-Thom

 

don't worry - you can do DLIs on the blank lines too :)

BTW - nice - looking good!

Edited by Sheddy
Link to comment
Share on other sites

A DLI every line is only feasible if you're doing a few operations.

 

An alternative is to disable DLIs, and just check NMIST on ANTIC - with your DLIs requested in the dlist - DLIs will be flagged but won't happen - they are triggered early in the scanline.

 

VCOUNT is OK but only accurate to 2 lines. Cycle counting in conjunction to waiting on VCOUNT change could be used.

 

A final alternative might be to use POTGO and use PADDLE7 register - in normal scan mode it increments exactly in sync with the scanlines (see thread elsewhere "Another use for paddles". Note: AFAIK, no emulator can do fast scan mode properly, but normal scan mode is "close" to the real thing.

Link to comment
Share on other sites

I have completed the first bits of code to handle player motion, I will leave as is for now, and continue on implementing the rest of the core implements for game play, then return to the various motion routines to add the velocity tables.

 

I have also put a placeholder in the bonus section up top for now, and redid the font slightly to make it more readable.

 

p.s. I am losing a little bit of granularity doing ANDs on RTCLOK, what if I wanted to do vblank checks on anything but 1 2 4 and 8? what would be the best way to do that?

 

-Thom

 

T08PLMOT.zip

Link to comment
Share on other sites

Evening fellas,

 

I took my first crack at a starfield tonight, it still needs a _CRAPLOAD_ of work, the stars flicker, but I do know my technique will work with the proper timing. I will try to tie VCOUNT in and see if I can carefully time the stars to appear on the correct scan lines without flicker, I'm going to try to keep stars down to one per line..maybe I can make something look good... if worse comes to worse, I will try to use two missiles for this, but I don't want to waste precious sprite space at this point.

 

-Thom

 

T09STARF.zip

Link to comment
Share on other sites

Starfield Update:

 

Definitely better this time, I've tightened the kernel routines a little, and made sure the starfield happens inside horizontal playfield borders. But I need to be able to fix the streaks happening during display... If I enable the WSYNC in the kernel code, the stars stabilise and the streaks stop, HOWEVER, there is a big black hole on the lower left corner of the screen.. WHAT GIVES? WTF? ... ok well, I am tabling this for now, and continuing on.

 

post-9462-1153028809_thumb.png

 

T09STARF2.zip

 

Continue on game play logic.

 

-Thom

Link to comment
Share on other sites

Starfield Update:

 

Definitely better this time, I've tightened the kernel routines a little, and made sure the starfield happens inside horizontal playfield borders. But I need to be able to fix the streaks happening during display... If I enable the WSYNC in the kernel code, the stars stabilise and the streaks stop, HOWEVER, there is a big black hole on the lower left corner of the screen.. WHAT GIVES? WTF? ... ok well, I am tabling this for now, and continuing on.

 

post-9462-1153028809_thumb.png

 

T09STARF2.zip

 

Continue on game play logic.

 

-Thom

 

Looking good (NTSC machine if it matters)! I noticed one small thing though. When the invaders reach the right edge of the screen and make their first drop, the entire display shifts up by one pixel.

 

Stephen Anderson

Link to comment
Share on other sites

Starfield Update:

 

Definitely better this time, I've tightened the kernel routines a little, and made sure the starfield happens inside horizontal playfield borders. But I need to be able to fix the streaks happening during display... If I enable the WSYNC in the kernel code, the stars stabilise and the streaks stop, HOWEVER, there is a big black hole on the lower left corner of the screen.. WHAT GIVES? WTF? ... ok well, I am tabling this for now, and continuing on.

 

post-9462-1153028809_thumb.png

 

T09STARF2.zip

 

Continue on game play logic.

 

-Thom

 

Looking good (NTSC machine if it matters)! I noticed one small thing though. When the invaders reach the right edge of the screen and make their first drop, the entire display shifts up by one pixel.

 

Stephen Anderson

 

yup, there is an off-by-one with the display list jump instructions which comprise the vertical scrolling, will fix it soon.

 

-Thom

Link to comment
Share on other sites

I am currently working on the player's missile routine, and as soon as it is debugged, i will be applying it to the enemies as well.. I will investigate using player and missile sprite multiplexing to get more than say, two enemies firing at the same time. But until I actually get to that point, I am learning things by trial and error, and looking at others code.

 

-Thom

Link to comment
Share on other sites

Evening all,

 

Just hacking away on the game. I have decided to add a set of three shields at the bottom of the playfield utilising ANTIC mode E for the graphics. I drew some preliminary shields using GIMP, and systematically converting each group of four pixels into their appropriate nibbles for the screen bytes. Is there an easier way to do this? hmm, i'll just plod along for now.

 

On the missile front, the missiles are firing properly, but I need to speed them up slightly, it is smoothly shooting however. Lessons learned? be sure to not overdo EORs.

 

-Thom

 

post-9462-1153704587_thumb.png <-- drawing shields in GIMP. guide lines are byte boundaries.

Link to comment
Share on other sites

well, the vertical scrolling technique as it stands right now, just alters antic jump instructions, it will probably just cause the shields to wipe away.... I'll add in code to completely black out the shields once the invaders start reaching the edge of it.....

 

-Thom

Link to comment
Share on other sites

And now after some initial work, the graphics display for the shields is started... yes.. I will be doing a better job on the graphics soon, I just wanted something in place to mess with. :-P

 

(can some people help me out on the graphics later?) :-)

 

I did realise that I will need to kill the shield graphics, the moment the invaders touch it, because of the vertical scrolling technique i am using.. the LMS to the screen memory that holds the shields gets _CLOBBERED_ ... oops, didn't think about that one hahaha.

 

more to come, later.

-Thom

 

post-9462-1153726998_thumb.png <-- showing the shields at work.

Link to comment
Share on other sites

Hello guys,

 

Have been refining the shields a bit, and have created a string of DLI interrupts that do RANDOM color changes to COLPF2 on a per scanline basis, creating an electrified pulse effect.. I will refine this, later...but the DLI code is in place. I just need to do a two pronged subroutine that clears the LMS and mode E and DLI bits, and do a slight change to re-vector over the additional DLI routines when not in use. Basic missile shooting is sort of in place, I need to make it track the ship, no collision detection yet..but soon.

 

Pictures and current code attached.

 

-Thom

 

post-9462-1153817115_thumb.png <-- electrified DLI shields still shot

 

T10PLMIS.zip <-- current code

Link to comment
Share on other sites

Looking pretty good.

 

Suggestions:

 

I'd recommend 4 or more animations for the invaders. No need to devote heaps of RAM to extra charsets, just copy the relevant data when needed (5x2x8 = 80 bytes to copy, no effort at all).

 

Why not have the stars move at different rates (ie - fast near the ground, slower at higher altitudes)

 

Sheilds: might be a case of doing the 2600 method of just having them vanish once the invaders get low down.

Maybe have options, like shields you can shoot through (they could momentarily go "down" for your shots to pass through (enemy shots could also pass through, adding a degree of chance - just have the sheilds go to 1/2 brightness or something).

 

Have you decided on a "mother ship" yet? Nice additions might be dropping new enemies, or shooting at you at an angle, etc.

Link to comment
Share on other sites

still lots and lots of stuff to debug even after I get all the features in. I will turn the shields off once the invaders get to the bottom, OR when the Breakout powerup is acquired. As for the other animations, I haven't gotten to the character set animations yet, still so much to add before-hand, and I am learning as fast as I can.

 

As for the stars parallax, hmmm.. will have to seriously think about how best to attack that one.. A better question would be, how the hell do I stop the instability that happens when too many DMA cycles get stolen because of the character graphics???

 

-Thom

Link to comment
Share on other sites

ok. i have looked into the code little bit...

 

your DLI code for the stars look too complicated....

but i guess the jumping comes from too many WSYNC... f.e. your game kernel has several DLIs as well (i hate the word kernel...we are not on 2600 here... ;))

 

is there any reason why you trigger so many wsyncs?

 

f.e. a potential starfield DLI could be looking like this

(assuming that the starfield counter is reseted every VBL to zero)

 

dli pha

txa

pha

lda dlicount

lda stars_xpos_tab,x

sta wsync

sta hposm0

inc dlicount

pla

tax

pla

rti

 

same to the tons of DLIs for the colours of the invaders... it seems that i have to dig more into it... ;)

 

now back to diablo 2:LOD... to get inspiration for my game...

Link to comment
Share on other sites

I thought i had posted this earlier, but it slipped my mind.. A copy of the game spec, that I wrote is attached below...

 

-Thom

 

specification.zip

 

Just tested the T10PLMIS version on my machine (NTSC machine, displaying on a VGA monitor via a SVIDEO to VGA convertor). Looks good, but the last row of invaders "walk off" the right edge of the screen about half way, when travelling to the left, they go offscreen by about 2 pixels. Also, the player ship is able to halfway disappear in both directions. Not sure if this is intentional or not.

 

Stephen Anderson

Edited by Stephen
Link to comment
Share on other sites

You'll probably get a more stable display using just one DLI for the stars rather than a DLI each line.

 

Even if you stick to a DLI per line, you can do away with WSYNC - just pad a few NOPs in, and/or do some of the processing before you store the missile HPOS.

 

Rather than doing TXA/PHA then PLA/TAX, it is actually faster to just STX into the operand of a LDX # instruction at the end of the DLI routine.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...