Results 1 to 13 of 13
  1. #1
    Member Z4urce's Avatar
    Join Date
    Jun 2011
    Location
    Slovakia
    Posts
    37

    Open World Game development (like GTA)

    Hello,

    I have already created a thread under WIP games, but since nobody gave ma an answer, i try to post my problems here too.
    Original thread (my WIP game): http://blenderartists.org/forum/show...-Alley-Arrival

    I have a lot of questions and problems. I would be grateful, if the community would help me during the development of my game. If someone want to join, tell me.

    - I have problem with the transparent objects (like the trees or the grass)... we all know that the BGE hates transparent objects, so if many of these objects are shown at the same time, the FPS falls down to 30~40.

    - LOD ... since i have written a multithreaded level of detail script, which doesn't affects the main FPS (so it runs continously and fast and powerful enough to replace all he meshes in the scene within a frame, but the FPS stays high) ... BUT! this only replaces an object and just when the player is far enough from it's central point... because of that I must manage every piece of grass as an object to make the LOD look run flawlessly and make beautiful transitions between visible and invisible... (because one piece of grass is just one poly, there's no levels, just visible and invisible) ... the other reason I need every piece of grass as an separate object is the Billboard face orientation... (so the piece of grass will always rotate to the direction of the player... with this I tried to save polys) ... so I need a flawless level of detail billboard grass method ... or some advice at least.

    (The "1. detail = 1. scene, 2.detail = 2. scene and then make cam to each scene and align the clip to eachother to make fake LOD" is very fast and impressive LOD system, but i'm gonna die while I position each of the object separately to each scenes)

    - If I create low poly humans in makehuman, Is there a method to give them clothes? (The human modeling is my weakness... especially the clothing... I'm totally retarded in this)

    - In blender 2.65 every material made with the node system is a lot darker... and I don't know why... although it's alright in 2.64 ... What is that?

    - I have a fence in my game... it has holes in it, so it uses alpha. But if you observe it as you walking away, it's fading away too soon thanks for the mipmapping... is there any way to turn off the mipmapping just for one texture (the radio button doesn't work in the textures panel)

    - The BGE custom 2D filters are the greatest graphical improvement method ever. But some of the filters uses too much system resource, so generating one frame takes more time (lower FPS) ... i would like to ask that is there some method to make a 2D filter run on a separate thread? ... I mean I made it with the LOD system... why would not work with the filters? I know that the only way to use a 2D filter is the logic bricks... but what if I put a plane in front of the camera and write a custom shader to it (which will be the 2D filter) and make it run on a separate thread? Might that be able to work? ... just thinking...

    (As everyone, I want the maximum FPS with maximum graphic...)

    - As we know and as Moerdn told us: One object with high amount of polygons is always faster than a lot of objects with small amount of polygons... The main reason is the physics calculations... So this made me thinking of two new questions...
    1.: Is there a way to make a physics LOD ? (so turn off entirely an object's physics if it's away)
    2.: If I make a lot of objects connected with compound (so they share bounding box) Will that count as one object in the physics calculation? Will it be faster? (STATIC objects)

    OMG... I just wrote a novel. If you read it, thank you and you're awesome.
    So guys, I'm waiting for the solutions. I would be grateful for the smallest help too.
    Thanks
    The Swindler Alley (My game project):
    Download, Homepage, Blenderartists, Facebook

    Multithreaded Level of Detail [High Performance]:
    Z-LOD_MT @ Blenderartists



  2. #2
    Member Z4urce's Avatar
    Join Date
    Jun 2011
    Location
    Slovakia
    Posts
    37
    For God's sake, please someone help me out at least one of these problems...
    The Swindler Alley (My game project):
    Download, Homepage, Blenderartists, Facebook

    Multithreaded Level of Detail [High Performance]:
    Z-LOD_MT @ Blenderartists



  3. #3
    Moderator Monster's Avatar
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    10,784
    How about making one thread for one issue?

    Originally Posted by Z4urce View Post
    - I have problem with the transparent objects (like the trees or the grass)... we all know that the BGE hates transparent objects, so if many of these objects are shown at the same time, the FPS falls down to 30~40.
    What is the problem?

    Originally Posted by Z4urce View Post
    - LOD ... since i have written a multithreaded level of detail script, which doesn't affects the main FPS (so it runs continously and fast and powerful enough to replace all he meshes in the scene within a frame, but the FPS stays high) ... BUT! this only replaces an object and just when the player is far enough from it's central point... because of that I must manage every piece of grass as an object to make the LOD look run flawlessly and make beautiful transitions between visible and invisible... (because one piece of grass is just one poly, there's no levels, just visible and invisible) ... the other reason I need every piece of grass as an separate object is the Billboard face orientation... (so the piece of grass will always rotate to the direction of the player... with this I tried to save polys) ... so I need a flawless level of detail billboard grass method ... or some advice at least.

    (The "1. detail = 1. scene, 2.detail = 2. scene and then make cam to each scene and align the clip to eachother to make fake LOD" is very fast and impressive LOD system, but i'm gonna die while I position each of the object separately to each scenes)
    It is normal that you LOD'd one object at the time as the single object have different distances to the camera.
    You can indeed LOD'd clusters of objects. There is no urgency for precision on LOD processing.

    BTW: I do not think that using a thread speeds up these processing, but I can be wrong with it.

    Originally Posted by Z4urce View Post
    - If I create low poly humans in makehuman, Is there a method to give them clothes? (The human modeling is my weakness... especially the clothing... I'm totally retarded in this)
    When you have a human body already you can use sim cloth to create good looking cloth meshes. Please have a look at the modelling forum.

    Originally Posted by Z4urce View Post
    - I have a fence in my game... it has holes in it, so it uses alpha.
    I recommend to use clip alpha. This is much more efficient than alpha blend (useful for your grass too).


    Originally Posted by Z4urce View Post
    - is there any way to turn off the mipmapping just for one texture (the radio button doesn't work in the textures panel)
    No it is not possible. I think you better manage that with LOD by switching to a lower detailed mesh (with different texture)


    Originally Posted by Z4urce View Post
    - The BGE custom 2D filters are the greatest graphical improvement method ever. But some of the filters uses too much system resource, so generating one frame takes more time (lower FPS) ... i would like to ask that is there some method to make a 2D filter run on a separate thread? ... I mean I made it with the LOD system... why would not work with the filters? I know that the only way to use a 2D filter is the logic bricks... but what if I put a plane in front of the camera and write a custom shader to it (which will be the 2D filter) and make it run on a separate thread? Might that be able to work? ... just thinking...
    As far as I know filters run in GPU. So they are already separate.
    (BTW. threads are not the solution for all problems. They are a tool to simulate parallel processing.)


    Originally Posted by Z4urce View Post
    - As we know and as Moerdn told us: One object with high amount of polygons is always faster than a lot of objects with small amount of polygons... The main reason is the physics calculations...
    This is partly true. It requires that you have a lot of physics objects. And it depends strongly on the shape of the objects.

    anyway:
    Originally Posted by Z4urce View Post
    1.: Is there a way to make a physics LOD ?
    Sure, you can disable/enable physics
    You can replace an object with a ghost version to completely take it away from physics calculation.
    Ensure to disable collisions when it is not necessary (e.g. leaves on a tree)

    Originally Posted by Z4urce View Post
    2.: If I make a lot of objects connected with compound (so they share bounding box) Will that count as one object in the physics calculation? Will it be faster? (STATIC objects)
    Just test it.



  4. #4
    As for your material being darker problem, ensure that the material's diffuse color isn't slightly gray, but is actually white (1, 1, 1).



  5. #5
    Member Z4urce's Avatar
    Join Date
    Jun 2011
    Location
    Slovakia
    Posts
    37
    Originally Posted by Monster View Post
    How about making one thread for one issue?
    Sorry, i did not want to spam the entire forum with separating my questions to threads... and as every of my problems is belongs to open world games, i thought it would be a good idea if I ask them in a single thread.

    Originally Posted by Monster View Post
    What is the problem?
    ... the low FPS. Need a method where BGE can handle a lot of alpha clipped texture, without slowdown.

    Originally Posted by Monster View Post
    It is normal that you LOD'd one object at the time as the single object have different distances to the camera.
    You can indeed LOD'd clusters of objects. There is no urgency for precision on LOD processing.

    BTW: I do not think that using a thread speeds up these processing, but I can be wrong with it.
    But when I use a lot of separated objects (like LOD clusters), the scenegraph won't handle it, or the rendering speed becomes more slower... (It's already done in that way in my game, however i used group instances, but I didn't dare to fulfill my whole scene with houses ... imagine what would happen, if I put there each grass piece as a separated object [for the flawless LOD])

    And since I use a separated CPU thread to do the LOD calculation for the entire scene, it's way more faster than before.

    Originally Posted by Monster View Post
    I recommend to use clip alpha. This is much more efficient than alpha blend (useful for your grass too).
    I always use clip alpha.

    ... Thank you very much, for answering


    Originally Posted by SolarLune View Post
    As for your material being darker problem, ensure that the material's diffuse color isn't slightly gray, but is actually white (1, 1, 1).
    Thanks for your answer... it's not the problem, sorry If I was mis-understandable. The problem is: I used the node system for putting AO texture to a material... so in the viewport it's alright... looks like in 2.64 in game.... but when I start the game engine in 2.65, the AO texture don't shows, just the plain texture of the material... :/
    The Swindler Alley (My game project):
    Download, Homepage, Blenderartists, Facebook

    Multithreaded Level of Detail [High Performance]:
    Z-LOD_MT @ Blenderartists



  6. #6
    Moderator Monster's Avatar
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    10,784
    It sounds you have much progress already .

    The first thing that comes into my mind when I here "open world" is:

    Do not put all your object into the scene at once.

    You just need the objects you can see. Nothing more. With that LOD comes into Play. Please be aware that the lowest detail of LOD is simply nothing. So it ends with an object culling. This frees the Physics from using it, it frees the scene graph from taking care of it and it allows the render to ignore it.

    This is independent of the how many alpha materials you have. This "just" influences how many objects you should have at once, not how many you can have overall.

    You might already thought about that.

    There are several issues:
    A) Where to place all the not existing objects, that LOD should add.
    Having millions of empties will badly influence performance. So it should be avoided.

    A good method is to create something like a level map (think about level editors). You store which object is at what position, with orientation and scale may be with some additional data (properties).
    I suggest to look for saveLoad-threads. They do exactly that - storing scene data in a separate file.

    If you choose a good data model you can have easy access on positional data (e.g. B-Tree) to find the data when you want to add an object to the scene. You can even do it that way, that you do not need to keep all level data in memory as you are interested in a small part only (the position of the camera).

    B) Where are the objects coming from?
    Be aware A) does not include mesh, material, texture data etc.. They are already in the scene (inactive) or can be loaded via LibLoad.
    In future versions of the BGE you will be able to even stream loading when LibLoad goes asynch. It will still be a good idea to load a few objects when needed.

    C) keep your stored game updated.
    As you surely want to see the effects of your previous visits within an area (like an opened a door or a solved quest), you can store or save an updated level map while running the game. This can be in memory (keep the difference to the saved level file) or in a file (update a save file). A common method is to let the user decide when to make changes persistent -> File/save


    I was working on a method to cluster a game into separate scenes. With a seamless transition the player would not see that he moves into a different one (see this tech video). Mainly designed for a space game it can be used for landscapes as well. The downside is: As it uses multiple scenes at once it eats more render power than a single scene.


    As said keep the number of objects within your scene small. That helps your performance a lot. It you can dynamical change this number
    you can adjust your game to computers with different power.

    I hope this helps you a bit.



  7. #7
    Member Z4urce's Avatar
    Join Date
    Jun 2011
    Location
    Slovakia
    Posts
    37
    Yeah, I have a lot of assets already done. In the beginning of my game's development (a year ago) I thought that I have a good concept for my game. In my original idea, the whole scene consist of group instances (I've 10 house templates, each template have at least 4 different texture, which make them looks different... so approximately 50 different houses) ... the Bus station is unique, every other object is just a group instance of a template (trees, grass, fences, gates, windows, chimneys, pipes, stairs) ... I tried to save as much RAM, as I know, by using the same object instance more than one times, fulfilling the scene, which looks like more detailed :P

    In my game, one group instance contains: 3 similar objects, with different detailed meshes, for the LOD. Two of them is always inactive, since the active object have some game property, which contains information for the LOD script (which runs in the main scene, and manages all objects in the scene, if they have the LOD set up in they game properties.)

    My LOD system: It's basically built up to change meshes for the active objects. In average there are 3 different leveled mesh in each instances. It works well... finally, when the camera is far away enough, the object turns invisible. (I think that's not enough to save resources. Is it?) The occlusion culling is always on, and every building is an occluder at the same time.

    This is what my game looks like now.
    In my original thread there's some videos and pictures, they says more than me.
    The Swindler Alley

    Your idea, to load the objects in the scene procedurally, is a perfect solution for my problem, but what would be the simplest way to implement it to a city scene which contains a lot of repeated group instances?
    The Swindler Alley (My game project):
    Download, Homepage, Blenderartists, Facebook

    Multithreaded Level of Detail [High Performance]:
    Z-LOD_MT @ Blenderartists



  8. #8
    Moderator Monster's Avatar
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    10,784
    I agree group instances is the way to go. It allows a pretty good development set up and separates level building from modelling and logic creation.

    It does not really save memory as it does not matter where the BGE loads the objects from. They all will be loaded at startup.

    The problem with the invisible meshes is, they are still present for scene graph and for physics. So you save render time, but only if they are withing the camera frustum (Otherwise they will not be rendered anyway.).

    To save resources I think you need to remove the empties as well.

    O lot of occlusion culling is not good either. It should be limited to a few large and simple objects. Otherwise the saved processing time can be eating by the overhead. So this depends on situation.

    Loading groups should be simple. Just merge the scenes with the groups/group instances (inactive) into the current scene. This allows to addObject (by LOD) them when needed.

    I hope this helps



  9. #9
    Member Z4urce's Avatar
    Join Date
    Jun 2011
    Location
    Slovakia
    Posts
    37
    So... if I understood it right, the solution is:

    1.: Create a build scene, where I put everything to the game area, then make a script to save the position of every kind of objects in it (group instances) ... this will build up a map file.

    2.: Set up an empty Play Scene, Load every group as an instance to the play scene to an inactive layer, and make the LOD script add these group duplication empties with addObject to the active layer, and put them to the places read out from the map file if the player is nearby?
    The Swindler Alley (My game project):
    Download, Homepage, Blenderartists, Facebook

    Multithreaded Level of Detail [High Performance]:
    Z-LOD_MT @ Blenderartists



  10. #10
    Hello
    an answer to most of your problems:
    forget "open world" ( and blockbuster games), make different spots/scenes and use the "Add Scene Actuator!
    Anyway, your work looks quite nice!
    Bye



  11. #11
    Member Z4urce's Avatar
    Join Date
    Jun 2011
    Location
    Slovakia
    Posts
    37
    OTO, in my Opinion it's not impossible to create an open world game with bge. If you look around, there are several open world games in progress, based on blender, with different solutions. It's hard I know, but that's the most exciting part of the development And thank you.

    Status report:

    1.: transparent objects - I always used alpha clip. I made some tests to figure out what causes the massive FPS drop down when looking through transparent objects. ...
    - When I put 20 alpha clipped objects to my scene, it's still runs at 60 FPS, but when I put them in the same row and looking through all of them, the FPS falls to ~25
    - in the same situation when I use alpha sort, the FPS is ~35
    (tested with an integrated Intel HD graphic card, but one of my friends sayd that this also occurs on nvidia, and on my desktop with amd radeon i also had some problems with the transparent problems)
    - so there's no solution for blender's slow transparent object handling as far as I know :/

    2.: LOD - I'm actually working on an advanced LOD script based upon Monster's suggestions.

    3.: Creating good looking Cloth to a naked low poly human body... still can't do that lol. Someone can give me some kind of tutorials please?

    4.: Solution for the 2.65 node system (originally darker materials): 2.65 requires that you have written the UV map's name to every texture, even if you have set it as default UV map.

    5.: invisible fence caused by mipmapping ... still searching for a solution because switching it's mesh with another fence texture just didn't work because of the big holes in the texture... (like this: http://www.psdgraphics.com/wp-conten...link-fence.jpg )

    6.: My question about the 2D filters was nonsense, i admit.

    7.: About the physics and the object's bounding box:
    - The highest FPS (and lowest physics percent) achieved with one high poly object (10 000 cubes joined)
    - With separated cubes with separated bounding boxes there was a great slowdown in the physics, rasterizer, and scenegraph too.
    - Surprisingly with separated cubes sharing the same bounding box was even worse.
    ... i thing there's no way to join objects to together in bge, to gain FPS boost, so the only thing we can to is trying not to use too much objects with physics (or using physics LOD)

    So this is what I know up to now... and as I said, I'm working on a global LOD system with Object and Physics culling.
    Last edited by Z4urce; 03-Feb-13 at 09:04. Reason: grammar mistake
    The Swindler Alley (My game project):
    Download, Homepage, Blenderartists, Facebook

    Multithreaded Level of Detail [High Performance]:
    Z-LOD_MT @ Blenderartists



  12. #12
    Maybe this help you with the physics problems http://blenderartists.org/forum/show...game+soft+body



  13. #13
    Member Z4urce's Avatar
    Join Date
    Jun 2011
    Location
    Slovakia
    Posts
    37
    Thank you Aryok, that's amazing
    The Swindler Alley (My game project):
    Download, Homepage, Blenderartists, Facebook

    Multithreaded Level of Detail [High Performance]:
    Z-LOD_MT @ Blenderartists



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •