Help reducing lag from tick events

Started by KingBugz on Mon, 10/19/2020 - 19:03

Topic category: Help with modding (Java Edition)

Last seen on 02:54, 24. Nov 2020
Joined Sep 2018
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Help reducing lag from tick events
Mon, 10/19/2020 - 19:03

So short and sweet as usual,

I my mod produces a HUGE amount of lag, this appears to be from too many tick events. My question is can I keep the events while reducing lag, or would combining procedures with the same global event help?

Also would item held and such tick events cause this lag without having the item in inventory? Or do these ticks only trigger once you have the item/holding the item?

 

ANY HELP WOULD BE GREATLY APPRECIATED, ty.

Last seen on 06:06, 24. Nov 2020
Joined Jul 2020
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
All i know for sure is too…
Mon, 10/19/2020 - 23:16

All i know for sure is too many things happening at once will cause allot of cpu and ram usage.

to combat this the best way is either to reduce the amount happening entirely or reduce the amount happening at once by using a timer/cooldown procedure.

the last and final piece of advice is to take out anything that is not needed or Simplify what you have already so it's not doing more than needed.

if you need help understanding how to make a timer there are plenty of videos and info out there with a simple search.

Last seen on 02:54, 24. Nov 2020
Joined Sep 2018
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
I cant think of much that…
Tue, 10/20/2020 - 01:40

I cant think of much that would be going on at all times is the problem there.

Most things need to be unlocked. But I did notice a big improvement when combining procedures with the same global trigger.

Last seen on 09:20, 24. Nov 2020
Joined Apr 2010
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Triggers will cause…
Wed, 10/21/2020 - 19:25

Triggers will cause additional computing, use as little tick triggers as possible, and don't do much in procedures called on ticks.