Space Engineers

Space Engineers

NAV Autopilot [OBSOLETE]
151 Comments
Decimal 5 Nov, 2016 @ 1:22pm 
This is kinda useless with the autopilot now though. It basically does everything your script does in better. It doesn't need to stop because it can calculate the whole thing, it's easier to handle and has collision avoidance.
Federal 15 Mar, 2016 @ 2:03am 
I know this isn't the most reliable way of doing this but I got these errors when I checked the script

https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=645727084 (Screenshot 1)
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=645727039 (Screenshot 2)

When you can get back to me with the issue here. Thanks
Mjello 13 Feb, 2016 @ 5:11pm 
Great script. However the game becomes veryvery slow when I activate your program ... Any idea why that may be ?
Wicorel 24 Sep, 2015 @ 11:48am 
I have received permission to publish my updated version of the script here:
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=523965418
Ekonant 21 Aug, 2015 @ 1:09pm 
For some reason your script now fails to compile ? Did I do something wrong or did a recent update break it ?
Floki 5 Aug, 2015 @ 11:37am 
True I realized that after I played Space Engineers with the update for 1000 hours, I just never got back to deleting the comment.
Nairou  [author] 23 May, 2015 @ 6:10am 
Shotblocker: The autopilot in the recent update is very basic. My script can still do a lot more than that.
Floki 23 May, 2015 @ 5:19am 
I hope you guys realize this is sort of obsolete since the update on the 21st.
Nairou  [author] 20 May, 2015 @ 6:16am 
And for anyone who hasn't noticed, I updated the description to link to the new version of the NAV Autopilot script I'm working on. It is a significant update, so I've posted it as a separate script in order to not break any current ships. It is still a work in progress, but already far superior to this first version.
Nairou  [author] 20 May, 2015 @ 6:05am 
TheTreeman: Awesome, thanks!
Guinevere 19 May, 2015 @ 6:30pm 
I thought I'd let you know, your script is being used in a w4stedspace contest entry, which is a ship that launches self-guided drop pods to resupply bases on a planet's surface.

If you aren't familiar with the contest I'm talking about, watch this:

https://www.youtube.com/watch?v=XBsfV22tHt0
Nairou  [author] 7 May, 2015 @ 7:34am 
Rommie: Good idea. I'm currently working on a rewrite, but I'll add that in.
FayDruh 7 May, 2015 @ 3:55am 
Can you add a instruction to start a timer block after arriving? I can't really use this effectively without it starting a timer. My best option is to set a timer to 5 minutes and assume it has arrived. I think an autopilot should work with a automatic setup but I'm finding without this feature I need to manually control everything which somewhat defeats the purpose of a autopilot.
HVC FOGEY34™ 25 Apr, 2015 @ 5:28pm 
I've done that and it just acts like a beacon does.
Famous5000 25 Apr, 2015 @ 1:22pm 
@Arrnor
The instructions would be (Yes they are spelled correctly)
+EMERGENCY Beacon
+Emergency I. Dampers
Go to Waypoint (Tell me if I need to designate what the waypoint was)
-Travel Thrusters
-EMERGENCY Beacon
-Emergency I. Dampers

I hope this is sufficient enough to satisfy the debug portion of it.
Nairou  [author] 24 Apr, 2015 @ 11:31am 
HVC FOG3Y34: Rename the text panel to "NAV Status" and set it to display the public text.
HVC FOGEY34™ 23 Apr, 2015 @ 6:36pm 
How do you get the text panels to show the status?
Nairou  [author] 22 Apr, 2015 @ 4:12pm 
Nigel: I noticed that as well. A recent game update must have changed gyros slightly. However, I have an update I'm working on that completely replaces the aiming code, so that issue will be going away.
Basti 22 Apr, 2015 @ 11:38am 
The Navigation is fine. but my ship fly not a straight line to the target. it aligns not the exact cordinate only a little off. then it flys in a curve to the target. Is there something wrong, or is that the right doing?
Nairou  [author] 21 Apr, 2015 @ 8:21pm 
Famous5000: It should let you turn things on or off. Can you show me the instructions you're using?
Famous5000 21 Apr, 2015 @ 6:11pm 
It seems to allow things to turn off, but to do otherwise is a lost cause for my ship.
Famous5000 21 Apr, 2015 @ 6:07pm 
Problem: Is it just me? Or will the script not turn on warning beacons / thrusters? I'm making a mining drone that allows it to go to a pre-defined location (BASE) and when it gets there I don't want it running into a wall.
Fastcircuit 19 Apr, 2015 @ 6:13pm 
ahh, yeah, true, would take a bit of doing to have a large ship react in time.
Nairou  [author] 19 Apr, 2015 @ 7:10am 
Fastcircuit: The actual logic for that would be extremely simple, you could even just use timer blocks to pull that off. The problem is that, because sensors have a max range of 50m, you'd have to move at an extremely slow speed for the ship to be able to react once an obstacle was that close.
Fastcircuit 18 Apr, 2015 @ 9:56pm 
how hard would adding a forward sensor script be? Have it move vertically or laterally anytime an object is detected in front of the vessel, then continue on one the sensor goes off.
Nairou  [author] 18 Apr, 2015 @ 4:45pm 
Fred: If the path is unknown, you'll want to stay alert. It will fly the ship from point to point, but the game doesn't give scripts any way to detect obstacles at a reasonable distance, so it wouldn't be able to avoid them.
Fred 18 Apr, 2015 @ 1:35pm 
Is this auto pilot able to avoid obstacles (asteroides and ships/stations) or do I have to stay alerted, ready to take over control of my ship?
Salzzar 17 Apr, 2015 @ 6:11pm 
So i managed to make a better status display by just adding global strings for each piece of information but as i wannt a funcional gps with and without auto pilot i came to the conclusiuon either to split of the informations for distance, current location, target location etc. into a seperate scribt to keep them updated through a timer even without the movment update of the auto pilot or to put them into a loop till the assinged destination is reached. Im not sure what would work better thou but i think splitting it off migth give you a better variety of options for the displays. I made an example cockpit i can show you if you want at the next week(wont propably be home till then). Also for my idea of having the travel time displayed could get a little difficult due to the fact you are always accelarating in your scribt(basicly also when you reached max speed).

Man this shit really hooked me in on the Idea of an Elite Dangerous like functional Cockpit :D good work Sir ;)
Nairou  [author] 17 Apr, 2015 @ 2:25pm 
Owlchemist: Ahh, so it causes server lag. Okay, I can see that. As you said, it loops itself as fast as possible for accuracy. I don't thing the game gives me any option to slow that down (other than using actual timer countdowns, which is way too slow), but I can certainly reduce the amount of work it's doing on each loop. I just never noticed lag from it on my server.

As for drifting, I've actually got that somewhat working already. It just isn't as reliable as I'd like, since you can't accurately measure ship speed. I'll keep working on it.

And, thanks for the feedback!
Owlchemist 17 Apr, 2015 @ 12:57pm 
Thanks!

If it helps, I've done a bit more research since my last post. I can confirm the lag. Soon as I enable my drone, the lag complaints from other players on the server pour in. Poking around the code, it looks to me as though the code is looping itself as fast as it can instead of being on a heartbeat. I imagine that's what's doing it.

If you were to streamline, perhaps my top request would be some sort of drifting intelligence. That is, let it get to speed, and if it thinks the next waypoint is a good ways away, turn off the dampener and kill the engines and just coast. I'd also like this to conserve power (my drone is solar and battery powered because I didn't want to maintain its fuel, so energy use is important).
Salzzar 17 Apr, 2015 @ 10:31am 
Um i already got the logbook worked out. got an extra panel with always adds an entry when the assinged destination is reached. Having trouble letting the lcd scroll donw as it adds entrys now thou -.- Also as you are already on it too how about changing the display of the coordinates so they funktion with the in game gps? You could then ad way points to your ingame GPS out of the Logbook for example :D
Nairou  [author] 17 Apr, 2015 @ 9:40am 
Owlchemist: That is very interesting. I also play exclusively on a dedicated server, but haven't monitored the incoming bandwidth. All the script is doing is messing with gyros and thrusters and such, so I would have assumed it would be the same bandwidth as a nearby player flying around. But I'll take a look with that in mind and see if I can streamline things.
Nairou  [author] 17 Apr, 2015 @ 9:37am 
Salzzar: I've actually been wondering what else to put on the LCD, what you have there looks good. :) Also, good idea on the logbook. I'm actually working on a big overhaul of the current NAV Autopilot script, so I'll add those ideas to the list.
Salzzar 17 Apr, 2015 @ 8:00am 
Could you make this into a fully working navigation system? Like add a nicer display of the status to the status LCD for example:

| Navigation |
| |
| Current Target: |
| No valid Instruction |
| |
| Distance: |
|Approximet Travel Time: |
| |
|Autopilote disabled |

You could also add an extra panel named Logbook where you add a line whenever a destiantion is reached with the date, time and coordinates of the destination.
Owlchemist 16 Apr, 2015 @ 6:49pm 
Well, I got everything set up and it works great and was easy to do. However, I don't think I can really use this on a dedicated server. Normally, the incoming bandwidth hovers around 10-15 KB/s, but when the script is running it shoots up to 80 KB/s...and by comparison, I got 500+ hours clocked in this game and have never seen it get above 45 KB/s before today :O
Raziel 13 Apr, 2015 @ 10:01pm 
Ok. now he no longer complains but the engines he does not fire anyway.
Nairou  [author] 13 Apr, 2015 @ 7:23am 
matthias: Looks like you have semicolons in your waypoint coordinates, and you're missing semicolons between other instructions. Try this: NAV:D 230;Q;W 9,16,0;+ Hyperraum;W -20988734543,5822642,-100983374;- Hyperraum;Q;W -20988734563,5822642,-100983374;P 300;Q;W -20988734543,5822642,-100983374;+ Hyperraum;W9,16,0;- Hyperraum;Q;W 14,0,193;P 300;L
Raziel 13 Apr, 2015 @ 5:37am 
NAV:D 230;Q;W 9,16,0;+ <Hyperraum>W -20988734543;5822642;-100983374- <Hyperraum>;Q;W;-20988734563;5822642;-100983374;P 300;Q;W -20988734543;5822642;-100983374;+ <Hyperraum>W9,16,0- <Hyperraum>;Q;W 14,0,193;P 300;L
Nairou  [author] 12 Apr, 2015 @ 8:32pm 
matthias: It was tested with groups. Can you show me the actual instructions you're using? The instructions you posted are incomplete.
Raziel 12 Apr, 2015 @ 7:30pm 
Unfortunately that does not work with the groups.
"NAV: D 230; + <hyperspace> W 9,16,0" == rung message: Noticed errors while executing the script: Object reference not set to on inasance of on object.

The group is called "hyperspace" and as large Superwhite engine in it.
Nairou  [author] 9 Apr, 2015 @ 6:52am 
Mr. Slave: You can create a LCD panel and name it "NAV Instructions", and put all of your instructions into the public text. Or you can use any named block (something that shows up in your ship's Control Panel list), and rename the block to "NAV: " followed by your instructions. Most things for this script are done by renaming blocks to specific names.
Raziel 9 Apr, 2015 @ 5:34am 
To which I can imagine the Q command place? Does not seem to be working.
Toadkiller Dog 8 Apr, 2015 @ 9:57pm 
Probably a noob question, but how do I actually input the commands? I haven't used programmable blocks for anything yet, and only have basic experience with programming, but there doesn't seem to be any user input line or anything. I get what I need to enter, but I can't find where to enter it.
Raziel 8 Apr, 2015 @ 6:11am 
I've got another idea for the autopilot. You could still incorporate an additional optional group, which "NAV Hyperdrive" or NAV Warp "or something like that. This is then fed to switch when the distance between ship and target a value X exceeds and other off again when they value X is less than the same.
Nairou  [author] 7 Apr, 2015 @ 1:08pm 
Wicorel: Thanks, I see the problem. You have your NAV Timer set to start itself, in addition to running the NAV Program. It should only run the program. If the program decides the timer is needed, it will start it itself. By having the timer start itself, you are constantly restarting the program even after it has completed, which causes it to start over from the beginning.
Wicorel 7 Apr, 2015 @ 9:23am 
I have published two worlds with the problem that are my WIP construction worlds.

See the 'readme' text panel on the ship.

These are set to friends-only.. Accept my friend request to see.
Nairou  [author] 7 Apr, 2015 @ 5:50am 
Wicorel: I've heard a couple people mention that, but I've never been able to reproduce it. Do you have a ship or map I can test?
Wicorel 6 Apr, 2015 @ 11:44pm 
I'm having problems with it always looping for me even if I didn't say "L" command. It was also doing this with 1.9.

Any suggestions?
Nairou  [author] 6 Apr, 2015 @ 8:33pm 
Script is updated. NAV Status can be written to LCD public text. Instructions can be read from a LCD named "NAV Instructions". Also added a couple new instructions. Description above has been updated.
Nairou  [author] 6 Apr, 2015 @ 12:48pm 
Agreed. It's been on my to-do list a while, I'll see if I can make time for it this evening.