Author Topic: A few Special Encounter check questions.  (Read 3816 times)

A few Special Encounter check questions.
« on: November 11, 2015, 10:11:31 am »
Was looking for this info over the net and here on these forums but couldn't find anything in particular so here goes (this refers to the Reloaded source):
1) How often is an SE check performed?
2) Is the small dot we see on the WM when traveling an indication of an encounter check?
3) From what I can see in the worldmap.fos, all SE checks performed simultaneously - is this correct?
4) The code mentions:
Code: [Select]
    _CheckSpecialEncounter(LOCATION_SecretBunker, (zone.Terrain == TERRAIN_Desert && (uint(GetLvar(leader, LVAR_q_secret_vault)) <= ELAPSED_TIME) && (Random(1, 18000) == 1 && leader.Stat[ST_LEVEL] > Random(0, 23))), SetLvar(leader, LVAR_q_secret_vault, ELAPSED_TIME + REAL_HOUR(8)));
// 1 roll in 10h
From what I understand, this encounter can only occur once per 8 hours and somebody simply forgot to update the comment after changing it, correct?

Thanks!

Offline Wipe

  • Rotator
  • Random is god
Re: A few Special Encounter check questions.
« Reply #1 on: November 12, 2015, 05:20:08 pm »
How often is an SE check performed?
Depends how "encounter tick" is set; it's best to check globalmap_group.fos which performs "low level" stuff before worldmap.fos functions are actually called.

Is the small dot we see on the WM when traveling an indication of an encounter check?
Nah, it's time based and completly client-side; nothing to do with server data.

all SE checks performed simultaneously - is this correct?
CheckSpecialEncounter() is just wall of ifs hidden behind macro; once something is found, function returns location PID where player will be put.

this encounter can only occur once per 8 hours
You forgot about terrain/level requirements and 0.005% chance [every encounter tick] but other than that, you're correct :P
Games are meant to be created, not played...

Re: A few Special Encounter check questions.
« Reply #2 on: November 12, 2015, 08:17:16 pm »
Depends how "encounter tick" is set; it's best to check globalmap_group.fos which performs "low level" stuff before worldmap.fos functions are actually called.
Hm...went through the file but only saw some terrain mods. Which variable controls the miliseconds (I've uploaded the file here: http://pastebin.com/vHmwBPB6 )?

CheckSpecialEncounter() is just wall of ifs hidden behind macro; once something is found, function returns location PID where player will be put.
I'm not sure I fully understand....so is a roll done at some separate function/place? The random check has the same range for some encounters which leads me to believe that each SE check is done independently of the other ones?

Offline Wipe

  • Rotator
  • Random is god
Re: A few Special Encounter check questions.
« Reply #3 on: November 16, 2015, 06:06:42 pm »
Code: [Select]
if(++cr.GlobalMapMoveCounter % (__EncounterTime / __GlobalMapMoveTime) == 0)
I'm [almost] sure there is description of these vars somewhere in code, most likely config.fos

is a roll done at some separate function/place?
Naah, it's all in same function; it's just worth to remember what really is behind _CheckSpecialEncounter macro :]
Games are meant to be created, not played...

Re: A few Special Encounter check questions.
« Reply #4 on: November 16, 2015, 07:07:48 pm »
Code: [Select]
if(++cr.GlobalMapMoveCounter % (__EncounterTime / __GlobalMapMoveTime) == 0)
I'm [almost] sure there is description of these vars somewhere in code, most likely config.fos
I've found:
__GlobalMapMoveTime         = 250;
__EncounterTime             = 4000;
From what I understand, the encounter tick occurs every 250 miliseconds?

Naah, it's all in same function; it's just worth to remember what really is behind _CheckSpecialEncounter macro :]
AaaaAAaAA!!!11! It's like you're really trying to live up to your RNG motto IRL - the more you explain, the less i understand  :-X
So in the end, I still don't get it - are all Random(1, 18000{or whatever number the other ones got here}) rolls performed simultaneously? As in I actually have a Random(1, 18000) OR Random(1, 9000) OR Random(1, 12000) OR (etc) chance each encounter tick?