Jump to content

Explain Weapon XMLs?


Recommended Posts

I just went to register but apparently I've been registered for three years but never posted. I don't even know...

Anyway, I've been messing around with the BP weapons pack 6.0 trying to make the weapon performance more consistent with the original weapons in the game, rather than keeping the no-recoil superweapons that just feel like cheats to me. It's been going fine for the most part, but I can't figure out a few things. I can't find a guide to weapon XMLs anywhere.

First off, every weapon XML has this block:

<!-- Moddable stats -->

<var name="damage" value="2"/> <!-- weapon damage + mods affect this -->

<var name="weight" value="2"/> <!-- weapon weight + mods affect this -->

<var name="stability" value="0.8"/> <!-- weapon stability + mods affect

I'd been filling those values out relative to the original weapons, but I started wondering exactly what "stability" meant (less recoil? but then why is there a recoil stat? crosshairs close faster?) To try and figure it out I set the primary SG552's stability to .1 and the secondary SG552's stability to 9.7 and there's absolutely no difference in performance. Does this stat actually do anything?

I found another XML that has the accuracy, impact, stability, and weight stats that show up in the Inventory menu in game - but do these stats actually affect gameplay or are you just supposed to manually edit them to reflect the weapon's spread, recoil, etc stats?

Also, it's always bugged the hell out of me that the grips make the weapons less accurate and the suppressors don't make the weapons less powerful. Where do you edit the stats for attachments/accessories? I found a few files that might do this but they seem like they might just change the Inventory stats rather than actual gameplay.

Or, if anyone has a handy guide that explains all the aspects of weapon and accessory gameplay modding, that would be awesome.

Thanks!

Link to comment
Share on other sites

So the "stability" variable in the u_weapon XML is meaningless? What about the "damage" variable?

The weapon_data XML has a line for each entry formatted <bar_stats accuracy="0.6" stability="0.7" weight="3.5" impact="0.4" /> but since it's labeled "bar stats", these only affect the length of the stat bars in the inventory screen and not the gameplay, correct?

Penetration, you say? I knew the engine supported penetration because of the .50cal but I was always disappointed this didn't apply to other weapons. What stat would affect this? Or is it only available to the .50 specifically?

Thanks for your help!

Edited by thelonesoldier
Link to comment
Share on other sites

hi,

not sure if the stability and damage make a difference in the u_weapon file, but damage can be adjusted in the weapon_data.xml.

just look out that the entrys match in the u_weapon and weapon data files.

the bar stats are more or less eye candy for the lobby, but the weight entry does effect ingame. lower the zeus weight and you can carry it together with the sniper. not sure if the others will effect ingame like the weight does.

for penetration add this line in the u_weapon file, check the u_barret.xml for example.

<var name="weapon_penetration_type" value="1"/> <!-- will penetrate walls -->

but assigning this to all weapons will take the only advantage away from the m99.

maybe that helps you a bit.

Link to comment
Share on other sites

I would think between spread and recoil you'd have full control of the weapon's accuracy. The accuracy stat affects it as well?

Gah, this is going to take a lot of testing.

I looked in the u_barret for penetration and didn't see it but I guess I just missed it. Is it just a toggle though? Do you know if it's affected by the weapon's damage? 5.56 obviously shouldn't penetrate as much as .50BMG.

Thanks to you both!

edit: I just tried significantly raising the accuracy and stability numbers in the weapon_data xml and it didn't affect the in-game performance at all.

Edited by thelonesoldier
Link to comment
Share on other sites

I just tried significantly raising the accuracy and stability numbers in the weapon_data xml and it didn't affect the in-game performance at all.

So... penetration doesn't depend on the damage? It's always going to penetrate "3 feet" of concrete? (although it doesn't seem like the Barret actually penetrates nearly that far in the game)

Link to comment
Share on other sites

the gun will move around in game no matter how u reduce the recoil or the spread

changeing the each weapon xml is the best way to see the affects in game

try adding the line of code that was posted earlier as well as these 2 lines (and these can me adjusted as well)

<var name="weapon_penetration_type" value="1"/>

<var name="max_penetration" value="1"/>

<var name="penetration_chance" value="1"/>

put this line of code into the firemodes section

the higher the number of the second and third line the better and farther the penetration and chance will be

and the penetration and distance of the weapons is represented like this in the xml

100 = 10feet

35000 = 350 feet

hope this helps some

Zero

Link to comment
Share on other sites

the gun will move around in game no matter how u reduce the recoil or the spread

changeing the each weapon xml is the best way to see the affects in game

I'm not sure what you mean. I've already been adjusting the recoil and spread values in the u_weapon xml and that gives you as much control over accuracy as the game allows. As far as I can tell the values in weapon_data don't affect gameplay at all.

If you dramatically reduce the recoil and spread variables (as the author of the BP weapons pack did) the guns will have almost no recoil and nearly perfect accuracy. Spread controls how far away from the center of the aim point the bullets can vary (in other words, the size of the cone of fire) and recoil is how much the gun moves upwards (although the behavior is completely different between using the sights and firing from the hip, the spread and recoil values still apply).

Anyway, I've been increasing the recoil and spread in the BP pack to be consistent with the original weapons in the game (while making small adjustments based on the real-world differences between the weapons, so all the rifles are different rather than clones of the SCAR).

Thanks for the additional info on penetration. It's assanine that the engine supports penetration and yet by default a 7.62mm NATO won't go through a picket fence.

100 = 10feet

35000 = 350 feet

Is one of those a typo? That first example translates to 10 = 1 foot, but the second example uses 100 = 1 foot.

EDIT: I started playing around with penetration for all assault rifles, and it's a fantastic feature. It makes the gameplay a little easier (you can now shoot people hiding behind thin wood and sand bags!), and much more realistic and enjoyable.

Edited by thelonesoldier
Link to comment
Share on other sites

Well, I've wasted hours and hours testing this in and out, and I can fairly confidently say understand how all the numbers work now.

Since most of you guys were giving me a lot of incorrect information about how the accuracy/recoil variables in the different file affect gameplay, and nobody ever acknowledged they were wrong about it, I want to make sure you understand that the bar stats do not affect the gameplay at all. I'm not trying to be a ######, I just had to spend a lot of time testing this and I would feel bad if other people were misinformed - it would really suck if you guys had been making mods only adjusting the bar stats and thinking that was actually affecting gameplay! No hard feelings, just test better in the future :thumbsup:

What Stats Don't Work

All of this information was easily and definitively determined by comparing the BP SG552 in both primary and secondary weapon slots. I would give them identical stats except one, for example giving one of them a stability of .1 and the other a stability of 9.

STATS THAT DON'T AFFECT GAMEPLAY ARE IN RED

weapon_data.xml

<weapon_data disabled_by="disable_heavy_rifle" unit="bp_sig552v1" name="bp_sig552v1" weapon_id="48" inventory_slot="primary" gui_unit="bp_sig552v1" weight="2" length="80" stability=".1" price="120" damage="1.7" player_weapon="1" grenade="0" cal="556" wizby="2">

<stats caliber="5.56 x 45 mm" rpm="700" velocity="725 m/s" firemodes="SA 3RB FA" capacity="30" info="info_bp_sig552v1" />

<bar_stats accuracy="0.6" stability="1" weight="3.5" impact="0.6" />

Except the stability stat in the first part, all of these numbers are only displayed in the inventory screen but should still be edited to reflect what you've done inside the u_weapon.xml so the players have an idea of the relative performances of the different weapons.

The stability stat is all over the place, but it does absolutely nothing.

u_weapon.xml

I left out a lot of stuff that isn't relevant here.

<stats block="weapon_data">

<var name="ammo_type" value="556"/>

<var name="length_from_root" value="60"/>

<var name="clip_max" value="30"/>

<var name="owner_align" value="primary_align"/>

<var name="public_name" value="Sig552 Commando"/>

<var name="anim_name" value="bp_sig552v1"/><!--scar-->

<var name="hud_name" value="bp_sig552v1"/>

<var name="network_id" value="0"/>

<var name="weapon_class" value="assault"/><!--assault-->

<!-- Spread -->

<var name="spread_normal" value="2.0"/> <!-- spread in normal mode + mods affect this -->

<var name="spread_zoom" value="0.48"/> <!-- spread in zoomed mode + mods affect this -->

<!-- Recoil -->

<var name="recoil_normal" value="0.5"/> <!-- spread in zoomed mode + mods affect this -->

<var name="recoil_zoom" value="0.9"/> <!-- spread in zoomed mode + mods affect this -->

<var name="zoom_lens_speed" value="1.5"/>

<!-- Fire modes -->

<var name="fire_modes" value="3"/> <!-- 1 = semi, 2 = semi+auto, 3 = semi+auto+burst -->

<var name="fire_rate_semi" value="0.140"/> <!-- minimum time between bullets in semi mode -->

<var name="fire_rate_auto" value="0.08333"/> <!-- time between bullets on full auto -->

<var name="fire_rate_burst" value="0.1"/> <!-- time between bullets in burts mode -->

<var name="fire_burst_count" value="3"/> <!-- the amount of bullets to fire in a row in burst mode -->

<var name="admits_reload_firing" value="true"/> <!-- Can be fired during a Tactical reload -->

<var name="weapon_penetration_type" value="1"/>

<var name="max_penetration" value="1"/>

<var name="penetration_chance" value=".5"/>

<!-- Moddable stats -->

<var name="damage" value="1.7"/> <!-- weapon damage + mods affect this -->

<var name="weight" value="1.9"/> <!-- weapon weight + mods affect this -->

<var name="stability" value=".7"/> <!-- weapon stability + mods affect this -->

Damage and weight are completely overriden by weapon_data.xml and again, the stability stat is completely meaningless and doesn't affect anything.

I'm still testing penetration, those numbers definitely turn it on, but it's nearly impossible to set up a controlled scenario for testing penetration in-game. With "max_penetration" set to 2, a 5.56 was still able to penetrate what appeared to be 18 inches of concrete, so I changed the value to 1 but again it's hard to test if it's working properly.

Edited by thelonesoldier
Link to comment
Share on other sites

Well, I've wasted hours and hours testing this in and out, and I can fairly confidently say understand how all the numbers work now.

Since most of you guys were giving me a lot of incorrect information about how the accuracy/recoil variables in the different file affect gameplay, and nobody ever acknowledged they were wrong about it, I want to make sure you understand that the bar stats do not affect the gameplay at all. I'm not trying to be a ######, I just had to spend a lot of time testing this and I would feel bad if other people were misinformed - it would really suck if you guys had been making mods only adjusting the bar stats and thinking that was actually affecting gameplay! No hard feelings, just test better in the future :thumbsup:

To be fair thelonesoldier, it was stated that Rahnman has only done weapon modding for GRAW2 which tells me that he was only saying what he knew from modding that game, what he said was only a guide to try and help and I think the same applies to what Zero was saying as well.

I don't do any weapon modding for GRAW but I have done a bit for GRAW2.

We all do our best to try and help each other out with modding issues, there is no need to put your point across using big or bold type as it can be seen as being aggressive. .

Link to comment
Share on other sites

I just did some testing in GRAW 2 - I couldn't get an override weapon_data to work (the game crashes) but I made an override for the u_scar_light XML and set the recoil and spread to 0, and the gun had absolutely no recoil and perfect accuracy. This tells me the situation is the same for GRAW 2 - the bar stats don't actually affect anything.

EDIT: I just tested the XMLs with the BP Weapons pack, and I can conclusively say that the numbers work the same way in GRAW 2 - the bar stats don't do anything and recoil/spread fully control accuracy.

Edited by thelonesoldier
Link to comment
Share on other sites

The only damage variable that is used is the one in the weapon_data.xml. This is easily verified by setting it to "0"; conversely, you can set the damage in a u_weapon.xml to 0 and the weapon will still kill in one or two bullets.

I am sure that the "accuracy" variable has impact as well.

No, it definitely does not. Try what I've mentioned; use a weapon from the BP pack that is available in both primary and secondary (I've been using the SG 552). Give them exactly the same stats in weapon_data and u_weapon, but then give one of them an extremely high accuracy and one of them an extremely low accuracy. Then load up a level with both of them in your inventory and try it out. There will be absolutely no difference between them. I've tested this many, many times now and I'm completely confident about it.

This is extremely easy to test yourself, but if you don't want to I can post screenshots of the bullet holes to prove it.

Okay, I'm sorry I questioned how much time you've spent testing, but this is the truth and you can test it yourself, the accuracy stat doesn't change anything but how long that bar is. I know you gave me information that was false, and I'm not trying not to be nice, I'm trying to be straightforward and correct misconceptions. I'm serious that I don't want people to waste time changing numbers that don't do anything; it's easy to imagine a variable is making a difference but when you put two otherwise identical weapons side-by-side the differences (or lack thereof) become obvious.

Edited by thelonesoldier
Link to comment
Share on other sites

As far as I know, the stats in the weapon_data.xml only affect the interface graphics in Graw1, not the actual weapon in game. I don't think they do anything in Graw2, but if they do, it's just interface stuff again. I gave up trying to work with it because it was so strange trying to make it work with attachments and the bar graphs were a little meaningless. I believe they had to be whole numbers and did some funky math when a scope was attached,etc. Made the accuracy bar super big. Any numbers I have in there are more or less meaningless. I use to match the u_weaponName.xml stats with the weapon_data.xml, but at some point I gave up. If the damage is actually affected by the weapon_data, well damn, I had no idea.

The u_weaponName.xmls are the ones that really affect the performance of guns. Spread, recoil, and damage are the ones I adjusted the most. To be honest, I didn't really care about spread_normal because it's like shooting from the hip and I never do that. I suppose I should have fixed them up better, but just left them as 1 usually.

Since most of the weapons I made were assault rifles similar to the Scar, I just stuck with 0.1 for spread_zoom since that's how I imagine most people would shoot from. Honestly the numbers seem a little whacked out to me. The mp5 has a 0.5 spread_zoom, yet this is suppose to be one of the most accurrate smgs in the world?

I wasn't trying to make these "super - cheater" weapons as you put it. Just tried to make them similar to what was already there...which wasn't much in Graw1.

Here's what I started with, and I believe the M4 is still the same in the last versions I did:

M4 Stats

<!-- Spread -->

<var name="spread_normal" value="1.0"/> <!-- spread in normal mode + mods affect this -->

<var name="spread_zoom" value="0.1"/> <!-- spread in zoomed mode + mods affect this -->


<!-- Recoil -->

<var name="recoil_normal" value="0.9"/> <!-- spread in zoomed mode + mods affect this -->

<var name="recoil_zoom" value="0.3"/> <!-- spread in zoomed mode + mods affect this -->

<var name="zoom_lens_speed" value="1.5"/>



ScarLight Default Stats

<!-- Spread -->

<var name="spread_normal" value="1.0"/> <!-- spread in normal mode + mods affect this -->

<var name="spread_zoom" value="0.1"/> <!-- spread in zoomed mode + mods affect this -->


<!-- Recoil -->

<var name="recoil_normal" value="0.9"/> <!-- spread in zoomed mode + mods affect this -->

<var name="recoil_zoom" value="0.3"/> <!-- spread in zoomed mode + mods affect this -->

<var name="zoom_lens_speed" value="1.5"/>

I would devieate marginally from this depending on the weapon, usually damage or spread_zoom for "sniper" type weapons to make them feel different by looking at something similar. Back then, I'm not sure how much a difference there really would be to most players, especially when enemies could take 2-3 rounds out of a Scar.

What can I say, I did the best I could. Just making the graphics, loading, crashing, fixing, loading, crashing, repeat for hours on end took up enough time. If the weapons felt good in game, I didn't tweak too much.

Link to comment
Share on other sites

As far as I know, the stats in the weapon_data.xml only affect the interface graphics in Graw1, not the actual weapon in game. I don't think they do anything in Graw2, but if they do, it's just interface stuff again.

This is mostly true, but like I said, the weapon_data fully controls damage, and this is easily verified by setting a weapon's damage to 0. It will knock enemies over but never kill them.

I'm glad you know the bar stats don't do anything :P .

I wasn't trying to make these "super - cheater" weapons as you put it. Just tried to make them similar to what was already there...which wasn't much in Graw1.

Your assault rifles aren't at all similar to the existing weapons. From the example SCAR you have up there I think you got the wrong code somewhere down the line.

SCAR Light defaults:

	<!-- Spread -->

				<var name="spread_normal" value="1.87"/> <!-- spread in normal mode + mods affect this -->

				<var name="spread_zoom" value="0.35"/> <!-- spread in zoomed mode + mods affect this -->


				<!-- Recoil -->

				<var name="recoil_normal" value="0.4"/> <!-- spread in zoomed mode + mods affect this -->

<var name="recoil_zoom" value="0.8"/> <!-- spread in zoomed mode + mods affect this -->


				

I'm almost finished balancing all the weapons; I've tailored them all individually and they all have different stats now, while maintaining the same gameplay feel as the original weapons. If you don't mind I'd like to post them when I'm done.

How do you adjust the in-game volume for the suppressed sound effects? The sound files you have sound great, quieter but still beefy, but the in game sounds are the lame little "pfft" noises. I don't understand the sound XMLs, I found a gain variable I assumed was volume but when I looked at some suppressed sounds they didn't have gain defined for them.

What does this (from the u_weapon XML) do?

<var name="fire_sound" value="1.3"/>

<var name="fire_supressed" value="1.2"/>

It doesn't seem to affect actual volume; does it change how well the AI hears the shot or something? :wacko:

Edited by thelonesoldier
Link to comment
Share on other sites

You're right. But those were the Graw2 stats I posted. If you look at the Graw1 stats(just checked em), they are the same for the Scar and M4, as the ones you posted. In other words, I changed them to match what the devs did in Graw2. They did change the stats for a lot of things going from 1 - 2.

However, weapons I made after Graw2 came out, such as the sig552 and Mk18, have the Graw2 stats copied into Graw1, since putting the weapons into Graw1 was more of a "favor" for Graw1 players, I did them very quickly. Maybe that's why you are seeing such huge discrepancies. I never went back and matched them, I see now, to the Graw1 style stats.

When I say u_weaponName.xml, I just mean u_scarlight.xml or u_bpm4v2.xml, without being specific to any one weapon.

Sound volume is a real pain in this game. I don't know how to really change it other then the wav file. A lot of it i think is affected by the sound setup you have, ie hardware. For instance, the intro movie volume is barely audible to me and and the suppressed sounds for the weapons are much louder then the default weapon suppressed sounds. In other words, I have no idea if people are hearing what I'm hearing, but what I'm hearing sounds pretty good to me. Do you have EAX? Most people complained the suppressed sounds were too loud.

Link to comment
Share on other sites

Doh! Since I've been focusing on GRAW 1 at the moment, I only looked through the GRAW2 files very quickly and missed the dramatic change they made in the numbers. That explains that, then. Thanks!

When I say u_weaponName.xml, I just mean u_scarlight.xml or u_bpm4v2.xml, without being specific to any one weapon.

I know, this was what I was referring to whenever I say u_weapon.

Hmm, strange problem with the audio. I have "Generic Hardware" with no other option besides "Generic Software", and no EAX option.

Edited by thelonesoldier
Link to comment
Share on other sites

Doh! Since I've been focusing on GRAW 1 at the moment, I only looked through the GRAW2 files very quickly and missed the dramatic change they made in the numbers. That explains that, then. Thanks!

To be honest, I forgot they were different. That's why I posted the Graw2 stats. I had to double check after you posted the original Scar stats to see if I really went that far off. I may not have tweaked them to perfection, but I wouldn't knowingly make a super gun, nor would I nerf a gun just for play balance issues.

Not sure about the sound. It's always been weird. I was asking if you had EAX on your computer. I found I had to set my volumes using the in-game controls to at least .8 or 8, can't remember the range off hand.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...