Iris2.de

Iris2-Forum
It is currently Sat Oct 24, 2020 6:27 pm

All times are UTC




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Thu Feb 14, 2008 5:46 pm 
Offline

Joined: Thu Feb 14, 2008 5:34 pm
Posts: 2
Hi,

I saw your video, and I would like to know, how do you process in order to load/show your world so big. I have maybe a few idea about it but I'm not really sure, so, as you're really good and that your game works great, could you indicate me if my idea is OK, and if it's OK, what you done, if it's not, what did you do then ?
So my idea is to set all world objets informations in memory (position and 3D filename). Then we check every time the distance between the camera and eatch objet. If the objets is really far, if he was loaded, we unload it with a thread. If an objets is not too far from the camera, we juste load it, but don't show it with a thread, and too finish, if an object is near the camera, we just show it (it had been loaded previously with a thread). And if an object go from near to not too far distance, we just hide it...

So with this idea I would calculate every object distance, and if there're 5000+ I don't know if the program will continu with a good FPS... So maybe I have to use a tile system, and check only objects on the tiles near the camera curent tile...

To finish, we juste had a fog...

Thank for responsing,

Stefbuet.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 14, 2008 7:51 pm 
Offline

Joined: Sun Jan 13, 2008 3:22 pm
Posts: 32
Location: Berlin
you only check every X tiles and you only unset objects "behind" you and you only add objects "in front" of you . That should reduce the load a lot. btw the server only sends objects "near by".

But I'm no programmer in iris. ;)

_________________
the more you know
the less you fear
you want my files?
my share is here


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 14, 2008 9:49 pm 
Offline
iris2-developer
User avatar

Joined: Tue Apr 18, 2006 10:28 pm
Posts: 823
Location: Munich, Bavaria, Germany
distinguish between normal ram and vram(video card), the latter is much more limited, and the bandwidth can be a problem, we're also fighting with that.

suprisingly the ideal state is that there are lots of bottlenecks, if there is only one bottleneck it is bad since idletime is wasted on the others, and you'll always have at least one.

no need to hold the full map in ram, the os caches somewhat, and there's no point in having the other end of the world accessible within milliseconds.

read into "level of detail" (LOD) if you want far-sight. we're somewhat limited with that in iris due to the data the server sends only near the character, but it's not that bad due to birdlike 3rd person cam (first person would be worse since you see the horizont and far stuff by default.

google gamasutra, vterrain, ogre paging terrain... might give a few interesting things


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 15, 2008 11:13 am 
Offline
iris2-developer
User avatar

Joined: Tue Aug 22, 2006 1:21 pm
Posts: 173
Location: Munich, Germany
doing distance checks between camera and every object every frame will totally kill your performance.

to overcome this problem you need a data structure (index) that speed up the distance checks. You probably could split your world into blocks and first check the distance to a block and only if the distance is small enough you check the distance towards the objects in the block.

If the simple block approach is not fast enough there are established data structures that probably will help.

http://en.wikipedia.org/wiki/Quadtree
http://en.wikipedia.org/wiki/R_tree (warning complex!)

_________________
O-->---


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 15, 2008 6:23 pm 
Offline

Joined: Thu Feb 14, 2008 5:34 pm
Posts: 2
Thank you for your responces, I think I will try to use this method :

first, the world editor will :
make a file containing some informations : blocks positions divising the world into little parts and objects property included in eatch block (filename, position, sound,...).

then, the game will :
load the file, and, in an Array, put all blocks data as block class. There class will contain an array of objects class who will contain all objects properties.

Then on eatch frame, I will check all blocks positions, and determine far, medium and near blocks.
note that far blocks are blocks just after medium blocks, not all others blocks, in fact there are near, medium, far and other objects.

Then, the game will load all objects of the far blocks, and if some objects are already showed, the game will hide them.

Medium block's objets will be showed if not, and have a medium LOD.

Near block's objects will have a good LOD.

For other blocks, far away than far blocks, objects will be unloaded (if loaded)

Then the game will add a fog, starting at the middle of the medium blocks, and finishing at the start of the far blocks, so users won't be able to see anythings.

You told me that using block system would maybe slowdown the program, but I won't create some really big maps like in GTA...

So, I think this method isn't so bad...
What do you think about it ?

Thank again a lot,

Stefbuet.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group