+ Reply to Thread
Page 1 of 2 12 LastLast
Results 1 to 20 of 30

Thread: Planetary Defense! Now with source code! (v0.02)

  1. #1

    Default Planetary Defense! Now with source code! (v0.02)

    In March of 1984, ANALOG Computing magazine published a game by Tom Hudson called Planetary Defense for the Atari 8-bit. (Does anyone out there remember this?) This is my take on Planetary Defense.

    Here’s a teaser video www.youtube.com/watch?v=zMrPOU6-UKI

    You are in charge of protecting your planet from alien attackers. Your only defense is an orbiting satellite armed with two weapons: a charged-particle gun and a missile launcher. To aim, move the targeting crosshairs with the mouse. The left mouse button fires the charged-particle gun, the right button fires missiles.
    Charged-particle projectiles travel until they hit something. There is an unlimited supply of them and up to six may be in flight at a time.
    Missiles explode when they reach their target (unless they hit something before then). There are 20 missiles per level and up to four can be in flight at a time.
    Satellites are destroyed on contact with incoming bombs or flying saucers. You get an additional satellite every 10,000 points.
    The game ends when your planet’s core (the glowing dot in the center) is destroyed.

    Requirements: Hydra, NTSC TV, two-button mouse.

    Installation instructions:
    1. Download the attached .eeprom file.
    2. Start the Propeller IDE.
    3. Type Ctrl-O and open the .eeprom file you downloaded.
    4. In the Object Info window, click Load RAM.
    5. Defend your planet!

    EDIT (attached source archive):

    Here's the source. Use at own risk blah blah no warranty blah blah.

    Note that I am not including NS_sound_drv_052_11khz_16bit.spin, so non-Hydra people won't be able to build the program (not with sound anyway). Non-Hydra folks, PM me if you want a build with custom clock speed, video pins, etc. and I'll see what I can do. (I assume it's all right to distribute binaries built with NS_sound_drv* -- please correct me if I'm wrong.)

    A few random notes on the program:

    Cog usage:
    1 Spin interpreter
    1 rasterizer
    3 renderers
    1 collision detection
    1 mouse
    1 sound
    ---
    8 total

    The screen is a 256 x 192 bitmap, 2 bits/pixel. The four colors are used as follows:
    00 - background (black)
    01 - score
    10 - planet
    11 - explosions

    The rasterizer randomizes the explosion color every vblank and changes the planet color every scan line to create the color bands. (The rasterizer also does a whole lot of other stuff in a background task.)
    Everything else on screen is a sprite. Sprites take up quite a bit of memory, being high-color (8 bits/pixel) and having a precomputed mask. I traded space for rendering complexity so that my three rendering cogs could give me the performance I wanted.

    I was at a loss how to do sound until I looked through Dodgy Kong/HDMF Lite. That showed me the way. (Of course what I came up with is nowhere near HDMF, Lite or otherwise.)

    EDIT

    Replaced version 0.01 with v0.02 -- corrected teeny tiny boo-boo. Details in thread.

    EDIT

    Changed video link to YouTube.

    Post Edited (mpark) : 4/4/2010 5:16:32 PM GMT
    Attached Thumbnails Attached Thumbnails Click image for larger version

Name:	pd_0001.jpg‎
Views:	352
Size:	9.4 KB
ID:	49010   Click image for larger version

Name:	pd_0002.jpg‎
Views:	528
Size:	9.2 KB
ID:	49011  
    Attached Files Attached Files
    Last edited by ForumTools; 10-01-2010 at 11:47 PM. Reason: Forum Migration

  2. #2

    Default

    Excellent game! A sort of rotational Space Invaders, or an inside out Gyrus combined with Missile command. Good Job!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Help to build the Propeller wiki - propeller.wikispaces.com
    Last edited by ForumTools; 10-01-2010 at 11:47 PM. Reason: Forum Migration

  3. #3

    Default

    Any chance of posting a 12Mhz pll*8 binary version?

    Cheers
    Last edited by ForumTools; 10-01-2010 at 11:47 PM. Reason: Forum Migration

  4. #4

    Default

    Man, I'm headed out the door for work! Can't wait to give it a try tonight!
    Last edited by ForumTools; 10-01-2010 at 11:47 PM. Reason: Forum Migration

  5. #5

    Default

    Project added to master Project list.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Paul Baker
    Propeller Applications Engineer

    Parallax, Inc.
    Last edited by ForumTools; 10-01-2010 at 11:47 PM. Reason: Forum Migration

  6. #6

    Default

    Thank you, Paul.

    Baggers --·what runs at 96MHz?

    CardboardGuru -- Thanks! I always thought of the original PD as a neat variation on Missile Command and in fact added more MC-ish touches to my version.
    Last edited by ForumTools; 10-01-2010 at 11:47 PM. Reason: Forum Migration

  7. #7

    Default

    mpark,

    Really great job! This is an excellent game in so many ways; very well suited to the platform, very well implemented, nice and stable, great use of sound, very good use of color, and best of all - super fun to play. I never played the original, but your version sure is a blast.

    One of the things I miss about the 80's is that back then game designers were constantly seeking out new mechanics. So much of what gets made today is just the same old game with increasingly glitzy graphics. How many times can we play the same platform jumper? Yawn. This game smacks of innovation in all its 8 bit goodness (okay, arguably 32 bit goodness ;) I love it when simple mechanisms lead to interesting emergent behaviors. The dynamics of shot timing, leading the target, waiting for line of sight, prioritizing targets, and working around the evolving shape of the planet all combine to make a spectacularly fun experience out of a small handful of objects.

    Thanks for porting this gem, and for doing such a fine job of it! You've made the world a better place.
    Last edited by ForumTools; 10-01-2010 at 11:47 PM. Reason: Forum Migration

  8. #8

    Default

    Wow, this runs and looks great and is *tons* of fun to play. Any chance of posting source code? I know I would learn a lot from being able to look over it...

    Mike
    Last edited by ForumTools; 10-01-2010 at 11:47 PM. Reason: Forum Migration

  9. #9

    Default

    epmoyer -- Thank you! Although I'm not much of a gamer, I think I know what you mean about the 80s and 8-bit goodness. Thank goodness for people like Tom Hudson, an Atari deity back in the day.


    MinimumWage -- Thanks, but I don't know how much you'd learn from the source. It's pretty messed up. However, posting it was my original intention (if there was sufficient interest). Maybe I'll wait for bug reports first.



    Michael
    Last edited by ForumTools; 10-01-2010 at 11:47 PM. Reason: Forum Migration

  10. #10

    Default

    EP Moyer said...
    One of the things I miss about the 80's is that back then game designers were constantly seeking out new mechanics. So much of what gets made today is just the same old game with increasingly glitzy graphics. How many times can we play the same platform jumper? Yawn.
    Exactly! That's why the Hydra will appeal to a lot of folks. My children have all those 'glitzy' games and they hold their attention for a few minutes at most.
    I remember when getting a game you would play it till you finished it!

    All the old 8 Bit game best sellers sold the most by being fun and playable not flashhy graphics.


    @mpark

    Please release a 96MHz version, to answer your question, a new platform the 'Hybrid' runs at that speed.

    See this post for more details http://forums.parallax.com/showthread.php?p=659491


    Best regards,


    Coley
    Last edited by ForumTools; 10-01-2010 at 11:47 PM. Reason: Forum Migration

  11. #11

    Default

    I've played the original on my Atari - please post the source so I can play it on my Propeller system (similar to the demo board).
    Last edited by ForumTools; 10-01-2010 at 11:47 PM. Reason: Forum Migration

  12. #12

    Default

    mpark: Sorry, it's 10Mhz + 8*pll, thanks :) it's another project that runs at 96Mhz

    Coley: It's the other project that runs at 96Mhz, Hybrid is still 80Mhz :) my typo originally soz. 12 should have been 10. too busy with second project.
    Last edited by ForumTools; 10-01-2010 at 11:47 PM. Reason: Forum Migration

  13. #13

    Default

    Everyone likes a bit of constructive criticism right? It's quite hard with this game, as it's incredibly polished for a first release. I can't find any bugs at all!

    Just one odd thing. I played it first using my WinTV card for display. Even at full screen the bullets were almost invisible. To the extent I didn't even notice they were there the fist time I played it! Trying it out on a real TV, the bullets are very clear and bright. I'd just put it down to the WinTV card, except that the bullets in Eric's Space War game are very bright on the WinTV card. Although the Space War bullets go slower, so that might contribute.

    Game play wise, I didn't pick up on the missiles at first. But the missile display and count at the level end is enough to hint that there are some to be found. But when I did, I didn't find them to be a much stronger weapon than a volley of bullets. I can see that they work like Missile Command missiles, but they just didn't seem so useful here. Perhaps there could to be some small enemies that are harder to shoot with bullets that the missiles would be better for.

    Perhaps the small enemies could bring a bit of Defender type action in? Moving rapidly they could steal something from the planet, and then make their escape? And something bad happens if all of the somethings are taken? You can shoot the enemies to retrieve the somethings which then fall under gravity back to the planet.

    It'd be nice to have some details of how you put the game together. What graphics driver did you use? What res? How many colours? How did you produce the sound?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Help to build the Propeller wiki - propeller.wikispaces.com
    Last edited by ForumTools; 10-01-2010 at 11:47 PM. Reason: Forum Migration

  14. #14

    Default

    Forrest -- Yay, another Atari guy! I'm going to post the source (see below).

    Baggers -- The Hydra is 10MHz * 8, so maybe it'll work as is. Did you try it?

    Coley -- The Hybrid is your baby, isn't it? Shouldn't you know its clock speed?

    CardboardGuru -- Constructive criticism is always welcome and I thank you for it.

    I don't know what to tell you about the "invisible" bullets.

    The MC-style missiles are my addition (I figured I should do something with the right mouse button) and smaller enemies were definitely in the plan, but I ran out of time and memory (I'm down to 1 free long). Instead, I·tried to design a few levels where you'd want to use the missiles to spray-and-pray a defensive cover of explosions, but more power to you if you can stick to the classic PD weapon and ignore missiles (and rack up the extra points).

    Anyhoo, I'll post the source tonight in the hopes that
    • Forrest can get it working on his demo board and relive the days of Atari glory
    • Baggers/Coley can get it working on the Hybrid
    • CardboardGuru can find a bullet color that will show up on WinTV
    • MinimumWage will find it informative.
    Last edited by ForumTools; 10-01-2010 at 11:47 PM. Reason: Forum Migration

  15. #15

    Default

    I have attached a source archive to the first post.
    Last edited by ForumTools; 10-01-2010 at 11:47 PM. Reason: Forum Migration

  16. #16

    Default

    mPark, thanks for releasing the source, and yes, the Hydra is 10Mhz, the hybrid is 5Mhz, I have so many things goin on in my head at the mo, and so many clock versions of the prop.

    My wife's nan died last friday, and my mum had a major stroke on Sunday, so please forgive my lack of attention to detail :) as you can imagine, my head is all over the place at the mo.

    Again, thanks for posting the source, I'll have a play later, when I get chance.

    Baggers,
    Last edited by ForumTools; 10-01-2010 at 11:47 PM. Reason: Forum Migration

  17. #17

    Default

    mpark said...
    Coley -- The Hybrid is your baby, isn't it? Shouldn't you know its clock speed?
    lol, yes I should!

    We have many things on the go at the moment and one product associated with the hybrid runs at 96MHz, sorry for the confusion.

    Thanks for releasing the source, I am looking forwards to trying this one, so it's a big thank you from me.

    Best regards,

    Coley
    Last edited by ForumTools; 10-01-2010 at 11:47 PM. Reason: Forum Migration

  18. #18

    Default

    Another Atarian here. (CoCo too)

    Thanks for this! It plays well and is a lot of fun. Brings back lots of happy memories waiting for new issues COMPUTE!, ANALOG, Antic, Creative Computing, etc... to hit the shelves each month. What a fun time.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Propeller Wiki: Share the coolness!
    Last edited by ForumTools; 10-01-2010 at 11:47 PM. Reason: Forum Migration

  19. #19

    Default

    Hi mpark,
    Got it working, just changed the clock speeds, and modified the original mouse.spin ( added getparameters and removed bounding functions, to make it fit in memory :) ) and changed mouse pins to pin 14,15.

    Works great, and it's very addictive.

    Well done, very nice port.

    Jim.
    Last edited by ForumTools; 10-01-2010 at 11:47 PM. Reason: Forum Migration

  20. #20

    Default

    Thanks for posting the source mpark! Maybe I'll learn something from reading through it - if I can pull myself away from playing it... =)
    Last edited by ForumTools; 10-01-2010 at 11:47 PM. Reason: Forum Migration

+ Reply to Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts