youngneil1 wrote:Do you experience the bad performance on regular laptos/notebooks/desktops, too (or only on phones/tablets)? Edit: And in case it happens on regular laptops/notebooks/desktops (Windows systems in this case), does normal IB show the same slow performance on these systems, too?
I see about 30-40 fps on my windows 10 laptop (Lenovo Legion Y520) when running IBx for UWP. I see about 4-7 fps on my android tablet, iPads, chromebook, and iPhone X. This is on the first main map screen for Blackwinter, other screens are different. I see 50-70 fps on my windows 10 laptop when running IB.
Thank you for cheking this out, Jer. On one hand this is good news as IB performance is good on your laptop, too. On the other hand this underlines that we will need to disable a few cosmetic features for IBx to run well. I will try more ways to turn off scrolling on main map after next IB release. First test for turning off scrolling I did were not very successful - I fear there will be no easy hack, but we will get there .
Let me do some more testing on my side before you try to add graphic toggles. I’m trying to track down the main culprits first by turning one feature off (and then back on after testing) at a time. I saw your notes in the code about the two resource heavy functions in the main map screen and it looks like the main layout ui draw routine is the bigger issue. I’ll dig into that and see what I find. Turning off the call to draw the ui took me from 4 fps to 15 fps on my iPad.15 is quite playable on the iPad so it looks promising. The main map drawing routine is the other that I’ll inspect next. I bypassed the update function on the main map, but it didn’t impact fps so it is okay. Also, I bypassed the scrolling system, but it didn’t impact fps so it is okay as well.
Biggest fps gains for me during optimization were related to the drawing of fonts. I dont recall the details right now but I think I reduced the numbers of calls for new writeFactories (or some such) to one 1/9. It was related to the way we draw the bigger letters (slightly shifted, multiple draw calls for each letter) and their black outlines. Before I optimzied I think each word had to be drawn nine times with 9 different creations and destructions of write factory objects. I shifted all of this into a single writeFactory, I think (doing its job nine times before being discarded). Well, maybe it was a bit differnt but it was definetly related ... I also drew them a bit less bold (less iterations, I think from 16 to 9), iirc...
Also, I think there was an important optimziation when it comes to drawing "blank" layers. Iirc the old code drew (loaded) each tiem a blank transparent graphic for this - just not drawing these blank layers gained a few fps, too. Again, I might rember this incorrectly .
When switching to skiaSharp drawText I had to reintroduce the 25 calls to draw black outline of text. I removed that and am now drawing just a single black text shifted 2 right and 2 down, then draw actual text color on top of that. So only two text draws now and I went from 4fps to 18 fps on my iPhoneX
Now IBx plays very well on my phone and iPad
From my iPhone X:
3C1205B5-C32E-4ED6-8065-AD5B0E89BE0D.jpeg (292.93 KiB) Viewed 4833 times
Today I did some more play testing and clean up work. I also added panning buttons to the combat screen to take place of the arrow keys on keyboard. Eventually, I would like to use a swiping gesture to pan the map. touch and hold down while sliding finger to pan. I also fixed a few bugs. One thing that I haven't fixed just yet is that when tapping an arrow key to move up on the main map, The players move two squares almost every time. Only one square for other directions. I think it has to do with the scrolling or move while holding down feature, but I'm not sure how to fix it just yet.
I'll probably release another version of IBx to Google Play for people to test this weekend some time.
Today I fixed a bug that has been "bugging" me for awhile. Moving up was jumping two spaces each time. It was a timer issue, but I fixed it so I'm back to one space at a time. I also removed the panning buttons and instead replaced it with a tap and drag feature to do the panning on the combat screen. It works very well, is super easy to pan around, and hopefully intuitive.