Page 1 of 1

[RW] Assembler crafting speed

Posted: Sat Jul 29, 2017 10:56 pm
by Reika
A way to change the crafting speed of an assembling-machine-type entity dynamically (for example, as in my case, a borehole driller that takes longer the deeper the hole) without hacks like on_tick setting the crafting progress (which cannot easily achieve the effect of an overall multiplier).

Given that brownouts slow assemblers, I imagine this to be possible without significant rewrite.

Re: [RW] Assembler crafting speed

Posted: Wed Aug 16, 2017 10:27 am
by darkfrei
All assemblers can be slowed with low power, why not with property too?
real_speed = base_speed * power[0…1 (from 0 - no power, to 1 - full powered)] * custom_speed_property_1[0…1].

Re: [RW] Assembler crafting speed

Posted: Wed Aug 16, 2017 4:52 pm
by Rseding91
darkfrei wrote:All assemblers can be slowed with low power, why not with property too?
real_speed = base_speed * power[0…1 (from 0 - no power, to 1 - full powered)] * custom_speed_property_1[0…1].
As it is now the speed is a calculated property based off the prototype, the amount of power the machine has, and any speed module effects being applied.

If something can be changed runtime through a property then it needs to be included in the class file as a property (using up slightly more RAM) and included in the save file (using up more disk space).

Re: [RW] Assembler crafting speed

Posted: Wed Aug 16, 2017 4:58 pm
by orzelek
Rseding91 wrote:
darkfrei wrote:All assemblers can be slowed with low power, why not with property too?
real_speed = base_speed * power[0…1 (from 0 - no power, to 1 - full powered)] * custom_speed_property_1[0…1].
As it is now the speed is a calculated property based off the prototype, the amount of power the machine has, and any speed module effects being applied.

If something can be changed runtime through a property then it needs to be included in the class file as a property (using up slightly more RAM) and included in the save file (using up more disk space).
Not sure how much one float would add to assembling machine compared to current size.. would it matter with even 10k of these?

Is it a lot of work to make some variant of assembling machine for modders with new property thats based on base one and has only spped calculation modified?

Re: [RW] Assembler crafting speed

Posted: Wed Aug 16, 2017 5:33 pm
by darkfrei
Rseding91 wrote:As it is now the speed is a calculated property based off the prototype, the amount of power the machine has, and any speed module effects being applied.

If something can be changed runtime through a property then it needs to be included in the class file as a property (using up slightly more RAM) and included in the save file (using up more disk space).
It means, this property needs much more recources then speed modues or electric power? Is it possible to set 0.1 or 0.2 module to the machine by ste script?

Re: [RW] Assembler crafting speed

Posted: Wed Aug 16, 2017 6:36 pm
by Rseding91
orzelek wrote:Not sure how much one float would add to assembling machine compared to current size.. would it matter with even 10k of these?

Is it a lot of work to make some variant of assembling machine for modders with new property thats based on base one and has only spped calculation modified?
No one property ever ads a ton on its own. It's all of them across the entire save that makes the save file what it is. Knowing when it makes sense to add more vs. when it doesn't is what it comes down to. In this case the utility of adding it in is minimal and the negatives to adding it aren't.

Also it's not a float, it's a double (8 bytes). Every additional property on an entity increases cache misses reducing performance of that entity, increases the amount of RAM used (because memory is not allocated in exact byte amounts but rounded up) and increases the amount of data that has to end up in the save file even when there are no mods that use the property.

Re: [RW] Assembler crafting speed

Posted: Thu Aug 17, 2017 1:38 am
by BenSeidel
Why not spawn an invisible beacon under the drill and slowly place in a custom module that slows down the entity update speed (a -ve speed module)?
If you make the beacon module slot count sufficiently large (and also have multiple tiers of modules) you can cause the drill to slow down in whatever increments you require.