playMaker

Author Topic: Array size issue [SOLVED]  (Read 3492 times)

Raika

  • Playmaker Newbie
  • *
  • Posts: 30
Array size issue [SOLVED]
« on: October 26, 2017, 02:03:58 PM »
When i try to create big int array like 400 000 unity froze. If I add a lot of ints to array on runtime and click on variable window i get this error: unity playmaker array was not one-dimensional array.
Does playmaker not support large array? Or did I do something wrong?
« Last Edit: November 04, 2017, 06:05:26 PM by Raika »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Array size issue.
« Reply #1 on: October 27, 2017, 01:57:36 AM »
Hi,

 you certainly hits a memory consuption barrier.

 Could you share your project? pm me if you can't share it publicly.

Also, it sounds odd you want to store 400 000 values in one array. Can you explain your use case, I may have some other proposals to make it work hopefully.

what's likely happening is that Unity can't deal with showing 400 000 entries in the inspector, so the solution would be to create a paging system like I did for ArrayMaker ( which for now I would suggest to use if you need 400 000 items and still be able to browser them in editor).


Bye,

 Jean



Raika

  • Playmaker Newbie
  • *
  • Posts: 30
Re: Array size issue.
« Reply #2 on: October 27, 2017, 05:13:50 AM »
In brief, c# script is creating Perlin Noise Index (x,y) Value: PN.
I use this on flat surface to create biomes like forest(green), desert(yellow) etc.
Now i wanna use this same perlin noise to create list of objects, for exmaple:
tree on Forest Biome, cactus on Desert Biome.

And here is my problem, from what I read I can't use 2d array in playmaker,
so i was trying to create 1d array and convert perlin noise indexes(x,y) to one index(x) like this:

For example: PN is max 2d(299,299) = (x*1000+y) = max 1d(299299).
With this method most of indexes will be empty and size will be 300300.

Also if i can somehow keep perlin noise with playmaker it will be great. I'm using SmoothSave.

Raika

  • Playmaker Newbie
  • *
  • Posts: 30
Re: Array size issue.
« Reply #3 on: October 28, 2017, 05:31:23 AM »
i will try use arraymaker today. I will inform you about the progress.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Array size issue.
« Reply #4 on: October 30, 2017, 03:24:59 AM »
ouch...

 Why not just keep it as a texture and sample at a given position to get the pixel color and work from there?

Bye,

 Jean

 

Raika

  • Playmaker Newbie
  • *
  • Posts: 30
Re: Array size issue.
« Reply #5 on: October 30, 2017, 11:26:25 AM »
Keep as a texture is good idea, thanks. But i have still problem with saving objects,
i was trying to use ArrayMaker to save them to Hash Table, but i don't have any idea how to save this hash table or whole object, smooth save don't work.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Array size issue.
« Reply #6 on: October 31, 2017, 01:43:19 AM »
Hi,

do you mean to save this outside the game for reuse? I would suggest EasySave, it has full support for PlayMaker and I provide support for ArrayMaker, so you can save your arraylist and hashtable with EasySave ( note you can't save gameobject references, it would have to be strings or Id or else).

 Bye,

 Jean

Gustav

  • Junior Playmaker
  • **
  • Posts: 53
Re: Array size issue.
« Reply #7 on: October 31, 2017, 06:39:46 AM »
I also use Easy Save 2. It's a fantastic asset with lots of features.

If you download ES2 now a beta of ES3 is included. The new version does lots of things even better with less actions. ES2 cluttered playMaker with an enormous number of actions while ES3 e.g. only uses one for setting all kind of data. It's really neat.
If you start now with ES you should use ES3 because you'll not be able to load files saved with ES2 in ES3. Just a warnig. :)
« Last Edit: November 11, 2017, 01:47:53 PM by Gustav »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: Array size issue.
« Reply #8 on: October 31, 2017, 04:30:18 PM »
Hi,
I am using easy save for all my games and i tried some others but easy safe is still the best asset so far.
Definitely worth every penny.

Raika

  • Playmaker Newbie
  • *
  • Posts: 30
Re: Array size issue.
« Reply #9 on: November 04, 2017, 12:38:11 PM »
Thanks for help, HashTable is great for handle many objects, with es2 i can save but not with es3, i will ask for help on easysave's forum and write here if is possible to save with es3.

Gustav

  • Junior Playmaker
  • **
  • Posts: 53
Re: Array size issue.
« Reply #10 on: November 04, 2017, 03:24:53 PM »
I think I read somewhere in the ES3 docs that those actions will be added after it almost finished the beta status.
« Last Edit: November 04, 2017, 03:26:33 PM by Gustav »

Raika

  • Playmaker Newbie
  • *
  • Posts: 30
Re: Array size issue.
« Reply #11 on: November 04, 2017, 06:05:06 PM »
Once again thanks for help, for now I will use easy save 2.