Jump to content
  • entries
    657
  • comments
    2,693
  • views
    899,068

Station revisions


SpiceWare

1,028 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:
draconian_20170619_closest_2_pods.bin
blogentry-3056-0-26334600-1497927001.png

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)*.
blogentry-3056-0-08204900-1497927049.png

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 detectionunsigned short int gSpriteX[MAX_SPRITES+1];     // +1 is used for Station Pod collision detectionunsigned short int gSpriteY[MAX_SPRITES+1];     // +1 is used for Station Pod collision detectionunsigned 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 detectionunsigned char gSpriteImageID[MAX_SPRITES+1];    // +1 is used for Station Pod collision detectionunsigned short int gSpriteX[MAX_SPRITES+1];     // +1 is used for Station Pod collision detectionunsigned short int gSpriteY[MAX_SPRITES+1];     // +1 is used for Station Pod collision detectionunsigned 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)
draconian_20170619.bin

 

 

 

* 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 %11110000ShotHorizontalHeight = * - ShotHorizontal


  • Like 1

9 Comments


Recommended Comments

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

  • Like 2
Link to comment

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

  • Like 2
Link to comment

Haven't tried it, but these mame invincibility cheats for bosconian could be useful for determining firing behaviours? http://www.mamecheat.co.uk/forums/viewtopic.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 ;)

Link to comment

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

Link to comment

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.

Link to comment

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

Link to comment

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.

Link to comment
Guest
Add a comment...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...