AInur Posted November 20 Report Share Posted November 20 You might be interested in: 1 Quote Link to comment Share on other sites More sharing options...
0 calories Posted November 20 Report Share Posted November 20 @ffmmaybe consider adding on chart some output like CPS take all commands within every 1 minute period and count it. My test shows I reach average 20-22 CPS. Tested on this website https://clickspeeder.com/click-per-second/ but probably any other will work the same. 1 Quote Link to comment Share on other sites More sharing options...
AInur Posted November 20 Report Share Posted November 20 (edited) 18 minutes ago, 0 calories said: My test shows I reach average 20-22 CPS. Tested on this website https://clickspeeder.com/click-per-second/ Wow you are fast! Using your website, I get between 5 clicks and 9 clicks per second, with a mode of 7. This is consistent with the peaks in the graph from ffm's script. In addition, the simulation lag prolongs the turn times, so it's possible to have values equal or slightly exceeding the score from this website. The highest value seen on sanafur's graph was 17, which is well below his maximum CPS (especially when considering in-game lag), so everything is well explained. Edited November 20 by AInur 1 Quote Link to comment Share on other sites More sharing options...
ffm2 Posted November 20 Author Report Share Posted November 20 On 15/11/2024 at 10:23 PM, ffm2 said: The highest of sanafur is 58 per turn (0.2 seconds). 58 / 0.2 = 290 clicks per second. The world record is (presumably) 1051 clicks per 10 seconds for clicking on any spot. World record speed per turn would be 1051 / 10 * 0.2 = 21 clicks per turn. But this is not clicking on any spot. 1 Quote Link to comment Share on other sites More sharing options...
0 calories Posted November 20 Report Share Posted November 20 (edited) @ffm Can you get overall statistic for lets say 100 games with me and see if these values are over-reached in all cases? I havent change it for year so I guess prove is in data - check and see .-) and i stand by my claims might be another aspec of these high values? is lag capable to recieve multiple timeframes within one or so? Edited November 20 by 0 calories Quote Link to comment Share on other sites More sharing options...
ffm2 Posted November 20 Author Report Share Posted November 20 This site has some interesting tests: https://www.arealme.com/apm-actions-per-minute-test/en/ But this is a bit too difficult. That record is 733 apm or 12.22 clicks per second or 2.44 clicks per turn Their cps test is nice displayed, but too easy (this should have a world record of 105 cps): https://www.arealme.com/click-speed-test/en/ Quote Link to comment Share on other sites More sharing options...
0 calories Posted November 20 Report Share Posted November 20 3 minutes ago, ffm2 said: This site has some interesting tests: https://www.arealme.com/apm-actions-per-minute-test/en/ But this is a bit too difficult. That record is 733 apm or 12.22 clicks per second or 2.44 clicks per turn Their cps test is nice displayed, but too easy (this should have a world record of 105 cps): https://www.arealme.com/click-speed-test/en/ This side gives me same results 1 Quote Link to comment Share on other sites More sharing options...
ffm2 Posted November 20 Author Report Share Posted November 20 (edited) This is a new update. Its a version for single games, that's easier to change, adapt, debug etc.. And one with the multiprocessing. For my Pc it didn't run through all games within my limited patience, so I tested it only in a folder with 10 games. It deletes .png files in the folders where it finds a commands.txt, so if you have stored pngs in your replay folder save them elsewhere. But I assume you might ran the old version and want the updates in the folders. Apart from already discussed command-analysis it features Colors are now in game colors Legend moved outside of the plot If you have a metadata.json of the game also: the eco_score of used resource (instead of gathered resources) units trained over time The attached figures are from the first game of the sanafur games that has also zoomed figures on page 2 in this thread. single_game_analyzer.py Edited November 21 by ffm2 4 Quote Link to comment Share on other sites More sharing options...
AInur Posted November 20 Report Share Posted November 20 @ffm2 Very nice scripts, thanks! On the first run of snipe_analyzer_platinum.py, there were some errors due to adding numpy arrays of different datatypes. The lines 220-224 have been fixed for you: def eco_scores(seq): score = np.array(seq['resourcesUsed']['food'], dtype='int64') score += np.array(seq['resourcesUsed']['wood'], dtype='int64') score += np.array(seq['resourcesUsed']['metal'], dtype='int64') score += np.array(seq['resourcesUsed']['stone'], dtype='int64') You need to specify the datatype when converting lists to numpy arrays. Also on line 20, you printed the string 'path' instead of the actual path. Both bugs are fixed in this file below: snipe_analyzer_platinum.py Applying your script on my replays: 1 Quote Link to comment Share on other sites More sharing options...
ffm2 Posted November 21 Author Report Share Posted November 21 Thanks, should all be in the single_game_analyzer.py too. Also I wrote si[N]gle in one chart... Still some to improve but the basis is better now. Quote Link to comment Share on other sites More sharing options...
0 calories Posted November 21 Report Share Posted November 21 17 hours ago, ffm2 said: This site has some interesting tests: https://www.arealme.com/apm-actions-per-minute-test/en/ But this is a bit too difficult. That record is 733 apm or 12.22 clicks per second or 2.44 clicks per turn Their cps test is nice displayed, but too easy (this should have a world record of 105 cps): https://www.arealme.com/click-speed-test/en/ 7 hours ago, AInur said: @ffm2 Very nice scripts, thanks! On the first run of snipe_analyzer_platinum.py, there were some errors due to adding numpy arrays of different datatypes. The lines 220-224 have been fixed for you: def eco_scores(seq): score = np.array(seq['resourcesUsed']['food'], dtype='int64') score += np.array(seq['resourcesUsed']['wood'], dtype='int64') score += np.array(seq['resourcesUsed']['metal'], dtype='int64') score += np.array(seq['resourcesUsed']['stone'], dtype='int64') You need to specify the datatype when converting lists to numpy arrays. Also on line 20, you printed the string 'path' instead of the actual path. Both bugs are fixed in this file below: snipe_analyzer_platinum.py 11.34 kB · 2 downloads Applying your script on my replays: Any idea what is wrong here? 2018-04-28_0001 Process Process-1: Traceback (most recent call last): File "/usr/lib/python3.10/multiprocessing/process.py", line 314, in _bootstrap self.run() File "/usr/lib/python3.10/multiprocessing/process.py", line 108, in run self._target(*self._args, **self._kwargs) File "/home/me/.local/share/0ad/replays/0.0.26/snipe_analyzer_platinum.py", line 31, in analyse_replay player_data = commands[0].split(',"PlayerData":[')[1] # crop unnecessary IndexError: list index out of range Quote Link to comment Share on other sites More sharing options...
AInur Posted November 21 Report Share Posted November 21 2 hours ago, 0 calories said: player_data = commands[0].split(',"PlayerData":[')[1] # crop unnecessary IndexError: list index out of range This index error is caused by referencing an index greater than the length of the list. It could either be caused by commands[] being an empty list (your commands file was empty) or if there was no valid players. Given this replay was from 2018, it's very possible that earlier versions of the game stored its replays in different formats, so this heuristic script won't be able to interpret it correctly. Since the analyse_replay function is already in a try-except condition, the analysis for this particular replay failed but the other replays should be analysed correctly. It would be helpful if you can post that particular replay from 2018-04-28_0001 here for me. Quote Link to comment Share on other sites More sharing options...
0 calories Posted November 21 Report Share Posted November 21 ohh there was multiple errors and the last i posted was misleading. I endup with this error: AttributeError: 'Legend' object has no attribute 'legend_handle and fixed it (here is why https://github.com/fastlmm/FaST-LMM/issues/48 and https://github.com/matplotlib/matplotlib/issues/28680) so if you face similar issue replace legend_handles with legendHandles thanks Quote Link to comment Share on other sites More sharing options...
0 calories Posted November 21 Report Share Posted November 21 (edited) DO NOT RUN IT if you have larger replays directory! Your machine will get over busy and all you have running will crash. Script run all in paraler so it cant handle too many directorys = new process...! FORK BOMB - crash your PC. Exhaus memory triggier swap and kills everything Edited November 21 by 0 calories 1 1 1 Quote Link to comment Share on other sites More sharing options...
ffm2 Posted November 21 Author Report Share Posted November 21 Oh, good I aborted after I heard my fans blow up and tested afterwards in a test directory with only 10 replays. This should be fixed but I only tested it in the test directory again. This can be run on only one case with multiprocess = False and a specified path (good for editing/debugging etc.) Can process a part of your database (first 10% in batches) limit number of processes (is set on 4 for now) delete pngs (good to delete all the pngs named sigle) multiprocess = False # you can specify to handle which part of your db you want process. # E.g. test with [0, 10] and if it works in a reasonable time do [10, 100] next. # in percent process_part_database = [0, 10] parallel_processes = 4 path = "2024-11-13_0009/" # for single game delete_pngs = False game_analyzer.py 2 Quote Link to comment Share on other sites More sharing options...
ffm2 Posted November 21 Author Report Share Posted November 21 1 hour ago, 0 calories said: AttributeError: 'Legend' object has no attribute 'legend_handle and fixed it (here is why https://github.com/fastlmm/FaST-LMM/issues/48 and https://github.com/matplotlib/matplotlib/issues/28680) so if you face similar issue replace legend_handles with legendHandles That's annoying. I got matplotlib 3.9.2, so quite new (instead of what they wrote). And for me the other way don't work: AttributeError: 'Legend' object has no attribute 'legendHandles' I don't want to include some checks to execute different code for different versions of matplotlib ... So I agree, if you have a similar issue, replace it yourself, sorry (-.-) 1 Quote Link to comment Share on other sites More sharing options...
AInur Posted November 21 Report Share Posted November 21 Apologies, the previous script was designed for moderate replay databases and purely optimised for performance. This version is safer as it counts the number of CPU cores that you have and limits the number of processes to just your core count. Of course it will be slower, but it's safer for low end systems. snipe_analyzer_platinum_safe.py The final process has to do the extra work, which slows down the overall generation. You can of course limit the folders that you want (for example we can have a CLI input for the user). I had no problem with running 100 concurrent processes, but it might be unsafe for some users. We can also try a multiprocessing pool. 1 Quote Link to comment Share on other sites More sharing options...
ffm2 Posted 3 hours ago Author Report Share Posted 3 hours ago Here is a mod which colorizes the attacker (green) and the target (red) of the selected player in a replay. It goes OOS, but you can click the warning away. Don't use it in games or as a spectator of live games though. The code is from elexis, I only packed it in a mod. I viewed some games. I the fast sniping of sanafur and Stockfish is done by -the firmware of the mouse -or some software that translates a held key While they hold this clicker-key, the repeated mouse clicks are automated in a high frequency. They can move the mouse meanwhile fast over units that shall be sniped. Depending on the speed of the cursor movement a target can be assigned a different number of attackers. The targets are quite near of each other. The attacking units are random from the army (with big gaps). The sniping is not so sophisticated, like choosing wounded units and assigning correct number of projectiles to take one out, as one would expect from a script. The clicking is done in combination with held ctrl-alt key. Ctrl has the effect that the attacker will attack a unit when clicked on it, but when cursor goes over a spot over the ground the unit gets a attack-walk command and thus attacking the next target. This is not harmful like a walk command which would have been send without the ctrl button. Alt gives the command to only one unit per click and removes it from the selection. When the attacked army is on a field, the attack-work does not work but rather the field gets attacked by a lot of units. You can see in the following plots that sanafur and Stockfish gives a high number of attack-walk commands during sessions of sniping. Not in every game, but usually. So occasionally they can hover over good selectable units. This is a form of cheating and abuse. E.g. in minecraft one can get a benefit by clicking fast, see: https://cpstest.org/kohi-click-test.php Quote Most cheat detection techniques are unhuman like when you use auto clicker and macros and get constant cps without dropping. You can get banned by Hipixel when you use such modifications. attack_viewer.zip 1 Quote Link to comment Share on other sites More sharing options...
ffm2 Posted 3 hours ago Author Report Share Posted 3 hours ago In this plot one can see sanafur giving attack-walk commands in a similar frequency like the attack commands commands.txt Quote Link to comment Share on other sites More sharing options...
ffm2 Posted 3 hours ago Author Report Share Posted 3 hours ago (edited) Here we can see the sniping fail and giving half of the army the order to attack a field Edited 3 hours ago by ffm2 1 Quote Link to comment Share on other sites More sharing options...
ffm2 Posted 2 hours ago Author Report Share Posted 2 hours ago Here we see a normal sniping in action. The green units are targeting the red ones in one turn. Quote Link to comment Share on other sites More sharing options...
ffm2 Posted 2 hours ago Author Report Share Posted 2 hours ago Stockfish's games show the similar high ammount of attack-walks mixed in. It seems his clicking frequency is set higher than sanafurs. Quote Link to comment Share on other sites More sharing options...
ffm2 Posted 2 hours ago Author Report Share Posted 2 hours ago The games of berhudar look different with no attack-walk commands in such a high ammount. Also the sniping is not so spread out. Quote Link to comment Share on other sites More sharing options...
ffm2 Posted 2 hours ago Author Report Share Posted 2 hours ago Here is the diff from which I made the mod for further use attack_view.diff Quote Link to comment Share on other sites More sharing options...
real_tabasco_sauce Posted 11 minutes ago Report Share Posted 11 minutes ago super cool @ffm2 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.