Jump to content

Unusual high sniping activity of very few players


ffm2
 Share

Recommended Posts

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 by AInur
  • Haha 1
Link to comment
Share on other sites

On 15/11/2024 at 10:23 PM, ffm2 said:

4.png

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.

  • Like 1
Link to comment
Share on other sites

@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 by 0 calories
Link to comment
Share on other sites

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/

Link to comment
Share on other sites

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

ckicktest.png

  • Like 1
Link to comment
Share on other sites

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.

all_commands.png

attack_queued.png

attack_unqueued.png

eco_score.png

group_attacks_unqueued.png

hold.png

sigle_unit_attacks_unqueued.png

units_trained.png

single_game_analyzer.py

Edited by ffm2
  • Like 4
Link to comment
Share on other sites

@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:

image.thumb.png.f14a2a62f94a9a987e04e1c6cd857cf5.png

  • Like 1
Link to comment
Share on other sites

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:

image.thumb.png.f14a2a62f94a9a987e04e1c6cd857cf5.png

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

Link to comment
Share on other sites

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.

 

 

 

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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 by 0 calories
  • Thanks 1
  • Haha 1
  • Confused 1
Link to comment
Share on other sites

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

  • Like 2
Link to comment
Share on other sites

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 (-.-)

  • Thanks 1
Link to comment
Share on other sites

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.

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...