0.1 interval emitters don't emit enough creeper (BUG)

Started by UpperKEES, November 26, 2010, 01:38:19 AM

Previous topic - Next topic

UpperKEES

An emitter with 0.1 second interval should emit every 3 frames (3.6 rounded down). The creeper array only gets updated every 7 frames however, thus 'forgetting' every other emittance and occasionally every 2 out of 3 emittances.

As a result an emitter with 0.1 second interval emits only about 50% of the amount it should!

Please have a look at the map below:



The left emitter will emit with a 0.1 second interval (every 3 frames) and an intensity of 4 for 3 seconds. This should add up to 36 emittances of 4 ccc = 144 ccc (= exactly 3 layers in the basin with a surface of 48). It will however only emit about 50% of that!

The right emitter will emit with a 0.2 second interval (every 7 frames) and an intensity of 4 for 7 seconds. Again this should add up to 36 emittances of 4 ccc = 144 ccc (= exactly 3 layers in the basin with a surface of 48). This will work as expected.

Now try the same thing on Double Down. Twice as much creeper should be emitted, but you'll notice both basins will fill up the same way as with DD mode turned off.

This means the use of emitters with an interval of less than 7 frames is useless due to the optimization that processes the creeper array only every 7 frames.

The following emitters are affected by this:
- In normal mode: emitters with 0.1 second (3 frames) interval
- In Double Down mode: emitters with 0.1 (1 frame), 0.2 (3 frames) or 0.3 (5 frames) interval

The only effective difference between a 0.1 and a 0.2 intensity emitter in normal mode is that they emit in different frames. As a result your blaster will be in sync with the 0.2 emitter, while it isn't with the 0.1 emitter, thus making it a little harder to cap. The amount of creeper emitted however is exactly the same!

PS: I'm pretty sure mthw2vc already knew about this, but never said anything. ;)
My CW1 maps: downloads - overview
My CW2 maps: downloads - overview

Kapoios

#1
I think this is not 100% true. It is only true if the emitter is not affected by weapons. When a blaster is hitting him  (clearly emitters are boys, what with all those emissions) then he behaves very differently from a 0.2 emitter. Because when the blaster hits him, it sets the square to zero or to some smaller value anyway. This happens at that frame; doesn't wait for creeper update. The creeper update might do the flow later, but the square is set to zero at the exact frame that the blaster fires. So, the emitter gets to refill his square both after the creeper update and after the blaster fires. If the update is, say, at frames 0 modulo 7 and the blaster fires at frames 4 modulo 7, then this 0.1 emitter emits double the amount of a 0.2 one. There is definitely difference there. The different behaviour at capping is not just a matter of synchronisation but also the fact that a capped 0.1 emitter produces more creeper than a "remote" one (one far from weapons). Bizzare, isn't it? Even if he's not capped, but shot without being capped, that makes him stronger.

As a more extreme example, think of an emitter that fires EVERY frame (you can somehow do that if you manipulate the files, i think). According to your arguments, he would be equal to a 0.2 emitter, but he isn't. If you put 7 blasters near him, each of which fires at frames 0,1,2,3,4,5,6 modulo 7, he will start emitting 7 times the amount it was making when remote! If you think about it, it's as if they get angrier when shot.

You are right, however, in that a "remote" 0.1 emitter is actually less good at making creeper than a 0.2 emitter. I'm not sure I'd call it a bug exactly, but it's certainly an unintended consequence of how things work. Ok, that's the definition of a bug more or less, right? Ok, then it's a bug. I think, however, that it shouldn't be fixed, as it would break many maps. I also think that 0.1 emitters is often a sign of bad design and don't particularly want to protect them.

UpperKEES

#2
Quote from: Kapoios on November 26, 2010, 10:33:13 PM
I think this is not 100% true. It is only true if the emitter is not affected by weapons. When a blaster is hitting him  (clearly emitters are boys, what with all those emissions) then he behaves very differently from a 0.2 emitter. Because when the blaster hits him, it sets the square to zero or to some smaller value anyway. This happens at that frame; doesn't wait for creeper update. The creeper update might do the flow later, but the square is set to zero at the exact frame that the blaster fires. So, the emitter gets to refill his square both after the creeper update and after the blaster fires. If the update is, say, at frames 0 modulo 7 and the blaster fires at frames 4 modulo 7, then this 0.1 emitter emits double the amount of a 0.2 one. There is definitely difference there. The different behaviour at capping is not just a matter of synchronisation but also the fact that a capped 0.1 emitter produces more creeper than a "remote" one (one far from weapons). Bizzare, isn't it?

Yes, there is indeed a difference in capping (although I'm not completely sure about the blaster fire, see below), but on most of the maps you'll be fighting those emitters from a distance, so that's obviously the main difference it makes.

Quote from: Kapoios on November 26, 2010, 10:33:13 PM
As a more extreme example, think of an emitter that fires EVERY frame (you can somehow do that if you manipulate the files, i think). According to your arguments, he would be equal to a 0.2 emitter, but he isn't. If you put 7 blasters near him, each of which fires at frames 0,1,2,3,4,5,6 modulo 7, he will start emitting 7 times the amount it was making when remote! If you think about it, it's as if they get angrier when shot.

Ah, you assume the blasters actually fire in different frames, maybe depending on their build order? I always assumed that all blasters fire in the same frame, because I always see them fire at the same time. Of course it's also possible that the blasters only on my screen get redrawn every few frames. Are you sure they fire in different frames?

Quote from: Kapoios on November 26, 2010, 10:33:13 PM
You are right, however, in that a "remote" 0.1 emitter is actually less good at making creeper than a 0.2 emitter. I'm not sure I'd call it a bug exactly, but it's certainly an unintended consequence of how things work. Ok, that's the definition of a bug more or less, right? Ok, then it's a bug.

I believe it worked fine before the algorithms were optimized, but get the impression that some optimizations are causing unwanted side effects, like we've also seen with the direction of blaster fire for instance.

Quote from: Kapoios on November 26, 2010, 10:33:13 PM
I think, however, that it shouldn't be fixed, as it would break many maps.

Indeed, this is definitely a bug we don't want to get fixed! I think it would break 80% of my maps as well, or require a difficulty rating above 'Expert Only'.

We don't want something similar in CW2 though....

Quote from: Kapoios on November 26, 2010, 10:33:13 PM
I also think that 0.1 emitters is often a sign of bad design and don't particularly want to protect them.

When you design a map you can calculate a whole bunch of stuff like you and me like to do, but in the end it comes to empirical testing to see whether a certain amount of creeper offers a good resistance. Don't forget that 10 stacked emitters with an interval of 1 second together become a 0.1 interval emitter when their start time is spaced evenly. It's only a lot harder to test how much creeper gets released, because each one starts minutes delayed. When you finish you only know how hard it was to complete the map.

Another reason to use 0.1 intervals is when you use low intensity emitters to keep the creeper levels in a pool at for instance exactly 3 elevation layers. Such a basin won't overflow (or only a little, when the intensity is set to 3.1), but will be hard to clear, which can give nice effects, like for oceans.

Apart from that Double Down now really lost its value. Every map with 0.1, 0.2 or 0.3 interval emitters (achieved by stacking them or just normal ones) is affected; some will be just as easy as in normal mode and some will be only a little harder.
My CW1 maps: downloads - overview
My CW2 maps: downloads - overview

Blaze


UpperKEES

Quote from: UpperKEES on November 26, 2010, 11:20:36 PM
Ah, you assume the blasters actually fire in different frames, maybe depending on their build order?

This indeed seems the case; just not for pre-built blasters (probably because they all finished in the first frame of the game).

It also means that 0.1 intensity emitters require more energy to be capped, but won't emit more creeper than a 0.2 emitter.
My CW1 maps: downloads - overview
My CW2 maps: downloads - overview

Kapoios

Quote from: UpperKEES on November 27, 2010, 02:24:18 AM
It also means that 0.1 intensity emitters require more energy to be capped, but won't emit more creeper than a 0.2 emitter.
This is also a bit inaccurate to say. Depending what one means. Things are a bit more complicated. Take a look at this example. All 12 emitters are of intensity 4, while their interval is shown on the left. Let it run for some time and watch the creeper. The first two pools demonstrates exactly what you say. The emitters behave identically. The second two pools demonstrate exactly what I say. The emitters behave differently. As an extra indication of the fact that the emitters in the third pool get to emit twice more often put your mouse over one of them and watch the elevation gauge. You'll see that they oscillate at double the frequency.

UpperKEES

#6
But these emitters aren't being capped are they?

Edit: Oh wait, you mean it's not only during capping, but also any other time you shoot at an emitter. Duh! I think most of the time you shoot at an emitter you will be capping it though, but it is indeed a weird effect seeing more creeper appear under blaster fire than without it.

The most important thing however, is that sometimes more than 50% of all creeper is not emitted at all! See here for some example data.
My CW1 maps: downloads - overview
My CW2 maps: downloads - overview

UpperKEES

#7
Quote from: UpperKEES on November 27, 2010, 02:24:18 AM
Quote from: UpperKEES on November 26, 2010, 11:20:36 PM
Ah, you assume the blasters actually fire in different frames, maybe depending on their build order?

This indeed seems the case; just not for pre-built blasters (probably because they all finished in the first frame of the game).

Another interesting thing: blasters that finish building in the same frame (or maybe placed on the map in the same frame?) will always keep firing in the same frame, thus saving energy when capping 0.1 interval emitters! This should be testable, right? Blasters that fire in different frames should consume more because they fire at creeper that will be replaced anyway when the emitter emits again before the creeper array update....

Edit: the order in which blasters fire is also reset after moving them; blasters that were moved last always seem to fire first. When you start moving them out of range, the order gets restored backwards. (De)activating and (dis)arming does not seem to influence the order.

Edit 2: you can even get some very weird capping behaviour, see attached map.

 

When you disarm one blaster immediately (during the opening text), the emitter of 0.7 intensity with 0.1 interval can easily be capped by the other blaster (even up to an intensity of 2). When you let the second blaster fire for a while as well and disarm it later, the first blaster won't be able to cap the emitter any more!

In fact it is possible that certain 0.1 interval emitters cost more energy to cap than when you wouldn't cap them, which isn't the way it's supposed to be.

In short: the use of 0.1 interval emitter should be avoided for 'normal' CW behaviour. Let's hope the optimizations in CW2 will be implemented differently so 0.1 intervals can be used effectively and without side effects. When emitters would add creeper instead of replacing it (which will be an option for emitters in CW2), you would not see this, only the way the creeper spreads would be influenced a little with updates once per 7 frames.
My CW1 maps: downloads - overview
My CW2 maps: downloads - overview

Sqaz

If you don't want to have any problems with this behavior you should place your blasters so the emitter is just out of its range, so it's just like capping a 0.2interval emitter.

About the capping behavior, this weird capping only happens when the shooting blaster is placed first, or due to moving became first in order.
That's because a blaster shoots once every 7 frames, so if it start the same time as the emitter it'll only shoot just as the creeper (as the creeper updates every 7 frames), so giving no capping problems. If it however doesn't, it shoots between those updates, causing the creeper to be replaced, causing the cap to fail.



UpperKEES

Quote from: Sqaz on November 29, 2010, 11:16:49 AM
If you don't want to have any problems with this behavior you should place your blasters so the emitter is just out of its range, so it's just like capping a 0.2interval emitter.

Ah, now I get what you meant in chat yesterday! :) Yes, that's indeed possible with a low intensity (0.7) emitters like this, but you don't want to let an emitter with high intensity spread out. For lower intensities it's a very elegant solution though!

Quote from: Sqaz on November 29, 2010, 11:16:49 AM
About the capping behavior, this weird capping only happens when the shooting blaster is placed first, or due to moving became first in order.
That's because a blaster shoots once every 7 frames, so if it start the same time as the emitter it'll only shoot just as the creeper (as the creeper updates every 7 frames), so giving no capping problems. If it however doesn't, it shoots between those updates, causing the creeper to be replaced, causing the cap to fail.

Yes, it's indeed the second blaster taking away intermediate emittances (in between creeper updates) that causes the first blaster to get out of sync with the emitter. There is a chance of 1:7 however that you disarm the second blaster in the right frame and in that case the capping will still succeed.

I'm not sure about the blaster order though. Can you explain a bit more? I've been testing with it as well, but couldn't find differences in this case. The only thing I notice is that the first blaster in the order (last placed) is the one that starts firing, which is what always happens.
My CW1 maps: downloads - overview
My CW2 maps: downloads - overview

UpperKEES

Quote from: UpperKEES on November 26, 2010, 01:38:19 AM
This means the use of emitters with an interval of less than 7 frames is useless due to the optimization that processes the creeper array only every 7 frames.

The following emitters are affected by this:
- In normal mode: emitters with 0.1 second (3 frames) interval
- In Double Down mode: emitters with 0.1 (1 frame), 0.2 (3 frames) or 0.3 (5 frames) interval

A tiny addition: emitters with a 6 frame interval can also be useful to map makers, but only when you supply the fire rate upgrade which will allow the player's blasters to sync with the emitters. However 6 frame interval emitters can only be created manually.
My CW1 maps: downloads - overview
My CW2 maps: downloads - overview