So I've decided to start fixing PR's issues with Performances, and other Issues as a compliment to the development so that servers and players can run games lag-free, performance-issue free and crash-free as a dedication to those who developed code and helped developed for PR
Instead of uploading links, I decided to write tutorials instead
You will see bits and pieces of information as you browse here, but I'll do my best to fit it here.
So without due, let us begin
Before we start, we need to create a pr_edit folder.
Windows 7 Users: Simply copy 'pr' and paste and then rename pr (copy) to pr_edit.
XP users: Make a folder called pr_edit, open pr, highlight everything and copy, go to pr_edit folder and paste.
After it's done copying, go to bin folder (not rubbish bin), and right-click on prlauncher.exe and make a shortcut to desktop, and then rename shortcut to anything.
LIST OF BF2 CODES:
http://www.bfeditor.org/forums/index.ph ... opic=14164
https://www.realitymod.com/forum/f189-m ... g-bf2.html
This also may be useful for Python coders: BF2 Gameplay Scripting Guide v0.1
Files we want to modify:
objects_common_client.zip
objects_vehicle_client.zip
objects_statics_client.zip
objects_weapons_client.zip
We will look at two programs created by Bytehazard. All credits go to him
1. BfMeshView - bfmeshview200.zip. For viewing meshes, models and fixing uv maps, textures, meshes etc. Great toolkit!
2. BfMeshCheck - meshcheck100.zip. For detecting errors.
ByteHazard's BF Tools
We will start with BfMeshView first.
1. Extract it.
2. Open it up.
Get really familiar with it. Experiment and look around, get a feel for the simple UI.
After you have a feel for it, we will setup associations first. This is an important step that makes it easy to view meshes without manually doing it:
'Setup Associations'
1. Go to Options, Preferences.
2. At the bottom, tick .staticmesh, .bundledmesh, .skinnedmesh, .collisionmesh. You can obviously select others or all of it if you want to view those files without having to right-click and setup associations manually.
Done
At the far-bottom, under Miscellaneous, you can allow it to maximize (fill up the screen) on start, and change the color of the stage.
Now, to Bf2 Mesh Check.
Before we start, we need to first make a folder first for the mod files. It can be made anywhere, it doesn't need to follow a directory pattern i.e "C:\program files\ea games\battlefield 2\mods\pr"
The program hates special characters, and crashes when you scan it for more than 20 seconds if your mod has '_', '-' so make your mod have letters only to prevent crashing.
In this case, I made one on the C:\Games folder.
We need to go to C:\Program Files\*Game Folder*\Battlefield 2\mods\pr_edit (or pr)\content\objects_static_client.zip etc
Copy all those .zip and paste into the created destination which is C:\Games or wherever you made the folder. Right-click and press extract each archive to separate folder. The Mesh Checker cannot support archives or folders with anything apart from alphabets, so you need to extract the files so that they can be read.
To use:
1. You need to point the mod path. Since there's no browse option, you need to copy and paste it, or you can type it in.
At mod path, go to the folder where you created your game folder and copy the directory in explorer. Paste it.
There's also fast mode. I don't check it because I'm not sure if it's the most accurate.
2. Select your mesh type to load. You can load StaticMesh, BundledMesh or SkinnedMesh. In this case, we will do each of everything. After you selected your preferred option, Press 'Start'.
It will scan between 1-5 minutes. The errors are highlighted in Red.
Now to go through Errors and their meanings
Code: Select all
[font=Comic Sans MS][color=DeepSkyBlue]Glossary[/color][/font]
[color=DarkOrange]x = number[/color]
[b]Important:[/b] For every change, Go to [u]File -> Save to save[/u]
NaNs
Meaning: Bad Vertices. The number next to Nan is the number of Vertices that needs fixing. Not sure exactly, but it improves performances once it's fixed, and makes FPS more stable.
Solution: Double-click it. It will open BfMeshviewer. Over there, go to 'Tools', then 'Fix Mesh'. Go to File -> Save, and click 'Yes' to replace.
After you fixed them all, I like to rescan them to make sure it's fixed.
Afterwards, go back to the folder 'objects_static_client' and open it. Use Winrar/winzip/windows etc to make a zip folder and place it in your pr_edit folder to test.
To test:
Download the debugger here:
[url=https://www.realitymod.com/forum/f388-pr-bf2-community-modding/123029-info-running-debugger-1-0-a.html]PR 1.0 Debugger[/url] and follow the tutorial.
Now, open your launcher and create an offline profile. I like to create a profile called 'Test'.
After you made it, go to settings, select 'Test', and adjust setting to match this:
[code]
Profile 0003: test
Type: Offline
View Intro: False
Fullscreen: False
Display Mode: 800x600@60Hz
Enable Local RCON Commands: Ticked (Global Tab)
Video Setting: High
A quick warning, debugger is annoying and will show messages at first. If the game won't boot, try a different resolution.
Select a map, and load it. You have to press 'ok' about 15 times but once you load the game, go and spawn.
Turn on the fps counter by pressing the console key '~' on the top-left side, and type in renderer.drawfps 1. The one in debugger is more detailed, allowing you to have drawcalls and lots of other features to debug and monitor performance.
Boot Project Reality (unmodified) in debug-mode, go to a building that's causing lag (plenty in Fallujah West), open up console and type in renderer.drawfps1, press F12 for screenshot (Screenshot is in My Documents -> Project Reality), then go to Project Reality (edited) in debug-mode and do the same. You should see a difference in FPS, and maybe in draw-calls.
When I finish this, I will upload it
Update: Finished it, yet to upload. If anyone can suggest a way of taking out only the modified files while perserving the directory, please pm me.
What I basically did was compare the bf2 objects_server, objects_client, menu_client, menu_server to pr objects_common_server, objects_common_client, menu_client & menu_server and then extracted pr's files.
For the menu meme atlas, I renamed it from menu_atlas to meme_atlas.
I searched for all atlas files within pr, compared it to bf2 and placed it at the correct directory.
LINKS
Meme Atlas: TinyUpload.com - MEME ATLAS FIX
Mesh Particles: TinyUpload.com - MESH PARTICLES MISSING FIX
It's uploaded on the forum now.
More to come as I update the article with more tutorials like 3d markers and test out my tutorial.






