RetroBytes Portal
Programming => Warhawk DS => Topic started by: flash 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!! :)
-
An interesting read. I take it you'll be implementing the "Toroidal Orienter and Sprite Shifter" soon then... T.O.S.S ::)
-
oh yeah - T.O.S.S. is in there...
and also the Twisted Warhawk Alien Termination...
-
And the Binary Object Lighting Logistics Ocillating Collision Kalcuating Sequencer.
-
You also need a piece of "Create Unlimited Nebula Textures" software for the backgrounds in the game. ::)
-
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
-
Hmm, great piece of sortware, but not nearly as useful as the "Very Abstract Generation of Ingrouped New Aliens". Jus' sayin'.
-
I have a feeling that RetroRemakes will have us for copyright infringement LOL :)
-
"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... :)
-
just done a little update to part 2 of the attack system description.
-
The WANK has begun! :D
-
You always manage to put a smile on my face... even when it involves WANK :)
Looking great mate...
-
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)
-
Some early screenshots
-
Here is the breakdown of the sprite layout..
-
W.A.N.K Version 1.0 Released!
Download (http://members.iinet.net.au/~freeaxs/nds/Wank.zip)
-
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
-
Here i am playing with Wank
-
Sweet :) Nice desktop!
-
Level 1 attack data
-
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
-
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?
-
Well, I have to get the pennies from somewhere LOL
-
Level data with level 2 started
-
Still having --- er --- FUN??
LOL
-
a fair amount of level 3 - you really need to grab them powerups :)
-
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 :)
-
This is what is is like on the laptop - a bit squashed :)
-
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...
-
W.A.N.K v1.0.26 Released
- Now remembers last object edited
- Other minor fixes/updates
-
a bit of level 5 is now done...
I have used an idea from BaDToaD, and it works really well... Bit tricky to add, but hey - had to be done...
I will say no more and let players discover it!
Still looking for another playtester? We have BaDToaD, Lobo, and - er... me and HK dont count... so, I could do with someone else, perhaps who can also test in hardware?
-
Slight mods to levels 1-5
-
more mods levels 1-5
-
latest
-
updates to levels 1 and 2 and completed level 5
-
start of level 6
-
mods to level 6
-
more of level 6 with new fire code! :)
-
Levels 1-6 complete
-
3 hours worth of level 7 (yes it takes that long :) )
... and it is "sweet"
-
Err.. no level 7 data there mate?
-
Strange...
Try this one..
-
completed levels 1-7
-
This has got to be a bit dull, this thread... level 1, level 2, level 6, etc.....
so, in leu of more vids (though I really want to show my highscore fireworks :( ) here is me hard at work playing with level 8....
and you should see it move :) he he
Just a note, for those who wish to play... you can download "WANK" from here and also the latest level data and see how it is all put together.
-
I diddent trought WANK was not a officiel tool? But great picture to see how it all works.
Could this tool leads to do a SEUCK like tool later then?
-
I diddent trought WANK was not a officiel tool? But great picture to see how it all works.
Could this tool leads to do a SEUCK like tool later then?
WANK works to create the attack wave externally for use in the Warhawk attack engine.
It is VERY versatile and enables most things to be done in the construction of Warhawk attacks. Warhawk uses 4 attack types. with the main being linear and curved. The curved patterns work on a fast beizier based system (well - a way of doing it so it looks the same).
Well, the answer is "yes" the tool could easily be reused on any game that uses alienwave.s from the Warhawk source... and it is our official tool :)
Oh well... half of level 8 is done and looking mighty sweet!! the nicest attack patterns as yet :) Oh, I wish i could show - but that would just ruin it for ya :)
-
Level 8 done at last - this one took a while :)
-
Nice one :)
Just did an update to WANK as well so grab it when you get the chance!
-
Ok, here is half of level 9 (3 hours work - so getting quicker)
What is a bit sad is you spend so long getting acrobatic aliens and pretty patterns, and all you bastards are gonna do is bloody shoot them :) LOL
Ok, also, with HK's latest updata of WANK we now see how much memory the attack waves take... so far it sits at a MASSIVE 64k for all of them ;)
ps... what the hell is going on in the picture? :)
-
Levels 1-9 now complete - over half way there, 8 to go!!! hurrah!!!
EDIT: I meant 7 to go ... ... ... ha ha ha (if this is an indication of my maths - this game will be shit :) )
-
Well - it is level 10, but perhaps it is getting a 'little tricky'
:)
-
Nice screenshot :) You know there may be an instance in the later levels where it might make sense to swap a level or two around. So I say leave it as is and tweak later.
-
Ok, level 10 now finished and it is hard.... perhaps too hard.. looks nice but even took me 4 atempts to get through it! perhaps level 10 should not be that tricky?
ps.. are them aliens plimsoles?
-
Those aliens are part of the galactic soles federation, umm..sworn to protect the feet of the universe. :P
-
Level 11 on its way!
-
STILL playing with level 11, trying to make it "yummy" ;)
I will not be posting any videos for a while, so - Just a screen shot as I REALLY do not want to show too much! ha ha
-
At last, level 11 is finished.. This one took quite some time as I wanted to make it a little bit harder but with a few fairly safe spots to help you get through it. There are a couple of new things in this level so, as the first of the "extra" levels and Lobo's first (level designe) also, I hope I have done it proud!
I wish I could post more screens, but.... nah! One for each complete level is enough... he he
-
ps.. the 330 odd attack waves so far over 11 levels take up a terrible 78k.... ulp!
-
Ok, after a brief break, we are now half way through level 12
-
Level 12 done,
Time to start unlucky 13
-
The start of level 14..
Level 13 is skipped for the moment due to technical reasons :)
-
More level 14
-
Level 14 finished i hope!!
-
Level 15 on it's way and also something special :)
-
Some work on special attacks
-
Ok, level 15 is now done...
This leaves level 13 and 16 to do and also to make the end of level bosses work correctly - ie.. get their difficulty sorted!
-
Ok, level 16 is done!! :)
This level uses all available defines for the attack waves (per level), so there is a lot going on... and also introduces another new "thing"!
So, just level 13 to do!! :)
-
nearly there
-
Level 13 is now complete..
And this is the dullest picture of it I could find... don't wanna give anything away :)
Edit: update for boss attacks
-
That cursed level, glad to see it works with that really odd but cool flying thing. 8)
-
I was saying to Flash before that perhaps we should skip level 13 like they do in some skyscrapers LOL
-
Actually, it was level 12 that was cursed for me, couldn't align the bloody targets for the life of me!
13 was Ok ;).
-
Levels 1-16 SHOULD be fairly well balanced now - i hope!!??!!
Will need quite a bit of external testing...
-
More modifications..
-
All waves and hopefully all final boss waves...
-
Level data for both normal and mental modes!
-
Hopefully all normal and mental levels now done, lots of little additions and tweaks!
:)
-
More level tweaks