Generic ships useable for multiple roles

Freeform discussion about anything related to modding Transcendence.
Post Reply
User avatar
Mutos
Militia Lieutenant
Militia Lieutenant
Posts: 218
Joined: Thu Aug 14, 2008 3:31 am
Location: Near Paris, France
Contact:

Hi all,


As part of my Stars of Call Adventure Mod, I intend to have generic ships, that can be spawned as either one of 6 main ship roles : freighters, miners, pirates, police, navy or mercenaries.

What could be done is to have ship classes that are only bare hulls with main characteristics. Then a CreateShip function would take a number of arguments to outfit the ship for its chosen role, adding the needed devices, armor, weapons and cargo. The ship would also receive a sovereign, some behavior guidelines and maybe missions and orders, and it will be released in the wild !

What would you see about implementing that concept ? I'm looking for ideas, warnings, advices to implement that. I already have some research paths, but I'm heading to unknown territories on this one...
@+

Benoît 'Mutos' ROBIN
Hoshikaze 2250 Project
User avatar
dosbox-gamer
Commonwealth Pilot
Commonwealth Pilot
Posts: 66
Joined: Sat Apr 05, 2008 9:41 pm
Location: Utopia Planitia Fleet Yards

Isn't this covered by the game already? In any given system you have miners mining, transports transporting, defensive ships on guard or patrol... Granted, how the game creates these is different, but isn't the end result the same?
"Make no little plans. They have no magic to stir men's blood and probably will not themselves be realized." -- Daniel Hudson Burnham, architect & urban planner
User avatar
Mutos
Militia Lieutenant
Militia Lieutenant
Posts: 218
Joined: Thu Aug 14, 2008 3:31 am
Location: Near Paris, France
Contact:

Hi dosbox-gamer, hi all,


Thanks dosbox-gamer for your answer.
Granted, how the game creates these is different, but isn't the end result the same?
In fact the problem lies with the amount and clarity of code needed to achieve the desired effect... The SoC Adventure Mod is a very heavy mod, with a large bunch of code : 18 files totalling 250 ko for now, and it's only a beginning ! Maintainability and ease of code adaptation are essential on such a dev.

For instance, take the Shire, which is a medium freighter hull with small shields and weapons. It is a very versatile ship, seen in any Human system, be it Core League, Planetary Alliance, Hoshi no Hekka or even Purple Trail.

The Shire basically exists in a systemwide version, which doesn't hyperjump, and an interstellar version, with jump capability. The systemwide version can be a good mining ship, with only mining weapons. The interstellar version can be captured and converted to a pirate ship, with souped-up weapons and shields and a bay full of looted items. Both may be military/police transports, with upgraded shields but near to no weapons, or a mercs gunship similar to the pirates.

Currently, I already have 3 ShipClass tags for the Shire in my XML : one for the systemwide freighter, one for the interstellar freighter and one for the pirate. Each has different loads and behaviors. And I've covered only 3 variants out of 10... I also got 2 Shire images with different textures, so this makes 6 ShipClass tags, and I would like to have more textures... Simply put, v variants * t textures quickly gives a large number (v*t) of ShipClass tags. This makes for either a limit on my use of ships or an utterly unmaintainable code. And that's only for 1 basic hull !

For instance, I'm currently balancing ships. Which means I must set each characteristics 6 times (or v*t times !!!) in the XML source when I change something.

Behaviors are also ship-specific for now. They could easily be unified, as they rely on a limited number of basic behaviors.

The first idea is to limit the number of ships to the number of images, Then, this leads to not having a fixed payload, or even a random payload, because it would depend on the role the ship is to play. So the best way would seem a CreateShip function, that selects the appropriate payload from class, role and maybe modifiers : a Shire that plays Pirate would have a certain payload, different than the same Shire that plays Miner.

There could, however, be other ways to do this. For instance, I never got too involved into random tables, and this could be a tool of choice for making such a variable ships system... That's why I need advice from already tempered modders, who have seen more than me at Transcendence modding...
@+

Benoît 'Mutos' ROBIN
Hoshikaze 2250 Project
User avatar
dosbox-gamer
Commonwealth Pilot
Commonwealth Pilot
Posts: 66
Joined: Sat Apr 05, 2008 9:41 pm
Location: Utopia Planitia Fleet Yards

Hi mutos, hi all,
Okay, I see where you're going with this. My hat's off to you -- I've dreamt big but am nowhere near attempting this level of coding. You did mention random tables though, and at that I do have a little experience. For my Tinker mule auton, I created the following damaged goods plus useful items table (or tables?):

<RandomItem count="2d8+2"
criteria= "aswd -Illegal; -Military; -NotForSale;"
level= "1"
levelCurve= "2"
damaged= "100"
/>

<RandomItem count="3d8+3"
criteria= "* -Illegal; -NotForSale;"
level= "1"
levelCurve= "4"

/>

BTW, the criteria 'aswd' means armor shields weapons and devices only, while the * means all types of items (it's in the 428K Transcendence.xml from the 99c xml list - another invaluable resource, for me anyway). Maybe this can help you. Either way, I wish you good luck. :)
"Make no little plans. They have no magic to stir men's blood and probably will not themselves be realized." -- Daniel Hudson Burnham, architect & urban planner
User avatar
Mutos
Militia Lieutenant
Militia Lieutenant
Posts: 218
Joined: Thu Aug 14, 2008 3:31 am
Location: Near Paris, France
Contact:

Hi dosbox-gamer,


Thanks for your reply. That was just the kind of thing I needed : some advices and bits of codes to get started with ! Now I'll download your Mod to see how you use it and how it fits in with the rest of the code. As for the level of coding, it'll not be easy nor fast, but in the long run I think I'll succeed, at least to some extent.

I agree with you as to the Transcendence source being a great starting point ! Many things I learned come from copy-paste from George's XMLs. But as my point is not exactly the same as the Transcendence universe, I sometimes must use creative imagination to twist the game's mechanisms as they were not intended for. Thanks to George, his game is outstanding in structuration and extendability !
@+

Benoît 'Mutos' ROBIN
Hoshikaze 2250 Project
User avatar
digdug
Fleet Admiral
Fleet Admiral
Posts: 2620
Joined: Mon Oct 29, 2007 9:23 pm
Location: Decoding hieroglyphics on Tan-Ru-Dorem

That's a very interesting idea Mutos,
from code you can install or remove from a ship any device, but armor.
I think that the best solution for now is to create a number of empty shipclasses with various configurations of armors then choose 1 randomly or by filtering and install the devices and adding cargo.

You can take a look to a number of mods on xelerus to install random devices, in particular the original idea of Periculi's random equip mod. (there are various versions)
There is also the Random Station Items mod that can you can take a look, this mod creates and add random items to stations.

Please note however that some of the mods do not work anymore because some functions changed name or syntax in 0.99 (itmAtCursor has been deprecated), so they need to be fixed. :P
User avatar
digdug
Fleet Admiral
Fleet Admiral
Posts: 2620
Joined: Mon Oct 29, 2007 9:23 pm
Location: Decoding hieroglyphics on Tan-Ru-Dorem

Betel corrected me on IRC, shpInstallArmor has been changed in 0.99 (and I forgot it) and now accepts itmStruct.
This means that is possible to install armor from code.
See dsReplaceArmor in transcendence.xml for more details.
User avatar
Mutos
Militia Lieutenant
Militia Lieutenant
Posts: 218
Joined: Thu Aug 14, 2008 3:31 am
Location: Near Paris, France
Contact:

Hi digdug,


As always you come with good news and advices ! So it validates the feasibility of this kind of ship building functions... I'll look into these paths and tell you how it fares.

As for now I'm balancing the existing ships to see in what direction I'm going to develop them and what configurations to add for the various roles.
@+

Benoît 'Mutos' ROBIN
Hoshikaze 2250 Project
Post Reply