games647 / LambdaAttack

Minecraft bot for servers. Currently supports stress testing.
MIT License
278 stars 56 forks source link

Bots don't generate chunks or spawn mobs around them #26

Open Frogperson opened 6 years ago

Frogperson commented 6 years ago

I'm trying to use this tool to stress test my server to see how many players I can support but it seems minecraft is only half loading them in. What I mean by that is the players are indeed there and they load chunks, but they do not seem to generate new chunks or spawn hostile mobs around them. They also ignore gravity and knockback from taking damage but that part doesn't really matter as much. The no gravity part reminds me of when a player who has terrible ping first joins.

games647 commented 6 years ago

Gravity and knockback is implemented client side. The client handles how the position changes downwards. This project is very simple and therefore doesn't implement things like gravity it just ignores it. Nevertheless chunk generation and spawning mobs is implemented server side. How do you verified it and do you waited long amount of time (Mobs for example do not spawn instantly).

Frogperson commented 6 years ago

Yeah that's what I was guessing about the gravity, and that's fine, it's not really needed for stress testing for the most part.

The chunk generation part isn't actually verified but I'm pretty sure about it because I had about 100 bots join a server on my computer and I did a spread players command /spread players ~ ~ 400 8000 false @a, and there was pretty much 0 server lag. The world was not pregenned beforehand by the way.

And I can tell mobs aren't spawning because hundreds (or thousands on a vanilla server vs spigot, I checked both) all spawn around me. The way the mob cap works is it takes the total amount of chunks loaded on a server and plugs that into an equation to get the cap of how many mobs can spawn. Since I'm getting so many spawning around me that means that the server recognizes the chunks are loaded so it's increasing the cap, but only trying to spawn the mobs around real players.

If you'd like to join my test server some time for me to show you if be happy to send you the ip

games647 commented 6 years ago

As far as I know Chunk loading is processed async nowadays. This way it doesn't affect the main thread performance at all.

Frogperson commented 6 years ago

I supposed I could load up dynmap to see if chunks are getting generated, but the mob spawning thing is definitely still an issue. I'll test that in a little bit and report what I find here

Frogperson commented 6 years ago

I just tested with Dynmap and it looks like my theory is correct, the server is not generating chunks for any of the bots https://i.imgur.com/WiseOkU.png