How to hide visual / sound effects during duel?

Discussions about modding, questions, mod requests or just show off what you're working on.
Post Reply
User avatar
Miso
Posts: 170
Joined: 24 Feb 2015, 02:41
Location: Massachusetts / United States

How to hide visual / sound effects during duel?

Post by Miso »

Hello, this is something I've wondered how to do for a while now and not sure if anybody would be willing to post some code pieces on how to do this.

I've used Daggolin's duel invisibility code that he posted on [DARK] Forum a while ago for the JJ Clientside (which is credited of course). What I am trying to do is to take it a step further and hide other player sounds and their effects (example ; like if they are in a duel or fighting you will see their saber clash as well, or if there's weapons you can see the bullets) like how it is done on the DS-Online clientside.

Much appreciated if one could assist :)
Jj.miso
User avatar
Valar
Posts: 67
Joined: 16 Aug 2015, 18:17
Location: Loading, please wait..

Re: How to hide visual / sound effects during duel?

Post by Valar »

Loda had this to say about sounds in JKA:
Sounds are mostly handled as events, where the server sends an event to the client (like EV_PAIN or EV_DEATH or EV_FIRE_WEAPON) and the client parses the info and does the appropriate actions (like play a pain sound, or a death sound + obituary message, or play a weapon firing sound + weapon firing FX).

Some of the events already tell the client who originated them, so in those cases its very easy to ignore the event if you are in a duel and the originator is not you or your duel partner. some events dont send this info though, so you have to do lots of bandaid fixes to try to cover all the sounds. for example if you are saberonly or force dueling you can ignore every weapon fire/weapon switch/weapon impact event.

I havn't looked at the code in a while but IIRC the main problem is that lots of sounds are sent as EV_GENERAL_SOUND, without a way to tell who originated it, so its hard to tell which sounds you should keep and which sounds you should ignore (since both types of sounds are sent using this).

Something I did in my fork for jaMME was to look at the origin of the sound, and compare it to the origin of yourself/your dueler, and if it is not in proximity ignore it. This has a few false positives though and it wont work for sounds like saberdrops though... unless -- idk.

-Loda
User avatar
fau
Staff
Posts: 433
Joined: 16 Aug 2015, 01:01
Location: Warsaw / Poland
Contact:

Re: How to hide visual / sound effects during duel?

Post by fau »

Miso wrote:like how it is done on the DS-Online clientside.
It's in the serverside.
User avatar
Daggolin
Administrator
Posts: 794
Joined: 23 Feb 2015, 13:05

Re: How to hide visual / sound effects during duel?

Post by Daggolin »

The Loda quote perfectly describes the issue. And as fau said the DS-Online serverside does some changes here. As far as I remember the serverside adds the clientNum of the player who triggered the event somewhere (I think as ownerNum). The DS-Online clientside probably reads those ownerNums and decides whether events belong to you/your opponent based on the ownerNum of the event. I don't see any way to achieve this without serverside adaptions (except the proximity based filter, but as Loda pointed out that wouldn't be perfectly accurate and couldn't filter for instance the sound of a dropping saber - in case you duel with saber throw - or similar things).

By the way, that's the only reason my old codepiece does not filter sounds or similar and only removes players and their prediction.
Post Reply
Created by Matti from StylesFactory.pl and Warlords of Draenor (modified by jk2.info)
Powered by phpBB® Forum Software © phpBB Limited