dcsimg
A Flash Developer Resource Site

Page 1 of 2 12 LastLast
Results 1 to 20 of 28

Thread: [post mortem] virus - a drawing API game

  1. #1
    383,890,620 polygons nGFX's Avatar
    Join Date
    Oct 2002
    Location
    Germany / Ruhrgebiet
    Posts
    902

    [post mortem] virus - a drawing API game

    Virus was one of my entries to the great mousebreaker comp.
    virus on mousebreaker

    The idea to virus came from some experiments with the flash drawing API, a font plotter I've written for some other game and a line plotter (which is used by the font plotter) and the wish to do something keyboard only controlled (verrry retro).

    Optics were mainly inspired by the c64 look of elite (and I must admit I took a great deal of inspiration of elite's planet creation routines, too)

    The idea is simple, using asteroids like movement and a set of baddies: just kill them. So the enemies should have some sort of AI to them in order to make them more interesting.
    As this never was meant as a "big" game - the MB comp forced me to finish it and add some depth (not much).

    There are just 3 enemy types:
    simple android, they just move from one sector of the screen to another, if the player comes in range they fire at the player and fly towards him. Androids may become trackers if a tracker gets killed.

    tracker, they actively try to find a way to the player and shoot at him. Trackers also drop mines which can be shot in order to set the secondary weapon. (nasty little buggers they are)

    factory, they appear when too many androids have been killed and spawn 2 "super mines" which turn into androids after a while.

    All graphics, including the 3d-ish clip arts on the menu screens and the (very basic) ingame animations are drawn from a set of coordinates, I first wanted to store them in an external xml file but was to lazy to do so in the end. So currently they are stored as array inside the main swf. The player sprite for instance looks like this:
    aPlayer = [[100, 0], [80, 30], [100, 50], [50, 150], [20, 50], [30, 180], [50, 150], [150, 200], [100, 50], [150, 150], [180, 50], [170, 180], [150, 150], [50, 200], [100, 50], [120, 30], [100, 0]];

    The arrays were created using a very, very, very unusable editor I wrote, but still better than doing it by hand, isn't it?
    virus gfx ed

    Paste this into the textbox and click "read" on the right side, afterwards just click on "preview"...
    Code:
    aData[0] = [[26, 95], [126, 151], [223, 182], [311, 100], [300, 48], [492, 191], [311, 100], [396, 309], [445, 351], [489, 432], [393, 413], [382, 365], [382, 358], [161, 279], [201, 420], [26, 95], [70, 188], [201, 420]];
    aData[1] = [[126, 151], [388, 338], [387, 333], [391, 307], [396, 309], [391, 307], [489, 432], [393, 413], [391, 307], [387, 333], [388, 338], [387, 359], [382, 358], [387, 359], [387, 355], [149, 235], [161, 279], [126, 151], [186, 199], [144, 217], [186, 199], [386, 338]];
    aData[2] = [[300, 48], [301, 109], [311, 100], [320, 122], [492, 191]];
    aData[3] = [[223, 182], [387, 333]];
    The biggest piece of virus is the sound, the androids doing some "paradroid"-ish kind of communication (they really do make some noise when they exchange data ). The speech was done with "Sam Reciter" and afterwards noised up in audacity.

    Some stats:
    - 140k as2 code (including gfx), 14 classes
    - 100k for background and logo images
    - 392k sound and music
    - about 50h coding work
    - some 10h sound
    - some 5h testing and debugging
    - 3L sweat and tears because of flash 32k per class problem
    - 20L tea and/or coffee
    - some bottles of beer to forget about that game on weekends
    - some sheets of paper for sketches and notes (mainly ToDos)
    - endless lines of curses and bad words for flash, my coding and the world in general

    Thanks to Squize playing and feedback.

    nGFX.

    ps: No bitmap sprites were harmed during the creation of this game. No pngs are abused during gameplay. All lines were over 18 at the time of the creation, records are kept for verification.
    Last edited by nGFX; 12-19-2006 at 08:02 AM. Reason: darn typos

  2. #2
    Student
    Join Date
    Apr 2001
    Location
    -
    Posts
    4,756
    poor nGFX, nobody has been replying so far
    sadly I dont have that much time writing everything down your project would call for. So I make it short:
    - technically nice: very smooth and good controls (even main menu with keyboard control- gives the game a more no flash game feeling aka like a real game)
    - nice bouncing & physics feels nice to control
    - layout & design are also good

    some critiques:
    - slow transitions between menu & gameplay. I sometimes had to wait many seconds until I was able to control the ship. This is rather a design question therefore more personal

    so overall very nice (esspecially from a technology standpoint)
    that´s it for now,- more by chance as the discussion starts

  3. #3
    Hype over content... Squize's Avatar
    Join Date
    Apr 2001
    Location
    Lost forever in a happy crowd...
    Posts
    5,928
    See the love hasn't quite made it to this thread yet.

    Squize.

  4. #4
    2KHeroes / Sylvaniah designer luxregina's Avatar
    Join Date
    Jul 2001
    Location
    Somewhere between Kirlundin and Anskaven
    Posts
    1,272
    I actually LOVE it ! I don't have much to say about it that would be constructive, except maybe that I would like the background to change, to give me a real feel that I'm changing sectors ...

    maybe also more emphasis on the "labyrinth" element, as it is a nice addtition to the "asteroid" feel of the game : I actually like that the rockets / lasers you send have some feedback on your ship, and I love the bounce thingy : had a nice bit of strategy to the whole thing...

    But, the sound ....the sound ....the sound is AWESOME ! it totally serves its purpose to remind you those oldies : I was actually feeling like I was playing on a deluxe version of my old ( and dead ) Vectrex console I like the speech fake-synthesis feel : more of it would be pure sex ( like annoncing timers, enemies, etc ... )

    Excellent work : definitely going in my favorites, and will be replaying it !

  5. #5
    2KHeroes / Sylvaniah designer luxregina's Avatar
    Join Date
    Jul 2001
    Location
    Somewhere between Kirlundin and Anskaven
    Posts
    1,272
    bah, Squize, you posted that while I was writting my message !

  6. #6
    Hey Timmy!!! walsher's Avatar
    Join Date
    Jan 2005
    Location
    Latrobe, PA
    Posts
    1,899
    Sweet game. I just love the graphics. And there all made from the drawing API, correct? I've heard of it, not real to fimilar with it, thats why I ask.

    I liked using the keyboard to go through the menu's. Added the effect of it not bein a Flash game, even though it is. The ship movements were nice too. At first I didn't know way the score thingy was in the middle and I tried going through it.

    Wasn;t able to check out the sound, due to no speakers at work. But will definitely check them out at home.

    Overall, great game. Will be play'n it again.

  7. #7
    Flash / Php game designer
    Join Date
    Mar 2005
    Location
    UK
    Posts
    253
    I like the graphics but didn't really enjoy the game... not sure what was wrong with it but the menu screen annoyed me at the start because i can barely read the text, theres way too much information on the screen at once and the movement is really tricky. Everything else is impressive though!

  8. #8
    Senior Member ozmic66's Avatar
    Join Date
    Oct 2005
    Posts
    472
    I think you did a really nice job with this game. very well polished and gameplay is good. maybe there's a few features to be added/changed but overall its a quality game
    Pixelwave Flash-based iPhone framework
    iPhone Games: Flyloop | Freedom Run

    Twitter: Oztune

  9. #9
    M.D. mr_malee's Avatar
    Join Date
    Dec 2002
    Location
    Shelter
    Posts
    4,140
    very nice game. I love the glows and shooting physics, effects are really cool to.

    What else can i say, it was fun to play, nice graphics and wikid sound

    ++love
    lather yourself up with soap - soap arcade

  10. #10
    383,890,620 polygons nGFX's Avatar
    Join Date
    Oct 2002
    Location
    Germany / Ruhrgebiet
    Posts
    902
    Quote Originally Posted by luxregina
    to give me a real feel that I'm changing sectors ...
    It first had no background at all, but found it a bit "empty" so I added that single backround image which blends with the surrounding html (not on MB, though) , the "map" (256 locations, btw) was added later and the deadline was way to close to add more :| - and it would def. have not been within the 600k size limit) ...
    DARN! I guess I should make a deluxe version

    Quote Originally Posted by luxregina
    old ( and dead ) Vectrex console
    You had one? - I loved that thing a friend of mine had one and I tried to visit every now and then to play with it (and you found the main reason for the visual style ).

    Quote Originally Posted by walsher
    And there all made from the drawing API, correct? I've heard of it, not real to fimilar with it, thats why I ask.
    Yup, and it's a pain in the a** to do it this way.

    Quote Originally Posted by ozmic66
    a few features to be added/changed
    yup. The todo had a lot more things on it that I dropped to meet the deadline, there had been some more extra weapons and some more gameplay elements ... maybe in the delux version - but I doubt it ...

    nGFX

  11. #11
    ********* mentuat's Avatar
    Join Date
    Mar 2002
    Location
    out of office
    Posts
    718
    only had a quick 2 minute play but thought I'd leave a comment in case I don't get a chance to fondle it more before xmas.

    nice to see a remake of omega race, one of my favourite quick blasts!

    plays nicely, if a little sluggish compared to the original, very slick presentation, looks like it's had a lot of love - but could do without all the text at the start and between levels, I found it kinda unnecessary for such an easy to pick up game and pretty hard to read with the glowing effect.

  12. #12
    Hype over content... Squize's Avatar
    Join Date
    Apr 2001
    Location
    Lost forever in a happy crowd...
    Posts
    5,928
    I got to see this all through it's development, and I really love it.

    The glow effects and overall presentation are just sex. I think the comments about some of the text screens being a bit busy are valid if it's treated as a 10 minute quick blast fix, but I think they add a lot of depth and atmosphere for people playing it longer.

    "50h coding work"

    That's so little ( "Project Soon" has just crossed the 300 hour barrier ).

    Blue be good to read about the use of ASBroadcaster in the game as well, what advantages it gave, what problems it's thrown up etc.

    Squize.

  13. #13
    Senior Member
    Join Date
    Sep 2006
    Posts
    133
    Very nice effects with the graphics and music. Gives a great feel of the old asteroids.
    The way the graphics draw is like vector graphics used to, the music is very 80's retro. The glow/reflection to the text looks very old monitor. I thought you could do with slightly more flicker to the ships though as I thought old graphics flickered like this. To be honest, I am not sure why old games did flicker like this, very noticeable on the old atari 2600 I used to play.
    As I was playing, an old program called terrahawks end theme came to mind... I'm off to youtube to see if it's there...
    I like the style to this game...

    edit: your game is more polished than terrahawks. I didn't mean to compare them terrahawks used to look a lot better to me as a kid, that must be it. I still like it's music though.
    Last edited by programicks; 12-21-2006 at 05:04 PM.
    May 2009 - Working on Thorenzitha RPG - episode 7

  14. #14
    383,890,620 polygons nGFX's Avatar
    Join Date
    Oct 2002
    Location
    Germany / Ruhrgebiet
    Posts
    902
    Quote Originally Posted by Squize
    Blue be good to read about the use of ASBroadcaster in the game as well, what advantages it gave, what problems it's thrown up etc.
    DARN! I really forgot about that ...

    K. let's go go down and get the hands dirty with some code ...
    As squize mentioned, virus makes *heavy* use of the asBroadcaster, it's a pure beauty to work with. The game also reuses every MC instead attaching/removing them.

    When the game starts, I create a number of empty MCs and assign them to the various objects (classes), right now I prepare 15 MCs for the player's bullets, 20 MCs for enemies' bullets and 1 MC for the player sprite and 25 for enemies.
    (So there are up to 61 sprites to be used and controlled - but I made some tests and it is quite possible to control twice as many, though you have to disable any effect and set the quality to low)

    As all bullets, enemies and the player share the same movement code (I'm using a force, direction and friction) and bounce of the walls the same way, I decided to write a basic Sprite class that then is extended for the various sprite types. (Bullet, Enemy and Player)

    To make life a bit easier all enemies are contained in one Enemy class using a iType and a iState variable for the different behaviours.

    The Sprite class contains the basic set of events to be used by the AsBroadcaster like "onMove", "onHide" ...

    In order to make the collision detection "simple" a Sprite also contains two arrays with references to the available bullets, the enemies and the "friends" it could collide with.

    The main game onEnterFrame (and the whole game uses only one) just contains a few lines of code and does this:
    - update HUD if needed
    - redraw border if needed
    - check for Keys
    - set player forces with objPlayer.setForce(north, east, west, firea, fireb);
    - call AsBroadcast "onMove"

    That's it. simple as 1, 2, 3 ...

    As I mentioned that I use only one set of bullets, I guess I should go a bit into detail there, too.
    The game contains a "BulletHandle" class, which isn't very bright, but gets the job done. It basically keeps track of the bullets being used/unused ...

    When a bullet is fired, it is marked as used in the BulletHandle, when it dies (or hits something) it's id (array position) is moved to the "unused" stack.
    So instead of firing the bullet from the player/enemy code, I call BulletHandle.fire, giving a direction, a starting point, speed, duration and an array of targets.

    The BulletHandle then takes the first unused bullet sets it's position and forces and enabled the "onMove" event (which is then used with the AsBrodcaster).
    As the bullet has a list of targets (either player(s) or enemies) it just has to check these for hits (and only if they are in the same "sector" of the screen.

    This way I got some 150 objects moving, bouncing and firing during tests, but the the drawing API and the effects takes their pay and drain cpu power like mad (using BMPs and no effects there was nearly no noticeable slowdown and the game ran steady at 24 fps)

    I guess that's it for now, if I missed something or left you puzzled give me a shout and I try to make things clearer ...

    nGFX
    Last edited by nGFX; 12-25-2006 at 04:06 PM. Reason: darn typos ...

  15. #15
    Banned
    Join Date
    Dec 2006
    Posts
    18

    What do you like about this game?

    Many people think this is a great game.
    What do you like about this game, Which part?
    I would like to get your opinions.
    Thanks.



    ===========================
    Card games is my nature,
    Can you tell me the game for me?
    Reveal your future, tarot reading
    www.tarotcard-psychic.com

  16. #16
    Untitled-1.fla strille's Avatar
    Join Date
    Mar 2001
    Location
    Sweden
    Posts
    1,626
    I can't believe I nearly missed this game! It looks great! Love the minimalistic style and it's really polished. Pretty good gameplay as well.

    My only complaint is that the difficulty lies in controlling the ship rather than the enemies/level design. It's really difficult to avoid bullets, and the recoil when shooting makes the game harder. I died a lot at first and I got the sense that it wasn't much I could do about it, which felt a bit frustrating. This is something that becomes less of a problem once you've mastered it though.

    Overall, it's really good!

  17. #17
    purple lizard
    Join Date
    Jan 2007
    Location
    somewhere in the world
    Posts
    85
    ok nGFX, i know this topic is starting to get a bit old now, but scince you are so good at API, i wonder if you could help me with a project i'm working on? here

  18. #18
    383,890,620 polygons nGFX's Avatar
    Join Date
    Oct 2002
    Location
    Germany / Ruhrgebiet
    Posts
    902
    dang!. missed the reply (and I was on a short holiday, too).

    @strille: yeah I the controlling of the ship is the real task, and I know it's hard to avoid bulltets with the movement controls alone, the trick is to use the recoil of your primary weapon (it's just a tiny wee bit faster than the enemy bullets, but enough to get away)

    @gecko: I'm just jumping over to the thread ...

    nGFX

  19. #19
    Developer
    Join Date
    Apr 2007
    Location
    UK
    Posts
    324
    Yo! That is a technically brilliant game! I cant even think how hard it was to primarily use the drawing API.

    One question - you mention that you use collision detection where the bullets only checks for collisions if they are in the same "sector" of the screen.

    Did you follow the ideas from this article :
    http://lab.polygonal.de/articles/rec...al-clustering/
    or did you create your own class. I'm interested to know how hard and how long it took to implement this as I'm creating a game myself which is to be run in full screen and I'm looking to use a sector by sector collision detection too.

  20. #20
    383,890,620 polygons nGFX's Avatar
    Join Date
    Oct 2002
    Location
    Germany / Ruhrgebiet
    Posts
    902
    hi cortana,

    nope actually it's way easier in this case.
    the screen is devided in 4 "sectors" (each 1/4 of the playing area), so it's only top/left, top/right, bottom/left and bottm right to check.

    Though it could be devided some more, but it wouldn't make it any easier or faster in this case.

    nGFX

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center