Comments (3)
Hey @ASGAlex, I ended up writting my own very basic spatial grid system (just grid mapping and some basic grid state management). But anyway, I'm just making some tests for a possible personal game code base.
I'll try to tweak those parameters as suggested as soon as I have an opportunity to do so.
Thanks for the tips!
from flame_spatial_grid.
This is expected behavior because you player leaves preloaded game field and triggers creating new cells with (probably) new components inside. Than more components you will have inside than longer the game will freeze.
I try eventually optimize the process but anyway it is blocking by-design, especially with single-threaded language like Dart =(
To avoid stutter in your game you should play with grid parameters:
- cellSize: should not be too big but maybe it is better to make it 10 times bigger than your average component size;
- activeRadius, unloadRadius, preloadRadius - to find balanced combination of active vs pre-build cells
- processCellsLimitToPauseEngine - if you need sometimes to build very large field of cells
- buildCellsPerUpdate / cleanupCellsPerUpdate
You can read details in initializeSpatialGrid
dartdoc, and play with parameters to find which fits with your game conditions.
Also, keep in mind that debug overlay is completelly unoptimized, so keeping it constantly enabled will cause a heavy FPS drop. But you can toggle it in runtime.
from flame_spatial_grid.
@daniel-mf did you found a solution for your case?
For your example it is only necessary to change processCellsLimitToPauseEngine
to larger value (default is 5) to prevent engine pausing while building new cells. But in games with complex logic it may become a reason of bugs. In this cause it become better to pause whole game during loading.
from flame_spatial_grid.
Related Issues (2)
- Cannot add JoystickComponent HOT 11
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 flame_spatial_grid.