Jump to content





Station revisions

Posted by SpiceWare, in Draconian 19 June 2017 · 429 views

Reworked the stations to fire from the 2 closest pods.  For that I revised the closest pod to player tests from before, it now shows the 2 pods it'll fire from as well as the targeting line from the closest pod:
Attached File  draconian_20170619_closest_2_pods.bin (32KB)
downloads: 31
Attached Image
 
Additionally I finally tracked down a bug where you could shoot a station pod that you shouldn't be able to.  For that I built another test build (though I forgot to save a copy of the bin, sorry) which would show the last pod destroyed, and the shot that destroyed it.  I also had it show the shot further down using another missile, and once more below that using a sprite to show which collision image was used (as the image data to draw a missile is different than the image data for collision detection)*.  
Attached Image
 
In reviewing the results the collision didn't make sense - unless the pod image was being treated as a 2X sprite.   One of the things I'd recently done was revamp the sprite state to hold flags for various things like 2x, whereas before I used a ranges of image ID values to denote things like sprite sizes.  I made the change to use bits in the state variable as those are much faster to check for than a range of values: 

// constants for gSpriteState, bits fedcba9876543210
// f = sprite is onscreen
// e = sprite is deadly if it collides with player's ship
// d = sprite is deadly if it collids with enemy ship
// c = sprite is an explosion (for animation logic)
// b = fast animation speed
// a = use 4x player
// 9 = use 2x player
// 8 = show bonus points when explosion finished
// 54 = frame countdown for explosions
#define SPS_SPRITE_ONSCREEN     0x8000
#define SPS_DEADLY_TO_PLAYER    0x4000
#define SPS_DEADLY_TO_ENEMY     0x2000
#define SPS_EXPLOSION           0x1000
#define SPS_FAST_ANIMATION      0x0800
#define SPS_4X_SPRITE           0x0400
#define SPS_2X_SPRITE           0x0200
#define SPS_SHOW_BONUS          0x0100
#define SPS_FRAME_COUNTDOWN     0x0030
#define SPS_EXPLOSION_TIME_MASK 0x000f
#define SPS_4_FRAME_EXPLOSION   0x0030
#define SPS_3_FRAME_EXPLOSION   0x0020
#define SPS_DECREMENT_FRAME     0x0010
 
 
The sprite info is stored in arrays:
unsigned short int gSpriteState[MAX_SPRITES];
unsigned char gSpriteImageID[MAX_SPRITES+1];    // +1 is used for Station Pod collision detection
unsigned short int gSpriteX[MAX_SPRITES+1];     // +1 is used for Station Pod collision detection
unsigned short int gSpriteY[MAX_SPRITES+1];     // +1 is used for Station Pod collision detection
unsigned char gSpriteColor[MAX_SPRITES];
 
Key thing to note there is the +1 used for Station Pod Collision detection -  gSpriteState didn't have it as it wasn't needed before.  This caused the revised collision routine to fetch data beyond the bounds of gSpriteState when it was testing a pod collision.  A quick fix solved that problem:
unsigned short int gSpriteState[MAX_SPRITES+1]; // +1 is used for Station Pod collision detection
unsigned char gSpriteImageID[MAX_SPRITES+1];    // +1 is used for Station Pod collision detection
unsigned short int gSpriteX[MAX_SPRITES+1];     // +1 is used for Station Pod collision detection
unsigned short int gSpriteY[MAX_SPRITES+1];     // +1 is used for Station Pod collision detection
unsigned char gSpriteColor[MAX_SPRITES];
 
 
Lastly I created all new station arrangements for the Gamma Quadrant (these may be revised by Nathan at a later date).

 

For Harmony or Stella (requires Stella 5.0.0-pre8 or newer)
Attached File  draconian_20170619.bin (32KB)
downloads: 20

 

 

* This is the data to draw a horizontal shot:

MG_ShotHorizontal:      
        .byte HMOVE_0   | ON,   0 | WIDTH_4
        .byte HMOVE_0   | ON,   0
  
While this is the data used for collision detection with the horizontal shot: 
ShotHorizontal:
        .byte %11110000
        .byte %11110000
ShotHorizontalHeight = * - ShotHorizontal
 






Did some goofy testing. The pods have a narrower firing arc than we think which is why the arcade never shoots itself. It is not any fancy collision avoidance

I wangled back and forth in this zone and neither closest pod could shoot me. The pod at NE could not shoot straight down. The pod at SW could not shoot straight east.

Zone 1 0004
 
zone 1 0003
  • Report

I'll play farther in but I'd say that each pod has a firing arc that overlaps its neighbor but does not break 45ish degrees from center of the compass direction that it sits on. It cant fire in the red zone but can fire in the green (green zone approximate)

 

zones
  • Report

That's an interesting find, thanks!  

  • Report
Haven't tried it, but these mame invincibility cheats for bosconian could be useful for determining firing behaviours? http://www.mamecheat...topic.php?t=324 Chris
  • Report

Haven't tried it, but these mame invincibility cheats for bosconian could be useful for determining firing behaviours? http://www.mamecheat...topic.php?t=324 Chris

I'll try that, I was trying to get the mame movie recording to work so I can record then just frame step thru after playing but I can't get any convert tool to convert the mame goofy format properly...got annoyed and went back to playing ;)

  • Report

On higher levels, one base will shoot thru the other

Invincibility On

The pod at A will shoot at me if I am in its firing arc, even if I was in the middle of the base to the left.

The pod at B CAN'T shoot me because I am above it's arc.

multibase
  • Report

I think even on the lower levels, bases will shoot through each other (if you follow their shots across the screen far enough). They seem to just ignore each other.

  • Report

I think even on the lower levels, bases will shoot through each other (if you follow their shots across the screen far enough). They seem to just ignore each other.

correct

  • Report

I have it set up so stations' shots won't blow up a station, and likewise the player's shots won't blow up the player.  

 

I got preliminary I & P-Type missile logic working this evening, though they both use the same logic and just home in on you.  Still need to make it so you can shoot them, plan to do that tomorrow.

  • Report

Search My Blog

Recent Entries

Recent Comments

Latest Visitors

1 user(s) viewing

0 members, 1 guests, 0 anonymous users