Space Engineers

Space Engineers

(Obsolete) Resource Exchanger
 This topic has been pinned, so it's probably important
Sinus32  [developer] 10 May, 2015 @ 3:45am
Bugs and suggestions
Please post your suggestions and bugs you found here.
< >
Showing 1-15 of 23 comments
Gorbadon 10 Jun, 2015 @ 7:18am 
I think i found a bug in the reactor balancing part of your script.

Current situation:
I have a large ship that runs the script, it is powerd by XPAR Modular Energy reactors and i use a managed blocks group.
When i dock a small ship powerd by stock small reactors to the large ship (managed blocks group is correct) the uranium gets swaped around in the small ship reactors but not balanced.

Happens on a survival single player map with inventory size set to realistic, in case that matters.
Last edited by Gorbadon; 10 Jun, 2015 @ 7:21am
Sinus32  [developer] 11 Jun, 2015 @ 12:03pm 
I'll check this. Can you publish your world or send me it somehow?
Gorbadon 11 Jun, 2015 @ 2:00pm 
Well... my mod-folder has somewere around 2.2GB, that map has most of them active.
But i should be able to publish it if you still need it.
Last edited by Gorbadon; 11 Jun, 2015 @ 3:01pm
Sinus32  [developer] 11 Jun, 2015 @ 3:07pm 
I'm afraid my computer won't be able to handle this. Instead, can you send me any screenshots with inventories that should be balanced, but they aren't? If I have understood correctly, the script did something, but the result is wrong.
Gorbadon 11 Jun, 2015 @ 3:38pm 
I am not shure if i can discribe that with screenshots, i will try to tell you what happens.

Balancing works on the large blocks ship without problems, the docked small blocks ship is suposed to get balanced together with the large blocks one.

Insted that happens:
small reactor 1: 10 Uranium, small reactor 2: 5 Uranium, small reactor 3: 5 Uranium
script runs
small reactor 1: 6 Uranium, small reactor 2: 10 Uranium, small reactor 3: 4 Uranium

The small blocks ship in question has 20 Reactors that get "swaped" like that, sometimes even emptying some reactors.

The large blocks ships Reactors stay perfectly balanced the whole time.
Sinus32  [developer] 11 Jun, 2015 @ 4:09pm 
Thanks. Now I need some time to find out what causes it and fix this.
Gorbadon 11 Jun, 2015 @ 4:20pm 
Just in case, if you dont find out what is going wrong or if my setup is causing that behavour, i can shrink the amount of mods on that map.
It is a testworld and i usualy have all mods active so i do not have to reload if i want to try something out.
However, the Ship itself is still a big one.
Last edited by Gorbadon; 11 Jun, 2015 @ 4:46pm
Sinus32  [developer] 14 Jun, 2015 @ 7:46am 
I'm sorry, but I cannot reproduce this bug. Probably there is something special in your setup.
Can you install some "debugger screens" and tell me what the script writes on them?
Especially I need to know how many blocks are taken into account, and in which way the script divids them into conveyor networks and groups.
Also please tell me if you are using any conveyor sorters, because when they have filters applied, they can (but don't have to) really make a mess.

Information about number of reactors do you have and their maximum capacity also would be handy. With this I could calculate a right result.
For example if you had:
1 reactor with capacity of 8000 (large reactor on station)
10 reactors with capacity of 1000 (small reactors or XPAR reactors on station, or large reactors on small ship)
10 reactors with capacity of 125 (small reactors on small ship)
2025 of uranium in total
the final result after about 12 - 16 calls of the script should be:
843 uranium in reactor with capacity of 8000 (about 10,5% of capacity)
105 uranium in each reactor with capacity of 1000 (again about 10,5% of capacity)
13,2 uranium in each reactor with capacity of 125 (and again about 10,5% of capacity)
Gorbadon 15 Jun, 2015 @ 1:51am 
Current setup:

The map is set to survival with realistic inventory size.
Sorters should not interfere, there are none in between the reactors.

Main Ship:
Heavy XPAR Reactors: 12
Medium XPAR Reactors: 24
Small Stock Reactors: 2
Each reactor has 1000 liter inventory space and some XPARs have upgrades.

Docked via Connectors:

2 small utility ships with 4 small stock reactors each.
2 small Fighters with 22 small stock reactors each.

These small reactors have 125 liter each.

LCD Output:

Resource exchanger. Blocks managed:
Reactors: 245, refineries: 71, oxygen gen.: 8, drills: 0, turrets: 12, cargo cont.: 0
Balancing reactors. Conveyor networks found: 1
Balancing conveyor network 1 group 1 "$Reactor|Generator"...
Inv. 1 vol: 0.000000; Inv. 2 vol: 0.125000; To move: 0.062500
Move 0.0625 l. from Small Reactor Fighter 16 to Small Reactor Fighter 7
Move 1201.923077 -> success
Inv. 1 vol: 0.000000; Inv. 2 vol: 0.125000; To move: 0.062500
Move 0.0625 l. from Small Reactor Fighter 14 to Small Reactor Fighter 8
Move 1201.923077 -> success
Inv. 1 vol: 0.000000; Inv. 2 vol: 0.125000; To move: 0.062500
Move 0.0625 l. from Small Reactor Fighter 14 to Small Reactor Fighter 10
Move 1201.923077 -> success
Inv. 1 vol: 0.000000; Inv. 2 vol: 0.125000; To move: 0.062500
Move 0.0625 l. from Small Reactor Fighter 17 to Small Reactor Fighter 3
Move 1201.923077 -> success
Inv. 1 vol: 0.000000; Inv. 2 vol: 0.125000; To move: 0.062500

I also noticed that all small reactors (large and small grid) don't get properly balanced.
Last edited by Gorbadon; 15 Jun, 2015 @ 1:58am
Sinus32  [developer] 15 Jun, 2015 @ 10:55am 
The script is balancing 245 reactors currently, and I'm sure about that.
The line "Reactors: 245, refineries: 71, oxygen gen.: 8, drills: 0, turrets: 12, cargo cont.: 0" shows how many blocks are really taken into account having regard to managed blocks group.
There should be exactly 90 reactors (12 + 24 + 2 + 2 * 4 + 2 * 22).

Can you write how you have set up managed blocks group in the script?
It's 10th line of the script. By default it's
"public const string MANAGED_BLOCKS_GROUP = null;"

And one more thing: are you sure about that there is only one instance of the script that affects the grid? Maybe you have another PB with TB on another connected ship?
Last edited by Sinus32; 15 Jun, 2015 @ 11:08am
Gorbadon 15 Jun, 2015 @ 11:37am 
I use MANAGED_BLOCKS_GROUP = "Exchanger";

Yes i am 100% certain that there is only one instance, the docked ships dont't even have PBs or TBs.

245 reactors on the outher hand sounds off to me, there are only the 90 reactors i wrote earlier.

Could XPARs upgrade system somehow cause that false readout?

Edit:
There could be deeper problems with that ship, i just copy/pasted it into a creative world to shrink the amount of mods.
Now the PB is telling me "Failed to compare two elements in the array"
Last edited by Gorbadon; 15 Jun, 2015 @ 1:29pm
Sinus32  [developer] 15 Jun, 2015 @ 3:38pm 
I've checked again, but it's not the XPARs upgrade system.

I'm using duck typing to detect if a block is a reactor or not, so I can say that:
The script sees 245 blocks, each of which:
- belongs to group "Exchanger"
- implements IMyReactor interface
- is functional (complete and not damaged)
- uses conveyor system (has "Use conveyor system" enabled)
- has at least one inventory

Maybe try to disconnect some blocks and observe how the number of reactors varies? Using this method you should be able to detect which blocks are counted toward reactors. Only keep in mind that switching blocks on and off makes no difference, you have to switch "Use Conveyor System" to off in order to exclude a reactor without disassembling it.
Gorbadon 15 Jun, 2015 @ 4:14pm 
To be onest, i have no clue what is happening between my ship and your script any more.
Now it randomly fails on top of the balancing issues.
Please try to load my published map, i shrinked the modlist by a lot (hopefully enough).

https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=462150205
Sinus32  [developer] 15 Jun, 2015 @ 10:29pm 
Nice ship. I'll check what is going on today after work.
Sinus32  [developer] 16 Jun, 2015 @ 3:15pm 
It's not a simple bug. I need more time.
< >
Showing 1-15 of 23 comments
Per page: 1530 50