Please drop some NAPALM on PU's vegafig..

Need help testing contributed art or code or having trouble getting your newest additions into game compatible format? Confused by changes to data formats? Reading through source and wondering what the developers were thinking when they wrote something? Need "how-to" style guidance for messing with VS internals? This is probably the right forum.
Post Reply
chuck_starchaser
Elite
Elite
Posts: 8014
Joined: Fri Sep 05, 2003 4:03 am
Location: Montreal
Contact:

Please drop some NAPALM on PU's vegafig..

Post by chuck_starchaser »

PU's vegastrike.config is a man-eating monster that grew from out of the PR1.2 lagoon, acquiring borrowed appendages from VS's own vegafig. Thing is, none of us knows the first thing about it. Like what's supposed to still be in there or not.... --rumors are that cheat_dot_value has been deprecated, so it's commented out, for example--; or what things should be added.

The monster is highly non-functional, atm: Some keybindings work in windows but not in linux, some work in linux but not in windows. For example, I added bindings for h and H, for the new select nearest hostile feature in yesterday's svn vegastrike.exe; but they work only in linux. Also, when you steer your ship around, target selection changes automatically to whatever is in front; which feature we want to be rid of like desperately, but don't know how...

Anyhow, please sprinkle NAPALM liberally:
http://deeplayer.com/pu/vegastrike.config

We also got reports of new bugs since we installed the new executable, like missions that were completed showing up later as still pending. Not sure if this might have something to do with missing things in vegafig.
chuck_starchaser
Elite
Elite
Posts: 8014
Joined: Fri Sep 05, 2003 4:03 am
Location: Montreal
Contact:

Post by chuck_starchaser »

Our vegafig has changed a lot the last couple of days. Rationalized difficulties, primarily; but also it has been xml-validated (there were several xml errors in it). Here's the current version:
http://deeplayer.com/pu/ebenezer/vegastrike.config
The invitation still stands, though; there's tons of stuff there we don't know what it is, --some possibly don't belong any more; and probably stuff that should be there but isn't.
pyramid
Expert Mercenary
Expert Mercenary
Posts: 988
Joined: Thu Jun 15, 2006 1:02 am
Location: Somewhere in the vastness of space
Contact:

Post by pyramid »

A good way of documenting engine related config variables would be on the wiki Configuration page.
chuck_starchaser
Elite
Elite
Posts: 8014
Joined: Fri Sep 05, 2003 4:03 am
Location: Montreal
Contact:

Post by chuck_starchaser »

God I hope so... It seems the only way of knowledge about vegastrike.config stuff is via gossip and whispers. :roll:
safemode
Developer
Developer
Posts: 2150
Joined: Mon Apr 23, 2007 1:17 am
Location: Pennsylvania
Contact:

Post by safemode »

the only way to really catch up to deprecation is doing a search in data4.x and vegastrike dirs for uses of the config variables. If your search turns up empty, remove the config var.


if i get some time i may do this for VS.

part of the problem also is that we're trying to move away from ever "writing" anything to the main config file. It should read from it for defaults only and write and read from user config files for everything else. I'm not sure how this is handled on different platforms.

Ideally, the game (and config app) will read the default config file, then read the user config file and fill in any missing config options not found in the user config file but seen in the default one.

We do have plans for totally rewriting the config setup post 0.5 to use more intuitive XML Perhaps moving the default config file built into the game and if a user-level config isn't found it generates one. This would have the added benefit of keeping the file out of SVN so personal settings dont keep getting comitted. I dont know if mods recompile VS specifically for their mod, but if not, we could have it also search for a special mod defaults file that overrides all the internal default configs.
Ed Sweetman endorses this message.
chuck_starchaser
Elite
Elite
Posts: 8014
Joined: Fri Sep 05, 2003 4:03 am
Location: Montreal
Contact:

Post by chuck_starchaser »

safemode wrote:the only way to really catch up to deprecation is doing a search in data4.x and vegastrike dirs for uses of the config variables. If your search turns up empty, remove the config var.
Thank you; I'll do this.
part of the problem also is that we're trying to move away from ever "writing" anything to the main config file. It should read from it for defaults only and write and read from user config files for everything else. I'm not sure how this is handled on different platforms.

Ideally, the game (and config app) will read the default config file, then read the user config file and fill in any missing config options not found in the user config file but seen in the default one.

We do have plans for totally rewriting the config setup post 0.5 to use more intuitive XML Perhaps moving the default config file built into the game and if a user-level config isn't found it generates one. This would have the added benefit of keeping the file out of SVN so personal settings dont keep getting comitted. I dont know if mods recompile VS specifically for their mod, but if not, we could have it also search for a special mod defaults file that overrides all the internal default configs.
Hahaha, I was asking for this very thing, a while ago.
http://vegastrike.sourceforge.net/forum ... hp?t=10303
Coragem
Bounty Hunter
Bounty Hunter
Posts: 169
Joined: Sun Jan 20, 2008 8:38 pm
Location: Rio de Janeiro, Brazil

Post by Coragem »

I know this a very late reply.
We also got reports of new bugs since we installed the new executable, like missions that were completed showing up later as still pending. Not sure if this might have something to do with missing things in vegafig.
I was having the same problem on Vegastrike campaign.

Just to let you know.
My System: Arch Linux x86_64 Bits CPU: AMD Phenom II X4 995 RAM: Kingston DDR2 800Mhz 8 GB GPU: Dual ATI Radeon HD 4830 512 MB Opensource ATI-Git Drivers. HD: SATA 500 Gb WindowManager: KDE4 Joystick: Thustmaster T.Flight Stick X USB
chuck_starchaser
Elite
Elite
Posts: 8014
Joined: Fri Sep 05, 2003 4:03 am
Location: Montreal
Contact:

Post by chuck_starchaser »

Actually, thanks for reminding me. The bug was found. Well, not the bug, per se, but its manifestation, in terms of what was corrupted in the save file.
http://wcjunction.com/phpBB2/viewtopic.php?p=6772#6772
chuck_starchaser
Elite
Elite
Posts: 8014
Joined: Fri Sep 05, 2003 4:03 am
Location: Montreal
Contact:

Post by chuck_starchaser »

I got a little documentation page started on vegastrike.config. Thanks to safemode for the idea, and to wolphin for greping the stuff.
http://vegastrike.sourceforge.net/wiki/CONFVAR
pyramid
Expert Mercenary
Expert Mercenary
Posts: 988
Joined: Thu Jun 15, 2006 1:02 am
Location: Somewhere in the vastness of space
Contact:

Post by pyramid »

The grep is nice indeed. However what we'll be missing with this approach is the explanation of the variables. I suggest at least linking from your page to the Manual:Configuration page which would then hold the explanations of variables.
chuck_starchaser
Elite
Elite
Posts: 8014
Joined: Fri Sep 05, 2003 4:03 am
Location: Montreal
Contact:

Post by chuck_starchaser »

I read your earlier post, and thought about that.
I think the Configuration page in the manual is meant for user config variables --those that are seen/written by setup.exe; rather than modding configuration variables.
If you think about it, that's a *Users* Manual; not a Modders Manual.

Of course it would be better to have textual explanations for config variables there; the problem is I might know maybe a dozen or so of them, out of 1270. I set up that page precisely to make it easier for the devs to start documenting vegastrike.config, --by setting up a basic document structure so that all they need to do is edit and add info. I have my fingers tightly crossed.

I think there should rather be a link from the Manual:Config page TO the grepped page, with text saying "For more information on variables in vegastrike.config that are mod-specific, rather than user-settable, go to ..."
pyramid
Expert Mercenary
Expert Mercenary
Posts: 988
Joined: Thu Jun 15, 2006 1:02 am
Location: Somewhere in the vastness of space
Contact:

Post by pyramid »

The reason I put this into the manual is that I was trying to think ahead a bit and assumed (too much at the moment) that at some point of time an advanced config utility would be able to handle all configuration variables. In addition, that the interested user (not only the mod dev) might be willing to play with his configuration if he understood what the options are meant for.

In any case, a link from manual:config to the complete list makes sense (actually it's done now). What would also make sense then is to keep the confvar page pure, i.e. only with the grep output and without any descriptions in order to be easier to keep it up-to-date (e.g. the additional config variables that i have committed yesterday). And still maybe cross-reference.
chuck_starchaser
Elite
Elite
Posts: 8014
Joined: Fri Sep 05, 2003 4:03 am
Location: Montreal
Contact:

Post by chuck_starchaser »

Hmmm... Yeah, I was thinking about the problem of maintainability. The problem is that it's not just grep. Well, maybe it can be; I'm not too familiar with grep's capabilities.
Coming up with it involved:

1) grep
2) search and remove spaces before or after ( or )
3) search and remove spaces after commas
4) sorting
5) adding "* " in front of the lines
6) adding == yada == headings
7) manually getting rid of things that came up in grep that were not variable accesses.

The problem with cross-referencing is cross-referencing to what?

If you're going to produce a document that, for each of those calls, has the text that describes what the variable is for, somewhere, you're going to have the same problem having to keep that other document up to date...

Back to square zero.

That's why I figured, this had better be a static starting point that should get updated religiously as people add new variables (or remove old ones).

The only other solution I can see would be to use Doxygen, but then there'd have to be properly formatted comments in the code, which would brutally violoate vegastrike traditions... :D

So, I was thinking of it being something like...
http://vegastrike.sourceforge.net/wiki/ ... :Variables
Culture20
Merchant
Merchant
Posts: 61
Joined: Wed May 05, 2004 2:34 am

Post by Culture20 »

chuck_starchaser wrote:Well, maybe it can be; I'm not too familiar with grep's capabilities.
Coming up with it involved:

1) grep
2) search and remove spaces before or after ( or )
3) search and remove spaces after commas
4) sorting
5) adding "* " in front of the lines
6) adding == yada == headings
7) manually getting rid of things that came up in grep that were not variable accesses.
You want a mix of grep, sed, (maybe awk), and sort
ie
grep foo file.txt | sed -e "s/ *(/(/g" -e "s/( */(/g" -e "s/, */,/g" |sort -whatever |sed -e "s/^/\* /g" > output.txt

If you're wanting to edit the source files for homogeneous code:
(be careful with this; the -i with sed makes it replace data _in_ the found files; notice we skipped using grep since it would be a useless step here)
find ./vegastrike/ -name \*.cpp -exec sed -i -e "s/ *(//g" -e "s/, */,/g" {} \;
loki1950
The Shepherd
Posts: 5841
Joined: Fri May 13, 2005 8:37 pm
Location: Ottawa
Contact:

Post by loki1950 »

I think that one went over chuck's head Culture20 :lol: he's strictly a windows type for now but i do believe that wophin will grok it :wink:

Enjoy the Choice :)
my box::HP Envy i5-6400 @2Q70GHzx4 8 Gb ram/1 Tb(Win10 64)/3 Tb Mint 19.2/GTX745 4Gb acer S243HL K222HQL
Q8200/Asus P5QDLX/8 Gb ram/WD 2Tb 2-500 G HD/GF GT640 2Gb Mint 17.3 64 bit Win 10 32 bit acer and Lenovo ideapad 320-15ARB Win 10/Mint 19.2
chuck_starchaser
Elite
Elite
Posts: 8014
Joined: Fri Sep 05, 2003 4:03 am
Location: Montreal
Contact:

Post by chuck_starchaser »

loki1950 wrote:I think that one went over chuck's head Culture20 :lol: he's strictly a windows type for now but i do believe that wophin will grok it ;-)
Hahaha, exactly; I just took Culture20's post very carefully with gloves and copied it over to where wolphin will see it. ;-)
http://wcjunction.com/phpBB2/viewtopic.php?p=6893#6893
pyramid
Expert Mercenary
Expert Mercenary
Posts: 988
Joined: Thu Jun 15, 2006 1:02 am
Location: Somewhere in the vastness of space
Contact:

Post by pyramid »

chuck_starchaser wrote:That's why I figured, this had better be a static starting point that should get updated religiously as people add new variables (or remove old ones).
So, I was thinking of it being something like...
http://vegastrike.sourceforge.net/wiki/ ... :Variables
I have created a page that was already existing.... Manual:Config is now gone and content is merged into Manual:Config:Advanced:Variables. Th epage is also referencing CONFVAR.

I think, the following approach might work:
1) Keep Manual:Config:Advanced:Variables as a manual edit for comments about the variables.
2) Make CONFVAR the complete reference (being automatically updated or not doesn't make a big difference since I am assuming a dev that creates or changes a variable would do the edit in the previous manual page)
chuck_starchaser
Elite
Elite
Posts: 8014
Joined: Fri Sep 05, 2003 4:03 am
Location: Montreal
Contact:

Post by chuck_starchaser »

Good stuff, Pyramid!

I'm thinking, CONFVAR could be autogenerated. SVN has hooks for scripts. You could make a script that runs after each SVN commit to head and uses the grep+++ code that Culture20 posted, logs into the WIKI and updates the page. Perhaps make it a separate server process, so that the ends of commits aren't delayed by the wiki part.
shadow_slicer
Merchant
Merchant
Posts: 47
Joined: Sat Jul 28, 2007 4:00 am

Post by shadow_slicer »

Try this script. I think it should generate the correct formatting.

Code: Select all

#!/bin/bash

VS_SRCDIR="svn/vegastrike/vegastrike/src";
VS_DATADIR="svn/vegastrike/data4.x";

for query in getColor gethColor; do
  echo "\n==$query==\n" #generate heading
  grep -hoR 'vs_config->'$query'[^)]*)' $VS_SRCDIR | sed -e "s/ *(/(/g" -e "s/( */(/g" -e "s/, */,/g" | sort | uniq
  echo
done

#Find C/C++ uses (and clean formatting)
#Find Python uses (and clean formatting)
#Sort and remove duplicates (sort and uniq)
#Generate headings (awk)
( grep -hoR 'vs_config->getVariable[^)]*)' $VS_SRCDIR | sed -e "s/ *(/(/g" -e "s/( */(/g" -e "s/, */,/g";
grep -ho 'VS.vsConfig[^)]*)' `find $VS_DATADIR -iname \*.py` | sed -e "s/VS.vsConfig/vs_config->getVariable/g" -e "s/ *(/(/g" -e "s/( */(/g" -e "s/, */,/g" ) | sort | uniq | awk 'BEGIN {label=""; FS="[,(]"}; { if (label !~ $2 ) {label=$2; print "\n==" substr($2,2,length($2)-2)  "==\n"} print $0 }'

pyramid
Expert Mercenary
Expert Mercenary
Posts: 988
Joined: Thu Jun 15, 2006 1:02 am
Location: Somewhere in the vastness of space
Contact:

Post by pyramid »

shadow_slicer wrote:Try this script.
Coincidence, meanwhile I was hacking one together. Once this is done, I'll also share it here. You can run it from the source dir (or any other if you change the first ./ parameter in find) command line:

Code: Select all

find ./ -name \*.cpp -exec grep "vs_config->getVariable" {} \; | grep -v 'svn' | sed -e 's/^[ \t]*//; s/.*[>] *//; s/).*//; s/$/)/; s/e (/e(/; s/( /(/; s/^/* /' | awk -F ":" '{ print $1 | "sort" }' | awk '! a[$0]++' > confvar.txt
Well, it doesn't have the label part, so I'll definitely try out shadow slicer's script and voilà, we'll have the CONFVAR (almost) auto-updated.
Post Reply