Author Topic: Asteroid Busting  (Read 3483 times)

0 Members and 1 Guest are viewing this topic.

Offline Admiral Nelson

  • Resurrecter of Campaigns
  • 211
  • The GTA expects that every man will do his duty.
Search is broken, so here's this question again.  There was some code at one time, IIRC, to permit capships to shoot at asteroids.  Also IIRC this code was removed as it made certain missions too easy.  Would it be practical to make this a mission level flag?  In one mission converted from FS1 an important ship can be destroyed simply by idling along until the asteroids smash it to bits.  I suppose the other work around is to make it invulnerable for a while, or give it a few esort fighters.  Nevertheless, I'll throw the idea out again... :)
If a man consults whether he is to fight, when he has the power in his own hands, it is certain that his opinion is against fighting.

 

Offline StratComm

  • The POFressor
  • 212
  • Cameron Crazy
    • http://www.geocities.com/cek_83/index.html
I have a very strong suspicion that this is the sort of thing tied in to the new ai settings table.  Unfortunately I've been here in presence only for almost the last month so I don't know the specifics of that.
who needs a signature? ;)
It's not much of an excuse for a website, but my stuff can be found here

"Holding the last thread on a page comes with an inherent danger, especially when you are edit-happy with your posts.  For you can easily continue editing in points without ever noticing that someone else could have refuted them." ~Me, on my posting behavior

Last edited by StratComm on 08-23-2027 at 08:34 PM

 

Offline taylor

  • Super SCP/Linux Guru
  • Moderator
  • 212
    • http://www.icculus.org/~taylor
I'm pretty sure that the asteroid firing code is still in there by default and isn't controlled by a flag or anything.  It's set up in a way to affect balance as little as possible.  That's not to say that it hasn't broken at some point but last time I checked it was working fine.

 

Offline WMCoolmon

  • Purveyor of space crack
  • 213
I thought about making it more and less flexible than that. Basically in ships.tbl you'd specify:
Code: [Select]
$Target precedence: ("weapon" "asteroid" "bomber" "figheter" "cruiser")and so on, with flags that would let you set what the weapon would go for first. IE with the example above, the turret would go for bombs then asteroids.

Right now tho, I think the Asteroid code is just commented out, so it'd be easy enough to add some kind of flag toggle for it.
-C

 

Offline taylor

  • Super SCP/Linux Guru
  • Moderator
  • 212
    • http://www.icculus.org/~taylor
Right now tho, I think the Asteroid code is just commented out
It's not, just checked to make sure.  Asteroids are always targetted last though.

 

Offline WMCoolmon

  • Purveyor of space crack
  • 213
Hmmm...so I see.

Although you could still make capships a little better at killing asteroids with
Quote
// don't use turrets that are better for other things:
   // - no cap ship beams
   // - no flak
   // - no heat or aspect missiles
   // - no spawn type missiles/bombs
   // do use for sure:
   // - lasers
   // - dumbfire type missiles
   // - AAA beams
-C

 

Offline taylor

  • Super SCP/Linux Guru
  • Moderator
  • 212
    • http://www.icculus.org/~taylor
Heat, aspect, and spawn weapons are useless against asteroids.  Cap ship beams are far too overkill and the friendly fire is problematic.  Same thing with flak and friendly fire.  I got killed numerous times during testing because of friendly fire problems so the list of usable weapons got trimmed to just those three types.  Every asteroid mission I've seen was also an escort mission so all of the fighters and other ships in the area require protection from the idiot AI.  Good mission designers can get around this easily though and make the reduced weapon types against asteroids work for them.

 

Offline Wanderer

  • Wiki Warrior
  • 211
  • Mostly harmless
This is partially OT but as WMC said:
I thought about making it more and less flexible than that. Basically in ships.tbl you'd specify:
Code: [Select]
$Target precedence: ("weapon" "asteroid" "bomber" "figheter" "cruiser")and so on, with flags that would let you set what the weapon would go for first. IE with the example above, the turret would go for bombs then asteroids.

So if such a feature is ever going to be introduced... Wouldn't this kind of a change cause some probs or have possibility of causing probs with existing weapon flags (bomber+, huge) and also should this kind of change be rather included to the weapons instead of ships table. Just an opinion if this is planned to be added to the game.
Do not meddle in the affairs of coders for they are soggy and hard to light

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Pretty much what Wanderer said. A change to the targetting precidence would be best in the weapons table as you could then have weapons that were anti-cap or anti-fighter only.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]

 

Offline IPAndrews

  • Disgruntled Customer
  • 212
  • This site stole my work
Surely asteroids though would always be at the back of the target precedence list. So that turrets would only target them if there were no more pressing threats (any kind of enemy) in their FOV? In which case a simple "turrets shoot asteroids" flag in the mission file would suffice.
Be warned: This site's admins stole 100s of hours of my work. They will do it to you.

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
In Rebels & Renegades for instance only the Vasudan bombers are a greater threat than the asteroids though because the fighters were ignoring the Iceni in order to take out the NTF fighters.

Maybe we need tables and a SEXP to alter them on a case by case basis.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]

 

Offline IPAndrews

  • Disgruntled Customer
  • 212
  • This site stole my work
Well in that case an ai-change-precedence SEXP or something might be a good idea. Never needed one myself though, but if you have you can bet I probably will one day.
Be warned: This site's admins stole 100s of hours of my work. They will do it to you.

 

Offline Selectah

  • 27
  • Unsuspended
Erhm.. the only thing that's needed for such a thing is a toggle SEXP, for instance set-asteroid-priority of 0 or 1, setting asteroids either as first or last in target priorities. A sign flip on the target priority list would probably suffice. A completely dynamic set-target-priority list is probably too difficult to implement, though. However, it would make the AI more .. well.. human, if you will.

- Selectah
Selectah Fan Club Member

disregard this post

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Erhm.. the only thing that's needed for such a thing is a toggle SEXP, for instance set-asteroid-priority of 0 or 1, setting asteroids either as first or last in target priorities. A sign flip on the target priority list would probably suffice. A completely dynamic set-target-priority list is probably too difficult to implement, though. However, it would make the AI more .. well.. human, if you will.

- Selectah

It's best for non-programmers to stay out of it when deciding how difficult something will be to implement. Changing the priority of the asteroid targetting could very easily involve exactly the same functions regardless of whether it was done via your or my method.

Best to just suggest things and then let the coders decide which is more difficult.

Well in that case an ai-change-precedence SEXP or something might be a good idea. Never needed one myself though, but if you have you can bet I probably will one day.

I've never needed one but I can think of many occassions I'd have used one if I had it. There are quite a few missions where a capship will say we'll handle enemy x, you handle y. I wouldn't mind seeing it actually do that :)
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]

 

Offline WMCoolmon

  • Purveyor of space crack
  • 213
Implementing either method would take roughly the same amount of work.

First you need an array.
Code: [Select]
char *Turret_order_names[NUM_TURRET_ORDER_TYPES] = {
"Bombs",
"Ships",
"Asteroids",
};

For each turret(ship? ship class? turret on a ship class?) you'd add another array:
Code: [Select]
int targeting_priority[NUM_TURRET_ORDER_TYPES];
Then in get_nearest_enemy_objnum():
Code: [Select]
for(int i = 0; i < NUM_TURRET_ORDER_TYPES; i++)
{
     switch(targeting_priority[i])
     {
          case -1:
               //Empty priority slot
               break;
          case 0:
               //Return if a bomb is found
               //...
          case 1:
               //Return if a ship is found
               //...
          case 2:
               //Return if an asteroid is found
               //...
          default:
               Int3(); //Means invalid number passed.
     }
}

Then you just need to add the SEXP, which is time-consuming but not really hard. Essentially what the code will do then is iterate through the array, which stores a series of numbers that correspond to each target type. When it hits the number corresponding to a type, then it'll target that object if one of that type exists.

The array above would be used for translating the numbers into human-readable strings in the SEXP (and vice-versa) by the order.

Dynamic order rather than simple priority actually results in a simpler code sequence because you don't need new functions or more if() checks (or, Goob forbid, gotos).

So, what basis would this be on?
-C

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
It would be nice to have one which works on all turrets (or all turrets of a certain type) on a ship and a more granular version which only affects a named turret if possible.

If you're only doing on go with the lowest level one. I could use when-argument or something to make all the turrets on a ship work.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]

 

Offline Goober5000

  • HLP Loremaster
  • Moderator
  • 214
    • Goober5000 Productions
(or, Goob forbid, gotos)

Hey, I like GOTO! :p I've even used it once or twice in the SCP.

 

Offline WMCoolmon

  • Purveyor of space crack
  • 213
turret-set-target-order and ship-turret-target-order should be in the next CVS build.
-C

 

Offline Trivial Psychic

  • 212
  • Snoop Junkie
 :nod: Nice.  :yes:
The Trivial Psychic Strikes Again!

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Excellent :)
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]