Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Version 7 (modified by noep, 10 years ago) (diff)

Big Ships

A BigShip should consist of multiple parts which can be individually destroyed, and the state of the individual parts should alter the behaviour of the entire vessels systems, such as shield, weapons or engines.

Ticket #356: Big Ships
Ticket #418: Big Ships implementation


Example

The HeavyCruiser spaceship is used to show how a complex big ship could look.

HeavyCruiser is composed of (at least) 9 parts: (the names used to refer to the parts are in gray)

  • Body (body)
    • Front extension L/R (frontL and frontR)
    • Sidebox L/R (partL and partR)
    • Sidearm L/R (sidearmL and sidearmR)
      • Sidearm front L/R (sidearmLfront and sidearmRfront)
Partattached todescription/function
bodyN/AMain part of the ship.
frontL/RbodyFront extensions of the ship. A rapid firing, weak laser is mounted on each of them.
partL/RbodyBoxes on the side of the ship. Provide extra shield-and boost power.
sidearmL/RbodyLarge sidearms of the ship. An engine is mounted on each of them, providing the ship with more acceleration.
sidearmL/RfrontsidearmL/RFront ends of the sidearms. A strong weapon can be mounted on them.
turretsbodyRapid firing autonomous turrets, defending the ship against nearby opponents.


Detailed Specification

We assume there is two kind of objects needed to create a big ship:

  • The main ship body (subsequently referred to as BigShip), which is controlled like any other spaceship by a player or AI.
  • Sub-parts of the ship (subsequently referred to as ShipPart), which are attached to either a BigShip or a ShipPart. They can interact with their parent-part in many ways.


Desired final form

Big ships should easily be assembled in an XML template like any other ship.

Here an example how this could look:

<BigShip [parameters]>

    <engines>
        ...
    </engines>
   
    <attached>   
        <Model [parameters] />
       
        <ShipPart [parameters]>
            <attached>
                <Model [parameters] />
            </attached>
            <collisionShapes>
                ...
            </collisionShapes>
        </ShipPart>
       
        <ShipPart [parameters]>
            ...
        </ShipPart>
    </attached>
   
    <collisionShapes>
        ...
    </collisionShapes>
   
<BigShip>


Possible interactions of parts

The parameters of BigShip and ShipPart describe how the parts interact with each other. This requires the objects to support a wide range of functions, here's a few examples:

  • Damage-sharing: Hits received by a BigShip or ShipPart can be shared to other parts attached to it
  • Variable-modification: Destruction of a part can e.g. reduce shield reload rate
  • Destruction events: If a part is destroyed, it can destroy objects like weapons or engines


BigShip

The BigShip class could be an extension of the existing SpaceShip class.
Additionally to a normal spaceships functions, it has a list of ShipParts which are attached to it. The BigShips engines, weapons etc. can be modified by its subparts.


ShipPart

In order to make a ShipPart attachable, it has to be a static entity.


Problems

With the current implementation of Pawns, it is impossible to nicely implement such a big ship into the game. This is due to the only destructible entities being Pawns, which are dynamic entities, which again cannot be attached in XML. Therefore the structure of Pawns needs to be changed, in order to create destructible static entities, which Bullet (the physicsengine) can attach to a spaceship.

Another problem is how to attach turrets. They need an AI controller and they need to be able to move (rotate), yet they need to be attachable.

A discussion on this topic can be found on the Forum.


Current implementation

Currently the HeavyCruiser ship created in the HS13 PPS provides a model for such a large spaceship.
In a demonstration level the vessel can be flown, and all its parts are individually destructible. This was achieved by literally hooking multiple Pawns together using collisionboxes hidden inside the spaceship. However the destruction of parts does not influence the ships systems behaviour at all.


More Ideas

BigShips could use an own HUD, to show individual parts health.

Systems of the BigShip could be controlled, e.g. power can be manually directed to engines, shields or weapons.