Space Engineers

Space Engineers

1,248 ratings
SIMPL | Ship Integrity Monitoring Program Lite (A sprite-based ship layout/floor plan script)
23
15
17
4
4
2
5
9
8
4
6
3
3
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
865.481 KB
Dec 31, 2020 @ 9:47pm
Oct 23, 2024 @ 10:59am
19 Change Notes ( view )

Subscribe to download
SIMPL | Ship Integrity Monitoring Program Lite (A sprite-based ship layout/floor plan script)

In 1 collection by Whiplash141
Whip's Scripts
22 items
Description

  Features
  • (NEW) Can draw multiple views onto a single display!
  • Can draw across multiple LCD panels
  • Displays cross-sections of your ship and can display destroyed blocks
  • Highlights ship subsystems like thrust, gyros, and power
  • Built in legend
  • Customizable colors
  • Works with screen rotation
  • Cross-section views can be rotated and manually scaled
  • Works with multi-screen blocks like cockpits and consoles
  • Uses sprites for drawing
  • Low performance impact


  Description
Howdy!

This script draws a sprite-based 2D cross-section of your ship and will display destroyed blocks and highlight important ship systems. This script is designed to be as lightweight as possible (hence the name) while still retaining a decent amount of utility.

Larger ships will take longer to scan than smaller ships because the script is designed to only go through a few blocks per run to keep the performance impact low.


  Setup Instructions
  1. Place this script in a programmable block on the grid that you want to display.
  2. Add text panels, LCD screens, and multi-screen blocks to a group named "SIMPL".
  3. Run the program with the argument refresh to process any new screens or Custom Data changes.
  4. Configure the custom data of the programmable block and the blocks with screens to your liking (see below).

If you wish to reset the script for damage or display newly placed blocks, you must recompile the script.


  Configuration
Display Config
You can configure the appearance of the ship view for each display screen in the Custom Data of each block with display screens. For blocks with only one display, the custom data will look like this:
[SIMPL - Text Surface Config] Number of views=1 [SIMPL - Display Config - View 1] ; View axis values: X, Y, Z, NegativeX, NegativeY, NegativeZ View axis=X Rotation (deg)=0 Scale=auto ; Elements should range from -1 to 1 where 0 indicates centered Position={X:0 Y:0} [SIMPL - Legend Config] Legend Scale=1 ; Elements should range from -1 to 1 where 0 indicates centered Position={X:-1 Y:-1}

For blocks with multiple screens, the custom data will look like this:
[SIMPL - Text Surface Config] Number of views for screen 0=1 Number of views for screen 1=0 Number of views for screen 2=0 Number of views for screen 3=0 [SIMPL - Display Config - Screen 0 - View 1] ; View axis values: X, Y, Z, NegativeX, NegativeY, NegativeZ View axis=X Rotation (deg)=0 Scale=auto ; Elements should range from -1 to 1 where 0 indicates centered Position={X:0 Y:0} [SIMPL - Legend Config - Screen 0] Legend Scale=1 ; Elements should range from -1 to 1 where 0 indicates centered Position={X:-1 Y:-1}
For multi-screen blocks, you must set "Number of views for screen X" to 1 or larger, then run the argument refresh. After that, the block's Custom Data will be populated with new section(s) where you can configure views for that particular screen, "X".

General Config and Colors
You can configure the colors and general settings used by SIMPL in the Custom Data of the Programmable Block that this script runs from. The Custom Data should look like the following:
[SIMPL - General Config] Group name=SIMPL Auto scan=true ; Colors are in the format: Red, Green, Blue, Alpha. ; If you do not want to see a particular subsystem color ; simply set the Alpha value to 0 and it will be ; omitted from the legend. [SIMPL - Colors] Max block density=50, 50, 50, 255 Min block density=10, 10, 10, 255 Missing block=100, 0, 0, 200 Background=0, 0, 0, 255 Power=0, 100, 0, 100 Gyro=100, 100, 0, 100 Thrust=0, 0, 100, 100 Weapons=100, 50, 0, 100
As mentioned in the comment above, you can omit a certain subsystem from special highlighting and the legend by setting the Alpha of the color to 0.


  Multiscreen Display
You can also combine multiple LCD panels together to create larger surfaces to draw sprites on.

In order to create a multiscreen display:
  1. Make a wall of LCD panels (They must all be the same type of LCD).
  2. Add only the top left LCD panel to the SIMPL group.
  3. Add the following to the custom data of that top left LCD panel:
    [SIMPL - Multiscreen Config] Screen rows=1 Screen cols=1
    • Change "Screen rows" and "Screen cols" to match the shape of your screen wall.
  4. Recompile (if you added new blocks) or run the argument refresh (if no new blocks were added) to process changes.
This will now be treated as one massive LCD screen!




  Arguments
Arguments are not case sensitive.
Argument
Description
refresh
Reacquires all display screens and reprocesses any Custom Data changes.
scan
Initiates a manual scan for any destroyed blocks. This is only valid when "Auto scan" is set to false in SIMPL - General Config.
force_draw
Forces a redraw of all sprites to clients within sync range. This has a 30 second timeout to reduce the possibility of using this to grief server networking


  Author's Notes
This is my rendition of a Floor Plan type script. Performance was my primary concern when writing this, so I've consciously sacrificed responsiveness for lower performance impact.

Be sensible. Don't attempt to draw 100k block ships on your favorite dedicated server. While the script runtime itself will still stay low, the renderer will ♥♥♥♥ itself and you will quickly get scripts banned. This script utilizes quadtrees to try and minimize the number of sprites drawn to the screen, but please be responsible.

The code currently only draws the grid that the programmable block is on, but perhaps in the future I may add subgrid drawing support. That is only a possibility though and I didn't want to wait as I felt this was still quite useful/neat as is.

I'll continue to add features, bug fix, and optimize, but I figured it was time for me to stop sitting on this and get it out in the wild.

Also, happy new year! :)

- Whiplash141

(Do not reupload without permission, not even to mod.io)


  Ships Used in Example Images
For those interested in the ships I used in my pictures, here is a list in order of appearance:
Popular Discussions View All (3)
106
Apr 11 @ 8:04am
PINNED: Help/Questions (SIMPL)
Whiplash141
1
Nov 27, 2024 @ 7:53am
Tankturret and Hull stable on LCDs
Hailstorm
446 Comments
Whiplash141  [author] Mar 28 @ 4:52pm 
SIMPL will throttle it's execution to keep running low so I think you should be fine. SIMPL will also output performance metrics that will let you monitor the load at runtime.

The issue with waiting for proper support is that I haven't had the time to get back into recreational coding for months because of work, so you may be waiting for a while :(
Swann Mar 28 @ 1:12pm 
Rovers tend to have a lot of subgrids. I did learn how to use the custom group name. But I worry about the server hit having to run even just 3 copies of the script to cover some of the main sections of the rover. We wait patiently for proper multi-grid support.
BloodAngel099 Mar 14 @ 5:31pm 
Perfect, sorry for the dumb question I now see the answer was just a couple lines above....
Whiplash141  [author] Mar 13 @ 11:36pm 
Change your view axis to Negative
BloodAngel099 Mar 13 @ 4:16pm 
Is it possible to flip the image? I have rotated it but I now need to flip the image to orient it correctly with my base.
_Your__Nightmare_ Mar 1 @ 3:06am 
How do you rotate the view?
AkagiVoid Jan 5 @ 3:33pm 
Nope. >w>

Although, TY 4 educating meh n anyone else dats 2 lazy 2 read the manual or go through lines of code 2 answer dat one simple FAQ while U was half asleep. X3

And sawry dat I rudely disturbed U while U was trying 2 wake up. >w<
Whiplash141  [author] Jan 5 @ 2:30pm 
Wow... can you tell I typed that up right after I woke up? :steamfacepalm:
AkagiVoid Jan 5 @ 11:55am 
TY. >w<
Whiplash141  [author] Jan 5 @ 11:35am 
no timers needed at all. That behavior is expected. It is why the script says to use the arg in me to refresh to my process custom data changes. Block damage is seen automatically, configuration changes need to be fetched on demand