3D vs 2D which is better for Factorio?

Post all other topics which do not belong to any other category.
User avatar
MeduSalem
Smart Inserter
Smart Inserter
Posts: 1485
Joined: Sun Jun 08, 2014 8:13 pm
Contact:

Re: 3D vs 2D which is better for Factorio?

Post by MeduSalem »

In my opinion it would be better to leave it at 2D with sprites for the sake of sparing the GPU the additional work. Wouldn't be fun for anyone except some enthusiast gamers if the game all of a sudden required top-notch graphics cards just to be able to render a decent base in moderate zoom levels.


That said what the devs might still be able to do with additional effort is rotate the map grid by a fixed angle so that the X-axis (basically depth of objects) of the grid doesn't fall in place with the Z-axis (height of objects) and re-render the sprites according to the new projection.

Basically going from the Top-Down projection (Row 3, Column 3) to something like a Military projection (Row 3, Column 1) instead.
Graphical_projection_comparison.png
Graphical_projection_comparison.png (213.28 KiB) Viewed 5389 times
The angle between XY (map grid) would still stay 90°, but the angle between XZ could be anything BUT 180°.

That would alliviate a lot of the stupid train stretching-issue and give multiple times more the feeling of having a 3D projection.

Only thing is it would require re-rendering of the sprites for almost every object in the game.
Last edited by MeduSalem on Wed Jun 01, 2016 5:38 pm, edited 1 time in total.

raidho36
Long Handed Inserter
Long Handed Inserter
Posts: 93
Joined: Wed Jun 01, 2016 2:08 pm
Contact:

Re: 3D vs 2D which is better for Factorio?

Post by raidho36 »

It would also require rewriting an engine a bit to support non-axis-aligned grid. So might as well go with isometric projection which looks much nicer.

User avatar
MeduSalem
Smart Inserter
Smart Inserter
Posts: 1485
Joined: Sun Jun 08, 2014 8:13 pm
Contact:

Re: 3D vs 2D which is better for Factorio?

Post by MeduSalem »

raidho36 wrote:It would also require rewriting an engine a bit to support non-axis-aligned grid. So might as well go with isometric projection which looks much nicer.
Fun part is that engine internally everything could stay the same as it is currently with the grid still being calculated as if it was axis-aligned, the only part where the non-axis-aligned grid would come into play is when determining the location and visbility of sprites from the back to the front for the rendering process, which has to be done currently anyways.

But yeah, basically it could be an isometric projection as well then, the coordinate transformation from the axis-aligned grid to non-axis aligned grid would happen during the render process.

If isometric looks better is a matter of taste, probably it does for the common human eye though. It's just that I had several years of geometry classes back at college/university... and somehow I grew to like military projections more than isometric due to how the XY plane stays undistorted, which has several benefits in architectural/engineering drawings, like squares being squares and especially circles still being circles and not some bloody ugly ellipses. So that's why a military projection came into my mind first.

raidho36
Long Handed Inserter
Long Handed Inserter
Posts: 93
Joined: Wed Jun 01, 2016 2:08 pm
Contact:

Re: 3D vs 2D which is better for Factorio?

Post by raidho36 »

You just described non-axis aligned grid. In axis aligned grid, X maps to X and Y maps to Y. In non-axis aligned grid, they depend on one another via some formula.

Also, this game doesn't actually uses oblique projection, it uses regular axonometric orthogonal projection, hence objects are vertically shorter than horizontally. It's just the grid is rectangular, which as you know, causes a lot of issues due to that mismatch.

TheWesDude
Inserter
Inserter
Posts: 25
Joined: Tue Mar 29, 2016 5:15 pm
Contact:

Re: 3D vs 2D which is better for Factorio?

Post by TheWesDude »

great, invasion of the "3D is superior!" crew.

here is the truth. it is similar to the AI issue games have.

3D is not inherently superior to 2D/Sprite based graphics. it is actually inferior in resource use/allocation.

Sprites just require a few "pictures" of the object which can be swapped out as needed. going 3D would require a fully textured wire-frame mesh of every object even if you only draw part of the object every pass. it would kill the ability for most laptops to run it unless they are gaming laptops.

there is a reason why you do not find many fully 3D games with thousands of entities on the screen at once, it would be impossible for the hardware to support it. Hollywood manages to do their huge CGI with hundreds of objects on the screen fully rendered in 3D, the difference is they use basically super-computers processing it and generating the image or iterate through the scripted scene over long periods of time on very beefy computers. your home computer could not handle it, let alone in anything resembling real-time.

3D is vastly inferior to 2D in resource use and allocation. the only benefit is it looks realistic in first person as motion is more fluid.

raidho36
Long Handed Inserter
Long Handed Inserter
Posts: 93
Joined: Wed Jun 01, 2016 2:08 pm
Contact:

Re: 3D vs 2D which is better for Factorio?

Post by raidho36 »

No need to be condescending.

While 2d can be made to represent game world very nicely, 3d is "superior" because it's default for the real world, and 2d representation of 3d world is only an approximation with plenty of limitations. This particular game is made in a way that it would be more naturally fit with 3d graphics than 2d, i.e. it has rotating objects and it's not a purely top-down view projection.

3d graphics can be more difficult to optimize, but essentially, the only big difference is number of vertices you're using - with sprites you use 4 per sprite, with 3d models that could be anywhere between 3 and several thousand. As I pointed out in another thread, if you use LODs and vertexbuffer cleverly, you can render huge amounts of objects in 3d at high framerates.

Don't get wrong impression that 2d graphics poses no challenge to GPUs: Factorio is already nearing the point where the amount of video memory it would be consuming goes off the charts and lower end GPUs may not handle that much - with animated sprites, with multiple copies of all animations rendered from different angles, it's quickly getting out of hand. With 3d graphics memory isn't nearly as big a challenge, but performance - is.

Shokubai
Filter Inserter
Filter Inserter
Posts: 470
Joined: Mon May 02, 2016 3:17 pm
Contact:

Re: 3D vs 2D which is better for Factorio?

Post by Shokubai »

MeduSalem wrote:In my opinion it would be better to leave it at 2D with sprites for the sake of sparing the GPU the additional work. Wouldn't be fun for anyone except some enthusiast gamers if the game all of a sudden required top-notch graphics cards just to be able to render a decent base in moderate zoom levels.

This is not easy to quantify in terms of performance.

Sprites will use less(if any) GPU capability while Polygons will use most. You are adding a layer of hardware requirement. The additional work mentioned above is not really additional so much as using idle capability. It's like your GPU has 10 arms. Right now it's using like two(granted heavily). 3D polygons may use all 10 but the work will be distributed more efficiently.

Most modern GPU will handle millions of polygons easily. In a world like factory where polygon counts would likely be low per object due to the lack of object complexity, I could actually see the existing game in 3D as a performance boost on my own rig.
Last edited by Shokubai on Wed Jun 01, 2016 7:27 pm, edited 1 time in total.

raidho36
Long Handed Inserter
Long Handed Inserter
Posts: 93
Joined: Wed Jun 01, 2016 2:08 pm
Contact:

Re: 3D vs 2D which is better for Factorio?

Post by raidho36 »

No, you see, the sprites are actually rendered as 3d quadrilateral polygons. For each sprite, there are 4 vertices and 2 triangles, all in 3d. The "2d mode" is achieved by discarding one of coordinates by defaulting it to 0 everywhere, disabling depth testing and enabling render blending. It's still 3d essentially, just with a bunch of settings tweaked. It's not faster than "real" 3d, in fact blending makes it a little slower.
Last edited by raidho36 on Wed Jun 01, 2016 7:26 pm, edited 1 time in total.

boksiora
Fast Inserter
Fast Inserter
Posts: 108
Joined: Thu Mar 10, 2016 7:45 pm
Contact:

Re: 3D vs 2D which is better for Factorio?

Post by boksiora »

I think the game will lose all its charm if its made on 3d


I like the current graphics a lot and they bring big uniqueness to the game

Also modding a 3d game is a lot harder and the casual modder will have problems with making graphics

:cry: pls stick to 2d

User avatar
MeduSalem
Smart Inserter
Smart Inserter
Posts: 1485
Joined: Sun Jun 08, 2014 8:13 pm
Contact:

Re: 3D vs 2D which is better for Factorio?

Post by MeduSalem »

raidho36 wrote:Also, this game doesn't actually uses oblique projection, it uses regular axonometric orthogonal projection, hence objects are vertically shorter than horizontally. It's just the grid is rectangular, which as you know, causes a lot of issues due to that mismatch.
Factorio tries to use an oblique projection. In axonometric projections (which oblique projections are a special case of) objects always become vertically shorter than horizontally due to foreshortening, but the amount is relative. If the projection an object casts is longer or shorter depends on the angle at which the observer looks down at the XY plane (in this case) and the thereby caused foreshortening of values in Z-axis.

But this happens additionally to the depth objects have in X-axis which also happens to fall into the same axis as the Z-axis lies in the special case of top-down oblique projections, which is the fundamental reason for why it looks that weird. It's basically converging from one orthographic projection (top-down/plan) to the other (front/elevation).

Long story short... The effect of things becoming shorter/longer is the summed up effect of X-depth + Z-foreshortening * Z-height, while Y-width remains as it is, which looks weird in certain situations, especially when converging from one extreme to the other (meaning X-depth becoming Y-width and vice versa).
extension
With other words: Don't use this special case of projection and rather have one where the Zf*Zh influence is equally distrubed between both the X and Y axis!



So... for almost all objects in Factorio the devs choose to have a view point angle resulting in a corresponding Z-foreshortening value that feels okay for the most part, since these objects never change their XY orientation.

But for trains the fundamental flaw of this special projection becomes obvious because they felt that even with the foreshortening value that feels allright for everything that is "static" the trains on the other hand change their shape too much when transforming from horizontal to vertical movement (X becomes Y and vice versa = weird situation desrcibed above) and no matter the amount of fiddling with the Z-foreshortening it can't be solved.

So what they did there instead is a cheat with something or a combination of the following:
  1. They used another view point angle for train sprites than for all other objects, one that results in even more Z-foreshortening, uncoupling the sprite from the XY plane all other objects lie in
  2. Compressing the actual length of the original object in X-depth before applying the actual projection (which is my bet)
Both of which would cause the mismatch with the grid for the sake of "aesthetic" appeal. So trains are the ones using a bastard-projection defying all rules, as if Top-Down Oblique wouldn't be already ugly enough. For me the projection the trains are using is the Ramsay Bolton of Factorio. *shudder* :lol:

That said I have to give the devs a lot of credit that they had the endurance to stand through these train related problems attached to the projection they chose. I would have probably fundamentally changed the projection to military or isometric/dimetric and re-rendered the sprites a long time ago just because I can't stand the thought of the "unclean" workarounds necessary.

Which is why I am already curious how the "fixed" solution will look like with 0.13


Shokubai wrote:This is not easy to quantify in terms of performance.

Sprites will use less(if any) GPU capability while Polygons will use most. You are adding a layer of hardware requirement. The additional work mentioned above is not really additional so much as using idle capability. It's like your GPU has 10 arms. Right now it's using like two(granted heavily). 3D polygons may use all 10 but the work will be distributed more efficiently.

Most modern GPU will handle millions of polygons easily. In a world like factory where polygon counts would likely be low per object due to the lack of object complexity, I could actually see the existing game in 3D as a performance boost on my own rig.
I am no GPU expert and don't claim to be, but since the unified shader stuff aren't shaders using basically the same functional units within the GPU to do everything? Wouldn't that mean if you start calculating polygons as intermediate step you take away possible hardware resources to do pixel calculation (which are probably necessary for textures or sprites), meaning that there actually is no real "idle" capability, just how you spend these units among geometry/vertex/pixel shaders?

But that set apart I still wouldn't like it if Factorio starts clogging the GPU with 80-90% workload due to polygons when a similar appealing game using sprites only uses like 30-40% of the GPU. It wears hardware off a lot faster.

For 3D shooters 90% workload on the GPU might be fine because I am only playing stuff like Doom for a couple of hours before shelving it, but running Factorio with 90% workload for 1000 hours and more the GPU fan bearing wouldn't be that happy, neither would be the circuitry with these 90°C grills nowadays... and I lost several graphic cards already that way back in the golden days. Last time with Crysis on my GTX 570 which were notoriously hot... it overheated just for a fraction of a second and it never really recovered from there on (though it took almost 2 more years to finally die off because of the damage done to the circuitry). One tiny fluctuation in air flow and your GPU spills out rainbow colors all over the screen for the rest of its life. Not worth it.

And fun part is... I am now back to a GTS 250 which is just fine for Factorio, probably because it is only using sprites. Probably wouldn't be able to do that if it was 3D based with polygons.

raidho36
Long Handed Inserter
Long Handed Inserter
Posts: 93
Joined: Wed Jun 01, 2016 2:08 pm
Contact:

Re: 3D vs 2D which is better for Factorio?

Post by raidho36 »

I just fired up Unity and generated a scene with 2.5 million vertices and 1.5 million polygons in 3000 draw calls, and it ran at 70 fps on my AMD R9 280 on Linux. It could run a lot more polygons than that since evidently CPU was bottlenecking the GPU with the absolutely obscene number of draw calls - you should be able to draw a busy Factorio scene fully zoomed out in a hundred of calls or so. So I really think you guys massively exaggerate the possible impact of using 3d graphics. I mean you already do use 2 polygons and 4 vertices per sprite and it runs at huge framerates, pretty sure if you increase that by factor of 2 or 3 the GPU wouldn't suddenly struggle to render all of that.

Muchaszewski
Inserter
Inserter
Posts: 23
Joined: Wed Nov 13, 2013 11:17 am
Contact:

Re: 3D vs 2D which is better for Factorio?

Post by Muchaszewski »

The problem is not with 3D alone. But how detailed you would like to see models. If you would like to keep "current" models from factorio. Probably game would have 100x-1000x bigger constrains on GPU, add to this lighting particles, postprocess etc... Also games in 3D gets old pretty quick. Try to play any game from 2010 (except Crysis :P). Litteraly unplayable due to graphics. 2D will not old so fast since, they can use fancy models that would not be able to run on most PC for next decades and compressed to 2D will look awsome for this next decade or even longer ;) Until there will be revolution in 2D rendering somehow, like vector graphics instead of rasetr.
In game Lotny

User avatar
Tongs
Inserter
Inserter
Posts: 31
Joined: Wed Jul 06, 2016 9:22 pm
Contact:

Re: 3D vs 2D which is better for Factorio?

Post by Tongs »

Factorio looks great in 2D, and the developers are not going to change that.

Just because we have GPUs that can render amazing 3D scenes does not mean every game needs 3D. We still have sidescroller games in the modern era of 3D graphics, why not appreciate the game for what it is?

Personally I think the game looks great. It has an old-school charm to it while using the full 1920x1080 of my monitor. I couldn't ask for more.

Factorio team: keep up the great work!

Post Reply

Return to “General discussion”