https://forums.civfanatics.com/threads/barbarians-spawn-logic.630389/page-2axx 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; }
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.