Welcome to Keen Software House Forums! Log in or Sign up to interact with the KSH community.
  1. You are currently browsing our forum as a guest. Create your own forum account to access all forum functionality.

Pennywise's openspace circus - New: Automated gravity cannon

Discussion in 'Community Creations' started by Pennywise, Oct 7, 2015.

Thread Status:
This last post in this thread was made more than 31 days old.
  1. Ronin1973 Master Engineer

    Messages:
    4,845

    Create one more text panel and use it for user input. When the script first runs, it finds the text panel due to flagged name like "[User Input]" It then populates the text panel with default user data.

    The player can then edit the data on the screen and the miner will parse it. Put a button next to the panel and label it "Update" When pushed, it sends an argument to the script to parse the data on the panel. If the data throws an exception it replaces the value on the screen with a Question Mark "?"
     
    • Agree Agree x 1
    • Funny Funny x 1
  2. Pennywise Apprentice Engineer

    Messages:
    338
    Maybe, i will do so.
     
  3. Pennywise Apprentice Engineer

    Messages:
    338
  4. 4o Apprentice Engineer

    Messages:
    316
    you've actually made it)

    i was making a drastic change in digging logic, finished it yesterday. still need some days to test it.

    but... i looks like i still have something to oppose to your script features.
     
  5. Taurec Trainee Engineer

    Messages:
    4
  6. mikeloeven Senior Engineer

    Messages:
    1,162
    Amazing! This has got to be the best drone design i have seen in a long time


    [​IMG]


    Now can we get a grinder version of this that seeks out unpowered grids and wrecks
     
  7. Pennywise Apprentice Engineer

    Messages:
    338
    1. You can use "Pause" button. Than take drone wherever you want and set new mining job.
    2. This error tells you, one of blocks is missing. Check ship integrity.
     
  8. Tatzelwurm Trainee Engineer

    Messages:
    2
    Hey There,

    First let me say thank you for this real impressiv work!!!

    But i also got some Problems on Using several drones... I Reneamed each Block with a new Number eg. Octopus1 ...2...3... an so on... Drones keep working fine realy but when Job is Finished (Square 25/25 is reached for example) they won't return to the specified Connector, instead they Fly on Save-Hight and are not controlable anymore... They seem to be flying arround till Engery is off and they are Crashing to the Ground...

    Maybe you got any Idea why it is so? Or what i can do, that the Drones after finishing work are going back to the signed connector?

    Greetings...
     
    Last edited: Feb 28, 2016
  9. Pennywise Apprentice Engineer

    Messages:
    338
    Yes, i know about this, will patch today. I've forgotten to update drone last time.
     
  10. Shennigans Trainee Engineer

    Messages:
    1
    Hi Pennywise, first off, amazing drone great work! I'm having some trouble with it when i try to mine the dark spots on the ice lakes on the earthlike starting planet. It doesn't seem to know what to do with getting that much ice instead of stone as the filler material. Switching the sorters to catch ice as well as stone makes it spit the ice out and effectively ignore it, but if I keep the ice, it just mines for a small bit then flies straight up endlessly. What would I change if I wanted it to keep the ice and drop that off with the rest of the stuff to use for oxygen and hydrogen? I dont know enough about the ingame programming to troubleshoot this Thanks and great work!
     
  11. Pennywise Apprentice Engineer

    Messages:
    338
    Thanx:D
    If it flies up while drilling, you probably need to check InvMult in the begining of script.
    Set it to value equal to Inventory Multiplier your world settings.
     
  12. Sarantis Trainee Engineer

    Messages:
    16
    • Like Like x 1
  13. Pennywise Apprentice Engineer

    Messages:
    338
    Wow, thnx for link. Will check it.
     
  14. Pennywise Apprentice Engineer

    Messages:
    338
    Fixed "crazy gyro" bug after previous game update. Drone behaves well in single-player game now.
    Added 2 buttons on cockpit side: "return to base, unload, recharge and continue last task" and "return to base and stay docked"
    I'll try to adapt it for using on dedicated servers, but now it's really not a sinmplle task. Frankly, I cant control even my own astronaut well after last update.
     
    • Like Like x 1
  15. Valygar Trainee Engineer

    Messages:
    3
    I had to registrate just to thank you for the mining drone. Amazing work.

    I am planning to use it on a multiplayer survival game (not dedicated).

    My main concern is the "mining speed", maybe the cycle of ejecting stones is making this too slow? I noticed sometimes only one side of the ship is ejecting while the other one is doing nothing. Also adding more rows would increase mining speed by a lot.
    I will try to tinker with it (both cycle speed and adding more ejectors), if I am successfull I will give you some feedback :).

    -> Edit: Ok, I've been trying it on creative. Some questions:
    When drilling shafts or even rocks, what usually happens is that it makes an initial hole, then goes up to -10 depth, and starts drilling again. It drills some additional rocks to the sides but it is not efficient. Is this normal? How can it be avoided? If I leave the drone alone, eventually it goes up, aligns and drills another shaft next to it so I am not sure what is causing this.

    Also, I added 2 more rows of ejectors (pointing up and down) on the sides without ejectors and I've to say that now it never stops due to too much stones. Maybe only one more row of ejectos on the already equipped sides would be enough.

    Nevermind, now I am sure something is not correct, I watched your video and there the drone mines very efficiently. Maybe it is because I am on an alien planet and the callibration was not correct?

    PD: Also tried on your mining example world (spawning an updated version of the drone) and the same thing happens, it stops very often to drop stones and it bugs every 5-10 times at -12m, it goes up 5 meters then tries again (pull up - drill loop).

    I am guessing it has something to do with this code?

    if (myDriller.cargoBlock.StoneDumpNeeded && myDriller.drillBlock.DrillSOn)
    myDriller.drillBlock.Turn("Off");
    else if (!myDriller.cargoBlock.StoneDumpNeeded && !myDriller.drillBlock.DrillSOn)
    myDriller.drillBlock.Turn("On");

    if (UpVelocityVector.Length() < ParentProgram.DrillSpeedLimit)
    {
    if ((Math.Abs(MyPosDrill.GetDim(0)) < 0.5) && (Math.Abs(MyPosDrill.GetDim(2)) < 0.5))
    myDriller.thrustBlock.SetOverrideAccel("U", (-ParentProgram.DrillAccel));
    else
    {
    myDriller.thrustBlock.SetOverrideAccel("U", (ParentProgram.DrillAccel * 1));
    PullUpNeeded = true;
    Complete = true;
    }
    }
    else
    {
    myDriller.thrustBlock.SetOverridePercent("U", 0);
    }
    if (MyPosDrill.GetDim(1) < ((myDriller.Command == Commands.DepoDrill) ? (-ParentProgram.DrillDepth) : -16))
    Complete = true;
    else if (myDriller.cargoBlock.CriticalMassReached || myDriller.batteryBlock.LowPower)
    {
    Complete = true;
    Emergency = true;
    }

    Ooook. Now I think I understand your code (well, this very small part). GetDim is getting the XZ shift (pitch,yaw?), and my problem is that Z goes to -0.5! now the question is, why my drone cannot reorient itself so it is digging straight?

    Not sure how to correct it so I've done this instead:

    if (myDriller.cargoBlock.StoneDumpNeeded && myDriller.drillBlock.DrillSOn)
    myDriller.drillBlock.Turn("Off");
    else if (!myDriller.cargoBlock.StoneDumpNeeded && !myDriller.drillBlock.DrillSOn)
    myDriller.drillBlock.Turn("On");

    if (UpVelocityVector.Length() < ParentProgram.DrillSpeedLimit)
    {
    if ((Math.Abs(MyPosDrill.GetDim(0)) < 1) && (Math.Abs(MyPosDrill.GetDim(2)) < 1))
    myDriller.thrustBlock.SetOverrideAccel("U", (-ParentProgram.DrillAccel));
    if ((Math.Abs(MyPosDrill.GetDim(0)) > 1.2) || (Math.Abs(MyPosDrill.GetDim(2)) > 1.2))
    {
    myDriller.thrustBlock.SetOverrideAccel("U", (ParentProgram.DrillAccel * 1));
    PullUpNeeded = true;
    Complete = true;
    }
    Nevermind, now I think this is more related to the fact it cant stay straight if it is mining. It can only go pull up and try again, and sometimes it gets into a loop
     
    Last edited: Apr 23, 2016
  16. Paladwyn Trainee Engineer

    Messages:
    12
    Valygar

    I've been having an issue with the drone, only in the last couple days. Since the 21st, on the latest patch.

    It used to fly great, but now it's being weird. It does get stuck in a loop, and I been trying to figure out what has changed. On the 21st, I had my drone crash. I built a drone foundry and now I can produce these things in 5 minutes, BUT...it seems to behave weird now.

    It used to drill straight down, but for some reason, it seems to want to slide around a bit... for me it seems to want to slide forward, and when it figures out it's position changed, it pulls up to realign. I've also noticed that even drilling manually it still wants to slide forward. Not just this miner, but even my older one I built.

    I've noticed that the ground doesn't seem to be where it's supposed to. I try to realign by thrusting backwards, which looks like there SHOULD be room, but it's hitting the wall (or it's behaving like it's hitting the wall), and the front of the ship is slightly clipping through the front of the shaft. Almost like the one side isn't drilling (yet it is) and it's pushing the craft out of alignment.

    I've noticed this with a couple attempts. I'm chalking it up to these voxel enhancements they made...I don't think they are displaying properly.
     
  17. Valygar Trainee Engineer

    Messages:
    3
    I think you are right. I am trying to change the maxspeed and the amount of accel it adds to correct its position while drilling (x2), also changing the value of xz shift in which it goes from pullup to drilling (0.15->3) and it seems better, but it still goes plenty of times in the pullup - drill cycle.
    I also multiplied by 2 the accels and speeds on pullup so it does the job faster (except UP speed/accel).
    What I basically tried to do was replicate the align repositioning.

    The code is this one, but may be horribly wrong, I hope Pennywise gives a better solution:

     
    Last edited: Apr 24, 2016
  18. Paladwyn Trainee Engineer

    Messages:
    12
    He did update the code to put in lateral correction changes in priority of a pullout...while it kinda works, it now gets 'stuck' against a wall, it can't seem to adjust due to an invisible wall.
     
  19. Pennywise Apprentice Engineer

    Messages:
    338
    At this moment drone is not capable to drill in 1st regime. Something was changed in voxelling, or drill radius was reduced. I dont know it exactly yet. But I will try to find solution.
     
  20. Paladwyn Trainee Engineer

    Messages:
    12
    Even in rock mining, it tends to get stuck. I gotta go out once in a while by hand and drill out part of the hole for it. The rear right corner seems to be the troublespot. I drill that down and it can finish. Although one time, it lifted off and tried to fly through the rock, tipping over. I had just save the game, so I reloaded and tweaked the code a bit.
     
  21. Paladwyn Trainee Engineer

    Messages:
    12
    For anybody reading...I figured getting a drill radius mod might be helpful in the meantime. This mod increases the drill radius on the small from 1.1 to 1.5, and the large from 1.9 to 2.5

    It's not a huge increase, but hopefully enough to do the job, it seems to be working so far...but I need more testing yet.

    http://steamcommunity.com/sharedfiles/filedetails/?id=378212427&searchtext=drill+radius

    I would also recommend slowing the drill speed down or the stonedump value higher with the mod, it's a bit aggressive, and you will be dumping stone every couple seconds.

    Another Edit - If you are like me, and on the Polar region of the planet, you will tear up a ton of ice, sending your craft back early for hitting the Critical Mass. I added in an Ice Dump, as an addition to the Stonedump, works off the same thing, just checks ice levels as well as stone.
     
    Last edited: Apr 25, 2016
  22. Pennywise Apprentice Engineer

    Messages:
    338
    Thank you all for your feedbacks and reports.

    BP is updated again. The "stucking problem" seems to be solved now. I've added a few new features in drilling procedure. Now if drone feels, it's pushed away from shaft central axis, it will incline itself to orient drills against "wrong" wall and push more towards it to bite off more material from that wall.

    Tho X and Z shifts are now greater then 0.5m, I haven't faced any accidents while pulling up from shaft bottom, but I suppose there can be something which still needs attention. So, if your drone will crash while pulling itself out of shaft, please let me know.

    Also, I've replaced one of batteries with large reactor. So, if you don't like to wait while bot is recharging, put some uranium in reactor. (not more than 100 ingots, cause bot doesn't take U mass in account when calculating thrust)

    Now default settings are: 10x inventory mult, Stone Dump on 50 000 kg, atmo thrusters are calibrated for earth-like planet.
     
    Last edited: Apr 25, 2016
  23. Esmea Trainee Engineer

    Messages:
    73
    I did some more rigorous testing of the undocking problem... it appears to only occur on DS. Tapping Pause twice fixes it, but it means that the drone can't be left unattended. This problem is exacerbated when the target ore field is 'behind the base'... as the drone will keep its momentum from undocking and won't be able to divert momentum to return to the target mining area. If the target area is in front of the docking connector, then the drone will be able to make it, albeit very slowly (~7m/s) and will almost definitely have an exception halfway through mining that will cause a catastrophic failure.

    I'm still looking into how this it happening. I wish the problem was more apparent, but I'll take what I can get. Netflix'n'mining isn't a problem for me.

    This mod works wonders and almost brings back the old feel of mining from a year ago.... the good ol' days when planets weren't a 'problem.'
     
  24. Paladwyn Trainee Engineer

    Messages:
    12
    I've got an issue with getting the connection problem when docking one of my vessels, it kills the engines and gyros of any docked vessel. You do need to be more vigilant with them, can't wander away too far. Save often.

    I'd like the drill radius to be more like 1.2 or 1.25...as it's a bit too aggressive, it really bogs down the ore dump system way too much. Lowering the drilling speed helps, but still. I will be modifying the drones and putting in the new code today. I will rip off the battery and drop in the reactor, just so I can use the new code, without having to do thruster calibrations. May as well get with the times. :D
     
  25. Pennywise Apprentice Engineer

    Messages:
    338
    Automated Gravity Cannon

    This gravity cannon is one of practicle implementations of @Innoble's space scanner script.


    [​IMG]

    Workshop link: http://steamcommunity.com/sharedfiles/filedetails/?id=693980900

    Cannon is capable to locate and destroy moving ships in it's scanner range which is set to 15km by default (this value is ajustable). Of course, I mean only linear motion with constant velocity.

    How to use:

    Put some iron ingots or steel plates in cargo container of cannon.
    Press "1" to run script in atodetect/autodestroy mode. Cannon will hunt for ships in 15km range.
    Press "2" to stop script. Sometimes you need to press "2" multiple times.

    You can run radar in "sectoral scan" mode. It will detect ships only in limited sector in front of cannon in this mode.
    It's useful for targetting specified ship.

    Press "4" to select 1st sector point, then move crosshair to set sector width and press "4" again.
    After sector width is set, crosshair your target ship and press "5" to run radar in "sectoral scan mode".
    Cannon will calculate intercept course and launch projectiles, using its gravity generators.

    Ok, now a few words about variables in the beginning off cannon script.

    Here is a description of cannon settings:
    ------------------------------------------------------------------------------------------------------------------------------------
    double PROJECTILE_VELOCITY=131; // Projectile velocity
    double kP = 3; // ========================
    double kI = 0.0001; // PID controller settings
    double kD = 80; // ========================
    double Precision = 3; // Desired precision (3 means 3m error in 10km range, i don't recommend to set this var to lower values)
    int BurstTime = 1500; // It's a "burst length"
    int FireMode = 2; // 0 - burst, 1 - slug, 2 - buckshot (gauss)
    float GaussSpread=0.1f; // Gauss shot spread multiplier
    float JunkFilter = 15; // Minimum target radius. If object is of smaller size, it won't get shot.
    ---------------------------------------------------------------------------------------------------------------------------------------

    Please, note: FireMode var sets different fire mods, the most advanced of which is the 2nd mode. It creates something like a buckshot with spread bound to with target size and distance to interception point.

    Ok, that is the brief description. Try to use this BP and let me know, if you have any questions.
     
    • Like Like x 4
  26. OtherKev Trainee Engineer

    Messages:
    1
    I accidentally broke off 2 drills... how do I add them back on and have the script still able to turn them on? I can't seem to figure it out, just turns all the others on.... I tried a similar naming convention, but no luck?

    That and my dampener doesn't seem to keep the ship still, it waits 5-10 seconds and then thrusts gently upwards, but it constantly makes it trend upwards which I think is breaking something, not sure if its another mod maybe... trying to figure that out

    Thanks for all the work, thing seems like it will be amazing when I get it working :)
     
  27. Paladwyn Trainee Engineer

    Messages:
    12
    OtherKev

    When I busted off drills, I ran into the same issue, then figured out...projectors! That did the trick. Just pop one on, line 'er up and zap... it'll fix it real good.

    The other issue..not sure about, something is definitely off there. Might be an issue that some people are having (like me), where it can't drill down straight, and will drill for a second, then pop up about 5 meters and drop down to drill again. There are workarounds if you are one of the unlucky ones to run into this.
     
  28. redrew89 Trainee Engineer

    Messages:
    3
    I just created an account to post on this thread regarding the Octopus robot.

    First of all, this is a really awesome design, and I'm impressed with the complexity of the drone while still finding it easy to use. However, I noticed some strange behavior when you have more than one Octopus active off of the same station.

    Here's the situation I'm seeing: I started a world with the Easy Start Earth Station, started it in Creative (because I'm impatient) and pasted in two Octopuses (Octopi?). One I set to mine from the nearby ore field, the other I put to work in the ice field about 1.5km away. I built two connectors; one for each Octopus, on either side of the base. I set each Octopus to remember the appropriate connector, but... it doesn't stick. Regularly, I find both Octopi queued up, trying to dock on the same connector. I pause the active mining cycle, move the offending Octopus to its designated connector, and try to rebind it with the correct key, but it doesn't stick. Is there some issue with having multiple Octopi active in the same world? I tried changing the name variables in the script, but that didn't seem to do it... Maybe I also need to change the ship's grid name in its info tab? Any insight would be great!

    EDIT:

    So, first, I realized that this thread may be considered dead, since it's been nearly a year since the last post. Apologies if I am in bad form for necro'ing. That said, I think I found the solution to running multiple Octos on the same world. I found that I had to go through and rename every part previously named "Octopus1<x>" where <x> is the Drill, Thruster, etc. I changed these tags to "Octopus2" and then edited the script variables in the PB_Nav script to match. This seems to have done the trick, but I'll need to test a bit more.

    EDIT2:

    I did a second pass of the thread and found out that someone else had already discovered this catch when running several bots. In any case, I can confirm that tweaking the naming of additional bots will allow them all to work with designated connectors and mining tasks. To make the process less tedious, I added another Programmable Block and loaded a Mass Renaming Script from the Workshop. I'll leave my post here for anyone else who has an issue with running two or more bots.
     
    Last edited: May 26, 2017
  29. uglydisease Trainee Engineer

    Messages:
    1
    Not sure if you are still working on your mods or not pennywise, I tried out the guided missile mod today, but it seems like the scripts are not running on the programmable blocks. Not sure if this is due to updates or if I'm missing something.
     
Thread Status:
This last post in this thread was made more than 31 days old.