With cordite in the air, splintered steel, shell casings and powder burns, there’s only one explanation...
Discuss & improve the game engine.

Moderators: Tequila, sparcdr, torhu

Weapons Testing Patch

Postby torhu » Fri Sep 25, 2009 1:22 am

I made a little weapons testing patch couple of weeks ago. I'm posting it here in case anyone wants to do some experimenting. NB! You need to be able to compile the game to use it. If people request it, maybe we'll provide a pk3 file to download later. :)

Patch here.

It adds three commands called 'spread', 'damage' and 'range'. You can use them in three ways:

  • <command> - show values for all weapons.
  • <command> <weaponNumber> - show value for a single weapon.
  • <command> <weaponNumber> <newValue> - set value for a weapon.

The weapon numbers are listed when you type just the command with no arguments.

To see the distance and the damage done when you hit something, you can uncomment some of Spoon's old debug code:

Code: Select all
Index: game/g_weapon.c
===================================================================
--- game/g_weapon.c   (revision 295)
+++ game/g_weapon.c   (working copy)
@@ -406,8 +406,8 @@
       damage -= (1/sqrt(bg_weaponlist[weapon].range/distance))*2;
    }
 
-   //G_Printf("distance:%f, damage: %f org. damage: %f\n", distance, damage,
-   //   bg_weaponlist[weapon].damage);
+   G_Printf("distance: %.1f, damage: %.1f of %.1f\n", distance, damage,
+      bg_weaponlist[weapon].damage);
 
    return damage > 0 ? damage : 0 ;
 }


The patch doesn't save the settings. Shouldn't be too hard to just add a read-only cvar for each command to store the values. That would also be a simple way to transfer the settings to the clients. The patch currently only affects the server code, but most things will still work as expected.

If there are any questions, I'll be here for a few hours, but then I'll be away for the weekend. :)
In game: =SG=monSter
Monster Browser
User avatar
torhu
SG Team
 
Posts: 1110
Joined: Thu Jan 06, 2005 8:12 pm
Location: Norway



Postby torhu » Fri Dec 23, 2011 12:53 am

For future reference, this patch was added to SG in r347 and removed in r620.
In game: =SG=monSter
Monster Browser
User avatar
torhu
SG Team
 
Posts: 1110
Joined: Thu Jan 06, 2005 8:12 pm
Location: Norway



Postby moRtem » Fri Dec 23, 2011 11:03 am

torhu wrote:For future reference, this patch was added to SG in r347 and removed in r620.


Why removed? Sounds like an interesting set of settings to play with.
User avatar
moRtem
Gunslinger
 
Posts: 284
Joined: Sun Mar 15, 2009 5:56 pm



Postby torhu » Sat Dec 24, 2011 12:41 am

It was just ment for experimentation, it wasn't suited for a release. It's there in 1.1b4 if you want to play with it.
In game: =SG=monSter
Monster Browser
User avatar
torhu
SG Team
 
Posts: 1110
Joined: Thu Jan 06, 2005 8:12 pm
Location: Norway




Return to Code

Show Sidebar
Show Sidebar

User Control Panel