Page 1 of 1

[1.1.76] Modded - Renders invalid textures and crashes on shutdown

Posted: Tue Apr 04, 2023 5:00 am
by raspberrypuppies
I'm using a fire entity prototype with multiple layers for the picture. One layer is a standard animation, the other two are a single frame from a different animation repeated. The the animations with the repeated frame seems to render unallocated textures/random stuff in the atlas.

layer #1, a single frame from a large texture, repeated using the frame_sequence property
layer #2, a texture 8 frames wide, all of them rendered
layer #3, a single frame from a large texture, repeated using the frame_sequence property

(the blue is not supposed to be there. It changes based on what textures are loaded. One time it was part of a gun turret, another time part of a biter.

And the game crashes when I quit...


I'm unable to upload it right now due to some internet issues. I'll post a follow up with the mod and save.

Re: [1.1.76] Modded - Renders invalid textures and crashes on shutdown

Posted: Tue Apr 04, 2023 5:03 am
by raspberrypuppies
I keep getting "HTTP ERROR" when uploading attachments.

Here's a link to download the mod, save game, and logs

https://drive.google.com/drive/folders/ ... sp=sharing

Re: [1.1.76] Modded - Renders invalid textures and crashes on shutdown

Posted: Tue Apr 04, 2023 8:03 am
by posila
Thanks for the report. I have not looked into it yet, but I would suggest you don't set "dice = 8" (or use sprite dicing at all) on fairly small sprites (I think 210x224 px in high res is not large sprite). Dicing is for better packing of large sprites into sprite atlases and for improving efficiency of sprite cropping (e.g. when the sprite is like rectangle rotated 45 degrees). For small sprites and large "dice" value, it won't help that much with packing and probably will end up taking up more space in the atlases due to padding of each individual piece in the atlas and it multiplies number of quads being drawn.

I bet the invalid rendering is related to drawing diced sprite.

Re: [1.1.76] Modded - Renders invalid textures and crashes on shutdown

Posted: Tue Apr 04, 2023 6:08 pm
by raspberrypuppies
Oh, I thought dice meant pick a random sprite, not slice a sprite. I'll check what it does with that turned off this evening.

Can you update the prototype docs to say that? There's no comments at all about what dice does.

https://wiki.factorio.com/Types/Animation#dice_x

Re: [1.1.76] Modded - Renders invalid textures and crashes on shutdown

Posted: Wed Apr 05, 2023 2:13 am
by raspberrypuppies
the "dice" property was definitely the worst offender. Turning that off stopped the crashes and most of the graphics glitches.

After I removed that, I tried testing each layer individually and then tried turning them on in different permutations. I was able to find one where textures still seemed to leak.

Having the layers in the order of [shadow, opaque, glow] causes glitches while [opaque, glow, shadow] does not.

Screenshot and modified script attached. (I'm sorry the screenshot is so low resolution, my internet is being annoying).