Separate weapon entities

Talk among developers, and propose and discuss general development planning/tackling/etc... feature in this forum.
Post Reply
-REBEL3-
Bounty Hunter
Bounty Hunter
Posts: 132
Joined: Sun Nov 01, 2009 2:43 am
Location: Alaska

Separate weapon entities

Post by -REBEL3- »

During Starbright's work on the Franklin, we decided we wanted weapons to be separate entities from the ship-installed onto the outside rather then built onto the ship by modelers. Instead, modelers would create flat surfaces, which coders could designate hardpoints-places the new weapons could be installed. I've heard that the code already exists in the PU project. I'd like to see this code imported into VS-it would simplify things for modelers, and create some more visible diversity among ships.
Boaal
Hunter
Hunter
Posts: 93
Joined: Sun May 06, 2007 6:43 pm

Re: Separate weapon entities

Post by Boaal »

I always wondered why they didn't do this originally.
I do support this idea, but it does mean that the small dev team would have to rework (pretty considerably) the existing models for each ship.
And then model each type of gun.

So I'm not sure how feasible it really is, given the circumstances.
The Twitching Pattern - http://www.last.fm/music/The+Twitching+Pattern
Have a listen.
Neskiairti
Confed Special Operative
Confed Special Operative
Posts: 334
Joined: Thu Jan 11, 2007 4:10 am

Re: Separate weapon entities

Post by Neskiairti »

considering just about every ship entity /needs/ to be redone.. thats not so terrible a feat :P and you /can/ simply overlap guns with hardmounted guns. would look weird until fixed, but it wouldnt break the game.
Deus Siddis
Elite
Elite
Posts: 1363
Joined: Sat Aug 04, 2007 3:42 pm

Re: Separate weapon entities

Post by Deus Siddis »

I think it wouldn't make a significant enough visual difference to be worth doing, on its own.

If it was to make a more impactful feature work, only then would it make sense, imo. So if you wanted to make weapons separate units so that they could also track targets like turrets when they were mounted on autotrackers, that might be cool. Or if all major components of a ship are separate, destructible subunits as well as weapons, that too would be worth it.

But otherwise, all guns are basically cylindrical housings around EM accelerators or LASER's and all missile launchers are cylindrical tubes housing missiles. You won't see enough visual distinctions switching from one weapon system to the next.

And last but not least, you'll only see anything when most of the weapon is visible from the outside (and therefor unnecessarily very vulnerable to damage). That counts out all Aera ships, probably all Rlaan ships and any Human ships that mount their forward weapons in gun pods and missile pods.
Neskiairti
Confed Special Operative
Confed Special Operative
Posts: 334
Joined: Thu Jan 11, 2007 4:10 am

Re: Separate weapon entities

Post by Neskiairti »

they would be destructible subunits :p the code is already there, really.. just create turrets with 0 arc or 5 degree arc.. or whatever.. call them something else, sure.. but if i was writing the code, i would have them inherit from the same class with very minimal changes.. mostly cosmetic.

the hard part is likely going to be converting ships.. so you are going to have an overlap.. either ships without guns for a while.. or ships with mesh guns and sub-unit guns..
klauss
Elite
Elite
Posts: 7243
Joined: Mon Apr 18, 2005 2:40 pm
Location: LS87, Buenos Aires, República Argentina

Re: Separate weapon entities

Post by klauss »

Ehm... this already is like that.

There are weapon mounts and there are weapon meshes.

I think VS doesn't show that because there aren't any meshes for weapons (ie: the weapons xml has a name, meshes/mounts must hold a similarly-named bfxm).
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
Neskiairti
Confed Special Operative
Confed Special Operative
Posts: 334
Joined: Thu Jan 11, 2007 4:10 am

Re: Separate weapon entities

Post by Neskiairti »

er.. so in other words, all the work is already done? just need the meshes?
klauss
Elite
Elite
Posts: 7243
Joined: Mon Apr 18, 2005 2:40 pm
Location: LS87, Buenos Aires, República Argentina

Re: Separate weapon entities

Post by klauss »

Pretty much.
It could also be disabled by config. I didn't check.
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
TBeholder
Elite Venturer
Elite Venturer
Posts: 753
Joined: Sat Apr 15, 2006 2:40 am
Location: chthonic safety

Re: Separate weapon entities

Post by TBeholder »

I'm for turning mount points into subunits completely. This would give more sensible autotracking via functions already working in turrets. Of course, to do this properly subunits would need 1) radar integration with their owner and 2) change in weapon control.
The next step could be placing those pulse caps and coolers close to the load, where they belong. :wink:
When subunits will properly work, that is. Right now they are the worst bugs' nests in VS. :(
"Two Eyes Good, Eleven Eyes Better." -Michele Carter
klauss
Elite
Elite
Posts: 7243
Joined: Mon Apr 18, 2005 2:40 pm
Location: LS87, Buenos Aires, República Argentina

Re: Separate weapon entities

Post by klauss »

I'm against that for technical reasons.

A subunit involves its own AI, it's a notorious drain on system resources. If every ship has 4+ AIs (its own + 3 mountpoints on average, not to mention capships), things could get out of hand really easy.
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
TBeholder
Elite Venturer
Elite Venturer
Posts: 753
Joined: Sat Apr 15, 2006 2:40 am
Location: chthonic safety

Re: Separate weapon entities

Post by TBeholder »

klauss wrote:I'm against that for technical reasons.

A subunit involves its own AI, it's a notorious drain on system resources. If every ship has 4+ AIs (its own + 3 mountpoints on average, not to mention capships), things could get out of hand really easy.
Hmmm, you're right.
BTW, can AI be made more configurable and given some efficient stubs? I mean, even proper turrets aren't supposed to do many things a normal unit does... It may be a "fighter", but does it need to know how to do "afterburn turn away"? Or anything other than separate scripts without maneuvers would be too much of a mess to do now?
"Two Eyes Good, Eleven Eyes Better." -Michele Carter
klauss
Elite
Elite
Posts: 7243
Joined: Mon Apr 18, 2005 2:40 pm
Location: LS87, Buenos Aires, República Argentina

Re: Separate weapon entities

Post by klauss »

Few people understand how AI "scripts" work atm, so very few people can actually do what you propose.

Last time I checked, the AI was some kind of limited but flexible state machine. Understanding that much, however, didn't help into making me able to mod it. I just don't grasp the concept behind the scripts.

I've been meaning to write a whole new AI model I can understand (and hopefully others too), because right now VS AI could use a lot of improvement, it probably could support a lot of functionality, yet it doesn't because noone knows exactly how to get it done.
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
Deus Siddis
Elite
Elite
Posts: 1363
Joined: Sat Aug 04, 2007 3:42 pm

Re: Separate weapon entities

Post by Deus Siddis »

Is there any chance of contacting the original creator of the AI?

Also is it written mostly in C++ or Python?
klauss
Elite
Elite
Posts: 7243
Joined: Mon Apr 18, 2005 2:40 pm
Location: LS87, Buenos Aires, República Argentina

Re: Separate weapon entities

Post by klauss »

I'm not sure who it is. Assuming it's Hellcatv (the original author of the entire engine), I doubt he's got enough free time to do what we'd have to ask of him: to thoroughly document the AI system.

Documentation, if not done slowly over time (as you write the code), takes a lot of time.
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
Neskiairti
Confed Special Operative
Confed Special Operative
Posts: 334
Joined: Thu Jan 11, 2007 4:10 am

Re: Separate weapon entities

Post by Neskiairti »

it should still be a subunit for design reasons.. but can you strip out the ai from it? so it just fires on its fixed trajectory?
klauss
Elite
Elite
Posts: 7243
Joined: Mon Apr 18, 2005 2:40 pm
Location: LS87, Buenos Aires, República Argentina

Re: Separate weapon entities

Post by klauss »

@Neskiairti: that's what mount points really are. Just a separate mesh that is aimed toward your target.
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
TBeholder
Elite Venturer
Elite Venturer
Posts: 753
Joined: Sat Apr 15, 2006 2:40 am
Location: chthonic safety

Re: Separate weapon entities

Post by TBeholder »

klauss wrote:I've been meaning to write a whole new AI model I can understand (and hopefully others too), because right now VS AI could use a lot of improvement, it probably could support a lot of functionality, yet it doesn't because noone knows exactly how to get it done.
But how to make it transparent?
A straightforward set of event handlers (install/uninstall/damaged/owner is hit/owner performs an action (fire/steer/special)/tick), maybe even on Python? :wink: That would be not only more flexible, but i suspect not noticiably slower (at least unless they'd have nested loops and all on python)... Of course, this way they'll mostly just use the functions from engine.
Deus Siddis wrote:Is there any chance of contacting the original creator of the AI?
Also is it written mostly in C++ or Python?
C++, AI scripts themselves in some sort of XML. With a little Python on top (is it really used?). Or in between. A bit of everything. :twisted:
Neskiairti wrote:it should still be a subunit for design reasons.. but can you strip out the ai from it? so it just fires on its fixed trajectory?
That's more or less what i wanted, but seems to be mostly hardcoded and how the unit's fields control it isn't quite clear.
But if units are divorced from AI, they may as well be split between functionality and "physical" object (just a mesh with hitpoints and attachment points) and we won't have those endless units.csv lines that are used only in proper units anyway?..

Edit: i forgot about Python.
Last edited by TBeholder on Sat Aug 14, 2010 8:45 am, edited 2 times in total.
"Two Eyes Good, Eleven Eyes Better." -Michele Carter
Neskiairti
Confed Special Operative
Confed Special Operative
Posts: 334
Joined: Thu Jan 11, 2007 4:10 am

Re: Separate weapon entities

Post by Neskiairti »

ah, i was thinking as in opposed to weapons modeled in to the ship model. That always bugged the crap out of me :p
TBeholder
Elite Venturer
Elite Venturer
Posts: 753
Joined: Sat Apr 15, 2006 2:40 am
Location: chthonic safety

Re: Separate weapon entities

Post by TBeholder »

And if we're at it, a weapon is three things:
  • ship device: it's an upgrade and the way it expends energy or ammo isn't necessarily unique
  • physical object: visible, damageable mount
  • effect emitter: can be unified with thrusters, shields, and probably some other things like damage indication - then the stellar radiation can be implemented as a literally "very long fusion blast".
Then bolts are physical objects with basic properties but no AI attached, missiles are exactly the same with AI (proximity detonation can be done via universal properties with minimal changes), engines are sort of beams, and can wash a lot. :)
And big radar dishes... this would require AI understanding where not to go, but maybe can be solved via the same collision avoiding algorithm.
"Two Eyes Good, Eleven Eyes Better." -Michele Carter
Post Reply