cizi.kim Posted January 26, 2011 Posted January 26, 2011 I maked a lot of PlayerActors into small field using sample actor2.cpp in players folder. the test was faild because the Unigine has a bug to make up worldpositions. change player count 25 to 441 in 'actor_02.cpp' void create_scene() { int num = 0; int size = 10; float space = 4.0f; for(int y = -size; y <= size; y++) { for(int x = -size; x <= size; x++) { for(int z = 0; z < 4; z++) { ObjectMesh mesh = add_editor(new ObjectMesh("samples/players/meshes/sphere_00.mesh")); mesh.setMaterial(get_material(x ^ y),"*"); mesh.setProperty("surface_base","*"); mesh.setWorldTransform(translate(vec3(x,y,0.0f) * space + vec3(0.0f,0.0f,0.5f + z * 1.0f))); BodyRigid body = class_remove(new BodyRigid(mesh)); ShapeSphere shape = class_remove(new ShapeSphere(body,0.5f)); shape.setMass(200.0f); } } } [color="#FF0000"]size = 10; // <-- for teat.[/color] for(int y = -size; y <= size; y++) { for(int x = -size; x <= size; x++) { vec3 position = vec3(engine.game.getRandom(-8.0f,8.0f),engine.game.getRandom(-8.0f,8.0f),1.0f); vec3 direction = vec3(engine.game.getRandom(-1.0f,1.0f),engine.game.getRandom(-1.0f,1.0f),0.0f); thread("player_update",position,direction); num++; } } PlayerSpectator spectator = new PlayerSpectator(); spectator.setPosition(vec3(-16.0f,0.0f,8.0f)); spectator.setDirection(vec3(1.0f,0.0f,-0.5f)); engine.game.setPlayer(spectator); return format("%d Third person Actors",num); }
serega Posted January 26, 2011 Posted January 26, 2011 Could you please say in details why the test failed?
cizi.kim Posted January 26, 2011 Author Posted January 26, 2011 I want to make a small town, there ara a lot of people as a AI NPC in town. so, I tried to make prototype using a sample script in players folder. and I have changed a bit codes. I just had increased the number of NPC count as you have seen in previous post. and the program always was stopped in a few seconds. I have attached a test screenshot. thanks.
serega Posted January 27, 2011 Posted January 27, 2011 and the program always was stopped in a few seconds. Thanks. I have the same behavior of the program. The problem assigned to devs.
frustum Posted January 27, 2011 Posted January 27, 2011 The bug is fixed. As temporary solution you can use single-threaded world update. Console command is: "world_num_threads 0"
cizi.kim Posted January 28, 2011 Author Posted January 28, 2011 The bug is fixed. As temporary solution you can use single-threaded world update. Console command is: "world_num_threads 0" Temporary solution is not bad. :) but, the frame performance comes down as you know. my team already was tried your solution before see the thread. Can I get a part of the fixed code or full source files before next update? thank you.
Recommended Posts