Help Can not use more than 19 Entitys

Posted By: RaceBert

Help Can not use more than 19 Entitys - 02/26/08 21:58

Hello,

when I try to use more than 19 Entitys, the objects will freeze. I only can move the camera.
I build a scene with a boulder (movable) and a wall with bricks.
It works fine with 18 bricks and one boulder but not more. Who can help me?
(sry, I am a n00b)
Posted By: RaceBert

Re: Help Can not use more than 19 Entitys - 02/27/08 15:23

It seem that the problem is not the number of entitys. If I use Spheres everything works fine but when I try to use boxes (for a destroyable brick construction) the problem happens again. The boxes are not extactly one on an other. (can not explain in english and do it in german: Die einzelnen Steine verschmelzen ein kleines Stück (rutschen ineinander) - if anybody can translate it - please do it)
Posted By: tindust

Re: Help Can not use more than 19 Entitys - 02/27/08 17:22

You said the blocks "melt" together. Which version GS do you use? It could be as simple as the vertex snap is to large, it automatically aligns objects. It is possible that the bounding boxes cross which could lead to that the blocks get stuck in each other. Try to decrease the vertex snap in WED or change the bounding boxes of each block.
cheers
Posted By: RaceBert

Re: Help Can not use more than 19 Entitys - 02/27/08 23:48

Sounds fine but please explain it a bit more because I am a noob and my english is not really good. I am from Germany and I use A7 Extra

I made the Bricks with MED and placed it with the Script editor
Posted By: tindust

Re: Help Can not use more than 19 Entitys - 02/28/08 00:00

OK, then of course the vertex snap does not apply here since it is found in the A6 WED. Two things to look at then:
1/ When you initially place the blocks, make sure their position offset is large enough so that they separate a little.
2/ read up on "bounding box" in the manual. That will explain when there can be a problem with the bounding boxes.

Those would be the first two "simplest" things to check.
Posted By: RaceBert

Re: Help Can not use more than 19 Entitys - 02/28/08 10:41

I think I need to use the "c_setminmax(my)"
But I have no idea how it works, there are not enought information inside the manual.
Posted By: RaceBert

Re: Help Can not use more than 19 Entitys - 02/28/08 14:59

Sometimes it work, sometimes not and I can not find out a reason.
In some cases, the bricks stuck together and the physics stops.
Posted By: tindust

Re: Help Can not use more than 19 Entitys - 02/28/08 16:29

The set minmax must be done for each model. Easiest is probably to do it when each entity is created. That is when the created entity has the me-pointer set to it. Just add the line: c_setminmax(my);. That will reset the bounding box for that particular entity. You could also set its hull to narrow.
Posted By: RaceBert

Re: Help Can not use more than 19 Entitys - 02/28/08 21:25

If I put 3 rows of bricks to build a wall the 21th stuck.
c_setminmax does not help
If I put 21 Bricks on different places I do not have that problems

If I use more than 40 Bricks some slide around like ants and has no shadow.
Posted By: tindust

Re: Help Can not use more than 19 Entitys - 02/28/08 22:22

Looks like it is improving at least. Have you done phent_settype where you can set the collision hull to ellipsoid, or have you set the entity flag my.POLYGON = on?
The Manual is your friend! Look up Hull, Collison etc.
Posted By: RaceBert

Re: Help Can not use more than 19 Entitys - 02/29/08 00:57

phent_settype is set to BOX because I try to mage layers of bricks

I will try the POLYGOM=ON etc.

But I think the problem is the CPU-Power (E6600)

The bricks colide not correct after about 40 bricks.
Posted By: tindust

Re: Help Can not use more than 19 Entitys - 02/29/08 01:33

Hmm, not sure exactly what you trying to do, but if you continue to add physics entities you might try to turn off the physics for those that are not needed any longer. That would free up cpu power.
Posted By: RaceBert

Re: Help Can not use more than 19 Entitys - 02/29/08 10:41

I build some constructions with bricks [phent_settype(eBrick0001,PH_RIGID,PH_BOX);]. Later I plan that the player can set the bricks in his own way.

Planned were a little game with about 200-500 bricks.

If the bricks are close to each other the prblems happen.
When I put boulder [phent_settype(eBoulder,PH_RIGID,PH_SPHERE);] in my landscape, the problems do not happen...

I think the problem is the distance between the bricks. I can place about 100 bricks with a greater distance to each other without problems.
If I build a staple with 20 Bricks, no problems happen.
If I try to build a wall, the problems causes..

(Excause me for my bad english - i red the manual but I do not understand all, I got A7 on beginning this week)
Posted By: RaceBert

Re: Help Can not use more than 19 Entitys - 02/29/08 11:54

eBrick0001.POLYGON=on;
set(eBrick0001,POLYGON);
does not work....
Syntax Error
Posted By: RaceBert

Re: Help Can not use more than 19 Entitys - 02/29/08 12:48

Maybe I do not understand everthing from the manual because it is in english.

function Brick(var m_x, var m_y, var m_z,var mBy)
{
var y_position;
eBrick0001 = ent_create("Brick.mdl" ,vector(m_x, m_y, m_z), NULL);
phent_settype(eBrick0001,PH_RIGID,0);
phent_setmass(eBrick0001,0,PH_BOX);
eBrick0001.POLYGON=on;
set(eBrick0001,POLYGON);
// wait(1);
vec_set(eBrick0001.min_x,vector(Br_x-0.01,Br_y-0.01,Br_z-0.01));
vec_set(eBrick0001.max_x,vector(Br_x-17.97,Br_y-35.97,Br_z-12.97));
// wait(1);
c_setminmax(eBrick0001);
// c_updatehull(eBrick0001,1);
// wait(1);
y_position = eBrick0001.y;
eBrick0001.y = y_position+mBy;
// wait(5);
phent_settype(eBrick0001,0,0);
phent_settype(eBrick0001,PH_RIGID,PH_BOX);
// wait(1);
phent_setmass(eBrick0001,3,PH_BOX);
phent_setfriction(eBrick0001,90);
phent_setelasticity(eBrick0001,70,70);
phent_setdamping(eBrick0001,90,90);
set(eBrick0001,SHADOW);
eBrick0001.material = mat_metal;
eBrick0001.emask |= ENABLE_FRICTION;

// wait(5);
}
Posted By: tindust

Re: Help Can not use more than 19 Entitys - 02/29/08 17:14

Since you are using models you may try to in script manually change the bounding box sizes. Look at the instructions for c_setminmax(ENTITY* ent) and min_x,max_x. Decrease the bounding box sizes hopefully solves the problem.
Here is the link to online manual.
Posted By: xXxGuitar511

Re: Help Can not use more than 19 Entitys - 02/29/08 18:32

Code:

function Brick(var m_x, var m_y, var m_z,var mBy)
{
eBrick0001 = ent_create("Brick.mdl", vector(m_x, m_y+mBy, m_z), NULL);
set(eBrick0001, SHADOW);
eBrick0001.material = mat_metal;
//
phent_settype (eBrick0001, PH_RIGID, PH_BOX);
phent_setmass (eBrick0001, 3, PH_BOX);
phent_setfriction (eBrick0001, 90);
phent_setelasticity (eBrick0001, 70, 70);
phent_setdamping (eBrick0001, 90, 90);
}


Posted By: RaceBert

Re: Help Can not use more than 19 Entitys - 02/29/08 19:12

I tryed it like your Code xXxDisciples but it will not work.

To change the size with c_setminmax() will not help too.

I am really confused
Posted By: xXxGuitar511

Re: Help Can not use more than 19 Entitys - 02/29/08 20:44

I simply cleaned up your above code. I didn't look into the details...

Everything looks fine, but the physics engine is not going to like having all those objects stacked together, especially 3DGS ODE physics. Try using Newton, it handles this better, but you'll still get bad results...

You'll need to manually switch physics on/off for the bricks...
Posted By: tindust

Re: Help Can not use more than 19 Entitys - 03/01/08 08:18

Yeah, xXxDisciple is right. (Kind of liked your old name xXxGuitar511 )

It's a real challange to the physics engine. Well, looking at what you try to create I wonder why you want to use physics at all when building the wall? It may be easier to have the bricks be non-physics entities when the wall is being built or changed by the player. Theb if there is a particular event occurring, change the involved bricks into physics ents. Then you avoid the condition that is the root of the problem.
Posted By: RaceBert

Re: Help Can not use more than 19 Entitys - 03/03/08 11:59

But if I do not use the physics from beginning the sense of the game get lost. I will try newton or.. give this project up, maybe when it look good and my plannings do not get lost I will try to activate the physics after building. But first I will have a look for an other way to solve that problem. Thanks alot for helping.
Posted By: DavidLancaster

Re: Help Can not use more than 19 Entitys - 03/05/08 00:17

I got the same problem with too many physics objects too close together. Just has to be managed.
© 2024 lite-C Forums