Thermal Solar Power (Lite)


Streamlined fork of Thermal Solar Power by MarximusMaximus and others. Contains the basic thermal solar panel (+ large version for better performance), heat exchanger & heat pipe. A new heat loss mechanism has been added, along with various features, visual updates, settings and new mod compat. The mod is carefully balanced for vanilla, but can be configured.

Content
a month ago
1.1
1.65K
Fluids Power

g Pyanodon Compat + Bug [DONE/FIXED]

4 months ago

Can you make it compatible with Pyanodon? It needs steam of 250 Celsius and every time i load a game after i changed settings - 1) boilers have only 20.3 steam per second and 2) i need to delete all panels and reinstall them or they will always stuck at 250 C and not produce any heat for boilers...

4 months ago
(updated 4 months ago)

Sure, I can look into that!

Right now, I have made a working prototype that allows the Basic Heat Exchanger's target temperature to be configured, as well as select compatibility for Pyanodon, where various parameters are adapted so just about the same amount of energy can be extracted from the Steam Engine. I have then added some suggestions for energy parameter values in Settings.

As for the issue with the Boiler (do you mean Basic Heat Exchanger?), I am not sure what is going on. Shouldn't the throughput be no more than 11.7 units/sec. of water/steam if set to 3700kW like the boiler?

As for the thermal panels getting stuck, I need more information. Could you check and write to me the result of using the command /tspl check in the console, then /tspl reset and /tspl check again, and then check to see if that at least momentarily fixes the issue?

4 months ago

I have just uploaded v.1.3.0! It adds a compatibility option for Pyanodon and writes out some energy parameter suggestions in Startup Settings. The mod is rather weird with its values, but now the solar thermal complex should at least perform roughly as normal and produce about the expected amount of energy with the Steam Engine.

I haven't been able to reproduce the issue with the panels that stop working. Especially the part with getting stuck on 250°C, when the Heat Exchanger should be producing 165°C steam, makes absolutely no sense to me. Aside from that, the panels may get removed from the global table, that a heat-generating script is applied to, but I don't know how; the code ought to be very robust by now and easily correct it if it ever does happen.

Guess I will have to double-check my control scripts. More info about the issue and under what conditions it happens, will be helpful. What parts of Pyanodon are you using?

4 months ago

I couldn't reproduce this one myself now - restarted factorio but it is working now. Seems like the problem was because i changed 165 to 250 in prototypes and i guess i had to reinstall all the entities.... Will check new version now.

4 months ago

Ok it seems every time something changes with the entities themselves (temperature and so on) panels (i use only big ones) stop producing heat or something. Big steam production with 50 panels at the moment of loading my save were heated to 1000 and it was midday with 100% sun but they started cooling down slowly. I reinstalled them and they reheated to 250 and up and heat exchangers started making steam. Then i checked my second array )10 panels) and they were at 250C and not heating up (it was still 100% insolation) and after reinstalling them and waiting while they got to 250 - heat exchangers started producing steam again.
I used 10000 kw heat exchange instead of 3700 and max panel power settings to make it faster though.

4 months ago
(updated 4 months ago)

Interesting! I have in fact experienced something similar a long time ago before releasing this fork, where I was changing prototype properties often. I never exactly figured out the cause, but then created some scripts in control.lua to rebuild the panel global table whenever mod configurations were changed. They should have worked in this instance too, but didn't. Very strange.

Anyway, did you try the console commands? The information would be very helpful.

[Edit] Just saw your latest answer. Will respond to it soon.

4 months ago
(updated 4 months ago)

Ok, thanks for the info, was trying to make the numbers add up.

It seems like the panels are somehow all removed from the global table that identifies the entities (thermal panels) which the heat-generating script should apply to. Or the global table is somehow entirely destroyed along with all its entries. The console commands should be able to confirm which one it is, if you make some tests.

Just a guess, but maybe the high settings, which allow max temperature to be reached, are exposing a heat related bug in Factorio, that may not have been fully resolved yet. I will get back to you on that after some more testing.

4 months ago

By the way, it probably isn't the change to the temperature target of the basic heat exchanger that caused the trouble, since the thermal panels are the ones affected.

4 months ago

I think the only thing i changed in the entity of panel was neighboring bonus (set to 1) but never seen it work really - description in game never mentioned a bonus being applied.

4 months ago

On the neigbour bonus not working: That is because there is no fuel burned in the "reactor". The heat is entirely produced through a script in control.lua.

4 months ago
(updated 4 months ago)

Anyway, I am pretty sure that I have found out the cause of the issue!

Here is my theory: You created a separate fork with a new name, loaded the fork instead of my mod on an existing save, and the panels don't work. You save the game, change some settings, load the save, and now they do work!

Your fork will work perfectly fine, except it won't add any existing thermal panels to its own global table until the reset functions are triggered, for example "on configuration changed".

I had not foreseen the scenario of someone creating a personal fork of my mod and using it in the middle of a playthrough. In the upcoming version 1.3.1, I will make sure that the global table reset functions are triggered "on mod initialization" as well, with the code below (in control.lua line 218+):

function on_init()
    create_global_table()
    clear_global_table(global.tspl_thermal_panel_table)
    search_fill_global_table(LIST_thermal_panels, global.tspl_thermal_panel_table)
end
4 months ago

Until I upload the new version, remember you can just use the console command /tspl reset!

4 months ago

OK. I actually changed the values INSIDE your mod (sorry if it is something bad). Today i loaded with your updated mod (and i used it yesterday so everything should be as intended) and ..... all the panels were on 250. Also tspl check showed me that there were 0 panels. I deconstructed and installed 1 panel - now check showed 1 panel. tspl reset did not work too. Reinstalled all of them - and they work again and show in tspl check....

4 months ago
(updated 4 months ago)

All right. It's fine to modify the code if you want, but this is an important piece of information for troubleshooting. I wasn't fully paying attention, and it was only with your second comment that I began to understand what you meant by "changing settings" and such. I think the issue with mod change/fork creation breaking things is probably a very common "vulnerability" of mods with control scripts employing a global table.

Anyway. So the global table is created, but it is not populated with any existing panels. As expected. But the reset function not working, that is very strange! I have no idea, why it doesn't work. Did you type it correctly? It should print a message like "The Thermal Panel global table was reset and rebuild", etc. Have you changed the names of any entities?

Just to be sure: Did you merely change the existing mod (by copying, un-zipping, modifying, zipping, replacing), or did you create a separate fork with a new name during that process? Because the latter makes the most sense to me.

4 months ago
(updated 4 months ago)

Another question: tspl check showing that 'there were 0 panels'. What did it say exactly, word for word?

An idea for a test: Type /tspl delete, then /tspl reset. And finally /tspl check. Does that resolve the issue?

4 months ago
(updated 4 months ago)

I would also like you to test if the mod works "as is" on a new save.

4 months ago

I have just uploaded v1.3.1, as promised. It probably won't fix everything, though.

4 months ago

Yeah - temperature 250 again ( And check showed 0 panels.

4 months ago

ctrl-x - ctrl-v repairs them all right

4 months ago
(updated 4 months ago)

Ok. Did /tspl check say that the global table exists? Is /tspl reset still not working? Does it work on a new save?

4 months ago

Heh i tried to make the save with the same mods and used creative mod for that - crashed the game :(...... WIth PyAnodon it will take a few hours to get to the Solar panels.....

4 months ago

Restarted Factorio and tried again - i reinstalled 56 panes last time (before restart) and so check command showed table 0/56 - but not 70 (how much i really have). Then reset made it into 0/0.....

4 months ago
(updated 4 months ago)

Huh! Okay, now it's clear that something else is going on. Something unexpected. Never mind the global table, the panels themselves somehow can't be recognized by the search or reset functions, maybe because they have been rendered invalid somehow. Never had this kind of issue, have no idea how to reproduce it myself.

Could you try to press F4 while in a save, then select the 13th option show-debug-info-in-the-tooltip? Then hover the mouse over many of the panels to check their name? It should be tspl-thermal-solar-panel or tspl-thermal-solar-panel-large. ([EDIT]: Corrected names! Sorry about that.) Also check if they have a unit number.

I would also like you to click on those panels and see if the makeshift sunlight indicator still works, filling up with "solar-fluid" (displayed as "Sunlight") on gui opened, emptying on gui closed.

4 months ago
(updated 4 months ago)

I have that tooltip option always on anyway :) Very useful.
Hm i exited the game and loaded it all again - and the panels are working and i have 0/79 in check command....
Damn then you look for an error - everything works fine :( Then you are not looking - everything breaks :(
Also each have unique unit number.

4 months ago

Ok, thanks for checking. Very weird. But if 0/79 are found, then the /tspl reset function should also work now, making it 79/79. Will you check that too?

4 months ago

Thinking about it more closely: The 0/79 number means that 0 panels where found in the world, but there are still 79 entries in the global table. And even though the entities can't be found, you said they work, meaning that the heat script is still being applied to them! This is very weird.

4 months ago

It goes from 0/79 (which works - steam is generated, light is in the gui screnn and not then screen is closed - all seems normal) and reset makes it 0/0.....

4 months ago

Huh. I am wondering if it is an issue only with Pyanodon mods installed. Right now I am changing and testing my reset function to see if I can at least automatically correct the problem, whatever it is.

4 months ago

I have gone over my code many times, and found no flaws with it. I think some mod must be interfering, making the panels unsearchable. But I just don't know how. They still exist, so they should be valid. The same goes for the surface they are built on. Maybe their names are changed, but why, and how?

Do the panels at least work on a world without any Pyanodon mods? Or no other mods at all? Do the commands (delete, reset, check) work as expected?

4 months ago

I might be on to something now. Do you have more surfaces in your world, other than Nauvis? Like other planets, an underground, a creative workspace or factory building with space inside like in Factorissimo?

4 months ago

I have uploaded v.1.3.2! Try it!

I found out that my search function would just replace the entries of a table when the next surface was searched for thermal panels, instead of properly appending to that table. I am pretty sure that the mod will work now.

4 months ago
(updated 4 months ago)

Well, just tested with a mod that adds another surface, and it seems to work, except that the console commands don't give the right information. Will correct it and make absolutely sure everything works. [Edit] There are still issues, but I am making progress.

4 months ago

Uploaded v1.3.3! I have finally fixed the issue! I had to address a few different errors/omissions, which made troubleshooting really difficult. The idea in version v1.3.2 was right, but the solution was wrong. Try it out!

4 months ago

OK..... Updated the mod. It works after Factorio restart. But check still shows 0/73, though reset doesn't make it 0/0 which is good - it makes it 0/73 :)

I have no other surfaces at all. Also i deactivated mod Solar Productivity (which probably didn't even detect your panels annd also i was waaaay before i could reach its 1st tech level) and Additional Turrets (for some reason it was in the list of mods affecting the panels. After that the list looks like - thermal solar lite - Squeak Through - Pyanodon AlienLife - Extended Descriptions.

Will check tomorrow again.

4 months ago

Thanks for info. The first part I discovered as well. No other surfaces at all, I did not expect. The rest does not particularly sound like an issue, but I will have to check.

Anyway, maybe v1.3.3 will work. I definitely did solve an important bug, but I don't know if it is the one afflicting your save(s).

4 months ago

Oh i see 73/73 now!!! Great work!!! Thank you.

4 months ago

Reset also leaves then at 73/73/

4 months ago

That's great! I am not a programmer, so it took me a while to figure this one out. Thank you for staying with me on the issue. Because of it, I was able to make a really important fix.

Let me know if there are other issues. I hope you (and others) can enjoy using my mod from now on. Cheers!

4 months ago

Just saw your latest post. Very good!

New response