Blazer scrolling grid project
-
- Posts: 167
- Joined: Wed Oct 22, 2014 3:26 pm
- My devices: iPhone 4 to 6+,iPad mini to iPad air 2
Re: Blazer scrolling grid project
Looks good but I ran into lag issues. It would hiccup and pause on the scrolling. Great job! Thank you!!!!!
- rbytes
- Posts: 1338
- Joined: Sun May 31, 2015 12:11 am
- My devices: iPhone 11 Pro Max
iPad Pro 11
MacBook
Dell Inspiron laptop
CHUWI Plus 10 convertible Windows/Android tablet - Location: Calgary, Canada
- Flag:
- Contact:
Re: Blazer scrolling grid project
There is still a lot of optimizing to be done. If I look at the photo of the filled grid of light and dark green squares that you included at the start of this thread to use as a model, it has far fewer quads in it. The closest 2 rows are only showing 3 quads each, and the next 2 rows are only showing 5 each. The quads at the screeen boundary are only partial size. And I can only see 7 horizontal rows of quads stretching to the horizon.
Compare that to the image that I just posted. It has 12 quads showing in each of the front two rows, and that number increases quickly for the rows farther away. There are 10 visible rows of quads. So one of the first steps should be to reduce those numbers.
Also the quads are not being clipped at the edge of the screen, so near the bottom of the screen the code is trying to draw more quads that have moved past the screen edges than quads that are actually visible! The code needs to be tweaked so that all drawing is clipped at the screen edges. That would increase speed many times.
Not sure when I will complete that, but when I do, I will include a frame counter that displays frames per second, and we can compare notes with Forum members with different devices. The ideal would be that every device would give smooth scrolling, but that could be difficult if we include the oldest iPhones and iPods still in use.
Compare that to the image that I just posted. It has 12 quads showing in each of the front two rows, and that number increases quickly for the rows farther away. There are 10 visible rows of quads. So one of the first steps should be to reduce those numbers.
Also the quads are not being clipped at the edge of the screen, so near the bottom of the screen the code is trying to draw more quads that have moved past the screen edges than quads that are actually visible! The code needs to be tweaked so that all drawing is clipped at the screen edges. That would increase speed many times.
Not sure when I will complete that, but when I do, I will include a frame counter that displays frames per second, and we can compare notes with Forum members with different devices. The ideal would be that every device would give smooth scrolling, but that could be difficult if we include the oldest iPhones and iPods still in use.
The only thing that gets me down is gravity...
-
- Posts: 167
- Joined: Wed Oct 22, 2014 3:26 pm
- My devices: iPhone 4 to 6+,iPad mini to iPad air 2
Re: Blazer scrolling grid project
Optimizing code for iPhone 6/6+ and newer is a good milestone marker. It's 3 years of cpu changes. If anyone has a legacy phone/device then they can reduce the draws to increase the frame rate. Right? 
Also, you're right about not showing the graphics outside the viewport. That should optimize the display speed a lot!

Also, you're right about not showing the graphics outside the viewport. That should optimize the display speed a lot!
