What does Sprite.priority do?

Place to get help with not working mods / modding interface.
Post Reply
User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3700
Joined: Tue May 13, 2014 11:06 am
Contact:

What does Sprite.priority do?

Post by DaveMcW »

What does Sprite.priority do? https://wiki.factorio.com/Types/Sprite#priority

The description is rather unclear.

User avatar
steinio
Smart Inserter
Smart Inserter
Posts: 2633
Joined: Sat Mar 12, 2016 4:19 pm
Contact:

Re: What does Sprite.priority do?

Post by steinio »

Yeah description should be: Sets the priority of the sprite.
Image

Transport Belt Repair Man

View unread Posts

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5206
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: What does Sprite.priority do?

Post by eradicator »

As far as i know it sets the caching priority of a sprite. I.e. when you set a sprite to low-priority and run out of VRAM it'll be amongst the first that gets moved out of VRAM to make room for higher priority sprites. Which is for example why everything gui related is extra-high to keep the gui responsive.
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

posila
Factorio Staff
Factorio Staff
Posts: 5202
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

Re: What does Sprite.priority do?

Post by posila »

It's too late for me, I don't want to write it up, but I still wanted to respond ... eradicator is close.
It is more explained in the beginning of https://www.factorio.com/blog/post/fff-264

In the not so distant future, "Video memory usage" should be replaced by "Video memory budget" and sprite priority will determine probability of a sprite being permanently resident in a sprite atlas in VRAM and rest, that's over the buget, will be streamed.

Post Reply

Return to “Modding help”