endless-sky / endless-sky

Space exploration, trading, and combat game.
https://endless-sky.github.io/
GNU General Public License v3.0
5.83k stars 1.03k forks source link

Request: Default emission point for ships #4700

Open Zitchas opened 4 years ago

Zitchas commented 4 years ago

Is your feature request related to a problem? Please describe. There have been a number of requests for features of various kinds that run into the problems related to "where does it come from?" The default answer is usually "the center of the ship," but we have some ships for which something coming from the center doesn't look good. For most of these, taking up a turret slot doesn't really feel appropriate, and the thing may not really function without having some kind of defined point.

The things running into these include such things as:

Related Issue Links Amazinite's flotsam tractor beam would be one instance of this being useful. My request for the ability to add bays as outfit types would also benefit from this. Finite Sky's request for more hardpoint types might be relevant as well.

Describe the solution you'd like I would like a point to be added to the ship definition, just like guns, turrets, engines, fighters, and drones currently are. This "default" point would be listed in the ship data file, and would be used as a catch-all point whenever the game needs a point for something to come off a ship but doesn't have a more appropriate point available. This point would by default be on the belly of the ship, so anything coming off it would always come from underneath.

In the data file it would look something like: default 0 0

For an example in context:

    outfits
        X2700 Ion Thruster        
        X2200 Ion Steering        
        Hyperdrive        
    engine -6 30        
    engine 6 30
    gun 0 -31        
    default 0 15
    leak leak 60 50

Additional context Given that this is an ambiguous point, I don't think it should be listed on the ship UI, although I suppose it could be identified as "Misc. Hardpoint" or something of the sort.

It might be useful to allow multiple points to be specified, with the engine simply cycling through points whenever they are used. Some ships might benefit from this, although it may also look kind of odd in some circumstances, depending on how it's done.

Additionally, given that the "default" hardpoint could potentially have anything in it (gun, turret, missile, fighter, whatever else needs a hardpoint or an emission point that doesn't exist elsewhere on the ship), this should usually be treated as under or inside the ship.

Just to re-iterate. This does NOT actually give ships any additional spaces for guns or turrets or whatever. This simply establishes a location on the ship that will be used as necessary. For example, one could have a "Gun hardpoint outfit" that takes up 25 outfit space and provides +1 gun hardpoint. We can technically do this in the code right now. But an outfit can't specify a co-ordinate on the ship, so the game needs to know where on the ship the stuff will come from.

beccabunny commented 4 years ago

I think that it would be nice that if no "default" is specified, then it is read as having "default 0 0", since: -the features this is needed for don't seem to need to limit the quantity of an item that can be installed in like the weapon hardpoints do -it avoids having to specify "default 0 0" in almost every ship except one or two -better plugin compatibility

Zitchas commented 4 years ago

Yes, having the default be 0,0 would be ideal, for exactly those reasons.

petervdmeer commented 4 years ago

This would probably work well for turrets and launch bays, but I'm afraid that it would look strange for guns if the projectile would suddenly appear above the firing ship.

Zitchas commented 4 years ago

That is why I was thinking the best case scenario would be for things to appear from underneath the ship. We can hide all sorts of weaponry under there.

petervdmeer commented 4 years ago

That is why I was thinking the best case scenario would be for things to appear from underneath the ship. We can hide all sorts of weaponry under there.

I understand, but I believe the engine currently always draws beams and projectiles on top of ships. It would be quite complex to change that to draw part of the beam and/or projectile under the ship.

An easier to implement solution would be to automatically move the default 0,0 point to the front of the ship in case it is a default for a gun (and keep the default where it is for turrets and bays).

Or another option is to have a separate second default for things (guns) that should appear from the front of the ship.

Zitchas commented 4 years ago

OK. Either one of those would work. That being said, the bays should definitely be from underneath (and the engine currently supports that, so that shouldn't be an issue.)

having separate default points for gun ports, turrets, and bays might make the most sense. If there is a clean way to determine where the front tip of the ship is, use that as the default point for guns, and 0,0 for turrets and bays.

Zitchas commented 3 years ago

OK, apparently a bunch of detail I thought was in this issue isn't, so must have been discussed elsewhere. An expansion of the original idea was concocted to make a better implementation, so now it includes a number of parts.

While it is not expected that we ever get to step 5 (a ship with absolutely no hardpoints of any kind seems rare), a better substitute for 0,0 would be if we could look at the outline of the ship, and pick the farther point forward along the central axis that is on the outline. Then we would guarantee not appearing in voids inside the ship.

Zitchas commented 3 years ago

So, an example that has been oft requested: A fighter bay!

200 outfit space, gives us 1 fighter bay. And then we buy a petrel to put in it.

When we go to launch our fighter, the game should note that we don't have a normal fighter bay specified at normal co-ordinates. Thus it should check our ship to see if we have any alternate fighter bays that it could launch out of. If we don't, then it looks for a normal fighter bay it could double up on. If not, then it looks for a gun hardpoint, and we do have that, so it launches from underneath the front of the ship.