Page 1 of 3

Friday Facts #333 - Terrain scrolling

Posted: Fri Feb 07, 2020 5:16 pm
by FactorioBot

Re: Friday Facts #333 - Terrain scrolling

Posted: Fri Feb 07, 2020 5:23 pm
by Filter62
That's why I respect you guys and believe you will do everything right! Keep up the good work. :mrgreen:

Re: Friday Facts #333 - Terrain scrolling

Posted: Fri Feb 07, 2020 5:23 pm
by Gergely
Reminds me of this: YouTube: The NES's Loading Seam.

Optimization on this level is not necessary today, but it was back then.

Re: Friday Facts #333 - Terrain scrolling

Posted: Fri Feb 07, 2020 5:24 pm
by Vornicus
This is how the NES did it! this way scrolling only took writing like 80 bytes per frame at most instead of a whole kilobyte.

Re: Friday Facts #333 - Terrain scrolling

Posted: Fri Feb 07, 2020 5:25 pm
by MakeItGraphic
Intel 4400 here ^_^ much appreciated.

Re: Friday Facts #333 - Terrain scrolling

Posted: Fri Feb 07, 2020 5:26 pm
by malventano
I think the only 'big' graphical thing left in need of optimization is when zooming out map view on larger bases - it noticeably slows the game even on the fastest of systems.

Re: Friday Facts #333 - Terrain scrolling

Posted: Fri Feb 07, 2020 5:29 pm
by cappie
You guys keep amazing me with the intricacies of game development.. I love these Friday Facts and wish EVERY developer would write them; I absolutely love them.. also, these optimizations is exactly why Factorio has been my #1 game for the last few years..

Do you have an updated unit test video? I'd love to see one updated to 0.18.x ... the older ones you have on YouTube were AMAZEBALLS.. I love the fact that you're doing tests like these; it's the reason why Factorio is unequivocally one of the best if not THE BEST QUALITY GAME I've ever played!

Re: Friday Facts #333 - Terrain scrolling

Posted: Fri Feb 07, 2020 5:32 pm
by 1234tv
Sounds like my Surface Pro 3 will do better now. The power limit has been the problem in the past as it favored the GPU over the CPU. Rendering was done in no time but the CPU had no power budget left to run the simulation.
While it managed 60 UPS in the map view of a 1k spm base it dropped to about 25 while playing. Just shows how insanely optimized the game is (and you are still improving it!).

Re: Friday Facts #333 - Terrain scrolling

Posted: Fri Feb 07, 2020 5:35 pm
by Gergely
posila wrote:People see a 2D game and expect to be able to play it on essentially anything.
I wish this was the case. I saw my fair share of 2D games that don't even justify being on a game engine and yet the computer fans go loud when I start them.

Re: Friday Facts #333 - Terrain scrolling

Posted: Fri Feb 07, 2020 5:36 pm
by netmand
I went in for 20 minutes last night and was greeted with this update... which broke my experience. Boohoo now I have to troubleshoot my setup.

Re: Friday Facts #333 - Terrain scrolling

Posted: Fri Feb 07, 2020 5:43 pm
by plepper1
Awesome!

Which release did/will this make it into?

Re: Friday Facts #333 - Terrain scrolling

Posted: Fri Feb 07, 2020 5:46 pm
by Rebmes
Going in the right direction ^^

Re: Friday Facts #333 - Terrain scrolling

Posted: Fri Feb 07, 2020 6:01 pm
by movax20h
Out of curiosity what time do you see when you disable the caching and use high end GPU and CPU for the test? I can imaging it will be unusable, but was wondering for comparison.

Re: Friday Facts #333 - Terrain scrolling

Posted: Fri Feb 07, 2020 6:05 pm
by abnessor
Thanks you!
I self use terrain caching lot of times (in my small game projects) and think about it like single and fastest solution, but now i have easy and faster solution.

And one more case i using this(my optimization, and now plan to add new optimization) with canvas html5 render, and some time it's kill performance on integrated gpu with specific drivers.

As additional optimization i use larger buffer than screen, and redraw missing parts only when touch border with recenter image. It's give delays only every ~30 frames while fast moving instead of every frame.

I think with that technique and bigger cache buffer it give way to write simple games with canvas and w/o hardware acceleration.

Re: Friday Facts #333 - Terrain scrolling

Posted: Fri Feb 07, 2020 6:31 pm
by Hiladdar
Yes, I like it, and hope to see more of this.

This is also why it is important to stress test the game not just on optimum gaming systems, but also on legacy setups. My expectation of a legacy system is something that was considered upper range about 5 years ago. I do not expect performance to be flawless like on a contemporary, but with most of the processing intensive stuff turned off, playable.

Hiladdar

Re: Friday Facts #333 - Terrain scrolling

Posted: Fri Feb 07, 2020 6:51 pm
by DerGraue
The only thing I don't quite understand: Why don't you tell us such amazing things in the patch notes?

Re: Friday Facts #333 - Terrain scrolling

Posted: Fri Feb 07, 2020 7:13 pm
by TOGoS
Neat. Back in the 90s (when I first started trying to program games) cutting down the number of pixels drawn to the screen was super important, so basically every attempt to write games started with me writing a class that figured out which parts needed to be updated, and leaving everything else alone (and I didn't even attempt to implement scrolling most of the time). Otherwise things would chug along at a couple of frames per second, at best. When I first played Doom I was amazed not at the 3D nature of it, but that they were somehow managing to rewrite 50000 pixels every second! I suppose John Carmack had figured out a quicker way to poke stuff into video memory than I knew about.

Anyway, having a mostly-static back buffer is still a useful trick if you're doing software rendering of any kind, especially if you're doing it in Java[Script] or something where who knows how many function calls and bounds checks get involved just to move an int around. Or if your scene is just really complicated with a bajillion decals scattered all over.

Re: Friday Facts #333 - Terrain scrolling

Posted: Fri Feb 07, 2020 7:28 pm
by torham
Gergely wrote: Fri Feb 07, 2020 5:35 pm
posila wrote:People see a 2D game and expect to be able to play it on essentially anything.
I wish this was the case. I saw my fair share of 2D games that don't even justify being on a game engine and yet the computer fans go loud when I start them.
Rise to Ruins. You can hardly call it even a pixel art, and yet it struggled on my AMD 8 core 4.4 GHz + Nvidia gtx 970. I really couldn't figure out how it is so badly written...

Re: Friday Facts #333 - Terrain scrolling

Posted: Fri Feb 07, 2020 7:30 pm
by KatherineOfSky
Thank you so much for this optimization! I've heard from so many people with self-described "potato" computers who are so happy they can play Factorio on their systems. This update is VERY much appreciated! <3

Re: Friday Facts #333 - Terrain scrolling

Posted: Fri Feb 07, 2020 7:38 pm
by PaszaVonPomiot
As a GTX 1070 user I say "Well done sir!". Every optimisation counts in this kind of game to be accessible to the widest audience.
I would like to go back to previous FFF where we discussed new sounds and there were many critical voices. Would you mind commenting on that?