Skip to content

Instantly share code, notes, and snippets.

@MeridiusIX
Last active May 16, 2021 05:41
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save MeridiusIX/52fbf5679e67107a8cf37706205b5812 to your computer and use it in GitHub Desktop.
Save MeridiusIX/52fbf5679e67107a8cf37706205b5812 to your computer and use it in GitHub Desktop.
MES-Threat-Score

Modular Encounter Spawner - Threat Scoring

When designing your SpawnGroups for use with MES, one feature that is available is Threat Score checking. This feature will scan an area around the proposed spawning coordinates and calculate the threat level of all player grids (and optionally NPC grids) within the specified radius.

Here's a detailed outline of how the Threat Score is calculated for each grid:

  • A list of all blocks on the grid is collected. Initially, any block that is not a Terminal Block or Non-Functional (damaged, incomplete) will be skipped.

  • Each block is checked to see if it can produce power (and if it is currently enabled/working). If so, for every 10MW of power the block can provide, 1 point is added to the threat score.

  • The next check is to see if the block is a Special Modded Block. Below is a table of these blocks and their point value:

Block Points
Nanobot Build and Repair (small and large) 10
Nanite Control Factory 15
Energy Shield (SmallGrid/Small) 3
Energy Shield (SmallGrid/Large) 7
Energy Shield (LargeGrid/Small) 10
Energy Shield (LargeGrid/Large) 20
Defense Shield (SmallGrid) 7
Defense Shield (LargeGrid) 10
Defense Shield (StationGrid) 20
  • The following values are based on block types present on the grid. If the block scanned is also a modded variant, then the score for that block is doubled.
Block Points
Weapons 5
Production 1.5
ToolBlock 1
Thruster 1
Cargo 0.5
Antenna 4
Beacon 3
  • Following the above, the calculator will then count the total blocks on the grid and add 1 point for every 100 blocks.

  • The last calculation done is based on grid size. If the grid type is small, the total score is divided by half. If the grid type is large, the total score is multiplied by 2.5

After all these calculations are done, the spawner will add up the scores of all grids within the radius of the spawn coordinates, and if the score satisfies the requirements in the SpawnGroup, the encounter will appear.

@Blaylock1988
Copy link

Blaylock1988 commented Apr 29, 2020

I think it would be helpful to have increased points for mass blocks and gravity generators since those are most often used in high numbers on ships with gravity drive (high threat) or in MAC weapons (also high threat). It should be a negligible threat increase for standard ships that just need player gravity.

@J37T3R
Copy link

J37T3R commented Dec 21, 2020

I had some trouble visualizing threat scores, so I made a list of various vanilla ships and their scores. Hopefully it can help someone else get an idea of what sort of ship gives what score.

Red Ship: 393.575
Red Cruiser: 240.45

Mining Hauler: 103.825

Respawn Space Pod: 38.55
Respawn Planet Pod: 8.245

Burstfire Bomber: 41.645

Pirate Raider: 254.53
Raider Drone: 19.34

V2 Gunboat: 92.925
Assailant: 52.4
Light Patrol Drone: 19.797

Fleeting Rival: 12.485
Spiteful Agressor: 21.33
Drifting Pursuant: 44.61499

@black-tortoise-official
Copy link

👍 tysm @J37T3R, thats super useful!

@ansorg
Copy link

ansorg commented Mar 22, 2021

👍
Just wonder, no difference in score if there are large vs. small variants of a block. like thruster, cargo?
Want your score low: use few large instead of many small thruster

@MeridiusIX
Copy link
Author

In most cases thats correct. The exception here would be power producing blocks, which factor potential output.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment