electronicarts / CnC_Remastered_Collection

Other
18.33k stars 4.74k forks source link

How do i find the AI difficulty? #104

Open Bast75 opened 4 years ago

Bast75 commented 4 years ago

How do i find the difficulty the AI is using? Like Easy, Medium or Hard. I want to give the easy AI other build limits vs the Medium or Hard AI. Someting like: easy AI=1 warfactory, medium AI=3 warfactories, hard AI=8 warfactories

I placed this in HOUSE.CPP:

bool DoDifficultyTest = true; if (DoDifficultyTest && !IsHuman) { int DifficultyTestLimit = 1; //does this work for each AI seperate? switch (<<<<what do i need to use here?>>>>) { case DIFF_EASY: DifficultyTestLimit = 1; break; case DIFF_NORMAL: DifficultyTestLimit = 4; break; case DIFF_HARD: DifficultyTestLimit = 10; break; } if (BQuantity[STRUCT_POWER] < DifficultyTestLimit ) { b = &BuildingTypeClass::As_Reference(STRUCT_POWER); if (Can_Build(b, ActLike)) { choiceptr = BuildChoice.Alloc(); *choiceptr = BuildChoiceClass(URGENCY_HIGH, b->Type); } } }

I tried: Difficulty Result: AI keeps building 4 in easy, medium & hard.

PlayerPtr->Difficulty Result: AI keeps building 4 in easy, medium & hard.

Anyone a tip for me?

Bast75 commented 3 years ago

Nobody?

Also tried cdiffculty Still no idea on how to dectect AI difficulty mode....