Home   Help Search Login Register  

Author Topic: Advice needed: drop[] performance  (Read 1042 times)

0 Members and 2 Guests are viewing this topic.

Offline Fragorl

  • Coding Team
  • Former Staff
  • ****
Advice needed: drop[] performance
« on: 17 Jun 2005, 04:16:43 »
I'm in the process of making the operation flashpoint world's 9 billion and 24th fire effect. I have it looking quite nice, but I'm aware that my computer is definitely on the upper end of the scale, and I started to wonder how it would perform on other people's machines. So I ran some tests. Here are my specs for the situation:

- I get 65-70 FPS when playing at normal terrain detail with a viewdistance on 2300. This may drop to 60 when turning quickly. But overall an excellent framerate.

- My drop script loops at 0.01s, dropping relative small particles (approx. 1/3 the size of a man).



I was aware that this was a fast loop as far as drop effects go. So I ran some tests. I stuck the visibility on high (or very high :P), then used the viewdistance slider as an adjuster for my framerate. Some background for my effect first of all: I need it looping at 0.01 seconds since otherwise I get a flickering effect with my particles, where the slowness of the loop means the position of the fire goes bright-dark-bright-dark at a painful speed. At anything below 0.05, the flicker becomes more or less continuous (this is the magical 20 images a second that the human eye cannot distinguish between, or so i'm told). The other reason is to mantain the fire's brightness - more drops a second means more intensity of light at the fire's position.

- Once my framerate fell below ~30 FPS, operation flashpoint started skipping drop calls and the flame noticeably dimmed.

- Below 22 FPS, the flicker began to reappear and the fire effect lost much of it's clarity. It was not viable as an effect below 20 FPs. If the fire effect is in a state of motion, this worsens the situation even more

Knowing that for many people these kinds of framerates are standard, what should I do? Obviously I want as many people as possible to see the effect, but I want people to see it as I created it. I certainly dont want to get into a 'your framerate must be this high to play' type scenario.

Hopefully someone who has overcome this same hurdle can give me some advice.
[img removed]FireEffect20.jpg[/img]
« Last Edit: 17 Jun 2005, 04:36:46 by Fragorl »

Offline Fragorl

  • Coding Team
  • Former Staff
  • ****
Re:Advice needed: drop[] performance
« Reply #1 on: 17 Jun 2005, 04:18:20 »
[img removed]FireEffect70.jpg[/img]
« Last Edit: 17 Jun 2005, 04:37:38 by Fragorl »

Offline Sui

  • Former Staff
  • ****
    • OFPEC
Re:Advice needed: drop[] performance
« Reply #2 on: 17 Jun 2005, 09:33:03 »
Looks like fairy dust :)

I'd suggest making the effect benchmark conditional... eg:

? benchmark < 3000: exit

This way anyone running a lower end machine won't have to suffer substandard drop effects due to low framerate

Offline Fragorl

  • Coding Team
  • Former Staff
  • ****
Re:Advice needed: drop[] performance
« Reply #3 on: 17 Jun 2005, 11:31:35 »
Benchmark command, excellent idea! Cheers

Fairy dust: I'll take that as 'there's room for improvement' ;)

Bluelikeu

  • Guest
Re:Advice needed: drop[] performance
« Reply #4 on: 17 Jun 2005, 15:30:33 »
i guess that a solution might be not so many particals per second. I think that decreasing the particals per second, and making the particals last longer might work. Also you might thing about make the particals a bit more distant from eachother on the human torch.
« Last Edit: 17 Jun 2005, 15:30:58 by Bluelikeu »

Offline Fragorl

  • Coding Team
  • Former Staff
  • ****
Re:Advice needed: drop[] performance
« Reply #5 on: 18 Jun 2005, 02:44:59 »
I need it looping at 0.01 seconds since otherwise I get a flickering effect with my particles, where the slowness of the loop means the position of the fire goes bright-dark-bright-dark at a painful speed. At anything below 0.05, the flicker becomes more or less continuous (this is the magical 20 images a second that the human eye cannot distinguish between, or so i'm told). The other reason is to mantain the fire's brightness - more drops a second means more intensity of light at the fire's position.

I run into these two problems, that the effect is not bright enough and flickers annoyingly, if I do what you suggest, and put the effect at say 0.1 say.

I can improve the brightness a little by slowing the flames down so there are more particles in the same volume, but it's still hard to achieve the authentic fire look :P, plus I have to compensate elsewhere for the slowness of the particles. If you take a look at the '30' fps flame (it was more like 20 fps overall, but I had a momentary burst of 25-30 fps when I took the picture), you can see the difference in brightness in the section of the flame over the top of the soldier. This is exactly what happens when I decrease the frequency of the drops.

The flickering is the worst part. The flicker actually happens every time a new particle is created, so there's no real way to avoid it except for adding lots of particles in quick succession. I honestly cant think of any way to stop this, it seems to be 'built in' with that type of particle.

As for the spacing, I obviously cannot space the particles out any more or the intensity will drop dramatically. I think it looks better with the particles close anyhow, as the fire stops looking like it's made of spherical particles (which it is), and begins to look like a continuous wave of licking flames (which is what I want).

Offline Sui

  • Former Staff
  • ****
    • OFPEC
Re:Advice needed: drop[] performance
« Reply #6 on: 18 Jun 2005, 06:14:13 »
Sorry... I didn't mean to be disparaging :P

I just meant that you're right... the intensity should be like the bottom picture if you can possible make it that way. :)

Offline Fragorl

  • Coding Team
  • Former Staff
  • ****
Re:Advice needed: drop[] performance
« Reply #7 on: 19 Jun 2005, 11:32:35 »
no prob.... I realised later that you meant the top picture, not both the pictures ;)

I have found a way to get a good intensity, trading off the spark effect (which I can add separately later) for a larger final particle size. This works well and decreases the drop frequency, but the persistent, annoying flicker remains. However, it's a short step down the pothole-littered road to success. That's good.

Offline Fragorl

  • Coding Team
  • Former Staff
  • ****
Re:Advice needed: drop[] performance
« Reply #8 on: 20 Jun 2005, 06:25:50 »
OK, I think I have solved my original problem- I've decreased the simlutation frequency but increased the number of drops per cycle. At low framerates this means a slight flicker (not a fast flicker like before; more like a blip in intensity), but the fullness of the fire is still there. This is excellent as it means that people with average framerates can run the effect almost as well as people with higher framerates. No exclusivity :toocool:

I've also improved somewhat on the overall simulation; fire looking more real than ever now.