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

Simplification of fire drawtype #655

Closed
paramat opened this issue Aug 30, 2015 · 13 comments
Closed

Simplification of fire drawtype #655

paramat opened this issue Aug 30, 2015 · 13 comments

Comments

@paramat
Copy link
Contributor

paramat commented Aug 30, 2015

screenshot_20150826_232131

Working on the fire mod i noticed a huge drop in FPS when viewing a forest fire, by far the largest FPS drop i have ever seen in MInetest. The fire drawtype has up to 10 textures displayed, most of the time 6 are displayed: 4 edges and the 2 in a central X shape. Perhaps it is the number of textures used combined with them being animated which is causing the FPS drop?

FIre is usually viewed more from the side than from the top, with 6 textures the effect is extremely dense, i feel the central 2 are not really needed.

There are 4 textures placed against the base of a node, seems overkill for the purpose, perhaps these could be simplified to just 1 that is level and placed a small distance under the node? This texture could be a different texture designed for the purpose, having flames spreading outwards from the centre.

@est31
Copy link
Contributor

est31 commented Aug 30, 2015

Perhaps we should have opaque fire, just like opaque leaves.

@est31
Copy link
Contributor

est31 commented Aug 31, 2015

This is an engine bug, if you complain about the firelike drawtype. But making it be the same as plantllike is a bit pointless, so you could switch to plantlike if you prefer that. Then its no engine bug :)

@paramat
Copy link
Contributor Author

paramat commented Sep 1, 2015

Hm perhaps a 'simple fire' setting in conf that selects plantlike.

@paramat
Copy link
Contributor Author

paramat commented Sep 10, 2015

Testing again i don't get such a large drop in FPS as i did before, however i do find the firelike drawtype too dense and overkill, so might open an engine PR to simplify it by removing the 2 central textures.

@Amaz1
Copy link
Contributor

Amaz1 commented Sep 10, 2015

Testing again i don't get such a large drop in FPS as i did before, however i do find the firelike drawtype too dense and overkill, so might open an engine PR to simplify it by removing the 2 central textures.

If you do this, would you be able to make it a setting please? I like firelike as it is now...

@est31
Copy link
Contributor

est31 commented Sep 10, 2015

Might be a good idea, I would change it in my local installation as well.

@paramat
Copy link
Contributor Author

paramat commented Sep 11, 2015

There's not much difference when removing the central 2, it still has a reasonable density especially when viewed from the side. Currently it's so dense it looks like a random mess and therefore out of character, Minetest's visual style is simple geometric structures.

Working on it last night i realised it has a problem, there are 10 drawtype textures within a limit of 6. The lower 6 flames have priority so some of the top 4 flames are often missing depending on which of the 4 lower side flames are used. Removing the central lower 2 allows up to 2 independant textures for use as top flame textures, these will always appear as the burning underside of the node above.

So it was over-engineered and buggy, i managed to reduce textures from 10 to 5, and further simplified the code, now the code is more than twice as lightweight while also being more effective at doing what firelike was meant to do.

@est31
Copy link
Contributor

est31 commented Sep 12, 2015

What load did you precisely remove? Note that with your changes to fire, there aren't any forest fires anymore, because fire just almost doesn't spread anymore, so no low FPS to be worried about. Also, this is an engine discussion, can you open an engine issue, so that we can discuss this there instead?

Fire is dense, and it is a random mess. That's what fire is, period. If you view fire from angles like 45°, you do notice the missing faces. actually the best idea would be to have a particle spawner here, which spawns "fire" particles. Then, if it still looks acceptable, we can remove those two textures.

@est31
Copy link
Contributor

est31 commented Sep 12, 2015

Minetest is messy, e.g. in the mapgen. Here we neither have "simple" shapes, but rather have an elaborate landscape, with lots of features. It isn't messy everywhere, but at some places you need "mess", so that it doesn't look boring. And right now, fire is one of the exciting nodes of minetest (ore blocks were as well, until pr 548 made them ugly).

@paramat
Copy link
Contributor Author

paramat commented Sep 12, 2015

PR here minetest/minetest#3171

Note that with your changes to fire, there aren't any forest fires anymore, because fire just almost doesn't spread anymore

If you try it you'll see this is not correct, my recent PR doubled the speed of fire spread, i agree it was too slow for 0.4.13 but that was because the code was so heavy. Spread is exponential so starts slow and speeds up, once a whole tree is on fire it spreads fast enough.

Fire is dense, and it is a random mess.

Yes sure in reality, but this is Minetest, everything is abstracted and simplified, and not over-engineered. The firelike drawtype looks more suitable for an RBA fork.

Particles for fire would be way too heavy for any large fire, particles are currently heavy in Minetest, besides this is overkill when an animated texture is fine.

Minetest is not messy on a small scale, the nodes and drawtypes themselves are very simple.

Firelike is currently very pretty yes, but over-complex and overly concerned with eye-candy instead of simplicity and being lightweight. Those 6 lower textures break the top 4 so we have to reduce the number. Many players are complaining of low FPS caused by fire.

@est31
Copy link
Contributor

est31 commented Sep 12, 2015

Honestly I can't notice an FPS drop caused by fire:
screenshot_20150912_050150
screenshot_20150912_050202

@paramat
Copy link
Contributor Author

paramat commented Sep 12, 2015

With a large forest fire, much larger than above, i noticed a 10 FPS drop.

@paramat
Copy link
Contributor Author

paramat commented Sep 12, 2015

Closing for reasons given in the PR minetest/minetest#3171

@paramat paramat closed this as completed Sep 12, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants