Site search

Categories

January 2009
M T W T F S S
« Dec   Feb »
 1234
567891011
12131415161718
19202122232425
262728293031  

Links:

Recent Comments

Tags

Follow-Up: Money in The Sims 2

A while back I wrote about how to get unlimited money in The Sims 2 (website).  It was an experiment I started because, as a computer programmer, I was curious how the developers of that game handled large amounts of money.  I found two interesting things at the end of the experiment, and I should warn you that if you’re going to try this at home, you need to save your game often once you pass a billion simoleans.

Thing 1: There is only enough room in the user interface to show values of money under a billion.  Once you pass that, the dollar sign (or simolean sign, or whatever) disappears off the left side, and the final digit disappears off the right.  This isn’t really a problem, since neither of those matter when you’re a sim-billionaire.

Thing 2: The game uses a signed integer to store money.  This data type has a maximum value of 2,147,483,647.  When it passes that, it actually becomes negative.  This probably doesn’t make much sense to non-programmers, but the reason has to do with how computers store numbers.

An integer has 32 bits (each bit is a 1 or 0), where each bit represents a power of 2.  The bit that’s in what you might call the “ones place” has a value of 2^0 (two to the power of zero, or 1).  The digit to its left has a value of 2^1 (2), and so on.  The final digit, on the far left, is used to indicate sign (positive or negative number).  So as the number grows, it approaches its upper limit of 2,147,483,647 (2^31 – 1).  When it goes up again, the computer tries to carry the addition into the final digit the same as it would add any other number, and the number becomes negative.

This was one of the three possible outcomes I suspected when I started the sim-money experiment.  The other two possibilities were:

1. The programmers could have written an arbitrary upper limit, like 1 billion, or 999,999,999.  When money reaches that point, it could just stop accruing.  It’s not like anybody would mind.  You can’t actually spend that kind of money.

2. Whichever data type was chosen (a signed or unsigned integer, which goes twice as large), the programmers could have checked that money never passes its maximum value.  Money would stop accruing at that number.

I’m actually a little disappointed.  The Sims series is a game known for weird bugs, but this is a common programming mistake that’s been around for decades.  I’ll admit that we (programmers) don’t always think about whether a number could ever pass its maximum value.  But in The Sims 2, it wasn’t even hard.

Finally, I want to make one addendum to the unlimited money strategy I posted.  If you buy the “Mansion & Garden” Stuff Pack (the last one), it has solar panels.  When you build enough solar panels, your sims get a refund instead of a bill on Tuesday and Thursday.  This removes the one last thing you have to do manually during the unlimited money experiment.  You can literally just hit the high-speed button and walk away (although some events, like bad weather, can turn the speed back to normal).

Share

Comments

Comment from PcGamesGalaxy
Time March 20, 2009 at 8:39 pm

Make your SIM to get a good job and that’s all,put on fastest speed.And let them to do whatever they want!

Epic Spoon is a blog about video games, from guys who like to play video games. The opinions expressed on Epic Spoon are those of the authors of the blog, and in no way represent the opinion of the Internet. Read each author's profile to get a better idea of his intentions on this blog, what type of games he likes to play, and who he is. If you like what we have to say, bookmark us or our RSS feed. If there's something you've got to say, or something you want to ask, you can find our e-mail addresses in our profiles.