Home » MODDING HQ 1.13 » v1.13 General Development Talk » Revamping revolvers
Revamping revolvers[message #252676] Sun, 30 May 2010 23:12 Go to next message
P.Val is currently offline P.Val

 
Messages:70
Registered:May 2010
I just made a small change regarding revolvers:

PVal
#1 (high) Making revolvers a little bit more realistic and useful by making unjamming easier (as each bullet has its own chamber). This will require adding a new entry to the weapons xml instead of hardcoding, as the system cannot make a difference between revolvers and self-loaders. Of course, it will be backwards-compatible as non-revolving guns will not be changed and the code will look only after the existence or non-existence of that entry.

I introduced a new xml entry "EasyUnjam" (didn't want to label the gun as "revolver" as modders might add this option to guns other than revolvers), and changed the Weapons.cpp to call SkillCheck() with a high enough bChanceMod to ensure a successful unjam, and drastically lowered the exp gain for such an easy task. I was considering adding a tiny penalty for very small dexterity values, but I decided against it, as you've already lost a bullet from a very small magazine, and if jamming occurred in the first place, the gun is in a bad enough shape that there is a high chance of the next bullet failing to fire es well. (To add this skill check regardless, the SkillCheck function could check for the high bChanceMod in case of UNJAM_GUN_CHECK, as weapon related variables are inaccessible)
As it is a minor change, I considered against having an ini option for it, and against making it HAM-specific.

As this is my first code change ever, my question is: what to do with it? Who should I give it to? Who makes the decision weather to add it to the main 1.13 code or not? How would future players know about this feature so that they can consider using revolvers in the early game a little more often?

While making and testing this small change, I had the following ideas/questions:
#1. One of my other old ideas was to add single/double action mode (and maybe fanning, settable from the ini in case of those who dislike it) to revolvers. This would require one of these two things:
1A. creating a different weapon class, and hardcoding this behavior for the "revolver" class. As there is a TODO in the code noting that it's planned to make weapon classes external, I considered waiting. Besides, this would require a lot of careful checks and changes in the whole code at places unrelated to this feature, as weapon classes are referenced a lot.
1B. externalizing firing modes. Many of the details around firing modes are hardcoded. I've heard about Headrock considering the revamping of firing modes and maybe multiple ammo types, I did't want to rush it.
I think I'll wait for the opinion of the developers of the above changes before I start messing around with it.

#2. The damage values in the description box are 2 lower than those on Bobby Ray's page.
#3. There is code about airstrikes, but I never witnessed it occurring.

[Updated on: Sun, 30 May 2010 23:21] by Moderator

Report message to a moderator

Corporal
Re: Revamping revolvers[message #252677] Sun, 30 May 2010 23:46 Go to previous messageGo to next message
DepressivesBrot is currently offline DepressivesBrot

 
Messages:3641
Registered:July 2009
Code changes are best sent to RoWa21.
Quote:
how would future players know about this feature so that they can consider using revolvers in the early game a little more often?

Well this thread is a good start. Generally, there are so many small improvements, nobody can know them all when beginning to play 1.13, but as it's 'realistic' behavior, some will probably assume it has to be that way.

#1 Well, I probably fall into the 'dislike' group, but an ini option is OK with me.
Seeing as externalizations are often boring/tedious but always appreciated, you should simply ask if someone is doing it already to avoid double work and then do it.
#2 Never noticed this, strange.
#3 As for those airstrikes, they were planned by the original devs, but deactivated due to either a) game breaking or b) stability issues (or both).
They were then reactivated in early 1.13 versions but were then again removed for stability reasons.
And before Dieter sees this: yes, I heard Demise of Man has airstrikes but I don't know if they are reasonably stable.

Report message to a moderator

Captain

Re: Revamping revolvers[message #252679] Mon, 31 May 2010 00:18 Go to previous messageGo to next message
Headrock

 
Messages:1757
Registered:March 2006
Location: Jerusalem
Good work, Pval. See, I told you the code's easy to figure out - at least where it concerns game mechanics. You did that very quickly, it's a good sign (assuming it actually works Wink ). Keep up the good work!

Report message to a moderator

Sergeant Major

Re: Revamping revolvers[message #252680] Mon, 31 May 2010 00:30 Go to previous messageGo to next message
P.Val is currently offline P.Val

 
Messages:70
Registered:May 2010
Thanks, Headrock, but I don't think it's that big of achievement Smile : I only changed a few lines of code, tested it a little and that's all. I didn't have time in the last few days, that's why I did these changes only this evening. I sent a message to RoWa21 asking how to do a checkin. By the way, is anyone still working on the firing mode externalization and multiple ammotypes stuff? It seems complex enough for me to not start right away because of irl time constraints, but I consider it one of my long term goals.

Report message to a moderator

Corporal
Re: Revamping revolvers[message #252686] Mon, 31 May 2010 01:18 Go to previous messageGo to next message
P.Val is currently offline P.Val

 
Messages:70
Registered:May 2010
Doing some more testing I discovered something strange: if I build my own exe, I can't throw hand grenades: their range becomes zero, so my mercs can only blow themselves up. It happens both in debug and release modes, and to be extra sure, I tried it out again with the original source without my modifications: the same effect. Maybe someone introduced a bug since the last exe release?

Report message to a moderator

Corporal
Re: Revamping revolvers[message #252688] Mon, 31 May 2010 02:06 Go to previous messageGo to next message
Headrock

 
Messages:1757
Registered:March 2006
Location: Jerusalem
Quote:
Thanks, Headrock, but I don't think it's that big of achievement smile : I only changed a few lines of code, tested it a little and that's all.


Let's just say I envy those who can just read the code and know what to do with it. I usually spend days just trying to figure out how something works at all.

Quote:
I sent a message to RoWa21 asking how to do a checkin.


As a newcomer, you're unlikely to get priviliges to check in. Of course that's up to RoWa. But the best course of action would be to simply send him all the changed files, he's pretty good at merging them into the code. It's a good idea to first annotate everything you changed so that it's easy to recognize.

Quote:
is anyone still working on the firing mode externalization and multiple ammotypes stuff?


Firing modes would be virtually impossible to externalize. It would require a functioning and inherent LUA scripting system, which is easier to build from the ground up (I.E., SMP project).

Dunno what you mean about multiple ammo types. As in, loading different bullets into the same magazine? If so, that would be extremely complicated, not game-wise, but interface-wise. It would require a whole mechanism to allow players to do that comfortably. As with everything else, it's possible (and easier than externalizing firing modes for sure) but still quite some work.

Quote:
Doing some more testing I discovered something strange: if I build my own exe, I can't throw hand grenades: their range becomes zero, so my mercs can only blow themselves up. It happens both in debug and release modes, and to be extra sure, I tried it out again with the original source without my modifications: the same effect. Maybe someone introduced a bug since the last exe release?


Which version of the code are you working with? There have been grenade issues reported with Bigger Maps, but those only occur when a big sector is loaded. Also they cause grenades to have no distance limit... Other than that - beats me. I haven't actually played the game in a long time.

Also, I shouldn't have to say that this is one reason why sending the code to RoWa a day after you're done with it isn't a good idea. Wink

Test, test, test.

Report message to a moderator

Sergeant Major

Re: Revamping revolvers[message #252691] Mon, 31 May 2010 02:41 Go to previous messageGo to next message
P.Val is currently offline P.Val

 
Messages:70
Registered:May 2010
I did a full SVN checkout just a few days ago, so it is pretty recent. About the change, it was just Weapon.cpp where one more IF to the xml reading function was added, and the CheckForGunJam() which got a few lines added in, and Weapons.h to add one new variable. No pointers, nothing what could affect anything else, but just to be extra sure, I checked out the original source again, and the same thing happens.
About testing, I tested everything what can be related to this tiny new feature: Got a bunch of revolvers and other guns from Bobby Ray, piled them up in the middle of the map, blown them up to around 40%-50% with explosives, and started firing away, both with high and low mechanics skill. (I discovered the grenade bug while trying to damage the guns more by lobbing a grenade at them)

Headrock
Dunno what you mean about multiple ammo types. As in, loading different bullets into the same magazine?

I mean guns to have the possibility of having two magazines: built-in grenade launchers (or underbarrel shotguns, aimer bullets for RPGs or anything modders will come up with) would be considered not as objects, but as ammo. A quick solution with rifle grenades would be to remove one "ammo type" grenade from the "clip", then create and fire a corresponding old-fashioned grenade.

About firing mode externalization, I don't mean a full scripting system, just a parameterized solution: the code will handle all the firing of bullets, the parameters will just effect APs, CTHs, number of bullets fired, etc.

Report message to a moderator

Corporal
Re: Revamping revolvers[message #252696] Mon, 31 May 2010 04:30 Go to previous messageGo to next message
Headrock

 
Messages:1757
Registered:March 2006
Location: Jerusalem
Quote:
built-in grenade launchers (or underbarrel shotguns, aimer bullets for RPGs or anything modders will come up with) would be considered not as objects, but as ammo.


If all goes well with NAS, main gun ammo will behave as an attachment rather than ammo. So I'm thinking the opposite way Razz

Quote:
About firing mode externalization, I don't mean a full scripting system, just a parameterized solution: the code will handle all the firing of bullets, the parameters will just effect APs, CTHs, number of bullets fired, etc.


You lost me there.

Report message to a moderator

Sergeant Major

Re: Revamping revolvers[message #252700] Mon, 31 May 2010 11:26 Go to previous messageGo to next message
P.Val is currently offline P.Val

 
Messages:70
Registered:May 2010
OK, I'll wait then for NAS to be finished or at least merged into 1.13 before continuing to make plans about ammo and firing modes.

Report message to a moderator

Corporal
Re: Revamping revolvers[message #252909] Fri, 04 June 2010 00:06 Go to previous messageGo to next message
wanne (aka RoWa21) is currently offline wanne (aka RoWa21)

 
Messages:1949
Registered:October 2005
Location: Austria
@PVal: Thanks for the code. It is committed in the development source.

Report message to a moderator

Sergeant Major

Re: Revamping revolvers[message #253073] Sat, 05 June 2010 01:00 Go to previous message
UniversalWolf is currently offline UniversalWolf

 
Messages:140
Registered:June 2009
Location: United States
Well done, PVal. You actually contributed something to the project instead of just nitpicking like most people (me included). :headbanger:

Report message to a moderator

Sergeant
Previous Topic: how do i hook up DATA-HAM into VFS.
Next Topic: no martial arts movement in stomp?
Goto Forum:
  


Current Time: Fri Jun 12 11:09:48 GMT+3 2026

Total time taken to generate the page: 0.01930 seconds