When you create a model from a world it only takes into account the soya 
faces that are inside the world, not the body or anything else. Anyway, 
even if it did I don't think you can make your game faster with this. 
Turning a world into a model require a lot of CPU. As I said before, I 
think the best thing you can do to speed your game is to make your own 
space partitioning system, one that fits your game's requirements.

Souvarine.



Lunpa, The wrote:
> Scratch that.  I built a test file out of one of the tutorial examples
> that shows the exact same problem without using any of the game's
> code. (but one of it's cal3d models)
>
> I have it attached if you're interested, but here's the relevant stuff:
>
> class loop_nest(soya.MainLoop):
>    def __init__(self, foo):
>     soya.MainLoop.__init__(self, foo)
>     self.scene = foo
>     self.terrain = soya.World(self.scene)
>     self.model = soya.AnimatedModel.get("column")
>     self.last = 0.0
>     self.mode = 0
>
>    def begin_round(self):
>     if self.fps != self.last and self.mode !=2:
>         self.last = self.fps
>         self.mode = 1
>         body = soya.Body(self.terrain, self.model)
>         body.set_xyz(random.randint(-10,10), random.randint(-2,0),
> random.randint(-10,-10))
>         body.rotate_y(random.randint(0,360))
>         body.rotate_z(-90)
>         print "body count: " + str(len(self.terrain.children))
>         print "fps: " + str(self.fps)
>
>     soya.MainLoop.begin_round(self)
>
>    def end_round(self):
>     if self.last <= 10.0 and self.mode == 1:
>         self.mode = 2
>         self.model = self.terrain.to_model()
>         self.scene.remove(self.terrain)
>         del self.terrain
>         body = soya.Body(self.scene, self.model)
>     
>     soya.MainLoop.end_round(self)
>
>
>
>
>
> console output for me (I expect that results would very):
>
> body count: 1
> fps: 46.4293001448
> body count: 2
> fps: 44.2594641738
> body count: 3
> fps: 23.1871219634
> body count: 4
> fps: 14.7546727549
> body count: 5
> fps: 10.2251945623
> body count: 6
> fps: 8.34125407502
>
>
> Once the FPS drops below 10, the program will attempt to compress the
> containing world
> into a model like I theorized before, then remove existing bodies, and
> then load up the model
> in a single body instance to see if there is a change, but the World
> instance itself doesn't have any model data associated, just bodies,
> so it doesn't really do anything.
>
>
> I similar test I ran filled up the screen with 100 animated objects
> (albeit individually rather high in poly count):  there was an
> identical pattern to refreshing that the game was showing with a lot
> of relatively simple models.
>
>
> Is there a better way to do this?
>
> Also, if anyone can think of a way to compress the Body instances of a
> world into a single model, (so I can finally put that thought to rest)
> it would be very appreciated :)
>
>


_______________________________________________
Soya-user mailing list
Soya-user@gna.org
https://mail.gna.org/listinfo/soya-user

Reply via email to