[BUG REPORT] Players don't see muzzle flash.

Report any bugs here or ask questions here!

[BUG REPORT] Players don't see muzzle flash.

Postby xElijah » 10 October 2020, 15:01

Players can't see muzzle flash of a custom weapon in multiplayer unless if timer responsible for its appearance is set to a very big value.

To make a double muzzle flash effect I usually use high timer values (6 for big flash and 5 for small flash) to bypass this issue. In singleplayer it looks ridiculously slow, but in multiplayer it works relatively fine.

For a test I tried to make a double muzzle flash effect using small timer value similar to default weapons (e.g. Assault Rifle CS-RC). In singleplayer it works fine, but this is what I've got while testing it in multiplayer:

1) Player who fires the gun sees the muzzle flash, while other player doesn't see it on his screen (game speed is default). Image.
2) When game speed is slowed by trigger (value was set to 3) both players see muzzle flash (both states - big and small flash). Image.
3) When game speed is slowed and gun was given to other player, both players see muzzle flash, but sometimes they only see one state of muzzle flash (either big flash or small flash, but not both). Image.

This is the map I used to test it. Link. Note that there are two rifles. First one has a slow flash (timer values: 6 and 5) and its action on shoot trigger deactivates itself when flash starts and activates itself when flash ends (this was made to reduce the possible lag). Second rifle has a quick flash (timer values: 1 and 1). The mentioned in this topic issue is related to the second rifle. Clarification image.

Is there a way to make muzzle flash look good in both singleplayer and multiplayer modes?
User avatar
xElijah
Usurpation Soldier [50]
 
Posts: 96
Joined: 3 October 2020, 15:43

Re: [BUG REPORT] Players don't see muzzle flash.

Postby nightmar » 10 October 2020, 15:06

I had problesm with making it show in single player as well. For some reason it has to be longer than normal muzzle flashes to work. My guess is that it is relevant to a trigger execution stalling it
How many bugs does this game have anyway? jeez
User avatar
nightmar
Usurpation Destroyer [350]
 
Posts: 393
Joined: 2 September 2017, 19:36
Location: Inside your closet or under your bed

Re: [BUG REPORT] Players don't see muzzle flash.

Postby xElijah » 10 October 2020, 15:16

nightmar wrote:I had problesm with making it show in single player as well. For some reason it has to be longer than normal muzzle flashes to work. My guess is that it is relevant to a trigger execution stalling it

I didn't have any issues in singleplayer. Maybe you set some trigger incorrectly?
User avatar
xElijah
Usurpation Soldier [50]
 
Posts: 96
Joined: 3 October 2020, 15:43

Re: [BUG REPORT] Players don't see muzzle flash.

Postby nightmar » 10 October 2020, 16:24

xElijah wrote:
nightmar wrote:I had problesm with making it show in single player as well. For some reason it has to be longer than normal muzzle flashes to work. My guess is that it is relevant to a trigger execution stalling it

I didn't have any issues in singleplayer. Maybe you set some trigger incorrectly?


The triggers work prefectly fine. I know that because:
1st) I can see the muzzle flash normally if I make it last longer.
2nd) The flash does appear but not after every shot.
How many bugs does this game have anyway? jeez
User avatar
nightmar
Usurpation Destroyer [350]
 
Posts: 393
Joined: 2 September 2017, 19:36
Location: Inside your closet or under your bed

Re: [BUG REPORT] Players don't see muzzle flash.

Postby xElijah » 22 October 2020, 22:19

I noticed niru-dm2 uses very small timer value for muzzle flash (~less than 4), yet it is perfectly seen in both singleplayer and multiplayer gamemode. I wonder how he did that. Does he change decoration model from nothing to muzzle flash and back, or does he turn it invisible? What triggerwork does it involve to work properly? It just works in his map. If anybody knows a way to make a working flash in level editor please share the knowledge. It would help a lot of people.
Last edited by xElijah on 8 November 2020, 14:38, edited 1 time in total.
User avatar
xElijah
Usurpation Soldier [50]
 
Posts: 96
Joined: 3 October 2020, 15:43

Re: [BUG REPORT] Players don't see muzzle flash.

Postby xElijah » 6 November 2020, 01:03

I think the issue might be the timer itself (the way how it works in PB2). It executes the trigger with normal speed in singleplayer, but in multiplayer it is sped up so it executes the trigger responsible for disappearance of muzzle flash too quickly.
User avatar
xElijah
Usurpation Soldier [50]
 
Posts: 96
Joined: 3 October 2020, 15:43

Re: [BUG REPORT] Players don't see muzzle flash.

Postby nightmar » 6 November 2020, 12:47

But isn't it in Multiplayer where muzzle flash usually works? The tests I did were on Single Player where the muzzle flash did not always appear. That being said, could it be the other way around?
How many bugs does this game have anyway? jeez
User avatar
nightmar
Usurpation Destroyer [350]
 
Posts: 393
Joined: 2 September 2017, 19:36
Location: Inside your closet or under your bed

Re: [BUG REPORT] Players don't see muzzle flash.

Postby xElijah » 6 November 2020, 13:05

nightmar wrote:But isn't it in Multiplayer where muzzle flash usually works? The tests I did were on Single Player where the muzzle flash did not always appear. That being said, could it be the other way around?

No. Muzzle flash doesn't work properly in multiplayer, but in singleplayer it works perfectly fine. Like I said earlier you most likely set some triggers wrong in your map which is why the flash doesn't appear for you. Check my test map where I added a custom gun and compare it to your version in your map.
User avatar
xElijah
Usurpation Soldier [50]
 
Posts: 96
Joined: 3 October 2020, 15:43

Re: [BUG REPORT] Players don't see muzzle flash.

Postby niru » 8 November 2020, 07:01

Hello xElijah. I made a map (open source) called "niru-mf" where I show my system to make custom snipers with muzzle flash (the same one used in niru-dm2). Hope this can help you a bit.

niru
 
Posts: 1
Joined: 22 October 2019, 04:45

Re: [BUG REPORT] Players don't see muzzle flash.

Postby xElijah » 8 November 2020, 14:33

Niru released a map source for his muzzle flash system. I added it to my test map and tested it. If anybody wants to test it too - clarification image. I've got following results:

- Niru made a muzzle flash by adding an infinitely called timer of time value 3 that infinitely calls a trigger which sets muzzle flash decoration's scale to 0. Each gun shot resets current phase of that timer and sets muzzle flash decoration's scale to 0.3.
- Niru's muzzle flash system works in singleplayer and multiplayer, but in multiplayer it has a bug - if your weapon's firing speed is high (e.g. value 3.5 and above) sometimes trigger on shot doesn't get activated so the muzzle flash doesn't appear. This bug becomes very noticeable if you drop the weapon and give it to other player and witness how he shoots it continuously.

To summarize: Niru's muzzle flash works, but it doesn't work properly in multiplayer when you use rapid firing weapons. Sometimes trigger on shot doesn't get activated so the muzzle flash just "skips". It's the best if we had another muzzle flash system that works better than Niru's one. If Eric somehow fixes it on game/server level it would be even better.
User avatar
xElijah
Usurpation Soldier [50]
 
Posts: 96
Joined: 3 October 2020, 15:43

Re: [BUG REPORT] Players don't see muzzle flash.

Postby nightmar » 9 November 2020, 08:43

I also noticed that niru uses only 1 decoration for muzzle flash. If we want to make guns work properly we have to use 2 decors that switch from one to the other (with a few exceptions).
How many bugs does this game have anyway? jeez
User avatar
nightmar
Usurpation Destroyer [350]
 
Posts: 393
Joined: 2 September 2017, 19:36
Location: Inside your closet or under your bed

Re: [BUG REPORT] Players don't see muzzle flash.

Postby xElijah » 13 November 2020, 15:47

Good news (relatively). I upgraded Niru's muzzle flash system. Now it doesn't contain timer that infinitely calls the trigger that changes muzzle flash decoration scale to 0. So it should give less lag to the map. I also created a 2-frames muzzle flash using this system (as @nightmar suggested). Map page. Clarification image. So far this works better than other ones.

I think I understood why it's difficult to make a properly working muzzle flash in PB2. 2 reasons:
1) Sometimes the trigger on shot just "skips" itself. It looks like this: when you shoot a fast firing weapon muzzle flash may appear or may not appear because trigger on shot didn't get activated when you shoot your gun. It happens due to PB2 code issues or PB2 server issues I think.
2) When you activate a trigger that has two actions - (A) changing decoration visibility (or scale/model) and (B) activating a timer, activation of timer executes faster than changing decoration visibility. It's a built in game "delay" issue. This was the reason why my first versions of muzzle flash with small timer values didn't work - timer was activating the muzzle flash disappearance trigger too quickly making it barely visible. Today to bypass this "delay issue" I added a trigger on shot that has following action "execute trigger A". It executes next trigger that launches the timer of muzzle flash disappearance trigger. In short "execute trigger A" trigger action creates the needed delay that makes flash appearance and launch of flash disappearance timer occur at the same time.

It's really sad that this bug report was posted 1 month ago and there is still no response from Eric Gurt, so I have to dig into this issue alone without any explanations or hints from game developer. Either way, sooner I will update my test map removing all old muzzle flash systems and I want to make the map smaller and less confusing overall, so if anybody has questions regarding old muzzle flash systems, ask now before I remove them.
User avatar
xElijah
Usurpation Soldier [50]
 
Posts: 96
Joined: 3 October 2020, 15:43

Re: [BUG REPORT] Players don't see muzzle flash.

Postby Eric Gurt » 16 November 2020, 12:19

From description it looks like problem could be related to how PB2 implements network delay compensation for timers that were called by triggers that were called by other players. Solution could be an extra timer that is called by extra trigger that is called by first timer perhaps?

Same is applied to movables, but in their case they move at double speed for short period of time in order to appear where they should be by the time game state snapshot reaches player.
Work it harder
Make it better
Do it faster
Makes us stronger
More than ever hour
After our work is never over.
User avatar
Eric Gurt
PB2 Developer
 
Posts: 409
Joined: 14 July 2013, 16:46
Location: dn.ua

Re: [BUG REPORT] Players don't see muzzle flash.

Postby xElijah » 16 November 2020, 15:36

Eric Gurt wrote:From description it looks like problem could be related to how PB2 implements network delay compensation for timers that were called by triggers that were called by other players. Solution could be an extra timer that is called by extra trigger that is called by first timer perhaps?

Same is applied to movables, but in their case they move at double speed for short period of time in order to appear where they should be by the time game state snapshot reaches player.

Thanks for the reply. It makes things clearer now. I already managed to fix the issue using similar method.

Mind checking the other bug report too? It's about connection issues with the server. Link.
User avatar
xElijah
Usurpation Soldier [50]
 
Posts: 96
Joined: 3 October 2020, 15:43

Re: [BUG REPORT] Players don't see muzzle flash.

Postby xElijah » 17 November 2020, 16:05

Map xelijah-test was updated. I removed 1-frame and 2-frame muzzle flash systems and replaced them with "multiframe" muzzle flash system. It works good for both slow firing and fast firing guns. It works in singleplayer and multiplayer. Though sometimes in multiplayer trigger on shot gets skipped when you use fast firing guns, but it's a PB2 game's/server's fault, not map's fault. Soon I will release a custom weapons tutorial describing every single step on how to create them. I just need to test the knife for bugs beforehand.
User avatar
xElijah
Usurpation Soldier [50]
 
Posts: 96
Joined: 3 October 2020, 15:43


Return to Bug Reporting, Help & Support

Who is online

Users browsing this forum: No registered users