I lost like a year off my life today in stress.
The first looming disaster of the day was the ongoing problems getting setup support with our billing service provider. It was getting to the point where unless it were resolved immediately, and it didn’t look that way, the project would have to be canceled for lack of ability to take payment and lack of time to write a solution. Ouch. Just by fortunate chance, the CEO of the company had posted on my blog before, back when I required registration to stop spammers. As a last resort I grabbed his email address, shot him an email asking for help, and got a phone call an hour later. I was really impressed by the positive attitude of the new person I was working with at that point. I’m pretty sure things will work out now and this problem is behind me.
The second disaster was, as I previously posted, CEGUI is SOOOO slow at rendering text. It does a full draw call for every letter, recalculating the screen every update. I vacillated between writing my own system, fixing CEGUI, switching libraries, or just bypassing the problem in some other way. There was no easy solution in sight, and they all came with drawbacks. But my programmer in Portugal found a design flaw with CEGUI – we were hiding the root window, rendering the compositor, and then showing it again. Doing this caused a full-rebuild of every element on the screen. When combined with how CEGUI treats every individual letter as a widget, it dropped the FPS between 50%-75%.
I added a hack to System::renderGUI(void) block the variable “d_gui_redraw” from changing between the compositor start and end and that fixed that part. Another problem is that calling setAlpha, setFont, or setText with the same as the current value signals an unnecessary rebuild. So I changed CEGUI to check for that. The last thing is that CEGUI redraws the screen anytime any element changes. So I had to disable the clock, coordinates, and energy text since they update almost every tick. I switched over to displaying them with Ogre overlays instead.
I still have a lot of stress as Alpha is several days late now, but with these problems out of the way, and a few annoying bugs, I can at least start looking at making an Alpha build again.