My own sound mod Issue ( ANDERS pls)

Making or wanting help making your own asset? Check in here
Post Reply
milosv123344
Posts: 100
Joined: 2012-07-29 13:26

My own sound mod Issue ( ANDERS pls)

Post by milosv123344 »

Hello how you doing, basically i have yet another annoying problem. What i am trying to do, i do not know if its possible to do in BF2/Pr.
Basically , i have a lot of sounds recorded with high tech equipment. All different sounds.
As you may know in reality no shots sounds the same, which is exactly my problem.

Lets say i got an ak47 sound, and i have over 15 different firing pin sounds, basicly its the same thing recorded over and over again BUT it has variations, some sound shorter, some longer, some sound stronger, some weaker, all in all each one has its own "something".

All this above also applies shooting samples , or reflections in the air (that reverb woosh after the bullet).
All in all those 3-6 samples (firing pin,bassy thump, shot,weapon "****" thing going back, woosh..) make 1 shot.

That would mean that i would have to make 15 different shots , which is time consuming but i can do it.

Now when that is done how do i make it that when i fire , those shots are played randomly?

For one i would probably have to put them all in the weapon sound folder and name them
ak47_fire_1p_outdoor.wav
ak47_fire_1p_outdoor2.wav
ak47_fire_1p_outdoor3.wav
ak47_fire_1p_outdoor4.wav
And so on...

Then i would have to go in to the weapon setting rurif_ak47_4.tweak and just spam...

ObjectTemplate.activeSafe Sound S_rurif_ak47_4_Fire1P
ObjectTemplate.modifiedByUser tda
ObjectTemplate.soundFilename "objects/weapons/handheld/rurif_ak47/sounds/ak47_fire_1p_outdoor.wav"
ObjectTemplate.loopCount 0
ObjectTemplate.is3dSound 0
ObjectTemplate.stopType 1
ObjectTemplate.volume 1
ObjectTemplate.pitch 1
ObjectTemplate.pan 0.5
ObjectTemplate.reverbLevel 1
ObjectTemplate.pitchEnvelope 0/1/0.9/1.1/1/1/0/0.98/1.025/
ObjectTemplate.volumeEnvelope 0/1/0/1/1/1/0/0.9/1/

...for each individual shot?

I hope someone can help me with this :D
Last edited by milosv123344 on 2013-02-02 23:52, edited 1 time in total.
milosv
milosv123344
Posts: 100
Joined: 2012-07-29 13:26

Re: My own sound mod Issue ( ANDERS pls)

Post by milosv123344 »

Thanks for the help.
milosv
LITOralis.nMd
Retired PR Developer
Posts: 5658
Joined: 2010-04-10 16:15

Re: My own sound mod Issue ( ANDERS pls)

Post by LITOralis.nMd »

Hello,

I am not a python programmer, I've worked in SQL and Oracle database work though,


In general coding terms, you want to create an array with several sub-arrays. Or you want to use a Shuffle List command.
Each sub array being called by a RANDOM function or a SHUFFLE function.

random.shuffle should work. Here's an example, where the objects are lists:

This is a single subarray, say the firing pin, you'd have to create a subarray for each part of the sound sequence, ...
from random import shuffle
x = [ for i in range(6)]
shuffle(x)

I would like to point out it might be less CPU cycles to create every possible sound combo into it's own line of python code, and create a single Shuffle function. If you code in python, the itertools are your friend for this.

A 30 round magazine shot continuously would create 180 memory calls plus the magazine reload and magazine empty sounds, that would kill CPUs and HDDs.
milosv123344
Posts: 100
Joined: 2012-07-29 13:26

Re: My own sound mod Issue ( ANDERS pls)

Post by milosv123344 »

'[R-COM wrote:LITOralis.nMd;1861827']Hello,

I am not a python programmer, I've worked in SQL and Oracle database work though,


In general coding terms, you want to create an array with several sub-arrays. Or you want to use a Shuffle List command.
Each sub array being called by a RANDOM function or a SHUFFLE function.

random.shuffle should work. Here's an example, where the objects are lists:

This is a single subarray, say the firing pin, you'd have to create a subarray for each part of the sound sequence, ...
from random import shuffle
x = [ for i in range(6)]
shuffle(x)

I would like to point out it might be less CPU cycles to create every possible sound combo into it's own line of python code, and create a single Shuffle function. If you code in python, the itertools are your friend for this.

A 30 round magazine shot continuously would create 180 memory calls plus the magazine reload and magazine empty sounds, that would kill CPUs and HDDs.


Aaahh i see! I will look in to that!
The reason why i want something like this is that battlefield 3 sound engine works pretty much the same way i plan on making this (kind of like a node graph , i extracted the files and saw what they did), and its audio experience is beyond amazing , so i wanted to recreate something in bf2 with my own bought sound files and samples :P

Thanks for the help !!
milosv
LITOralis.nMd
Retired PR Developer
Posts: 5658
Joined: 2010-04-10 16:15

Re: My own sound mod Issue ( ANDERS pls)

Post by LITOralis.nMd »

Good luck, I like the idea,

6 separate sounds per sequence = (2^6)-1 = 63 lines of python code if you can't figure out some time saving and RAM saving tricks.

Be aware that BF2 engine has a hard limit of 2GB of RAM for the entire level, your project is going to use a large amount of RAM I believe, though you probably know more than me on how sounds are loaded as a level is loaded.
LITOralis.nMd
Retired PR Developer
Posts: 5658
Joined: 2010-04-10 16:15

Re: My own sound mod Issue ( ANDERS pls)

Post by LITOralis.nMd »

If you aren't a programmer, but know how to use MS Excel, there is a way to visualize all your nodes pretty easily:

NodeXL is a free, open-source template for Microsoft? Excel? 2007 and 2010 that makes it easy to explore network graphs.

NodeXL: Network Overview, Discovery and Exploration for Excel - Home

With some intense Concatenate Function usage you could also write all the python in Excel too.
milosv123344
Posts: 100
Joined: 2012-07-29 13:26

Re: My own sound mod Issue ( ANDERS pls)

Post by milosv123344 »

'[R-COM wrote:LITOralis.nMd;1862243']If you aren't a programmer, but know how to use MS Excel, there is a way to visualize all your nodes pretty easily:

NodeXL is a free, open-source template for Microsoft? Excel? 2007 and 2010 that makes it easy to explore network graphs.

NodeXL: Network Overview, Discovery and Exploration for Excel - Home

With some intense Concatenate Function usage you could also write all the python in Excel too.
Aaah yes thanks for that, that helped as i was drawing the nodes in photoshop by myself like a retard ( lol ).
Anyway, what i was trying to do is :
1 shot - 6 different samples ( 90 samples for 15 shots)

Instead of programming how each sample plays (because it would take so much time and resources from bf2) i have it already pre made in my audio editor program , 15 shots to be exact, all i need is to program the 15 shots to be fired randomly, not the samples as the shots have been made already :D

Thanks for the help guys its much appreciated. :D


EDIT:
I got a PM reply from Anders, aparently its impossible to do in bf2 engine... He tried to do it himself
Last edited by milosv123344 on 2013-02-09 15:35, edited 1 time in total.
Reason: Solved
milosv
-=anders=-
Retired PR Developer
Posts: 1532
Joined: 2005-10-27 14:48

Re: My own sound mod Issue ( ANDERS pls)

Post by -=anders=- »

milosv123344 wrote:Aaah yes thanks for that, that helped as i was drawing the nodes in photoshop by myself like a retard ( lol ).
Anyway, what i was trying to do is :
1 shot - 6 different samples ( 90 samples for 15 shots)

Instead of programming how each sample plays (because it would take so much time and resources from bf2) i have it already pre made in my audio editor program , 15 shots to be exact, all i need is to program the 15 shots to be fired randomly, not the samples as the shots have been made already :D

Thanks for the help guys its much appreciated. :D


EDIT:
I got a PM reply from Anders, aparently its impossible to do in bf2 engine... He tried to do it himself
That's what I got told atleast from another guy. It's possible through effects though.
[img]https://dl.dropboxusercontent.com/u/11035283/anders_prsig.png[/img]
PR:BF2 Sound & VisualFX

Post Reply

Return to “PR:BF2 Community Modding”