initialise() methods

A place to discuss everything about the Orxonox framework.

Moderator: PPS-Leaders

Post Reply
User avatar
1337
Baron Vladimir Harkonnen
Posts: 521
Joined: Wed Oct 10, 2007 7:59 am

initialise() methods

Post by 1337 » Sun Dec 14, 2008 5:31 pm

Something for after the presentation:
I think we might need an initialise() method for certain classes like Level or Scene or maybe Gametype.
The idea is from an issue with physics: I cannot add the WorldEntities directly to the Scene (and with it Bullet) because that would mean every time something vital changes about the physical body, it has to be removed and added again. Thats awfully slow.
There's also some issues with that.

--> Objects get added in the first tick. But thats bad practice.
Much better would probably be a function that gets called in the Scene AFTER the level has been loaded. I'm sure there are other areas of applications.

Never mind right now, we've got loads of important stuff to work on. ;)
http://www.xkcd.com/
A webcomic of romance, sarcasm, math, and language.

User avatar
beni
Baron Vladimir Harkonnen
Posts: 949
Joined: Tue Oct 03, 2006 9:15 am
Location: Zurich
Contact:

Post by beni » Mon Dec 15, 2008 2:53 pm

So if I understand this right you first want to load a practically empty scene and then start adding objects afterward?

What does 'vital changes' mean in reference to the physical body?

I agree it's bad practice to load everything in the first tick. But I don't understand the issue, I guess. Please shed some more light on it, maybe with an example or something, if possible.
"I'm Commander Shepard and this is my favorite forum on the internet."

User avatar
1337
Baron Vladimir Harkonnen
Posts: 521
Joined: Wed Oct 10, 2007 7:59 am

Post by 1337 » Mon Dec 15, 2008 2:56 pm

quite simple: After everything has been loaded from the XML file, we simply tell the Level and the Scene that they can do some preparations, that are only possible after everything is set.

By "adding" I meant adding physical bodies to Bullet, which is quite separate.
http://www.xkcd.com/
A webcomic of romance, sarcasm, math, and language.

User avatar
beni
Baron Vladimir Harkonnen
Posts: 949
Joined: Tue Oct 03, 2006 9:15 am
Location: Zurich
Contact:

Post by beni » Mon Dec 15, 2008 3:01 pm

Oh AFTER loading. Now I got it.. I guess that we need to work on loading anyway since a level consists of so much more than what we have right now. So this'll need much work anyway. A initialise function after setting everything seems a reasonable thing to do.
"I'm Commander Shepard and this is my favorite forum on the internet."

User avatar
1337
Baron Vladimir Harkonnen
Posts: 521
Joined: Wed Oct 10, 2007 7:59 am

Post by 1337 » Mon Dec 15, 2008 3:15 pm

Actually, the loader can do everything I can think of right now...
Except that one little request.
But anyway, what more do you want wit loading?
http://www.xkcd.com/
A webcomic of romance, sarcasm, math, and language.

User avatar
x3n
Baron Vladimir Harkonnen
Posts: 810
Joined: Mon Oct 30, 2006 5:40 pm
Contact:

Post by x3n » Mon Dec 15, 2008 3:57 pm

The problem is not that easy, there are several processes which are somehow close to loading and it should always work, with or without initialization. But as you said, that's not the main problem right now. ;)
Fabian 'x3n' Landau, Orxonox developer

User avatar
greenman
Baron Vladimir Harkonnen
Posts: 360
Joined: Wed Oct 03, 2007 2:53 pm
Contact:

Post by greenman » Mon Dec 15, 2008 4:05 pm

just not that i forget it:

having an initialize routing may improve our single-player performance, but imagine the loading process on a client:
- server sends all objects
- each object is first getting created on the client with default values and then all variables of the object are being updated. this happens one-by-one for every object (same order as on server)
- maybe during update of variables callbacks are being called

so as you might realise an initialization function could be problematic on clients
There are only 10 types of people in the world: Those who understand binary, and those who don't.

User avatar
1337
Baron Vladimir Harkonnen
Posts: 521
Joined: Wed Oct 10, 2007 7:59 am

Post by 1337 » Mon Dec 15, 2008 4:14 pm

yeah, I see can that...
seems almost impossible.
http://www.xkcd.com/
A webcomic of romance, sarcasm, math, and language.

Post Reply

Who is online

Users browsing this forum: No registered users and 11 guests