Space Engineers

Space Engineers

1,259 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
31 Dec, 2020 @ 9:47pm
23 Oct, 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
11 Apr @ 8:04am
PINNED: Help/Questions (SIMPL)
Whiplash141
1
27 Nov, 2024 @ 7:53am
Tankturret and Hull stable on LCDs
Hailstorm
453 Comments
Leconite 24 May @ 3:31am 
Feature suggestion(s).
1. A way to put a line of user defined title text at the bottom or top of the display.
Something like the Radar script does, but with the ability to set scale and possibly text alignment.
2. A way to insert the grid name into the title text.
Something like
Ship $GridName Structural Integrity:
Displaying
Ship Large Grid 2355 Structural Integrity:

Also, as of the fieldwork update, projectors can highlight damaged armor blocks.
Has KSH extended the scripting API to provide access to that info?
Whiplash141  [author] 23 May @ 3:27pm 
hero <3
Wingnut 23 May @ 10:51am 
Got it. Thanks :steamthumbsup:
Leconite 23 May @ 7:08am 
Config example of multiple views on one display.

[SIMPL - Text Surface Config]
Number of views=3

[SIMPL - Legend Config]
Legend Scale=1
; Elements should range from -1 to 1 where 0 indicates centered
Position={X:-1 Y:-1}

[SIMPL - Display Config - View 1]
; Top Down View
; View axis values: X, Y, Z, NegativeX, NegativeY, NegativeZ
View axis=NegativeY
Rotation (deg)=180
Scale=7
; Elements should range from -1 to 1 where 0 indicates centered
Position={X:0 Y:-0.5}

[SIMPL - Display Config - View 2]
; Back View
; View axis values: X, Y, Z, NegativeX, NegativeY, NegativeZ
View axis=X
Rotation (deg)=270
Scale=8
; Elements should range from -1 to 1 where 0 indicates centered
Position={X:0 Y:0.25}

[SIMPL - Display Config - View 3]
; Side View, Front on Left.
; View axis values: X, Y, Z, NegativeX, NegativeY, NegativeZ
View axis=Z
Rotation (deg)=180
Scale=8
; Elements should range from -1 to 1 where 0 indicates centered
Position={X:0 Y:0.75}
Leconite 23 May @ 7:08am 
Yes, but you have to set it up manually.

Note "Scale=auto" does not play nice with multiple views, unless SIMPL generated abstract art is your thing. :-)
Wingnut 23 May @ 6:02am 
Is there a way to rotate the view in multiple axes on the same display?
brakdis 1 May @ 2:39pm 
the subgrid idea you may add will be useful in my case, i make some mech so that can help in a way
Whiplash141  [author] 28 Mar @ 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 28 Mar @ 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 14 Mar @ 5:31pm 
Perfect, sorry for the dumb question I now see the answer was just a couple lines above....