jPCT-AE - a 3d engine for Android > Support

StackOverflowError

(1/4) > >>

raft:
happens almost immediately in a relatively large scene: 60x20 grid where each cell is a primitive box. in 20x20 it happens again but later


--- Code: ---Uncaught handler: thread GLThread 8 exiting due to uncaught exception
java.lang.StackOverflowError
  at com.threed.jpct.VisList.qsort(VisList.java:168)
  at com.threed.jpct.VisList.qsort(VisList.java:172)
  at com.threed.jpct.VisList.qsort(VisList.java:173)
  at com.threed.jpct.VisList.qsort(VisList.java:173)
  at com.threed.jpct.VisList.qsort(VisList.java:173)
        ...
--- End code ---

EgonOlsen:
Stack size is very limited in Dalvik...and so is recursion depth. I could convert the sort to be iterative but that will be slower and consumes additional memory (heap access instead of stack and i would have to keep the virtual stack in memory to avoid object creation). There's an iterative fsort-implementation lying around in the code...just deactivated. I can reenable it and see if it still works. On the other hand: Aren't 1200 single objects a bit too much for Android anyway?

raft:
i see. 1200 objects are surely too much, (i was just trying it) but 400 objects ?

are we talking about polygon sorting or object sorting here ? if objects, merging some objects may help i suppose. i dont know how much this will be possible, since in the course of game, some of the tiles disappear, some of them are highlighted and so on. seems as i will have problem with large levels..

i dont know much about sort algorithms. but as i recall, most (if not all) recursive algorithms can be flattened by emulating recursion. is that what you call iterative sort ?

EgonOlsen:
It's not polygon sorting, it's sorting of compiled instances. Yes, that's what i call iterative sort when you remove the recursion. As said, i once wrote an iterative fsort implementation but never activated it, because on the desktop, it wasn't any faster. I'll enable it for AE and see if that helps and how it performs.

raft:
maybe a flag in Config may help comparing the results

Navigation

[0] Message Index

[#] Next page

Go to full version