Holy...crap!
jase:
Quote from: Gus Smedstad on 2005 September 27, 12:32:58
That's what Sims 2 code looks like? Ye gods, it's spagetti! I haven't seen anything that bad since I stopped using BASIC 23 years ago. I started to do a trace, and I was astonished to see -
On line 0x1, the code jumps to line 0x19.
It's impossible for control to flow from line 0x18 to 0x19, since the preceeding line is a jump to 0x3B.
Ergo, there's no conceivable reason why the code at 0x19 wasn't located immediate after line 0x1.
Line 0x1B then jumps to line 0x2, where this segment should have appeared in the first place.
Line 0x4 jumps to 0x48. Again, it's impossible from control to flow from 0x47 to 0x48, because both paths are a jump to 0x28.
Line 0x48 jumps back to line 0x5, so we've got a one line digression for no apparent reason.
It's difficult for me to imagine a compiler writing code this bad. It has all the earmarks of code that has been patched by hand. I.e., as originally written line 0x4 jumped to 0x5, then the programmer realized he needed another instruction in there, so instead of inserting it and changing the line numbers, he changed the jump, added the code, and then jumped back.
That's horrible.
- Gus
Maxis behaviors are implemented as "trees" - binary trees. There are THOUSANDS of trees in the game. To represent them all in memory at once would likely take terabytes of RAM. The nodes of the trees are balanced and optimized by a tool that Maxis uses interally - which undoubtably produces this "balanced tree" output to avoid redundant data/code reads, minimize cache misses, and having to reparse the behavior data again and again. A good optimizing C++ pentium-optimizing compiler would give your code the same kind of treatment. What you see is actually "intelligent" tree balancing and branch predicition for performance. I can assure you the output isn't arbitrary.
J
dizzy:
Quote from: jase on 2005 September 27, 22:08:29
What you see is actually "intelligent" tree balancing and branch predicition for performance. I can assure you the output isn't arbitrary.
Well, the output may be "balanced" and "branch predicted" (for whatever that's worth :P), but the composition of the code is very much arbitrary. This is betrayed by the many instances (especially in the base game) of unused code, the massive blocks of duplicated code, and the weird, seemingly-random transitions from one iteration to another. No compiler I've ever seen produces output like that.
Hook:
Consider the case of toddlers playing in toilets.
The Prima guide, obviously working from the design documents and not the playable game, has said that toddlers only play in toilets when in a bad mood. Uh huh. Twojeffs said there was actually a test for the toddler's moods in the code, but the results were ignored, resulting in the toddler playing in the toilet no matter what their mood.
This isn't something that got optimized away, but an error in the script creation... and from what I can determine one that would be easy to make given the way the script development system works, and one that would have been damn difficult to miss if the scripting system used a proper procedural text language.
Hook
Kristalrose:
Well, since I know nothing about coding and trees and generating and whatnot, I'll leave all that alone.
I did have the move in "Magic bonus" happen to me, twice. Both times I had moved in a YA so they could transition and marry my sim. Is this what happened to you, also?
vecki:
I had it happen the first time I experimented with moving Bella in with the Goth family, nearly 5 million simoleons. Of course the next time I went into the lot I got the standard 'Bella has died on another lot' yada yada yada and shortly after reinstalled. But she is now resurrected courtesy of nightlife and planning to set herself up with a fabulous bachelorette pad.
Navigation
[0] Message Index
[#] Next page
[*] Previous page