We are about to switch to a new forum software. Until then we have removed the registration on this forum.
I have been working on how to code my AI project, but keep running into memory limitations. Even with 64GB or RAM and a 4GB video card, I keep getting Out of Memory heap errors. I have modified my JVM settings and watch the resource usage. I am using all 63Gb or available memory. My PShape model when put into video memory only takes in a small percentage of the video RAM. The problem to the best of my knowledge is the creation of the hierarchical PShape World. The largest that I can get is about 40X40X40 brain cells, whereas I need 1K X 1K X 1K, but the memory requirements are virtually unobtainable in the near real world future.
Are there examples or Best Practices on using large worlds with many many objects?
As you can see from the image, there are 64000 cells in the object, but only ~1000 being viewed, how do I work on only those in a certain area or group?
Can all of the objects be stored in a database that is manipulated by Processing?
I have seen some stuff on unfolding, but do not understand it.
Any pointers to best practices or tutorials would be much appreciated.
Answers
What are you going to do with this? And do you always have this frontal view or is it possible to move around with a camera?
Sorry, this is all within a PeasyCam world. I am able to rotate, zoom into the brain and select individual cells in order to view the cell characteristics. The different quadrants are have inputs to cells not shown on the diagram that are stimuli inputs from different senses. All of the cells have their rotation and colors controlled by stimuli and interaction with other cells. I have all of the specifics worked out, I just need to be able to scale this up to millions/billions of cells and be able to observe the trends and patterns on cells through different stimulation. The AI rules are quickly saturated on a 64000 cell brain. I would gladly post my project somewhere to share, but most of the sites will not work with the libraries...
Are you able to display the 1000x1000x1000 without the AI? (also, that's really a lot!) And just being able to see the code would help a lot (github?).
Thank you very much for the suggestion of how to share my code. Could you please let me know if it works for you to download my code?
Yes, 1,000,000,000 cubes is the ULTIMATE goal I would be happy with 100x100x100 for the near future, but when designing the code, I wanted to design with the ultimate goal in case hardware was the limiting issue, as hardware is always changing and I have access to some really big cloud and cluster based systems if I could figure out how to design it correctly.
download link?
DUHHH https://github.com/Schievelbein/Brain
I took a quit look. Hoping you did something stupid but i didn't find anything. Later i will take a better look. You could figure out a algorithm to guess what boxes probably can't be seen but that can be tricky.
I think i would move away to a proper 3d application with a good renderer. Redshift is really nice and fast and supports instancing: http://docs.redshift3d.com/Default.html#I/Instances.html
Redshift is also easy to use, i really loved it. Just get yourself a videocard with a lot of cuda cores.
You could also try Arnold, which relies not on your video card but the ram you have. And since you have 64gb :D solidangle.com Look at how they made gravity for example, i was amazed what was done by it. Even things i didn't expect.
Other options might be octane, fabric-engine or v-ray, but i don't know much about that. There is also another one but i forgot the name.
You still would need to set the render quality low to keep it to a low frameRate. Some renderers have some delay. I would check looping the timeline and see how that goes.
If your rich: That video is a bit out of context, it's not rendered by 1 video card but like 128 or something (can't remember how many, but a lot). This doesn't mean you have to buy that many cards, you pay to make use of the render cloud.
Then for a 3d application. Softimage is the best software i ever used (i tried 3dmax, blender, maya and cinema4d, some more then others). There is a reason the first 2 renderers i mentioned had very early support for for softimage (SI from now). SI supports JScript, python and VisualBasic. Then they have the sdk that supports c++ (and python as well if i'm correct). They also have node based programming (and the best implementation i have ever seen). The interface is really nice. The interaction with sliders etc. is the best i have seen. There is a construction history that allows you to change something you did earlier like smoothing etc. And 100 more things.
Here are 2 awesome videos:
God i love this product.
The only reason not to use it is because it's EOL cause AutoDesk is evil. To compare it to processing, imagine processing will discontinue and we all have to use actionscript or something...
This product allowed small companies or even one man companies to be a concurrent of larger companies.
If you consider to switch to a 3d application i recommend reading the letter below (not written by me).
I took a quick better look at your code (i'm really tired). First this is wrong:
Brain should be brain cause it's an instance. This won't matter for running but it matters for people who read your code.
Also following Java syntax rules (or whatever it's called) this is wrong:
cells_per_side
Should be
CellsPerSide
Then what you could try, create a PShape with only a certain amount of boxes instead of so many. For example 10x10x10. Then in draw, use pushMatrix, translate and popMatrix to go around and draw the 10x10x10 multiple times at multiple places.
This way it will take less memory. You should test with different numbers.
This goes really fast (7ms):
But having a pushMatrix, translate and pop shows things really down (130519ms).
So bottom line is try to find the magic number, so a loop that doesn't take to long in combination with a PShape that holds a certain amount of cubes. You could also make a shape of the front. This way you only need one loop in the z direction (try that first i suggest).
Thank you very very much for your help and guidance. I have made the changes you suggested and I rewrote the code to create small groups of cells and then cluster them into a larger [areas], and then cluster the ares into brain hemispheres and then cluster those into a brain. I think my issue with using some of the other suggestions, is that I need to be able to PICK any given cell and display the information stored within that cell. I think I am going to have to go the way of a stand alone renderer as you suggested and connect everything to a database to store the information. I believe this is more of a Data Visualization project and need to start thinking of it in more of that venue and see what I can figure out to do.
Thank you again for you help and I will sen you a link to the next version, as I appreciate your feedback.
yeah cool, keep me up to date! O yeah here is a good video of ice:
For the rest, i think you should separate the visual and the data. In other words, don't store data in each cube but store it in a list (but you already mentioned database). Look into quadtree it might help: http://gamedevelopment.tutsplus.com/tutorials/quick-tip-use-quadtrees-to-detect-likely-collisions-in-2d-space--gamedev-374
I could imagine you only save data that is not default. Then in the quadtree you look at which parts are unchanged and render that with the 10x10x10 instance for example.
Anyway, you will run into problems, a project like this is not easy.