[MOD] Smart miners [0.4 experimental]

The place to discuss scripting and game modifications for X Rebirth.

Moderators: Scripting / Modding Moderators, Moderators for English X Forum

felrasha
Posts: 37
Joined: Mon, 18. Nov 13, 14:55

Post by felrasha »

You'll need to extract the zip into an extensions folder in your Rebirth directory. Unless you changed it, it should be something like

C:\Program Files (x86)\Steam\steamapps\common\X Rebirth\extensions

if that folder ain't there, you'll need to make one
-- This code keeps amazing me...
BagOfMeat
Posts: 8
Joined: Thu, 21. Nov 13, 17:42

Post by BagOfMeat »

thank you :P
HostageTaker
Posts: 65
Joined: Thu, 29. Dec 05, 17:10
x3tc

Post by HostageTaker »

@Felrasha

First off, thanks for the great work you're doing to fix XR man, good on you!

Really glad to hear that you're gonna look into the drones next. I was going to make a request post about them but I see other people have already posted what I've been seeing ingame, the strange behaviour.

They travel very long distances away from the Fedhelm during mining and this slows the whole mining operation to a crawl. Sometimes they don't return and hover in space or are basically left behind by the mining ship.

What I would like to know and possibly request/suggest; would it be possible to give the drones a maximum operating distance?

So like limit their travel to 5km or 10km from their mining ship? Force them to work in a 5km sphere around the Fedhelm?

:idea: :?:
felrasha
Posts: 37
Joined: Mon, 18. Nov 13, 14:55

Post by felrasha »

aye that's what I plan on figuring out. Thing is though that they are only supposed to go for pickups within 4km of the ship atm. That's how they are programmed, but a bug somewhere is making them fly off.

Trying to find what is causing that... and also going to improve on the pickup gathering. 4km is a long distance for drones when there are pickups within 200 meter of the ship.
-- This code keeps amazing me...
BagOfMeat
Posts: 8
Joined: Thu, 21. Nov 13, 17:42

Post by BagOfMeat »

well this mod certainly works, :D

the ice miner sits there for around 5 to 10 seconds before heading off to some ice rocks, basically parks over the top of it. I understand that this is for the ore miner which only has a bottom forward mining laser (makes sense). it releases it drones and then begins to mine

impressive work man !!!, any possibility of stopping the ship at a distance from the asteroid as it kinda dose sit on top of the rock before it activates the mining laser ? looks like you some how got it set a 45 degrees below the the centre of mass could you increase the distance but not the angle ?

But I have experienced a number of crashes mainly around very dense ice fields aka it stops on top a rock pew pews it and starts to move then the game just freezes these are the first crashes iv had with this game I currently have no other mods on.
felrasha
Posts: 37
Joined: Mon, 18. Nov 13, 14:55

Post by felrasha »

hmmm, I hope it's not causing any crashes. The only reason it could do that is if it triggers an infinite loop, and I don't think that's possible atm.

The positioning of the ships is tricky, but I'll try to tweak it a it in the next version.
-- This code keeps amazing me...
foxtrot76
Posts: 75
Joined: Fri, 12. Mar 10, 21:44

Post by foxtrot76 »

First of all you mod works like charm, been testing the mod on both ice miner and ore miner. I'm sure many people appreciate you work including myself. Thanks!

I've noticed a couple of things which I'm pretty sure are not related to your mod but maybe you will look into them once you got drones working better.

Occasionally the ice harvester ship will shoot itself with the mining laser if the ice it's trying to brake is somewhere close to the rear of the ship. The mining laser will stop after a second or two but will keep trying to hit the same iceblock over and over again until the ship either moves or the block is destroyed. This causes the ship to take a little damage from the laser and over time stacks up to be quite a lot of damage.

The above described behavior also happens when the miner is trying to hit an asteroid which is behind another one of a different type. The miner will shoot the asteroid and hit the "wrong" one thus immediately stopping the mining laser. Unfortunately it will continue this process until the blocking asteroid is destroyed... which can take for ever...
I think the simplest fix to this problem would be a timer before forcing a target switch. Something along the lines of target still exists after 1 minute? tag target as bad and switch...


Also I've noticed that the drones occasionally fly into the laser beam taking a bit of damage when approaching or departing the ship. This has the same effect like above and eventually the drones are destroyed.

My favorite bug is the mining ship trying to hit an ice/ore and the beam is missing the target for some weird reason. This causes the mining ship to keep the beam fired in empty space for an extensive amount of time. I personally watched this behavior and manually broke the oce/ore after a few minutes thus fixing the behavior. The above mentioned target switching fix would solve this issue as well.
felrasha wrote:The positioning of the ships is tricky, but I'll try to tweak it a it in the next version.
Wouldn't it be simpler to reposition the mining laser on the nose of the ship? All those things are editable in the XML of the saved game and probably can be also with your mod... Just a thought

Cheers
Malaras
Posts: 60
Joined: Tue, 17. Jan 12, 06:55
x4

Post by Malaras »

Think this mod (maybe) causeing my game to crash now for some reason.

I've had my eye on this miner ship that has literly been sitting there for hours (in rl) played game most of the day and ship just been sitting there. And at certain spot the game locks up. So waiting for mods to update to see what happens as my game is now useless after prolly 35ish hours into it sadly.
And i only have 3 mods to which i like very much. And figures had 4 station about to be done being built lol. Just need some plating for all of them.
felrasha
Posts: 37
Joined: Mon, 18. Nov 13, 14:55

Post by felrasha »

Malaras,

could you zip your savegame and extensions folder and upload it to dropbox for me? that way I can debug your exact scenario and see what is causing the problem and make a fix.
-- This code keeps amazing me...
Malaras
Posts: 60
Joined: Tue, 17. Jan 12, 06:55
x4

Post by Malaras »

felrasha wrote:Malaras,

could you zip your savegame and extensions folder and upload it to dropbox for me? that way I can debug your exact scenario and see what is causing the problem and make a fix.
Give me a few, dont have account on dropbox.

Thanks Allot!
Malaras
Posts: 60
Joined: Tue, 17. Jan 12, 06:55
x4

Post by Malaras »

Pm'd you link. Hope you get it.

EDIT: takes 5-15min to it to lock up, max 30min. off that save
Last edited by Malaras on Fri, 22. Nov 13, 10:55, edited 1 time in total.
foxtrot76
Posts: 75
Joined: Fri, 12. Mar 10, 21:44

Post by foxtrot76 »

Can confirm I'm also getting a lot more random crashes, wasn't sure it was related to your mod.
felrasha
Posts: 37
Joined: Mon, 18. Nov 13, 14:55

Post by felrasha »

I'm starting the savegame from Malaras now while at work with debug text enabled. Is it an NPC mining ship that you where looking at? I don't see any player mining ships.
EDIT:

just to confirm, the mod does seem to be creating an infinite-loop. Debugging now to find the cause.
-- This code keeps amazing me...
Malaras
Posts: 60
Joined: Tue, 17. Jan 12, 06:55
x4

Post by Malaras »

felrasha wrote:I'm starting the savegame from Malaras now while at work with debug text enabled. Is it an NPC mining ship that you where looking at? I don't see any player mining ships.
EDIT:

just to confirm, the mod does seem to be creating an infinite-loop. Debugging now to find the cause.
Sorry was reading another forum, sorry took so long, NPC ship i reuploaded save where your staring at the ship.
BagOfMeat
Posts: 8
Joined: Thu, 21. Nov 13, 17:42

Post by BagOfMeat »

foxtrot76 wrote:I've noticed a couple of things which I'm pretty sure are not related to your mod but maybe you will look into them once you got drones working better.

Occasionally the ice harvester ship will shoot itself with the mining laser if the ice it's trying to brake is somewhere close to the rear of the ship. The mining laser will stop after a second or two but will keep trying to hit the same iceblock over and over again until the ship either moves or the block is destroyed. This causes the ship to take a little damage from the laser and over time stacks up to be quite a lot of damage.

The above described behavior also happens when the miner is trying to hit an asteroid which is behind another one of a different type. The miner will shoot the asteroid and hit the "wrong" one thus immediately stopping the mining laser. Unfortunately it will continue this process until the blocking asteroid is destroyed... which can take for ever...
I think the simplest fix to this problem would be a timer before forcing a target switch. Something along the lines of target still exists after 1 minute? tag target as bad and switch...


Also I've noticed that the drones occasionally fly into the laser beam taking a bit of damage when approaching or departing the ship. This has the same effect like above and eventually the drones are destroyed.

My favorite bug is the mining ship trying to hit an ice/ore and the beam is missing the target for some weird reason. This causes the mining ship to keep the beam fired in empty space for an extensive amount of time. I personally watched this behavior and manually broke the oce/ore after a few minutes thus fixing the behavior. The above mentioned target switching fix would solve this issue as well.
iv had that behavoir in the standard game before the mods seen drone just fly though the mining beam when docking and leaving the miner probably just poor laser positioning
felrasha
Posts: 37
Joined: Mon, 18. Nov 13, 14:55

Post by felrasha »

version 0.4 available now that should fix the game crashes. Sorry for the inconvenience, many thanks for the assistance in finding this problem, and let me know if other problems or weird behaviour occur.

Note that this is a quickfix: it had to do with some of the old code stating that any group of less than 5 asteroids was not worth mining. This was causing problems with the iterative scan if it found anywhere from 1 to 4 asteroids in a scanincrease.

My check would say there were asteroids found, so there was no need to increase the scanrange, but the egosoft check would say that the asteroids where not worth mining, and the start the scanning over again. This would cause an infinite loop.

This occurs most commonly with the stray asteroids that are not in asteroidbelts. The mining ship in the savegame is sitting next to 3 small asteroids, and eventually the script goes haywire.

my quickfix is to set the asteroid limit to 1 to determine if it's worth mining. Not the most elegant solution, but it will fix the crashes until I can write a better one.
-- This code keeps amazing me...
t13link
Posts: 4
Joined: Fri, 22. Nov 13, 14:09
x4

Post by t13link »

Russian translation:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<diff>
  <add sel="/language[@id='7']">
    <page id="345375" title="SMARTMINER" descr="Text for SMARTMINER mod." voice="no">
      <t id="1">Трюм заполнен: добыча газа остановленна.</t>
      <t id="2">Трюм заполнен: разработка астероидов остановленна.</t>
      <t id="3">Остановка: указанная зона не существует.</t>
      <t id="4">Остановка добычи по указанию.</t>
      <t id="5">Остановка: нет астероидов в радиусе действия.</t>
	  <t id="6">Остановка: причина проблеммы не известна.</t>
    </page>
  </add>
</diff>
felrasha
Posts: 37
Joined: Mon, 18. Nov 13, 14:55

Post by felrasha »

thanks! will implement it in the next version
-- This code keeps amazing me...
User avatar
pilakin
Posts: 235
Joined: Sat, 16. Feb 08, 23:44

Post by pilakin »

BagOfMeat wrote: I understand that this is for the ore miner which only has a bottom forward mining laser (makes sense).
you're talking about the fedhelm. however thats not the only "ore miner". the sequana has 2 lasers, one on top one on the bottom. and the scaldis has even 3! all of these ships can mine all bulk wares, not only ore, but also crystals, ice etc ... i recommend the sequana, it performs the best at mining imo.
BagOfMeat
Posts: 8
Joined: Thu, 21. Nov 13, 17:42

Post by BagOfMeat »

pilakin wrote:
BagOfMeat wrote: I understand that this is for the ore miner which only has a bottom forward mining laser (makes sense).
you're talking about the fedhelm. however thats not the only "ore miner". the sequana has 2 lasers, one on top one on the bottom. and the scaldis has even 3! all of these ships can mine all bulk wares, not only ore, but also crystals, ice etc ... i recommend the sequana, it performs the best at mining imo.
yeah I was talking about the fedhelm but I was going off the in game encyclopaedia as it says what they are for but your right there are more than one which can mine ore.

well sadly I wont be able to try your mod out anymore as the 1.16 patch makes my game crash about 10 seconds after leaving a highway . . . :cry:

or it could be to do with a cap ship getting fuel not sure

Return to “X Rebirth - Scripts and Modding”