Home » MODDING HQ 1.13 » v1.13 Bug Reports » DifficultySettings.xml values (DifficultySettings.xml values)
DifficultySettings.xml values[message #343603] Sun, 03 January 2016 21:51 Go to next message
OviK is currently offline OviK
Messages:1
Registered:January 2016
GameDir rev no 2275.
Data-1.13/TableData/DifficultySettings.xml

AllowReinforcements and AllowReinforcementsOmerta are set to 1 for novice and insane, but to 0 for Experienced and expert. This looks fishy.

Report message to a moderator

Civilian
Re: DifficultySettings.xml values[message #343610 is a reply to message #343603] Mon, 04 January 2016 10:31 Go to previous messageGo to next message
wanne (aka RoWa21) is currently offline wanne (aka RoWa21)

 
Messages:1961
Registered:October 2005
Location: Austria
Thanks for reporting. Fixed in SVN GameDir (Rev. 2276)

Report message to a moderator

Sergeant Major

Re: DifficultySettings.xml values[message #343611 is a reply to message #343603] Mon, 04 January 2016 10:34 Go to previous messageGo to next message
silversurfer

 
Messages:2793
Registered:May 2009
*grrr* This DifficultySettings.xml is causing nothing but trouble ever since it has been implemented and the creator doesn't provide any support for it. angry

In addition to your findings (thanks for them) I already found several code errors related to this XML and I didn't even search for any. This needs some time for fixing...



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
Re: DifficultySettings.xml values[message #343651 is a reply to message #343611] Wed, 06 January 2016 19:07 Go to previous messageGo to next message
wanne (aka RoWa21) is currently offline wanne (aka RoWa21)

 
Messages:1961
Registered:October 2005
Location: Austria
silversurfer wrote on Mon, 04 January 2016 08:34
*grrr* This DifficultySettings.xml is causing nothing but trouble ever since it has been implemented and the creator doesn't provide any support for it. angry

In addition to your findings (thanks for them) I already found several code errors related to this XML and I didn't even search for any. This needs some time for fixing...


I didn't know of any errors until now. Good that you are working on fixing it!

Report message to a moderator

Sergeant Major

Re: DifficultySettings.xml values[message #343704 is a reply to message #343651] Sat, 09 January 2016 18:21 Go to previous messageGo to next message
silversurfer

 
Messages:2793
Registered:May 2009
I fixed some values for reinforcements and additional defenses around Meduna in DifficultySettings.xml and updated the code to use them correctly (r8013 + GameDir 2277).



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
Re: DifficultySettings.xml values[message #344466 is a reply to message #343704] Thu, 10 March 2016 10:37 Go to previous messageGo to next message
3iff is currently offline 3iff

 
Messages:65
Registered:July 2001
Location: Birmingham, UK
I tried adding another difficulty level, "Custom", but the game complains badly (and crashes) when I select that level and start the game. I didn't note the error (I know...) but just gave up for now. I think the complaint was about setting underground levels? I'm sure the xml cut/paste is 100% correct with <> and </> matching.

Is it possible to add a new difficulty level?

Report message to a moderator

Corporal
Re: DifficultySettings.xml values[message #344467 is a reply to message #344466] Thu, 10 March 2016 10:38 Go to previous messageGo to next message
DepressivesBrot is currently offline DepressivesBrot

 
Messages:3658
Registered:July 2009
I'll just say 'better not' and leave it up to Flug to post his standard rant as to the why of it.


Chat with us!
#bearpit on IRC
Discord
Get your latest 1.13 Builds
(Pls don't use my forum PMs for general game queries)

Report message to a moderator

Captain

Re: DifficultySettings.xml values[message #344468 is a reply to message #344467] Thu, 10 March 2016 11:58 Go to previous messageGo to next message
3iff is currently offline 3iff

 
Messages:65
Registered:July 2001
Location: Birmingham, UK
Not a problem. The file docs implied it might be possible but I'm happy to modify an existing level with the settings I want.

Report message to a moderator

Corporal
Re: DifficultySettings.xml values[message #344469 is a reply to message #344468] Thu, 10 March 2016 12:42 Go to previous messageGo to next message
silversurfer

 
Messages:2793
Registered:May 2009
Indeed, the file still says "uiIndex 0-15". Don't create new difficulty levels! It just doesn't work because there are too many points in the code that still work with the old 4 levels. Also you should know that there is still hard coded stuff in the code so better adjust the level that you would usually want to play on. Now, with so many values externalized to DifficultySettings.xml it is quite useful but the original creator didn't think it through to the end and also doesn't support his modifications. That's why we have these inconsistencies.

I'll fix the description.



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
Re: DifficultySettings.xml values[message #344470 is a reply to message #344469] Thu, 10 March 2016 13:13 Go to previous messageGo to next message
3iff is currently offline 3iff

 
Messages:65
Registered:July 2001
Location: Birmingham, UK
silversurfer wrote on Thu, 10 March 2016 10:42
Indeed, the file still says "uiIndex 0-15". Don't create new difficulty levels! It just doesn't work because there are too many points in the code that still work with the old 4 levels.


That's exactly what I thought when it didn't work. Reverting back to the original file fixed things and no harm done.

Report message to a moderator

Corporal
Re: DifficultySettings.xml values[message #344479 is a reply to message #344470] Thu, 10 March 2016 23:40 Go to previous messageGo to next message
wanne (aka RoWa21) is currently offline wanne (aka RoWa21)

 
Messages:1961
Registered:October 2005
Location: Austria
I will inform Jazz (who did the difficulties externalization) that he should take a look at the problems and the hardcoded diff values.

EDIT: Jazz is informed and hopefully he can finish/fix the difficulties externalization...

[Updated on: Mon, 14 March 2016 09:26]

Report message to a moderator

Sergeant Major

Re: DifficultySettings.xml values[message #344569 is a reply to message #344479] Wed, 16 March 2016 22:36 Go to previous messageGo to next message
wanne (aka RoWa21) is currently offline wanne (aka RoWa21)

 
Messages:1961
Registered:October 2005
Location: Austria
I talked to Jazz. When adding a new Difficulty in DifficultySettings.xml you also need to update the 3 lua scripts (GameInit.lua, initmines.lua, initunderground.lua).
I have uploaded 2 examples of using the new difficulties in our SVN Documents folder:
https://ja2svn.mooo.com/source/ja2/trunk/Documents/1.13%20Modding/Modding%20Examples/Additional%20Difficulty%20Settings% 20Example.zip
https://ja2svn.mooo.com/source/ja2/trunk/Documents/1.13%20Modding/Modding%20Examples/Additional%20Difficulty%20Settings% 20Example%202.zip

BTW, this folder also contains updated examples of the Briefing Room Feature. With the Briefing Room Feature, you can make different missions for JA2 1.13, so it is similar to Deadly Games (kill all enemies, escort civilist, find object, ...). Modders should definitly try it out.
https://ja2svn.mooo.com/source/ja2/trunk/Documents/1.13%20Modding/Modding%20Examples/Briefing%20Room%20Example%201.zip
https://ja2svn.mooo.com/source/ja2/trunk/Documents/1.13%20Modding/Modding%20Examples/Briefing%20Room%20Example%202.zip

Report message to a moderator

Sergeant Major

Re: DifficultySettings.xml values[message #344570 is a reply to message #344569] Wed, 16 March 2016 23:10 Go to previous messageGo to next message
Gambigobilla

 
Messages:693
Registered:July 2008
Why don't we just roll back this feature and call it a day and everyone be happy.

Report message to a moderator

First Sergeant
Re: DifficultySettings.xml values[message #344571 is a reply to message #344570] Wed, 16 March 2016 23:44 Go to previous messageGo to next message
wanne (aka RoWa21) is currently offline wanne (aka RoWa21)

 
Messages:1961
Registered:October 2005
Location: Austria
Gambigobilla wrote on Wed, 16 March 2016 21:10
Why don't we just roll back this feature and call it a day and everyone be happy.

Why should we rollback, please explain. I think it is working like before the externalization and modders have now have the possibility to add new difficulty settings.

Report message to a moderator

Sergeant Major

Re: DifficultySettings.xml values[message #344572 is a reply to message #344571] Thu, 17 March 2016 00:32 Go to previous messageGo to next message
tais

 
Messages:656
Registered:February 2008
Location: NL
So am I reading this correctly? you got some XML files but the hardcoded parts that silversurfer spoke about remain untouched?


Discord

Report message to a moderator

First Sergeant

Re: DifficultySettings.xml values[message #344573 is a reply to message #344572] Thu, 17 March 2016 01:04 Go to previous messageGo to next message
Gambigobilla

 
Messages:693
Registered:July 2008
Because before this feature implemented by Jazz, we could happily change settings from ini and be done with it. Difficulty parameters were already externalized. There was literally no reason to externalize it further just to add more difficulty settings. I'm sure nobody would care even there was just one difficulty setting. Everybody was content the way it was. Changing ini was much easier and noob friendly than changing xmls and luas. And I don't believe there was a demand for it. This feature just appeared out of nowhere, without warning, without testing, created much more problems while showing literally no functionality.

And I didn't want to shitpost but i don't trust Jazz to write a code that prints "Hello World".

Report message to a moderator

First Sergeant
Re: DifficultySettings.xml values[message #344574 is a reply to message #344572] Thu, 17 March 2016 01:18 Go to previous messageGo to next message
Flugente

 
Messages:3509
Registered:April 2009
Location: Germany
While it might not always seem so,this post is not intended to offend, but merely to point out any issues I have, in my usually friendly enthusiastic manner.

Nobody who starts the game for the first time is going to wade through the folders and look for a documentation that explains what scripts to alter in order to set up a xml that sets up difficulty levels that set up the game.

While the idea of having a dedicated file for difficulty settings is a good one (since one can easily spend a day wading through tons of configurations and options), the current state of DifficultySettings is seriously lacking. I'd even call it damaging.

A core issue - that I remember to have pointed out repeatedly - is that not everything that is tied up to the different difficulty levels is represented in the xmls. This was always the case, but in the old days, when there were just 4 difficulty levels, this wasn't as bad. If someone wanted to play as novice, he'd likely play 'Novice' and adjust his settings. Same for 'Insane'. He/she might not be aware of all the times difficulty level affected sth., but as the hardcoded values roughly represented what they chose anyway.

The 'feature' of creating a new difficulty level indicates that one can set up a new level, but that is not entirely true. Take this code part for example - this is the part where we evaluate how many troops are set up during the Drassen counter attack:
UINT8 val;
if( gGameOptions.ubDifficultyLevel == DIF_LEVEL_EASY )
        val = 1;
else if( gGameOptions.ubDifficultyLevel == DIF_LEVEL_MEDIUM )
	val = 2;
else if( gGameOptions.ubDifficultyLevel == DIF_LEVEL_HARD )
	val = 3;
else if( gGameOptions.ubDifficultyLevel == DIF_LEVEL_INSANE )
	val = 4;
else
{
	val = Random (4);			
	if (val == 0) val = 1;
}	
			
ubNumSoldiers = (UINT8)( gubMinEnemyGroupSize + val * 3);	

This variable (ubNumSoldiers ) is then used as the base value to set up the size of the 4 groups that set up the DCA. For simplicity reasons, lets just assume that these are the troops sent. You see what happens here? If a player sets up a new difficulty level, we evaluate the else{...} part. This means that val is random. As in, random, chance-based, you-have-no-idea-what-you-get. So if a new player copies over novice settings (where gubMinEnemyGroupSize = 3), ubNumSoldiers can be 6, 9 or 12. It thus follows that the size of the DCA can vary by a 100%. That is bullshit. Pure bullshit. Especially as this total variance is lower on high difficulty levels, where gubMinEnemyGroupSize is higher. Sucks to be a new player here.

Other times, we have just this:
UINT8 DiffLevel;
if( gGameOptions.ubDifficultyLevel == DIF_LEVEL_EASY )
	DiffLevel = 1;
else if( gGameOptions.ubDifficultyLevel == DIF_LEVEL_MEDIUM )
	DiffLevel = 2;
else if( gGameOptions.ubDifficultyLevel == DIF_LEVEL_HARD )
	DiffLevel = 3;
else if( gGameOptions.ubDifficultyLevel == DIF_LEVEL_INSANE )
	DiffLevel = 4;	
else
	DiffLevel = 1;

This isn't exactly better. For new difficulty levels, some value is simply set - here its the value for Novice. The player can't affect this, and won't even know bout this. Thus this feature only sets up half the settings, the rest is just set to whatever the coder felt was okay at implementation time.

Other things are inexplicable:
// AI Modifiers
if ( !(pSoldier->flags.uiStatusFlags & SOLDIER_PC ) )	// if this is a computer AI controlled enemy
{
	if ( gGameOptions.ubDifficultyLevel == DIF_LEVEL_EASY )
	{
		// On easy, penalize all enemies by 5%
		iChance -= 5;
	}
	else
	{
		iChance += __min( 0, gbDiff[ DIFF_ENEMY_TO_HIT_MOD ][ SoldierDifficultyLevel( pSoldier ) ] );
	}
}

A difficulty 'Novice', the xml setting simply gets ignored for no reason.

Another issue can be found in the JA2 UB sepcific code:
void InitNumberOfEnemiesInAboveGroundSectors( )
{
	UINT8	ubNumAdmins=0;
	UINT8	ubNumTroops=0;
	UINT8	ubNumElites=0;
	UINT8	ubNumTanks=0;
        
        ...

        //SEC_H8:
        {
		switch( gGameOptions.ubDifficultyLevel )
		{
			case DIF_LEVEL_EASY:
				ubNumAdmins = 0 + Random( 0 );
				ubNumTroops = 6 + Random( 4 );
				ubNumElites = 0 + Random( 0 );
				break;
			case DIF_LEVEL_MEDIUM:
				ubNumAdmins = 0 + Random( 0 );
				ubNumTroops = 13 + Random( 3 );
				ubNumElites = 0 + Random( 0 );
				break;
			case DIF_LEVEL_HARD:
				ubNumAdmins = 0 + Random( 0 );
				ubNumTroops = 16 + Random( 6 );
				ubNumElites = 2 + Random( 2 );
				break;
			case DIF_LEVEL_INSANE:
				ubNumAdmins = 0 + Random( 0 );
				ubNumTroops = 19 + Random( 9 );
				ubNumElites = 2 + Random( 2 );
				break;
		}

		SetNumberJa25EnemiesInSurfaceSector( SEC_H8, ubNumAdmins, ubNumTroops, ubNumElites, ubNumTanks );
	}

I'm not testing UB, so perhaps this function is no longer in use anyway, but to me it seems that with a new difficulty setting, you won't find a lot of enemies in there...

If you implement the feature to add more difficulty levels, either do it full or not at all. Do not do it halfway.

Also, if you implement a feature, test it, for FUCK sake. A huge point of this feature seems to be the ability to set up new difficulty levels. If you then try that out, the game crashes, because the above-mentioned scripts won't work and need to be adapted. Granted, sometimes stuff I add doesn't work, because I forgot to add files, or missed something. Everybody does, errors, I do a lot. But I'm at least (reasonably happy ) ashamed by any errors on my side and try to fix them ASAP. This stuff has been broken for months, and these issues have been pointed out several times.

And yes, I am fully aware of these issues (seeing I just pointed them out). Yes, I could fix them. No, I am not going to fix them. If someone has a bug and needs help or advice, I am gladly helping to solve the issue. It is not my job to clean up the mess someone else came up with without doing anything to fix it.



I know now that it could never work between us, as much as we wanted to, it could never be! Not because you're a rabbit, but because you're black.

If you want, you can donate to me. This will not affect how and what I code, and I will not code specific features in return. I will be thankful though.

Report message to a moderator

Captain

Re: DifficultySettings.xml values[message #344578 is a reply to message #344574] Thu, 17 March 2016 10:34 Go to previous messageGo to next message
silversurfer

 
Messages:2793
Registered:May 2009
Precisely the reason why I added this at the top of DifficultySettings.xml:
DO NOT CREATE NEW ENTRIES! INSTEAD MODIFY THE DIFFICULTY LEVEL YOU WANT TO PLAY ON!
There is still hardcoded stuff that will make use of the old 4 difficulty levels.

uiIndex : 0 - 4


Since nobody is going to fix the code issues we simply restrict the difficulty levels to the four default ones. Period.



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
Re: DifficultySettings.xml values[message #344588 is a reply to message #344578] Thu, 17 March 2016 19:23 Go to previous message
tais

 
Messages:656
Registered:February 2008
Location: NL
When new features are created there are simply two routes..
- they are directly put in the development trunk by a coder who is known to deliver good or at least sort of stable code and received SVN access because of that (Flugente, silversurfer, Bob, Rowa and the rest)
- they are pitched in a forum thread by the coder so the players can be used as guinea pigs, when deemed tested, sort of stable, complete and a good feature the code is put into SVN after review by someone with SVN access

Stop putting incomplete clunky features/externalizations/whatever into SVN through the backdoor without proper testing, it damages the 1.13 mod as a whole

[Updated on: Thu, 17 March 2016 19:24]




Discord

Report message to a moderator

First Sergeant

Previous Topic: Resolution changed and "misaligned" map objects
Next Topic: Tileset editing problem
Goto Forum:
  


Current Time: Sat Apr 20 00:20:22 GMT+3 2024

Total time taken to generate the page: 0.01378 seconds