Hellgate Revival :: Forums

Hellgate: London (Single Player) => Modification => Topic started by: Ghoul-bb on Nov 01, 2018; 02:07 PM

Title: How to modify weapon fire range?
Post by: Ghoul-bb on Nov 01, 2018; 02:07 PM
I'm going to make some changes to weapons,  such as:

- increase fire distance
- increase radius damage for weapons with radius damage attack (grenade launchers, etc.)
- improve accuracy for some weapons
- reduce power drain for weapons with "laser beam"attack

But i don't know how to start, what do i need to modify.
Title: Re: How to modify weapon fire range?
Post by: Kikina the templar on Nov 01, 2018; 11:22 PM
fire distance - not set on weapons, but on weapons missiles, table "missiles", parameter "rangeBase"

weapon accurancy - table "items", parameter "firingErrorIncrease", "firingErrorDecrease", "firingErrorMax"

weapon radius - table "items", parameter "props1", its not only number, but formula (field_fire(100, 100, 50, 80); )

beam weapons energy cost - table "items", parameter "props3" (in most cases), its again formula (SetStat669('energy_max', 400);
SetStat669('energy_decrease_source', 45);
SetStat669('energy_increase_source', 275); )
Title: Re: How to modify weapon fire range?
Post by: Morphy on Nov 01, 2018; 11:22 PM
I'm going to make some changes to weapons,  such as:

- increase fire distance
- increase radius damage for weapons with radius damage attack (grenade launchers, etc.)
- improve accuracy for some weapons
- reduce power drain for weapons with "laser beam"attack

But i don't know how to start, what do i need to modify.

I don't want to crap on your idea.... but i think you'll be disappointed.

With the mods in you can have reasonably high fire rate sniper riffles with longer range.

Most weapons are either close, 2m, middle, up to about 25m, and long, up to about 40m (+the snipers).

These ranges match the game nicely - too far would mean you'll kill everything long before it's even seen you let alone become a threat to you = less fun in the game.

However - I would like to see a few swords with longer reach, 3m instead of the 2m; become like a Claymore, for e.g.

As for the rest - if you add the points to them you will have grenades with massive blast radius... and the "fire from above" attacks end up with some 25 sq metre blast radius = kills shit everywhere!!

I think you'll find that you've made the early stages too easy and the later stages pointless (in terms of character progression).

Reduced power drain for the laser weapons - yeah, i can see the use for that, those bugger drain pretty fast and become "wrist tappers".
Title: Re: How to modify weapon fire range?
Post by: Malachor on Nov 02, 2018; 12:51 AM
weapon radius - table "items", parameter "props1", its not only number, but formula (field_fire(100, 100, 50, 80); )
To add on from this: field_fire(minDam, maxDam, radius, duration).
 minDam/maxDam is a percentage of the base damage, some weapons can do more than one type, like rad_fire(50, 50, 60) and field_fire(50, 50, 80, 40), or dmg_fire(33, 33) and dmg_toxic(67, 67), so they add up to 100.
radius is divided by 10, so the example 50, means a radius of 5 metres.
duration is in ticks, and there are 20 ticks per second, so 80 means it persists for 4 seconds.
Title: Re: How to modify weapon fire range?
Post by: Ghoul-bb on Nov 02, 2018; 10:11 PM
Thanks, guys, it should work!

In my opinion, explosives hawe too small damage radius, so they are useless wery often. I'll fix it . The same with the fire range. I'm not going to make 1 kilometter fire distance... for the first time i'm going to make double range for the firearms, so, i think, this should be enough. Anyway, without good accuracy you can not fire too far, so the player should  stat points to improve  it.

Same with laser weapons - fast power drain makes them less effective, than, for example, rifles (when you shoot from rifles, there is no damage decrease, they became less accurate only )
Title: Re: How to modify weapon fire range?
Post by: Ghoul-bb on Nov 05, 2018; 08:05 PM
fire distance - not set on weapons, but on weapons missiles, table "missiles", parameter "rangeBase"


I got a bug in game, while firing the weapon: projectiles does not go straight, they are flying in random directions, after I changed the fire distance. (I increased it in two times)  What's wrong?
Title: Re: How to modify weapon fire range?
Post by: Kikina the templar on Nov 05, 2018; 08:47 PM
I have encountered similar effects while modding game.  :D
Missiles data are set for cooperaton with graphics effects, sometimes is necessary compare several other parameters.
I never really cared much about it.
Also, the speed of missiles is important, at some speeds some weapon models do not work at all.
Title: Re: How to modify weapon fire range?
Post by: Ghoul-bb on Nov 06, 2018; 08:18 PM
So, ho to act in this case?
BTW,
 

weapon accurancy - table "items", parameter "firingErrorIncrease", "firingErrorDecrease", "firingErrorMax"

also works strange: I changed these parammeters for XM314 Falcon (pistol) (reduced from 300 to 150) but in game nothing changed: the pistol fires very inacurate.

And, of course, a few words about damage: where are they located? minBaseDmg is 24, maxBaseDmg is 45, but in game this pistol's damage differs:   physical damage (direct):4-7
Title: Re: How to modify weapon fire range?
Post by: Kikina the templar on Nov 06, 2018; 11:10 PM
Now you will understand that modding of this game is real hell  :D
Try read old modding threads on this forum, there is a lot of information of the changes in weapons scheme.
Unfortunately, i can not help you with weapon distances, for new revival weapons i everytime used missiles that have been pre-set in the program.
Weapon acurancy should be reflected on the cursor that showing weapon while firing - "firingErrorMax" is maximum where the cursor can expand, "firingErrorIncrease" is speed of expanding, "firingErrorDecrease" is speed of restoring this cursor to normal state. Program should be firing missiles only inside this cursor.
Base damage of weapons is in table "items", parameters "minBaseDmg" and "maxBaseDmg". Damage multiplier is set with parameter "dmgIncrement". Accurate transfer "number here" to "number on weapon in game" is not known to me, i always worked with approximate numbers.
Title: Re: How to modify weapon fire range?
Post by: Malachor on Nov 07, 2018; 10:10 PM
To add onto Kikina's comments.
The Players table also has firing error max, increase and decrease.
And the item_levels table has baseDamageMultiplyer
Title: Re: How to modify weapon fire range?
Post by: Ghoul-bb on Nov 07, 2018; 11:15 PM
Ok, here is my progress in exploration of weapon stuff:

DONE:


1. I found a way how to modify weapon's damage. To do this, we need "props1" column. For example, it has dmg_phys(100,100); We can modify it, like dmg_phys(200,200); In this way the  weapon will do 200% damage in game. Also it is possible to add an extra dmg types here, like fire, toxic, etc.. And, of course, splash damage rad_phys(100,100,30); So, the gun will do radius damage within 3 metters.

2. criticalPct & criticalMult ajusted for all weapons. criticalPct is more common for sniper weapons, rare for rapid fire firearms. (in vanilla for most weapons there was ZERO chance for a critical hit. WTF? )
 If I'n not mistaking, critical hits work in this way:
For example, critical chance is 5%, and criticalMult should be how many percent from the base damage will be added to the final damage in case of critical. Right?
So, if current weapon does 10 units of damage, has 5 criticalPct and criticalMult 50, it means, that only five bullets from 100 fired rounds will do 50% extra damage (10 + 10*0.5 = 15), right?

3. Power drain is decreased for laser weapons, also increased energy capacity for them.

TODO:

1. Weapon's range. As I told before, messing with parameter "rangeBase" in missiles table resulted in an error, so i have another idea, what to do. There are different augments, like fuel, battery, relic, ammo, which gives something extra to the weapon parammeters. And we just need to increase weapon's fire range with these augmentations. But usually they provide something like +3% ~ +7%, and it is not serious. We need to change these numbers to 80%-100%, but how? Where these characteristics are located?

2. Fire rate for weapons. How to change it?
Actually it is not very important, but interesting for me.
Title: Re: How to modify weapon fire range?
Post by: Ghoul-bb on Nov 08, 2018; 12:47 PM
I found a way how to extend little bit fire distance.
Everything necessary is located in "affixes" table.
But there is a limit for the weapon fire range, and it depends of the weapon class. as far, as I now, (i did some tests) for pistols max range is 28 metters, for assault rifles - 39 metters, for sniper weapons - 63 metters.
So, If we put 200% range boost mod into the weapon (for example, with base range of 25m) we will receive only 39m effective range for this weapon (not 75 m)!!!
So, there should be something, what limits this range!!!!
Title: Re: How to modify weapon fire range?
Post by: Morphy on Nov 08, 2018; 08:57 PM
Quick suggestion - can you look at existing weapons and see the changes made to make them more accurate or high fire rates?

E.g: My char has a sniper rifle (yes, sniper) that fires 1200 rounds per minute (from a sniper?).

My suggestion is to find a high fire rate weapon then compare that to a lower fire rate one and check the values/positions that change - just like we used to do in the "old days" of hacking games and save files, ha!
Title: Re: How to modify weapon fire range?
Post by: Malachor on Nov 09, 2018; 12:27 AM
There is something that limits the range: rangeMax column in the Missiles table.
And rate of fire is in Items table, column cdTicks. The ingame value is calculated by 153600 divided by cdTicks = rate of fire
Title: Re: How to modify weapon fire range?
Post by: Ghoul-bb on Nov 09, 2018; 04:58 PM
There is something that limits the range: rangeMax column in the Missiles table.
Sure, they are present, but all these limits are similar for all projectiles: rangeMin is 30, RangeMax is 160

Title: Re: How to modify weapon fire range?
Post by: Ghoul-bb on Nov 09, 2018; 05:03 PM
Quick suggestion - can you look at existing weapons and see the changes made to make them more accurate or high fire rates?

E.g: My char has a sniper rifle (yes, sniper) that fires 1200 rounds per minute (from a sniper?).

My suggestion is to find a high fire rate weapon then compare that to a lower fire rate one and check the values/positions that change - just like we used to do in the "old days" of hacking games and save files, ha!

I hope, I found an accuracy for projectiles: Missiles table, horizontalAccuracy, verticalAccuracy.
But I can only guess, which weapon this projectile belongs to. So, I need time to check this theory.
Title: Re: How to modify weapon fire range?
Post by: Kikina the templar on Nov 09, 2018; 11:53 PM
How find which weapon belongs to which missile ?

- In table "items" look at parameter "startingskills" - for example item 442 "Crusher Cannon" have here number 639
- Look to table "skills". In line 639 is skill named "Crusher Cannon". Look at parameter "events". Here you find "weapon/CrusherCannon"
- now you must uncooking game data and in data/skills/weapon you must find file with name "crushercannon.xml"
- open this file and in script search for line "<pEvents>Fire Missile</pEvents>". Somewhere under this line you find definition "<tAttachmentDef.pszAttached>Crusher Cannon</tAttachmentDef.pszAttached>" this is name of missile
- now go to table "missiles" and find here name "Crusher Cannon", is in line number 25

(Btw, this is a practical demonstration of how you should never have to working with data in your game...)
Title: Re: How to modify weapon fire range?
Post by: Ghoul-bb on Nov 12, 2018; 12:01 AM
One problem, with weapon's accuracy, is totally solved. All we need, is located in missiles table.
There are four columns, responsible for missile's accuracy.
They are: horizontalAccuracy, verticleAccuracy. As closer to zero numbers in these columns, as accurate the weapon is.
But... there are two more columns: walkSpeed and walkMax. Modifying these parammeters, I found, that as faster the projectile is, as it is more accurate.
So, there are two ways to change an accuracy for the weapon!

Example: horizontalAccuracy = 0.5 verticleAccuracy = 0.5 walkSpeed = 25 walkMax = 30
if we change only : horizontalAccuracy = 0.25 verticleAccuracy = 0.25 , we will receive two times more accurate weapon.
And, if we change only walkSpeed = 50 walkMax = 60, we also receive the same result, but with two times more faster projectiles.
Of course, it's possible to change all four parameters. We will receive 4 times more accurate weapon with two times faster projectiles.

So, the last problem, which is not solved yet is with extended weapon's range....
Title: Re: How to modify weapon fire range?
Post by: Malachor on Nov 14, 2018; 10:00 PM
There is something that limits the range: rangeMax column in the Missiles table.
Sure, they are present, but all these limits are similar for all projectiles: rangeMin is 30, RangeMax is 160
Perhaps they are percentages. sniper rifles have a range of 40, if it is multiplied by 1.6, it becomes 64, assault rifles have a range of 25, multiply that by 1.6 it becomes 40. That's very close to the values you saw.
Title: Re: How to modify weapon fire range?
Post by: Ghoul-bb on Nov 16, 2018; 11:22 PM
Thanks for advise, I should check this!

btw, do you know, where are located properties for an explosive objects, like gas tanks, oil barrels? (I need their damage and radius)
Title: Re: How to modify weapon fire range?
Post by: Malachor on Nov 17, 2018; 12:45 AM
I couldn't find their damage radius after a quick look, but their damage is in monsters: minBaseDmg/maxBaseDmg, no props though. and check their skills, though nothing jumped out at me in there, but again it was just a quick look.
Title: Re: How to modify weapon fire range?
Post by: Ghoul-bb on Nov 17, 2018; 04:52 PM
Who could think, that an explosive objects are located in monsters?!  :o

I found that they have skill number 781 "Crate do damage", after I  opened "skills" table, and added fire damage + field fire damage to statsSkillEventServer column. Now an explosive objects make a huge field of fire after explosion.  So, I'm actually could not do a bigger damage radius for them, but did a fire field. It's pretty cool  ;) ;)
Title: Re: How to modify weapon fire range?
Post by: Ghoul-bb on Nov 18, 2018; 12:09 AM
There is something that limits the range: rangeMax column in the Missiles table.
Sure, they are present, but all these limits are similar for all projectiles: rangeMin is 30, RangeMax is 160
Perhaps they are percentages. sniper rifles have a range of 40, if it is multiplied by 1.6, it becomes 64, assault rifles have a range of 25, multiply that by 1.6 it becomes 40. That's very close to the values you saw.

You are a genius! This is exactly what I need!!! I increased rangeMax numbers in 3 times, and now it's possible both to extend rangeBase and (or) in game install an augmentation to the weapon, which increases it's range (more than it was before) And no bugs with different flying directions of projectiles!! But... only one thing makes me unhappy: the game does not draw monsters further than fifty-sixty meters ( the maximum visibility in the game settings is on) When I'm aiming at the monsters, located far away, I can see only an icon of the monster, it's health and distance to it, but I can't see the model...
Title: Re: How to modify weapon fire range?
Post by: Ghoul-bb on Nov 19, 2018; 12:02 AM
One more question about damage augmentations for weapons.
There are some damage boost options, located in "affixes" table.
DamageAugmentation with properties like SetStat673('damage_percent', 'all', rand(@game4, 12, 20));
works perfect, and, being installed, it increases weapon damage. Here is all right.
But, there are also some damage boosts, to increase special damage type, like DamageBoostPhysicalWeapon, DamageBoostFireWeapon, and so on. (SetStat673('damage_percent', 'physical', rand(@game4, 20, 36)); )

And all these boosts work in a strange way or do not work at all. I mean, when being installed into weapon, it does nothing: neither damage increasing, nor adding new damage type. Is it a bug or something I don't know?
Title: Re: How to modify weapon fire range?
Post by: Malachor on Nov 19, 2018; 01:01 AM
Damage augmentation adds damage to a weapon.
Damage boost adds damage to a weapon if it already does that damage type. Check the cond column.
Title: Re: How to modify weapon fire range?
Post by: Ghoul-bb on Nov 19, 2018; 01:33 AM
Damage boost adds damage to a weapon if it already does that damage type. Check the cond column.

I see in the code, that it SHOULD add damage to the weapon, but it does not (after applying damage boost, nothing happens with weapon's damage)
For example, the weapon has electrical damage of 20, I add a device  that adds 50%  electrical damage, but the base damage does not increase!

Title: Re: How to modify weapon fire range?
Post by: Malachor on Nov 20, 2018; 01:06 AM
Have you tested it against some zombies, or something?
I haven't done much with affixes, so I haven't noticed if this is normal behaviour for an affix on a mod. Maybe it's only affixes directly applied to a weapon that changes the base damage display.
Title: Re: How to modify weapon fire range?
Post by: Ghoul-bb on Nov 24, 2018; 03:02 PM
Have you tested it against some zombies, or something?
I haven't done much with affixes, so I haven't noticed if this is normal behaviour for an affix on a mod. Maybe it's only affixes directly applied to a weapon that changes the base damage display.
No, I did not. For zombies, beasts and others there are another augmentations.
Anyway, I fixed this problem, just added dmg type increase %, so now it works properly.