-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
What's the best way to store block states? #50
Comments
There is a dedicated thread for Blocks at the jMonkeyEngine forum. You can ask all your questions there. I don't quite understand the question, but I'll try to answer it generally. It's not a good idea to mix render data and business data together. In JME terms, it would be the same as storing game data on Spatials. If you want to add data to blocks, don't put this data in the Block class. Store the data and link it with the block id. The Block class is pure data. It has an id, type, shape, ... It contains the bare minimum info so Blocks know how to render this specific block. A block will always render in exactly the same way. Some blocks however have only differences in shapes, or models as you call it. A wedge block for example, actually has 4 different shapes. One shape facing north, east, south and west. Each shape is represented by a different block object ( For handling blocks, there is the Chunk class. A chunk is a way of organising and structuring block data. Internally it has optimizations for block data lookup etc. |
That makes sense. Thanks! |
This isn't an issue per se, but I don't really know where else to put this as there isn't a community forum for this project.
I'm trying to integrate this library into a pre-existing block data structure which has a feature where it can store arbitrary block data that may change the block's model. I've already written a basic adapter and I am not trying to store this data in the render blocks themselves, but I need a way of conforming this multi-model system into your single-model system at runtime.
How would you recommend doing this in a way that makes sense?
The text was updated successfully, but these errors were encountered: