--- Log opened Thu Oct 18 00:00:44 2018 20181018 00:37:00-!- celmin|away is now known as celticminstrel 20181018 02:08:39-!- mattsc [~mattsc@wesnoth/developer/mattsc] has quit [Quit: So long and thanks for all the fish.] 20181018 02:48:16-!- celticminstrel [~celmin@unaffiliated/celticminstrel] has quit [Quit: KABOOM! It seems that I have exploded. Please wait while I reinstall the universe.] 20181018 02:48:35-!- celticminstrel [~celmin@unaffiliated/celticminstrel] has joined #wesnoth-umc-dev 20181018 03:27:54-!- celticminstrel is now known as celmin|sleep 20181018 07:20:35-!- Nobun [~user@51.179.102.116] has joined #wesnoth-umc-dev 20181018 08:54:48-!- zookeeper [~lmsnie@wesnoth/developer/zookeeper] has joined #wesnoth-umc-dev 20181018 10:02:23-!- hk238 [~kvirc@unaffiliated/hk238] has joined #wesnoth-umc-dev 20181018 10:48:18-!- Nobun [~user@51.179.102.116] has quit [Quit: WeeChat 2.1-dev] 20181018 10:54:13-!- zookeeper [~lmsnie@wesnoth/developer/zookeeper] has quit [Ping timeout: 245 seconds] 20181018 10:58:17-!- zookeeper [~lmsnie@wesnoth/developer/zookeeper] has joined #wesnoth-umc-dev 20181018 12:39:47-!- celmin|sleep is now known as celmin|away 20181018 13:34:34< hk238> btw how does wesnoth syncronize random number generation? 20181018 13:34:39< hk238> *synchronize 20181018 13:35:49<+wesdiscordbot> o, hae 20181018 13:36:30<+wesdiscordbot> my two wild quesses are either the host sends the result or it sends the unique rng key 20181018 13:37:13< hk238> I'd like to know some more details about that :p 20181018 13:47:02< hk238> does the seed get generated every turn or at the beginning of the game or? 20181018 13:48:10<+wesdiscordbot> No, the seed is generated at the start of the game. After that, random number generators of all players are kept in sync. 20181018 13:48:52< hk238> how does that work exactly? :d 20181018 13:49:03<+wesdiscordbot> I haven't checked. 20181018 13:50:41< hk238> hmm so basically the seed is like an input to a random number generator so that the random number generated by the generator is deterministic 20181018 13:50:55< hk238> and using the seed you can do like "generate next" random number 20181018 13:51:21< hk238> and because it's the deterministic then the numbers generated by all clients are the same, an ordered sequence of numbers? 20181018 13:51:35<+wesdiscordbot> Yes. 20181018 13:52:07< hk238> hmm and the random number generator produces like a number from 0 to 1 , and it's used in calculations like chance to hit 20181018 13:52:23< hk238> is it done in such a fashion that if the cth < number generated 20181018 13:52:39< hk238> or some other method such as taking a slice of the sequence? 20181018 13:52:57<+wesdiscordbot> It produces random 32-bit unsigned integers. 20181018 13:53:13< hk238> oh 20181018 13:53:17<+wesdiscordbot> The hit check takes modulo 100 and compares it to the hit probability percentage. 20181018 13:53:31< hk238> okay that's pretty cool 20181018 13:54:26<+wesdiscordbot> https://github.com/wesnoth/wesnoth/blob/f594019433de6c2709151cf5319d12c2265894bf/src/actions/attack.cpp#L991-L994 20181018 13:54:53< hk238> I was just wondering if it was possible to for an example tamper with the seed generator, with the result that you'd get the cth to converge to some offset 20181018 13:55:11< hk238> but at least at first glance I'm not sure if it's possible with that method of evaluation 20181018 13:55:58< hk238> hm 20181018 13:56:18< hk238> so get_random_int produces the modulo of an individual number? 20181018 13:56:38<+wesdiscordbot> It gives a random integer in the provided range, inclusive. 20181018 13:57:35<+wesdiscordbot> https://github.com/wesnoth/wesnoth/blob/f594019433de6c2709151cf5319d12c2265894bf/src/random.hpp#L44-L51 20181018 13:57:47< hk238> yes I'm interested in the mechanic of how it's produced with the interest that what type of control you would have over the randomness behavior in the game by controlling the seed generation process 20181018 14:00:20< hk238> for an example can you choose a subset of seeds such that you're likely to get unusual behavior 20181018 14:02:02< hk238> speaking of which replays store the seeds right? 20181018 14:02:15< hk238> so for an example all the seeds for games played on the MP server are actually stored online? 20181018 14:03:38< hk238> Just out of curiosity :D 20181018 14:04:07< hk238> I was thinking about it the other day 20181018 14:06:27< hk238> for an example if I wanted to 'cheat' in this game then I could rewrite the random seed generator and compile my client with abnormal random seed generator, that would have some specific behavioral aberration that would then manifest in the games 20181018 14:06:40<+wesdiscordbot> :GWsetmyxPeepoWeird: 20181018 14:07:03< hk238> and it would be also undetectable because they're just random seeds afterall and the game behavior itself would be consistent 20181018 14:07:47< hk238> although it would be possible to look at the seeds generated via thus a method and see if they're a truly representative sample of the typical random number generator, but it would probably require a lot of numbers before any statistical analysis would pick it up 20181018 14:07:48<+wesdiscordbot> wouldn't that mean, that opponent gets the same bonuses? 20181018 14:08:01< hk238> yes but it would mean that you could predict the behavior 20181018 14:08:08< hk238> depending on the actual mechanism involved of course 20181018 14:08:34< hk238> so that how the random number is produced with the help of the seed determines what kind of control you would have that way 20181018 14:08:39<+wesdiscordbot> :GWfroggyPepoSmug: 20181018 14:09:31< hk238> for an example it might be possible, depending on the specifics, that you'd get more volatile RNG than normal, or that you'd get a specific behavior on certain intervals 20181018 14:09:36< hk238> it's a mathematical puzzle of sorts I guess 20181018 14:10:56<+wesdiscordbot> just set everything to zero 20181018 14:10:58<+wesdiscordbot> :GWsetmyxPeepoEvil: 20181018 14:13:25< hk238> :D 20181018 14:16:33< hk238> I mean it's possible to do that I'm not actually interested in it 20181018 14:16:54< hk238> I mean, I am interested in it, but like I'm not interested in any manner of cheating 20181018 14:18:27< hk238> although if there was a particularly unusual aberration then it might not require a lot of numbers to pick it up 20181018 14:25:05<+wesdiscordbot> right, for that we already have the cheat mode, -d 20181018 14:26:06< hk238> :D 20181018 14:26:20< hk238> I never cheat in any games I just like to think about such things 20181018 14:33:58< hk238> actually there is a bit more specific reason I was thinking about that too but it doesn't matter for the purposes of this conversation 20181018 14:37:09< hk238> hmm but looking at this it seems that the changes in behavior would be limited 20181018 14:47:45< hk238> my cpp reading skills are next to zero it takes time before I understand this if tha tever happens.. 20181018 14:47:46< hk238> :D 20181018 15:14:39< hk238> This got complicated really quickly 20181018 15:27:26< hk238> overall looks like this entropy source is so complicated/random that probably nothing very general can be said about the generated numbers even if you could select a subset of seeds except by simply testing the output 20181018 15:28:46< hk238> but it could have some effect but not much 20181018 15:29:55< hk238> for an example you could just try a number of different seeds and pick the most unusual sequence of numbers, but then for there to be a property present in the generated random numbers would require bruteforce approach 20181018 15:30:36< hk238> like the number of seeds you'd need to test would approximately equal the likelyhood of the property 20181018 15:31:17< hk238> so if you'd want to generate a seed that results to that all attacks miss on 50% defense 20181018 15:31:57< hk238> for sake of simplicity, and then you'd want that to be true for the first N numbers, then you'd need to test 2^N seeds ? 20181018 15:35:25< hk238> Well it is possible to cheat that way technically 20181018 15:36:03< hk238> and because of how the check is implemented it also has a natural usecase in the game like you can choose a seed that benefits high defense units 20181018 15:38:49< hk238> this could also be prevented by the way :D 20181018 15:41:27< hk238> but then I'm pretty sure most people wouldn't go to such lengths 20181018 15:41:37< hk238> to do that 20181018 15:42:38< hk238> hmm it is also possible to generate a seed with a particular offset but it would be only particular with respect to some given CTH 20181018 15:43:01< hk238> like for an example if all attacks in the game are performed against 60% defense you have the average hike towards -30% for an example 20181018 15:43:30< hk238> but it's not possible to do that so that the offset was consistent with different cth values 20181018 15:44:48< hk238> hmm I guess it would be pretty easy to detect that kind of hack 20181018 15:45:50< hk238> I mean if you take a seed and then look at the distribution of the % 100 numbers 20181018 15:46:07< hk238> then if someone used a bruteapproach to tailor some seeds, it would be visible 20181018 16:02:17<+wesdiscordbot> I'm having a problem with WFL 20181018 16:03:12<+wesdiscordbot> $($alanin.y-1) would be the the y-coordinate minus one 20181018 16:03:30<+wesdiscordbot> but … what would be the y-coordinate plus one 20181018 16:03:49<+wesdiscordbot> $($alanin.y+1) 20181018 16:04:21<+wesdiscordbot> However, if the containing WML literal isn't quoted, the WML preprocessor will see the plus sign first and turn it into $($alanin.y1). 20181018 16:04:54<+wesdiscordbot> So in most contexts you'll want to surround formulas containing a plus sign in double quotes, e.g. foo="$(bar + 1)" 20181018 16:05:02<+wesdiscordbot> ahh… that must be it. thanks 20181018 17:11:00< hk238> hmm could order a shirt with wesnoth logo :p 20181018 17:24:01<+wesdiscordbot> :GWfroggyPepoThumb: 20181018 17:24:20< hk238> or maybe the image of armageddon drake 20181018 17:24:26< hk238> :D 20181018 17:26:57<+wesdiscordbot> lvl2 pikeman ftw 20181018 17:41:46<+wesdiscordbot> What's this with these green smileys… somehow if associate negative things with it 20181018 17:48:26<+wesdiscordbot> :GWsetmyxPeepoWeird: 20181018 17:48:33<+wesdiscordbot> pepes are gud bois 20181018 20:10:31<+wesdiscordbot> @hk238 I acctualy delved into topic of making "automated best recruitment generator" and i think that doing it in non-automated way is quite a bit easier. Mainly becouse it will require making matchups of every unit vs every unit and after that ever unit vs current enemy composition. >.< 20181018 20:22:30<+wesdiscordbot> And becouse it does not look at what players want to do. 20181018 23:58:57-!- zookeeper [~lmsnie@wesnoth/developer/zookeeper] has quit [Ping timeout: 244 seconds] 20181018 23:59:57-!- hk238 [~kvirc@unaffiliated/hk238] has quit [Quit: KVIrc 5.0.0 Aria http://www.kvirc.net/] --- Log closed Fri Oct 19 00:00:45 2018