Yeah that sounds good. It'll definitely take some time to get it balanced. Currently the "you find some items" encounters are coming up too often, I gotta figure out why.
Other than that, code is working well. There's currently the option of basing just on Luck (like vanilla), or Luck + Game Difficulty, or Combat Difficulty + Game Difficulty, or Player Level.
I'll have to playtest with it just using player level, because that should be pretty interesting. From level 13 onward you'll have a lot more of the worst encounters (which means mutants even in areas not near the Vats). Basically it changes every 2 player levels until lvl13, from 13 onward you're at the hardest difficulty curve. (So lvl 1 and 2 you get +3 meaing lots of easy encounters, lvl 3 and 4 is +2, etc)
Two things that need doing, that I haven't done yet:
1) Balance the damn free item encounters, or at least make them much more rare. I understand what the designers were doing, but free items is just lame unless it's a rare occurence, or only at low player levels. This will take some time to get done properly.
2) Make it so you can't get the same encounter twice in a row. I've always hated that. This one is easy to implement.
Code is here, but the formatting and code itself got all messed up, even with code tags:[spoiler:57b236d946]
Code:
Encounter_Num := (random(0, 8) + random(0, 8) + random(0, 8));// 0 to 24, vanilla was 3 to 18
if global_var(0) or (global_var(326) == 0) then begin//if NOT set to ignore Luck in factoring EncNum
if (get_critter_stat(dude_obj, 6) <4> 7) then begin
if (get_critter_stat(dude_obj, 6) == 10) then begin
if (difficulty_level == 2) then begin
Encounter_Num := (Encounter_Num + 1);
end
else begin
if (difficulty_level == 1) then begin
Encounter_Num := (Encounter_Num + 2);
end
else begin
if (difficulty_level == 0) then begin
Encounter_Num := (Encounter_Num + 3);
end
end
end
end
else begin
if (get_critter_stat(dude_obj, 6) == 9) then begin
if (difficulty_level == 2) or (difficulty_level == 1) then begin
Encounter_Num := (Encounter_Num + 1);
end
else begin
if (difficulty_level == 0) then begin
Encounter_Num := (Encounter_Num + 2);
end
end
end
else begin
if (get_critter_stat(dude_obj, 6) == 8) then begin
if (difficulty_level == 1) or (difficulty_level == 0) then begin
Encounter_Num := (Encounter_Num + 1);
end
end
else begin
if (get_critter_stat(dude_obj, 6) == 3) then begin
if (difficulty_level == 2) or (difficulty_level == 1) then begin
Encounter_Num := (Encounter_Num - 1);
end
end
else begin
if (get_critter_stat(dude_obj, 6) == 2) then begin
if (difficulty_level == 1) or (difficulty_level == 0) then begin
Encounter_Num := (Encounter_Num - 1);
end
else begin
if (difficulty_level == 2) then begin
Encounter_Num := (Encounter_Num - 2);
end
end
end
else begin
if (get_critter_stat(dude_obj, 6) == 1) then begin
if (difficulty_level == 2) then begin
Encounter_Num := (Encounter_Num - 3);
end
else begin
if (difficulty_level == 1) then begin
Encounter_Num := (Encounter_Num - 2);
end
else begin
if (difficulty_level == 0) then begin
Encounter_Num := (Encounter_Num - 1);
end
end
end
end
end
end
end
end
end
end
end
else begin
if (global_var(327) == 1) then begin// modify EncNum purely on difficulty levels
if (difficulty_level == 2) then begin
Encounter_Num := (Encounter_Num - 1);
end
else begin
if (difficulty_level == 0) then begin
Encounter_Num := (Encounter_Num + 1);
end
end
if (combat_difficulty == 2) then begin
Encounter_Num := (Encounter_Num - 1);
end
else begin
if (combat_difficulty == 0) then begin
Encounter_Num := (Encounter_Num + 1);
end
end
end
else begin
if (global_var(328) == 1) then begin// modify EncNum by player level
if (get_pc_stat(1) < 7) then begin
if (get_pc_stat(1) < 3) then begin
Encounter_Num := (Encounter_Num + 3);
end
else begin
if (get_pc_stat(1) < 5) then begin
Encounter_Num := (Encounter_Num + 2);
end
else begin
if (get_pc_stat(1) <7> 8) then begin
if (get_pc_stat(1) < 11) then begin
Encounter_Num := (Encounter_Num - 1);
end
else begin
if (get_pc_stat(1) < 13) then begin
Encounter_Num := (Encounter_Num - 2);
end
else begin
Encounter_Num := (Encounter_Num - 3);
end
end
end
end
end
end
end
[/spoiler:57b236d946]
EDIT: It's funny what you learn when modding. For example, in all mountain encounters across all regions in vanilla game, there was only five encounter categories:
Patrick, rats, mole rats, radscorpions, rockfall. If we consider mole rats in the same ballpark as rats, and if you killed Patrick, that means all you could get is rockfall and scorpions and rats.