I know that I’m going to seriously struggle to word this eloquently, given how the title makes negative sense, so bear with me a moment.
I’m currently working on the backend of a factory game (think Factorio/Satisfactory/Dyson Sphere Program kind of games) and part of it is as follows:
- the locations of mineable ores are randomly generated in 32x32 stud chunks (equivalent to 16x16 in-game tiles)
- the user will be able to tell what material is in a chunk, if any, by standing in it, which will come up on their HUD somewhere
- if the user places a mining machine in a chunk, it will mine the material in that chunk, or Stone if the chunk has no material
- these mining machines would over time drain the resources in that chunk, and after about 100k of that material has been mined mining machines in the area will no longer work and have to be picked up
- I want to do this without having a part in every 32x32 chunk that determines the material because that’d be stupid
- I doubt gameplay area will ever expand 2048 studs from origin in any direction so there’s the upper bounds of where ore chunks will be generated
I’m imagining that this would be doable with attaching each chunk to a set of co-ordinates in-world, with the scripts comparing the location of the Torso or a part of the mining machine with these co-ordinates to determine the chunk they’re in, but this brings up another issue - I want the game to remember where the randomly generated ores are in, and for multiple - so a string seed that determines ore position somehow seems like the best bet, which can be stored in the base folder and saved with the rest of the base, with some kind of conversion script to turn the seed into the location data that is required.
However, having the string have a character for every chunk feels like a non-option, as 4,096 characters seems rather excessive and quite truthfully I’m not even sure ROBLOX would be able to handle that.
So how would I go about implementing this, or is there a better way to do this that I can’t think of?