Framework for connecting two values by reference

Things that we aren't going to implement
Post Reply
sparr
Smart Inserter
Smart Inserter
Posts: 1330
Joined: Fri Feb 14, 2014 5:52 pm
Contact:

Framework for connecting two values by reference

Post by sparr »

I want entity X to always have the same position as entity Y. Doing this in onTick is not very efficient. I would love to have a way to register with the API the fact that one of those values should always mirror the other, and have it handle that behind the scenes.

Rseding91
Factorio Staff
Factorio Staff
Posts: 13232
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Framework for connecting two values by reference

Post by Rseding91 »

That's an extremely specific thing to make part of the games code.

Doing it on-tick is exactly what the game would do so doing it on-tick through a mod is almost the same cost.
If you want to get ahold of me I'm almost always on Discord.

sparr
Smart Inserter
Smart Inserter
Posts: 1330
Joined: Fri Feb 14, 2014 5:52 pm
Contact:

Re: Framework for connecting two values by reference

Post by sparr »

I would not want it to be just for entity positions. I would want it to be for any two values.

Two surfaces always having the same time-of-day.

Two inserters always having the same drop position.

Two train engines always having the same color.

Two players always having the same running speed modifier.

etc.

Doing this in C, in a single loop that covers every such request, should be much much faster than every mod needing an onTick handler with separate lua code to do it.

Post Reply

Return to “Won't implement”