Sims2 has a pretty versatile effects system, these are used for some things you might expect, such as the smoke and sparks coming out of the UFOs in strangetown:
However, they are also used for things you might not expect such as the plumbobs floating over buildings in the neighborhood view and even the fly throughs that play when you load into a neighborhood.
The compiled versions of these effects live in the Res/Effects/effects.package
. While we
have done some work to decode the overall structure and some fields of that format
here, there is now a much easier way to
edit these effects.
LazyDuchess and I found that the game still looks for and compiles these effects from their developer friendly textual representations. This means that you can now edit and make new effects using the same scripting format that the original Sims 2 artists did.
Sims2 looks for a file under TSBin\Plugins
called main.fx
. So for example if you have all the
expansions you would create a text file The Sims 2 Ultimate Collection\Fun with Pets\SP9\TSBin\Plugins\main.fx
.
This file should contain the effects you want to add/override. So for example, we can override the afformentioned smoke coming from the strangetown UFOs to be giant orbs that turn from green to red:
particles test
life 5
rate 30
source -point
emit -dir (0, 0, 1) 1 -speed 5
texture "effects-puff"
color (0.0, 1.0, 0.0) (1.0, 0.0, 0.0)
end
effect neighborhood_house_smoking
particleEffect test
end
and we get:
I have a giant dump of effect names from the base game here.
The basic structure of the file is a list of blocks like
<effect_type> <name> <effect_options>
<effect_parameter_1>
<effect_parameter_1>
end
We haven't really fully explored the options of the effects system but there are a few types of effects used in Sims 2:
particles
decal
camera
model
screen
The effect
type is the root of visual effects and contains the effect name used in the game's scenegraph assets.
Each of these types of effects has its own set of parameters. Almost every parameter can be given a "curve" of values that
change over its lifetime, so for example instead of just alpha 0.3
you can do alpha 0.1 0.3 1
to make a particle that starts faded out and becomes more opaque.
Here are some parameters we know:
life
- How long the particle should last in seconds.
rate
- The number of particles spawned per second.
source
- Defines where the particles come from, can be made into different shapes somehow.
emit -dir (x, y, z) -speed <speed>
- Which direction to emit particles into and at what speed.
alpha
- The transparency of the spawned particles.
color
- The color of the spawned particles.
As mentioned in the intro, flythroughs when loading into a hood are actually powered by this effects system. For example this turns the strangetown flythrough into a very spinny time in the ground:
camera my_custom_flythrough
life 10
heading 0 1 2 3 4 5 6 7 8 9 10 11 12
end
effect strangetown_flythroughfx
cameraEffect my_custom_flythrough
end
This works for any hood in the game as long as you make an effect called <hood_name>_flythroughfx
If you are going to play around with this, I highly recommend grabbing LazyDuchess's TS2-HiddenCheats from here: https://github.com/LazyDuchess/TS2-HiddenCheats It is meant to be used with Sims2RPC and it will show errors when parsing the fx file in a console so you can actually debug when effects aren't loading and why:
You can learn more about the particle effect's system from its developer Andrew Willmott here: https://www.andrewwillmott.com/talks/swarm-procedural-content
Some notes from me reverse-engineering the binary effects format can be found here: LazyDuchess/OpenTS2#7
Known commands per effect type (syntax not known yet). I'll update this as I go along.
particles
effect
decal
camera
model
screen
sequence
?