Bug in 1.19


I’m not sure how many people see this, but I attach some screenshots which show a bug in Democracy 2. I’m playing Democracy 2 in window mode, and it seems that all I have to trigger this bug is to go to the country selection screen, switch to other things for a while, and then go back (yeah, I play and work at the same time). If I attempt to start the game at this point, the game crashes and my debugger is awakened (I am a programmer). Looks like memory corruption, but I have no idea why alt-tabbing would do this, unless… there’s a problem with the rendering code.

A slight variation of this happens after a game ends and I want to start a new one, possibly having the same cause: switching to other applications while playing.

This isn’t annoying so far, as I can restart the game, and it only takes a few seconds to do so, but it may have some deeper implications that I don’t know yet.




Yeah, definitely a bug in when treating “paint” messages from Windows. I open the game in window mode, fiddle around, nothing happens. At one point I need to open the calculator for a simple operation. I close the calculator (I was in the country selection screen) and bam! Problem occurs. Also, while with the calculator on top, when I moved it on top of the game, black background was being left behind (I expected to see the game menu, not black canvas), which points to the “paint” message I mentioned.

I switched to full screen mode, started a clean game, pressed alt+tab to switch away, then switched back to the game to obtain the same effect.

It should be trivial to fix I guess…

You are the first person to report this, so I’m assuming its more likely to be a PC-hardware specific issue than a code one. Has anyone else got this? It’s definitely some rendering corruption, looks like some texture pointers are getting swapped.
You arent running an over clocked video card are you? If you have another PC you can try it on, I’d be amazed if it does the same thing, but would love to know.

I installed the game on my brother’s computer, and I get a manifestation of this bug there too, but in the form a disappearing text from the “select” buttons. When I hover over a select button, the text appears, but when I move away, the text disappears. And all have to do is alt+tab while at the country selection screen.

I installed it on my laptop, and I get the same effect. So far, my desktop behaves as in the screenshots. My brother’s computer and my laptop show a milder effect, that where the buttons labels are gone until I hover over the buttons.

I asked a friend to install the game on his computer, and he reports that he doesn’t see the problem.

[You don’t have to worry about piracy on their parts, as they don’t like the game to begin with (my friend because there’s no LAN play, my brother because it’s not a brain dead shooter/adventure)]

When the mild manifestation occurs, the game doesn’t crash, so what I see may have something to do with my desktop setup, which saw lots of development tools installed on it during its lifetime, which could have enhanced some memory leaks.

I’m not running any overclocked components, and when you mentioned that I remembered that my video card’s fan needs a small push to start spinning, so I did that, but the effects are the same. But my laptop for sure is not overclocked.

Also, the video cards are different: my desktop has an ATI 9600 Pro, my brother’s computer has an integrated nVidia 6200 and my laptop has an integrated Intel 915. The spread is big enough to count driver bugs out.

I don’t know my friend’s computer configuration, but the difference is that, because he hates installers that need Administrator access, I gave him an archive of the installed game, which means that if the installer does something to the Windows installation, he didn’t get it.

I also tried running the game under Wine, just to see how that goes, and it went really bad, as most of the screen gets rendered white and alt+enter seems to kill the application instead of making it go into window mode, so I can’t use that to demonstrate anything related to my report. Manually changing data/config.muf doesn’t help either, as it gets reverted once I start the game. Where is this setting stored?

I get it too, in various forms very similar to uplink’s screenshots.

The funny thing is, it appeared just as I was alt-tabbing back to Democracy 2 after reading this post in the forum. I never saw it before! :slight_smile:

Anyway, I can consistently reproduce it like this:

  • Start Democracy 2
  • Click New Game (problem does not show up if I skip this step)
  • Bring another window into focus. For example: hit the Start button, alt-tab to Firefox.
  • Bring Democracy 2 back into focus.

It does not matter whether Democracy 2 is running fullscreen or windowed.

I’m running on Windows XP SP2, and I don’t get any graphical glitches in other games.

Yeah, it’s one of Murphy’s laws on computing: Software will work flawlessly until someone finds a bug. Once that bug is found, it will start manifesting for everyone else too, without anyone changing the way they use the software.

This is all very strange. I always go to great lengths to ensure that alt+tabbing and window mode changes work fine for my stuff, because it bugs me when other devs don’t do it. Is there some consistent factor here, maybe the same video card? what video card do you have?
Also, although it sounds obvious, this is under Windows, and not through WINE or similar yes? and not on Mac.

Hum, why didn’t I think to check the version… I have version “Full 1.18”!

I just assumed Impulse kept me up to date. :-/ Downloaded it on sunday, and haven’t received any updates yet.

I have a Radeon X1950 Pro card, Windows XP (norwegian), Dual-Core CPU

As I mentioned in my previous post, I get this effect on a wide enough spread of video cards: ATI Radeon 9600 Pro, nVidia 6150 (I said it’s a 6200, but I was wrong), Intel 915. All under Windows XP SP2 (american english). I have version Full 1.19.

I just tried version Demo 1.19 and I get it there too.

Good News: I’ve fixed this.
Bad News: haven’t uploaded a patch yet. But I will today.

Give us programming savvy customers a hint: what was causing it? So we can learn from your experiences.

it was a nightmare. its related to the text for country descriptions, the vertex data for all of the characters gets buffered so its not recalculated every frame. that buffer just sits there and gets read from. The problem seems to be when you leave that menu and then return to it later. in this case the buffer has been lost but the code doesn’t know that, and its full of gibberish. at this point pretty much anything might get drawn anywhere.
So it was an easy fix once spotted, i just rebuild that buffer whenever we switch back to that screen. It was a silly mistake not to spot before. The problem is, depending on your video card and what else is in RAM etc, it might not have any side effects at all, so it’s not consistent. I’m pretty sure I’ve fixed it now, and I’m uploading a new 1.20 version now. (which is taking ageeeessss)



Well, I still see the same thing in 1.20.

The patch also fails on my desktop, my laptop, and my brother’s computer. I get two modal windows on all counts:

  1. Patching process has failed (title: CRC failed)
  2. Patch Failed

My 1.19 Democracy2.exe file has this md5 checksum: dcd98307bc2aa31d67acdaf3e4f30b10. Is this correct?

After seeing this, I looked for virus-like effects: file changes in flight and resulting a different .exe on my hard drive: nope. I verified this by copying the zip file I received with the Democracy2.exe 1.20 file (md5: b4b2cb209b9be8a47b96ee165d4616ca) and the uncompressed Democracy2.exe from my hard drive to my Linux server, then uncompressed the ZIP on the server directly without Windows interference, and compared the checksums: identical.

I even deleted the game and installed clean, and still the same.

So, what now? Is my int bigger than yours or something? I thought 32-bit should stay 32-bit all around.

BTW, I also tried to apply the patch under Linux, using Wine, and it behaves exactly the same, so it can’t be a Windows thing.

The system configurations are like this:
Desktop: AMD Sempron 2200+ (the old Socket A kind, rebranded Athlon XP 1700+ with faster FSB), 1.5 GB RAM
Laptop: Intel Pentium M, 1.1 GHz, 1.24 GB RAM (256 soldered to the motherboard, that’s where the weird number comes from)
Brother: AMD Sempron 3000+ (the Socket AM2 kind, 64-bit enabled, running Windows XP SP2 for 32-bit), 1 GB RAM

What could be breaking this stuff?

I can still do this:

  1. Start Democracy 2
  2. Click “Start Game”
  3. Press the Win key
  4. Go back to Democracy 2
  5. Things are messed up in the menu, and they don’t go away.
  6. Repeat steps 1-5 to see different effects.

how did you get 1.19 in the first place?

I strongly recommend reinstalling from scratch using the original download link (its updated). I’ll look into replicating the problem again.

AHA: Ok, found what’s still causing it there, I’ll try and get it fixed today.

Bought from your site, downloaded from a link in the email I got after the order was processed. BMT Micro is the company that processed my order.

1.21 fixed it. Thanks.