Showing posts with label games. Show all posts
Showing posts with label games. Show all posts

Tuesday, July 12, 2011

Sims Medieval Fails To Start, or Why I Love Electronic Arts

I got my wife a copy of "Sims Medieval" for her birthday a few weeks ago (DVD from Amazon), and she was really pleased and looking forward to playing it. Sadly, we've run into nothing but problems, and EA's support (both email and phone) has been useless.

So, allow me to vent a little here and perhaps share a fix or workaround that search engines will be able to find, assuming someone comes up with a tip :)

Some info on my wife's machine: It's running Windows 7 64-bit, and is a beefy laptop with a decent video card. Sims 3 ran fine on it.

Issues #1: DVD fails to be read
Right out the gate, we hit a snag since the DVD wouldn't be recognized by the drive in my wife's "gamer" laptop. After hunting around for a while I found other people had run into this, and the suggestion was to download the game from EA's Origin site (basically a Steam knock-off). The product key in the DVD case works to get the digital download for free. So, I downloaded it (takes ages) and installed it without errors. Yay! Not quite...

Issue #2: The game fails to launch/start
The game creates a desktop icon which runs a little launcher application. Clicking on the "Play" icon in the launcher is supposed to start the game, but nothing (visible) happened. Research online showed this was not something other people had run into, and several tips were provided on forums:
  • Try downloading the game again and re-installing - Made no difference
  • Disable your anti-virus (!) - I checked any the AV product had not blocked any of the apps related to the game, and disabling real-time scanning made no difference
  • Disable UAC (!!) - made no difference

Note: I really don't recommend doing the last two things - you're opening yourself up to compromise by malware

Looking into the Windows Event Viewer, I noticed there were entries for each time I had tried to launch the game, indicating that the executable had crashed. The information indicates that the app (TSM.exe) is hitting in invalid instruction exception which is not handled... Looks like a bug to me...


Fault bucket 2466582291, type 1
Event Name: APPCRASH
Response: Not available
Cab Id: 0

Problem signature:
P1: TSM.exe
P2: 0.0.0.8065
P3: 00000000
P4: TSM.exe
P5: 0.0.0.8065
P6: 00000000
P7: c000001d
P8: 00c6fdfd
P9:
P10:

Since I'm a geek (or perhaps just a masochist), I decided to take a closer look at the crash dump. For some reason the code is executing an invalid instruction deliberately - after setting up an exception handler. I am guessing this is part of the DRM solution (SecuROM, which is from Sony, ahem! :). I would guess this is aimed at making debugging and reverse-engineering harder, but if it makes the games unplayable then you wonder how they can stay in business?

Here's a disassembly dump of the code in question:


0:000> u 0106fe0b
TSM+0xc6fe0b:
0106fe0b 683efc0601 push offset TSM+0xc6fc3e (0106fc3e)
0106fe10 64ff3500000000 push dword ptr fs:[0]
0106fe17 64892500000000 mov dword ptr fs:[0],esp
0106fe1e 0f0b ud2 <-- The app crashes here
0106fe20 03648f05 add esp,dword ptr [edi+ecx*4+5]
0106fe24 0000 add byte ptr [eax],al
0106fe26 0000 add byte ptr [eax],al
0106fe28 83c404 add esp,4
0:000> lmvm tsm
start end module name
00400000 01e71000 TSM T (no symbols)
Loaded symbol image file: TSM.exe
Image path: C:\Program Files (x86)\Electronic Arts\The Sims Medieval(TM)\Game\Bin\TSM.exe
Image name: TSM.exe
Timestamp: Wed Apr 27 12:58:42 2011 (4DB87572)
CheckSum: 012BE735
ImageSize: 01A71000
File version: 0.0.0.8065
Product version: 0.0.0.8065
File flags: 0 (Mask 17)
File OS: 4 Unknown Win32
File type: 1.0 App
File date: 00000000.00000000
Translations: 0000.04b0 0000.04e4 0409.04b0 0409.04e4

The UD2 instruction is an special instruction used to generate un unsupported instruction exception (see here and here). It's been supported for ages, so it's not an issue with the processor in my wife's laptop (Intel Core 2 Duo) being too old.

EA Customer Support:

In one of EA's forums, it was mentioned that you could email them with bug reports. Perhaps this was during the Beta only? I emailed them but have yet to hear back...

In a fit of insanity I thought I might get something useful out of calling EA Customer Support. After some scripted steps (collecting DXDiag information) the call turned tragi-comical as the rep told me that my wife's video card and then processor were not supported. (The CPU is .2 GHz slower than the recommended Windows 7 specs, and her video card is not on the "blessed" list).

I mentioned I got the DVD from Amazon, and he told me off, saying buying games from Amazon was a bad idea and you "never know what you are going to get". (WTF? I didn't but it from some reseller on Amazon, it's the same product sold in all other stores!) He then suggested I download the game from Origin (despite me saying I had done this already), and then said I could install the game "on the Internet" so it wouldn't matter what video card or CPU my wife had.

Tuesday, September 23, 2008

Fun iPhone puzzle game and an interesting blog

I've been enjoying the puzzle game Subway Shuffle on my iPhone. It's has a clean, simple design, is easy to play and challenging, plus I love this sort of abstract puzzle. (There's also a Mac trial version but no PC version).

The author, Bob Hearn, was a student at MIT, and it looks like this game was part of his Ph.D. research. (No, I haven't read his dissertation :P)

An unexpected discovery by way of the Subway Shuffle website is Robert Brinkerhoff - a talented artist who has an interesting blog covering art and life as an American in Rome.

Wednesday, June 18, 2008

Hell's Kitchen game

After last night's episode of Hell's Kitchen I noticed an add for a computer game based on the show. You can play it here for free (Windows-based PCs only currently). I haven't had a chance to try it out (that will come tonight), but it looks like it could be fun for a few minutes.

It looks like it might be bit like the Sushi restaurant game {C} sent me last week. That game is very addictive (and quite hard!)

In terms of this season's HK, I must say I don't really think any of the chefs are that impressive, and I'm not so invested in any of them. I predict Christina will win, but that she won't actually get to cook much at Gordon's new restaurant. (They'll probably leave that for the real chefs).

In other Gordon Ramsay news, the US version of Kitchen Nightmares will return to Fox in the fall. While it is not half as good as the UK version, it will have to do. Perhaps they will try to emulate the UK show a bit more, instead of trying to stir up drama and conflict.

Thursday, December 14, 2006

Retro games

I recently came across Retrospec, a group of hobbyists dedicated to recreating classic Spectrum and Commodore 64 games.

They have several completes games available on their website, including one of my all-time-favourites, Head Over Heels. I'm happy to report that Head Over Heels works well on Vista! :)

Then of course, there are emulators that let you run the original C64 and Speccy games on your PC. Some quick links: Gamebase64, Lemon64, C64.com, VICE

Somehow I'm more inclined to play remakes of the classic games that use the improved graphics and sound capabilities of modern PC's, but every now and then it's fun to fire up the originals and bask in their SID-tuney glory!

Saturday, November 18, 2006

Scrabble: Man vs. Machine


The Seattle Times today has a story about recent man-machine match in Seattle. Jim Kramer is the 2006 U.S. Scrabble Open champion, and played a best-of-3 match against RealNetwork's new Scrabble game. Jim managed to beat the computer 2-1, and walked away with the $10,000 prize.

Jim said:




...it was a victory that he wouldn't expect five years from now. The computer programs will be much more sophisticated, he said. "They'll just have much more brute force."


I'm not sure how much stronger Scrabble games will be in 5 years - Scrabble is a fairly simple game for computers to play (unlike, say, Go). The mechanics of the game have documented algorithms that can be used (Appel & Jacobson's "The world's fastest Scrabble program", for example). The tricky bit is the strategy - often playing the highest-scoring move will not ensure a win against a strong human opponent.

This is the algorithm I implemented for fun many years back when I was in university (as a hobby). The project was really fun and had some interesting challenges, the first of which was filling in the few gaps in the above paper so that the algorithm was clear. Other fun things (at least they seemed fun to me at the time):




  • Where to get words from? The most essential part of a Scrabble game is having a good list of words - they should be legal Scrabble words of course. I found a few free word lists online and used them, but had to try to prune out invalid words (proper nouns, acronyms). Eventually I found a nice OWL/OSW word list (I think it was 2-8 letter words) and augmented that with some longer words from my other source. I think in the end I had 130,000+ words.


  • Storing the dictionary in a file. The naive solution is to use a big text file. The program would then read this in and build a DAWG ("directed acyclic word graph" incase you care) for use when searching for words. However this was slow, and the file was huge. So, I started playing with ways to build the DAWG once, and save it as a binary file that was smaller and could be loaded quickly.


  • Compressing the dictionary. It turns out that there is a lot of redundancy in English words, and the DAWG has lots of sub-graphs that are redundant. This means wasted space on the disk (not such a big deal) and wasted memory (more of a big deal). I was coding all this in C/C++ and DJGPP (a free 32-bit compiler and port of the GNU C libraries). This meant I could use more than 640kb in DOS/Windows, but my home machine was not that beefy. (It was a 486SX with 4MB of RAM if I remember right). So, the huge dictionary I was using actually had problems fitting into memory unless I reduced it's size somehow. The solution was to look for the redundant parts of the DAWG and "fold them" onto themselves. Finding matches for sub-graphs was fun, and I had many iterations of my "dictionary builder and packer" tool. Initially it would take an overnight run for it to produce the final output file, but in the end it did its job in an hour or so! :)


  • Graphics. Since the DJGPP compiler and libraries I was using were pretty basic, I didn't have fancy Windows-style graphics I could use (no menus, windows, etc.) I used the fantastic free graphics library Allegro instead. This still meant I had to cobble together my own menus and code to handle the placement of Scrabble tiles. I also had a feature that would let you ask the computer for "hints". It would basically figure out all the possible moves you could make, and sort them in descending score. You could then drag a scrollbar and flip through all the possible words - really quickly.


  • Strategy. I left this to last and never really did anything wonderful (by this stage I was ready to move on to something else...) My game simply chose the highest-scoring move it could find and played that... It was still pretty hard to beat.


Sadly, the code to my Scrabble game disappeared when I upgraded to a new machine (stupid me for not having enough backups)!