1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

mods for Battlefield 2 crash under POL-WINE (Plain BF2 is fine)

Discussion in 'PlayOnLinux' started by oldrick, Nov 24, 2016.

  1. oldrick

    oldrick New Member

    Joined:
    Nov 22, 2016
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    I have an i3 system with an AMD R9 280 card. I am using Linux Mint 17 32-bit with the MATE desktop (I am using the 32-bit version of Linux Mint because I also run the Linux Dedicated Server kit for Battlefield 2 which is also 32-bit. It was easier to get the Dedicated Server running on a 32-bit Linux). The install uses the AMD proprietary driver 15.302. Installing BF2 (Windows) from a retail 3-CD kit into POL-WINE following the instructions on the site I made a few changes. I used the POL ver. 4.2.10 from noobslab and installed WINE ver. 1.9.11 under it. I set WINE to operate the Windows XP version. After the CD of Battlefield 2 was installed I patched BF2 up to version 1.41. (This was the version the mod runs under.) I DID NOT apply the v1.5 patch. To use BF2 v1.41 requires a no-CD version of bf2.exe which I use. The plain version of BF2 runs without a problem.
    I have installed mods (Hard Justice v1.3 and AIX 2.0) on top of the BF2 game and they installed without errors. The mods will start but will crash out after a short amount of time.

    The POL log is:

    [11/23/16 17:26:06] - Running wine-1.9.11 BF2.exe +restart 1 +modPath mods/hardjustice +fullscreen 1 (Working directory : /home/oldrick/.PlayOnLinux/wineprefix/141bf2_drive/drive_c/Program Files/EA GAMES/141Battlefield 2)
    wine: Unhandled page fault on read access to 0x000000a8 at address 0x75fa9e63 (thread 0009), starting debugger...

    And the Backtrace is:

    Can anyone tell me how to fix this problem with mods crashing?

    I used the POL-WINE method because I couldn't get BF2 to run with just WINE in my Linux Mint 17.
    - I am not a complete n00b but I am really not that much above a n00b. So, any fix will have to have a lot of step-by-step for me to understand.
    Last edited by a moderator: Nov 29, 2016
  2. oldrick

    oldrick New Member

    Joined:
    Nov 22, 2016
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    OOPS. Correction: Video driver is not what I listed. It's the AMD proprietary driver : fglrx-updates version 2:15.201-0ubuntu0.14.04.1 (Sorry about that).
  3. booman

    booman Grand High Exalted Mystic Emperor of Linux Gaming Staff Member

    Joined:
    Dec 17, 2012
    Messages:
    7,510
    Likes Received:
    542
    Trophy Points:
    113
    Location:
    Linux, Arizona
    Home page:
    Where did you get the BF2 Mod? I will download it and try it myself...

    By the way, if you install the 1.5 patch, you will get the expansions and it doesn't require a CD anymore. So then you won't need the no-CD crack
  4. oldrick

    oldrick New Member

    Joined:
    Nov 22, 2016
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    I got the mod from the Hard Justice mod website several years ago. I originally ran everything under Windows XP (I don't dare hook my XP system to net these days). The HJ site went dark about 2011-2012. You can probably find HJ on some other sites but you have to get the 1.3 version. Several of the sites still only carry the old 1.1 and 1.2 versions (which can be a bit flaky). There are also three add-on map packs for HJ v1.3 (HJ has about 12 maps with the default kit, so you don't need the add-ons). But, if you want the extra maps, you have to get the map packs that were updated to v1.3. Like the mod itself a lot of sites only have the old v1.1 and v1.2 map sets.

    With a quick look I found: http://www.bf-games.net/downloads/1220/hard-justice-v1-3-full-client.html. I think this is the good version. The team launched the 1.3 version but found a couple of mistakes in it after they released it and had to fix them. Since this file is listed as the "full" version I think it's the fixed kit. (If it's not you will have to find the HJ v1.3 "Hotfix" kit and use it to patch the HJ v1.3) I have read where the "good" kit is sometimes listed as the 1.31 version but I don't know if that was the HJ mod team's official name.

    I know the BF2 1.5 patch gets rid of the CD check but Hard Justice v1.3 has problems with BF2 v1.5. Using Windows XP, running Hard Justice v1.3 under BF2 1.5, the mod will crash randomly. The mod team knew about the crashing and while they were working on a fix they recommended a parallel install of BF2 updated to only 1.41 to run HJ. Unfortunately the team didn't have it fixed before their web site went dark. So, the only way to run HJ v1.3 reliably is use BF v1.41. Which is why I am using the no CD executable.
  5. booman

    booman Grand High Exalted Mystic Emperor of Linux Gaming Staff Member

    Joined:
    Dec 17, 2012
    Messages:
    7,510
    Likes Received:
    542
    Trophy Points:
    113
    Location:
    Linux, Arizona
    Home page:
    Wow, looks like you have done a lot of testing with this mod.
    You are treading new ground here...
    Basically, in order to get it running in PlayOnLinux, you will need to simulate everything you had setup in Windows XP. Your problem might be the mod its-self, but if it ran well in XP, then Wine may have some issues.

    I have only tested Battlefield 2 with patch 1.5 and it is very stable. When I do a fresh install, I will use the 1.4 patch first, then the 1.5 patch. This is the problem with game patches and mods with patches. I have to really really love a mod to go through all of these "hoops" in order to get it working.

    I'll download it and give it a try. I will report my results here.
  6. booman

    booman Grand High Exalted Mystic Emperor of Linux Gaming Staff Member

    Joined:
    Dec 17, 2012
    Messages:
    7,510
    Likes Received:
    542
    Trophy Points:
    113
    Location:
    Linux, Arizona
    Home page:
    I tested Hard Justice 1.3 in PlayOnLinux with Wine 1.8.3 and the BF2 1.5 patch.
    Never had any issues with crashing, but I didn't play for a long time either. Some of the maps are really good and others are just cut-n-paste objects everywhere. I wasn't able to allow 64 bots on a map for some reason, it maxed out at 32.

    Your crashing issues might be related to huge 64 maps with 100 bots running around. Battlefield 2 is only a 32-bit game, so you might be running into memory leaks or running out of memory. Try running the mod with System Monitor running on the Resources tab, then when it crashes you can check how much memory it was using.

    If you haven't play the Assault Mod yet, check it out, because they have added some great features like muzzle-flash, realistic damage and 64 player maps of the original BF2 maps. It runs on 1.5 patch
  7. oldrick

    oldrick New Member

    Joined:
    Nov 22, 2016
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    The bots were limited to 32 because the settings of "Create Local" affect the running of the Singleplayer. To play by myself with just the client I click on the [MULTIPLAYER] button and select the "Create Local" function. First I set the "Co-op" option under the AVAILABLE MAPS then set the MAX PLAYERS down to 1. Then I shove the "bot" slider up to 48 to get me and 47 bots. Then click the [Start Sever] button at the bottom right. Setting the number of player to "ONE" allows the game to run with just me.
    (With the default configuration the amount under "MAX PLAYERS" is subtracted from the total number of bots. You probably had the number of players at 16 and the bots set to 48. 48-16=32.) (EDIT [My Bad] minor detail: With the default configuration the amount of Players AND bots can not exceed 64. Under the MULTIPLAYER section the default number of players the slider is set at is 32. So, 64-32=32 bots. If you reduce the number of Players to 16 or less then you get the maximum number bots, 48, the normal settings give you. The highest value the bot slider goes up to is 48.)

    To go higher than 48 bots you have to make changes to some settings. In the folder:
    "drive_c/Program Files/EA GAMES/Battlefield 2/mods/hardjustice/AI"
    find the "AIDefault.ai" file and open it with a text editor. Find the entries:
    aiSettings.setMaxNBots 32
    aiSettings.maxBotsIncludeHumans 1
    Disable these with the remark function ("rem") in front of the line. Like this:
    rem aiSettings.setMaxNBots 32
    rem aiSettings.maxBotsIncludeHumans 1

    Add these lines under the Remarked out entries (they replace the REM'ed entries.)
    aiSettings.overrideMenuSettings 1
    sv.coopBotCount <- (Bad edit job. It should be the line "setMaxNBots 64" Sorry. OldRick)
    aiSettings.setMaxNBots 64
    aiSettings.maxBotsIncludeHumans 0

    And then save the new version of AIDefault.ai.
    (There are some comments in the AIDefault.ai file that might help.)

    I have found that to keep things working properly you also have to make another change. In the folder:
    "drive_c/Program Files/EA GAMES/Battlefield 2/mods/hardjustice/Settings"

    CORRECTION
    As noted in a later post
    For a Listen-Server (aka Serve&Play) the ServerSettings.con file is located in the Player Profile. Go to the player profile in:
    drive_c/users/<user name>/My Documents/Battlefield 2/Profiles/0002
    The numbered folder might be 0000, 0001, 0002, 0003, etc depending on the player name you're using. To find the correct profile in the numbered folder open the "Profile.con" file with a text editor to read the player name.


    find the "ServerSettings.con" file and open it with a text editor. Find the entries
    sv.coopBotRatio 50
    sv.coopBotCount 16

    Change the values to:
    sv.coopBotRatio 67
    sv.coopBotCount 64

    (The sv.coopBotCount line always has to match the sv.coopBotCount aiSettings.setMaxNBots in AIDefault.ai) <-(More Bad Edit job)

    You will have 64 bots and 32 of them will be on "TEAM 1".

    !> The BotRatio and BotCount get to be a little strange when you have more than 48 bots. The game engine seems to think that there can never be more than 48 bots. Which is wrong. The game engine can handle more than 48 bots. (Whether or not your computer can manage more than 48 bots without LAG is another story.) But, because the game engine "thinks" there are only 48 bots the interaction of the BotCount and BotRatio gets weird. The bot ratio is calculated on the number of bots up to 48 BUT, if the value is higher the calculation will always assume 48. The bot ratio assigns the number of bots to TEAM 1. Any bots NOT assigned to TEAM 1 automatically get moved to TEAM 2. So if you have more than 48 bots to get the ratio correct divide the number of bot you want on TEAM 1 by 48 and multiply by 100 to get a % value. So, from what is listed above 67% of 48 is 32 bots. Just be aware that no matter how many bots you have in total the number of bots on TEAM 1 can never exceed 48. 100% of 48 is = 48.

    If you have a system less than 5 years old you should be able to run 64 bots from the client without a problem.

    !> To get more than 64 bots usually requires the "Dedicated Server" over a network connection. The server kit has to have the same changes to AIDefault.ai and ServerSettings.con as listed above (adjusted to the larger bot count) and since the dedicated server doesn't have to create the 3D image for a player to look at the system has a lot more computing power available to manage the bots. The 100 bot case I mentioned was from a dedicated server on a LAN. In most cases the only place most of us can have a dedicated server is at a LAN party. (I still don't know how to connect a dedicated server AND a client box simultaneously to my home internet connection.) I do have a computer for my Dedicated Server as well as my usual client machine so I can have a LAN game with just me playing.

    I doubt the crashing problem is due to 100 bots on a 64 player map. The Dedicated LINUX Server has run 96-108 bots for several years with Windows XP client machines connected to it on a LAN and there were no crashes.

    I'll get to the Assault Mod eventually.

    Since you have Hard Justice running start the 64 player version of the ISLAND CITY map. The Canadian airfield at the lower right (South East) has an F15 with a Tactical Nuke (if the bots don't grab it first). Fly over the far end of the bridge north of the city, there's usually lots of enemy vehicles trying to get on the bridge, and drop the Nuke. Make sure you stay high enough the blast doesn't blow you out of the sky.
    If that's not to your liking... Try the A10s. One of them has cluster bombs and Maverick missiles.

    I'm still experimenting with settings. I found out the Video settings listed on the WINE HQ site are for an nVidia video card. Since my card is an AMD I've changed the settings and things seem to work better. I have also found a comment on the BattlefieldSinglePlayer Forum from someone trying to get BF2 and the AIX 2.0 mod working under Windows 10. He claimed that AIX 2.0 crashed constantly under windows 10 until he installed the Visual C++ Runtime 2005 kit. PlayOnLinux has several "vcrun" kits in the components list so I thought I'd try them and see if things got better.
    Last edited: Dec 12, 2017
  8. booman

    booman Grand High Exalted Mystic Emperor of Linux Gaming Staff Member

    Joined:
    Dec 17, 2012
    Messages:
    7,510
    Likes Received:
    542
    Trophy Points:
    113
    Location:
    Linux, Arizona
    Home page:
    Wow, thank you for being so thorough.
    I will try to edit the mentioned files and see if I can get my listenserver to run 100 bots on a single level. My machine has a 6-core AMD CPU and 8 GB of RAM. So hopefully it can handle the load and play the game at the same time. If not, I can always run a dedicated server and connect from one of my other machines.

    Since you have an AMD video card, I've read many times that drivers cause issues specially from AMD. Sounds like you have a good grasp on the driver situation, but I'm using Nvidia cards. GeForce 550 Ti, GeForce GTX 950, GeForce 750 Ti. Hopefully I will experience less crashing....

    I'll report my findings back here.
  9. booman

    booman Grand High Exalted Mystic Emperor of Linux Gaming Staff Member

    Joined:
    Dec 17, 2012
    Messages:
    7,510
    Likes Received:
    542
    Trophy Points:
    113
    Location:
    Linux, Arizona
    Home page:
    I made the requested changes to:
    • ServerSettings.con
    • AIDefault.ai
    But now my listenserver crashes every time. If I touch the in-game bot count, max players, etc... does this override those two files I made changes to?
  10. oldrick

    oldrick New Member

    Joined:
    Nov 22, 2016
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    With the "aiSettings.overrideMenuSettings 1" in the AIdefault.ai file the sliders in the Multiplayer - Create Local don't override the file settings. The in-game settings are based on the values inside the AIDefault.ai and the SeverSettings.con files. The in-game sliders only "adjust" the settings when the "override" is off (override off is the default). And be aware the maximum slider values are fixed. They don't accurately show what the file values are. Note that the settings in the AIDefault.ai and the SeverSettings.con files are also used for the Singleplayer function.

    Looks like you will have to reset everything to the default values to get your BF2 working.

    (EDIT: MORE LIKELY it was my bad editing in the AIDefault.ai entry in my earlier post. Use the aiSettings.setMaxNBots 64 entry as in the "fixed" post.)

    The crashing problem may be your WINE version. Even with the original installation of BF2 (without any mods yet) I had trouble trying to get regular BF2 to run on my system with WINE 1.8.3 and 1.8.5. (However, it may be possible my problem might be the AMD video drivers. You're using an nVidia video card, my is an AMD. And that might explain why I need WINE version 1.9.11 to get things working. WINE 1.8.x may not like AMD video cards.)

    Remember that BF2 is Single-Threaded. Having a multi-core CPU doesn't give any extra computing power to BF2 because it only uses one core. With multi-core CPUs under Windows XP you actually had to lock the BF2 "process" to a single core or the game would always Crash To Desktop. I haven't found that I need to set the CPU affinity in WINE to get BF2 working. (But, it is there if you want to try it. POL configuration, WINE tab, Task Manager, Processes tab, Right-Click on the BF2 Process and set the CPU affinity.)

    Since BF2 is single threaded the "Processor Rating" of a multi-core CPU will give a false idea of what your system can support when it comes to running BF2. For example: If you have two CPUs of the same series, a quad core at 3.0 GHz and a dual core at 3.2 GHz, the dual core will actually be better for BF2 because one core of the dual is running faster than one core of the quad. In general AMD CPUs have a lower Instruction Per Clock (IPC) rate than Intel units which can also give poorer results. I have gotten 48 bots running from a Listen-Server on an AMD Phenom II X2 550 BE but that was after I added a heavy-duty Heat-Pipe CPU Cooler and over-clocked the CPU from 3.1GHz up to 3.8GHz. As a reference Comparing my current stock Intel CPU at 3.4 GHz to the old Over-Clocked AMD CPU at 3.8 GHz... Even though the Intel is running at a lower clock its Single-Thread rating is 40% Higher than the AMD.

    Trying to get 100 bots running from a Listen-Server is probably too optimistic. I said you could likely get 64 bots running from a Listen-Server if your system was less than 5 years old. In my examples with 90+ bots I was quoting what I could get from a Dedicated Server kit.

    Moving the MAX PLAYERS slider down to ONE in the Mutliplayer - Create Local settings will allow the Listen-Server to run with only you playing on it. And setting the MAX PLAYERS down to one should stop the Single Player function from subtracting bots from the "Number of bots" slider value. Or, the setting "aiSettings.maxBotsIncludeHumans 0" in the AIDefault.ai file is another way to stop the game from subtracting a bot for every "human" player.

    NOW, I admit that all of my experience is with BF2 v1.41. There may have been changes with the BF2 v1.5 patch. I will have to install BF2 v1.5 and experiment to see if any of the "adjustments" still work.

    I'm back -
    I made a mistake in the file locations. For a Listen-Server the SeverSettings.con file is not where I said it was. It is actually located in the game user profile.
    drive_c/users/<user name>/My Documents/Battlefield 2/Profiles/0002
    The 0002 number will be different depending on the game name used. (i.e. 0000, 0001, 0002, 0003, etc.) Open the number folder then open the "Profile.con" file with a text editor to see the game user name.

    A quick test with the BF2 v1.5 install I've got showed that when the settings are done correctly my system can run 64 bots in a Listen-Server or Singleplayer.
    Last edited: Dec 12, 2017
  11. booman

    booman Grand High Exalted Mystic Emperor of Linux Gaming Staff Member

    Joined:
    Dec 17, 2012
    Messages:
    7,510
    Likes Received:
    542
    Trophy Points:
    113
    Location:
    Linux, Arizona
    Home page:
    Ok, I'm about to try with your new tips setting it in the My Documents profile.
    Do I still need to set it in AIDefault.ai?
  12. booman

    booman Grand High Exalted Mystic Emperor of Linux Gaming Staff Member

    Joined:
    Dec 17, 2012
    Messages:
    7,510
    Likes Received:
    542
    Trophy Points:
    113
    Location:
    Linux, Arizona
    Home page:
    Yup, it totally worked! I hosted my own LAN server by modifying .con file in my BF profile. Its hard to tell if there really are 64 bots when using Tab menu, but there was a lot more and I could actually play the 64 player maps for once.

    So did the Hard Justice team create bot paths for their 64 player maps? So far it looks really good and interactive. Some of the maps are so big that its hard to help my team-mates, but its still fun. I may have to try this at my LAN parties too.
  13. oldrick

    oldrick New Member

    Joined:
    Nov 22, 2016
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    Yes. The settings in the AIDefault.ai are the important ones to get more than 48 bots. The changes to the ServerSettings.con are extras to help with the stability of the game when it has more than 48 bots.
  14. booman

    booman Grand High Exalted Mystic Emperor of Linux Gaming Staff Member

    Joined:
    Dec 17, 2012
    Messages:
    7,510
    Likes Received:
    542
    Trophy Points:
    113
    Location:
    Linux, Arizona
    Home page:
    So what other tests do you want me to try?
    I really don't want to connect all 6 computers in my LAN, but so far it appears to run fine with Patch 1.5
  15. oldrick

    oldrick New Member

    Joined:
    Nov 22, 2016
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    Using the Tab menu only has room to list 21 names for each team. But, if you look below the list you can see the "total number of players" for each team. Which will show that you have more "soldiers" than just the names listed.

    Just be careful when the combat gets busy. Since the game is designed for a maximum of 48 bots the extra bots (from 49 - on) Do Not get a nametag on screen. You know, green for your squad, blue for friendlies and Red for enemy. And they don't get a map-dot on the mini map or the big one either. I try to be careful but I have given up counting the number of times I have killed "un-marked" friendlies. When "someone" appears suddenly moving toward me I'll often shoot before I see the uniform and recognise a friendly. (Even worse so much of the time the friendly coming at me is a Medic when I need him most.) Or, when doing a bombing run I take a quick look at the mini map, see nothing, drop a string, only to see the score ticker list "Teamkills" next to my name. You just have to take the -2 points for each incident. If my "assists" gets to be too negative I'll change class to a Medic and try to bring my minus points to a plus value before the end of the map.

    Yes, the Hard Justice mod Team did a full 64-player map bot path (aka navmesh) for the maps. Now, some areas the bots have no need to go into so in those places the path was removed to keep the bots out. Also, the navmesh was sometimes reduced to keep the game from getting too slow.
    Most mods with 64-player COOP maps have the full size navmeshes. AIX2 has them and I think BF2all64 (a mod that just navmeshed the 64-player BF2 conquest maps.)

    For LAN parties you probably have to do the changes to the AIDefault.ai on every machine on the LAN to keep each machine from crashing. I forget if the ServerSettings.con file has to be changed as well. Just remember the number of bots in the AIDefault.ai and the ServerSettings.con files have to be the same for stability. (One guy told me that you can get away with having the bot value in AIDefault.ai any value equal to or larger than the value in the ServerSettings.con file so it's easy to change the number of bots by only changing the ServerSettings.con file as long as it's less than the AIDefault.ai value.)
    Last edited: Dec 15, 2016
  16. oldrick

    oldrick New Member

    Joined:
    Nov 22, 2016
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    I was hoping that there was some setting or component that I was missing that when applied would fix things. But, there doesn't seem to be a quick fix.

    Your setup and mine are different so it looks like anything you try won't apply to my machine. I'll just have to keep experimenting. I do know that the mod team reported that Hard Justice 1.3 has problems in BF2 v1.5 so don't be surprised if something strange happens running HJ.

    I did manage to get my system to run longer by installing the vcrun2008 kit (listed as msvcr90 in the Libraries tab "DLL Overides" section of WINE Configuration) and installing the OpenAL32 from the Libraries tab "DLL Overides" section of WINE Configuration. But, I still get crashes. Usually after running a few maps in a cycle. Which is better than having it crash loading the first map.

    Thanks Booman.
    Last edited: Apr 1, 2017
  17. booman

    booman Grand High Exalted Mystic Emperor of Linux Gaming Staff Member

    Joined:
    Dec 17, 2012
    Messages:
    7,510
    Likes Received:
    542
    Trophy Points:
    113
    Location:
    Linux, Arizona
    Home page:
    No problem. Thanks for posting everything you have learned about Battlefield 2. There are still a lot of communities playing this classic game.
    I wish I had more productive input for you, but it seems you have a find grasp on the problem and the configs.

    Did you ever look into Battlefield Revive?

    I tried their downloader and it crashed in Wine...

Share This Page