Dedicated and asserts

Get help with programming issues.

Moderator: PPS-Leaders

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

Dedicated and asserts

Post by x3n » Tue Jun 16, 2009 12:10 pm

reto wrote:[20:21] <reto> Mir isch no öbbis ufgfallä: Eusi "Mach dr dedicated-server laufend"-Strategie isch nid allzu guet. Mir hei überhaupt kei Sicherheit, dass nid doch neumä es Assert triggered wird, will mä halt mol öbbis exotisches im Dedicated ladet...
translation:
asserts suck
You're right, asserts surely aren't a good idea to be used in the code except for development and debugging, but of course never ever for runtime stability. But lucky as we are, some wise guy (not me) wrote one small line in Exceptions.h:

Code: Select all

CREATE_ORXONOX_EXCEPTION(NoGraphics);
:adoration:

So I suggest using "ThrowException(NoGraphics, "some text")" to handle the "exotic" stuff, which provides us much more options to catch such cases in the future.
Fabian 'x3n' Landau, Orxonox developer

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

Re: Dedicated and asserts

Post by 1337 » Tue Jun 16, 2009 1:18 pm

I agree but actually I was thinking about something more convenient for those developing a class:
At first I thought of something like 'CreateGraphicsOnlyFactory', but then I remembered that the clients receives objects instances from the server, so this probably isn't possible. I'm currently only thinking about classes that really do nothing in dedicated mode except existing in the first place.
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:

Re: Dedicated and asserts

Post by x3n » Sat Jun 20, 2009 12:24 pm

Hm, so you're thinking about something like a null-scenemanager for Ogre which does nothing? But isn't that exactly what you already tried once, but didn't succeed because Ogre still needed a window? Or am I wrong?
Well, if we somehow manage to bring this to work, it would be probably the best solution, so maybe it's worth a second try (and maybe it works better with a newer version of Ogre, but that's yet another problem).
Fabian 'x3n' Landau, Orxonox developer

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

Re: Dedicated and asserts

Post by 1337 » Sat Jun 20, 2009 11:29 pm

Actually I wasn't thinking of that either ^^

From my point of view I see:
- Classes that don't need graphics in any way to work (just SceneNode or so, but no particle effects, textures or anything)
- Classes that have graphics stuff if showGraphics()
- Classes that only exist to visualise something hence without graphics they're useless
What I'm really interested in is the third group. It shouldn't even be possible to create such an object in the dedicated mode.
And I also think that the second group shouldn't be too large but instead get separated into the first and the third group.

I hope you got the idea but I don't yet see a good solution. Maybe something like an optional argument that specifies the graphics or sound capabilities of a class when creating the class factory.
http://www.xkcd.com/
A webcomic of romance, sarcasm, math, and language.

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

Re: Dedicated and asserts

Post by greenman » Tue Jun 23, 2009 8:44 am

1337 wrote: What I'm really interested in is the third group. It shouldn't even be possible to create such an object in the dedicated mode.
from the network point of view these objects have to exist on the dedicated server, or otherwise they won't exist on the client (which obviously needs them) neither.
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

Re: Dedicated and asserts

Post by 1337 » Tue Jun 23, 2009 9:38 am

I totally see that. But what about something like ghost objects? From a network point of view they exist, but not actually.
I cannot give an implementation of this right away, but maybe it is possible.
http://www.xkcd.com/
A webcomic of romance, sarcasm, math, and language.

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

Re: Dedicated and asserts

Post by greenman » Tue Jun 23, 2009 6:25 pm

you just have to make sure that theese ghost objects on the client aren't ghost objects anymore. then you would have to use showGraphics() or whatever just as we're doing now.

i think what x3n proposed would be the best solution:
a ogre interface which always checks whether it should show graphics or not and then does the appropriate or just nothing ....
or we could stick with what we do now, but then everyone always has to keep in mind that there is also a dedicated server ...
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

Re: Dedicated and asserts

Post by 1337 » Tue Jun 23, 2009 6:27 pm

Have fun writing that ghostly SceneManager interface...
http://www.xkcd.com/
A webcomic of romance, sarcasm, math, and language.

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

Re: Dedicated and asserts

Post by greenman » Wed Jun 24, 2009 6:52 am

:D
i have no clue how much time it would take to do, but i just think this would be the (from the architectural point of view) best way to resolve this problem. one would have to write this once and maybe update it for new versions of ogre but then we (hopefully) wouldn't have problems with this issue anymore
There are only 10 types of people in the world: Those who understand binary, and those who don't.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest