Range Research

Things that we aren't going to implement
User avatar
Deadly-Bagel
Smart Inserter
Smart Inserter
Posts: 1498
Joined: Wed Jul 13, 2016 10:12 am
Contact:

Range Research

Post by Deadly-Bagel »

A little while ago I wrote a small mod to rework much of the combat to be a bit less straightforward, and one of the things I really wanted to do was implement a research to increase the range of the rocket launcher. The problem with damage research is the shells start at say 3 shells to kill a spawner, but you need several levels in damage to get that down to 2 shells and until then you don't see any return on the investment. Shifting the power scale from damage to range just makes more sense for any high-power weapon.

I also found this mod that adds research to increase the range of laser towers:
As you cannot actually modify an entities range this mod creates a new entity for each range level of the turret. A script updates turrets when they are built. Another script updates turrets when research is complete. There can be spike lag when finishing research in very large bases as it checks and updates large amounts of entities. For convenience the turret will revert back to the normal appearing ITEM when it is picked up but will change back to the current level when placed.
I was quite excited with the Artillery Cannon being added with its range research, unfortunately it is specific to the Artillery Cannon. It would be really awesome if we could do this for weapons and turrets too.

Ideally we could create some kind of research variable and then apply that wherever we want, increase Flamethrower's fire count / ammo consumption, add pellets to Shotgun Shells, etc, it would be a lot more flexible and intuitive though I would be happy just for range research so we can at least cover the three basics of any weapon.
Money might be the root of all evil, but ignorance is the heart.
User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2905
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: Range Research

Post by darkfrei »

So, have ability to make technologies for all game.force RW variables?
http://lua-api.factorio.com/latest/LuaForce.html
Rseding91
Factorio Staff
Factorio Staff
Posts: 14345
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Range Research

Post by Rseding91 »

Artillery turrets are special in that they can change their targeting range and not need any special treatment to make it work.

Changing the range of any other turret in the game simply isn't possible due to how chunk activation logic works.
If you want to get ahold of me I'm almost always on Discord.
User avatar
Ranakastrasz
Smart Inserter
Smart Inserter
Posts: 2173
Joined: Thu Jun 12, 2014 3:05 am
Contact:

Re: Range Research

Post by Ranakastrasz »

Could that be elaborated on?
Is there an upper limit to effective range because they don't scan paused chunks, and as such if range gets high enough, it will run into said paused chunks and not have full range?

Or what exactly? I mean, I can see why infinite range upgrades might be an issue, and we all know the second it is possible someone will add infinite range upgrades, but just because someone will, and then complain that their 9000 range turret isn't firing at max range, doesn't mean that it shouldn't be added.
My Mods:
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16
Rseding91
Factorio Staff
Factorio Staff
Posts: 14345
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Range Research

Post by Rseding91 »

Ranakastrasz wrote:Could that be elaborated on?
Is there an upper limit to effective range because they don't scan paused chunks, and as such if range gets high enough, it will run into said paused chunks and not have full range?

Or what exactly? I mean, I can see why infinite range upgrades might be an issue, and we all know the second it is possible someone will add infinite range upgrades, but just because someone will, and then complain that their 9000 range turret isn't firing at max range, doesn't mean that it shouldn't be added.
When the game starts it iterates all of the turrets that can shoot and records the maximum distance in chunks. When an entity with force is built or placed in the world it activates all of the chunks around it using that radius so when a biter walks into your turret wall it wakes up the turrets and they shoot at it.

So, instead of having your turrets always active they're only active when there's something in range for them to shoot at.

Changing that maximum range means every entity with force on the map has to re-activate chunks around it which isn't going to happen.
If you want to get ahold of me I'm almost always on Discord.
User avatar
Ranakastrasz
Smart Inserter
Smart Inserter
Posts: 2173
Joined: Thu Jun 12, 2014 3:05 am
Contact:

Re: Range Research

Post by Ranakastrasz »

Rseding91 wrote:
When the game starts it iterates all of the turrets that can shoot and records the maximum distance in chunks. When an entity with force is built or placed in the world it activates all of the chunks around it using that radius so when a biter walks into your turret wall it wakes up the turrets and they shoot at it.

So, instead of having your turrets always active they're only active when there's something in range for them to shoot at.

Changing that maximum range means every entity with force on the map has to re-activate chunks around it which isn't going to happen.
Ah, so the chunks, when an enemy enters it, it tells the turret to start scanning for a target.
And the reason you can't re-run that logic is? Is it really expensive? I suppose it would be O(n^2) maybe. N entities, and then N for how many chunks to check.

I just can't see why the logic is only possible in those two situations. I mean, given it already has to run again each time you build a turret, and we have mods already that have turrets replaced with longer ranged turrets - which works fine, I am not seeing the reason this is infeasible.
My Mods:
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16
BlakeMW
Filter Inserter
Filter Inserter
Posts: 954
Joined: Thu Jan 21, 2016 9:29 am
Contact:

Re: Range Research

Post by BlakeMW »

Rseding91 wrote: Changing that maximum range means every entity with force on the map has to re-activate chunks around it which isn't going to happen.
What if the chunk activation range were precalculated based on the maximum possible range for the turret (with all upgrades), but the turret can only actually fire at its current maximum range, this would be a little inefficient before the upgrades are researched because the game would needlessly activate chunks but would be inconsequential in the long run once the upgrades are actually researched.
User avatar
Ranakastrasz
Smart Inserter
Smart Inserter
Posts: 2173
Joined: Thu Jun 12, 2014 3:05 am
Contact:

Re: Range Research

Post by Ranakastrasz »

BlakeMW wrote:
Rseding91 wrote: Changing that maximum range means every entity with force on the map has to re-activate chunks around it which isn't going to happen.
What if the chunk activation range were precalculated based on the maximum possible range for the turret (with all upgrades), but the turret can only actually fire at its current maximum range, this would be a little inefficient before the upgrades are researched because the game would needlessly activate chunks but would be inconsequential in the long run once the upgrades are actually researched.
Except for the people who are all for infinite range upgrades.

Recalculating them, even as a rolling update (X turrets/tick until all of em are done) would also work fine IMO.

I mean, unless you have more than like 500 turrets. In which case it would take around 10 seconds to finish.
My Mods:
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16
User avatar
Deadly-Bagel
Smart Inserter
Smart Inserter
Posts: 1498
Joined: Wed Jul 13, 2016 10:12 am
Contact:

Re: Range Research

Post by Deadly-Bagel »

Ranakastrasz wrote:Except for the people who are all for infinite range upgrades.
I don't think that's so much the problem as it is for the potential for infinite research... I don't think the system is set up in a way to disallow infinite research for this specifically.

Still, is there no way we could have this at least for personal weapons...? They're a manual trigger and there's rarely a large number of them in the game.
Money might be the root of all evil, but ignorance is the heart.
BlakeMW
Filter Inserter
Filter Inserter
Posts: 954
Joined: Thu Jan 21, 2016 9:29 am
Contact:

Re: Range Research

Post by BlakeMW »

Deadly-Bagel wrote:
Ranakastrasz wrote:Except for the people who are all for infinite range upgrades.
I don't think that's so much the problem as it is for the potential for infinite research... I don't think the system is set up in a way to disallow infinite research for this specifically.
It makes sense to cap the max activation range anyway. Look at it this way: someone could make a turret right now with a quadzillion range and who knows what it would do when placed.
Post Reply

Return to “Won't implement”