#No Notes Lag

19 messages · Page 1 of 1 (latest)

deep holly
#

Note spells could lag my game when cast at high frequency. This was because they render random png sprites from their particle emitter.

Now they don't kill my FPS, because I removed the laggy sprite emitter.

TLDR: dull note graphics → no lag for spamming notes.

https://drive.google.com/file/d/1jYg1f1koqB9HcDsFHptnZf1WmbBUAwVB/view?usp=sharing

EDIT:  💡 NOW UPDATED FOR FULL COMPATIBILITY WITH OTHER MODS
thanks @flint harness for the explanations and sample code

flint harness
#

It looks like this mod overrides the note data files completely

#

That may cause some cross mod incompatibility

deep holly
#

On principle, right (and thanks for pointing this out)
But do other mods really modify these particular xml files?

flint harness
#

Yep

#

I know mine does

#

Others might too depending on how they implement certain things

deep holly
#

Oh 😦
Do you think there'd be a more compatible way to remove the png particle emitters without a script running every frame that would itself contribute to lag?

flint harness
#

You could use nxml or gsub to remove the particle emitter

#

uhhh

deep holly
#

Mmh, I see. I put a disclaimer about compat with your mod in the first post.
And I'll try to publish a more compatible update soonish.

flint harness
#

@deep holly

  local pathprefix = "data/entities/projectiles/deck/"
  local notes = {
    "kantele/kantele_a.xml",
    "kantele/kantele_d.xml",
    "kantele/kantele_dis.xml",
    "kantele/kantele_e.xml",
    "kantele/kantele_g.xml",
    "ocarina/ocarina_a.xml",
    "ocarina/ocarina_a2.xml",
    "ocarina/ocarina_b.xml",
    "ocarina/ocarina_c.xml",
    "ocarina/ocarina_d.xml",
    "ocarina/ocarina_e.xml",
    "ocarina/ocarina_f.xml",
    "ocarina/ocarina_gsharp.xml",
  }

  for k=1,#notes do
    local path = pathprefix .. notes[k]
    local content = ModTextFileGetContent(path)
    local xml = nxml.parse(content)
    attrpath = xml:first_of("ProjectileComponent").attr
    attrpath.damage_every_x_frames = "15"
    ModTextFileSetContent(path, tostring(xml))
  end
#

Here's something I use with nxml, you should be able to repurpose it to look for the ParticleEmitterComponent and set _enabled to 0

#

If you want to use gsub instead, you could try searching for delay=\"0\" and replacing it with something like
delay="0" _enabled="0"

deep holly
#

👍

#

Thanks a lot

flint harness
#

Best of luck~

deep holly
#

It's fixed, using your code and nxml. Thanks to you Conga!