Space Engineers

Space Engineers

FOC My Buddy - Follow Companion Drone AI
Showing 1-4 of 4 entries
Update: 22 Dec, 2020 @ 9:27am

boolean boolWriteDisplay boolLocalGrid Controlled by CustomData. Default set to on.
moved CustomData init to the init method.
Added to BuildConfigs() and LoadConfigs()
prioritytarget moved to end.
Fixed BuildConfig VelocityPrediction always set to true

Fixed Display warning message, default write to programmable block display when no LCD with "mybuddy" tag is found.
Added Localgrid only option, boolean controlled in script, need to add it to the uh.. customdata config

Any fubar stuff with grabbing wrong blocks, unnamed blocks, connected grids, things on reload, etc shouldn't be fubar-ee

Update: 22 Aug, 2018 @ 3:24am

2018081900 - 2018082109
* Configurations in CustomData. Junked the old presets. Better production with blueprints. State data is now all in the CustomData. Use argument "LoadConfigs" when updating the CustomData config or recompile.
** OLD CUSTOMDATA SHOULD BE PURGED **

CustomData now has
CheckDistance = 6
AltitudeDistance = 3
BehindDistance = 4
Hybernate = false
VelocityPrediction = true
PriorityTarget = none


* argument list changes as follows main adds were HybernateOff/HybernateOn and changes for the Configs like LoadConfigs, etc.
ToggleHybernate - Enable/Disable follow
HybernateOff - Enables follow
HybernateOn - Disables follow
GOTO <GPS string> - Goto GPS Location
LoadConfigs - Load configs from CustomData
UpdateConfig <Variable>,<Value> - Updates CustomData
BuildConfigs - Rebuilds CustomData
Settings - list settings
VerboseON - Default off
VerboseOFF
DebugOn - Default off
DebugOff
GET <string> - Gets a variable to Echo
SET <string> <value> - Sets a Variable


* Fixed, did, create, upgraded did a handful of fancy math settings all offsets are in perspective meters yay.
* Super fun Predictive Velocity. Still using standard Remote Control Autopilot but with slow and careful acceleration. Can hang with you at 100 m/s yay!
* Flight Control now automated, left collision avoidance and precision up to the user to set!
* PriorityTarget you can now have your buddy only follow you!! hooya!
* Best of all it's still really crappy.. I mean derpy, lots of silly things can happen! Sooo Exciting!
I forget what else here's my notes while I worked on it, got lazy on those too.


2018081900
got some of the basic requests in
arguments for hybernateon, hybernateoff
Added turn off autopilot when hybernate is turned on, where the drone no longer follows detected entity
Added turn off autopilot within the check distance range. Basic logic of only follow if you are x meters away, but now includes remote stops trying to go to the point if it's within that range. This should fix some of the drifting up continously using the autopilot.
Processing reduction, doing some checks to see if the target location has changed, running at 100 ticks is pretty good allowing time for the remote control to function before being retriggered. so I didn't do the tick delays I was originally thinking.

2018081901
removed storage and current customdata info, trying to test some new offset calculations and it kept pulling the storage and custom data offsets.

2018081902
Got some working offsets, proper math allowing the offsets to be in meters. Using some fancy vector methods to get a straight line behind the target (well almost does a reject of the backwards facing position of the drone against the gravity vector which makes a straight line back).
Added parts from one of my GPS classes to convert vectors to gps coords, stashing the interim positions for the calculations in the Remote control blocks custom data. This is mainly for testing maybe pull these customdata writes into the debug boolean checks.

2018082000
Looking into customdata settings. New will drop a
CheckDistance = 8.0
AltitudeDistance = 3.0
BehindDistance = 4.0
PriorityTargetName = the-phil // maybe set this to get owner. something for none, null, any so it follows lastdetected.entity.


float fCheckDistance = 6.0f; // How far away you have to be in order for it to move.
//float fPlanetGravMultiplier = -.15f; // -.1 = 1 meter. negative to go away from planet gravity.
//float fStayAwayMultiplier = -3f; // -1 is about 1 meter. negative to go away from you.

float fPlanetGravMultiplier = 3f; // Elevation from ground in meters, basically target location with an offset based on the gravity vector.
float fStayAwayMultiplier = 4f; // how far behind you the waypoint should be in meters

Got most of those settings mashed out, seems to be working

2018082001
Messing with direction things
works great on planet but fubared in space, when we do the new maths with a zero gravity vector everything barfs up. Need to do a gravity well or nat grav check.

2018082002
Added the well bits, looks good. Thinking about doing quat and matrix tests to see if we can get some better rotation.
I think we need to get some basic gyro things going. Some of the vector math we did might help me get my head wrapped around some of the rotatoin offsets will need to test that.
Added some checks for flightmode, super cool I wonder if that was available when I started this script or if I just never noticed it before digging into ILSpy more.

2018082003
Cleaning up old code bits for presets, junking that system.
LoadConfigs method to read customdata can be triggered via argument loadconfigs
Rearranged argument if else statement, moving more commonly used toggles up in the if else chain.


2018082004-2018082109
Better Vector Math, cleaner, notes, etc. Space and Planet calculations.
Predictive Velocity, this is too much fun. Can follow at 100m/s in space, bit finiky but hilarious. Routines to loop back to last known position when out of range. Lots of speed tweaks. Option to not use it.
Priority Targets, can be set to only follow one player.
CustomData now has
CheckDistance = 6
AltitudeDistance = 3
BehindDistance = 4
Hybernate = false
VelocityPrediction = true
PriorityTarget = none

Cleaned up a lot of comments, added more, updated help output, lots of testing fun!, etc.

Update: 13 Mar, 2018 @ 1:19am

Bug with timers, removed the need for them. Simply added update frequency to the constructor.

public Program()
{
Runtime.UpdateFrequency |= UpdateFrequency.Update100;
}
whoops I copied the or equals, eh it should work good enough for a quick fix.

Update: 27 Apr, 2017 @ 4:22pm