Author Topic: PHP Script for reading the weapon data out of the XML  (Read 2788 times)

0 Members and 1 Guest are viewing this topic.

Offline =KoS= Eldragon

  • Living Legend
  • *******
  • Posts: 2505
  • l33tp0intz: +91/-2
PHP Script for reading the weapon data out of the XML
« on: February 02, 2011, 07:43:15 PM »
This is a work in progress, but it has nearly all the info you care about.

This script generates an HTML table with the complete info dump on the weapons statistics in GameData.pak.

Usage: Simply run the command: php ReadWeapons.php <pathtoWeaponDir>

e.g. php ReadWeapons.php C:\Temp\GameData.pak\Scripts\Entities\Items\XML\Weapons\

A future versions of this script may generate Wiki formatted tables, to make it easy to cut and paste the data into the wiki for updates. However in order to do that, I need to be able to generate all the data found in those tables. There is some information that I do not know how to calculate yet. Splash Radius. etc

If there is information missing from these tables, that you would like to see, let me know and I will see what I can do.

Attached script and HTML table is current as of MWLL 0.5.1

Edit: Updated values to 0.5.1. Fixed several calculation bugs. Added a WeaponTableMerged.html weapon table that lists the changed values between 0.4 and 0.5. Added the ability to sort the columns. Added a "Damage Per minute" and "Shots per minute" column.


[attachment deleted by admin]
« Last Edit: May 31, 2011, 06:18:58 PM by (TLL)Eldragon »

Offline ~SJ~{CDT} Ro0t

  • MechWarrior
  • **
  • Posts: 236
  • l33tp0intz: +18/-0
  • Smoke Jaguar
Re: PHP Script for reading the weapon data out of the XML
« Reply #1 on: February 14, 2011, 06:29:26 PM »
The script is great, but without the actual formulas to calculate the different stats, that information is kind of pointless to a certain degree...

For example, knowing that a MPL has a raw damage output of 40.2192 doesn't mean much unless you can calculate the damage per burst. Same goes with the Pulse Lasers...
« Last Edit: February 14, 2011, 07:07:46 PM by The_Yanster »
~SJ~{CDT} Root
(Formerly known as Dazzlenut)


Offline =KoS= Eldragon

  • Living Legend
  • *******
  • Posts: 2505
  • l33tp0intz: +91/-2
Re: PHP Script for reading the weapon data out of the XML
« Reply #2 on: February 14, 2011, 06:53:39 PM »
These values are publicly available. I only started working on a script to make updating the wiki easier. I suppose I could do the updates myself, but usually I would rather play MWLL than update the wiki.

I haven't spent much time on it, but I'm pretty sure one could take a guess at the total damage and get reasonably close. Not perfect, but better than nothing.

For Beam and pulse weapons. There is data in the xml files not being published in this script. If someone figures out a calculation for these, I would be more than happy to update the script to reflect it.

E.g. The Large Pulse laser has this extra bit of data. If you can take this data and come up with a way of calculating total damage, I can have the script generate that total.

Looks like it fires 5 shots separated by .015 seconds, and it can be fired every 2.5 seconds. So total damage is probably ~450. Now someone just needs to test that hypothesis.

 
Quote
<param name="damage" value="89.0568"/>
<beam>
        <param name="shots" value="5"/>
        <param name="burst_cooldown" value="2.5"/>
        <param name="tick" value="0.015"/>
        <param name="range" value="600"/>
      </beam>

Offline Loom

  • Bondsman
  • *
  • Posts: 15
  • l33tp0intz: +0/-0
Re: PHP Script for reading the weapon data out of the XML
« Reply #3 on: March 26, 2011, 09:35:28 AM »
Nice! I like numbers :)

I will see if I can do something useful with this data.

Offline Loom

  • Bondsman
  • *
  • Posts: 15
  • l33tp0intz: +0/-0
Re: PHP Script for reading the weapon data out of the XML
« Reply #4 on: March 26, 2011, 11:41:56 AM »
Some data is missing in the table, which exists in the file (as already mentioned for the lasers).

For the Missiles it is important to know how much are fired in a burst (firemode=Burst), else all variants of a MRM are the same in the table. Maybe you can add a firemode specific column? Here my thinking:
Automatic: spread average (min+max/2)
Beam: don't know what tick means
Burst: nshots
Pulse: shots (maybe per time)
Rapid: spread
Shotgun: pellets
Single: recoil?

Offline Xarg Talasko

  • Living Legend
  • *******
  • Posts: 2960
  • l33tp0intz: +159/-6
  • KANE LIVES!
Re: PHP Script for reading the weapon data out of the XML
« Reply #5 on: March 30, 2011, 04:03:15 PM »
Quote
<param name="damage" value="89.0568"/>
Damage per hit
Quote
        <param name="shots" value="5"/>
Fires 5 shots
Quote
        <param name="burst_cooldown" value="2.5"/>
Cooldown
Quote
        <param name="tick" value="0.015"/>
How long each shot discharges for
Quote
        <param name="range" value="600"/>
Range, obviously



Hope this helps.


Thief gameplay + Doom3 engine = The Dark Mod

Offline =KoS= Eldragon

  • Living Legend
  • *******
  • Posts: 2505
  • l33tp0intz: +91/-2
Re: PHP Script for reading the weapon data out of the XML
« Reply #6 on: March 30, 2011, 04:14:14 PM »
I'll update the script sometime soon with derived values such as these. Too busy lately to work on it. But I will be sure to do it for the next release.

Offline =KoS= Eldragon

  • Living Legend
  • *******
  • Posts: 2505
  • l33tp0intz: +91/-2
Re: PHP Script for reading the weapon data out of the XML
« Reply #7 on: May 31, 2011, 06:19:50 PM »
Updated the original post with updated table values. Let me know if anything is broken or if there are other values you would like to see.