Page 1 of 1

[Rseding91] [15.35] Large entities won't draw correctly on map

Posted: Mon Oct 09, 2017 5:28 pm
by Atria
I know this is probably in territory "just don't do it and you will be fine" but I made huge 100x100 entity but when I place it into world the map doesn't show it correctly. The map shows only some wierd corners of my entity. LINK

Also it froze the game for a couple of seconds when I placed it but that is reasonable...

Re: [15.35] Large entities won't draw correctly on map

Posted: Tue Oct 10, 2017 10:05 pm
by eradicator
I recommend you post the zip of your mod. And maybe the entity definition directly. Does this reproduce on every map? Does your entity have a very large number of inventory slots?

Re: [15.35] Large entities won't draw correctly on map

Posted: Wed Oct 11, 2017 3:20 pm
by Atria
eradicator wrote:I recommend you post the zip of your mod. And maybe the entity definition directly. Does this reproduce on every map? Does your entity have a very large number of inventory slots?
Here is the mod. I stripped to bare bone state. Entity is 100x100 chest with 20 inventory slots, so basicly biggest place waster. And I tested it on 4 different maps and it happened in all of them (it's pretty hard to find a spot for it in sandbox mode).

Re: [Rseding91] [15.35] Large entities won't draw correctly on map

Posted: Thu Oct 12, 2017 4:01 am
by Rseding91
Thanks for the report. I actually found a few bugs in the game with that mod :P
  • Large entities wouldn't draw correctly on the map
  • Curved rails could sometimes not draw correctly on the map
  • Large numbers of nested sprite layers would overflow the stack during creation, rendering, and destruction.
All of the issues are fixed for 0.16.

Re: [Rseding91] [15.35] Large entities won't draw correctly on map

Posted: Thu Oct 12, 2017 5:38 am
by Atria
Thanks a lot Rseding.

I also noticed that if I use sprite layers in prototypes the game always rebuilds sprite cache when starting the game. I dynamicly generate sprite layers but these don't change between game restarts and it still rebuilds cache.

Can be something done about that?

Re: [Rseding91] [15.35] Large entities won't draw correctly on map

Posted: Thu Oct 12, 2017 6:28 am
by Rseding91
Atria wrote:Thanks a lot Rseding.

I also noticed that if I use sprite layers in prototypes the game always rebuilds sprite cache when starting the game. I dynamicly generate sprite layers but these don't change between game restarts and it still rebuilds cache.

Can be something done about that?
Does it happen with the example mod for you? The example mod you provided works just fine for me - in fact it didn't even rebuild the cache when I installed/removed the mod.

Re: [Rseding91] [15.35] Large entities won't draw correctly on map

Posted: Thu Oct 12, 2017 6:39 am
by Atria
Rseding91 wrote:
Atria wrote:Thanks a lot Rseding.

I also noticed that if I use sprite layers in prototypes the game always rebuilds sprite cache when starting the game. I dynamicly generate sprite layers but these don't change between game restarts and it still rebuilds cache.

Can be something done about that?
Does it happen with the example mod for you? The example mod you provided works just fine for me - in fact it didn't even rebuild the cache when I installed/removed the mod.
I don't know it factorio rebuilt cache. I'm just used to factorio starting quickly and when I was using my entire mod it seemed to take a while longer than usual. I will try it with stripped down mod I provided and entire mod once I get home and report back. Is there definete way to figure out if cache was rebuild? Other than eyeballing loading time?

And is there some not obvious downside to using these large layered sprites? I expected (and experienced) some performance drop when placing the entity but I'm curious if multiple already placed entities will be massive UPS/FPS drag?

Re: [Rseding91] [15.35] Large entities won't draw correctly on map

Posted: Thu Oct 12, 2017 2:37 pm
by Atria
My bad, it loads exactly the same time.

Re: [Rseding91] [15.35] Large entities won't draw correctly on map

Posted: Thu Oct 12, 2017 3:28 pm
by Rseding91
In 0.15 and previous layered rendering is done through recursion so you can pay a small performance hit when it goes to render it. In 0.16 it would be the same performance cost as rendering N number of normal entities as 1 entity with N layers. Maybe even slightly faster because it doesn't have to go touch N entities. But reducing N will always give better render performance as it's less sprites to draw.