Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reconsider the default value of FlxCamera.pixelPerfectRender on native targets #1065

Closed
Gama11 opened this issue May 10, 2014 · 12 comments
Closed

Comments

@Gama11
Copy link
Member

Gama11 commented May 10, 2014

Currently, it's true by default on all targets for the sake of consistency. However, in most cases, pixelPerfectRender == false yields better (smoother) results on native targets at practically no performance loss. On flash however, true is necessary as a default setting for the added performance (although it seems surprisingly usable to have it set to false in Mode).

I'm thinking it might make sense to make the default depend on the render mode. Things can't be totally consistent cross-platform, sometimes it makes sense to choose the best setting based on the target - see the special logic in FlxButton for no highlight frames + swiping on mobile.

pixelPerfectRender:Bool = #if FLX_RENDER_TILE false #else true #end

For people who want to use pixel perfect rendering on native (pixel-art games etc), this would still be easy to accomplish due to the new global camera flag.

cc @gamedevsam @PaulGene @cwkx @schonstal

@AndreiRegiani
Copy link
Contributor

By my observations, the best configuration for low-res (pixel) games are: (HaxeFlixel default)

pixelPerfectRender = true
fixedTimestep = true
camera.antialiasing = false

For high-res games, this works much better:

pixelPerfectRender = false
fixedTimestep = false
camera.antialiasing = true

@SeiferTim
Copy link
Member

Are these typically always used in tandem?
Except in rare circumstances, would most people either do all of these:
pixelPerfectRender = true fixedTimestep = true camera.antialiasing = false
Or all of these:
pixelPerfectRender = false fixedTimestep = false camera.antialiasing = true
Meaning, in the FlxGame constructor, we could add an optional (or not optional) parameter like useHighResRendering which, if true, sets the second group, and if false will use the first group?

@cwkx
Copy link

cwkx commented May 11, 2014

Managing this stuff with a global camera flag is fine, as long as it's easy to do, and well-documented for new users to select their preferences based on their game type, as Andrei proposed.

@Gama11
Copy link
Member Author

Gama11 commented May 23, 2014

I'm not sure fixedTimestep is really connected to high res games. It's more related to whether or not the game depends on physics and / or has to be deterministic.

Closing this, as nobody really seemed in favor of changing the current default.

@Gama11 Gama11 closed this as completed May 23, 2014
@AndreiRegiani
Copy link
Contributor

I am really in favor to change the current default.

Recent forum post: https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!msg/haxeflixel/Gcw-oxL09T8/jgm5GRaofAIJ
coin_comparison

Anyone developing anything serious will change these values, modern game engines uses the same:

fixedTimestep = false               // "delta time" animations
camera.antialiasing = true
pixelPerfectRender = false

@Gama11
fixedTimestep is connected with his res games because it gives much better results.

To grow the user base, this project should be more appealing for commercial development (high-res), not for "game jam pixels".

@gamedevsam
Copy link
Contributor

I am also in favor of changing pixel perfect rendering value. Especially for targets that use tilesheet rendering.

@sruloart
Copy link
Contributor

Why not set a "FlxG.render = PixelArt"? This way all the settings are pre(-ish) configured.

@Gama11
Copy link
Member Author

Gama11 commented Aug 25, 2014

@AndreiRegiani That's simply not true, a variable timestep doesn't always give better results. If you rely on deterministic phyiscs, a fixed timestep is usually preferable. I don't see how this is related to the art style. Article on timesteps.

Also... "Anyone developing anything serious"? It's not possible to use pixel art for "serious" development then? :P

@gamedevsam There's no "especially" here, not using pixelPerfectRender = false; is too expensive when using blitting to be the default.

@sruloart
Copy link
Contributor

  1. "A variable timestep doesn't always give better results" = you're right, it has little to do with art, what they probably mean is that their games seem to run "better" without it, which in some cases may be true, from totally different reasons. Anyhow I wouldn't make it a part of the "HD" mode anyhow.
  2. Shovel Knight! Pixel-art dev is as serious as gamedev can be, but the fact is that it's only one specific type of gamedev. There are others. Just saying :)

@gamedevsam
Copy link
Contributor

@Gama11: I understand, so why not make pixelPerfectRender false by default for tilesheet rendering and true for blitting? I'm not a fan of changing the timestep default.

@AndreiRegiani
Copy link
Contributor

@Gama11 It's not related to the art style, by "pixel art" I meant low-resolution, example: 256 x 240 with zoom (2x), in this case antialiasing must be off and fixedTimestep false, this is the typical Flixel game.

@Gama11 Gama11 reopened this Jun 21, 2015
@Gama11 Gama11 closed this as completed in 7a3f128 Jun 21, 2015
@Gama11
Copy link
Member Author

Gama11 commented Jun 23, 2015

@JoeCreates Since pixelPerfectRender now defaults to false with FLX_RENDER_TILE, should pixelPerfectPosition default to false as well?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants