Jump to content





Revised station shots

Posted by SpiceWare, in Draconian 17 June 2017 · 528 views

In the prior builds the stations would randomly shoot in 1 of 8 directions.  I've revised the routines to do the following:

  • station shots can travel in 32 different directions
  • identify the pod closest to player
  • randomly decide to shoot from that pod, as well as the 2 adjacent to it (the chance of firing is tied to the difficulty level and the sector you're in)
  • each pod now has a unique cool down timer before it can shoot again (before it was 1 timer for the station as a whole).  Cool down duration is tied to difficulty level and sector you're in.
  • station shots can take out asteroids and mines (and the player earns points!)
  • station shots are now slower than the player's ship
It took a few iterations to get this working, and I thought y'all might find the test builds interesting!
 
First off was the "closest pod to player" detection test.
Attached File  draconian_20170613_closest_pod.bin (32KB)
downloads: 29
Attached Image
 

 

Then was direction to fire from the identified pod.  Identified direction is drawn using a line of stationary shots, though they are still deadly.  This showed a few issues such as if you attack from the bottom of the station the station preferred to shoot straight down, making it easy to hit an open core, while if you attack from the top the station preferred to shot at an angle, making it easy to take out the pods.
Attached File  draconian_20170615_direction_test_2.bin (32KB)
downloads: 25
Attached Image
 
After a few iterations I go the targeting to work much better.  In this build the line of stationary shots is no longer deadly as I extended the line.
Attached File  draconian_20170617_direction_test_3.bin (32KB)
downloads: 25
Attached Image
 
While the routines are functional there's a few things I need to do before they're finalized:

  • decide if the firing should be from the 2 pods closest to the player rather than 3 pods (the closest pod and it's neighbors).  I'm leaning towards 2 pods as I often see one of the neighbors shooting slightly through the station.
  • fine-tune the cool down timer
  • fine-tune the random chance of firing
 
For Harmony or Stella (requires Stella 5.0.0-pre8 or newer)
Attached File  draconian_20170617.bin (32KB)
downloads: 23






I agree on the 2 Pods only firing, the 3rd often shoots thru the station. But even in this scenario, a shot from "A", a diagonal shot ( currently inside the circle) can sometimes go thru the station

 

draconian 20170617

 

Thanks for posting the steps, it is neat to see the pod AI visualized.

  • Report
Closest pod and neighbors include pods that have been destroyed, so if all 3 are destroyed the station won't fire at all.

As such, A shouldn't be shooting at all as the closest is the pod aabove the ship, and it's neighbors are the leftmost pod and the destroyed pod to the right.

Shooting from A could happen if you were flying to the left just before that screenshot was taken.
  • Report

Thanks for posting the steps, it is neat to see the pod AI visualized.


Usually I'd be posting the source as well, but CDF's still a work in progress. We don't want the driver to get out until we've finalized it as it's possible we'll have to change how it works, and thus break backwards compatibility in Stella like we did with BUS.

  • Report

Closest pod and neighbors include pods that have been destroyed, so if all 3 are destroyed the station won't fire at all.

As such, A shouldn't be shooting at all as the closest is the pod aabove the ship, and it's neighbors are the leftmost pod and the destroyed pod to the right.

Shooting from A could happen if you were flying to the left just before that screenshot was taken.

I'm pretty sure I was flying left to right then turned down just as I took the screen shot, I'll try again

  • Report

Yes, I was flying left to right, the pod at "A" fired thru the station just as I crossed the threshold between lower left intact pod and the destroyed lower right one. my ship would have been dead centre between the lower two pod spots

  • Report
You could still do 3 pods firing, you'd just have to detect if a shot will go through the station and not have the "problem pod" fire at that angle. A lesser angle could be used, however inaccurate it may be. Or not fire at all.

Wha does the arcade game do?
  • Report

Had a busy Sunday - my folks & I headed down to met my sister & brother-in-law for lunch at The Pumphouse in Victoria, Texas in celebration of Father's Day and my sister's upcoming birthday.  Victoria's midway between Houston and Corpus Christi(where my sister lives).

 

 

Wha does the arcade game do?

 

Not sure what the arcade does, playtesting while trying to figure that out results in my ship getting destroyed :lol:  That's one of the reasons for Rules of the Game, to get community feedback to build a better understanding of how Bosconian works.
 
Additionally there'd be the tradeoff between extra code for "sometimes fire from the 3rd pod" or "space for better sounding samples".    In this instance, I'd most likely choose the samples.

  • Report

You could still do 3 pods firing, you'd just have to detect if a shot will go through the station and not have the "problem pod" fire at that angle. A lesser angle could be used, however inaccurate it may be. Or not fire at all.
Wha does the arcade game do?

The arcade game doesn't shoot thru the base, destroyed pod or not ;)
  • Report

Search My Blog

Recent Entries

Recent Comments

Latest Visitors

0 user(s) viewing

0 members, 0 guests, 0 anonymous users