Weapons Tutorial


Weapons Kit Tutorial

����������� This document is designed to help users interested in weapons modification and give insight to some of the decisions made concerning weapons during production of MOHPA.


Getting Started

����������� Make sure that you have installed the MOHPA MDK. There is a sample mod called WeaponSample in your �My Documents\EA Games\Medal of Honor Pacific Assault(tm)\moddir� folder which gets installed with the MDK. Be sure to read the �Getting Started� document to understand how to use the MDK to create mods. In order to run this mod in the game, you will need to run the �Mod Configure� program to enable the mod. Also when running the Mod Configure program be sure to click on the �Select Current Mod� button to make WeaponSample the current mod.


Using the Shooting Range


����������� The simplest way to run the test map is to click on the �Test Mod� button in the MDK Launcher. It will bring up a dialog which asks for the name of the map. Type �dm\mp_shootingrange� or select it from the list by clicking on the ��� button.You can also select the game type from the pull down combo box. For this test, select �Free For All�. Unless you change to a different mod with the Mod Configure utility, the same settings will saved each time you click on the �Test Mod� button. Click on the �Run� button to start the game with the shooting range map.


When you run the map, you may spawn in a maze-area.Hit the tilde key to bring down the console and type �noclip� and fly around the map.You should see over the walls of the maze a large open area containing the entire array of hand-held, mountable, and portable weaponry that was created for MOHPA near a targeting range of bullseyes.Inactive AI�s will appear in this area of the map when running in Single Player so it may be useful to use them as targets to assess weapons damage and collision.


Changes to .hag files can be made from the Script Editor utility. From the launcher click on the �Script Editor� button. Then click on the ��� button to bring up a dialog for selecting the .hag file. Select the �.Hag Files� radio button to see all of the available .hag files. The .hag files used for the weapons testing are in the �weapons_test� folder and �statweapons_test� (see �Modifying Hag Files� below for details). Select the hag file you want to edit, click on the select button, then click on the Open button in the main window. It will bring up the file which you can edit and save in your mod folder.


You can reload the .hag files by restarting the game. Go to the console and type �map shootingrange� to restart the game. You will then be able to see the results of the changes you make to the weapons.


Modifying HAG Files

����������� .HAGs are the new format for weapons files that replace the older .TIK format used in Allied Assault and the expansions.The MDK Script Editer allow you to open and edit any of the .hag files used in the game. Alternatively you could unpack the pak1.rez file using the MDK Rez Utility and edit the HAG files using a simple text editor. The disadvantage of this method is that there are lots of files in pak1.rez and it can take up lots of hard disk space. As you can see, the format of .HAG files is nearly identical to the .TIK file format.

����������� The .HAG files used in the sample map are actually copies of the .HAG files used in the game. If you look in your�My Documents\EA Games\Medal of Honor Pacific Assault(tm)\moddir\WeaponSample\models� folder you will see the folders �weapons_test� and �statweapons_test�. This is where the copies of the game weapon .hag files are stored. In the game they are normally stored in the �weapons� and �statweapons� folders, but for testing the mod we need to rename the folders so that the game will use the modified .hag files instead of the game .hag files. The reason for this is because the game searches pak files (.rez, .pk3) first by looking in the moddir, then in the game folder. If it doesn�t find the file, it then looks for directory files (not pak files) in the moddir folder, then in the game folder. Our �shootingrange.map� test map references �weapons_test\*.hag� files not �weapons\*.hag� files. Because of this, the game will not find the hag file in the game�s pak files, so it will look in directory folders, starting with the moddir folder, then find it in the moddir\WeaponSample\models folder. If �shootingrange.map� used �weapons\*.hag� for the file name, the game would find the file in the game�s pak1.rez file, and not look in the moddir folder. You can still create .hag file mods with the exact same name as used in the game. You just need to pakage up the mod using the PakFile tool (pakscape) and give it a name like pak15.pk3, or anything with a higher number than the .rez files. That way when the game searches the pak files, it will see your mod file first, since it searches the moddir pak files first. To summerize, we rename the directory for the .hag files because the game�s search order for finding files is: moddir pak files, thengame pak files, then moddir directory files, then finally game directory files.


Interpreting the Spreadsheet

����������� Open the spreadsheet by clicking on this link: MOHPA Weapons.xls.If asked to open the file you can either click Open or save the file to a location on your hard disk and then open it for viewing. The spreadsheet contains most of the pertinent values for users interested in weapons modification, and was used by both the Single and Multiplayer Lead Designers for MOHPA to balance the weapons relative to one another.By clicking the different worksheets at the bottom, you can view the weapon values for Stock MP, MP Realism, Single Player, and also the Stock MP settings from Breakthrough.

Some of the values in this spreadsheet are generated from formulas (such as the Movement Deltas, Damage/Second, and Realism Bulletrange values) -- this is intended to reduce iterative recalculation of values and assist in qualitative weapon balancing.The Stock MP settings were obtained from many cycles of playtesting.To compensate for the relatively smaller selection of Japanese weaponry, we have implemented several benefits that could be envisioned as being properties of the Japanese Soldier, rather than the Weapon.These include greater accuracy when prone, quicker accuracy recovery times after reaching the maximum accuracy fire threshold (from holding down the fire key or pressing it rapidly) as well as faster run speeds regardless of weight on some weapons.In Realism, the Japanese movement speed bonus has been removed.


Anatomy of a Weapons HAG File

A quick summary of the most pertinent parameters is as follows:


  • Bulletrange � This value is the distance from the player beyond which a bullet trace will to detect collsion will terminate.Think of it as the �height� of the cone which defines the volume that a bullet will exist in.In Stock MP settings they are all slight variations on 4000.The Bulletrange values for Realism are based on real-world maximum effective point ranges using the conversion of 16 Radiant units per foot (or 48 per yard).Any value over 16000 for realism bullet ranges was topped off at 16000 for purposes on computational efficiency (it�s probably not the best use of your CPU�s time and performance to detect collisions any farther from the player than this)
  • Bulletspread � this parameter includes 4 values that indicate what the size of the weapons cone will be and how wide the targeting crosshair will spread open when set to Dynamic.The first two values are the size of the cone when stationary, while the second pair defines the size of the cone when moving.The values within the pairs should always be the same.There are 3 flavors of Bulletspread, one for each stance (standing crouch, and prone)
  • FireSpreadMult � FireSpreadMult is a parameter comprised of 4 values that defines the accuracy of the weapon as it is fired repeatedly.��
    • The first value defines how quickly a weapon becomes inaccurate.So a low value will make a weapon tend to stay more accurate as it is fired repeatedly, while a weapon with a high value will quickly become inaccurate.
    • The second value is how quickly a weapon becomes accurate after ceasing fire.In this case, a smaller value will make the weapon return to base accuracy slowly, while a high value will make it become accurate quickly.
    • The third value is the maximum accuracy of the weapon, visually displayed as the maximum extents of the dynamic crosshair.Most weapons have a value in the range of 5 � 10, although semi-automatic weapons still retain the value of 200.
    • The final value defines a brief delay or pause after the weapon is done firing when it will begin to return to base accuracy.Modify this to make a weapon seem sluggish or more responsive.�������
  • BulletDamage � this is the amount of damage a single bullet will do when it hits.However, keep in mind that the damage done is modified by the hit location table.So while a headshot will likely kill, and a torso shot will do the amount of damage specified here, limb shots will be less than this.
  • FireDelay � This is the delay in between shots.It has the most effect for automatic and semi-automatic weapons.The delay between shots for Bolt-action rifles is defined more by the rechambering animation than the firedelay setting, so when modifying these types of weapons, it isn�t as important.��
  • MovementSpeedthis is the speed the player will move at when this weapon is equipped.The weight values are provided in the spreadsheet for reference.
  • Melee Range/Damage � in the HAG files, these values are the secondary bulletrange and damage.Pretty straightforward � most bashes use a value of 50-60 points, while a bayoneted weapon will do 150 points of damage (ouch!).
  • Starting Ammo � this is the amount of ammunition that is included in the clip of the weapon
  • Clipsize � How many bullets are included in a clip.Unless you are interested in making your own weapons, it would be historically inaccurate to modify these values, but feel free to do so.Note � the total amount of ammo you will start with is the sum of the Clipsize and the Starting Ammo.
  • Tracer Frequency - This defines how frequently a tracer bullet will be fired out of the weapon.If the tracer frequency is X, then 1 out of every X bullets will display a tracer.


Additional Related Cvars

����������� Using these console commands and variables may prove helpful when tweaking or balancing weapons in the Shooting Range.

  • material_debug � this cvar, when set to 1, will display information regarding the surface that you are pointing the weapon at, as well as an arrow indicating the normal that is perpendicular to the surface you are pointing at.Could be useful for debugging collision.
  • sv_showdeeptraceshapes this will display the collision bounding volumes of characters and will highlight the body part you are currently aiming at.
  • g_drawPlayerBullets � this will draw color-coded lines showing the path of bullets.

Red � bullet hit character for damage

����������������������� Blue � bullet missed

����������������������� Yellow � bullet hit a collision detail

  • timescale � default is 1.By entering values lower or higher than this, it will slow down or speed up the game.Good for checking weapon animations.
  • showActorInfo � displays information on characters, such as health and morale states
  • noclip � enter this command to fly around the map rapidly
  • g_showEntInfo � set this to 1 to display additional information about the entity
  • sv_showEntNums � show entity numbers
  • whois <entNum> - outputs information about a specific entity number into the console


The Weapon Tweaking Process

����������� The best way to tweak weapons is to balance the values in the spreadsheet first before touching any of the HAG files to get a sense of the relative strengths, nuances, and weaknesses of the weapons relative to one another.Once done, the values of the weapon need to be transcribed into the individual HAG file in order for the changes to take effect in game.The HAG file should be saved in your mod folder with the same path name as the original HAG file (relative to the game directory), only in you moddir/WeaponSample folder. The MDK ScriptEditor will save it there by default. Once the HAG files are modified, run the Shooting Range map (or any multiplayer map) to playtest and assess the results. When you are finished tweaking the mod, you can pack up the .hag file in a .pk3 file and name it pkn.pk3 where n is greater than 1, and not used by any other .pk3 or .res file name. You can then ues Mod Configure to add the pack to the mod and then it can be shared and automatically downloaded by clients.


Changes from Medal of Honor: Allied Assault

����������� For the most part, most of the values and variables mean the same as they did in Allied Assault.However, a few notes should be made about those few changes.During development, we learned that the fireDelay values only work in multiples of .05 seconds between each bullet (this is a result of the fact that the Quake III network code only updates every 1/20th of a second).Although the settings were set to multiples other than .05 in MOHAA and the expansions, all along they were automatically rounded down to multiples of .05.Also, this value needed to be modified by subtracting -.001 from the value (this is due to a bug deep in the fire delay code that was too extensive to be addressed for ship).For modification, please make sure all fireDelay settings are multiples of .05, then subtract .001.

Also, due to the nature of changes in the engine, the Allied Assault numbers proved to be a good ballpark reference, but using them verbatim didn't get the best results.The most notable change is for the 3rd parameter of fireSpreadMulti setting- this represents the maximum inacurracy of the weapon and now uses much lower values than before for automatic weapons.We recommend that you enable the Dynamic Crosshair option to balance and tune any weapons mods.


Realism Settings

While there currently is no option exposed in the User Interface to activate realism settings, it can be activated by setting the cvar g_realismmode to 1.Our initial intention was this: instead of imposing our notion of realism onto the community, we wanted to give the community the tools and documentation they need to make their own realism settings.Past MOH-PC games implemented Realism simply by doubling the damage values from the Stock MP settings.However, the Online MOH Community made it known that this was not the preferred way to do this, as the most popular realism mods attempted to simulate the real-world characteristics and behaviors of the weapons.

Under advisement and feedback from one of our military advisors, Sgt. Quay Terry, who served in the Marine Corps (and is a self-admitted geek about weapons and ballistics!)I have attempted to do the same here � create realism settings that model the real-world ballistics of the weapons.However, in the European Theater, the German weapons were, comparable or superior to the Allied ones.In the Pacific, this was not the case with the Japanese weaponry, which were inferior primarily in terms of the caliber and damage power of bullets.Later in the war, manufacturing quality issues adversely affected accuracy as well.These realism settings have not been playtested or balanced!They are presented, as is, primarily for relative historical reference and for the benefit of the community and users interested in weapons modification.