Data container for each chunk of tiles.

Things that we aren't going to implement
Post Reply
yagaodirac
Fast Inserter
Fast Inserter
Posts: 152
Joined: Sun Jun 16, 2019 4:04 pm
Contact:

Data container for each chunk of tiles.

Post by yagaodirac »

Now I have to maintain a table to save all the extra info for each tiles in lua.
In the on_chunk_generated, I added the new chunk to the container. Inside the container, I wrote a container like table. In this way, I can easily iterate all the existing tiles of a surface.
The code is like
container = {}
container[chunk_x][chunk_y][in_chunk_x+32* in_chunk_y]
This is clear and actually works. But array in lua is slow. If staff would like to make some container in cpp and register into lua, we could keep track of water level, temperature, humidity, or any customized info for each tile. And it should be way faster than what I've done.

Koub
Global Moderator
Global Moderator
Posts: 7203
Joined: Fri May 30, 2014 8:54 am
Contact:

Re: Data container for each chunk of tiles.

Post by Koub »

[Koub] Moved to modding interface requests.
Koub - Please consider English is not my native language.

User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 2250
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

Re: Data container for each chunk of tiles.

Post by boskid »

No.

Post Reply

Return to “Won't implement”