Foundations

by 0n0w1c

A quality of life mod that provides settings, tools and automation to assist the engineer in placing tiles to achieve a multi-layered tile appearance. Support added for AAI Industry, Dectorio, Space platform for ground, Electric Tiles, and Even Pickier Dollies.

Utilities
a month ago
2.0
2.18K
Cheats

g (Resolved) Electric Tile Foundations.

a month ago

Let`s continue the conversation here so the comment wont confuse other players.

a month ago

If possible it would look really NICE to have the space platform tile for the ELECTRIC TILES,

In my oppinion 1 tile for conducting electricity it is enought, we do not need all tiles to conduct electricity.
with a good script electric tiles would be placed only below the buildings and nowere else unless manually placed. what i mean by that by using FOUNDATIONS mod.

a month ago

I thought the author of Space Platform, for Ground was going to make the tiles.

a month ago

something they spoke, i let Joss know of this link he will come here when he is on, he is working on linux system now :))
me i dont know linux so i dont mess with that thing.

I`ve been trying to create a mod myself and i get all kinds of errors.
was trying to upgrade 5 red science potions to 1 green, then 5 green to 1 black, 5 black to 1 blue, 5 blue to 1 purple and 5 purple to 1 yellow.
I could not even do that , still trying but fail every time. cause of errors.

a month ago
(updated a month ago)

Hi there bros :D

Yeah, I alreadey told Snouz a little about the possible compatibility patch for his mod, however he didn't respond back... He is also a father of a baby, so, its understandable.

The way i made Electric Tiles work back in 1.2.2 allows other modders to create their own electric variants of their own tiles, howwwwever with a little thing that, at least in their eyes, could be a problem: duplication.

You see (and other players that are also interested in this information) electric tiles essentialy creates a duplicate from the data that u pass to it, it performs some little but necesary alterations, and then creates a new tile/item prototype.

The thing is that this new duplicate is essentialy a new kind of tile that just looks the same as his parent, so, players would have to craft the new one... And the main reason to why is this like that, well, is cause of preventing existing tiles from being considered "electric", cause of the mod just recently starting to take it into the calculations, any tile that was placed before will NOT act as its electric variant. That is actually a necesary limitation, cause recalculating a whole surface consumes a gigantic amout of UPS. Practically frozes the game for like 2 minutes in big bases.

And so, after that long explaination that probably only I understod xdd, the main reason why i didnt directly integrate a compatibility for Snouz's mod is cause of the two ways of doing it, two methods that Snouz should be the one that chooses from: creating the duplicate, or removing the existing one, so the new one replaces it.

Havent actually thought about how to implement the compatibility... But probably the best way should be the replacement + a migration, so players still have their bases covered in platforms, but well, with the draw back that they would need to be "refresed", by the console command that I implemented, or just by building/removing some close tiles.

... I rlly dont know if i made myself understandable guys... Srry xd

a month ago
(updated a month ago)

I have a few varied thoughts, do not worry if I make no sense. Somehow I do manage to survive.
First, Congratulations to Snouz!

Second, I am very direct, I mean no offense. I speak my mind, fair warning. :)

I would not be too concerned with megabase performance. Electric Tiles will never be performant enough. Only if you manage to find a way to save UPS, will your mod be useful to a megabase. So I would not worry too much about those big recalculations. Be performant enough for "normal" size bases, is all that can be expected. Placing city blocks of electric tiles via the logistics system or retrofitting a base, is probably not performant.

This is where I would suggest providing a selection tool, to place your tiles. Then you can have some control of how they are placed... maybe do the calculation in the tool event handler, so tiles and proxies are optimally located? I would probably encourage tile creation (no logistics) over tile placement. But that should be considered carefully from the game play perspective.

Co5tel's idea of using Foundations to place Electric Tiles under entities, while I share the vision, I need to play it out to see how it performs. This is from the other end of the performance question, too many electric poles. Foundations makes swiss cheese of the tiles as far as Electric Tiles is concerned. However, it can place a significant number of electric tiles with little performance impact. But any selection tool and a bit of scripting can do.

a month ago
(updated a month ago)

I personally don't know... don't have any experience with custom tools like you have.

The fact that the electric tiles are kind of "integrated" in the gameplay logic is key to me: the player doesn't need to manouver his engineering degrees too much xd, only keep in mind the logic of the tiles, place some of them closer and the electricity goes through.

I already implemented some optimisations for the mod, like, timers, to prevent updating grids in EACH tile placement, a timer that forces the normal timer, so the player cannot build infinite... and currently adding in 1.2.7 another limitation, but in the amount of tiles placeable before an update (4 full chunks, so 4096 cached tiles) (be aware that when i'm talking about "caching" is just storing a single number in a matrix, so the mod can then interpretate it)

... I was thinking in implementing possible the biggest (and most complex) optimisation until now: processing by batches, so not ALL cached tiles get procesed in one shot.

0n0w1c, you certainly have more experience with this kind of things, and i mean custom tools and certain kinds of prototypes, after all u have been modding factorio for more time than me, so, I'll need some feedback down here xd

And just saying something about the comment where u said that placing blueprints could not be very performant... well, It actually hovers the central problem of optimisation, rather than its own, after all the mod interpretates the placing/removal of players and robots exactly the same, the only thing is that robots can easily built/remove a pretty good amount of tiles in just seconds, making so that the mod starts having some problems.

a month ago
(updated a month ago)

and hey, just asking here, do u know about the var type bit32? I just found out cause of some Lua forums... maybe that could even help a little in the main processing of tiles

a month ago
(updated a month ago)

Internally I am sure lua uses var types, but none in the language that I know of.

I have a couple of videos on the Foundations portal page. They are very short but if you have not used Foundations, they will give you a visual and maybe some ideas.

There is a significant performance difference between
surface.set_tiles(tiles_to_place, true, false, true, true)
and
on_player_built_tile and on_robot_built_tile

The first you can call when a selection tool is used. Which is just an event that the player selected an area (and the entities), you then do with the area what you want. Like lay thousands of tiles in a single call with set_tiles, which accepts an array of tiles and positions to place.
Not one tile at a time through the logistics system... robot animations, job dispatch, robot entity control, etc. huge difference in performance.

The downside is the tiles spawn instantly into place, bad for immersion.

a month ago

hi there brothers, like i said i use FOUNDATIONS all the time along with electric tiles, i find it very easy when i can place electric tiles only under the buildings that require it, later on we will work on a Wi-Fi Antenna wich will send electric signal far away, from the main base to an Uranium outpost far away from base.

I got ideeas most of them are good, if i knew how to code i was going to be like DellAquila with 100-200 mods posted.

a month ago

0n0w1c i got another QoL feature wich is needed.
Now since we build Electric tiles under the buildings, poles, belts and inserters could we get a script that no matter what other tiles we build around those that are under the specified buildings does not get replaced, nor stack something else on top of them.

a month ago

The issue you face is due to using the wrong type of tile. It is not possible to prevent the changing of tiles, a script can revert the change, but the change will occur.

a month ago

But then I am not sure if Electric Tiles works if you cover a tile, so even the correct tile type won’t help.

a month ago

@Factory077
I am not able to resolve how to use your remote interface.
Would you mind posting the code you used to get Space-platform-for-space tiles to work?
I know you have the example posted, but I don't know how to make it work without an event id returned.

a month ago

Or maybe you know of a mod that has successfully implemented the remote interface that I could look at?

a month ago
(updated a month ago)
    if remote.interfaces["ElectricTilesControlInterface"]
        and remote.interfaces["ElectricTilesControlInterface"]["registerTilePrototype"] then
        remote.call("ElectricTilesControlInterface", "registerTilePrototype", { "space-platform-for-ground" })
    end

This runs without error, but the space-platform-for-ground tiles do not have proxies when I place the tile.

a month ago

Never mind, I have it working now. I tend to make things harder than they need to be. :)

a month ago

xd

Srry for the late response. Have been working.

I'm currently starting the development of 1.2.7, and many little things will come in hand for this version... Maybe with a little bit of luck I can bring down the UPSs problem, at least in certain grade.

a month ago

1.2.7 published.

I got my hands in the main problem of optimisation, however, I was able to only increase the processing speed by 13% aprox... Mostly cause of an operation that is heavy, but required, to calculate the correct connections for the electric proxies.

Also, got "foundations" like tiles working! 0n0w1c, may you confirm that ur foundation variant is working correctly now?

a month ago

1.2.7 published.

I got my hands in the main problem of optimisation, however, I was able to only increase the processing speed by 13% aprox... Mostly cause of an operation that is heavy, but required, to calculate the correct connections for the electric proxies.

Also, got "foundations" like tiles working! 0n0w1c, may you confirm that ur foundation variant is working correctly now?

All tiles work and has their name Written for every tile. Aquilo ones included

a month ago

@Factory077
Yes, in early testing, it appears to be working. I will do more testing in the next couple of days.
Thanks!

a month ago
(updated a month ago)

Version 2.21.0 has been uploaded, in addition to fixing several bugs, it adds an option for the experimental Electric Space Platform Foundation tiles.
Works like landfill, but can be placed anywhere. Lay it down and build on top... including decorative tiles.

a month ago

niceeee

a month ago
(updated a month ago)

very expensive recipe ..and i did not see if it gives any speed bonus.

a month ago
(updated a month ago)

It is much cheaper than the Space Platform for ground. What do you think is a good recipe?
Use the vanilla tiles for speed increases.

a month ago
(updated a month ago)

It is much cheaper than the Space Platform for ground. What do you think is a good recipe?
Use the vanilla tiles on top for speed increases.

a month ago

And if you want the ground clutter, place the original Space Platform for ground tiles on top or nearby, very messy tile.

a month ago
(updated a month ago)

Version 2.21.4 has been uploaded, and with this version, I think it is pretty much all in place.
I do want to do more to help with optimum placement, still kicking around ideas.

a month ago
(updated a month ago)

Failed to load mods: Error in assignID: item-subgroup with name 'eg-electric-distribution' does not exist.

Source: esp-foundation (item).

https://imgur.com/a/ymStbGc

With this Update it is conflickting with Stack Size mod (Silicon) https://mods.factorio.com/mod/Silicon?from=search

using version 2.0.55 :D

a month ago

Thank you, investigating now.

a month ago

Version 2.21.5 has been uploaded, it should resolve the issue.
Ugh, "eg-electric-distribution" (electric grid)... forgot which mod I was coding. :D

a month ago
(updated a month ago)

If possible it would look really NICE to have the space platform tile for the ELECTRIC TILES,

In my oppinion 1 tile for conducting electricity it is enought, we do not need all tiles to conduct electricity.
with a good script electric tiles would be placed only below the buildings and nowere else unless manually placed. what i mean by that by using FOUNDATIONS mod.

While you can use Foundations to place electric tiles under entities, it is not my recommendation. If you turn on the debug startup setting for Electric Tiles, you will see what I am referring to. I think you could run into performance issues as the base grows.
I defined the Space Platform Foundation tile specifically with this issue in mind. Placing them using the Fill tool in large square areas is my recommendation. You can then place decorative tiles on top without disturbing the electric tiles.

a month ago
(updated a month ago)

the Space platform recipe is 20 steel and 20 copper cable. (but i am building a small ship here)
the Electric Space Platform tile adds 10 Landfill on top of the Space Platform Recipe.
Space Platform (ground) is 20 steel and 20 copper cable.

a month ago
(updated a month ago)

But you get 10 Space Platform Foundation tiles. So rather than 20 steel and 20 copper per tile, it is 1 landfill + 2 steel + 2 copper.
And pretty sure there are mods to reduce the cost of landfill.

a month ago

But you get 10 Space Platform Foundation tiles. So rather than 20 steel and 20 copper per tile, it is 1 landfill + 2 steel + 2 copper.
And pretty sure there are mods to reduce the cost of landfill.

there is only 1 Electric Space Platform not 10x. https://imgur.com/a/B093erh

a month ago
(updated a month ago)

But you get 10 Space Platform Foundation tiles. So rather than 20 steel and 20 copper per tile, it is 1 landfill + 2 steel + 2 copper.
And pretty sure there are mods to reduce the cost of landfill.

there is only 1 Electric Space Platform not 10x. https://imgur.com/a/B093erh

if there was 10 i would not commented.

a month ago

Oh, oops. I intended for it to result in10 tiles. Fixing that now.

a month ago

Version 2.21.6 has been uploaded, it resets the recipe to give 10 tiles.

a month ago
(updated a month ago)

Version 2.21.6 has been uploaded, it resets the recipe to give 10 tiles.

It will be a pain to make all those landfill... 50 stone is a lot..
60 Landfill/minute = 3000 stone :))
Doable but slowly slowly because i cannot mass produce landfill.

1 electric miner + 1 stone furnance produces 3.75 steel/min.
5 electric miners + 1 Assembler produce 3 Landfill/ 1min and 2 sec

a month ago

Since it is a landfill, I do not think it should be cheaper than landfill. Maybe a mod like Configurable Landfill will work?

a month ago

did the space platform for ground (Electrified) was finished ? is it work as intended ? can i place it under buildings ?

a month ago

Yes, Space Platform Foundation (Electric) seems to be working as expected. If there are tiles under buildings, you will need to remove the tile and then place the Space Platform Foundation. That seems to an engine rule, landfills can not be placed at a position that already has a decorative tile, like concrete.

Warning, the Electric Tile recipes will be hidden. If you mine an Electric Tile, it will be converted to Space Platform Foundation.

a month ago
(updated a month ago)

Double post by mistake!!!

a month ago

I am in a new game ... so only Space platform...
Is it safe now as many buildings as i want with Space Platform under them, i mean Auto Deploy not placing manually, cause to be honest this is how i want it to be.

No speed buffs for tile as of yet ?

a month ago
(updated a month ago)

The SPF are made with the Electric Tiles mod, they will have the same performance. I suggest laying a large area with SPF, then build and add decorative tiles on top. This should help to limit the number of proxy (electric poles) and keep performance levels up. Use the Electric Tiles debug mode after you place a good amount of SPF tiles and modify a little if too many proxy are made. Placing tiles in squares of 8x8, 16x16, and 32x32, if possible, is a good practice.

For the speed buffs? I suppose so. There are two settings, walking speed modifier and vehicle friction modifier. 1 is the default value.
What do you think would be good values?

a month ago

A little note: even if two kind of electric tiles are placed in the same position (normal + foundation), the mod only considers the fact that, in THAT position, an electric tile, of any kind, exist, so the mod electrifies that position. Extra proxies aren't created.

And yes, building in squares is the best method, as the mod will create less proxies.

a month ago
(updated a month ago)

A little note: even if two kind of electric tiles are placed in the same position (normal + foundation), the mod only considers the fact that, in THAT position, an electric tile, of any kind, exist, so the mod electrifies that position. Extra proxies aren't created.

Ah, this I did not realize. So adding electric tiles on top of electric foundation does not duplicate proxies. Maybe needlessly expensive but not troublesome. This is good to know. I removed the electric tile recipes mistakenly thinking this would be an issue. I should have tested.

a month ago

now me for instance i wont bother to build in square like you guys suggest :))
I have my electrified tiles under buildings or powered by power poles .. square building makes my job harder.

a month ago

@Factory077
Version 2.22.2 restores the Electric Tiles recipes, since there is no harm in using multiple electric tiles.

a month ago

Nice

New response