MOD[AE][working]: All weapons twice as fast

Distribute and discuss mods that are functional. Moderator - Grognak
sul
Posts: 121
Joined: Sat Jan 30, 2016 4:22 pm

MOD[AE][working]: All weapons twice as fast

Postby sul » Mon Feb 01, 2016 11:16 pm

EDIT: for now on see my more general post (many other features), CRAZE:
viewtopic.php?f=11&t=29027&p=99238#p99238

This little mod (my first !) decreases the recharge rate (cooldown) by two for any weapon in the game (both VANILLA and Advanced Edition).

This is mainly an experiment, it wont make the gameplay balanced as it was designed for, but can be worth a try for FTL gamers that already tried everything ;). I just finished a run with the kestrel on normal and it was doable. Any weapon (especially ions !) will now be much more valuable than any kind of defense like shields, cloaking. The ion blast for example will now have the same effect as the ion blast ii (see this table for an idea: http://ftl.wikia.com/wiki/Weapons/Tables). This affects your weapons but also the ones of the enemies.

Here is the link: https://www.dropbox.com/s/picug4v6mczkx ... 2.ftl?dl=0

Some details:
- The file is in .ftl format, to use with slipstream mod manager.
- If used with other mods that dont modify/introduce weapons, just patch this one at the end.
- If used with other mods that modify/introduce weapons, the changes may not be always effective, and will very likely glitch on new weapons with chain effect (they could stop firing or keep autofiring).
- For the vulcan the minimum recharge rate recheable is still 1.1 seconds (after 4 volleys instead of 5) to avoid a glitch.
- weapon travel speed (in space for projectiles, in rooms for beams) is unchanged.
- description of each weapons (which includes their original recharge rate sometimes) is unchanged (im lazy).
Last edited by sul on Tue Feb 02, 2016 5:42 pm, edited 5 times in total.
User avatar
Turbo_Scrooge
Posts: 47
Joined: Sat Nov 07, 2015 3:00 am

Re: MOD[AE][working]: All weapons twice as fast

Postby Turbo_Scrooge » Tue Feb 02, 2016 12:04 am

Cool!
I goof off on superluminal. If I make something cool, the I post it.
User avatar
Gencool
Posts: 409
Joined: Sun Jun 16, 2013 1:21 pm

Re: MOD[AE][working]: All weapons twice as fast

Postby Gencool » Tue Feb 02, 2016 1:05 am

Noice. Simple idea but could be fun.

One question/suggestion; I haven't looked at the code yet (using mobile) but I imagine you've replaced the value for each weapon by name, or with a search-replace code?
ImageImageImage
- Gencool (aka Puppetsquid) -- I make weird stuff
sul
Posts: 121
Joined: Sat Jan 30, 2016 4:22 pm

Re: MOD[AE][working]: All weapons twice as fast

Postby sul » Tue Feb 02, 2016 1:57 am

Gencool, I used both search-replace and names, so the changes are not systematic.

Here is how I did: I first lowered cooldown for any weapon that has integer values between 4-25. It looks like that in blueprints.xml.append:
<mod:findLike type="weaponBlueprint">
<mod:findLike type="cooldown">
<mod:selector>4</mod:selector> <!-- only works for weapons of value 4 -->
<mod:setValue>2</mod:setValue> <!-- now reduced to 2 -->
</mod:findLike>
etc for 5,6,7 up to 25
</mod:findLike>

Then for laser chain and vulcan (with chain effect) I did specific changes for them. The boost.amount had to be lowered by two consistently, and for vulcan the count is changed from 5 to 4 so the max reachable speed is 1.1 seconds instead of 0.5. I tried 0.5 seconds and the vulcan would never stop autofiring lol. Maybe the game engine checks some status (like battle end/ship destroyed) each second so it's not cool to fire at a faster rate.
<mod:findName type="weaponBlueprint" name="LASER_CHAINGUN">
<mod-overwrite:cooldown>8</mod-overwrite:cooldown><!-- was 16 originally-->
<mod:findLike type="boost">
<mod-overwrite:amount>1.5</mod-overwrite:amount><!-- was 3 originally-->
</mod:findLike>
</mod:findName>
<mod:findName type="weaponBlueprint" name="LASER_CHAINGUN_2">
<mod-overwrite:cooldown>5.1</mod-overwrite:cooldown><!-- was 11.1 originally-->
<mod:findLike type="boost">
<mod-overwrite:amount>2</mod-overwrite:amount><!-- was 2 originally-->
<mod-overwrite:count>4</mod-overwrite:count><!-- was 5 originally-->
</mod:findLike>
</mod:findName>

All that could be done more systematically so you would use it with any mod/weapon: in short you would have to reduce for any weaponBlueprint the cooldown by two. Then,provided the weapon has a chain effect (i.e. a boost.type=cooldown), reduce the boost.amount by two, and reduce the boost.count if ever the max reacheable is below 1 second. But that would involve some simple math operations in xml, I was too lazy to learn some more today. The above structure was from your arwing adventure mod (thanks !), so I guess you could easily help :)
User avatar
Gencool
Posts: 409
Joined: Sun Jun 16, 2013 1:21 pm

Re: MOD[AE][working]: All weapons twice as fast

Postby Gencool » Tue Feb 02, 2016 9:07 am

Ah I'm so proud!

Yeah, boost is a weird one. I remember making a single use bl2 which was both fun and useless...

As far as i'm aware you cant really do maths in ftl mods, even if they are xml based.



If reducing only the amount is leaving your values too low, then deviding both boost count and amount by 2 it might work in theory, but maybe for balance and ease of coding it may be better to devide just one of the values by 4.

I know the cooldown works in decimals, so I'd say its the best target for this. So where cooldown is x0.5, boost.cooldown.amount would be x0.25 (rounded down)
This way the laser chain gun, for example, reduces by 0.75 seconds per shot; 3.75 overall, resulting in a 1.35 cool down. That's still insanely fast, but nowhere near the 0.5 mark.


I mean, there are most likely some mods where there would still be an issue, but this should really up the compatibility ^^


Also, with searching for the cool down type before applying the changes, my Sensdep mod code may help here. It uses ' has child like ' flags all over the shop.

And please tell me you're using notepad++?
ImageImageImage
- Gencool (aka Puppetsquid) -- I make weird stuff
sul
Posts: 121
Joined: Sat Jan 30, 2016 4:22 pm

Re: MOD[AE][working]: All weapons twice as fast

Postby sul » Tue Feb 02, 2016 1:38 pm

Gencool,

thanks for the help ! Nah I'm on linux, using kate. ok so if maths relations are not possible then more cases can be done but all by hand. I am putting again how I would do it if maths were possibles (it helps me understand), so maybe someone will do it:

First, all weapons should change cooldown*=cooldown/2, where * means the new one. Previously I had done this with a search-replace for all values cooldown=3,4,...26 seconds, and also cooldown=5.5, 11.1 that corresponds to laser charge and vulcan. Now you could do it for all values with one more decimal, cooldown=2.2...26.0, that would be more systematic and cover more weapons that modders could invent (you could also go beyond values 26.0, but not below 2.2 in our case, see end of this post). That just means writing down all the cases (its long !).Note that if a modder comes up with a cooldown of two or more decimals or more (say cooldown=3.14), it wouldnt be affected.

Now, weapons with chain effects (that have boost.type=cooldown) are more complex because recharge rate also decreases as they shoot. The actual recharge rate you will see in game, lets call it "recharge" and it is in seconds, would be like that: on first volley, recharge=cooldown, on second one recharge=cooldown-amount, on third recharge=cooldown-2*amount, ..., to a maximum of recharge=cooldown-count*amount. Now if you want to modify recharge*=recharge/2 for each weapon, then just change cooldown*=cooldown/2 (it is already done above) and amount*=amount/2, and you can keep count*=count.

There is a catch though ! If the recharge rate goes below 1 second, weird things happen. I noticed that with the vulcan when it reached recharge*=0.505 seconds, it would never stop autofiring. There must be some in-game checks performed every 1 second in game I guess, that is maybe why the devs ensured the vulcan would reach a minimum recharge=1.1 seconds. So as a rule of thumb, lets ensure we never go below 1.1 seconds, in other words recharge*=cooldown*-(count*)*(amount*) >=1.1. For weapons without chain effects (count*=0, amount*=0), just ensure cooldown*>=1.1. That means if someone made a weapon with an original cooldown<2.2 seconds, you will not apply cooldown*=cooldown/2. For weapons with chain effects, reduce count* if necessary (that is what i did for the vulcan, count*=4 while we had count=5 originally).