So now that HPF coming out of Quantrinum Reactor are pre-heated, is it even necessary to run it through a boiler anymore? Previously, running HPF through a Gearbox before high tier generators was pointless because the Gearbox doesn't exactly raise the HPF to a efficient temperature, so it couldn't sustain said generators. Now, it doesn't even look like it's necessary to run the HPF coming out of a Quantrinum Reactor through anything. I think I need a refresher lesson how HPF works. Lol.
MantisShrimp wrote:So now that HPF coming out of Quantrinum Reactor are pre-heated, is it even necessary to run it through a boiler anymore? Previously, running HPF through a Gearbox before high tier generators was pointless because the Gearbox doesn't exactly raise the HPF to a efficient temperature, so it couldn't sustain said generators. Now, it doesn't even look like it's necessary to run the HPF coming out of a Quantrinum Reactor through anything. I think I need a refresher lesson how HPF works. Lol.
Temperature in recipe is a new feature of 0.13. Thus Quantrinum Reactor making hot MF is a desirable thing. It was always meant to be that way but the limitation of the past didn't allow it at first.
Edit: I just looked at the recipe for MF from Quantrinum Reactor. It is producing 250 deg MF, which can still be boiled to maximize the temp.
you can still raise the temperature to atm max. 500 °C, but heating with boilers is save solid-fuel-energy into the fluid. its not way as delievered where the energy comes from the transformation-process. if you afterheat you use both methods conventional vanilla-heating and fantasy yi-technic ^^
the base idea (lost in time) was store daily/sunshine energy into fluid instead of accumulators because better to handle and store. (same for infusion) but (in my opinion a bug) i cant prevent a assembly using modules from beacons (entity-code allow_modules=false is ignored). this original idea would also let handle energy in outpost better, because you transport some mf-liquid (now quantrinum) and have lots of energy, without water supply. fluids in my opinion also better to handle power-spikes instead of flipping accumulators on and off.
i watching the whole system and tweak/balance if nessesary. i still aim for a easy to use medium energy-output-system and complicated tweaked setup for higher output
I've sent Yuoki new code. global.YGBX used to be initialized during on_load but some bad characters have done some very strange things during on_load causing many desync mess. This has forced Rseding's hands and thus he has prevented any mutation of the global table during on_load which was where I used to initialize stuff that I forgot to put into on_init() or forget in on_configuration_changed.
In the mean time, replace your control.lua with this
require "versions"
-- following code by Fatmice, used with permission
local entities
script.on_init(function()
global.TickerA = 59
global.ROSTER = {}
global.ACTIVE = {}
global.YGBX = {}
initialize_entities()
global.version = "0.3.13"
global.dirty= {}
global.dirty[game.tick+54000] = true
end)
script.on_load(function()
initialize_entities()
end)
script.on_configuration_changed(function(event)
if global.version == nil then
game.players[1].print("Past global.version not found. Initializing default migration for yi_engines_"..event.mod_changes["yi_engines"].new_version)
migrate0_3_13a()
elseif event.mod_changes and event.mod_changes["yi_engines"] then
game.players[1].print("Migrating: "..event.mod_changes["yi_engines"].old_version.." -> "..event.mod_changes["yi_engines"].new_version)
migrate0_3_13b()
end
end)
script.on_event(defines.events.on_built_entity, function(event)
Registration(event.created_entity)
end)
script.on_event(defines.events.on_robot_built_entity, function(event)
Registration(event.created_entity)
end)
script.on_event(defines.events.on_preplayer_mined_item, function(event)
Unregistration(event.entity)
end)
script.on_event(defines.events.on_robot_pre_mined, function(event)
Unregistration(event.entity)
end)
script.on_event(defines.events.on_entity_died, function(event)
Unregistration(event.entity)
end)
function Registration(entity)
if entity.name == "y-gearbox-power" then
if global.YGBX == nil then
global.YGBX = {}
initialize_entities()
end
local yegearboxen = {}
yegearboxen[1] = entity
--saving fluidbox wrapper in table
yegearboxen[2] = entity.fluidbox
--tick time
yegearboxen[3] = 5
--table.insert(entities[entity.name]["global"], yegearboxen)
table.insert(global.ROSTER, yegearboxen)
end
end
function Unregistration(entity)
if entity.name == "y-gearbox-power" then
local found_index
local found_entity
local found_entity_x = entity.position.x
local found_entity_y = entity.position.y
for index,entry in pairs(global.YGBX) do
if entry[1] == entity and found_entity_x == entry[1].position.x and found_entity_y == entry[1].position.y then
found_index = index
found_entity = entry
break
end
end
table.remove(global.YGBX, found_index)
end
end
script.on_event(defines.events.on_tick, function(event)
if global.dirty[game.tick] then
clean()
end
if global.TickerA == 0 then
global.TickerA = 59
--Once per second check ROSTER for things that could be moved to ACTIVE
for k,entity in pairs(global.ROSTER) do
if entity[1].valid and entities[entity[1].name] then
if entity[1].is_crafting() then
local next_tick = game.tick + entities[entity[1].name]["time"]
setActiveTick(entity, next_tick)
--game.players[1].print("Moved "..entity[1].name.." at "..entity[1].position.x..", "..entity[1].position.y.." to ACTIVE on tick "..game.tick)
global.ROSTER[k] = nil
end
else
--game.players[1].print("Something died while in ROSTER.")
global.ROSTER[k] = nil
end
end
else
global.TickerA = global.TickerA - 1
end
-- ACTIVE entities. Tick according to rules. Subscription based ticking.
if global.ACTIVE[game.tick] then
for k,entity in pairs(global.ACTIVE[game.tick]) do
if entity[1].valid and entities[entity[1].name] then
if entity[1].is_crafting() then
entities[entity[1].name]["update"](entity)
local next_tick = game.tick + entities[entity[1].name]["time"]
setActiveTick(entity, next_tick, k)
--game.players[1].print("Ticked "..entity[1].name.." at "..entity[1].position.x..", "..entity[1].position.y.." Index: "..k)
global.ACTIVE[game.tick][k] = nil
else
--game.players[1].print("Moved "..entity[1].name.." at "..entity[1].position.x..", "..entity[1].position.y.." to ROSTER")
table.insert(global.ROSTER, entity)
global.ACTIVE[game.tick][k] = nil
end
else
--game.players[1].print("Something died while in ACTIVE.")
global.ACTIVE[game.tick][k] = nil
end
end
global.ACTIVE[game.tick] = nil
end
end)
function initialize_entities()
-----------------------------------------------------------------------------
-- Defining table of update functions and global tables for each entity names
entities = {
["y-gearbox-power"] = {
["update"] = gearBox,
["global"] = global.YGBX,
["time"] = 5
}
}
end
function clean()
--game.players[1].print("Table cleaning due on "..game.tick)
-----------------------------------------------------------------------------
-- Cleaning ROSTER
if global.ROSTER then
game.players[1].print("Cleaning ROSTER")
local new_ROSTER = {}
for index,value in pairs(global.ROSTER) do
if value ~= nil then
table.insert(new_ROSTER, value)
end
end
global.ROSTER = new_ROSTER
end
-----------------------------------------------------------------------------
-- Cleaning ACTIVE
if global.ACTIVE then
game.players[1].print("Cleaning ACTIVE")
local new_ACTIVE = {}
for tick,entries in pairs(global.ACTIVE) do
if #entries > 0 then
new_ACTIVE[tick] = entries
end
end
global.ACTIVE = new_ACTIVE
end
--game.players[1].print("Next table cleaning due on "..game.tick+54000)
global.dirty[game.tick] = nil
global.dirty[game.tick+54000] = true
end
function setActiveTick(entity, tick, index)
if global.ACTIVE[tick] == nil then
global.ACTIVE[tick] = {}
end
table.insert(global.ACTIVE[tick],entity)
end
function gearBox(entity)
--[1] is MF input
--[3] is MF ouput
if entity[2][1] ~= nil and entity[2][3] ~= nil then
entity[2][3] = {
["type"] = entity[2][1].type,
["amount"] = entity[2][3].amount,
["temperature"] = entity[2][1].temperature + 100
}
end
--game.players[1].print("Modified temperature of "..entity[1].name.." at "..entity[1].position.x..", "..entity[1].position.y.." Temp: "..entity[2][3].temperature)
end
remote.add_interface("yi_engines", {
dump_ACTIVE = function ()
local active_entries = {}
for tick,_ in pairs(global.ACTIVE) do
for index,value in pairs(global.ACTIVE[tick]) do
if value ~= nil then
if active_entries[tick] == nil then
active_entries[tick] = {}
end
active_entries[tick][index]= {
["index"] = index,
["name"] = value[1].name,
["position"] = { value[1].position.x, value[1].position.y},
["fluidbox"] = value[2]
}
end
end
end
game.write_file("/yi_engines/ACTIVE.txt", serpent.block(active_entries))
end,
dump_newACTIVE = function ()
local active_entries = {}
for tick,_ in pairs(global.ACTIVE) do
for index,value in pairs(global.ACTIVE[tick]) do
if active_entries[tick] == nil then
active_entries[tick] = {}
end
active_entries[tick][index] = {
["index"] = index,
["name"] = value[1].name,
["position"] = { value[1].position.x, value[1].position.y},
["fluidbox"] = value[2]
}
end
end
game.write_file("/yi_engines/newACTIVE.txt", serpent.block(active_entries))
end,
dump_ROSTER = function ()
local active_entries = {}
for tick,_ in pairs(global.ROSTER) do
for index,value in pairs(global.ROSTER) do
if value ~= nil then
if active_entries[tick] == nil then
active_entries[tick] = {}
end
active_entries[tick][index]= {
["index"] = index,
["name"] = value[1].name,
["position"] = { value[1].position.x, value[1].position.y},
["fluidbox"] = value[2]
}
end
end
end
game.write_file("/yi_engines/ROSTER.txt", serpent.block(active_entries))
end,
cheat = function()
for _,player in pairs(game.players) do
addItems(player, {name = "y-gearbox-power", count = 5})
addItems(player, {name = "ye_overheater", count = 5})
addItems(player, {name = "y-1stirling-engine", count = 5})
addItems(player, {name = "ye_sturbine", count = 5})
addItems(player, {name = "ye_tfmw_generator-s", count = 5})
end
end,
killactive = function()
for tick,_ in pairs(global.ACTIVE) do
for k,entity in pairs(global.ACTIVE[tick]) do
if entity[1].name == "ye_overheater" or "y-1stirling-engine" or "ye_sturbine" then
global.ACTIVE[tick][k] = nil
end
end
end
end
})
function addItems(player, items)
local countBefore = player.get_item_count(items.name)
local countAfter
player.insert(items)
countAfter = player.get_item_count(items.name)
if countAfter < (countBefore + items.count) then
dropOnGround(player.surface, player.position, {name = items.name, count = (countBefore + items.count) - countAfter})
end
end
function dropOnGround(surface, position, items, markForDeconstruction, force)
local dropPosition
local entity
for n=1,items.count do
dropPosition = surface.find_non_colliding_position("item-on-ground", position, 50, 0.5)
if dropPosition then
entity = surface.create_entity({name = "item-on-ground", position = dropPosition, stack = {name = items.name, count = 1}})
if markForDeconstruction then
entity.order_deconstruction(force)
end
end
end
end
I suggest you wait for Yuoki to release 0.3.14 and tell me if the migration is giving issues.
The function migrate0_3_13b is in version.lua so it shouldn't be nill. The code for control.lua that I gave above is for 0.3.13, so if you paste that into any other version of yi_engine, you will have issues.
As for .old_version, just comment out the printing line. It's just debug.
It seems the hard locking issue is still here when hovering over items in your crafting que or in your tech tree. It may not seem like a big issue but it means i cant use it on my server as if anyone hovers over an item it just hard locks everyone for seemingly forever. The server seems to never recover.
Codec wrote:It seems the hard locking issue is still here when hovering over items in your crafting que or in your tech tree. It may not seem like a big issue but it means i cant use it on my server as if anyone hovers over an item it just hard locks everyone for seemingly forever. The server seems to never recover.
Is the hard lock the long pause on cancelling items?
Is that this mod? Is it related to the raw materials calculation? Noticed game thinks even simple vanilla things have a ton yuoki materials in them.
Codec wrote:It seems the hard locking issue is still here when hovering over items in your crafting que or in your tech tree. It may not seem like a big issue but it means i cant use it on my server as if anyone hovers over an item it just hard locks everyone for seemingly forever. The server seems to never recover.
Is the hard lock the long pause on cancelling items?
Is that this mod? Is it related to the raw materials calculation? Noticed game thinks even simple vanilla things have a ton yuoki materials in them.
Its only when you hover over items in your crafting que or items in the tech tree. I'm not sure about if its from the materials, but it happens on any item I've tested. I would love to pfw but it needs this addon that kills the server. If i remove engines its fine, i made a short video of it here https://www.youtube.com/watch?v=T2N8g8mnLlA .
if have tracked this ... some recipe seems make problems or produce a loop, but atm idk which.
it's for sure in the autogenerated file z_recipes. (but these recipes are fully defined) - i removed recipes with vanilla-output but no change atm, so it's maybe a different recipe that generates this internal loop. ^^ i will split these file into portions and test all parts and see if i can find the bad-recipe.
i have here a working yi_engines version but all package-recipes deactivated. yi_engines 0.3.15
possible because all recipes refers in crafting-category causes the issue. of course i don't know why. but until i have moved all in a extra category and made a extra-package-machinery - deactivation fixes the problem looks like. please test and give feedback before i make a upload to mods.factorio.com
is it worth a bug-report ? - idk
i have here a working yi_engines version but all package-recipes deactivated. yi_engines 0.3.15
possible because all recipes refers in crafting-category causes the issue. of course i don't know why. but until i have moved all in a extra category and made a extra-package-machinery - deactivation fixes the problem looks like. please test and give feedback before i make a upload to mods.factorio.com
is it worth a bug-report ? - idk
Resolves the performance issue Codec showed in his video.
Peppe wrote:
Is the hard lock the long pause on cancelling items?
Is that this mod? Is it related to the raw materials calculation? Noticed game thinks even simple vanilla things have a ton yuoki materials in them.
i think - yes.
for most items i have full group and subgroup descriptions (more than nessesary), so the game should not include this into calculation. can only fixed by removing the transformations - i think. i'am not sure if with code the game can forced to take another search-route.
There sems to be a problem with the 50MW generator, as I'm not able to run it with a steam-turbine at all.
All the y-mechanical-force is sucked up instantly witout giving anny power. (the fluid_usage_per_tick sems to be a bit high with 8.913 and the turbines only producing 24 mechanical-force per 1.2 s)
Lorico wrote:There sems to be a problem with the 50MW generator, as I'm not able to run it with a steam-turbine at all.
All the y-mechanical-force is sucked up instantly witout giving anny power. (the fluid_usage_per_tick sems to be a bit high with 8.913 and the turbines only producing 24 mechanical-force per 1.2 s)
I think it is a temperature issue. Steam seems to be coming out of overheater at 110 degrees no matter what now instead of 200+ when the input is >95.