Limit to entity size?

Place to get help with not working mods / modding interface.
Post Reply
Pi-C
Smart Inserter
Smart Inserter
Posts: 1654
Joined: Sun Oct 14, 2018 8:13 am
Contact:

Limit to entity size?

Post by Pi-C »

Is there a hard limit to the size an entity may have? I've been thinking about making a garden that takes up a complete chunk (see here, towards the end of the post) that would only produce a huge negative amount of pollution so that it would suck up all pollution drifting in from adjoining chunks. The idea was to buy a bit of security by placing an entity that considerably inhibits the pollution spread, but making that entity very expensive and letting it take up a lot of space where nothing else can be built. Would such a huge entity even be possible? Would it be a UPS hog?
A good mod deserves a good changelog. Here's a tutorial (WIP) about Factorio's way too strict changelog syntax!

PFQNiet
Filter Inserter
Filter Inserter
Posts: 289
Joined: Sat Sep 05, 2020 7:48 pm
Contact:

Re: Limit to entity size?

Post by PFQNiet »

I don't know about an upper limit but I have a very large entity in my mod - 27x27 - and it works just fine. I imagine the biggest concern would be the graphics.

Pi-C
Smart Inserter
Smart Inserter
Posts: 1654
Joined: Sun Oct 14, 2018 8:13 am
Contact:

Re: Limit to entity size?

Post by Pi-C »

PFQNiet wrote:
Tue Jan 26, 2021 2:22 am
I don't know about an upper limit but I have a very large entity in my mod - 27x27 - and it works just fine.
OK, 27x27 isn't a complete chunk, but close enough, so I guess that could work. :-)
I imagine the biggest concern would be the graphics.
Fortunately, I don't have to make the graphics at all! My biggest concern was that it may not be practical -- better ask than wasting time on something that's guaranteed to fail.
A good mod deserves a good changelog. Here's a tutorial (WIP) about Factorio's way too strict changelog syntax!

PFQNiet
Filter Inserter
Filter Inserter
Posts: 289
Joined: Sat Sep 05, 2020 7:48 pm
Contact:

Re: Limit to entity size?

Post by PFQNiet »

I figured the anecdotal evidence would help - I'm actually curious now how big you can make an entity before something breaks...

One thing I have noticed that's quite clever is that your build range is based on distance to the edge of the entity you're placing, so by default you can place my 27x27 entity up to 37 tiles away from you. Very handy!

(Although it doesn't handle rectangles well - a hypothetical 1x100 entity would be very difficult to place when rotated 90deg because it uses the prototype rectangle and not the rotated one... hmm... to the bugs forum!)

Pi-C
Smart Inserter
Smart Inserter
Posts: 1654
Joined: Sun Oct 14, 2018 8:13 am
Contact:

Re: Limit to entity size?

Post by Pi-C »

PFQNiet wrote:
Tue Jan 26, 2021 5:30 am
I figured the anecdotal evidence would help - I'm actually curious now how big you can make an entity before something breaks...
I remember there used to be a lot of bug reports of inserters not working as expected if they were on the very edge of one chunk and trying to take from/put into the other. I wonder if that could become an issue. Also, with assemblers adding to the amount of pollution of the chunk they're placed in, would that apply to just one chunk (presumably the one where the center of the entity is located?), or would it apply to all chunks that are covered by part of the entity? Guess I'll have to play around a bit with some pseudo entity to check that out. :-)
One thing I have noticed that's quite clever is that your build range is based on distance to the edge of the entity you're placing, so by default you can place my 27x27 entity up to 37 tiles away from you. Very handy!
I wouldn't have expected that!
(Although it doesn't handle rectangles well - a hypothetical 1x100 entity would be very difficult to place when rotated 90deg because it uses the prototype rectangle and not the rotated one... hmm... to the bugs forum!)
:-)
A good mod deserves a good changelog. Here's a tutorial (WIP) about Factorio's way too strict changelog syntax!

ss_Baum
Long Handed Inserter
Long Handed Inserter
Posts: 58
Joined: Wed Apr 04, 2018 10:58 am
Contact:

Re: Limit to entity size?

Post by ss_Baum »

I read something about a limit for the sprite picture size. So at some point there could be the problem, that the entity looks bad. But I think it was about 8192 px ore something like this.

https://wiki.factorio.com/Types/Sprite#size the point size.

Pi-C
Smart Inserter
Smart Inserter
Posts: 1654
Joined: Sun Oct 14, 2018 8:13 am
Contact:

Re: Limit to entity size?

Post by Pi-C »

ss_Baum wrote:
Tue Jan 26, 2021 9:29 am
I read something about a limit for the sprite picture size. So at some point there could be the problem, that the entity looks bad. But I think it was about 8192 px ore something like this.
Thanks for the link! So there is a limit, but it's probably high enough not to make any problems. I mean, I want a huge entity, but it should still fit on a screen if you zoom out. :mrgreen:
A good mod deserves a good changelog. Here's a tutorial (WIP) about Factorio's way too strict changelog syntax!

ss_Baum
Long Handed Inserter
Long Handed Inserter
Posts: 58
Joined: Wed Apr 04, 2018 10:58 am
Contact:

Re: Limit to entity size?

Post by ss_Baum »

Of course, but you maybe have to think about the animations. I am not sure because I never created one. I am still in the learning phase. But If I understood it right, the animation pictures are all in one spreadsheet. So this could mean less animations eq more resolution. So if you want to have 32 pictures, you would have to devide the 8192 by 32 and that would make a max res of 256 per frame.

User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2528
Joined: Fri Nov 06, 2015 7:41 pm

Re: Limit to entity size?

Post by Deadlock989 »

ss_Baum wrote:
Tue Jan 26, 2021 11:41 am
Of course, but you maybe have to think about the animations. I am not sure because I never created one. I am still in the learning phase. But If I understood it right, the animation pictures are all in one spreadsheet. So this could mean less animations eq more resolution. So if you want to have 32 pictures, you would have to devide the 8192 by 32 and that would make a max res of 256 per frame.
That given size limit of 8192 for width and height is per frame, not necessarily a limit on the whole sprite sheet - in early versions of Factorio sheets were limited to 2048x2048 but that was increased later (I don't know what to, but I have a sheet that exceeds 4096 in one direction). Even if the sheet limit is 8192x8192, what you say here is only true for 1 row of 32 frames, e.g. a 256x8192 sheet. A sheet of size 8192x8192 could fit 32x32 frames of 256x256 each, which would be 1024 frames in total.

You can also set up animations to use multiple sheets (i.e. separate sprite files) in some situations, most usually for entities that have directions such as vehicles or turrets (see stripes).

For large/long animations you can also (and should be trying to) break the moving parts out from any static background and use layered compositions, so that the moving animated parts have a much smaller frame size. For some literally chunk-sized animated entity this probably would be essential. Even for non-animated compositions you can break static frames up into layers and compose them to resemble a larger image.
Image

Post Reply

Return to “Modding help”