The client now supports two resolutions: 800×600 and 1024×768 – without a border! I discovered that the graphics actually scale quite well, so I’m slightly puzzled as to why Maxis originally decided to put a border around the screen when in 1024 resolution. I suspect the answer might be that today, scaling is done on the GPU and as such is much less expensive – either way, the result is that the game now looks better than ever! 😀
Since the last post, support has been added for more or less all the iff chunks in the game (with an exception for the BHAV and OBJD chunks).
I’ve added an analyzing feature to Iffinator, to aid me in rapidly supporting new chunks. The only major thing that is currently missing is decompression of SPR# sprites, which I’m currently working on. I’ll also eventually get back to 3D rendering, but mustering the motivation to do so is difficult. I really wish I had someone more experienced to help me with that. So if you’re reading this and you have experience with 3D rendering in C# and/or the XNA API, please do not hesitate to contact me!
As far as parsing SimAntics, I’ve implemented support for Sleep and Idle commands. More will be implemented over time, but progression will most likely speed up as more of the gameplay is implemented in the client.
So, since the last update, I have been working on adding normal transformation and normal blending. I still haven’t been able to figure out correct bone placement and rotation, so for the time being I’ve put it aside to work on what is probably one of the most difficult aspects of this project;
Recreating the VM.
For those unfamiliar with the concept, VM is short for Virtual Machine, and the core of The Sims consists of a VM named Edith, which is constantly running the code inside objects (sims are also objects with their own programs for Edith to run).
Now, in TSO, the VM is less important because you only control one sim at a time, but you can still turn on free will to have your sim be autonomous.
The task of recreating Edith is so massive and all-encompassing that it is hard to imagine where to start, but after quite a bit of research and cooperation with NIOTSO, I’ve decided to start by writing a basic parser for SimAntics (the language that Edith programs are written in) that translates it into a human-readable form. After that, the next step will be to design an interface so that SimAntics programs can easily call functions defined in the Project Dollhouse executable. If all goes well, after a certain amount of time I should have a VM built in C# that can load *.iff files in realtime and run their programs synchronously and display state changes on the screen. The Sims is basically just a graphical representation of such a machine.
Since so many people are asking about the client, seemingly completely unable to wait until it is released as a compiled binary for testing, I feel like I’m forced to make this blogpost explaining the neccessary steps.
Once you’ve grabbed the latest version of the repository, you should download and install Visual Studio C# Express Edition 2008 from here.
Next you’ll need to download and install XNA Gamestudio 3.1, then Lua for Windows, as well as Bass.NET. You can now open TSOClient.sln from trunk\TSOClient\ and compile the client. To compile an application in Visual Studio, simply press F5.
However, the client won’t run unless you have copied the Lua scripts to their appropriate directories. So for now, just press F5 to build the client. This will create a folder called bin in trunk\TSOClient\TSOClient\ with a folder called Debug inside.
The compiled client will be in the Debug folder. You need to create a folder called gamedata inside of Debug, and then copy all the three folders inside trunk\TSOClient\LuaScripts\ to this new folder. Lastly, copy NAudio.dll from trunk\TSOClient\TSOClient\ to trunk\TSOClient\TSOClient\bin\Debug\
When you’ve done this, you can open up Visual Studio again (if you closed it) and press F6 to compile and debug the client. Now the client should run without any errors, providing you have installed TSO on your PC.
Today I was asked on Facebook when this project would be finished. I tried to explain that it doesn’t have any deadline, but the message didn’t seem to go through.
Therefore I’m writing this post to put things into perspective. One of the projects that inspired me to do this was Corsix-TH. It aims to rebuild Theme Hospital using nothing but the game’s original assets and open-source code. The difference between that project and this is that Theme Hospital is a much older game, and much less complicated to rebuild. Corsix-TH has been in development now since mid-2009, and it only just reached version 0.01.
Think about that for a minute. Between 0.01 and 1.00 you can at the least put 9 incremental updates. And if each update takes 6 months to make, that equals out to 4.5 years. Now as far as I know, there is currently only one developer working on Corsix-TH, and hopefully more developers will join as the project matures. That’s my hope for this project as well, but at least these figures should put things into perspective.
So far I’ve decided to concentrate on the skeleton, and the skeleton only, because everything else is depending on it.
This is the closest I’ve been able to come so far;
I’m still trying to figure out why the root bone is located away from the rest of the skeleton and why the upper arms are above the head, and the lower arms are way down. Other than that, everything seems to be correct.
Have you ever tried hammering a nail into a wall using nothing but a rock, with both hands tied firmly behind your back?
That’s just about how it feels trying to do any 3D operations in XNA that are even remotely advanced. I have now tried for several months to set up skeletal animation, and am now in a situation where I’ve discovered that XNA even has a built-in function for parts of what I’ve been trying to do (transforming a set of vertices based on a bone’s location in 3D space), but that this is completely useless so long as I am unable to position the skeleton’s bones correctly in 3D space.
My current theory is that the bones’ locations (which are made up of a rotation and a translation) are stored as OpenGL-native coordinates. Vitaboy (the rendering system used by The Sims and The Sims Online) was originally written in Direct3D, but it isn’t unthinkable that it was ported to OpenGL for TSO. I have tried every possible matrix and vector based operation on the bones’ translations and rotations that I could possibly think of, but nothing seems to help.
I have been putting this off for what feels as long as possible, and I’m giving myself another week, but if I haven’t made any significant progress within that timeframe I’m switching to OpenGL.
I have already tried SFML (Simple Fast Multimedia Library – an engine that allows you to use OpenGL calls and combine them with calls to the engine), but it applies some kind of funky custom world matrix that fucks up animation and rendering.
The reason I’ve been putting this off for so long is that I know that rewriting the GUI-system in OpenGL is going to take time and be a learning process all of its own, but my current consensus is that it’ll take less time than trying to fight with XNA in order to make it do something it obviously wasn’t meant to do.
I am allowing comments on this post in the hope that I can get some bright ideas and/or support.
Finally, Project Dollhouse has its own website. I’ve been putting it off for a long time due to working on the code, but I figured it was time to make it happen. In this section I will be blogging about any news related to the project.
Please forgive if things aren’t looking “up to scratch” at the moment, as I am still tweaking the setup to make the website just the way I want it.