Game
fezEngine


3 years ago

How I managed to optimize my text engine by 500%


Recently, I posted my #fezEngine's text engine progress and it was... disasterous. So I tried to completely reengineer it and I've come up to a conclusion:

Most of the time the text you render is static, unless you render timers or variables that are constantly changing, the more frequent changes you can do to a text is change it's position, scale or it's rotation, and the old engine I made took all that into account while dynamically rendering the text. The problem with that is that it was very unoptimized since it had to do that every frame, practically returning the same values, just offset, scaled and rotated, which was really reducing the performance.

The solution was quite simple, actually. Basically what it does, the function gets the text, pre-renders it at normal values, stores the result into a list and then renders the needed text using data from that list with adjusted values according to it's position, scale and rotation.

You might be confused and say:

-Wait fezman isn't that just the same thing but with extra steps and lists involved?

Actually not, instead of rendering the text every frame, it pre-renders it once, stores the result in a list and then reuses that list data when it's needed, practically doing the actual render once per runtime.

The result is huge: Instead of 100, it can run 500 text functions while maintaining 60 fps (screenshots provided), that's 5x faster!

And you know what is the best part, the code is much cleaner now, I've splitted it into 2 functions for now but soon I will combine them and you will see the result on the #screenshotsaturday or later.

Anyway, that is all I wanted to showcase, fezEngine is near to being finished, as always, stay tuned for the updates!

Upd:

Just noticed that the debug panel has the same values on both screenshots so it might look fake, but it's just an unlucky coincidence lol. I can post a package on the fezEngine's page so you can see the improvement yourselves.



1 comment

Loading...

Next up

#fezEngine's biggest changelog so far!

I went a bit too far when I started implementing pointers and jumps in scratch using lists

all this to basically make a parser

have a bizzare graph and dont @ me

@NEOWIZ_QUEST 's NARRATIVE JAM is underway!

Create an original narrative / story game in 10 days for a chance to win cash! 💸

Join the game jam: https://bit.ly/GameDevCommunity

Start Narrative Jam-inspired quests: https://bit.ly/narrativejamquests

Soo fezEngine is kinda pointless now that extensions made scratch usable, it also is not very compatible with scratch because send/receive message blocks are laggy as all hell unless you're using turbowarp which 'mind you has extensions, oh well

@NEOWIZ_QUEST 's NARRATIVE JAM is underway!

Create an original narrative / story game in 10 days for a chance to win cash! 💸

Join the game jam: https://bit.ly/GameDevCommunity

Start Narrative Jam-inspired quests: https://bit.ly/narrativejamquests

Scratch not being able to recognize capital letters ruins my text engine

thanks ig

@Patata1236 is a Jolter to Watch who makes games and art for fun! Follow @Patata1236 before the quest ends on November 18 and you'll get Coins!

#screenshotsaturday is near, here is a little sneak peek to what I will be posting