I noted that i have too little fps on the map with 30-40 wall models, the same number of tower models and 10-20 house models (in summary, about 100 entities).
On the other hand, i remember my playing with instancing and also i remember post on this forum with 500K cubes.
So, lets see: first, i procedurally generate map, and then i need to generate SBX file by my hands so i would be able to load level in editor or game. So the question is: how engine knows that this object (that is loading now) is instanced or not? I see two ways:
1)
- while saving map into SBX, Editor puts in order models with the same name
- while LoadMap, engine looks at the name of previous entity (because they are already categorized by name) and make CopyEntity if the names are the same
2)
- engine just have list of all entities and while it loads new one, it checked by that list, and if entity already exists, it makes CopyEntity, if not - creates new one.
So, generated file looking like this:
Model {
path="tower.gmf"
position=35.75,0,35.75
rotation=0,0,0
scale=1,1,1
id=22979576
"class"="Model"
"collisiontype"="2"
"intensity"="1.0000000000000000"
"name"="GeneratedModel_0"
}
Model {
path="wall_large.gmf"
position=30.25,0,35.75
rotation=0,0,0
scale=1,1,1
id=22979576
"class"="Model"
"collisiontype"="2"
"intensity"="1.0000000000000000"
"name"="GeneratedModel_1"
}
Model {
path="tower.gmf"
position=24.75,0,35.75
rotation=0,0,0
scale=1,1,1
id=22979576
"class"="Model"
"collisiontype"="2"
"intensity"="1.0000000000000000"
"name"="GeneratedModel_2"
}
Model {
path="wall_large.gmf"
position=19.25,0,35.75
rotation=0,0,0
scale=1,1,1
id=22979576
"class"="Model"
"collisiontype"="2"
"intensity"="1.0000000000000000"
"name"="GeneratedModel_3"
}
Model {
path="tower.gmf"
position=13.75,0,35.75
rotation=0,0,0
scale=1,1,1
id=22979576
"class"="Model"
"collisiontype"="2"
"intensity"="1.0000000000000000"
"name"="GeneratedModel_4"
}
Do i need to group it like "tower", "tower", "tower", "wall", "wall", "wall" for enabling instancing?