Topology generation hook for mods

Freeform discussion about anything related to modding Transcendence.
Post Reply
User avatar
alterecco
Fleet Officer
Fleet Officer
Posts: 1658
Joined: Wed Jan 14, 2009 3:08 am
Location: Previously enslaved by the Iocrym

Sat Jan 28, 2012 10:40 pm

It would be cool to be able to modify topology from within mods. Here is a rough draft of a proposed syntax.

NOTE: this is not for adventure mods in particular, but for normal mods that need to add content to vanilla

Code: Select all

<TopologyHook
  criteria="+newBeyond" ;; general criteria that must be fulfilled for these topology changes to be considered
  levelFrequency = "--ucu" ;; what system levels should be considered and at what probability
  >

  ;; here we can have any legal topology code

  <RandomLocation probability="90" locationCriteria="++lifeZone; *planet">
    <RandomStation stationCriteria="*friendly; *primary"/>
  </RandomLocation>

</TopologyHook>
The name TopologyHook is just an example... i could not come up with a better one right now. There might be need for more criteria, but that should get us started.
Get your own Galactic Omni Device
Get it now. It's free!!
Image

User avatar
RPC
Fleet Admiral
Fleet Admiral
Posts: 2876
Joined: Thu Feb 03, 2011 5:21 am
Location: Hmm... I'm confused. Anybody have a starmap to the Core?

Sat Jan 28, 2012 11:13 pm

What are you hooking exactly? Is it a bunch of topology parts or a whole system?
If it's a whole system we need the stargate that makes that system.
If it's topology parts I'd also like to ask for the ability to specify which node (root node doesn't matter, it should be for a root or non-root node so there's the element of chance) to add the part to.
Tutorial List on the Wiki and Installing Mods
Get on Discord for mod help and general chat
Image
Image
Der Tod ist der zeitlose Frieden und das leben ist der Krieg
Wir müssen wissen — wir werden wissen!
I don't want any sort of copyright on my Transcendence mods. Feel free to take/modify whatever you want.

User avatar
alterecco
Fleet Officer
Fleet Officer
Posts: 1658
Joined: Wed Jan 14, 2009 3:08 am
Location: Previously enslaved by the Iocrym

Sun Jan 29, 2012 2:33 am

It is not a hook to add new systems. We can already do that in script. What i want to do is hook into system generation and specify additional elements to generate. The syntax for the xml element (the levelFrequency and criteria attributes) should of course be fine grained enough to allow us to only modify the systems we want to.

A use case would be the following:

Lets say i have a mod that adds a new side quest. It contains new systems and new stations, in particular a station that kicks off the whole side quest. This system should of course appear somewhere in the vanilla game, but not hardcoded at a specific location. I want it to be part of the RNG like the rest of T. So, i would hook into the system generation and specify that this station should be generated in systems above a certain level that match certain attributes. If the hook matches, i will have a station placed in some asteroid belt away from enemy and friendly placement (using standard xml system definition syntax).

I hope that example makes some sense out of what i would like to see.
Get your own Galactic Omni Device
Get it now. It's free!!
Image

george moromisato
Developer
Developer
Posts: 2979
Joined: Thu Jul 24, 2003 9:53 pm
Contact:

Sat Feb 11, 2012 7:27 pm

This is quite reasonable. I believe you are looking for a declarative way of doing what Huari.xml does, i.e., connect a new set of systems to an existing topology.

The Huari module does that procedurally with two scripts:

1. <OnGlobalTopologyCreated> makes a new stargate connection between an existing node (call it the "source node") and the Huaramarca node (defined in Huari.xml). The source node is chosen randomly (by selecting among all nodes >= level 5 and with the "ungoverned" attribute).

2. <OnGlobalSystemCreated> fires when the system at the source node is created. The script is responsible for creating a stargate in a random location and connecting it to Huaramarca node.

Your <TopologyHook> idea basically contains both steps in one element. The first part chooses the node and the second part create the stargate.

A few thoughts:

1. I think you will need a <TopologyHook> element for each connection. E.g., imagine that a new extension contains the topology for the systems around Sol. There are two connections to those stars: one from St. Kat's and one from Jiang's Star. Thus you would have two <TopologyHook> elements, once for each connection. [p.s., maybe we should call it a <TopologyConnection> or <NodeConnection> or something.]

2. You have essentially combined the topology connection and the stargate in one place. Perhaps the current topology element should also be able to specify the stargate. That is, we could use the same syntax in the existing <Node> element to specify the location of a stargate in a <SystemType> element [so that we can keep it all in one place.]

3. It might make sense for the <TopologyHook> element to be able to (optionally) specify both stargates. I.e., the stargate in the source node and the destination node. This would allow you to create a connection between two existing nodes (e.g., a new gate between St. Kat's and Heretic).

User avatar
alterecco
Fleet Officer
Fleet Officer
Posts: 1658
Joined: Wed Jan 14, 2009 3:08 am
Location: Previously enslaved by the Iocrym

Sun Feb 12, 2012 8:51 pm

Actually, the idea is not so much to generate new topology, but to add to previously defined systems. Perhaps TopologyHook was not the right wording.

What i am proposing is a way to add objects to systems using an xml syntax. Say i have an extension that needs to have a wreck floating somewhere in any system that is over level 5 (and perhaps some other criteria). I would write the xml hook, and on system generation, if the system matched my criteria there would be a chance that the objects were placed. Does that make sense or would you like a fuller example?
Get your own Galactic Omni Device
Get it now. It's free!!
Image

george moromisato
Developer
Developer
Posts: 2979
Joined: Thu Jul 24, 2003 9:53 pm
Contact:

Mon Feb 13, 2012 3:35 am

alterecco wrote:Actually, the idea is not so much to generate new topology, but to add to previously defined systems. Perhaps TopologyHook was not the right wording.

What i am proposing is a way to add objects to systems using an xml syntax. Say i have an extension that needs to have a wreck floating somewhere in any system that is over level 5 (and perhaps some other criteria). I would write the xml hook, and on system generation, if the system matched my criteria there would be a chance that the objects were placed. Does that make sense or would you like a fuller example?
I think I get it now. Yeah, that makes sense. It is a generalization of what I said. In the Huari example, I talked about two cases. The second script, in OnGlobalSystemCreated, inserts a gate into an existing system. You want to generalize that and have an XML way of injecting arbitrary objects to one or more systems.

I like it. I would call it something like, <SystemExtension> or <SystemTypeExtension>.

Definitely add a ticket, if you haven't already. It seems like a really useful feature to me, especially with all the emphasis of adventures and shared resources.

Post Reply