Lower the minimum distance of push-back effect?

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
Post Reply
User avatar
Mooncat
Smart Inserter
Smart Inserter
Posts: 1175
Joined: Wed May 18, 2016 4:55 pm
Contact:

Lower the minimum distance of push-back effect?

Post by Mooncat »

Request: please make the new "push-back" effect to accept distances lower than 0.3, and lower its actual effective distance from 1 to the input value.

During my approach to make a proper push back effect for the discharge defense equipment by dividing the effect into multiple frames, I found out that the new "push-back" effect does not accept values lower than 0.3. No error was thrown, but it didn't do anything. Even if I input 0.3, the actual push back distance seems to be 1.

If this request is implemented, I can make a proper push back effect. :) (I would call the current effect as teleportation.)
My mods (Deprecated, maybe temporary... idk. Currently time/mood to continue):

User avatar
Ranakastrasz
Smart Inserter
Smart Inserter
Posts: 2070
Joined: Thu Jun 12, 2014 3:05 am
Contact:

Re: Lower the minimum distance of push-back effect?

Post by Ranakastrasz »

Absolutely do need this. Allowing sliding effects would be great.
My Mods:
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16

Rseding91
Factorio Staff
Factorio Staff
Posts: 10995
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Lower the minimum distance of push-back effect?

Post by Rseding91 »

The distance isn't limited to any particular value code wise. It does however not work if you try to move the entity by less than half its bounding box size because it can't find a place that doesn't collide with itself and can't move the entity.
If you want to get ahold of me I'm almost always on Discord.

User avatar
Ranakastrasz
Smart Inserter
Smart Inserter
Posts: 2070
Joined: Thu Jun 12, 2014 3:05 am
Contact:

Re: Lower the minimum distance of push-back effect?

Post by Ranakastrasz »

Ah. In that case, when a push effect occurs, ignore the entities own bounding box for checking.
My Mods:
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16

User avatar
Mooncat
Smart Inserter
Smart Inserter
Posts: 1175
Joined: Wed May 18, 2016 4:55 pm
Contact:

Re: Lower the minimum distance of push-back effect?

Post by Mooncat »

Rseding91 wrote:The distance isn't limited to any particular value code wise. It does however not work if you try to move the entity by less than half its bounding box size because it can't find a place that doesn't collide with itself and can't move the entity.
I think it can (partially) explain why this thing occurs:

All targets are pushed to the same direction when I set distance = 0. Looks like a bug.

Yes, as Ranakastrasz said, each target should ignore itself when being pushed. :)
My mods (Deprecated, maybe temporary... idk. Currently time/mood to continue):

User avatar
Ranakastrasz
Smart Inserter
Smart Inserter
Posts: 2070
Joined: Thu Jun 12, 2014 3:05 am
Contact:

Re: Lower the minimum distance of push-back effect?

Post by Ranakastrasz »

Huh. If the distance was zero, I would expect it to go due east, due to the whole Atan2 thinggy. Always happened when I messed with Angles.
My Mods:
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16

User avatar
Mooncat
Smart Inserter
Smart Inserter
Posts: 1175
Joined: Wed May 18, 2016 4:55 pm
Contact:

Re: Lower the minimum distance of push-back effect?

Post by Mooncat »

You can't expect how the aliens behave. :P
Yea, I tried a few more times. The direction is the same.
My mods (Deprecated, maybe temporary... idk. Currently time/mood to continue):

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

Re: Lower the minimum distance of push-back effect?

Post by posila »

Hack tip ... you can teleport biters back and give them sticker with negative movement modifier. So when they try to run back toward you, they will actually move backwards :D

User avatar
Mooncat
Smart Inserter
Smart Inserter
Posts: 1175
Joined: Wed May 18, 2016 4:55 pm
Contact:

Re: Lower the minimum distance of push-back effect?

Post by Mooncat »

posila wrote:Hack tip ... you can teleport biters back and give them sticker with negative movement modifier. So when they try to run back toward you, they will actually move backwards :D
lol! Didn't think of it.
But I think it is not very effective on spitters? Since they don't need to move before spitting on you. :lol:
My mods (Deprecated, maybe temporary... idk. Currently time/mood to continue):

User avatar
Ranakastrasz
Smart Inserter
Smart Inserter
Posts: 2070
Joined: Thu Jun 12, 2014 3:05 am
Contact:

Re: Lower the minimum distance of push-back effect?

Post by Ranakastrasz »

Do those speed modification debuffs stack? If so, do they add or multiply? can you end up with negative speed if they add?
My Mods:
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16

User avatar
Mooncat
Smart Inserter
Smart Inserter
Posts: 1175
Joined: Wed May 18, 2016 4:55 pm
Contact:

Re: Lower the minimum distance of push-back effect?

Post by Mooncat »

Ranakastrasz wrote:Do those speed modification debuffs stack? If so, do they add or multiply? can you end up with negative speed if they add?
Based on my Supportive Weapons mod (pending update for 0.15), 2 different stickers with slow down effect can definitely make the enemies move slower than just one sticker. I think they multiply. Addition will easily produce negative movement speed, but I didn't see that happen in my mod.
My mods (Deprecated, maybe temporary... idk. Currently time/mood to continue):

User avatar
Ranakastrasz
Smart Inserter
Smart Inserter
Posts: 2070
Joined: Thu Jun 12, 2014 3:05 am
Contact:

Re: Lower the minimum distance of push-back effect?

Post by Ranakastrasz »

Mooncat wrote:
Ranakastrasz wrote:Do those speed modification debuffs stack? If so, do they add or multiply? can you end up with negative speed if they add?
Based on my Supportive Weapons mod (pending update for 0.15), 2 different stickers with slow down effect can definitely make the enemies move slower than just one sticker. I think they multiply. Addition will easily produce negative movement speed, but I didn't see that happen in my mod.
Thing is, addition for modules could easily result in negative energy consumption if you stack 3 50% effectively modules. Instead, it caps at 20%. Just beccause it uses addition doesn't preclude a cap.
My Mods:
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16

User avatar
Mooncat
Smart Inserter
Smart Inserter
Posts: 1175
Joined: Wed May 18, 2016 4:55 pm
Contact:

Re: Lower the minimum distance of push-back effect?

Post by Mooncat »

Ranakastrasz wrote:
Mooncat wrote:
Ranakastrasz wrote:Do those speed modification debuffs stack? If so, do they add or multiply? can you end up with negative speed if they add?
Based on my Supportive Weapons mod (pending update for 0.15), 2 different stickers with slow down effect can definitely make the enemies move slower than just one sticker. I think they multiply. Addition will easily produce negative movement speed, but I didn't see that happen in my mod.
Thing is, addition for modules could easily result in negative energy consumption if you stack 3 50% effectively modules. Instead, it caps at 20%. Just beccause it uses addition doesn't preclude a cap.
But posila said that there is no cap on movement speed effect from stickers.
Anyway, I did a small test: I changed the "target_movement_modifier" of "slowdown-sticker" to 2, and that of "stun-sticker" to -0.2

I bet the equation is something like

Code: Select all

local final_velocity = base_speed
for _, sticker in pairs(stickers) do
    final_velocity = final_velocity * sticker.target_movement_modifier
end
return final_velocity
My mods (Deprecated, maybe temporary... idk. Currently time/mood to continue):

User avatar
Ranakastrasz
Smart Inserter
Smart Inserter
Posts: 2070
Joined: Thu Jun 12, 2014 3:05 am
Contact:

Re: Lower the minimum distance of push-back effect?

Post by Ranakastrasz »

Ok, test this.
2x speed tag.
-1x tag
See if they move at double speed, normal speed backwards, and double speed backwarda
My Mods:
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16

User avatar
Mooncat
Smart Inserter
Smart Inserter
Posts: 1175
Joined: Wed May 18, 2016 4:55 pm
Contact:

Re: Lower the minimum distance of push-back effect?

Post by Mooncat »

Ranakastrasz wrote:Ok, test this.
2x speed tag.
-1x tag
See if they move at double speed, normal speed backwards, and double speed backwarda
Actually you can test it yourself. :P
Image
My mods (Deprecated, maybe temporary... idk. Currently time/mood to continue):

Post Reply

Return to “Modding interface requests”

Who is online

Users browsing this forum: No registered users