Jump to content

Recommended Posts

Posted

Hello. I have an entity that i noticed lags the server, resulting in entities semi-teleporting around, and overall server lag. After commenting out all of my entity's AI, it ran like normal. However after undoing that it lags as expected. Could this be because the class is to large? Here is my class, by the way:

https://github.com/Alex-the-666/Ice_and_Fire/blob/77547cdff9fe98fe619ce48e21ef2c98ff048597/src/main/java/com/github/alexthe666/iceandfire/entity/EntityDragonBase.java

Posted

Could this be because the class is to large?

 

What-Meme-13.jpg

 

The "commented out" code you were talking about is EXACTLY the code that is commented out in file you linked?

If yes - could you narrow it down?

If no - could you please mark lines which are the ones that change game experience (lag)?

 

Also - how many such entities are in world when lag occurs (with AI code)?

 

Is this actually server lag (meaning - have you checked with cmd /tps ?) or maybe some rendering (I don't think so, but still).

 

Without looking too much at code (too long really) I can guess that your entity, by using dragon's AI (I assume that is vanilla AI, because if not, you would include it, and I can't get on IDE now), is doing some bat-shit crazy processing, especially ridiculus when having shitload of dragons where they shouldn't be. (This is only guess, provide more info).

1.7.10 is no longer supported by forge, you are on your own.

Posted

I said "class too large" meaning there might have been too much logic that could be triggered by the AI, but i don't think that would fit on Subject.

The currently commented out code hasn't been tested. I just mean the current code does the server lag, which is server lag, as logic is slowed down, mobs move extremely jittery, etc.

Posted

You should sample your mod to determine what's using so much CPU time/memory.

1. The JDK comes with the java profiler VisualVM; it's located in <jdkname>/bin, look for jvisualvm.exe or type "jvisualvm.exe" into a run window and press enter.

2. Launch your mod, then go into VisualVM and find the VM called GradleStart under local, right-click it and select Open.

3. Go into the Sampler tab, check the box labeled Settings and set the packages you wish to profile/not profile.

4. Press the CPU or Memory button to start sampling.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  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.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.