# Exploring the particle system

## Recommended Posts

1. Introduction

As you may or may not know, particles are all over the modern RuneScape world. They occur in items we wear such as capes, objects such as torches and even NPCs. Particles come from an emitter. You could consider a sprinkler as an example of a particle emitter and the water droplets as particles. Each individual droplet goes into a direction with slight variation to its trajectory, its size and its lifespan. Particles in RS and other games work the same way (be it possibly with more complex parameters).

In my previous research I have been able to modify particles in realtime, here's an example:

Spoiler

By modifying a certain parameter in the particle, I change the velocity of each particle. Because they only change in one axis, I am assuming there are either more parameters for other axes or the parameter I am currently modifying is combined out of shorter values just like the particle colors.

Anyways, the goal of this thread is to gradually expand information on particles as I find it. As such, it will get better over time and I hope this will help or excite people to research on their own. Soon I will post some of my findings but I am currently not at home. If you think you can contribute to this thread, feel free to contact me or post it in this thread and I will include it!

3. Contributors

• Me

##### Share on other sites

1. The particle definition data structure

Status: Under construction

Consider the following bytes that represent a particle definition, raw from the cache:

Spoiler

[1, 0, 0, 0, 8, 1, -1, 1, -19, 3, 0, 3, 51, 51, 0, 4, -52, -52, 31, 0, 7, 0, 8, 27, 0, 1, 28, 100, 7, 0, 50, 0, 60, 8, 0, 19, 0, 32, 10, 1, 0, 6, 12, -1, 14, 0, 0, 15, 3, 44, 16, 1, 127, -1, 127, -1, 1, 20, 100, 30, 26, 21, 100, 22, 0, 11, 51, 51, 23, 100, 6, -106, 17, 17, 17, -56, 17, 17, 17, 18, 0, 34, 34, 34, 0]

Legend:

• ARGB Color #3 (4 bytes of 0 to 255 packed together into one integer)
• ARGB Color #2 (4 bytes of 0 to 255 packed together into one integer)
• ARGB Color #1 (4 bytes of 0 to 255 packed together into one integer)
• Decay Factor (1 byte of 0 to 255)

1.1. Decay Factor

The decay factor is an unsigned byte (0 to 255) that represents how fast a particle decays. The decay will be much less when the factor is on 0, very fast if it is on 255. This way you can control how long particles live. If you look at the cloud animation gif below, changing this factor does not affect it. So there must be something else to play.

Here is an example:

Spoiler

1.2. ARGB Color 1, 2 and 3

As you might have guessed, these represent the color of particles. They are in the ARGB format which stands for Alpha, Red, Green, Blue. All of these are unsigned bytes (0 to 255) and are packed into an integer. Alpha controls the opacity. It seems like a particle is formed together by three sub-particles, explaining the three colors. Changing one of these results in SLIGHTLY modifying the color. Changing all three of these results in the particles taking the pure color as expected.

Here is an example of modifying only the last ARGB color:

Spoiler

This is how it looks when setting the colors to:

#1: A: 255, R: 255, G: 0, B: 0

#2: A: 255, R: 0, G: 255, B: 0

#3: A: 255, R: 0, G: 0, B: 255

Spoiler

As you can see, the colors are still dominantly blue, this means that, in the particle definition, the third color is, I believe the color of the top particle, and the other two are for the two sub-particles.

##### Share on other sites

Hell of a job m8

##### Share on other sites

Wonderful guide! Can't wait for more updates

##### Share on other sites

Well-written article!

##### Share on other sites

If you want snow in a region, adding an object with model 64543 will make it snow (in 718 loading 753)! Otherwise, adding emitter 281 to any model will cause it to snow in that region as well. Yay for snow cape!

##### Share on other sites

Found the particle size!

##### Share on other sites

Found out which sprite to assign to the particles

I will soon update the documentation.

Changing colors and used sprite can create some (imo) pretty combinations

##### Share on other sites

I need an update mate, and what program are u using to see real-time effect on changing things? and on which client file you find those numbers you were talking on your first thread? I changed them and nothing happenned on the dung master cape so I am wondering what could have happenned, i have a 667 loading 718 server

##### Share on other sites
On 10/10/2017 at 4:27 AM, GabrielTheOw said:

I need an update mate, and what program are u using to see real-time effect on changing things? and on which client file you find those numbers you were talking on your first thread? I changed them and nothing happenned on the dung master cape so I am wondering what could have happenned, i have a 667 loading 718 server

I made my own tool to manipulate the values in the client while they are in use. Every frame render, the definition gets queried for its configuration to then render it. Changing this information (by changing the numbers AND calling some kind of 'apply' method to apply the changed numbers) will change them in real time.

## Create an account

Register a new account

×
• Home

• RSPS List

• Clubs