5 | | A BigShip (aka !ModularSpaceShip) 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. |
| 5 | {{{ |
| 6 | #!html |
| 7 | <table border="0" bgcolor="lightgray"><tr><td> |
| 8 | <font color="red"><b>WARNING:</b> Currently (as of revision 10058) destroying a part of a ModularSpaceShip by shooting at it is likely to cause a segmentation fault, crashing the game.<br> |
| 9 | The command <i>ModularSpaceShip killshippart</i> can be used to destroy a ShipPart through the console.</font> |
| 10 | </td></tr></table> |
| 11 | <br> |
| 12 | <table border="0" bgcolor="lightgray"><tr><td> |
| 13 | <b>NOTE:</b> Not all features mentioned in this article are implemented yet. |
| 14 | </td></tr></table> |
| 15 | }}} |
| 16 | |
| 17 | A !BigShip (aka !ModularSpaceShip) is a spacecraft consisting of multiple parts, which can be destroyed individually. The destruction of parts can alter the behaviour of the vessel, for example by weakening shields, engines or disabling weapons. |
12 | | == Example == |
13 | | |
14 | | The HeavyCruiser spaceship is used to show how a complex big ship could look. |
15 | | |
16 | | !HeavyCruiser is composed of (at least) 9 parts: (the names used to refer to the parts are in gray) |
17 | | * Body [[span(style=color: #777777, (body) )]] |
18 | | * Front extension L/R [[span(style=color: #777777, (frontL and frontR) )]] |
19 | | * Sidebox L/R [[span(style=color: #777777, (partL and partR) )]] |
20 | | * Sidearm L/R [[span(style=color: #777777, (sidearmL and sidearmR) )]] |
21 | | * Sidearm front L/R [[span(style=color: #777777, (sidearmLfront and sidearmRfront) )]] |
22 | | |
23 | | ||'''Part'''||'''attached to'''||'''description/function'''|| |
24 | | ||body||N/A||Main part of the ship.|| |
25 | | ||frontL/R||body||Front extensions of the ship. A rapid firing, weak laser is mounted on each of them.|| |
26 | | ||partL/R||body||Boxes on the side of the ship. Provide extra shield-and boost power.|| |
27 | | ||sidearmL/R||body||Large sidearms of the ship. An engine is mounted on each of them, providing the ship with more acceleration.|| |
28 | | ||sidearmL/Rfront||sidearmL/R||Front ends of the sidearms. A strong weapon can be mounted on them.|| |
29 | | ||turrets||body||Rapid firing autonomous turrets, defending the ship against nearby opponents.|| |
30 | | |
31 | | [[br]] |
32 | | |
33 | | == Detailed Specification == |
34 | | |
35 | | We assume there is two kind of objects needed to create a big ship: |
36 | | * The main ship body (subsequently referred to as ''!BigShip''), which is controlled like any other spaceship by a player or AI. |
37 | | * 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. |
38 | | |
39 | | [[br]] |
40 | | |
41 | | === Desired final form === |
42 | | |
43 | | Big ships should easily be assembled in an XML template like any other ship. |
44 | | |
45 | | Here an example how this could look: |
46 | | {{{ |
47 | | <BigShip [parameters]> |
48 | | |
49 | | <engines> |
50 | | ... |
51 | | </engines> |
52 | | |
53 | | <attached> |
54 | | <Model [parameters] /> |
55 | | |
56 | | <ShipPart [parameters]> |
57 | | <attached> |
58 | | <Model [parameters] /> |
59 | | </attached> |
60 | | <collisionShapes> |
61 | | ... |
62 | | </collisionShapes> |
63 | | </ShipPart> |
64 | | |
65 | | <ShipPart [parameters]> |
66 | | ... |
67 | | </ShipPart> |
68 | | </attached> |
69 | | |
70 | | <collisionShapes> |
71 | | ... |
72 | | </collisionShapes> |
73 | | |
74 | | <BigShip> |
75 | | }}} |
76 | | |
77 | | [[br]] |
78 | | |
79 | | === Possible interactions of parts === |
80 | | |
81 | | 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: |
82 | | * Damage-sharing: Hits received by a !BigShip or !ShipPart can be shared to other parts attached to it |
83 | | * Variable-modification: Destruction of a part can e.g. reduce shield reload rate |
84 | | * Destruction events: If a part is destroyed, it can destroy objects like weapons or engines |
85 | | |
86 | | [[br]] |
87 | | |
88 | | === !BigShip === |
89 | | |
90 | | Note: As of PPS FS14, this has been implemented as "!ModularSpaceShip". |
91 | | The !BigShip class could be an extension of the existing !SpaceShip class.[[br]] |
92 | | 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. |
93 | | |
94 | | [[br]] |
95 | | |
96 | | === !ShipPart === |
97 | | |
98 | | In order to make a !ShipPart attachable, it has to be a static entity. |
99 | | |
100 | | [[br]] |
101 | | |
102 | | == Problems == |
103 | | |
104 | | 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. |
105 | | |
106 | | 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. |
107 | | |
108 | | A discussion on this topic can be found on the [http://orxonox2.vseth.ethz.ch/phpBB3/viewtopic.php?f=1&t=1104 Forum]. |
109 | | |
110 | | [[br]] |
111 | | |
| 61 | |
| 62 | == Example == |
| 63 | |
| 64 | Currently the HeavyCruiser ship created in the HS13 PPS provides a model for such a large spaceship.[[br]] |
| 65 | In a demonstration level ("Modular Ships - Test 1") the vessel can be flown, and all its parts are individually destructible and alter the ships behaviour. |
| 66 | |
| 67 | !HeavyCruiser is composed of (at least) 9 parts: |
| 68 | |
| 69 | ||'''Part'''||'''attached to'''||'''description'''||'''Event on destruction'''|| |
| 70 | ||body||N/A||Main part of the ship.||Death|| |
| 71 | ||frontL/R||body||Front extensions of the ship.||Loss of the weapon mounted on the part.|| |
| 72 | ||partL/R||body||Boxes on the sides to the front of the ship.||Boost regenerates slower. Speed, acceleration and boost of the body's engine are weakened.|| |
| 73 | ||sidearmL/R||body||Large sidearms of the ship.||Loss of the engine mounted on the part. Less controllability of the ship. (As well as destruction of sidearmL/Rfront)|| |
| 74 | ||sidearmL/Rfront||sidearmL/R||Front ends of the sidearms.||Engines mounted on sidearms don't provide any more boost.|| |
| 75 | ||turrets||body||(optional) Rapid firing autonomous turrets, defending the ship against nearby opponents.|| |
| 76 | |
| 77 | Look at the !HeavyCruiser.oxt template to see an implementation of this! |
| 78 | |
| 79 | [[br]] |
| 80 | |
| 81 | == Development == |
| 82 | |
| 83 | |
| 84 | [[br]] |
| 85 | |
| 86 | === TODO === |
| 87 | |
| 88 | * Fix segfault when parts are destroyed by shooting at them |
| 89 | * Implement turrets to be attached as !ShipParts |
| 90 | |
| 91 | [[br]] |
| 92 | |
| 93 | |
| 94 | === Problems === |
| 95 | |
| 96 | Severe problem: Destroying a ShipPart by shooting at it can cause a segfault. |
| 97 | This is probably due to the collisionshapes of the part being deleted, while the Bullet physics engine is still handling a collision with them. This can probably be solved by changing the destruction process of a !ShipPart to something similar like for Pawns, which use a PawnManager to coordinate their destruction inbetween ticks. |
| 98 | |
| 99 | [[br]] |
| 100 | |
| 101 | |