Marco Diaz - Mapping out Maps
Heyo! Marco here. As mentioned in an earlier post I’m more on the technical end of things for this project, and id like to talk a bit about one of our newest systems, the map!
every good piece of code starts with a plan! Having a good goal in mind and knowing how you intend to execute it is important. Rarely do I start programming without already having a solution in mind (and I regret it whenever I do!).
Our map is a stellar map of all the visitable areas near our ship. Its 3 dimensional, like a holographic table. Our current location will be the center of the map, and clicking on one of the points will take us there.So, there’s the goal, have a rectangular volume populated with randomly placed points that pan when we choose a new destination, giving the effect of traveling through some larger space.
Now for figuring out how it should be executed. The idea I came up with is to divide space into cubic cells, each cell containing one star randomly placed inside. This will keep the distribution relatively even while randomly placing them in 3D space. Additionally, now I only need to generate and keep track of these cells which exist on a perfect grid, indexing them by their coordinate position, and shifting them with the points inside when panning the map.
Solid plan, time to execute!
I’ve already done 3D chunk generation before for another project, so ill be reusing that for generating the cells.
This is the chunk gen I’m reusing. Chunks are generated around a given point and unloaded when outside of range. I can reuse this logic to generate the map cells.
Here I’m generating new cells ahead of the panning direction of the map volume. Grey cells are unloaded, blue are ready, and the points only render when inside of the map volume.
Final step is making the points clickable and pan the view to center the clicked point.
And there it is! Not as pretty as it will eventually be, but fully functional. :)
Get Just Space Things
Just Space Things
Space Pod Game
Status | In development |
Authors | Coldest Bean, LVL, TCog, jespobuiz09, Marco Diaz, vaeloops |
Genre | Simulation |
More posts
- LAUNCH!1 day ago
- Marco Diaz - Assets planning and integration21 days ago
- Elora VanderWal - Narrative - Jan2576 days ago
- Jack McLoughlin - Managing Sprints and Prototypes78 days ago
- Devlog 6 - World (Galaxy) Building Document 1.0Dec 10, 2024
- Devlog 5 - Crafting the Space(ship)Dec 06, 2024
- Devlog 4 - Julian DevlogDec 03, 2024
- Devlog 3Nov 22, 2024
Leave a comment
Log in with itch.io to leave a comment.