Page 1 of 1

Allow filtered inserters to have more than 5 filters

Posted: Sat Jan 07, 2017 10:01 pm
by bigyihsuan
I attempted to increase the number of filter slots from 5 to 10 today and got an error saying that the limit to filters on a filter inserter is 5.

You should be able to set the filter count of a filter inserter to any positive integer.

Re: Allow filtered inserters to have more than 5 filters

Posted: Sat Jan 07, 2017 10:04 pm
by Rseding91
We store the filters as an array (compile time size) which is why you can't have more than 5.

It's done this way for performance reasons.

Re: Allow filtered inserters to have more than 5 filters

Posted: Mon Jan 09, 2017 9:39 pm
by darkfrei
Rseding91 wrote:We store the filters as an array (compile time size) which is why you can't have more than 5.

It's done this way for performance reasons.
And negative filter? It takes all, but not the specified.

Re: Allow filtered inserters to have more than 5 filters

Posted: Tue Jan 10, 2017 2:29 am
by bigyihsuan
darkfrei wrote:
Rseding91 wrote:We store the filters as an array (compile time size) which is why you can't have more than 5.

It's done this way for performance reasons.
And negative filter? It takes all, but not the specified.
Honestly, it would be best for all integers to be accepted for filter count, with negatives being a blacklist, like you say.

Re: Allow filtered inserters to have more than 5 filters

Posted: Tue Jan 10, 2017 2:59 am
by Rseding91
bigyihsuan wrote:
darkfrei wrote:
Rseding91 wrote:We store the filters as an array (compile time size) which is why you can't have more than 5.

It's done this way for performance reasons.
And negative filter? It takes all, but not the specified.
Honestly, it would be best for all integers to be accepted for filter count, with negatives being a blacklist, like you say.
No. Making it a compile time max size gives a massive performance improvement because the memory doesn't need to be dynamically allocated and dereferenced every time the inserter checks the filter.