Jump to content
XCOMUFO & Xenocide

One Assignment To Go


mamutas

Recommended Posts

Hi all.

 

There were a few programmers willing to help with the project, but there was nothing specific I could offer to them so far.

 

But there is now.

 

Here are the details. There is a class (MiscConfigFile) which reads information from *.conf file (for example, from engine.conf located in your Xenocide Alpha installation directory). This class needs some improvement:

  • Allow digits and underscores in identifiers. Currently identifiers (the variables used in between square brackets and on the left side of equal sign) do not allow anything except letters in them. This is a major issue for implementation of dialog layout configurations (see this thread).
     
  • Do not convert values to lowercase. Currently all identifiers and valus (variables on the right side of equal sign) are converted to lower case. While it is OK for keys and section names, it is not appropriate for values. The values should not be converted.

So, as you see no more than common C++ knowledge is required. Anyone willing to help, please contact me.

 

Regards.

Link to comment
Share on other sites

Well I was in a programming row yesterday and appart from the OpenGL Fonts Defect, I correct some of this. Currently if I dont remember wrong the identifiers are modelled against pascal identifiers (starts with letter then you can use as much digits as you want.) Reason: The parser is far easier to code as a state machines instead of a context free or stack automata (I had used formal techniques to implement that, so unless you dont want to do a Res800x600, you will have to reimplement lots of code).

 

About the in and out normalization, I had taken out the normalization phrase out from the FileRetriever so it is case sensitive now (in both ways, in from archive and asking for information).

 

Adding underscores is pretty simple, you have to change it the state machine in the LexicalAnalyzer (for those that are interested in this).

 

Greetings

Red Knight

Edited by red knight
Link to comment
Share on other sites

  • 3 weeks later...
Guest Jim69

Hi, on RK's advice I took a look around this forum. Is there any really basic work that I could do? My bro knows a fair bit, so maybe he could help me but my knowledge is very limited, and I must confess I don't understand a lot of the things said in this part of the forum. Am I right in sayin that u just want the identifiers names changing to allow 4 a global naming convention? I could probably do that if u still need the help. I may even understand some of the code that I am reading as I am doing it, which would help me a lot.

 

Thanks

Link to comment
Share on other sites

Jim69 could you download from the CVS the source? If you do, you can start taking a look at it to get familiar with Doxygen Documentation System and the code conventions in itself... after that you can try documenting some little classes from the Misc library (Utility Package)...

 

Miceless if you want start with that too, go for it, just tell me.

 

Greetings

Red Knight

Link to comment
Share on other sites

Well I was in a programming row yesterday and appart from the OpenGL Fonts Defect, I correct some of this. Currently if I dont remember wrong the identifiers are modelled against pascal identifiers (starts with letter then you can use as much digits as you want.)

I have almost forgot about that thread :)

 

But here is the proof that I was right. This is a snipet of code from configfile.cpp:

if ((isLetter (c)) | (isDigit (c)))
       {
               // Construct the identifier
               if (isDigit(c))
                       type = _IDTVALUE;
               else type = _IDTIDENTIFIER;

               aux += file->getChar ();

               while ( (isLetter (file->peekChar ())) | (isDigit (file->peekChar())))
               {
                       if (isDigit(file->peekChar()))
                               type = _IDTVALUE;
                       aux = aux + file->getChar();
               };

               return aux;
       }

 

For, it looks like any token which has a digit in it is a value, but not the identifier. Also, it looks like the fix is as simple as removal of that 'if' statement within 'while' loop. I will fix it myself. The assignment request is canceled.

Link to comment
Share on other sites

Guest Jim69
Jim69 could you download from the CVS the source? If you do, you can start taking a look at it to get familiar with Doxygen Documentation System and the code conventions in itself... after that you can try documenting some little classes from the Misc library (Utility Package)...

 

Miceless if you want start with that too, go for it, just tell me.

 

Greetings

Red Knight

Yeah, I downloaded it last night, gonna get 2gether with my bro and take a look at it, since he is doing a comp science course at Uni and is back 4 a while. He knows more C++ than I do, I really only understand the very basics.

 

I subscribed to the programming mailist as well, however I get confused a lot by the complicated terminology that other ppl understand, so for a while I may just be along 4 the ride. But as I understand more I'll try and get as involved as I can.

Link to comment
Share on other sites

Mamutas, that first isDigit© in the if statement shouldnt be there in the first place. (Provided I recall correctly about the context of that)... That would make every number or sequence of letters and digits to be an identifier. Numbers should be tagged as _IDTNUMBER and Identifiers (a la pascal) should be _IDTIDENTIFIER.

 

Greetings

Red Knight

Link to comment
Share on other sites

I have a new task involving work for the translations, in short a string resources load manager... So you can have standard calls to get resources and for translation you only have to change the file or an internal flag... Any volunteer contact me for details, better this weekend on ICQ.

 

Greetings

Red Knight

Link to comment
Share on other sites

In lights of that new assignment...

How are you going to use that library? To load strings for X-Net database and similar? I am asking because there are strings in layout configuration files which must be translated. So current layout implementation would require a copy of layout config file for each translation.

 

On the second thought: depending on installation functionality, it might not be necessary to even specify a file name to load strings from. As we agreed before, there will be no dynamic language changes after game is installed. So instead of laying down bunch of files with strings in different languages, there will be only one copy of the internationalized resources which will be installed. The language to install will be selected during the installation. So why such advanced string loading library?

Link to comment
Share on other sites

I wasnt thinking on an advance string loading library, just a default app to let modders modify it easily and a default loading mechanism... just that, it sounds more advance than it is...

 

In the case of loading from the config, you specify in the button creation the name of the resource in the file and get the string from there... (or just hardcode it if you want, I prefer the loading one cause we already have the support for it).

 

Greetings

Red Knight

Link to comment
Share on other sites

×
×
  • Create New...