Making Encounter Tables

Freeform discussion about anything related to modding Transcendence.
Post Reply
User avatar
TheLoneWolf
Militia Captain
Militia Captain
Posts: 802
Joined: Thu Nov 28, 2013 5:03 pm
Location: Aboard the CSS Radiant

Hey guys. I'm looking to make my very own custom encounter tables.
Where can I find all the

Code: Select all

eventHandler=
and

Code: Select all

orders=
And what is the difference between

Code: Select all

<ShipTable UNID="&etAresAmbush1;">
		<Ship count="1d2+2"	class="&scSandstorm;"	orders="attack"	sovereign="&svAres;"/>
	</ShipTable>
And this

Code: Select all

<ShipTable unid="&tbAresEncounters;">
		<LevelTable>
			<Ship levelFrequency="----- ucur-" count="1"	 class="&scSandstorm;" eventHandler="&evStdPatrolEncounterBehavior;">
				<Escorts>
					<Ship					   count="1d3-1" class="&scSandstorm;" orders="escort"/>
				</Escorts>
			</Ship>

			<Ship levelFrequency="----- -vuur" count="1"	 class="&scSandstorm;" eventHandler="&evStdPatrolEncounterBehavior;">
				<Escorts>
					<Ship					   count="1d4-1" class="&scSandstorm;" orders="escort"/>
				</Escorts>
			</Ship>

			<Ship levelFrequency="----- --rrv" count="1"	 class="&scTundra;" eventHandler="&evStdPatrolEncounterBehavior;">
				<Escorts>
					<Ship					   count="1d3"	 class="&scSandstorm;" orders="escort"/>
				</Escorts>
			</Ship>

			<Ship levelFrequency="----- --vuu" count="1"	 class="&scSandstorm;" eventHandler="&evStdPatrolEncounterBehavior;">
				<Escorts>
					<Ship					   count="1d6-1" class="&scSandstorm;" orders="escort"/>
				</Escorts>
			</Ship>

			<Ship levelFrequency="----- ---rr" count="1"	 class="&scTundra;" eventHandler="&evStdPatrolEncounterBehavior;">
				<Escorts>
					<Ship					   count="1d6" class="&scSandstorm;" orders="escort"/>
				</Escorts>
			</Ship>

			<Ship levelFrequency="----- ---rr" count="1"	 class="&scChasm;" eventHandler="&evStdPatrolEncounterBehavior;">
				<Escorts>
					<Ship					   count="1d6" class="&scSandstorm;" orders="escort"/>
				</Escorts>
			</Ship>

			<Ship levelFrequency="----- ruucu" count="1"	 class="&scPolar;" eventHandler="&evStdConvoyEncounterBehavior;">
				<Items>
					<Table>
						<RandomItem chance="40" count="1d2" levelFrequency="----- ccurv" criteria="* +Ares;" />
						<Item		chance="10" count="1d12" item="&itTetramiteOre;"/>
						<Item		chance="10" count="3d12" item="&itXenotiteOre;"/>
						<Item		chance="10" count="2d12" item="&itPteracniumOre;"/>
						<Item		chance="10" count="3d12" item="&itPteracniumFuelRod;"/>
						<Lookup chance="10" count="1d4" table="&trConsumables8;"/>
						<Lookup chance="5" count="1" table="&trMinorItem8;"/>
						<Lookup chance="5" count="1" table="&trMajorItem8;"/>
					</Table>
				</Items>

				<Escorts>
					<Ship					   count="2d4"	 class="&scSandstorm;" orders="escort"/>
				</Escorts>
			</Ship>
		</LevelTable>
	</ShipTable>
How does the former spawn ships without levelFrequency?
User avatar
DigaRW
Militia Captain
Militia Captain
Posts: 517
Joined: Thu Jul 30, 2015 3:10 pm
Location: The place where I belong
Contact:

-I don't know which one, I also looking this, though it doesn't my priority.
-The difference is encounter table is when enemy trully break and attack the player and/or their enemies. Another one is patrol around system. They may attack player, but if player doesn't shoot back, they will continue their patrol.
Download Transcendence mods from Reinvented Workbench Project!
Click this link!
shanejfilomena
Fleet Officer
Fleet Officer
Posts: 1533
Joined: Tue Mar 22, 2011 8:43 pm
Location: Alaska
Contact:

in the modern versions you can find your behavior in the source .xml : http://xelerus.de/index.php?s=mods&c=Sources

"attack" means exactly that : a full weapons blasting event directed at the target

However: in an event handled by a behavior script the ships will not attack unless it's defensive because they have other orders. It should also be noted that some behaviors only want the Player to SEE the ships, not get into a fight ( unless the player wants to ) .
And another actually tries to avoid the player.....they run away when you find them : good luck catching up.

"wander" is exactly the two previous ones rolled up into one. the ship really has no orders except to go get lost : but if it is attacked, it will return fire.....if nobody shoots back, or target is destroyed, they go on their way.

behaviors can be anything you want: take the Wind Slavers for example : their mission is to really get in your face : they are set to find & attack ( just about anybody but the Player is a Primary target if they can find you )
not shooting them in return will not make them go away, they are out to kill.

Now you have the random illegal Miner : the escorts will attack a threat ( like the player) but the Miner will not shoot you unless A) you get in front of them B) you attack them directly

Illegal Miners hunting Asteriods : will only attack you directly if you attack them. their escorts will attack anything they think is a threat to the ship they are escorting.
Flying Irresponsibly In Eridani......

I don't like to kill pirates in cold blood ..I do it.. but I don't like it..
User avatar
TheLoneWolf
Militia Captain
Militia Captain
Posts: 802
Joined: Thu Nov 28, 2013 5:03 pm
Location: Aboard the CSS Radiant

Thanks for helping me understand behaviours! Can you help me with the tables too?
User avatar
TheLoneWolf
Militia Captain
Militia Captain
Posts: 802
Joined: Thu Nov 28, 2013 5:03 pm
Location: Aboard the CSS Radiant

Can I define encounters in a module file too?
shanejfilomena
Fleet Officer
Fleet Officer
Posts: 1533
Joined: Tue Mar 22, 2011 8:43 pm
Location: Alaska
Contact:

TheLoneWolf wrote:Thanks for helping me understand behaviours! Can you help me with the tables too?
tables can be easy or hard ( if you're as sadistic to your typing skills as RPC is :) )

now, for a table you have :
tables for stations

tables for encounters

tables for : well, whatever your heart desires.

the real question is exactly how do you want your table to execute?
do you want to summon ships at an event, random encounter, station build ( OnCreate) or maybe a selection of ships for a mission :

let's try this ( now I KNOW everybody else is better then I am, just ask them ) However, if you want to explore using a table for something to see if it gives you the kind of variety you are looking for or does what you would like - try experimenting by calling on tables already in the game.
then tweek it.

if you are tired of chasing down the random mystery ship that turns out to be something you think is not fitting a "WarLord" : tweek it with &tbHeliotropeEncounters;
so it would be

Code: Select all

(block (theShip)
						(setq theShip (sysCreateShip
							&tbHeliotropeEncounters;
							(Location of where-ever )
							&sv(what-ever);
							))
then if you think that is too weak or too strong go to the table and tweek it, steal it, rename it, edit it to your own idea.
Event Handlers or Orders ? that is the question!
and actually it's the same thing.
you can give the ships orders instead of using a behavior: so edit the "EventHandler" to "Orders" and tell it to dance to your tune.
IF you use "Patrol" you must give it a distance from the target it is protecting

Code: Select all

orders="patrol" patrolDist="5"
Here is an encounter table:

Code: Select all


	<!-- Heliotrope Encounters -->

	<ShipTable UNID="&tbHeliotropeEncounters;">
		<LevelTable>
			<Ship levelFrequency="--ccu rr---" count="1"	class="&scHeliotropeGunship;" eventHandler="&evStdZoneEncounterBehavior;">
				<Escorts>
					<Ship					   count="1d2"	class="&scHeliotropeGunship;" orders="escort"/>
				</Escorts>
			</Ship>
			
			<Ship levelFrequency="--rcc uurr-" count="1"	class="&scHeliotropeGunship;" eventHandler="&evStdZoneEncounterBehavior;">
				<Escorts>
					<Ship					   count="1d4"	class="&scHeliotropeGunship;" orders="escort"/>
				</Escorts>
			</Ship>
			
			<Ship levelFrequency="--ruu uurr-" count="1"	class="&scHeliotropeFrigate;" eventHandler="&evStdZoneEncounterBehavior;"/>
			
			<Ship levelFrequency="--vuc cuurr" count="1"	class="&scHeliotropeFrigate;" eventHandler="&evStdZoneEncounterBehavior;">
				<Escorts>
					<Ship					   count="1d4"	class="&scHeliotropeGunship;" orders="escort"/>
				</Escorts>
			</Ship>
			
			<Ship levelFrequency="---rr rrrrr" count="1"	class="&scHeliotropeFrigate;" eventHandler="&evStdZoneEncounterBehavior;">
				<Escorts>
					<Ship					   count="1d2"	class="&scHeliotropeFrigate;" orders="escort"/>
				</Escorts>
			</Ship>
		</LevelTable>
	</ShipTable>
Last edited by shanejfilomena on Sat Apr 02, 2016 6:38 pm, edited 2 times in total.
Flying Irresponsibly In Eridani......

I don't like to kill pirates in cold blood ..I do it.. but I don't like it..
shanejfilomena
Fleet Officer
Fleet Officer
Posts: 1533
Joined: Tue Mar 22, 2011 8:43 pm
Location: Alaska
Contact:

TheLoneWolf wrote:Can I define encounters in a module file too?
this is the starting lines for EncountersVol01.xml where much of your random encounters in the game come from : so, yes you can.

Code: Select all

<?xml version="1.0" encoding="utf-8"?>

<TranscendenceModule>

<!-- MISC ENCOUNTERS VOLUME I

	Abbasid Survivalists
	Bennin Xenophobes
	Death Drugs Cartel
	Freeworld Anarchists
	Gaian Terraformers
	Heliotropes
	Himal Separatists
	Huari Empire
	Kobol Syndicate
	Marauders
	Order of Penitence
	Outlaws
	Pteravores
	Ranx Warlords
	Salvagers
	Sapiens
	Sealed Cargo Container
	Ventari Settlers
	Weapons Cache

-->

Flying Irresponsibly In Eridani......

I don't like to kill pirates in cold blood ..I do it.. but I don't like it..
User avatar
TheLoneWolf
Militia Captain
Militia Captain
Posts: 802
Joined: Thu Nov 28, 2013 5:03 pm
Location: Aboard the CSS Radiant

Thanks Shane! So you mean to say that encounter tables with levelFrequency= are easier to manage then those Ares encounter tables without them? Also, is "escort" an order? Or using <Escort> tag is a better bet? I am started at making encounter tables with levelFrequency= element, but I still can't understand the "&tbAresAmbush" tables. How do they spawn ships without levelFrequency?
NMS
Militia Captain
Militia Captain
Posts: 569
Joined: Tue Mar 05, 2013 8:26 am

I haven't studied the code, but based on how other things work and what I've observed in the game, this is how I think encounters work:

Periodically, the game decides an encounter should occur. It checks the <Encounters> elements of the current system and all the non-abandoned stations in the system. Each one is added to a list some number of times, depending on its frequency. Then one is selected from that list at random.

The encounter will define what ships appear, either by including a <ShipTable> or referring to one that's defined somewhere else. If the table has only one entry, that one will be used. If there are multiple entries with frequency or levelFrequency properties, again the different options are added to a list a number of times based on their frequency, then one is picked at random.

So for example, Ares Shipyards have:

Code: Select all

		<Encounters frequency="common">
			<Lookup table="&tbAresEncounters;"/>
		</Encounters>
This means that as long as there's an intact shipyard in the system, the random encounters have a high chance of being &tbAresEncounters;. If this encounter is picked, then the game looks at the level frequencies of each entry in the <LevelTable> and determines how likely each one should be based on the system level.
User avatar
TheLoneWolf
Militia Captain
Militia Captain
Posts: 802
Joined: Thu Nov 28, 2013 5:03 pm
Location: Aboard the CSS Radiant

NMS my brother! Freaking thanks! It was like clouds were blowed away from my head! Thanks a lot! But there is that question still. In the shipyard's code, the levels of the system it is "common" in aren't specified. How does the game decide in what systems to spawn it?
NMS
Militia Captain
Militia Captain
Posts: 569
Joined: Tue Mar 05, 2013 8:26 am

Stations have their own levelFrequency, usually near the beginning of the station definition, that determines what systems they appear in. Ares shipyards have:

Code: Select all

levelFrequency=		"----- --vuu ----- ----- -----"
So they're veryRare in level 8 systems and uncommon in level 9 and 10 systems.
shanejfilomena
Fleet Officer
Fleet Officer
Posts: 1533
Joined: Tue Mar 22, 2011 8:43 pm
Location: Alaska
Contact:

level frequency is also for appearing ships :
<Ship levelFrequency="uuurr -----" count="1" class="&scAntaresI;"/>
<Ship levelFrequency="uurr- -----" count="1" class="&scAntaresV;"/>
<Ship levelFrequency="ccrr- -----" count="1" class="&scAntaresII;"/>
So if you used the table in your " syscreateship ...." the game will select a ship fitting the level, it will also give you different ships based on the frequency table that they would appear in that level

Such as, did you know the most common ship in Eridani is the IAVLight? I used to get alot of them playing with tables in Eridani .....but then I would get other ships too.
Flying Irresponsibly In Eridani......

I don't like to kill pirates in cold blood ..I do it.. but I don't like it..
User avatar
TheLoneWolf
Militia Captain
Militia Captain
Posts: 802
Joined: Thu Nov 28, 2013 5:03 pm
Location: Aboard the CSS Radiant

That sounds interesting :D
Post Reply