my sandbox game develop have some questions

Posted By: 20BN

my sandbox game develop have some questions - 07/27/16 13:27

hi all,
my sandbox game develop have some questions:

1.

this game need many many cube entities.(like minecraft)
i try to:
var world_xyz[3] = { 1024,1024,1024 };
...
function main()
...
max_entities = (world_xyz[0] + world_xyz[1] + world_xyz[2]) * 10 + max_entities;
...
start no error, but run game when function create random world a few min ago display error:
to many entities!

how can i fix it?

my PC:
2 XEON,48GB RAM,GTX1080

---------------------------------------------------------
2.

i set all cube entities flags:
my.emask &= ~DYNAMIC;
works fine! too many entities can't display, but game render fps is very slow

how can i fix it?



thx all.
Posted By: Reconnoiter

Re: my sandbox game develop have some questions - 07/27/16 14:13

Hi,

max_entities = 10000; //fill in any value here

Please note though that you cant give all of them an active while() loop (only ~1000 or such). So use a global while() loop to e.g. update/change them, and the event system for e.g. push or impact events (just like normal entities).

I have tried something similar on time and its possible but not as high numbers as minecraft I think (unless you use some really complicated tricks to solve it).
Posted By: Wjbender

Re: my sandbox game develop have some questions - 07/27/16 14:40

hi i have done similar terrain as minecraft-like and marching cubes voxel based and normal height based based projects, in unity and gamestudio , i can only stress that your approach is on the wrong track , in the case where you wish to represent a lot of models /entities as fast as possible ,each entity must be rendered and that is way to much , you must fake it by joining the meshes or creating/building up a single mesh to represent all the cubes visible faces such that it takes only one mesh to be rendered instead of thousands ..

http://forum.unity3d.com/threads/wip-john-doe-yet-to-be-named-project.393060/

you need to research why and how.
Posted By: sivan

Re: my sandbox game develop have some questions - 07/27/16 16:48

similar thing can be, more exactly already made with Unreal Engine 4, by instanced static meshes and in more professional solution by procedural mesh generation. there is a tutorial how to make it, and maybe a marketplace item too... it requires really advanced optimizations.
Posted By: Reconnoiter

Re: my sandbox game develop have some questions - 07/27/16 17:40

Originally Posted By: sivan
similar thing can be, more exactly already made with Unreal Engine 4, by instanced static meshes and in more professional solution by procedural mesh generation. there is a tutorial how to make it, and maybe a marketplace item too... it requires really advanced optimizations.
, but where is the dirty-Acknexing in that? grin
Posted By: sivan

Re: my sandbox game develop have some questions - 07/27/16 18:35

I don't think it can be effectively made with 3dgs, it is better to choose the right engine for your game than to be tight by an engine's limitations. the strengths of 3dgs are located in other areas...
Posted By: Dico

Re: my sandbox game develop have some questions - 07/27/16 22:37

This is an old exemple like minecraft created by acknex 8 : https://www.youtube.com/watch?v=6vCf_g1cWGc
Posted By: jenGs

Re: my sandbox game develop have some questions - 07/28/16 09:46

I created something like that a while ago. But not with a blocky world. I used marching octats (or something like that, I can't remember) to proceduraly generate the "natural" looking world.

I created chunks of terrain. Every Terrain hat three lod steps. But the big problem was that the realtime modification needed to be done on the cpu, because directx9 doesn't support this nice geometry features in shaders.

For blocky worlds it should not be so heavy on the fps to recreate the terrainchunk. But my guess is, that it will never be so fluent like minecraft or other sandbox games.

Another approach would be using a shader. You create a terrain-chunk with all possible faces and hide those which are not visible. But collision will be a nightmare then. And the polygons are still rendered even if they are not visible.

Use another engine with nice advanced shader capability.
Posted By: Reconnoiter

Re: my sandbox game develop have some questions - 07/28/16 11:11

Originally Posted By: Dico
This is an old exemple like minecraft created by acknex 8 : https://www.youtube.com/watch?v=6vCf_g1cWGc
, going a bit offtopic here, but what is that Alphabox you are developing? Looks interesting.
Posted By: Anonymous

Re: my sandbox game develop have some questions - 07/28/16 11:32

^-- He's been working on port platform to android for sometime. In fact HE posted about a early version that could convert any pure 2d 3gds game to android long ago. I'd say this is a next step and full evolution to 3d .. But just guessing.
Posted By: Reconnoiter

Re: my sandbox game develop have some questions - 07/28/16 11:42

Originally Posted By: Malice
^-- He's been working on port platform to android for sometime. In fact HE posted about a early version that could convert any pure 2d 3gds game to android long ago. I'd say this is a next step and full evolution to 3d .. But just guessing.
, oh that is pretty cool
Posted By: Dico

Re: my sandbox game develop have some questions - 07/28/16 12:00

Originally Posted By: Reconnoiter
Originally Posted By: Dico
This is an old exemple like minecraft created by acknex 8 : https://www.youtube.com/watch?v=6vCf_g1cWGc
, going a bit offtopic here, but what is that Alphabox you are developing? Looks interesting.


Originally Posted By: Malice
^-- He's been working on port platform to android for sometime. In fact HE posted about a early version that could convert any pure 2d 3gds game to android long ago. I'd say this is a next step and full evolution to 3d .. But just guessing.


Yes But now it support 3d games laugh
I will add the new version this week so it can fix some bugs found in last version
Posted By: Wjbender

Re: my sandbox game develop have some questions - 07/28/16 21:13

https://github.com/krispykrem/Infiniminer

good to start learning with , dont copy and paste though , just learn the method.
Posted By: 20BN

Re: my sandbox game develop have some questions - 12/07/16 13:37

THANKS ALL!

I used dynamic model and group loading to solve this problem.
but i have some problems:
1. how to run dynamic strings script etc: _chr("error("/OK!"/);") ?
2. shader-c evo can't support 2nd UV Lightmap, give me some advice please?
3. shader-c evo can't support terrain shader and water shader, give me some advice please?
4. shader-c evo can't support alpha or TRANSLUCENT, give me some advice please?

thanks again.
Posted By: Reconnoiter

Re: my sandbox game develop have some questions - 12/08/16 16:08

Hi 20BN,

3) terrain and shade-c EVO (/the newest version) is complicated, easiest way is to just use normal models as terrain (otherwise your mostly likely going to have to sacrifice some other features)
4) yes it does support them, but you mostly likely use the wrong .fx file. Open the .fx file you use and uncomment #define ALPHA. Than use .png or 32 bit .tga with alpha channel for transparent texture.

Also check this thread incase you already haven't -> http://www.opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=460457#Post460457
Posted By: Reconnoiter

Re: my sandbox game develop have some questions - 12/09/16 15:16

I have been messing with transparency to in Shade-C and it seems you have 2 options and maybe this will be of help to you:

1) One is when you either fully hide or show a part of the texture (bit like the OVERLAY flag in gs3d).

2) and the other is normal transparency.

For both you have to set the TRANSLUCENT flag for the entity, than in the shade-c .fx file you use in your material only uncomment '#define ALPHA' to get result 1 (OVERLAY like) or uncomment both '#define ALPHA' and '#define TRANSPARENT' for result 2. And your entity's texture needs to have transparent layer or an alpha channel (so use a .png or 32 bit .tga texture) otherwise it will be invisible.
What is pretty cool that stuff like shadows and emissive masks still seem to work correctly for transparent parts too, only gloss maps doesn't seem to work I think.

Here is an example of a .fx file for transparent material:

Code:
//------------------------------------------------------------------------------
//----- USER INPUT -------------------------------------------------------------
//------------------------------------------------------------------------------

//assign skins
#define SKIN_ALBEDO (skin1.xyz) //diffusemap
#define SKIN_ALPHA (skin1.w) //alphamap
#define SKIN_NORMAL (skin2.xyz) //normalmap
#define SKIN_GLOSS (skin2.w) //glossmap
#define SKIN_EMISSIVEMASK (skin3.y) //emissive mask
#define SKIN_COLOR (skin3.w) //(team)color mask

#define NORMALMAPPING //do normalmapping?

#define GLOSSMAP //entity has glossmap?
//#define GLOSSSTRENGTH 0.2 //glossmap channel will be set to this value if GLOSSMAP is not defined

#define ALPHA //entity has alphamap?
#define TRANSPARENT //entity alpha should be interpreted as transparent/translucent?

#define EMISSIVEMASK //use emissive mask? (formula: emissive_color = SKIN_EMISSIVEMASK * SKIN_ALBEDO)


//------------------------------------------------------------------------------
// ! END OF USER INPUT !
//------------------------------------------------------------------------------

#include <scHeaderObject>

//custom code goes here

#include <scObject>

© 2024 lite-C Forums