Current SVN activity log

Development directions, tasks, and features being actively implemented or pursued by the development team.

Current SVN activity log

Postby safemode » Sun Jan 10, 2010 12:48 pm

Ok, i'm going to create a new vsfilesystem function for debug output, then make it activate via flag during runtime. when the flag is not used, the function is conditioned to do nothing. when it is active it will output to stderr. I suppose i'll keep the printf syntax argument setup, only no need to specify stderr as arg 1. Instead arg1 will be a priority level of 1 to 3.
debug outputs of 1 will be outputted when --debug is used. Very important debug output only here. As in, the game will likely crash or screw up.

debug outputs of 2 contain all of 1 and also anything related to files missing but not necessarily incorrect. Basically, warnings that probably wont be missed. --debug=more or whatever.

debug outputs of 3 contain developer info and all of 2 and 1 outputs. This is info important mostly to developers and may not be errors at all but not intended as regular output for release.

--debug=all. something like that.
Ed Sweetman endorses this message.
safemode
Developer
Developer
 
Posts: 2150
Topics: 84
Joined: Sun Apr 22, 2007 6:17 pm
Location: Pennsylvania

Share On:

Share on Facebook Facebook Share on Twitter Twitter Share on Digg Digg

Re: Current SVN activity log

Postby safemode » Sun Jan 10, 2010 5:33 pm

I committed the update to vegastrike for the debug argument.

you can see an example of it's use in the GL output block.

it wont appear unless you use --debug=3 since that's what level i set it's output to be in gl_init.

the function change is vs_dprintf instead of supplying stderr as the first argument, you supply a char relating to the priority.
'1' for highest .
'2' for medium type stuff, like missing files
'3' for developer related info. basically informational outputs that have nothing of interest to regular end users. This would be most of the output.

this way normal operation is quiet, --debug=1 or --debug shows only important stuff. and etc.
Ed Sweetman endorses this message.
safemode
Developer
Developer
 
Posts: 2150
Topics: 84
Joined: Sun Apr 22, 2007 6:17 pm
Location: Pennsylvania

Re: Current SVN activity log

Postby safemode » Mon Jan 11, 2010 1:19 am

OK, so klauss proposed an idea of a config file variable and I went with a runtime argument. Technically both can be used.

He set it up as a bool, but made the same requirements as i did about priorities, so this wont work. Instead, i'll add to the options.cpp file a vsdebug char. This character has 3 values, either '1', '2', or '3' but the config file will handle it like any other int. By being turned off in the config file (not existing or whatever), it has a default value of '0'.

We can then remove the static bool call in gl_texture since it's done in options_init. We can then call after options_init if the global var g_game.vsdebug is set to a non '0' value. If so, then we ignore the options file setting. Otherwise, we set g_game.vsdebug to the options file setting, which can be either still unset or some value 1-3.

Then, we dont have to have multiple conditionals to check in vs_dprintf. Just the same one we check now.

In the code, we dont have to wrap any call to vs_dprintf in conditionals, it does that for us. We just call it with the intended priority and message and let it do the work for us.

Hopefully that satisfies klauss and everyone else. I'll commit those changes tomorrow. For now, vssetup will not be modified, this will be a commented option in your config file that you will have to un-comment and set manually. Until vssetup is updated.

And of course, you can always just use the command line argument.

command line trumps config file though.
Ed Sweetman endorses this message.
safemode
Developer
Developer
 
Posts: 2150
Topics: 84
Joined: Sun Apr 22, 2007 6:17 pm
Location: Pennsylvania

Re: Current SVN activity log

Postby charlieg » Mon Jan 11, 2010 3:58 am

Good stuff Mr Sweetman.
Free Gamer - free software games compendium and commentary!
FreeGameDev forum - open source game development community
User avatar
charlieg
Elite Mercenary
Elite Mercenary
 
Posts: 1328
Topics: 56
Joined: Thu Mar 27, 2003 4:51 pm
Location: Manchester, UK

Re: Current SVN activity log

Postby safemode » Mon Jan 11, 2010 7:41 am

Well, I committed the changes this morning before job #1. Master config file was updated in /data, which probably means that unless you want to start with a fresh new config file, you will have to copy the line into your user config file or just ignore the config option until the future when you do start over with a new config file. Either way, the config file option is in the general section named verbose_output.

What verbose output takes is a value of 0,1,2,3 with 0 turning it off. Not existing is also default 0. Turning it off means all output sent to vs_dprintf gets ignored. This will eventually be the majority of output from /vegastrike. Otherwise it has the same effect as --debug, which you can still use and override the config option if you wish.

I still have to update klauss's config variable snippet in gl_texture. Basically, all that's needed is the call to vs_dprintf('3',"whatever message"); No conditionals required or call to get the config variable. All that is done prior. Meaning all the changes to the code will be basically one liners and everyone is happy.

Also, i'm not sure if it was correct, but i basically reversed a function call in the case that nv_cubemaps was not compiled in because it was failing to compile. Since the state was the same as before the change, it didn't look like it could be wrong but klauss would know better there.

Either way, such code is on it's way out ...so this only helps those of us who haven't started compiling with cubemap support yet. I will probably wait until the /data change is done and the code in /vegastrike is known to work. Then we can get rid of the preprocessor macros and just support cubemaps.
Ed Sweetman endorses this message.
safemode
Developer
Developer
 
Posts: 2150
Topics: 84
Joined: Sun Apr 22, 2007 6:17 pm
Location: Pennsylvania

Re: Current SVN activity log

Postby safemode » Tue Jan 12, 2010 11:37 pm

I really need to spend more time figuring out how the whole boost::python thing works.

Basically, what i'm looking to do is make vs_dprintf functional in python and then hijack debug.py to use it for printing it's various levels of output. This would mimic functionality across python the same as within the game, automatically by only changing this one file.

The problem is, i need to expose g_game's object in vegastrike to python, not just the class, but the actual object. Also, use_volumes, as we check against that too. Other than those two objects, all i then need is access to the function.

Then python output will finally behave sanely and be controllable through vegastrike by the same arguments/config controls that vegastrike output is done by. Sweet.
Ed Sweetman endorses this message.
safemode
Developer
Developer
 
Posts: 2150
Topics: 84
Joined: Sun Apr 22, 2007 6:17 pm
Location: Pennsylvania

Re: Current SVN activity log

Postby klauss » Wed Jan 13, 2010 8:36 am

I recommend you rather add a python version of vs_dprintf (that uses vs_dprintf to do its stuff), in the VS module, that way is even more centralized, and you don't have to add boost::python junk to vs_config
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
User avatar
klauss
Elite
Elite
 
Posts: 7243
Topics: 55
Joined: Mon Apr 18, 2005 7:40 am
Location: LS87, Buenos Aires, República Argentina

Re: Current SVN activity log

Postby safemode » Wed Jan 13, 2010 11:37 am

How do python scripts recieve the arguments passed to vegastrike? And how do they recieve options that get set via config file directives ...when i know at least in that aspect, it doesn't seem like C++ exports to python the options class.

If python has access to the arguments we pass to vegastrike ...then re-implementing dprintf is an option, but without that, I could create a special python output class that just encapsulates that dprintf function, as we access it directly anyway in-game. This would keep the python cruft out of VSFileSystem, but i still would need to learn how to do all that. seems fairly complex.
Ed Sweetman endorses this message.
safemode
Developer
Developer
 
Posts: 2150
Topics: 84
Joined: Sun Apr 22, 2007 6:17 pm
Location: Pennsylvania

Re: Current SVN activity log

Postby klauss » Wed Jan 13, 2010 1:55 pm

vsConfig is exported in python/star_system_exports.h, so from python you can read any config variable like

Code: Select all
import VS

VS.vsConfig.getVariable("section","variable","default")


And yep, python support code is terribly messy in VS. It's probably not boost::python's fault, it's VS' attempt at being compatible with ancient versions of boost::python.
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
User avatar
klauss
Elite
Elite
 
Posts: 7243
Topics: 55
Joined: Mon Apr 18, 2005 7:40 am
Location: LS87, Buenos Aires, República Argentina

Re: Current SVN activity log

Postby safemode » Wed Jan 13, 2010 3:35 pm

Still need to access the commandline args. And it would be better to have access to the options class rather than directly to vsconfig. Anyways, that's down the road a bit.


In unrelated news. I have wing commander 2 running on my linux phone :) Woot.
Ed Sweetman endorses this message.
safemode
Developer
Developer
 
Posts: 2150
Topics: 84
Joined: Sun Apr 22, 2007 6:17 pm
Location: Pennsylvania



Return to Engine Development

Who is online

Users browsing this forum: No registered users and 1 guest

cron