Foghrye4 / ihl

IHL: Tools & Machines mod for Minecraft Forge 1.7.10
Other
11 stars 3 forks source link

Flexible cable bugs #55

Open wormzjl opened 7 years ago

wormzjl commented 7 years ago

https://pastebin.com/EVhRV2xS

Foghrye4 commented 7 years ago

I can't recreate that crash. Could you show me your setup?

wormzjl commented 7 years ago

It happens a bit random, probably by connecting ihl cable directly to ic2 cables

Foghrye4 commented 7 years ago

I still could not catch it. I added additional null check in grid calculation in 0.640. This should solve a case. http://www.mediafire.com/file/hgqj9ekcyagh457/ihl-tools_n_machines-0.640-1.7.10.jar

wormzjl commented 7 years ago

ok thx!

yuyuyzl commented 7 years ago

Another stall happened in our server today, luckily we have recorded the stall log and an image of his wire connections. ihlcablestall And the stall log: stall-2017-05-29_20.44.19.txt

Seems it would be a IHL&Uncomplication compatible problem. And we're using Thermos. Hoping this would help.

Foghrye4 commented 7 years ago

Seems to be a fatal flaw of using NBT object as grid cable representative. Fixing this would take some time.

Foghrye4 commented 7 years ago

Ok, try a new version (0.642), it should not cause stalls, because I get rid of NBT in energy net.

tony987852 commented 7 years ago

It happened again. We have already updated to the latest version.

Here is the stall log: stall-2017-05-31_23.06.49-2.txt

Thanks.

Foghrye4 commented 7 years ago

I'm not sure in anything now, but I changed a code a little bit. Maybe this could help. http://www.mediafire.com/file/5dx5ff93rmq152c/ihl-tools_n_machines-0.0.643-1.7.10.jar BTW how complex is grid? Do it contain a circles?*


wormzjl commented 7 years ago

It quiet simple, just power source -> electrolysis bath with length less than 2

wormzjl commented 7 years ago

https://github.com/Foghrye4/ihl/blob/8ed8c659da9496bf49fec94c049b0abae21746a8/ihl/flexible_cable/IHLGrid.java#L272 Can you add some sort of size limit & debug warning on this hashmap? Might help pinpointing the issue Also is it possible to print the location of bugged cable?

Foghrye4 commented 7 years ago

@wormzjl I removed that hashmap. Source updated, check by yourself.

wormzjl commented 7 years ago

ok will test

Foghrye4 commented 7 years ago

@wormzjl ...no. Does it stall?

wormzjl commented 7 years ago

Nvm, still testing Just have a probable cause for the issue coming up in mind. Thermos/ spigot "deactivates" entities if they are some distance away from players, will this cause issue with the cables? Also if the nbt is not saved properly on chunk unload, on chunk reload will it crash like this?

Foghrye4 commented 7 years ago

@wormzjl entities does not involved in enegy transfer unless they are touch ground and uninsulated or voltage in cable above insulation breakdown voltage. In that case they emit smoke particles. Each time chunk containing energy node unloaded ... wait... I think I found a possible case. When TE is in uloaded chunk it is invalidated and removed from all lists. But in my case it is remains in grid TE list. So, when chunk is loaded again it will generate new instance of TE, which will be added to grid alongside with old invalid instance of TE.

wormzjl commented 7 years ago

So boom?

Foghrye4 commented 7 years ago

Ok, try this: http://www.mediafire.com/file/taojc7ubcicbyke/ihl-tools_n_machines-0.644-1.7.10.jar Also check fractionator column.

wormzjl commented 7 years ago

https://pastebin.com/PSijj7ht crashed by linking an electrolysis bath with a mfe

Foghrye4 commented 7 years ago

Unexpected. Well this version does not crash: http://www.mediafire.com/file/gw2fbm0yl7j7o5y/ihl-tools_n_machines-0.645-1.7.10.jar (and as well does not work with uncomplication mod (energy not transferred after first packet))

wormzjl commented 7 years ago

Some weirdness in the enet?

Foghrye4 commented 7 years ago

@wormzjl probably demanded energy >0d but <1d bug.

wormzjl commented 7 years ago

Seems that when the electrolysis bath finishes it's work, it refuses to work again unless the cable is reconnected

Foghrye4 commented 7 years ago

For a freaking hour I tried one to another options to fix that. Screw it. Ok, IHL officially incompatible with Uncomplication mod until a further notice.

Maybe I should make electrolyzer to support work with normal cables?

wormzjl commented 7 years ago

That will lose some...identity

Foghrye4 commented 7 years ago

@wormzjl I took my will into fist and found a lot of bugs related to flexible cable energy transfer system (0.646). I did not test fixes with uncomplication, but it was not an uncomplication related bugs at a first place. You may want to check a work with uncomplication now, and I need to sleep.

wormzjl commented 7 years ago

Thank you very much! gonna do some more testing

wormzjl commented 7 years ago

Ok, the power transfer from/to ic2 energy block is fine. But it seems that the electrolysis bath is not receiving any power? Also before you can attach wire to desired block face by simple shift + rightclick, but now you need to stand right before that side

Foghrye4 commented 7 years ago

But it seems that the electrolysis bath is not receiving any power?

Is recipe conditions are fulfilled? Because everything fine at my side (even with uncomplication mod). Try this: launch Minecraft with opened console. Right-click at electrolysis bath with thermometer (from IHL creative inventory). Copy-paste 4 lower lines of console output here. Do a same thing with opposite side of cable connected (there should be invisible but clickable "junction box").

Also before you can attach wire to desired block face by simple shift + rightclick, but now you need to stand right before that side

O.O I did not change anything related to this part of code. At least as I remember.

yuyuyzl commented 7 years ago

Also before you can attach wire to desired block face by simple shift + rightclick, but now you need to stand right before that side

That's true. I have not read your code but in game you should stand at the face you want to put wire and click or your wire will connect to other faces.

Because everything fine at my side (even with uncomplication mod).

And i'm sorry about my misleading to uncomplication. IC+IHL+Uncomplication works fine, The problem is Immersive engineering use a strange way to feed energy to IC capacitors, which causes the problem i've mentioned before. An IE->IC->IHL wire connection will cause the problem, but IE->IC->IC->IHL wire works fine.

wormzjl commented 7 years ago

[19:34:03] [Server thread/INFO] [STDOUT/]: [ihl.items_blocks.IHLTool:func_77659_a:106]: grid energy=0.0

[19:34:04] [Server thread/INFO] [STDOUT/]: [ihl.items_blocks.IHLTool:func_77659_a:106]: grid energy=0.0

[19:34:05] [Server thread/INFO] [STDOUT/]: [ihl.items_blocks.IHLTool:func_77659_a:106]: grid energy=0.0

The recipe works normally before update

setup image

Foghrye4 commented 7 years ago

getEnergyAmountThisNodeWant()=32000.0

32000 at both sides? This value show amount of energy which can consume node when energy injected in net. 400*400/5 - is basic value before grid update for electrolisis bath. So everything fine here. Please check opposite side (invisible junction box). There will be a small black box when you point tool to an end of cable. http://imgur.com/a/bgJk1

wormzjl commented 7 years ago

[20:09:51] [Server thread/INFO] [STDOUT/]: [ihl.items_blocks.IHLTool:func_77659_a:106]: grid energy=0.0

This is on the side of the MFE

image

and the wire I'm using image

Foghrye4 commented 7 years ago

Weird. Different grid ids... (id=1 at MFE side and id=7 at electrolysis bath side). Is it bug persistent? If you remove a cable and reconnect devices together again it will be a same?

wormzjl commented 7 years ago

it's the same all the time

Foghrye4 commented 7 years ago

@wormzjl send me your world and modpack.

wormzjl commented 7 years ago

https://mega.nz/#!fcRGRCwC!MA62EeTdt_yY18IVzBUyDY6AVMF4sedyKcYnVOZzztY You can import it via multimc

Foghrye4 commented 7 years ago

@wormzjl it's a DragonAPI. Have no idea what it do, but everything works fine without it.

wormzjl commented 7 years ago

why it no longer works after the fix...this is really weird-

Foghrye4 commented 7 years ago

@wormzjl A thing I fixed - "junction box" sending energy back to source if it is a sink as well (all energy storage devices are both sink and sources). If it is a second node in grid - everything work fine. If it is first - energy does not go further. I added condition to junction box to send energy to attached device only if this device allow input from box side.

wormzjl commented 7 years ago

Seems that the cable orientation issue starts from 645...still checking

wormzjl commented 7 years ago

If the machines and wire were placed before adding dragonapi, everything works properly...investigating

Foghrye4 commented 7 years ago

Damn. It seems you founded it. If DragonAPI use ASM to add that interface with provided functions into all IC2 energy tiles, this could cause collision with my own function result. And it seems DragonAPI just catch exceptions caused by this mess silently.

wormzjl commented 7 years ago

No this is probably not the issue so I deleted it, still investigating

wormzjl commented 7 years ago

Ok this has nothing to do with dragonapi Ihl cables only conducts power when energy source is facing east, you might want to have a look at the side checks

Foghrye4 commented 7 years ago

You mean that energy source transfer energy to flexible cables only if it facing east? Why everything works fine without DragonAPI then?

wormzjl commented 7 years ago

yeah, tested without DragonAPI, no power emit when it's not facing east even with MFE->MFE connection, nothing to do with the electrolysis bath

Foghrye4 commented 7 years ago

Ooops. My bad.

Foghrye4 commented 7 years ago

What about now? http://www.mediafire.com/file/zq5pffyh311hibo/ihl-tools_n_machines-0.647-1.7.10.jar

wormzjl commented 7 years ago

thx, doing some live testing