Limit percent by short integer max

Place to post guides, observations, things related to modding that are not mods themselves.
Post Reply
Helfima
Fast Inserter
Fast Inserter
Posts: 199
Joined: Tue Jun 28, 2016 11:40 am
Contact:

Limit percent by short integer max

Post by Helfima »

I want to know if it is a limitation when percent of crafting speed modifier exced 32767 because the value stored in a short integer

in Pyanodons AlienLife we can put 27 modules with speed bonus of 1500% that do 40500% but the factory limited at +32767%
cap_percent.png
cap_percent.png (320.18 KiB) Viewed 1098 times

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

Re: Limit percent by short integer max

Post by Deadlock989 »

Search is your friend. viewtopic.php?p=361025#p361025
Image

Helfima
Fast Inserter
Fast Inserter
Posts: 199
Joined: Tue Jun 28, 2016 11:40 am
Contact:

Re: Limit percent by short integer max

Post by Helfima »

I searched!
it's not a problem with productivity there are 0% of productivity
it's not a problem with 1 cycle per tick

information on recipe:
energy recipe=80
crafting speed=0.02
crafting speed modified=0.02*405=8.13
crafting speed limit per tick=80x60=4800

coincidence short interger max=32 767 and this cap 32 767%!
Last edited by Helfima on Mon Mar 16, 2020 10:56 am, edited 1 time in total.

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

Re: Limit percent by short integer max

Post by Deadlock989 »

It's not a problem, period. The engine was never intended to have recipes that only make sense when their speed is boosted by 40000% or more. The designers most likely capped those values at a 16 bit signed int because anything beyond that is foolishness and anything below that is better for performance.
Image

Post Reply

Return to “Modding discussion”