Space Engineers

Space Engineers

50 ratings
Radiation Detection (pseudo radar) UPDATED
   
Award
Favorite
Favorited
Unfavorite
Type: Mod
Mod category: Block
File Size
Posted
Updated
11.831 KB
7 Apr, 2020 @ 6:42am
25 Apr, 2021 @ 6:50am
9 Change Notes ( view )

Subscribe to download
Radiation Detection (pseudo radar) UPDATED

Description
This mod adds four functions to Programmable Blocks which give you a passive pseudo-radar by detecting other grids at a distance based on their radiation emissions or broadcast (radio antenna/beacon) signals.

Emissions are calculated based on how much power your radiators are outputting, with a floor limit of 10% capacity so even idle/damaged/switched off reactors do put out some emissions. Empty reactors (no Uranium ingots) do not create any emissions at all.

Turning off your reactors, taking out all their uranium, and turning off other systems so the reactor output reduces, will all allow the the emissions level to drop, but they take time to reduce. You can't flick off your reactors and have the signature snap to zero.

Batteries and solar panels do not emit radiation so you can use these systems for stealthy ships.

Your Programmable Blocks' four new functions hold the key to this system. Examples are as follows:


THE FUNCTIONS:

double distance = Me.GetValue<double>("EmissionRange");

This will give you a number telling you how far away your grid can be detected, in metres. Set it to display on a cockpit LCD and you'll be able to see how firing and stopping thrusters varies your detectable range.


List<Vector3D> targetList = Me.GetValue<List<Vector3D>>"GetEmitters");

This will give you a list of Vector3D locations where emissions have been detected. This function does not discriminate between friends and enemies, it just sees emissions at a certain point, so be cautious firing missiles indiscriminately at detected locations!!!


List<Vector3D> targetList = Me.GetValue<List<Vector3D>>("GetTransmitters");

This will give you a list of Vector3D locations where grids are broadcasting. This basically just gives you the coordinates of any beacons or radio antennas that are visible from where you are.


NEW FUNCTION (two lines needed, the first tells the PB where to look)

Me.CustomData = position.ToString();
string info = Me.GetValue<string>("ScanPos");

This will check the Vector3D "position" to see if there is a grid parked there, and provide some info about what it sees. Use a Vector3D location from the GetEmitters or GetTransmitters function, for example. Note you can only check one position per game tick, so don't bother setting up a loop to randomly scan all of space, you'll just get one return and then crash the server.


CONFIG:

There are four options for calculating range; you can find the config file by going to your save folder, and looking inside Storage/2051825134_IndustrialAutomaton. The options are a "first takes precedence" so if you change all four to true, only the first one will be active.

Logarithmic: the original and best. Radiation dissipates quickly in the void, only seriously high-power ships will be visible beyond 10km.
InverseCubic: Falloff is a little slower so you can detect grids further away. SE space is three-dimensional so this formula makes sense, the radiation spreads into three dimensions.
InverseSquare: Falloff is slower again so detection range is significantly further. It's like space is 2D.
Linear: Double the power output, double the range. Fun but not very balanced.
All types are very roughly normalised to a large reactor, turned off, being visible at 4-5km.

Oh, there's a fifth independent option in the config: damaged reactors (green smoking type ones) will leak radiation and be detectable at the same range as the reactor running full tilt. It adds some insult to injury; you can't get away 'cos your reactors are busted, and you can't hide 'cos radiation is leaking everywhere. Guess that's why they call him Can't Man :)
31 Comments
hyprcoob 10 Nov, 2021 @ 8:13pm 
Hey, so this gives us the tools necessary to use this in a script?
jonn19  [author] 25 Apr, 2021 @ 7:00am 
Hi Mattler, in theory the mod already does this (and I've just updated so it's less server impact and faster to update.) The detection range is based on how much power your reactors are outputting, so controlled burns or proportional thrust at less than 100%, will be less visible than 100% "press W" thrust. If you show the emission range on a cocpit/LCD (assuming you're conversant with PBs) and try playing with the thrust percentages you'll see what I mean.
Mattler~~ 9 Mar, 2021 @ 5:23pm 
hey man! love the idea of this mod. though i must ask, would it be possible to add thrusters to the list of blocks that increase emission? we are planing on using this mod for a gamemode with stealth and it'd be awesome if it would track thrusters in addition to reactors forcing people to do controlled burns instead of holding W. Cheers o/
HUBERT THE ROCK 22 Sep, 2020 @ 11:56am 
i did not get the instructions that well
can you explain them more simple
ThePropheticWarrior 14 Sep, 2020 @ 6:48pm 
This mod already has some of this, but posting it to give Modders more ideas: I would love to use multiple (perhaps 4 or 5) sensors on a rotating rotor and/or rotating dish, like in real world! It would also be awesome to have the option of selecting one directional sector at a time (different radar consoles looking at different sectors, like Fighters use) - and main for (all sectors) general viewing, as well as passive/active modes - like in the real world! It would also be nice to implement this in planet/wall maps! I'm going to also suggest this in the other radar mods - perhaps some cooperation can be done between the Modders - and the Community!
LulaLunaHealingHarlot 23 Jul, 2020 @ 8:37am 
Any way to make it have a tag? I use a few scripts and so my lcd's are mostly taken up. I made a new for this radar but it flashes on all lcd's XD including the ones in use
jonn19  [author] 2 May, 2020 @ 9:24pm 
Due to (I think) an update that previously linked pastebin code is now crashing PBs. I've updated here: http://pastebin.com/078G0Q5n
This will output any detected locations on LCDs/cockpit screens/etc. It's pretty quick and dirty but should explain how to grab the list of locations.
jonn19  [author] 18 Apr, 2020 @ 6:23am 
OK so now a config file will be generated in the /Storage/2051825134_IndustrialAutomaton folder within your game save folder, with four options on range calculation, and the option to have radiation leaking on reactor damage (thanks for the suggestion Can't Man.)
Only one range option can be active, highest in list takes precedence.
If you liked it the way it was before... good news, nothing will change unless you change it.
jonn19  [author] 18 Apr, 2020 @ 5:00am 
Nah, can't, man.

Sorry haha you had that coming, though. Yeah not a bad idea, not especially hard to implement. Dunno if it's particularly nice to make it harder to run away from a fight, but if you're on the giving rather than receiving end it would be fun. When I get time I might make a config file, then people can opt for a linear rather than logarithmic equation too (even though I think balance is best as is.)
Lex 17 Apr, 2020 @ 8:36am 
Could you include a function where damaged reactors produce more "leaked" radiation, I feel like that would be a very neat mechanic to make more intense combat as your damaged vessels would be detectable to other players at a greater range.