Learning by doing - loading data from a database

Hi everyone,

This is my first post on this forum and I am still learning BabylonJS. I am loving it so far!! I usually learn best by building something challenging. It’s hard for me to focus on small boring tasks, I need a problem to solve. Of course, what I consider challenging is probably baby stuff for any average dev. So, I would like to just describe what I am building to get some feedback and see if it’s feasible with BabylonJS. Here goes…

I want to generate some terrain data using a server-side backend separately (something with some basic Perlin noise) and then feed this to BabylonJS to build the terrain. The terrain will be built on “blocks” with just the visible portion actually rendered. Sort of like Minecraft. The terrain will be editable too, again like Minecraft. I will be able to remove and place objects to the map and build. Later I will add some basic units that can move around as well. All the tutorials I’ve seen work from a perspective of building everything directly on BabylonJS, but I since my data here is coming from a backend which will be rendered by BabylonJS and manipulated (and continuously saved to the database) I am still figuring out how to begin.

thanks for your time, wish me luck!

1 Like

Hello and welcome!

I think you may try to use Dynamic Terrain | Babylon.js Documentation (or some ideas from it).
Basically every block may be in array or represent an object with some properties which you can save in SQL, for example, then use AJAX+PHP to communicate as needed (or it could be other languages).

1 Like