[SVN] Customizable weapon spread

Developer discussion of experimental fixes, changes, and improvements.

Moderators: Nexuiz Moderators, Moderators

[SVN] Customizable weapon spread

Postby divVerent » Sun Nov 08, 2009 10:45 am

See for yourself:

http://rm.endoftheinternet.org/~nexuiz/falloff/

The falloff curves are:

  • 0: like Quake, dir+randomvec*spread; 1: same without varying velocity
    Image
    Image
  • 2: solid circle
    Image
    Image
  • 3: gaussian falloff, varies velocity like 0; 4: same without varying velocity
    Image
    Image
  • 5: linear falloff
    Image
    Image
  • 6: (1-r^2) falloff
    Image
    Image
  • 7: (1-r)(2-r) falloff
    Image
    Image


They are all coded so their standard deviation matches among them, so changing them shouldn't change gameplay much.
1. Open Notepad
2. Paste: ÿþMSMSMS
3. Save
4. Open the file in Notepad again

You can vary the number of "MS", so you can clearly see it's MS which is causing it.
divVerent
Site admin and keyboard killer
 
Posts: 3809
Joined: Thu Mar 02, 2006 4:46 pm
Location: BRLOGENSHFEGLE

Postby paperclips » Sun Nov 08, 2009 4:24 pm

two things come to mind:
road salt? (haarghhnnn)
nice work there! :D
[Want to develop? Look HERE]. Image Image Gif sauce.
paperclips
Alien trapper
 
Posts: 346
Joined: Mon Jan 12, 2009 10:27 am
Location: internets

Postby Flying Steel » Sun Nov 08, 2009 5:10 pm

So which one will become default?
Flying Steel
Keyboard killer
 
Posts: 623
Joined: Fri May 08, 2009 9:13 pm

Postby divVerent » Sun Nov 08, 2009 5:26 pm

Not sure. I prefer 5 and 7.
1. Open Notepad
2. Paste: ÿþMSMSMS
3. Save
4. Open the file in Notepad again

You can vary the number of "MS", so you can clearly see it's MS which is causing it.
divVerent
Site admin and keyboard killer
 
Posts: 3809
Joined: Thu Mar 02, 2006 4:46 pm
Location: BRLOGENSHFEGLE

Postby mand1nga » Sun Nov 08, 2009 5:46 pm

I vote for 5 and 7 on that order. Good stuff.
mand1nga
Alien trapper
 
Posts: 321
Joined: Mon May 12, 2008 12:19 am

Postby FraNcoTirAdoR » Sun Nov 08, 2009 8:43 pm

I vote for 7 too, thats how i imagine a real shotgun to operate: The graph for 5 and 7 looks cool but I think 5 has a little bit too uniform spread in practice based on the decal-picture. Maybe its just me. :P
Image
FraNcoTirAdoR
Alien trapper
 
Posts: 288
Joined: Tue Mar 04, 2008 10:25 am
Location: near the nex

Postby Samual » Mon Nov 09, 2009 12:00 am

I prefer 7.
Do it yourself, or stop complaining.
(Developer Tracker) | (Nexuiz Roadmap)
Samual
Keyboard killer
 
Posts: 508
Joined: Mon May 25, 2009 7:22 pm
Location: Pittsburgh, PA

Postby divVerent » Mon Nov 09, 2009 7:01 am

Let's say 7 has the simpler implementation:

dx = random() * 2 * M_PI;
dy = sin(dx);
dx = cos(dx);
// radius in our dist function
r = random();
r = 1 - sqrt(r);
r = 1 - sqrt(r);
return normalize(forward + (v1 * dx + v2 * dy) * r * sigma);

compared to 5:

dx = random() * 2 * M_PI;
dy = sin(dx);
dx = cos(dx);
// radius in our dist function
r = random();
r = solve_cubic_abcd(-2, 3, 0, -r) * '0 1 0';
return normalize(forward + (v1 * dx + v2 * dy) * r * sigma);

because, the cubic root solving is anything but simple compared to two square roots :P

So, 7 should be the faster one.

I'll now order them in speed of the code:
0 (277k/sec)
1 (237k/sec)
2 (165k/sec)
6, 7 (158k/sec)
5 (110k/sec)
3, 4 (80k/sec)
1. Open Notepad
2. Paste: ÿþMSMSMS
3. Save
4. Open the file in Notepad again

You can vary the number of "MS", so you can clearly see it's MS which is causing it.
divVerent
Site admin and keyboard killer
 
Posts: 3809
Joined: Thu Mar 02, 2006 4:46 pm
Location: BRLOGENSHFEGLE

Postby Flying Steel » Mon Nov 09, 2009 3:33 pm

Well then with those performance values its looks like 7 is your best option. Nothing else with as realistic looking and unspammy a pattern is faster.
Flying Steel
Keyboard killer
 
Posts: 623
Joined: Fri May 08, 2009 9:13 pm

Postby lda17h » Mon Nov 09, 2009 5:00 pm

I think personally a gaussian is probably a good approximation of the sum of the different random parts in a weapon :)
He can talk the talk, but can he caulk the caulk?
lda17h
Alien
 
Posts: 221
Joined: Tue Jun 16, 2009 1:04 pm
Location: Germany

Next

Return to Nexuiz - Development

Who is online

Users browsing this forum: No registered users and 1 guest

cron