Home » MODDING HQ 1.13 » Flugente's Magika Workshop » New feature: Overheating Weapons
Re: Feature: Overheating Weapons[message #325808] Fri, 27 September 2013 15:17 Go to previous messageGo to next message
Sam Hotte

 
Messages:1966
Registered:March 2009
Location: Middle of Germany
"Let's get pissed in Arulco"
"D. piss off!"
? Wink

Report message to a moderator

Sergeant Major
Re: Feature: Overheating Weapons[message #325813] Fri, 27 September 2013 15:52 Go to previous messageGo to next message
Zombiehunter is currently offline Zombiehunter

 
Messages:182
Registered:March 2011
Location: Franconia, Germany
But seriously guys, while the idea of a pooping and pissing system is hilarious, don't get to carried away, next thing someone's asking for a cooking system and then you start going to town to buy groceries, then you need a pan and firewood to make a campfire, so you'll need a woodcutting system and in the end you sit there in some wood sector at your campfire and start making bacon and eggs in your frying pan. My point is, don't let this get outta hand Wink

Report message to a moderator

Staff Sergeant
Re: Feature: Overheating Weapons[message #325818] Fri, 27 September 2013 16:11 Go to previous messageGo to next message
DepressivesBrot is currently offline DepressivesBrot

 
Messages:3658
Registered:July 2009
Zombiehunter
But seriously guys, while the idea of a pooping and pissing system is hilarious, don't get to carried away, next thing someone's asking for a cooking system and then you start going to town to buy groceries, then you need a pan and firewood to make a campfire, so you'll need a woodcutting system and in the end you sit there in some wood sector at your campfire and start making bacon and eggs in your frying pan. My point is, don't let this get outta hand Wink
Or in short Jagged Alliance: Minecraft Edition

Report message to a moderator

Captain

Re: Feature: Overheating Weapons[message #325820] Fri, 27 September 2013 16:17 Go to previous messageGo to next message
Sam Hotte

 
Messages:1966
Registered:March 2009
Location: Middle of Germany
DepressivesBrot
Zombiehunter
But seriously guys, while the idea of a pooping and pissing system is hilarious, don't get to carried away, next thing someone's asking for a cooking system and then you start going to town to buy groceries, then you need a pan and firewood to make a campfire, so you'll need a woodcutting system and in the end you sit there in some wood sector at your campfire and start making bacon and eggs in your frying pan. My point is, don't let this get outta hand Wink
Or in short Jagged Alliance: Minecraft Edition

Yeah, exactly my thought as well: We need a JA-Minecraft total conversion ... Wink

Report message to a moderator

Sergeant Major
Re: Feature: Overheating Weapons[message #325821] Fri, 27 September 2013 16:22 Go to previous messageGo to next message
Gambigobilla

 
Messages:693
Registered:July 2008
I thought someone is already coding a crafting table.

Report message to a moderator

First Sergeant
Re: Feature: Overheating Weapons[message #325823] Fri, 27 September 2013 16:49 Go to previous messageGo to next message
DepressivesBrot is currently offline DepressivesBrot

 
Messages:3658
Registered:July 2009
You can collect cow poop and turn it into fertilizer. That's close enough.

Report message to a moderator

Captain

Re: Feature: Overheating Weapons[message #325824] Fri, 27 September 2013 16:50 Go to previous messageGo to next message
silversurfer

 
Messages:2793
Registered:May 2009
Hey, I just fixed the sex animation in the brothel. Why not have... :rofl:

Report message to a moderator

Lieutenant
Re: Feature: Overheating Weapons[message #325827] Fri, 27 September 2013 17:18 Go to previous messageGo to next message
silversurfer

 
Messages:2793
Registered:May 2009
Sam_Hotte

In older versions like 4870 stable a gun will rarely jam at 94% condition; the occasional jam starts somewhere in the 80ies and below AFAICS.
And that's what I think is good value so that you can't use most dropped weapons immediately in the very same battle you found them.


Just for your interest - this is the code that was used in the past to calculate gun jams:

/* Old jam code 
// gun might jam, figure out the chance 
//iChance = (80 - pObj->bGunStatus); 
 
//rain 
iChance = (80 - pObj->ItemData.Gun.bGunStatus) + gGameExternalOptions.ubWeaponReliabilityReductionPerRainIntensity * gbCurrentRainIntensity; 
//end rain 
			 
// CJC: removed reliability from formula... 
			 
// jams can happen to unreliable guns "earlier" than normal or reliable ones. 
//iChance = iChance - Item[pObj->usItem].bReliability * 2; 
			 
// decrease the chance of a jam by 20% per point of reliability; 
// increased by 20% per negative point... 
//iChance = iChance * (10 - Item[pObj->usItem].bReliability * 2) / 10; 
			 
//rain 
// iChance = iChance * (10 - Item[pObj->usItem].bReliability * 2) / 10; // Madd: took it back out 
//end rain 
			 
if (pSoldier->bDoBurst > 1) 
{ 
// if at bullet in a burst after the first, higher chance 
iChance -= PreRandom( 80 ); 
} 
else 
{ 
iChance -= PreRandom( 100 ); 
} 
*/ 

It was commented and replaced in revision 2207. I guess this is the time when the higher jam probability started.

[Updated on: Sat, 28 September 2013 11:00] by Moderator

Report message to a moderator

Lieutenant
Re: Feature: Overheating Weapons[message #325834] Sat, 28 September 2013 01:41 Go to previous messageGo to next message
Zundman7301 is currently offline Zundman7301

 
Messages:38
Registered:June 2005
Location: USA
silversurfer
It was commented out and replaced in revision 2207. I guess this is the time when the higher jam probability started.


Yeah, that looks like what I'm talking about. Thanks for that. In original JA2 (v1.12) jamming happened a lot later. Probably TOO much later (into the high 60th percentile? Can't remember.) But even having a chance of jamming in the 90th percentile seems to have gone too far in the other direction. I think there should be a happy medium between the two extremes.

Report message to a moderator

Private 1st Class
Re: Feature: Overheating Weapons[message #325836] Sat, 28 September 2013 02:09 Go to previous messageGo to next message
pheloncab is currently offline pheloncab

 
Messages:278
Registered:August 2004
Location: So. Cal. or texas
Reliability is usually from about -4 to positive 4 right? that means a 'bad' weapon with this formula could have 60-80 % jam rates which is WAY too much, and if the weapon had a good reliability rate it could run real damaged and still fire.

my personal table would look something like this
Reliability +/- 3% per point.

Weapon status: 91-100% 1% jam chance
85-90 % 2%
80-84 4%
70-79 6%
60-69 10%
50-59 20%
30-49 35%
16-29 50%
1-15 75%

This means a 'ultra-reliable' weapon with reliabilty 4 would have 12% jam resistance or be able to get down into the 50s, most reliable weapons being a 2 would get 6% so would crack 80% for jams to start. on the other side, total trash weapons would start with a small chance of jamming 13% and it would creep up slowly at first and then gets worse the further the weapon goes down.

Obviously these numbers would have to be play tested, but its a good start point for conversing from.


Report message to a moderator

Master Sergeant
Re: Feature: Overheating Weapons[message #325839] Sat, 28 September 2013 11:44 Go to previous messageGo to next message
silversurfer

 
Messages:2793
Registered:May 2009
Sorry I think I used the wrong term there. That code was made inactive in rev 2207. It hasn't been used anymore since then. The new code was this:

Toggle Spoiler

That code hasn't changed much since rev 2207 except for Flugente's additions of weapon overheating and dirt feature which seem to work nicely. This is the current code:
Toggle Spoiler

The only thing that I don't understand is why he multiplies with "dirtpercentage" twice.

Simple example calculation for a single shot with a weapon that is at 100%, no heat system, no dirt system, no rain, no reliability modifier, no burst. This is the "perfect" scenario:

invertedBaseJamChance = 100 + 0*2 + rain intensity*0 = 100

jamChance = 100 - sqrt ( 100 * (75 - 0*15 + 100 /2 ) = 100 - sqrt ( 100 * 125 ) = 100 - 111 = -11

edit: This means that a weapon in perfect condition will never jam under these circumstances.
A weapon that is at 80% status will have a 5% chance of jamming under perfect circumstances and so on.

Temperature and/or dirt will modify the chance of weapon jamming so as long as they are activated we can expect our weapons to jam more frequently.

[Updated on: Sat, 28 September 2013 17:56] by Moderator

Report message to a moderator

Lieutenant
Re: Feature: Overheating Weapons[message #325848] Sat, 28 September 2013 16:58 Go to previous messageGo to next message
Moa is currently offline Moa

 
Messages:58
Registered:September 2013
Quote:
jamChance = 100 - sqrt ( 100 * (75 - 0*15) + 100 /2 ) = 100 - sqrt ( 7500 + 50 ) = 100 - 86 = 14


the second brace of sqrt closes after 100/2
jamChance = 100 - sqrt ( 100 * (75 - 0*15 + 100 /2 ) )
          = 100 - sqrt ( 100 * 125 ) = 100 - 111 = -11
          = 0

Report message to a moderator

Corporal
Re: Feature: Overheating Weapons[message #325858] Sat, 28 September 2013 17:57 Go to previous messageGo to next message
silversurfer

 
Messages:2793
Registered:May 2009
Crap. Too many brackets error... :angry:

Thanks for correcting. Too bad that Visual Studio 2008 doesn't color these brackets. Would be easier to read.

Report message to a moderator

Lieutenant
Re: Feature: Overheating Weapons[message #325991] Mon, 30 September 2013 20:52 Go to previous messageGo to next message
silversurfer

 
Messages:2793
Registered:May 2009
Flugente, would you mind if I increase the thresholds of all machine guns by factor 5 on SVN?

I just had a fight were my machine gunner shot 23 rounds from his MG36 and after that the gun had a long red line on it saying "Temperature is dangerous"... :yikes:
I think that a machine gun should be able to fire at least 200 rounds before starting to overheat.

Report message to a moderator

Lieutenant
Re: Feature: Overheating Weapons[message #325992] Mon, 30 September 2013 20:57 Go to previous messageGo to next message
Flugente

 
Messages:3509
Registered:April 2009
Location: Germany
You can either use the global ini modifier to temperature caused an set it to a lower value, or introduce similar global modifiers for thresholds while you're at it. Same effect, but everyone will profit Wink

Report message to a moderator

Captain

Re: Feature: Overheating Weapons[message #325994] Mon, 30 September 2013 21:06 Go to previous messageGo to next message
silversurfer

 
Messages:2793
Registered:May 2009
You mean this one? -> OVERHEATING_TEMPERATURE_GLOBAL_MODIFIER

I didn't want to use this one because it will make all weapon types more "reliable".

With "similar global modifiers" do you mean one for each weapon type? This would be an interesting idea. We could leave the values in the XMLs as they are and modify by factor x as we read the XML.

So we would have a modifier for these:
	GUN_PISTOL,
	GUN_M_PISTOL,
	GUN_SMG,
	GUN_RIFLE,
	GUN_SN_RIFLE,
	GUN_AS_RIFLE,
	GUN_LMG,
	GUN_SHOTGUN

Report message to a moderator

Lieutenant
Re: Feature: Overheating Weapons[message #325995] Mon, 30 September 2013 21:08 Go to previous messageGo to next message
DepressivesBrot is currently offline DepressivesBrot

 
Messages:3658
Registered:July 2009
silversurfer
Flugente, would you mind if I increase the thresholds of all machine guns by factor 5 on SVN?

I just had a fight were my machine gunner shot 23 rounds from his MG36 and after that the gun had a long red line on it saying "Temperature is dangerous"... :yikes:
I think that a machine gun should be able to fire at least 200 rounds before starting to overheat.
That's not a machinegun, that's only marginally better than a standard G36.

Report message to a moderator

Captain

Re: Feature: Overheating Weapons[message #325996] Mon, 30 September 2013 21:11 Go to previous messageGo to next message
Flugente

 
Messages:3509
Registered:April 2009
Location: Germany
I meant modifiers for
  • damage threshold
  • jam threshold
  • cooldown speed
These modifiers would be used ingame. Modifying on reading is a potentially bad idea, as it is confusing when what you put into the xml isn't what you receive.

Report message to a moderator

Captain

Re: Feature: Overheating Weapons[message #325997] Mon, 30 September 2013 21:47 Go to previous messageGo to next message
silversurfer

 
Messages:2793
Registered:May 2009
DepressivesBrot
That's not a machinegun, that's only marginally better than a standard G36.

That hardly matters because as it is now you cannot even fire 30 rounds (the standard AR clip size for 5.56mm ammo) without the barrel of this LMG melting and this LMG has a 100 round mag. Factor 5 may be a bit much but 4 is certainly justifiable.


Flugente
I meant modifiers for
  • damage threshold
  • jam threshold
  • cooldown speed
These modifiers would be used ingame. Modifying on reading is a potentially bad idea, as it is confusing when what you put into the xml isn't what you receive.

These modifiers still have to be there for each weapon class. Otherwise the game would modify all weapons equally and we had the same situation that we have now.
I don't see the problem with modifying while reading the XML. Modders are aware of the ini files, aren't they? Players look at the values in game and these show the modified values.

Report message to a moderator

Lieutenant
Re: Feature: Overheating Weapons[message #325999] Mon, 30 September 2013 21:57 Go to previous messageGo to next message
Flugente

 
Messages:3509
Registered:April 2009
Location: Germany
Aha, then I misunderstood you... I took it overheating was too high for you in general, and you disliked that, not for a specific class. Well then, feel free to make it class-specific Wink

Ini values tend to be forgotten very fast imho.

Report message to a moderator

Captain

Re: Feature: Overheating Weapons[message #326001] Mon, 30 September 2013 22:12 Go to previous messageGo to next message
silversurfer

 
Messages:2793
Registered:May 2009
Yes, ini values tend to be forgotten. Very Happy

The problem that I see with internal modifications is that the player won't know what happens.

If he has gun A with:

OverheatingJamThreshold = 4000
OverheatingDamageThreshold = 5000
OverheatingSingleShotTemperature = 80
OverheatingCooldownFactor = 100.0

and gun B with:

OverheatingJamThreshold = 4000
OverheatingDamageThreshold = 5000
OverheatingSingleShotTemperature = 80
OverheatingCooldownFactor = 100.0

and he looks at them in the UDB he would expect both to heat up at the same rate, cool down at the same rate and reach the thresholds after the same number of shots because they show the same values. If we use the modifiers only internally the guns would behave differently despite showing identical values.
Now if we modify the values while reading the XML the player will see these values for gun B (factor 2 for both thresholds of its class in the ini):

OverheatingJamThreshold = 8000
OverheatingDamageThreshold = 10000
OverheatingSingleShotTemperature = 80
OverheatingCooldownFactor = 100.0

I would want to see these real values that the game uses. Tomorrow I will check the code and see if I can implement this system.

Report message to a moderator

Lieutenant
Re: Feature: Overheating Weapons[message #326005] Mon, 30 September 2013 22:38 Go to previous messageGo to next message
Flugente

 
Messages:3509
Registered:April 2009
Location: Germany
Be internally I mean apply in the game code itself. That includes UDB.

Report message to a moderator

Captain

Re: Feature: Overheating Weapons[message #326007] Mon, 30 September 2013 22:54 Go to previous messageGo to next message
silversurfer

 
Messages:2793
Registered:May 2009
Haha, now I misunderstood you.

Flugente

Modifying on reading is a potentially bad idea, as it is confusing when what you put into the xml isn't what you receive.

So you meant that from a debugging perspective that the item keeps its values from the XML but the player will see the modified values in UDB and the game does its calculation with the modified values as well. That makes sense.

Report message to a moderator

Lieutenant
Re: Feature: Overheating Weapons[message #326035] Tue, 01 October 2013 11:43 Go to previous messageGo to next message
silversurfer

 
Messages:2793
Registered:May 2009
I thought about this change a little more and I believe that it would be best if I create another ini for such modifications. I think that I will call it "Item_Settings.ini". This file can hold all item property modifiers that are now in Ja2_Options.ini and those that might come in the future. This will help to keep a smaller Ja2_Options.ini and have all the item modifiers in a logical place.

There have already been requests for more modifiers (class specific modifiers for range, damage and so on) and these could be placed in the new ini as well. So if modders/players decide that they want their pistols to have +50% range in the future they could do so with the modification of one value in the ini instead of hundreds of values in weapons.xml and so on. Would be great for testing too.

Report message to a moderator

Lieutenant
Re: Feature: Overheating Weapons[message #326104] Wed, 02 October 2013 16:09 Go to previous messageGo to next message
silversurfer

 
Messages:2793
Registered:May 2009
I added modifiers for:






in exe 6463. The modifiers are stored in the new "Item_Settings.ini" which is part of GameDir 1800.
I left the defaults at 1.0 to not confuse players that have mods installed.

Report message to a moderator

Lieutenant
Re: Feature: Overheating Weapons[message #326201] Thu, 03 October 2013 18:41 Go to previous messageGo to next message
Faalagorn is currently offline Faalagorn

 
Messages:154
Registered:February 2012
Location: Poland
silversurfer
in exe 6463. The modifiers are stored in the new "Item_Settings.ini" which is part of GameDir 1800.
I left the defaults at 1.0 to not confuse players that have mods installed.

Seeing a new file, wouldn't at least some of the [Item Property Settings] fit in this new file? Though I'm still looking forward to some further INI cleanup. If I'll have some more time, I'll post some suggestions in this thread.

P.S. The files uses Linux new line format, so the new lines don't appear under Windows Notepad.

Report message to a moderator

Staff Sergeant
Re: Feature: Overheating Weapons[message #326225] Fri, 04 October 2013 17:15 Go to previous messageGo to next message
silversurfer

 
Messages:2793
Registered:May 2009
Faalagorn

Seeing a new file, wouldn't at least some of the [Item Property Settings] fit in this new file?

Oh yes, most certainly. I didn't have the time to browse through Ja2_Options.ini though to write down all those item modifiers.
Some of the existing modifiers should also be expanded to cover certain classes. For example I plan to add range modifiers to the gun classes (maybe all weapons, haven't decided yet) in addition to the general "GUN_RANGE_MODIFIER".

I may also move the general weapon temperature modifier to the new file but I would like some additional opinions on moving general modifiers. Some people may say that parameters like "OVERHEATING_TEMPERATURE_GLOBAL_MODIFIER" belong to Ja2_Options.ini because there is a block for the Weapon Overheating feature. Some may say that this is an item property modifier and should be put in the new file.


Faalagorn

P.S. The files uses Linux new line format, so the new lines don't appear under Windows Notepad.

The lines end with LF and not CR LF. Windows Notepad has problems with that as it seems. Windows Notepad has problems with lots of other things too so I wouldn't use it anyway. Wink
I'm using Notepad++ which is a much better editor.

Report message to a moderator

Lieutenant
Re: Feature: Overheating Weapons[message #327164] Fri, 25 October 2013 22:52 Go to previous messageGo to next message
Flugente

 
Messages:3509
Registered:April 2009
Location: Germany
As of r6531 and GameDir r1843
  • OVERHEATING_DISPLAY_JAMPERCENTAGE controls wether the temperature bar shows temperature/jam threshold(true) or temperature/damage threshold (false). MMight be useful for those testing new overheating values and want to see effects on thresholds ingame.
  • OVERHEATING_TEMPERATURE_GLOBAL_MODIFIER is obsolete and this removed, as the same effect can be achieved by OVERHEATING_TEMPERATURE_PISTOL_gunclass in Item_Settings.ini, which silversurfer so kindly coded.

Report message to a moderator

Captain

Re: Feature: Overheating Weapons[message #359926 is a reply to message #327164] Tue, 05 May 2020 07:17 Go to previous messageGo to next message
Deleted.

 
Messages:2663
Registered:December 2012
Location: Russian Federation
Interface Utils.cpp, DrawItemUIBarEx()

// Flugente
if ( ubStatus == DRAW_ITEM_TEMPERATURE )
{
	// the food item bar always has full size
	if ( UsingFoodSystem() && Item[pObject->usItem].foodtype > 0 )
	{
		sValue = 100;
	}
	else
	{
		sValue = (INT16) (100 * GetGunOverheatJamPercentage( pObject) );

		// if temperature is 0 or below, do not display anything
		if ( sValue < 1)
			return;

		// cut off temperature at 100%, otherwise the bar will be out of its box
		sValue = min(sValue, 100);
	}
}
Item temperature bar doesn't use OVERHEATING_DISPLAY_JAMPERCENTAGE option, shouldn't it instead be
sValue = (INT16) (100 * GetGunOverheatDisplayPercentage( pObject) );
Currently, the game will always display jam level.



Left this community.

Report message to a moderator

Lieutenant

Re: Feature: Overheating Weapons[message #359929 is a reply to message #359926] Tue, 05 May 2020 11:43 Go to previous message
silversurfer

 
Messages:2793
Registered:May 2009
Yes, I think GetGunOverheatDisplayPercentage() was created for the purpose of displaying overheat percentage and take OVERHEATING_DISPLAY_JAMPERCENTAGE into account.


Wildfire Maps Mod 6.07 on SVN: https://ja2svn.mooo.com/source/ja2/branches/Wanne/JA2%201.13%20Wildfire%206.06%20-%20Maps%20MOD

Report message to a moderator

Lieutenant
Previous Topic: New feature: Constructable static fortifications (sandbags etc.)
Next Topic: New feature: Improved trade menu
Goto Forum:
  


Current Time: Sun May 05 16:22:15 GMT+3 2024

Total time taken to generate the page: 0.01883 seconds