Warhawk Attackwave & Nuance Kreator (W.A.N.K)

flash · 54086

Offline flash

  • Administrator
  • Blue Gene Super Computer
  • **********
    • Posts: 13180
on: February 24, 2009, 02:26:57 pm
Here is the first part into how the Attack wave code is stored and used!

The text is also attached!

----Alien Level Based Attacks----

The attack wave system is described using several "blocks". All these blocks are defined in a source file "attackwave.s" within the main code.

The first, and easiest to explain is the Level relevent data, this is a block of data referenced by the name "alienLevel"

Each level has a block of 128 words that describe what happens when in relation to the scrollers position, as such

.word
   scrollPos, alienWave, scrollPos, alienWave, scrollPos, alienWave, etc....

The scroll pos must be in descending order, ie. starts from the scrollers original position and works back until the lowest value, 160.

So, for example,

3650,1,3450,2,3060,4....

At "yposSub" 3650, initialise attack wave 1, then at 3450, wave 2, then wave 4... etc!

But, it is not that simple :)

We also have a modifier on the attack wave, and 2 special waves...

attack wave 8192 = Initialise "Mines"
attack wave 16384 = Initialise "Hunters"

These 2 attack waves are handled by the main code and do not need to be defined further.

Also, the attack wave word is split into 2 16bit values,

[ high ][ low ]

The [ low ] denotes the actual attack wave, and the [ high ] denotes the modifier

The modifier can have a value of :-

0 = The attack wave is a single attack and each alien can be classed "independent"
 - this is what we would class a normal attack (so just attack wave, no modifier)

The following values affect the way the sprites are placed on the screen. There are 2 priorities. A "low" draws the sprites with a lower priority, and "high" does the opposite

1 = Draw "low" priority
2-4 = Draw "low" priority, *BUT* all aliens with this value will be treated as a whole, ie, shoot one and they will all flash
5 = Draw "High" priority
6+ = Draw "high" priority, *BUT* all aliens with this value will be treated as a whole, ie, shoot one and they will all flash

So, that covers how the system works!

---Levels---


The 128 word data is stored sequentially one block after the other!

The first 128 is level 1, next is level 2.... etc....
There is no need to add a alienLevel1 name, as the main code calclulates the offset during play.

PHEW!!!!


After this i will start to go into the way the attack waves are constructed from individual alien defines!! :)
« Last Edit: February 27, 2009, 09:22:10 pm by Flash »

Coding for the love of it!


Offline BaDToaD

  • Proterian
  • Dragon 32
  • *****
    • Posts: 76
Reply #1 on: March 18, 2009, 08:56:51 pm
An interesting read. I take it you'll be implementing the "Toroidal Orienter and Sprite Shifter" soon then... T.O.S.S  ::)



Offline flash

  • Administrator
  • Blue Gene Super Computer
  • **********
    • Posts: 13180
Reply #2 on: March 18, 2009, 09:16:55 pm
oh yeah - T.O.S.S. is in there...

and also the Twisted Warhawk Alien Termination...

Coding for the love of it!


Offline BaDToaD

  • Proterian
  • Dragon 32
  • *****
    • Posts: 76
Reply #3 on: March 18, 2009, 09:22:27 pm
And the Binary Object Lighting Logistics Ocillating Collision Kalcuating Sequencer.



Offline Sokurah

  • RBP Member
  • Cray-1 Super Computer
  • *****
    • Posts: 724
    • Tardis Remakes
Reply #4 on: March 18, 2009, 09:30:10 pm
You also need a piece of "Create Unlimited Nebula Textures" software for the backgrounds in the game.  ::)



Offline flash

  • Administrator
  • Blue Gene Super Computer
  • **********
    • Posts: 13180
Reply #5 on: March 18, 2009, 09:38:36 pm
well, I was gonna use that, but discovered code for Fractal Analytical Normalised Negetive Independent Etchings

I discovered it rolls off the tongue better

LOL

Coding for the love of it!


Offline Sokurah

  • RBP Member
  • Cray-1 Super Computer
  • *****
    • Posts: 724
    • Tardis Remakes
Reply #6 on: March 18, 2009, 09:56:23 pm
Hmm, great piece of sortware, but not nearly as useful as the "Very Abstract Generation of Ingrouped New Aliens". Jus' sayin'.



Offline flash

  • Administrator
  • Blue Gene Super Computer
  • **********
    • Posts: 13180
Reply #7 on: March 19, 2009, 06:58:18 pm
I have a feeling that RetroRemakes will have us for copyright infringement LOL :)

Coding for the love of it!


Offline flash

  • Administrator
  • Blue Gene Super Computer
  • **********
    • Posts: 13180
Reply #8 on: March 22, 2009, 07:19:58 pm
"alienWave"
-----------

Each atack wave (alienWave) (as pointed to in alienLevel) is a string of 32 words that each point to the alien to initialise.
The first bank (0) is a 32 word blank area so that 0 can be used to denote no-attack in alienLevel.

AlienWave is just 32 words and each is the number of an alien (singular) that is defined as described later. A 0 in the wave denotes "no more aliens".

BUT... (another addendum)
ok, in the alienwave... the high word (top 16 bits) of the "alienDescript" to be initialised, are used as an X offset.. This way you can set an alien to init at 0,0 and offset it across the screen. this does not modify any tracking points, but i may add that..?

Ok, now the tricky bit!!!!!

"alienDescript"
---------------

This is used to describe a singular sprite in the game and uses hi/low split words to keep the data down to just 8 words for the main description and 22 words for the movement data.

The first 8 words are as follows...

Word 1
------
Low 16      =   Initial X coord of the alien
High 16      =   FIRE - Amount of bullets to fire in BURST mode (0=normal fire)
High 16      =   OR, for random fire set to 32768 (and rate in word 2)

word 2
------
Low 16      =   Initial Y coord
High 16      =   FIRE - Delay between BURST shots
High 16      =   OR, random rate (0-65535 = higher=more frequent)

word 3
------
whole 32   =   Initial X speed   in CURVED mode
         OR overal speed when in LINEAR mode

word 4
------
whole 32   =   initial Y speed in CURVED mode
         OR, set to 1024 to signal this alien is LINEAR mode

word 5
------
Low 16      =   Max speed, this is an overal speed that governs both
         X and Y speeds
High 16      =   Friction! the time it takes for a CURVED alien to turn
         the higher the slower (4-8 is a good base)
         leaving at 0 will set the default of 5

word 6
------
whole 32   =   Sprite object. This is the image to use for the alien.

word 8
------
low 16      =   Hits to kill... (0= one shot)
high 16      =   Shot speed, the speed in pixels the bullets move


word 8   (i may make this a 16/16 split)
------
Low 16      =   Fire type (0=none)
high 16      =   Fire delay, how long till next shot or next BURST shot(s)
         (set to 0 if using random shots)


So, that describes a single alien, the next 24 words tell it what to do..

These are paired

part1, part2, part1, part2, part1, part2, and so on....

The use of these changes depending on the alien type...

CURVED ALIEN
------------
part1, part2   =   Track x,y

A curved alien starts at the initial x,y coord and uses intertia/friction to move to the next track point based on the settings in alienDescript. When the alien reaches the track x,y point, it will then head to the next and so on, unless:-
   if part1=1024 it will track YOU on the X axis
   if part2=1024 it will track you on the Y axis
   or, make both 1024 and it will hunt you down,
   (this ends the tracking as a pattern based alien)

   set part1 and part2 to 2048 and this will instantly kill the alien.
   this does not explode but is handy if you tuck an alien off the screen
   and want rid of it.

   if part1 and part2 are 0, or it is the last part of the 24 words, then
   the attack motion will loop.

LINEAR ALIEN
------------
part1, part2   =   Direction, Distance

A linear alien starts at the set init coords and moves in the direction (1-9) and moves in that direction the set number of pixels set in part2
unless:-
   set part1 and part2 to 2048 and this will instantly kill the alien.
   this does not explode but is handy if you tuck an alien off the screen
   and want rid of it.

   if part1 and part2 are 0, or it is the last part of the 24 words, then
   the attack motion will loop.


ADDENDUM:
---------
further to part1, part2 as described above... if the high 16 bytes of part one are anything other than 0, it has this effect:-

1 = set speed of alien to 0
2 = set speed of alien to 1
etc.

for a linear alien, this is a direct change.
for a non-linear alien, this changes the maximum speed the alien can travel.

--------------


OK,
Well, i hope that makes some sense... :)

« Last Edit: March 30, 2009, 08:05:09 pm by Flash »

Coding for the love of it!


Offline flash

  • Administrator
  • Blue Gene Super Computer
  • **********
    • Posts: 13180
Reply #9 on: March 26, 2009, 05:46:52 pm
just done a little update to part 2 of the attack system description.

Coding for the love of it!


Offline headkaze

  • Administrator
  • Blue Gene Super Computer
  • **********
    • Posts: 7838
Reply #10 on: March 26, 2009, 07:21:39 pm
The WANK has begun!  :D



Offline flash

  • Administrator
  • Blue Gene Super Computer
  • **********
    • Posts: 13180
Reply #11 on: March 26, 2009, 07:23:46 pm
You always manage to put a smile on my face... even when it involves WANK :)

Looking great mate...

Coding for the love of it!


Offline flash

  • Administrator
  • Blue Gene Super Computer
  • **********
    • Posts: 13180
Reply #12 on: March 26, 2009, 10:42:26 pm
these are the "current" fire codes

fire values

0   =   no fire

1   =   fire up
2   =   fire right
3   =   fire down
4   =   fire left

5   =   fire left but.. with update to level scroll
6   =   fire right but.. with update to level scroll

7   =   fire left.. with double scroll update
8   =   fire right.. with double scroll update

9   =   tracker shot

10   =   accelerated shot

11   =   Ripple shot (2 bullets)

12   =   Ripple shot (3 bullets)

13   =   Mine shot

14   =   Triple shot

15   =   Ripple shot phase 1
16   =   Ripple shot phase 2

17   =   Direct shot

18   =   spread shot (5 bullets)

19   =   spray shot (BOSS only)
« Last Edit: March 27, 2009, 07:16:58 am by Flash »

Coding for the love of it!


Offline headkaze

  • Administrator
  • Blue Gene Super Computer
  • **********
    • Posts: 7838
Reply #13 on: March 27, 2009, 04:53:58 pm
Some early screenshots
« Last Edit: March 27, 2009, 05:58:16 pm by headkaze »



Offline flash

  • Administrator
  • Blue Gene Super Computer
  • **********
    • Posts: 13180
Reply #14 on: March 27, 2009, 05:34:13 pm
Here is the breakdown of the sprite layout..


Coding for the love of it!


Offline headkaze

  • Administrator
  • Blue Gene Super Computer
  • **********
    • Posts: 7838
Reply #15 on: March 28, 2009, 03:28:11 pm
W.A.N.K Version 1.0 Released!

Download
« Last Edit: March 29, 2009, 11:50:17 pm by headkaze »



Offline flash

  • Administrator
  • Blue Gene Super Computer
  • **********
    • Posts: 13180
Reply #16 on: March 28, 2009, 06:53:12 pm
HK...

Here is a level1.xml file that lays out what attacks happen when in the level.

I do have some suggestions,

I need a way visually to see in the main view what alienLevel settings are assigned. that the moment you have the boxes all central. could one with an alienWave set to 0 (ie. none) be on the left? and the ones that are assinged have text next to them to show the wave and modifyer?

In the numberical entry boxes, ie. scroll pos, if i enter a value (or start typing a larger value) less than the set minimum, i get a crash and error (which i can send if needs be?)

for alienWave, we use wave 0 as a blank. in WANK, when selecting wave 0, we can edit this? does this relate to wave 1 or should the minimum wave have been set to 1? perhaps it should be 1-8191 as the wave number?

That is it for now. Please import the attachment so you can see that it is hard to see what is used and what is not?

Thanks HK...

EDIT: one other thing,

The boxes in the main view are 160 pixels too low, as the top point in the map at the moment is 0, when the scroll stops in game it is 160. the values stored within the alienlevel boxes is fine, they just need to be displayed as if the first location on Y was 160
« Last Edit: March 28, 2009, 07:04:03 pm by Flash »

Coding for the love of it!


Offline flash

  • Administrator
  • Blue Gene Super Computer
  • **********
    • Posts: 13180
Reply #17 on: March 29, 2009, 09:16:48 pm
Here i am playing with Wank

Coding for the love of it!


Offline headkaze

  • Administrator
  • Blue Gene Super Computer
  • **********
    • Posts: 7838
Reply #18 on: March 29, 2009, 09:53:08 pm
Sweet :) Nice desktop!



Offline flash

  • Administrator
  • Blue Gene Super Computer
  • **********
    • Posts: 13180
Reply #19 on: April 01, 2009, 07:18:33 am
Level 1 attack data

Coding for the love of it!


Offline headkaze

  • Administrator
  • Blue Gene Super Computer
  • **********
    • Posts: 7838
Reply #20 on: April 01, 2009, 11:48:41 pm
W.A.N.K Version 1.0.24 Released

- Added selection box
- Added shift select to select multiple objects
- Added context menu to insert Attack Waves
- Added ability to show/hide Attack Wave 0



Offline Tempest

  • Jupiter Ace
  • *
    • Posts: 31
Reply #21 on: April 03, 2009, 02:00:56 pm
Sweet :) Nice desktop!

Yes, but I'm curious as to why when I hover over the pic it says "Whoring Hard?"
Maybe I mis-read it?



Offline flash

  • Administrator
  • Blue Gene Super Computer
  • **********
    • Posts: 13180
Reply #22 on: April 03, 2009, 02:46:59 pm
Well, I have to get the pennies from somewhere LOL

Coding for the love of it!


Offline flash

  • Administrator
  • Blue Gene Super Computer
  • **********
    • Posts: 13180
Reply #23 on: April 04, 2009, 06:27:45 pm
Level data with level 2 started

Coding for the love of it!


Offline flash

  • Administrator
  • Blue Gene Super Computer
  • **********
    • Posts: 13180
Reply #24 on: April 05, 2009, 08:59:56 pm
Still having --- er --- FUN??

LOL

Coding for the love of it!


Offline flash

  • Administrator
  • Blue Gene Super Computer
  • **********
    • Posts: 13180
Reply #25 on: April 06, 2009, 06:29:44 pm
a fair amount of level 3 - you really need to grab them powerups :)


Coding for the love of it!


Offline flash

  • Administrator
  • Blue Gene Super Computer
  • **********
    • Posts: 13180
Reply #26 on: April 07, 2009, 06:29:55 pm
Level data for levels 1-3

Level 3 is my fave... Added a really nice bit of "galactic dancing" to the end of the level... Very Galaxians, and very "curvy" :)

Level 3 NEEDS powerups though :)

Coding for the love of it!


Offline flash

  • Administrator
  • Blue Gene Super Computer
  • **********
    • Posts: 13180
Reply #27 on: April 07, 2009, 06:53:26 pm
This is what is is like on the laptop - a bit squashed :)

Coding for the love of it!


Offline flash

  • Administrator
  • Blue Gene Super Computer
  • **********
    • Posts: 13180
Reply #28 on: April 08, 2009, 06:27:49 pm
ok, data for level 1-4...

Level 4 is now my fave... lots of BIG ships and some sweet sweeping alien patterns..

I timed this one - from start to pre-release, 6.15 hours... ulp!

This one has a CHEAT in the attack waves, there is a way to kill the big aliens really easy.. :) (I like adding these things - wonder if anyone finds it on release?)

Oh well, time to start on level 5.... Starting to run out of ideas and wonder if 64 scroll inits was a little restirctive? perhaps i should have had 128 possitions to init waves? hmmm... we will see...

I think we will also go for a "ninja" version of the levels that are opened once the original 16 are completed. This will use a "similar" version of the original attack waves, but with slightly different patterns/order and be as hard as nails... :) he he...


Coding for the love of it!


Offline headkaze

  • Administrator
  • Blue Gene Super Computer
  • **********
    • Posts: 7838
Reply #29 on: April 09, 2009, 04:32:06 am
W.A.N.K v1.0.26 Released

- Now remembers last object edited
- Other minor fixes/updates