@t0neg0d said:
Since the topic is closed... how are you sectioning these? Per terrain tile? i.e. To make use of camera frustum culling.
Oh yeah, it’s definitely 1 batch geometry per terrain quad. Of course, else the fps would drop substantially because of the [lack of] frustum culling, it would be unplayable, especially with 49 terrain quads, so more than half of those are culled that way. On laptops I bring this down to 9 terrain quads. Of course later on when I’ll be very focused on optimization, I’ll have to test if subdividing these even more would help or not. I think not, but who knows, I haven’t tried yet. All I know is at one point, the more subdivisions, the slower.
I’m liking that idea to use of the terrain quad’s triangles to place vegetation tough, because the triangles have everything I need to place my trees: a position, a normal for the slope, etc… the only thing it doesn’t have is if there’s a rock on it or not… collisions on rocks are inevitable I think.
@pspeed said:
-just doing radius checks instead of involving JME's collision system... it will be exponentially faster.
Please elaborate on this suggestion if possible.
@pspeed said:
-"sparse grids" as a way of indexing the objects to avoid having to perform many collisions at all. Instead of the 1000th object having to hit every other object it may hit none or only 2-3 objects.
You could probably get the placement of 1000 objects down to a 1 or 2 milliseconds this way.
I’m not colliding each geometry against all geometries, as I posted a couple days ago in this thread, I’m colliding with a SELECTION of geometries and that means sometimes 4 or 5 only. So in total it’s like maximum 4000 or 5000 collision checks for the whole thing (not 1000999998997996… oh no, trust me my computer would be hanging way before it reaches even half of those!). I do agree it would be even better to divide these by grids tough so that a far away rock will not be tested against closer trees, but I’m wondering if the time it takes to do the IF checks to actually see if the collisions are necessary for each geometry will take even longer than actually doing those collisions, not sure, would have to test this. I’m thinking maybe if I just do that roughly like:
- for each rock, put it in one of those lists: “first half of terrain quad” or “second half of terrain quad”
- for each tree in first half collide with “first half of terrain quad”
- for each tree in second half collide with “second half of terrain quad”
Just like that I may be saving half of the collisions. BUT… then again, I mean this is optimization… I’m not there yet, I do agree there are so many better ways of doing what I want to do, but I’m just at the idea exploration stage if you will… I’m so going to rewrite the whole application when I’ll be finally decided on what game exactly I’ll be doing.
TOUGH, I have profiled a somewhat typic chunk’s computation time and I’m getting this:
PROFILE: Raycast Grass Billboards Layer for 4000 objects = 691 ms (0,172ms per collision)
PROFILE: Raycast Tree Billboards Layer for 393 objects = 14 ms (0,035ms per collision)
Not quite sure why ray tracing the grass patches take magnitudes more time than trees… that seems odd but anyhow it’s still not “1 or 2 milliseconds” that you’re saying could be achieved with the technique you’re talking about, so I’m quite interested by that actually.
@pspeed said:
* – oh, except for the side conversation where you as much as said our engine design was stupid. ;) I wonder why I got frustrated.
Never said that either. I said it was counter-intuitive and not thread-safe, which personnally I think is something that could be improved (even tough Empire Phoenix seems to think it’s not possible because it would be too slow), but ANYWAY the point is by that post, you were ALREADY telling me to “post the stack trace or get the fuck out” or bursting sarcasm on all your replies. I did post the stack trace and I did tell you I was sorry, I was tired and simply forgot to do it… I didn’t mean to upset you or anybody else, but man, you have got to drop that attitude, I’m a beginner and I’m still trying to understand JME3, I don’t have a PhD and I don’t do that as a professional job, this is like my new hobby, nothing more for now
I’m sure you guys are losing a lot of people because of this kind of aggressiveness towards noobs. It’s just unnecessary. Don’t expect newbies to learn JME3 in a month or two. This platform is HUGE and thanks to that, it’s appealing to beginners like me. But we’re still beginners, you know what I’m saying? I can feel the same thing when a client makes me lose my time with stupid questions or does not do what I tell them to fix their issue, but… they’re still computer unsavvy and it’s my job to stay calm and help them, even if they’re stupid or slow or even if it takes 2 hours to help them setup their Outlook and then they call you back the day after because they erased their account and lost all their emails (lol). Anyway, I think you get the point and again I’m sorry if I made you go mad, but let’s stay calm about it. I really appreciate your support and everybody else’s support too.
@pspeed said:
Anyway, good luck with your game.
Thanks.
@pspeed said:
Edit: and by the way, now that we have a clear picture of what you are actually doing on a separate thread it makes total sense to do it that way... as a thread pool I mean.
Smelling troll here
I’m serious, at this point I’m not sure if you’re messing with me or not. BUT if you’re serious about this, please could you give me a general idea of why that could have been wrong and what I could have done instead? You talked about the scheduler that was not looking like the appropriate choice… why? And what else could one be using instead of this? I took this approach in a [very limited] JME3 tutorial found around here. I do not know anything else to use in its place, but I can tell you it works quite well tough. My goal is to set a thread, continue executing my app and every like 100ms, check if the thread has finished and when it has, execute some more code like attach geometries on the sceneGraph and such (that cannot be done from a thread of course). So that’s why I’m doing it like this.
Thx for reading both of you
I +1’ed again both of you, because I like those ideas you suggested and I’ll try to implement this later on. [damnit, I +1’ed the wrong post from you @t0neg0d oh well, you got a freebie then as I can’t remove it :P]