Fractal Softworks Forum

Please login or register.

Login with username, password and session length

Author Topic: Creating 'threatened' zones  (Read 3216 times)

LazyWizard

  • Global Moderator
  • Admiral
  • *****
  • Posts: 1365
    • View Profile
    • GitHub Profile
Creating 'threatened' zones
« on: December 19, 2012, 05:23:30 PM »

I've been working on some custom weapon effects, and for the most part it's going well. However, there is currently no way to tell the AI that a zone is dangerous, meaning they gladly do things like fly directly into a black hole. ;)

Would it be possible to add a system to designate areas to avoid so the AI knows to pathfind around them?
Logged

xenoargh

  • Admiral
  • *****
  • Posts: 5078
  • naively breaking things!
    • View Profile
Re: Creating 'threatened' zones
« Reply #1 on: December 19, 2012, 09:14:37 PM »

+1; amongst other things, it'd make it possible to tell the AI to dodge Hulks and other Entities, which would be useful :)
Logged
Please check out my SS projects :)
Xeno's Mod Pack

MCWarhammer

  • Ensign
  • *
  • Posts: 45
  • What time is it?
    • View Profile
    • MCWarhammer's Homepage
Re: Creating 'threatened' zones
« Reply #2 on: December 19, 2012, 10:53:49 PM »

I REALLY want to see a ship fly directly into a black hole...
Logged
Quote from: Alex
I'm not a robot! *bzzt* *chirp*

ArkAngel

  • Captain
  • ****
  • Posts: 404
  • The essence of strategy is choosing what not to do
    • View Profile
Re: Creating 'threatened' zones
« Reply #3 on: December 20, 2012, 10:22:03 AM »

Add gravitational hazards would be a nice addition to the combat game play
Logged
"Yes... Yes I -am- sending you, alone, unarmed, against the might of the Hegemony defense fleet.  Not to worry - watching how they obliterate your puny frigate will be most... enlightening.  I shall dissect their tactics and emerge victorious!  Any questions? Then get to your ship, you launch in 5."

Wyvern

  • Admiral
  • *****
  • Posts: 3803
    • View Profile
Re: Creating 'threatened' zones
« Reply #4 on: December 20, 2012, 10:28:19 AM »

Could you add an invisible, hostile-to-everything ship with guns pointed in all directions and an AI that just never actually shoots anything?
Logged
Wyvern is 100% correct about the math.

ArkAngel

  • Captain
  • ****
  • Posts: 404
  • The essence of strategy is choosing what not to do
    • View Profile
Re: Creating 'threatened' zones
« Reply #5 on: December 20, 2012, 02:24:50 PM »

Eh I don't think that would work. The ships wouldn't avoid the invisible ship they would shoot at it.
Logged
"Yes... Yes I -am- sending you, alone, unarmed, against the might of the Hegemony defense fleet.  Not to worry - watching how they obliterate your puny frigate will be most... enlightening.  I shall dissect their tactics and emerge victorious!  Any questions? Then get to your ship, you launch in 5."

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24149
    • View Profile
Re: Creating 'threatened' zones
« Reply #6 on: December 20, 2012, 06:04:07 PM »

I've been working on some custom weapon effects, and for the most part it's going well. However, there is currently no way to tell the AI that a zone is dangerous, meaning they gladly do things like fly directly into a black hole. ;)

Would it be possible to add a system to designate areas to avoid so the AI knows to pathfind around them?

I've looked at this more or less recently, and it's actually quite difficult. It does beyond just avoiding something the way it avoids collisions and missiles and such - it would also have to take it into account while traveling somewhere (with the danger zone in the way), and somehow resolve conflicts like "missile avoidance requires me to strafe left, danger zone requires me to strafe right".

I'll probably end up taking another look at it at some point, though.


Hmm. As a really hacky way of doing it, you might have some high-velocity, invisible missiles at the center of the black hole, pointing out at regular angular intervals - and then reset their location to the center of the black hole every frame. The AI would still see those as moving and would try to avoid them...

I've no idea how well that would work in practice, though. Probably fail horribly and/or have unintended side effects :)
Logged

intothewildblueyonder

  • Captain
  • ****
  • Posts: 278
    • View Profile
Re: Creating 'threatened' zones
« Reply #7 on: December 20, 2012, 06:24:41 PM »

Could you describe what they are doing now? Want to give better ideas/suggestions

utilizing existing mechanics:
dodge asteroid AI (not sure the exact calculation
make the item you wish for them to avoid an immobile (or approx. with very low speed) projectile(s)

Does the AI already calculate how much damage it will take from given items and choose to dodge the most of what it can actually dodge?
« Last Edit: December 20, 2012, 06:26:44 PM by intothewildblueyonder »
Logged

hadesian

  • Admiral
  • *****
  • Posts: 2058
  • It's been one of those days...
    • View Profile
Re: Creating 'threatened' zones
« Reply #8 on: December 21, 2012, 08:41:55 AM »

I've been working on some custom weapon effects, and for the most part it's going well. However, there is currently no way to tell the AI that a zone is dangerous, meaning they gladly do things like fly directly into a black hole. ;)

Would it be possible to add a system to designate areas to avoid so the AI knows to pathfind around them?

"missile avoidance requires me to strafe left, danger zone requires me to strafe right".

That's quite an interesting point there, and there's two ways I'd handle that.
One is to be blunt, just say 'this is more damaging, avoid'.
Another is to randomly choose to dodge either, with modifiers based on some logic.
Logged
Changes as of May 24, 2013
  • Reinvented Starsector.
  • That is all.

Sonlirain

  • Commander
  • ***
  • Posts: 143
    • View Profile
Re: Creating 'threatened' zones
« Reply #9 on: December 22, 2012, 07:16:38 AM »

I've been working on some custom weapon effects, and for the most part it's going well. However, there is currently no way to tell the AI that a zone is dangerous, meaning they gladly do things like fly directly into a black hole. ;)

Would it be possible to add a system to designate areas to avoid so the AI knows to pathfind around them?

I've looked at this more or less recently, and it's actually quite difficult. It does beyond just avoiding something the way it avoids collisions and missiles and such - it would also have to take it into account while traveling somewhere (with the danger zone in the way), and somehow resolve conflicts like "missile avoidance requires me to strafe left, danger zone requires me to strafe right".

Maybe make the AI take the "lesser evil" and take the 3 pilums 500 damage each instead of avoiding them and flying into a "fire" that might deal well over 500 damage.
Logged