Raging Barbarians Mod? - Idea

xdtrololo

Chieftain
Joined
Aug 20, 2021
Messages
2
axx was pretty correct about sea spawning! Let's see.

Some pseudocode below.
Code:
var_A = (5-difficulty)*30;
var_B = game_turn;
var_C = game_turn/150+1;
IF var_C < 1 THEN var_C = 1;
IF var_C > 3 THEN var_C = 3;

IF var_A <= var_B
AND
IF game_turn is multiple of 8 AND no civ knows AUTOMOBILE tech
THEN
set random X from 0 to 79 and set random Y from 3 to 46 (so barb ships never spawn on 3 northest and 3 southest lines...)
WHILE (X,Y) has no units //including barbarians
or (X,Y) is not an ocean square
or size of ocean in (X,Y) is strictly less than 10;

IF var_C < 3
 unit = SAIL;
ELSE
 unit = FRIGATE;
spawn UNIT;
counter = 0;
WHILE counter <= var_C
{
 IF no civ knows EXPLOSIVES
  unit2 = LEGION;
 ELSE
  unit2 = KNIGHTS;
 if var_C == counter
  unit2 = DIPLOMAT;
 spawn UNIT2;
 set SENTRY flag of unit2 to 1;
counter = counter+1;
}
https://forums.civfanatics.com/threads/barbarians-spawn-logic.630389/page-2
I have a question. Would it be possible to swap 'is game_turn multiple of 8' check with for example '1 ==1?' to get 8 times more barbs and make game harder? ?Naval barbarians have never been the serious threat, so maybe it could be good idea to change it? I wanted to do it on my own, but i cant unpack civ.exe... and i dont know where these bits are. Any help? Sorry for my english.
 
For sea barbarians, there's &7 expression here. We can change it to &3 (every 4th turn) or &1 (every second turn):
at least in .05 en version you should
find (it's starting at 0x2d09 in .exe)
a0 d2 81 fe c0 a8 07 74 03 e9 fd 00
which means
Spoiler :

Code:
MOV   AL, [GAME_TURN]
INC   AL
TEST  AL, 0x7
JZ    LAB_SSALB_check_somebody_knows_automobile
JMP   LAB_SSALB_call_random_city

and change bolded here "07" to "01" for barbarians to spawn every second turn.

And for every turn spawn, I guess simplest solution is to NOP everything:
find
a0 d2 81 fe c0 a8 07 74 03 e9 fd 00
and replace with
90 90 90 90 90 90 90 90 90 90 90 90

Achtung: I think that such pressing barbarians can almost demolish AI civs... Barbarians always goto to most closest+most richest city, and if your civ is poor, you will not got them in most cases anyway.

Also I think it's a interesting idea to change demanded tech for Knights and for end of pirates spawning:

26 f6 06 24 05 07 if somebody discovered Automobile, stop sea barbs spawning. It's big-endian, so it means 0x0524. 2 bytes per tech. Let's change it, for example, to Future Tech (0x05ce):
26 f6 06 ce 05 07

And Explosives tech (0x0520) changes Legion to Knights:
26 f6 06 20 05 07
Let's change it, for example, to Chivalry (0x052c):
26 f6 06 2c 05 07
You will find this sequence in .exe twice, because there's also condition for barbarian cities to change production from legions to knights.

I also made some small fixes in my old post.
 
Last edited:
Honestly, it doesn't make much difference against AI. Barbarians did not capture even a single city. And they do land pretty often near London when I switched to Republic and started making some money, but with one city it does not matter anyway.
 

Attachments

  • !every_turn_barbs_test.png
    !every_turn_barbs_test.png
    65.5 KB · Views: 66
Top Bottom