Log In  

Does anyone know if there are any good token optimization tutorials out there? Something like a collection of tips that show a suboptimal way of doing something and then demonstrate an optimized equivalent?

I'm about 25% through my latest game but about 60% through my token count already. Ordinarily I am much more inclined to finish functionality first and optimize/polish later, but in this case there is no way I will be able to finish if I don't clean up because I'll run out of tokens well before everything is in.

I suspect most of my problem is that I have a lot of tables and nested tables, like this:

-- this is 76 tokens total and I have a total of about 608 tokens worth of just these
ryl = (yl + (flr(yl/10)*1.5))*7.84

which I then refer to values of like this (adding another 26 tokens): sspr(oteam.rec.rec1.sx,oteam.rec.rec1.sy,sprw,sprh,oteam.rec.rec1.x,oteam.rec.rec1.y,sprw,sprh,oteam.rec.rec1.f)

There are obvious things I could do here, like shoving "oteam.red.rec1" into something more compact so it's a single token instead of 3 every time, but I'm hoping there are more "best practices" sorts of things folks could point me to for general token savings and more proper ways to deal with data structures like this.

P#83365 2020-10-26 15:04

[Please log in to post a comment]

Follow Lexaloffle:        
Generated 2021-01-21 08:35 | 0.007s | 4194k | Q:9