FOnline Development > Questions and Answers

A few Special Encounter check questions.

(1/1)

jokeUsa:
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: ---    _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
--- End code ---
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!

Wipe:

--- Quote from: jokeUsa on November 11, 2015, 10:11:31 am ---How often is an SE check performed?

--- End quote ---
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.


--- Quote from: jokeUsa on November 11, 2015, 10:11:31 am ---Is the small dot we see on the WM when traveling an indication of an encounter check?

--- End quote ---
Nah, it's time based and completly client-side; nothing to do with server data.


--- Quote from: jokeUsa on November 11, 2015, 10:11:31 am ---all SE checks performed simultaneously - is this correct?

--- End quote ---
CheckSpecialEncounter() is just wall of ifs hidden behind macro; once something is found, function returns location PID where player will be put.


--- Quote from: jokeUsa on November 11, 2015, 10:11:31 am ---this encounter can only occur once per 8 hours

--- End quote ---
You forgot about terrain/level requirements and 0.005% chance [every encounter tick] but other than that, you're correct :P

jokeUsa:

--- Quote from: Wipe on November 12, 2015, 05:20:08 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.

--- End quote ---
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 )?


--- Quote from: Wipe on November 12, 2015, 05:20:08 pm ---CheckSpecialEncounter() is just wall of ifs hidden behind macro; once something is found, function returns location PID where player will be put.

--- End quote ---
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?

Wipe:

--- Code: ---if(++cr.GlobalMapMoveCounter % (__EncounterTime / __GlobalMapMoveTime) == 0)

--- End code ---
I'm [almost] sure there is description of these vars somewhere in code, most likely config.fos


--- Quote from: jokeUsa on November 12, 2015, 08:17:16 pm ---is a roll done at some separate function/place?

--- End quote ---
Naah, it's all in same function; it's just worth to remember what really is behind _CheckSpecialEncounter macro :]

jokeUsa:

--- Quote from: Wipe on November 16, 2015, 06:06:42 pm ---
--- Code: ---if(++cr.GlobalMapMoveCounter % (__EncounterTime / __GlobalMapMoveTime) == 0)

--- End code ---
I'm [almost] sure there is description of these vars somewhere in code, most likely config.fos

--- End quote ---
I've found:
__GlobalMapMoveTime         = 250;
__EncounterTime             = 4000;
From what I understand, the encounter tick occurs every 250 miliseconds?


--- Quote from: Wipe on November 16, 2015, 06:06:42 pm ---Naah, it's all in same function; it's just worth to remember what really is behind _CheckSpecialEncounter macro :]

--- End quote ---
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?

Navigation

[0] Message Index

Go to full version