Comments (8)
I think that the main problem with the drawing is that you are drawing everything at once. Even if its as efficient as possible you are still drawing millions of blocks, I had this problems with my game where the problems isn't the function itself it only took about 0.001 seconds, but rather the amount of times the function needed to happen. I don't know if its possible, but you don't technically have to draw everything at once you could just do it asynchronous by drawing 100 blocks every frame or something. If you unblock the main thread you realise that there was no performance problem in the first place.
from gaea.
That makes sense though! I've never worked with threads so I'll have to look into it but that sounds better than implementing a chunk system for generators that don't need it (I'd prefer chunking to be only used for infinite worlds rather than static ones).
from gaea.
Should we close this now that #29 was merged?
from gaea.
This is the result I got when generating a 1750x900 world in the heightmap_demo
scene. I used Time.get_ticks_msec()
to measure time
It seems like most of the time is spent on the _draw_tiles
function, which is hard to optimize any further. I believe chunking can help in this case. It would be easier to draw the terrain in chunks instead of drawing it all at once but the solution may end up adding a slight overhead so it might take longer than 25s(324 in my case) to generate but at least it would be a smoother experience
from gaea.
Hi! Thanks for checking it out.
Yeah, I suspected it was _draw_tiles
. It's really slow, ESPECIALLY if you use terrains. I think chunking would be the best solution, but should we add chunking to all generators or just this one? As far as I've seen, they're all pretty slow with a large world size.
from gaea.
Since all the generators will benefit from chunking, we should add chunking to the GaeaGenerator
class. And for fine tuning, properties like chunk size could be exposed in the editor
from gaea.
Yeah that sounds like the right idea!
from gaea.
I did give this some thought, but in the end it seems like a chunk system will be implemented anyway so I don't think we need to make any optimization here. But if needed I support moving the tile rendering to another thread
from gaea.
Related Issues (20)
- Can't generate tilemaps with heightmaps HOT 2
- Publish Gaea to Godot Asset Library HOT 1
- extra collisions beside collidable tiles HOT 5
- [NoiseGenerator] Render different tiles to different Tilemaps HOT 1
- Biome Modifier for Overworld map generation. HOT 1
- Flickering issue when viewing preview HOT 1
- Heightmap chunk-generation issue HOT 1
- Better tutorials (especially for 2D terraria-like worlds) HOT 5
- No generate button
- ChunkLoader3D causes "Out of bounds get index '0'" error when "load_on_ready" is set to true and generator's "infinite" setting is set to false. HOT 3
- add tutorials generation and documentation for 3D mode
- Combine multiple noises to e.g. build biomes HOT 1
- Error in noise_generator.gd when using ThreadedChunkLoader2D HOT 5
- I'm curious, how optimised is gaea HOT 4
- Error adding a WalkerGenerator to the scene HOT 1
- Autotile Issue HOT 1
- Update to Godot 4.3 (TileMapLayer) HOT 3
- Missing parameters in signals HOT 2
- Handle Hexagon-based tilemaps HOT 7
- Broken link on github pages HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gaea.