Developement: Quick Question, Quick Answer

Topics about the general development of Orxonox.

Moderator: PPS-Leaders

User avatar
Mozork
Mogthorgar, the mighty
Posts: 134
Joined: Wed Sep 24, 2008 3:27 pm

Developement: Quick Question, Quick Answer

Post by Mozork » Wed May 18, 2011 8:49 am

Since I have a quick question that doesn't warrant a thread in its own, I thought I might start this thread to address exactly such question. So whenever you have a question that is quick and you think has a quick and simple answer, you can use this thread to ask it.

Now to my question:
Since the new LevelInfo object we can tag a level with various tags. These tags could then be used to only display a subset of levels you are interested in based on their tags.
At the moment, all valid tags have to be specified and invalid ones are not accepted and throw a warning. I did this to ensure consistency, e.g. so that we don't have the tag "test" in some levels and the tag "Test" in others, which would make classification considerably harder.
Do you think that one should be able to choose the tags freely or are the restrictions that are in place necessary? I'm kind of undecided on the issue...

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

Re: Developement: Quick Question, Quick Answer

Post by x3n » Wed May 18, 2011 10:53 am

I'm not sure if this thread will be used... but let's give it a try.
Also I'm not sure if this is really a quick question ;)

In general I assume that tags are free to choose, but in this case this doesn't make much sense because the tags are not defined by the player, but rather by the level designer. There has to be some sort of a filter in the game (or level list) and since the player doesn't know the possible tags, they have to be known to the system. So it's probably good to define a set of allowed tags.

Another question is how we intend to use these tags. I see some need to hide test levels and to filter levels for specific gametypes. But do we really need tags to achieve this? A boolean flag hidden/visible would be enough to hide test levels, while gametypes are already defined in level files. So what other usages do you see for tags? (I'm not saying I don't like them, I'm just curious how they would be used in the end.)
Fabian 'x3n' Landau, Orxonox developer

User avatar
Mozork
Mogthorgar, the mighty
Posts: 134
Joined: Wed Sep 24, 2008 3:27 pm

Re: Developement: Quick Question, Quick Answer

Post by Mozork » Wed May 18, 2011 1:27 pm

I see the just as a more generic form of various booleans that Levels could have. One useful example would be the distinction between multi- and singleplayer levels, or maybe there are levels that are both. Hence in the Multiplayer Menu we would only display levels that work with multiple players.
There are probably also many other useful distinctions, e.g. difficulty levels or gametype, although, admittedly, this could be implemented separately as well...

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

Re: Developement: Quick Question, Quick Answer

Post by x3n » Wed May 18, 2011 2:43 pm

Well, we probably need a dedicated gametype for single player levels, so this doesn't necessarily need a separate tag/flag. However you're of course right that there are more possible options, for example some single player levels may also work in coop mode, while others don't.

So to answer the original question, if the tags just replace a bunch of well defined booleans, then the tags should be defined just the same way.
Fabian 'x3n' Landau, Orxonox developer

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

Re: Developement: Quick Question, Quick Answer

Post by greenman » Wed May 18, 2011 3:01 pm

i like the idea of this topic and i'm curious if it'll be used ...

i think in this use case fixed tags will be fine esp. if we might need some menu elements or sheets that know all/some tags and select/filter between them
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: Developement: Quick Question, Quick Answer

Post by 1337 » Sun May 22, 2011 6:37 pm

@quick question
I too like the idea, but not the thread ;(
We have a orxonox-dev mailing list for exactly those things. Every developer will get the message and can reply in a quick and easy manner. So far, we haven't used it at all, but writing emails is much simpler than writing forums posts. That would fit your needs exactly.

@tags
We might want to distinguish between tags that define bhaviour (test levels, unstable levels, multiplayer/singleplayer levels, etc.) and those that define content. What do you think?
http://www.xkcd.com/
A webcomic of romance, sarcasm, math, and language.

User avatar
Mozork
Mogthorgar, the mighty
Posts: 134
Joined: Wed Sep 24, 2008 3:27 pm

Re: Developement: Quick Question, Quick Answer

Post by Mozork » Wed May 25, 2011 10:48 pm

I would be inclined to agree, regarding the use of the dev mailinglist for this purpose. However the archive is currently not working, which makes the forum more suitable.

Regarding the tags: I thing a separation between behavior and content seems reasonable. The content tags could probably also be left unrestricted.

The Jo
General DuGalle
Posts: 121
Joined: Mon Mar 01, 2010 7:43 pm

Re: Developement: Quick Question, Quick Answer

Post by The Jo » Wed Jun 08, 2011 10:17 pm

Wrong include path -> where is the mistake ?
I want to include Rocket.h in AIController.cc so I typed

Code: Select all

#include "weapons/projectiles/Rocket.h"
 
But this resulted in an compiler error: fatal error: weapons/projectiles/Rocket.h: Datei oder Verzeichnis nicht gefunden
compilation terminated.
In spite of several attempts (other path versions) I couldn´t get rid of the error.
Fail. Fail again. Fail better.

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

Re: Developement: Quick Question, Quick Answer

Post by 1337 » Wed Jun 08, 2011 10:43 pm

Simple solution: Don't do it ;)

Think about the implications on dependencies if you were to do this. Then you will figure out why this is impossible.
No module ever HAS to be loaded...
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: Developement: Quick Question, Quick Answer

Post by x3n » Thu Jun 09, 2011 11:34 am

Rocket.h is in the weapon module, AIController.cc in the orxonox library.
See the image at the bottom of page 1: http://svn.orxonox.net/webdev/pps/fs10/ ... kuerze.pdf

In the orxonox library you can not use code from a module. Usually classes in modules are children of a base class in the orxonox library, so you can use virtual functions to do what you need. Sometimes we also use interfaces.

In your case the Rocket is a child of ControllableEntity, which is defined in the orxonox library. Try to use this. If it doesn't work out, ask again. Maybe we can find a solution if we know what you want to do :)
Fabian 'x3n' Landau, Orxonox developer

The Jo
General DuGalle
Posts: 121
Joined: Mon Mar 01, 2010 7:43 pm

Re: Developement: Quick Question, Quick Answer

Post by The Jo » Thu Jul 07, 2011 5:30 pm

How can I search the whole orxonox code base and probably even the code of included engines? I'm looking for the string "Failed to reset camera!", which is displayed, whenever a bot uses boost.
Fail. Fail again. Fail better.

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

Re: Developement: Quick Question, Quick Answer

Post by 1337 » Thu Jul 07, 2011 6:17 pm

For the orxonox code: That depends on your IDE. In MSVC I can easily do it with file search. However I don't get the files from the data folder there.

So I usually open a Bash and use grep (on Windows too):
grep -ri "Failed to reset camera" . | grep -v \.svn

If you want to search all sources leading to the orxonox executable: Download them manually and extract them. Then search the folder with all the extracted archives ;)

As for your particular string: you might want to have a look at SpaceShip.cc at the end of the file...
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: Developement: Quick Question, Quick Answer

Post by x3n » Thu Jul 07, 2011 6:59 pm

Hi Jo,

As 1337 said, most IDEs (code editors) have a search function. For example, in CodeBlocks Ctrl+F searches within the current file and Ctrl+Shift+F searches in all files of the project. Other IDEs should have similar features. If you don't use an IDE, you should probably choose one. I think on Linux there are KDevelop, CodeBlocks, Eclipse. CMake can generate projectfiles for them - enter "cmake" in the console and look for the list of generators.

Now of course I'm not a meanie, so I'll point you to the file where the string "Failed to reset camera!" is located: SpaceShip.cc
I had a quick look at the code and it looks like the camera is reset everytime the boost stops. This is a problem, because bots don't have a camera. In fact even remote players in network games don't have a camera, only the "local" (i.e. not remote) and "human" (not a bot) player has one.

ControllableEntity (SpaceShip inherits from this class) has two functions which help with this issue:

Code: Select all

this->hasLocalController() && this->hasHumanController()
If this returns true, it's usually save to reset the camera ;)
(Note how these functions are already called in tick() in SpaceShip.cc, but only to decide whether to enable motion blur or not, but not for the camera)
Fabian 'x3n' Landau, Orxonox developer

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

Re: Developement: Quick Question, Quick Answer

Post by 1337 » Thu Jul 07, 2011 7:10 pm

x3n wrote:Hi Jo,
Now of course I'm not a meanie, so I'll point you to the file where the string "Failed to reset camera!" is located: SpaceShip.cc
That almost sounds like I would be mean... (I hope that omitting the line number was not that mean) :P
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: Developement: Quick Question, Quick Answer

Post by x3n » Thu Jul 07, 2011 7:35 pm

Haha no, don't worry, I guess you're far from being mean. To be honest I didn't see you named the file already in your post when I read it first, so I thought after talking about IDEs for 5 lines I should give a hint. :wink:
Fabian 'x3n' Landau, Orxonox developer

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest