November 26 2024 11:47:16
Navigation
· Home
· Articles
· Downloads
· FAQ
· Discussion Forum
· Web Links
· News Categories
· Contact Me
· Photo Gallery
· Search
· Gameservers
Languages
Users Online
· Guests Online: 12

· Members Online: 0

· Total Members: 1,134
· Newest Member: Brody
Teamspeak 3
Last Seen Users
· hackepter02:29:23
· GONZO19:23:54
· Intruder19:50:37
· Sully 1 day
· desintegrator 2 days
· WEZ 3 days
· Homi 3 days
· The ACE 4 days
· xhc 1 week
· dRgiGGLeZ 1 week
· El Dookie 1 week
· Melber 2 weeks
· SGT PEPPER 2 weeks
· martyr 2 weeks
· Terminator 2 weeks

View Thread: AI accuracy in vietnam mode
Vietcong.Info » Vietcong General Discussion » General Discussion
Who is here? 1 Guest
Current Rating: (Total: 1 rating)  
 Print Thread
AI accuracy in vietnam mode
andy_kosela
How it's possible to lower shooting accuracy of AI in Vietnam mode? Right now it seems they are too accurate and precise... Is it doable by some script or by changing weap.txt?
 
www.andykosela.com
Silent Bob
all parameters are declared in the vcbasic.inc file.

change parameters as you wish (refer to the vietcong sdk for description).

Vietnam mode is case 3
  x 1
 
www.vietcong.info
KostiCZ
You can change it in AI script, separate foe each AI. It is mostly included in .inc file. Try to search for...

Download source  Code

//settings of difficulties
#ifndef D0_SHOOT_PREC
#define   D0_SHOOT_PREC   1.5f
#endif

#ifndef D1_SHOOT_PREC
#define   D1_SHOOT_PREC   1.0f
#endif

#ifndef D2_SHOOT_PREC
#define   D2_SHOOT_PREC   0.6f
#endif

#ifndef D3_SHOOT_PREC
#define   D3_SHOOT_PREC   0.3f
#endif


.....


         //set by difficulty
         switch( SC_ggi(SGI_DIFFICULTY) )
         {
         case 0:
            props.shoot_imprecision      = D0_SHOOT_PREC;      //overload previous (default) setting
            props.shoot_damage_mult      = 0.5f;
            props.grenade_throw_imprecision = 1.5f + frnd(0.5f);
            break;

         case 1:
            props.shoot_imprecision      = D1_SHOOT_PREC;
            props.shoot_damage_mult      = 1.0f;
            props.grenade_throw_imprecision = 1.0f + frnd(0.5f);
            break;

         case 2:
            props.shoot_imprecision      = D2_SHOOT_PREC;
            props.shoot_damage_mult      = 1.1f;
            props.grenade_throw_imprecision = 0.5f + frnd(0.5f);
            break;

         case 3:
            props.shoot_imprecision      = D3_SHOOT_PREC;
            props.shoot_damage_mult      = 1.2f;
            props.grenade_throw_imprecision = 0.3f + frnd(0.3f);
            break;
         }




Signature________________________________________________

2LT William Theolinus "KostiCZ" Boner Jr.
LRRP Squad Baker, Delta Team
cache.www.gametracker.com/player/KostiCZ/63.143.47.189:2302/b_560x95.png
  x 1
 
Teamrespawn.cz
andy_kosela
OK, I can locate vcbasic.inc in SDK and can change D3_SHOOT_PREC macro. Now what are the next steps to actually make it change behavior of all AI in single player and multiplayer? In other words where I need to put this file in the .cbf directory structure so the game engine will pick it up and use it instead of the default?
Edited by andy_kosela on 29-01-2014 19:16
 
www.andykosela.com
KostiCZ
This file should be compiled and added to map in editor. If you want to create new map with modified parameters, it is not problem. If you want to modify existing map or single player campaign, don't do it. For single player - choose another difficulty, for multiplayer - map will be modified and you will not be able to play with others (or you will be kicked by server).
Signature________________________________________________

2LT William Theolinus "KostiCZ" Boner Jr.
LRRP Squad Baker, Delta Team
cache.www.gametracker.com/player/KostiCZ/63.143.47.189:2302/b_560x95.png
  x 1
 
Teamrespawn.cz
andy_kosela
For right now I'm mostly concerned with single player. So there is no way to alter AI accuracy on the global level for single player while still using "vietnam" mode?
Edited by andy_kosela on 30-01-2014 03:36
 
www.andykosela.com
Silent Bob
I dont see a sense for doing that....
  x 1
 
www.vietcong.info
KostiCZ
If vietnam mode is too hard for you, just try something easier ;-) medium dificulty Smile

If you want to change behavior/accuracy for singleplayer, you have to change it in all VC scripts (hundreds of them) and then compile them again. Problem is that you have only compiled versions in CBF files, not sourcecodes. So - it is not possible easily. You can debug it and try to modify scr filed in hexa editor but I think only Brchi can do that. And from my POV - it is wasting of time when you can chose lower difficulty.
Signature________________________________________________

2LT William Theolinus "KostiCZ" Boner Jr.
LRRP Squad Baker, Delta Team
cache.www.gametracker.com/player/KostiCZ/63.143.47.189:2302/b_560x95.png
 
Teamrespawn.cz
andy_kosela
It's not that it's too hard, it's just that in my opinion AI accuracy in Vietnam mode is completely unrealistic. They act more like sniper cyborgs than historical NVA/Vietcong.

My question is what other things besides number of allowed saves and AI accuracy, difficulty level changes? Does it also alter the number of opponents in single player campaign? Does it also alter other behavior of AI, e.g. are they more aggresive in Vietnam mode than Normal mode?
 
www.andykosela.com
KostiCZ
From code below you can see:

props.shoot_imprecision = D0_SHOOT_PREC;
props.shoot_damage_mult = 0.5f;
props.grenade_throw_imprecision = 1.5f + frnd(0.5f);

Shoot imprecision, damage multiplier and grenade throw imprecision are affected by dificulty.
Signature________________________________________________

2LT William Theolinus "KostiCZ" Boner Jr.
LRRP Squad Baker, Delta Team
cache.www.gametracker.com/player/KostiCZ/63.143.47.189:2302/b_560x95.png
 
Teamrespawn.cz
Silent Bob
Thats for the multiplayer. But i guess there are some changes when it comes to the campaign mode.....imo more changes were made.

Look at the structure of the AI properties which can be found in the sc_global.h (SDK)

You can also use the properties in MP-Maps to create even smarter enemies ;)

Download source  Code
typedef struct{

   float max_vis_distance;            // how far can see
   float watchfulness_zerodist;      // how he can recognize enemies at near distance
   float watchfulness_maxdistance;      // how he can recognize enemies at maximum distance
   float boldness;                  // odvaha - 0.5- very low, 1 - low, 2-medium, 4-high,10-suicide - ma vliv na vykukovani z krytu kdyz okolo litaj kulky
   float coveramount;               // normal 0.2 - jak daleko se maximalne bezi schovat vuci vzdalenost nejblizsiho EN
   float shoot_imprecision;         // 0 - absolutely exact aim, 1 - very bad aiming, default is 0.2
   
   BOOL extend_searchway;            // FALSE - do not use (recommended for enemies)
                              // TRUE - use extended searchway (recommended for player's group)
   float shortdistance_fight;         // 0 - do not use
                              // 1 - use as much as possible
                              // - computing very expensive, use 0.2 (in average) for enemies, 1 for player's group
   float view_angle;               // 2.5f is default, for allies is recommended 4.7 (1.5*PI)
   float view_angle_near;            // 3.5f is default, for allies is recommended 6 (nearly 2*PI)

   float hear_imprecision;            // 0 - absolute hearing, 1 - average hering, 5 - bad hearing
   float hear_distance_mult;         // 0.5 - half, 1 - normal, 2 - two-times better
   float hear_distance_max;         // default is 1000.0f

   float grenade_min_distance;         // minimal distance to throw grenade at (default: 10.0f)
   float grenade_timing_imprecision;   // random max + in sec                  (default: 0.5f)
   float grenade_throw_imprecision;   // 0 - totally exact, 1 - normal      (default: 1.0f)
   float grenade_sure_time;         // how long player makes sure about valid situation to throw grenade (default: 5.0f sec)

   float forget_enemy_mult;         // how fast ai forgots enemies , 1.0f default, 2.0f - 2times faster, 0.5f - 2times slower
   float shoot_damage_mult;         // multiple of the damage player causes

   BOOL disable_peace_crouch;         // when TRUE, player never crouches in peace mode (except crouching bellow obstacles when moving)

   float peace_fakeenemy_run;         // 0 - walk, 1 - run, 0.3 70%walk, 30%run, default 1.0f
   float peace_fakeenemy_phase;      // 0 - stand, 1 - crouch, default 0.5f

   float shoot_while_hidding;         // 0-1   (0-never, 1-ever), default is 0.3f

   float reaction_time;            // used when spotting first enemy, default is 0.0f for side 0, and 1.0f for the rest
   float scout;                  // if AI going to check spotted first enemies (0-never, 1 - ever), default is 0.0f
   float berserk;                  // if AI is in Attack mode - if attack withouot hidding himself (0-never, 1- ever), default is 0.0f

   float aimtime_max;               // maximalni cas pro zamireni, default 0.7f
   float aimtime_canshoot;            // hodnota 'casu', pod kterou jiz muze strilet, default 0.1f
   float aimtime_rotmult;            // nasobitel otoceni, default 0.5f

   float wounded_start_perc;         // hodnota hp/max_hp pri ktere se zacina uplatnovat zhorsovani mireni
   float wounded_aimtime_mult_max;      // hodnota nasobku zamirovaciho casu pri hp==0
   float wounded_shoot_imprec_plus;   // hodnota zvetseni shoot_imprecision pri hp==0

}s_SC_P_AI_props;


  x 1
 
www.vietcong.info
andy_kosela
Silent Bob, what then would be the easiest way to incorporate global script with s_SC_P_AI_props structure to change behavior of AI across all single player campaign?

I guess the easiest way would be to include it in some header file, but it seems I still would have to compile all the scripts, right?

Is there any simpler way to do this?

And if I would like to compile all the scripts again where I can find the source files for them?

PS> Little explanation of my motivation. In my spare time I'm working on the new military simulation mod for Vietcong that is basically aiming for VBS type realism. One of the main reasons I'm interested in Vietcong is that it has one of the best (if not the best) implementation of military AI ever created in the computing industry. It's really fun to play with bots in this game. Even VBS AI is much much worse.
Edited by andy_kosela on 31-01-2014 21:18
 
www.andykosela.com
Jump to Forum:
Similar Threads
Thread Forum Replies Last Post
Rising Storm 2 Vietnam General Discussion 3 29-12-2023 16:45
Military Conflict: Vietnam General Discussion 10 23-09-2021 22:57
coop mode crashes game Vietcong Tech Talk 4 22-02-2016 17:57
Spectator Mode General Discussion 1 17-01-2015 19:11
CTF Mode issues. Maps & Mapping 5 21-07-2014 17:02
Login
Username

Password



Not a member yet?
Click here to register.

Forgotten your password?
Request a new one here.
Render time: 0.27 seconds - 74 Queries 5,473,642 unique visits