[MOD] Smart miners [0.4 experimental]

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

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

User avatar
Sandalpocalypse
Posts: 4447
Joined: Tue, 2. Dec 03, 22:28
x4

Post by Sandalpocalypse »

Is the script the same for 'support skunk' and for 'free mining/mining resources?'?
Irrational factors are clearly at work.
felrasha
Posts: 37
Joined: Mon, 18. Nov 13, 14:55

Post by felrasha »

Version 0.2 released, which fixes a very very annoying and stupid bug.
Apparently the large miners (it's the only one I have...) only have one turret, on the bottom of their hull. The result of this is that they will only mine from the bottom hemisphere. If an asteroid is present in the upper hemisphere, and none in the lower hemisphere, the mining ship will just sit there...
I planned on triggering it so if your mining lasers hadn't fired for a while you would change position, but the firing of weapons is a bit weird. I had to jump through some hoops to find a way to reposition the ship. It now repositions itself after it has passed 20 cycles in which the amount of asteroids within 1.8km has not changed.

@Zothen: I believe that will result in a lot more stress on the CPU due to all the checks I need to do (I would need to validate every ship in the zone to see if it had mining lasers, mining drones, free cargo space, no other orders, etc...). Also, unless I plan to due this for every asteroid in the zone at once (poor CPU :( ), it would result in either only one miner at the same time being allowed to mine, or all miners in the zone going for the same roid.

@zone22
Egosofts code specifies the following:

Code: Select all

<do_if value="$subordinate.pilot.command.value == command.follow">
I believe this basically means the ship needs to be in your squad and not doing anything else.

@Sandalpocalypse
Aye, this ship works for all mining actions of Large and XLarge ore miners. Including NPC's btw.


I'm going to change the todo list a bit, since I don't really know where to fly gasminers toward. (I don't think find_asteroid_in_region will help me find gas)
I plan on finding out what on earth is going on with drones flying off into the distance all the time, and what the purpose of the abort script is.
Afterwards I'll try and improve on the babysitting.
-- This code keeps amazing me...
User avatar
Sandalpocalypse
Posts: 4447
Joined: Tue, 2. Dec 03, 22:28
x4

Post by Sandalpocalypse »

I plan on finding out what on earth is going on with drones flying off into the distance all the time,
I would guess they are picking up random rocks in the area. I have found the drones to be way more reliable at doing their job than the mining ship, personally.

I'd give my particle cannon for the Sequana to be kitted out like the HoA's mining Scaldis... xD
Irrational factors are clearly at work.
zone22
Posts: 55
Joined: Fri, 4. Aug 06, 05:24
x3tc

Post by zone22 »

Thank you for the update! Keep up the great work!
I'm still experiencing the same issue as I said before. Maybe it's user error, but I mined perfectly fine for a couple hours before before this issue presented. I went ahead and recorded a video of the problem:
https://dl.dropboxusercontent.com/u/20743623/1.mp4

The mining ship is in my squad has collector drones and free cargospace.
felrasha
Posts: 37
Joined: Mon, 18. Nov 13, 14:55

Post by felrasha »

Thanks for taking the time to create the video, it's very informative. I'll check into this tonight.

On a sidenote, I'll need tofigure out a way to spawn myself some decent mining ships. I've been doing all the changes with only one Fedhelm with only 8 mining drones :P
-- This code keeps amazing me...
ZoiN
Posts: 53
Joined: Sat, 16. Nov 13, 04:26
x4

Post by ZoiN »

Does this work for the AI factions as well ?

If so then I guess this might help on keeping the economy steady yeah ?
felrasha
Posts: 37
Joined: Mon, 18. Nov 13, 14:55

Post by felrasha »

ZoiN wrote:Does this work for the AI factions as well ?

If so then I guess this might help on keeping the economy steady yeah ?
Sort of. Ships have different 'attention' levels in Rebirth. This mod works for all mining ships with attention level 'visible'. I believe that means all ships in your current zone. Ships outside of that use a different script, in which they don't really mine: They just have a gather-rate over time, and the deplete the system of resources at the same rate. There's no actual mining going on.
-- This code keeps amazing me...
felrasha
Posts: 37
Joined: Mon, 18. Nov 13, 14:55

Post by felrasha »

Pilakin, what ship are you using for this?

Edit: hmm, his comment is gone now :P
-- This code keeps amazing me...
zone22
Posts: 55
Joined: Fri, 4. Aug 06, 05:24
x3tc

Post by zone22 »

Just in case this might be helpful. I zipped up my extensions folder and the saved game in question. That way you have a mining ship and everything's ready to go. https://dl.dropboxusercontent.com/u/207 ... rebirth.7z
felrasha
Posts: 37
Joined: Mon, 18. Nov 13, 14:55

Post by felrasha »

awesome! That will help immensly.
-- This code keeps amazing me...
User avatar
pilakin
Posts: 235
Joined: Sat, 16. Feb 08, 23:44

Post by pilakin »

felrasha wrote:Pilakin, what ship are you using for this?

Edit: hmm, his comment is gone now :P
yea I realised my mistake, has nothing to do with mining or this mod.
the miner was mining till he was full and then stopping. thing is, the "storage capacaty" is just general. you can go into details of it and will see it's actually devided between different ware types. i was using the scaldis which can carry 240k overall but only 40k bulk of it, thus the miner stopped at 40k obviously.

the mod is really good actually. one thing i noticed if you want to start mining outside any zone, the ship boosts to the center of nearest zone first and then tries to find asteroids there, mostly without success cuz asteroids don't float around in center of zones.
felrasha
Posts: 37
Joined: Mon, 18. Nov 13, 14:55

Post by felrasha »

yes I hope on finding the cause of that tonight, and release a new version

EDIT: I found the problem thanks to the savegame, and I also already have a fix, I'm going to eleminate the zone-check if the player ship is within a certain distance.
The Rahanas in the savegame however has a full cargo hold.
The total hold of the Rahanas is 180.000, but only 170.000 is reserved for bulk. (you can see this when inspecting the ship and selecting details on the cargo)
The code says the ship need 5% cargospace left to initiated a mining sequence. I don't really feel like changing that at the moment, because an XLarge ship with a whole bunch of drones might actually cover several percent, and I don't feel the base code is sturdy enough to handle it if it goes over the maximum.

There is atm 164.844 m3 in bulk on the Rahanas, leaving 5.156, and it would need 9.000 to start a cycle.

I'll update the abort script to be more clear on full cargo, and make a 0.3 release
Last edited by felrasha on Thu, 21. Nov 13, 18:22, edited 1 time in total.
-- This code keeps amazing me...
BagOfMeat
Posts: 8
Joined: Thu, 21. Nov 13, 17:42

Post by BagOfMeat »

Hello

I am just wanting to post on this thread as ultimately I want to have an epic mining corp, and having the ability to step back and watch all my miners make me money with out getting involved in the actual mining process. Iv clocked around 35hrs of play on X Rebirth 30 of which is in Free Mod as story is a tad broken.

the majority of my time is getting to grips with the mining side of thing but mining ICE as the ore miner ship is missing a landing pad (the last time I checked anyway). The ice miner (Sequana) has 2x mining turrets both on the nose of the ship but one on top and one below and a landing pad at the back.

So I am assuming you mod should work wonders on this ship as you wont have any problems with the ship getting stuck under the asteroids and the fact is ice is mined in the same way as ore.

Have you try this ?

I would like to confirm that the AI acted COMPLETLY different when you leave system that when u are baby sitting them. and if they are next to some ice when I ask it to mine it fly's off in a random direction but firing its mining lasers at the near by ice until out of range. . .

also the drone would rather fly 30k to pick up a small (ready to pick up) ice rock than the mining ship move 5k to brake down a ice rock to the required size (I followed a drone . . . it took some time lol)

the majority of the time my miner gets stuck I fly off to another system and it generates ice till its full and I can drop it off (unless I have stuck drones then I am Fracked and have to reload)

are you planning on changing the URV's behaviour any time soon ??

thanks sorry for wall of text
felrasha
Posts: 37
Joined: Mon, 18. Nov 13, 14:55

Post by felrasha »

The part with the ship flying off is probably related to it not being in a zone. A fix for that will be released tonight. I've not yet played around with a Sequana. Infact, I've only actually played the game for a couple of hours, before I got too frustrated (spent all my money on a Fedhelm, to have it do nothing...)

Mining drones are definitly on my list, but their behaviour is spread out over 3 or 4 aiscripts, and hard to comprehend. Even harder to debug, but yes, definitly a high priority.
-- This code keeps amazing me...
User avatar
pilakin
Posts: 235
Joined: Sat, 16. Feb 08, 23:44

Post by pilakin »

you are not limited to ice with the sequana, the description ingame is misleading. the sequana has mining turrets and can carry bulk wares, thus you can mine every bulk items with it including crystals, ice, nividum, ore and silicon. and it even has a docking point (although i'm surre fedhelms dock is gonna be fixed soon).
BagOfMeat
Posts: 8
Joined: Thu, 21. Nov 13, 17:42

Post by BagOfMeat »

Thanks for the speedy reply

I am used to the steroid induced rage called the steam forums, what a horrible place lol

yeah I reloaded when I bought the Fedhelm and it didn't do much :x

But if you are interested Inner worlds, frozen circuit has multiple ice belts over multiple zones I do believe 1 or 2 overlap 2 zones would this system be good for testing this mod ?

last thing the miner dose seem to leave some drones out in space which don't do anything but sit there admiring the view.

gonna try this mod out do you recommend a new game to see its best results :?
felrasha
Posts: 37
Joined: Mon, 18. Nov 13, 14:55

Post by felrasha »

This mod just replaces AI, so I'd use an existing game to check improvements. (backup your save ofcourse)

I'd wait an hour though, I'll have the next version ready by then which should fix the out-of-zone mining.

The drones are Egosofts fault. I haven't touched them yet :P
-- This code keeps amazing me...
BagOfMeat
Posts: 8
Joined: Thu, 21. Nov 13, 17:42

Post by BagOfMeat »

pilakin wrote:you are not limited to ice with the sequana, the description ingame is misleading. the sequana has mining turrets and can carry bulk wares, thus you can mine every bulk items with it including crystals, ice, nividum, ore and silicon. and it even has a docking point (although i'm surre fedhelms dock is gonna be fixed soon).
thx for the info explains why it could pick up stuff off a hacked freighter . . . I was bored lol

one way to get fuel tho.

to all joking aside that maybe another bug as it should only hold ice so this may get fix in a patch.
felrasha
Posts: 37
Joined: Mon, 18. Nov 13, 14:55

Post by felrasha »

version 0.3 released, which should fix out-of-zone mining and adds some more descriptive texts (translations are welcome)

Now I'll take a look at drones
-- This code keeps amazing me...
BagOfMeat
Posts: 8
Joined: Thu, 21. Nov 13, 17:42

Post by BagOfMeat »

felrasha wrote:version 0.3 released, which should fix out-of-zone mining and adds some more descriptive texts (translations are welcome)

Now I'll take a look at drones
:lol:

thanks for your dedication man.

Iv literally just finished sorting a new save, so I could test this mod out with my ice miner in frozen circuit with nothing gone wrong (drones stuck or something)

FYI buying a cap has been fixed aka all of the drones are available and when u are prompted that they have no fuel and u asked them to get fuel THEY DO !!

I will let you know what happens

I am a computer mong so any guides on how to install this on a steam X rebirth ? sorry :oops:

Return to “X Rebirth - Scripts and Modding”