Jump to content

xp_values in ghost_templates.xml


brms007

Recommended Posts

Been looking through the code some now and I can't figure out if these functions are really used anywhere. As I wrote before, I don't know much of the diesel language syntax so that doesn't really help... But I've found two functions with the same name, recalc_xp(), in the same file, which can't be good. And nowhere where any of those are called from any other functions... I'll keep looking some, but my gut feeling is that this part ain't used anywhere. The variables themselves may still be used somewhere though, even though I can't find that on searches it could be because of functions that uses concatenation to create each variable name before it uses them.

Link to comment
Share on other sites

  • Replies 54
  • Created
  • Last Reply

Top Posters In This Topic

  • 4 weeks later...
  • 2 weeks later...

In teammates file it is as follows:

<var name="is_teammate" value="true"/>

<var name="acc_min_time_to_acc_near" value="2"/>

<var name="acc_min_time_to_acc_far" value="4"/>

<var name="acc_chance_to_hit_near" value="0.3"/>

<var name="acc_chance_to_hit_far" value="0.1"/>

<var name="acc_max_distance_for_hit_with_all" value="1500"/>

It appears they've been slowed down and made more inaccurate than default settings, I changed them to following and they were quicker on the draw:

<var name="acc_min_time_to_acc_near" value="0.1"/>

<var name="acc_min_time_to_acc_far" value="0.2"/>

<var name="acc_chance_to_hit_near" value="0.9"/>

<var name="acc_chance_to_hit_far" value="0.8"/>

<var name="acc_max_distance_for_hit_with_all" value="1500"/>

Under teammates file it also states under base stats <var name="cant_detect" value="true"/>--ai seem to do better when set to true. You can also adjust cone for sight (default is 110 close/45 degrees medium/far) or distance they can see and hear in sb_templates file-global. If you want to check changes without ai being blown away, set detect to true, then, also in teammates file, put this:

<stats block="base_data">

<var name="invisible" value="true"/>

</stats> (I do this for each instance of base_data mentioned in file)

It makes your ai invisible to enemy, except tanks and helo's, and you can more accurately view what your tweaks have done in a positive or negative way, or set them to god mode so you don't have to keep replaying level.

Also in global file are default settings for enemy and friendly precision, lower it to 0.5 or less and they become super uber shots, raise it to say 5, and tank mg no longer nail you on first blast and shots spray more.

could you tell me where this "teammate file" is located? I dont recall finding any file in the sb_templates with the name "teammate" on it.

could you also tell which part in the global file are the enemy/friendly precision values located? I may have a pretty vague idea as to where they are but I'm not really good enough with this sort of thing to warrant any confidence in my guesses. :(

After i'm finished editing the files, am I suppose to copy the XMB and XML file to the local/english folder for it to take effect?

Edited by mark2000
Link to comment
Share on other sites

^

\data\units\beings\u_teammates.xml

\data\sb_templates\global\sb_global.xml (From line 468 <!--Difficulty parameters-->)

All you need to include in \Local\English is the .xml, leave the .xmb behind.

yeah...i'm kinda clueless about this part right here.

<var name="overall_enemy_precision" type="number" default="5.0"/>

<var name="overall_friendly_precision" type="number" default="0.5"/>

<var name="overall_enemy_tactical_difficulty" type="number" default="0.2"/>

<var name="overall_friendly_tactical_difficulty" type="number" default="0.2"/>

<var name="overall_tactical_difficulty" type="number" default="1"/> <!-- not used -->

<var name="difficulty_chance_to_hit_far_enemy" type="number" default="1.0"/>

<var name="difficulty_chance_to_hit_near_enemy" type="number" default="1.0"/>

<var name="difficulty_time_to_hit_far_enemy" type="number" default="1.0"/>

<var name="difficulty_time_to_hit_near_enemy" type="number" default="1.0"/>

<var name="difficulty_chance_to_hit_far_teammates" type="number" default="1.0"/>

<var name="difficulty_chance_to_hit_near_teammates" type="number" default="1.0"/>

<var name="difficulty_time_to_hit_far_teammates" type="number" default="1.0"/>

<var name="difficulty_time_to_hit_near_teammates" type="number" default="1.0"/>

<var name="difficulty_chance_to_hit_far_player" type="number" default="1.0"/>

<var name="difficulty_chance_to_hit_near_player" type="number" default="1.0"/>

<var name="difficulty_time_to_hit_far_player" type="number" default="1.0"/>

<var name="difficulty_time_to_hit_near_player" type="number" default="1.0"/>

<var name="difficulty_time_between_hits_player" type="number" default="2.0"/>

I'm really not sure which one of these sections are the ones that decrease the enemies' accuracy.

I'm pretty aware that they look self-explanatory but i've already tried mixing up values before between 0.1 and 5(i even tried 40) but in all cases, they still hit me dead on with almost every bullet even at the longest distances.

....or maybe that was because i also had the XMB files placed in the local/english folder..... <_<

Link to comment
Share on other sites

convenient XMB remover BATCH script...

@echo off

del *.xmb *.bak /q /s /f

if not "%LOCALAPPDATA%"=="" goto :clean_vista

ECHO CLEANED XMB

@pause

:clean_vista

cd /D %LOCALAPPDATA%\GRAW2

if not errorlevel 1 del *.xmb *.bak /q /s /f

ECHO CLEANED XMB

@pause

Just create a file called clean_xmb.bat in your GRAW2 folder and paste that into it. ;)

Link to comment
Share on other sites

ok thanks alot for the help, everyone.

Now back to the topic at hand, which one of those sections affect the accuracy of the AI?

BTW. I saw a term named "clean_vista" on that script and i was wondering if that had anything to do with the Vista OS by any chance since I'm using XP. Just curious. :)

Link to comment
Share on other sites

:clean_vista is just a function within the script. You can see on the third line that there is an if statement which checks if you're running XP or Vista. If it is Vista it moves on to the :clean_vista function and runs that part, otherwise it doesn't.

This is because Vista stores the XMB files in the "user"/AppsData/Local/GRAW2 folder, and not where the game is installed. ;)

Link to comment
Share on other sites

Found it. The variables that can be adjusted (by any modder) are:

- Auto detect range (in cm)

- Seeing radius (in cm and with 4 stages)

- Seeing cone angle (in degrees, 1 setting for stage 1 and 1 for stages 2-4)

- Hearing radius (in cm and with 4 stages)

All these are also available for separate settings for the Ghosts, which in the original game are set to be the exact same.

EDIT:

How do they work? Well... basically the 4 stages work like this (with some special cases and such which I 'm not really sure how to explain yet):

Everything is overridden if the AI already knows where the target is and their memory time has yet not expired (det_memory_see or det_memory_hear depending on situation). So then it's all a game of run and hide to try and get away again.

SEEING

- STAGE1: Detects target if seen inside set range and cone, no matter which mode they are using.

- STAGE2: Detects target if seen inside set range and cone, if in assault mode or if in recon mode and has a stance higher then prone.

- STAGE3: Detects target if seen inside set range and cone, if in assault mode and with a stance higher then prone or if in recon mode and with a stance higher then crouch.

- STAGE4: Detects target if seen inside set range and cone, if in assault mode and with a stance higher then crouch.

HEARING

- STAGE1: Detects target if noise made within range and noise is player moving in assault mode, in the open or behind cover, or player running in either mode, in the open or behind cover, or weapon fired.

- STAGE2: Detects target if noise made within range and noise is player moving in assault mode in the open, or if weapon fired in the open, or unsilenced weapon fired behind cover.

- STAGE3: Detects target if noise made within range and noise is unsilenced weapon fired in the open or behind cover.

- STAGE4: Detects target if noise made within range and noise is unsilenced weapon fired in the open.

So by looking at these, the correct stance and mode does affect the AI significantly. wink.gif

EDIT2:

Then there is also the det_shot_timer that says how long the sound stays and is in the risk of getting into the detection range for a moving enemy, and explosion_alert_range for at how long range the AI will detect detonations.

Post 25

:thumbsup:

Link to comment
Share on other sites

I was actually talking about the part of sb_global.xml that i quoted a while ago. I wanted to now which one of those lines affect the accuracy of the enemy AI. Thanks for the reminder though. I'll keep that in mind. Could be of some use in the future when I'm still not content of all this. :)

:clean_vista is just a function within the script. You can see on the third line that there is an if statement which checks if you're running XP or Vista. If it is Vista it moves on to the :clean_vista function and runs that part, otherwise it doesn't.

This is because Vista stores the XMB files in the "user"/AppsData/Local/GRAW2 folder, and not where the game is installed. wink.gif

Ah I see. Thanks. I used the program and it worked like a charm. Now I'm gonna start my tests again.

BTW. Since I'm trying to test different values in the game, does that mean that I'll have to use that batch file every time I make a new set of values for the game to read?

Edited by mark2000
Link to comment
Share on other sites

strange....

so i used the batch file and started the game with the new values. Whether i was seeing better results or just power of suggestion, God only knows, but that's not the problem here.

I stopped playing and thought of changing the overall enemy accuracy again since they were still a wee bit too accurate for my intellectually challenged teammates. I did as wolfsong said and used the batch file again before playing it but then it suddenly said that there were no XMB files that were existing in the GRAW2 directory anymore.

I just want to know if this is a good thing or a bad thing..?

....or is it a bug in the batch file or something....?

:unsure:

Link to comment
Share on other sites

OT:

Wolfsong, not trying to sidetrack, but why would certain edits in an .xml require a recompile but not others. Is it linked to something locked in the related .dxe? And if so why would it be handled differently (routing) depending on the OS?

When you and Mono were going over this earlier I ran searches (XP-Pro(last accessed/last modified/last created)) for .xmb activity or a temp dir creation, with the program loaded, and didn't come up with a result.

Link to comment
Share on other sites

NoQ, as long as your context xml has compile xml to false, you'll generate no xmb's ( at least in xp sp2).

Mark, in sb_global xml, I changed the default enemy precision to 4, makes a noticeable diff in mg acc on tanks/enemy. Once they get locked on you though, they kick it into another gear and go uber again. You might try changing values such as how long ai remember your last location (20 sec if seen, 10 if sec if heard). Been meaning to try those but haven't yet. Once they know where you're at they "follow" you behind buildings, rock obstructions etc. with their eyes. I like to make changes and go in game invisible to see results. I've actually aimed at enemy ai from over 100m and they ducked as soon as I locked on---they didn't know I was there--hadn't fired a round yet. Some code may beyond our reach in hard coded files.

To go invisible go to multiplayer and teammate xml's, look for player references, most have this for base stats-----

<stats block="base_data"/> You delete this and paste this:

<stats block="base_data">

<var name="invisible" value="true"/>

</stats>

Enemy ai won't see you but their tanks and helo's will. It's a nice way to look at what your changes do to ai without having to hide behind cover.

I can't figure those difficulty chance to hit numbers either.

As Tinker pointed out you can change distance seeing/hearing but that doesn't have an effect on uber accuracy. It does work well setting default ghost cone of view to 180 --makes them much more aware.

Link to comment
Share on other sites

Someone mentioned something about editing the damage points under the u_teammates.xml earlier in this thread. I did that by editing both the two identical parts of the script in that file that had min/max values of 24 in it and changed them to 240.

Not pretty sure if it worked or not since the first headshot from my M14 took only 1 bar from his health but the second one right after killed him instantly. <_<

Anyways. I'm just wondering what's the difference between the two identical min/max values on that u_teammates.xml file.

Edited by mark2000
Link to comment
Share on other sites

  • 3 weeks later...

I see. I seem to have them off so it only means that that isn't the problem here.

Now would someone care to tell me why the hell is it impossible to mod the accuracy of both my teammates and enemy infantry in both games?

Is there some sort of "min-to-max" value that those parameters affecting accuracy can only use?

I'm just curious because I just set the spread of my teammates to 100 and they can still snipe 3 guys from 5 blocks away in under 3 seconds by using only a pistol. Now I'm starting to think that even the accuracy edits I did with the enemy never really had any effect at all in the first place.

Link to comment
Share on other sites

Mark, I think Jonathan's approach of upping the precision values in each weapon file for ai would yield best results. Many parts of ai abilities are locked away in those dxe files and there is no way currently to dissassemble them. Nemon was working on a tool awhile back, but stopped, reason unknown. I would love to see inside aibeehivebrain, logics, aidetection etc, but no go. Wolfsong works the graphics side of game, he has to pick through code just like the rest of us, and if you've followed the progression of his mod, you've seen trial and error is how to proceed. Suggestion, each time you try a tweak, run game with just that tweak active in your english folder. As you find tweaks that please you, put them in a temp folder and slowly assemble your mod. And forget about xmb's, you have xp so if your context file in graw2 folder says compile=false at bottom, you're good to go. I think the other grin types have moved onto other projects, it's the modder in Wolf that keeps him coming back to help us out where he can. A short readme of what variables mean would have been nice, but I doubt we'll ever see one, unless someone from grin with code knowledge did it on their own time.

Link to comment
Share on other sites

could you please list down those weapon files you mentioned? I'm also starting to think that the default precision of each weapon are the ones that keep the AI from getting the biggest amount of spread no matter what value I put them in.

Kinda strange that AI accuracy also rely on weapon accuracy though since I've never seen any other game that use that kind of policy.

Link to comment
Share on other sites

@TRC

lol. I was actually trying to figure out what the hell you were talking about when you mentioned something about Jonathan and then I found this while using google.

Thanks for the info. I set the AI_precision to a value of 4, but IMO that resulted in some very poor shooting on the AI part. A 2.5 is still a little off . Going to try something between 1.5 and 2.5. But it is getting there.

I've been editing the AI vars in each of the weapons XML files (ex u_g36_compact.xml). But that's a lot of files to go thru in attempt to make the AI a little easier to battle. Is there better method than this?

regards

Jonathan

Well....I guess that proves that weapon stats DO affect AI performance. The vars in group_manager probably also do but I found them to be not quite effective since I've set the skill_shooting of every enemy, from mercs to SFs, to 10 and they still hit me like mad though I have to admit that the larger spread is quite noticeable when compared to the default.

There IS one problem about tweaking the weapon stats though: ...........it doesn't work on the ghosts...<_<

Seriously. I tried setting the scar H AI_precision value to 10 but my guys are still pot-shot champs with the damn gun.

I'm gonna continue my testing using the enemy AI this time because I find tweaking my Ghost team a waste of time since nothing ever works.

(just wanna remind everyone that I'm using GRAW1 so don't suddenly get confused as to why I'm praising the ghost AI accuracy so much. Main reason is because I couldn't get any of my tweaks to work for GRAW2 before though I think I know the problem now. I want to clear things up first with the tweakings before wasting my time installing that game again. It's the same engine anyway so what the hell. )

oh and TRC, please give thread links next time ok? :D

Edited by mark2000
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...