Quadtree for CUlling

Quadtree for CUlling

Postby paul424 » 06 Aug 2012, 12:15

I just impleneted and made working Quadtree for Creatures ( and GameEntity ) for culling.
Now it gets segfaults because it needs semaphores.
There are various ways I could go from there, first is :
How large or small are update of Creatures when walking when doing setPosition ?
Should we go for separate thread which would queue positions updates and then reread them and apply them to QUadtree ( as with the case of RenderManager) ?
Do we want to have some collision detection with it ?
Also how to compose it in with the coming Event System Manager ? Or maybe when there is Event regarding some area we wanna just cut out Entries from QUadtree put it into some container and then futher process it ?


Also some better memory allocation model would be better when dealing with QUadtrees.
User avatar
paul424
OD Moderator
 
Posts: 660
Joined: 24 Jan 2012, 13:54

Re: Quadtree for CUlling

Postby oln » 08 Aug 2012, 16:39

I really think doing this is premature optimization, so I would suggest not focusing on this at all right now besides making sure it doesn't crash or break anything.
User avatar
oln
 
Posts: 1020
Joined: 26 Oct 2010, 22:16
Location: Norway

Re: Quadtree for CUlling

Postby svenskmand » 10 Aug 2012, 17:47

I agree with Oln. The thread model needs to be in place before you can begin to integrate advanced optimizations like that.
Jamendo.com - The best music store on the net, uses CC licenses.
User avatar
svenskmand
OD Moderator
 
Posts: 1850
Joined: 09 Dec 2009, 00:07
Location: Denmark

Re: Quadtree for CUlling

Postby paul424 » 10 Aug 2012, 18:36

I have no idea what you have in mind. You mean the thread model of OD in general ? Or that mine added code should use the threads properly ? Second what do you call advenced optimization ? The steps I proposed described above or adding Quadtree in general ? Gosh sometimes using too many idioms makes posts obscure ;)
User avatar
paul424
OD Moderator
 
Posts: 660
Joined: 24 Jan 2012, 13:54

Re: Quadtree for CUlling

Postby svenskmand » 10 Aug 2012, 19:48

Since it has to do with rendering, and the creatures change positions which will be handled by the Event System / Thread model. It will require some sort of synchronization with the thread model to do culling correctly. But since we have not decided exactly how the thread model should be, it would be in vein to synchronize the culling algorithm with the current threads, if it requires too much work.
Jamendo.com - The best music store on the net, uses CC licenses.
User avatar
svenskmand
OD Moderator
 
Posts: 1850
Joined: 09 Dec 2009, 00:07
Location: Denmark

Re: Quadtree for CUlling

Postby oln » 10 Aug 2012, 22:10

I'm not convinced that we should even be doing this manual culling, at least not at this level. There has been some discussions earlier about the best way to do tile rendering, but we never came to a conclusion. Right now stuff is rendered model by model, though rendering in large batches is much more efficient, so it might be a better idea to use instanced rendering, or some other method. I don't know Ogre or 3D graphics well enough to make any suggestions here. Ogre 1.8 might have improved things as well.

Either way, this should really not be a focus right now. Unless the framerate is so horrible that the game is unplayable, optimizations like this should not, at least in my opinion, be done before the application code is properly structured. Otherwise it's probably just going to break things and make refactoring even harder. (Last time I checked the framerate was sufficient on my 5-year old computer at least. )

Anyhow, it's really up to you two right now, my health situation doesn't seem to be improving much, so I am not expecting to be able to do much more than some occasional forum posting in the foreseeable future.
User avatar
oln
 
Posts: 1020
Joined: 26 Oct 2010, 22:16
Location: Norway

Re: Quadtree for CUlling

Postby Skorpio » 14 Aug 2012, 16:56

oln {l Wrote}:Either way, this should really not be a focus right now. Unless the framerate is so horrible that the game is unplayable, optimizations like this should not, at least in my opinion, be done before the application code is properly structured. Otherwise it's probably just going to break things and make refactoring even harder. (Last time I checked the framerate was sufficient on my 5-year old computer at least. )

When we implement the new tiles the poly count will explode. Zoomed out I get about 5 FPS, looking at 2000000 polys. :) I guess we'll need LoD versions of the walls, what will cause some tedious work for me.

oln {l Wrote}:Anyhow, it's really up to you two right now, my health situation doesn't seem to be improving much, so I am not expecting to be able to do much more than some occasional forum posting in the foreseeable future.

I hope you get well soon. :( We need you. :)
User avatar
Skorpio
OD Moderator
 
Posts: 775
Joined: 05 Dec 2009, 18:28

Re: Quadtree for CUlling

Postby paul424 » 14 Aug 2012, 17:35

Skorpio , where is that new tile set ? Is it in standard repo ? Also who could write a few words about exporting blender models , somehow I managed to get this working , but I know there are many issues of which I am not aware : http://www.ogre3d.org/forums/viewtopic.php?f=8&t=61485 . Lod's a diffrent issue, by default in OGre you can map the Z lenght interval and appropriate mesh , which is of no use for now, cause all models have fixed number of polys. If you Skorpio could write simple instruction someone might try to repoly existing models.
User avatar
paul424
OD Moderator
 
Posts: 660
Joined: 24 Jan 2012, 13:54

Re: Quadtree for CUlling

Postby Skorpio » 14 Aug 2012, 18:43

The tile set is in our SVN repository and on OGA.

There are exporters for Blender 2.49 and 2.5+, and on the 2.49 page is a short installation guide. I haven't checked out the 2.5 exporter yet. I think you also have to install the OgreXmlConverter.
Then in Blender you only have to select the model, choose the Ogre exporter from the list and click the OgreXMLConverter button.

To create LoD models you have to build a new mesh with lower poly count over the old one and bake the textures. Also animated models have to be skinned again.
User avatar
Skorpio
OD Moderator
 
Posts: 775
Joined: 05 Dec 2009, 18:28

Re: Quadtree for CUlling

Postby paul424 » 16 Aug 2012, 20:38

I tried to use that way, but all I get is one huge scene file. I could work out that by futher inspection, but I see no point of learning additionally SVN to make the tileset be into the standard SVN repo ( and btw learning blender and models converting would be useful though) . Afaik adding new models to SVN repo is broken , so an SVN newbie won't help very much in this topic. How things are getting work in this project really makes me sad and takes away motiviation to work on it.
User avatar
paul424
OD Moderator
 
Posts: 660
Joined: 24 Jan 2012, 13:54

Re: Quadtree for CUlling

Postby Skorpio » 16 Aug 2012, 21:51

Hmm, that's odd. Even if you have everything in a scene selected, the output should be separate files for all the different objects in the scene. You're German, too, aren't you? Maybe you could explain to me in German what you're doing step by step. If it's a bug in the exporter I can't help, though. I should check out the 2.5-2.6 exporter to see if it works for me.

What's the problem with SVN? The last time I tried to use it I had some problems as well, but that had to do with the changed folder structure of the repository. I think after I deleted the folder on my hard drive and redownloaded it, it worked again.
User avatar
Skorpio
OD Moderator
 
Posts: 775
Joined: 05 Dec 2009, 18:28

Re: Quadtree for CUlling

Postby paul424 » 16 Aug 2012, 22:01

No, I am Polish and I hardly understand German :D

Here's what do I get :

tom@linux-ex0a:~/opendungeons_media/NewTileSet> ls -la
total 7636
drwxr-xr-x 2 tom users 4096 Aug 15 00:05 .
drwxr-xr-x 4 tom users 4096 Aug 15 00:05 ..
-rw-r--r-- 1 tom users 12590 Aug 15 00:05 Dirt102NS-A.mesh
-rw-r--r-- 1 tom users 66508 Aug 15 00:05 Dirt102NS-A.mesh.xml
-rw-r--r-- 1 tom users 4480929 Aug 15 00:05 Dirt_darkE.png
-rw-r--r-- 1 tom users 510843 Aug 15 00:05 Dirt_dark_nor3.png
-rw-r--r-- 1 tom users 1509 Aug 15 00:05 Dirt.material
-rw-r--r-- 1 tom users 2722545 Aug 15 00:05 Dirt_spec4.png
-rw-r--r-- 1 tom users 1291 Aug 15 00:05 OD_Tilesets3.scene
User avatar
paul424
OD Moderator
 
Posts: 660
Joined: 24 Jan 2012, 13:54

Re: Quadtree for CUlling

Postby oln » 16 Aug 2012, 22:08

From what I remember you can adjust the exporter settings to not export the scene. I don't know how it works with exporting multiple meshes from one blender file though.
User avatar
oln
 
Posts: 1020
Joined: 26 Oct 2010, 22:16
Location: Norway

Re: Quadtree for CUlling

Postby Skorpio » 16 Aug 2012, 22:20

Ah, I think Stefan is the other German here. All I can say in Polish is cześć, dobrze and some nasty words. :D

So it exports only this tile "Dirt102NS-A.mesh" and then the whole scene?
User avatar
Skorpio
OD Moderator
 
Posts: 775
Joined: 05 Dec 2009, 18:28

Re: Quadtree for CUlling

Postby paul424 » 16 Aug 2012, 22:22

The blender version is 2.63, and the OgreExporter is the
>>Download Beta: requires Blender2.63 or newer
. http://blender2ogre.googlecode.com/file ... eview1.rar << So both are probably highest version.

Now I see there's separate menu poping, when doing File->Export->Ogre3d which I haven't notice earlier ...

Ohh It seems Exporter writes ONLY the mesh which is marked as active in blender. Seems I would need to repeat the process for each one ...


The remaining question is why those new Tile sets are not in the SVN repo ?
User avatar
paul424
OD Moderator
 
Posts: 660
Joined: 24 Jan 2012, 13:54

Re: Quadtree for CUlling

Postby Skorpio » 16 Aug 2012, 22:25

The tileset can be found in the repo under mediaSource\Models\OD_Tilesets

In Blender you can press A to select everything, then it should be possible to export all objects at once.

Edit: Btw, the exported models are in this folder mediaSource\Models\OD_Tilesets\OD_Tilesets_export
There are only claimed and dirt tiles, and I have a half finished texture for stone tiles on my pc, but no time to finish it at the moment.
User avatar
Skorpio
OD Moderator
 
Posts: 775
Joined: 05 Dec 2009, 18:28

Who is online

Users browsing this forum: No registered users and 1 guest

cron