Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Low FPS performance with Atomic Bomberman #2

Closed
tokariu opened this issue Nov 9, 2018 · 10 comments
Closed

Low FPS performance with Atomic Bomberman #2

tokariu opened this issue Nov 9, 2018 · 10 comments

Comments

@tokariu
Copy link

tokariu commented Nov 9, 2018

I have trouble running Atomic Bomberman with cnc-ddraw (v1.2.4.0 and Win7x64). I know it's not mentioned anywhere, but the game has the same type of ddraw issue as C&C, Carmaggeddon and others.

When I apply the cnc-ddraw .dll to the gamefolder and start the game it looks perfect at first. All colors are working as intended again.
But while playing the game i noticed several lags and low framerates. I checked the FPS with bandicam while running it with opengl/d3d renderer and I only got 12-18 FPS while playing. it is a fast paced game and these low-fps are breaking the gameplay. I tried all possible options in the ddraw.ini file but whatever I chose (renderer, maxfps, maxframerate etc.) there is no change in low-fps.

I also have a virtual machine running windows XP with Atomic Bomberman. When I play it there, the game performance is overwhelming good, it runs with something like >200fps (estimated), so the gameplay is lightning fast and smooth.

What causes the issues on AB? is it a general win7-10 problem or a ddraw.dll emulation problem that the perfomance is so low?

@FunkyFr3sh
Copy link
Owner

There should be no difference in performance on win 7, it probably runs even faster there than on your VM. The only thing that can cause problems on newer versions of windows are the compatibility modes, make sure you got all of them disabled when using cnc-ddraw.

@FunkyFr3sh
Copy link
Owner

FunkyFr3sh commented Nov 9, 2018

Just tested the game and I got the same bug on Win 10 too! The game is running too fast and somehow this is causing it to glitch. I slowed it down a bit and it worked perfectly :)

The game is not using many features of directdraw hence why the maxgameticks setting isn't working with this one.

Edit:
Should work fine now with the new nightly build https://github.com/CnCNet/cnc-ddraw/releases

@tokariu
Copy link
Author

tokariu commented Nov 10, 2018

@FunkyFr3sh thanks for looking into this issue.
I just had a little time to check the new release and settings. I'm not done yet, but it looks like the maxgameticks is the key for a better performance.
on my core i7 win7x64 setup I found maxgameticks = 60 as too slow. 0 (infinite) however is working even slower. I got best result with maxgameticks from 2500 to 5000.
However these results are still not perfect. Compared to the Atomic Bomberman instance on Windows XP running on VirtualBox, it is still low-fps and lagging frequently.
If I had to choose I would still play it on the VM, because it runs lightning fast and without lags, which is a bummer in multiplayer games.

I also noticed: in the VM at the main menu of the game, the bomb-icon is pulsating at an insane speed, just like it used to be in the late 90s when the PC got more powerfull than in the mid-90s when the game was released.
when I start the game on win7 with ddraw.dll the icon at the main menu is pulsating very slowly, regardless of the maxgameticks setting.

I think it needs some further investigation to get things running perfect.

@FunkyFr3sh
Copy link
Owner

FunkyFr3sh commented Nov 10, 2018

Oh, you can't actually use such high values (it will just set itself to 0 if you try that). Valid values are 1-999 for maxgameticks.

For me it works fine with anything between 60-500, above that it will start to run slow again. I actually been playing the game for 1 hour the other day (it's pretty fun!) and I didn't had any problems with 60. (Using Win10 x64 on a i5)

The bomb animates very fast for me with maxgameticks 0, I'm just having these random slow downs during the gameplay. I guess you might have another problem on top that I can't reproduce :( I could maybe try to set up a win 7 VM and hope I get the problem too since it doesn't seem to happen on win 10.
Do you happen to have a win7 vm and tested it in there?

Edit:
Make sure you edit maxgameticks at the new [BM] section added by the latest build, this one overrides the one on top!

@tokariu
Copy link
Author

tokariu commented Nov 12, 2018

of course I deleted all [game] sections before and edited the main options, so the settings did not get overwritten again.

ok I didn't know about the maxgameticks 999 limit.. but I got better performance with higher values towards the 999 limit.

but I think that all doesn't really matter, because I tested something else and it seems it's not the fault of cnc-ddraw.
I deleted ddraw.dll/ini so bomberman can start without it. On Win7x64 I applied Windows 98 compatibility settings on bm95.exe. If I start it right away I get the wrong ddraw color palette, so I need to use the workaround where I kill explorer.exe before I start the game. I start using a batch file:

taskkill /F /IM explorer.exe > NUL
BM95.EXE
start /B explorer.exe

Then the game runs with the correct colors and without using this ddraw.dll. At the main menu I already noticed the bomb-icon is pulsating very slow in contrary to the winXP attempt. While playing I noticed there are again the same random lags while playing as with ddraw.dll before. It also seems to run generally on lower fps (I couldn't measure it without running on d3d/gl, but it felt again like 12-18fps "non-fluent")

Therefor I think the problem of the poor performance is not due to ddraw.dll, but due to something else, maybe Windows 7/10 itself. It's probably something to do with the compatibility setting.. because the pulsating bomb-icon at the menu is always slow.. and it should be lightning fast. so something on the host is synching cpu-time already for the game.

To see Atomic Bomberman at full glance while running on VM Windows XP, I recorded a video to show you how smooth it is able to run when everything is working as intended. Here ya go:

https://streamable.com/cb4dq

if you compare it with win7/10 gameplay, you'll see a difference especially when the player is skating around very fast. it feels like playing a Shooter game with 15fps on one machine and then with 60fps on another machine..

@FunkyFr3sh
Copy link
Owner

Here is how it looks for me on win 10 x64 (1803):

With maxgameticks = 0:
https://drive.google.com/file/d/1oJbcMDbXU1z59pKQWC9Rc2xVrIGdKfX8/view

A lot of frame drops, goes down to as low as 20 FPS

With maxgameticks = 60:
https://drive.google.com/file/d/1IX8d-Xo3Ug6KPLEjwaHYKM8-a2g-u1Cj/view

Very stable, seems to have no issues from what I can see

Note: I enabled the cnc-ddraw FPS overlay, pay attention to the FPS counter in the top left

@tokariu
Copy link
Author

tokariu commented Nov 12, 2018

Ok, I found the reason and the final solution

The reason is Microsoft really f*cked it up with the, in MS Vista introduced, Game Explorer (GameUX.dll) which incorporates update checking and game information. Notice: This wasn't available in WinXP. and probably isn't available on win8/10 anymore (i don't know), so if it's not available the issue here probably won't even exist!
Lots of games from that time share the same issue (like the original version of Half-Life, Tomb Raider 4, Ballistics etc.)

please read this thread to see the details and amount of f*ckup MS did with it's game explorer:
https://answers.microsoft.com/en-us/windows/forum/windows_other-gaming/windows-7-game-explorer-interfering-with-game/efd39c74-cfab-4c2c-b6c5-834b8849a1b3

So what happens when I start the game (bm95.exe) on Windows 7? The instant the game is launched, rundll32.exe is spawned with the GameUX.dll and constantly polls the dns, network and domain functions in the OS. rundll32.exe then constantly takes about 12%+ CPU load but the actual game is not launched. So beside huge CPU load, nothing happens, the game process is frozen.
But if you start the game a second time, the game suddenly loads - without any Win98 compatibility layers applied. However, due to the rundll32.exe cpu-load the game runs actually with really poor performance.

Now, how to run Atomic Bomberman on Windows 7 so that it runs smooth and perfect like on Windows XP back in the days?

  1. Install Atomic Bomberman (Full installation)
  2. copy the cnc-ddraw .dll to the game folder to fix the color problems
  3. do not start the game directly with bm95.exe and don't use any compatibility options.
  4. either get rid of game explorer (see link above) or my personal solution: create a batch file (.bat) which starts the game twice and then kills rundll32.exe:

bm95-start.bat

@echo off

start bm95.exe
timeout 5
start bm95.exe
timeout 5
taskkill /F /IM rundll32.exe
  1. start the game with bm95-start.bat

that way rundll32.exe doesn't steal any cpu-load and ddraw.dll fixes bombermans color problems. Works perfectly on Win7.

@tokariu
Copy link
Author

tokariu commented Nov 12, 2018

@FunkyFr3sh I see :) on your win10 machine the maxgameticks = 60 video version is exactly how it should run and it's the same as in the VM-winXP machine - or with the gameUX.dll fix above.

I'm glad we sorted this out, because this game is timeless and one - if not the greatest - of all multiplayer titles ever :)

@FunkyFr3sh
Copy link
Owner

I see, that's interesting! So you actually didn't had an active internet connection on that PC and that triggered the bug?

I actually start the game via "bm.exe" since "bm95.exe" doesn't work on win 10 (not sure if that makes a difference...)

Anyways, I'm going to close this now, thanks for sharing the solution, I hope it will help others having the same issue in the future :)

@tokariu
Copy link
Author

tokariu commented Nov 12, 2018

that's right, probably it would have worked with internet connection, but how silly is that from MS that a game won't start due to game explorer if you're offline.. i have no words for this behaviour..

I don't know, I don't even have a bm.exe.. just the bm95.exe. Maybe you've got a more recent game version, because I installed it right from the CD-ROM from the year 1996 or 1997.

next step: trying to get network game starting. It should actually work with this guide:
https://www.oldpcgaming.net/how-to-play-ipx-spx-games-over-lan/ :)

happy gaming :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants