• We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.
Showing developer posts only. Show all posts in this thread.
An overview of the general syntax is:

Code:
#Comment
root_node =
{
    child_node = single_data
    child_node =
    {
        array_data1 array_data2 array_data3
    }
    child_node =
    {
        child_node = single_data
        child_node =
        {
            child_node = single_data
            child_node = single_data
        }
    }
    child_node = single_data #Another valid comment
}
root_node = single_data
 
Last edited:
Hehe I'll start with the actual logic of the EUG loader very soon. I am just halted right now because I attempt to actually finish an EU2 World Conquest (even though it's supposed to be easy I want to be able to say I've done it). Unfortunely it takes quite a lot of time with all that micromanagement.
 
I'm fighting the time issue currently (I'm about to fail HL maths in school so it's quite some work to catch up). As far for the loader goes I've got the shell done, and I've started on the actual loading code.
 
A combined progress report and a question. Firstly, do you find my coding style below readable? This is important because some poor person will have to study it and convert it to Java. Secondly, I am right now working with the ReadLine() function, which is a real test I tell you.

Currently I have a loop inside ReadLine() that reads all the characters on the line, and now I have two options for reading the elements of the .EUG file: Either a recursive or a state machine approach. If the recursive approach is taken I'll have to create several sub functions to deal with each kind of keyword, the problem with this then is that the type of keyword is not always known before some element after it shows up. A state machine approach however causes a lots of if statements in the reading loop and other complexity.

Code:
bool CFile::Load(std::string filename)
{
    unsigned int error_count;

    //try to open input file
    m_stream.open(filename.c_str(), std::ios::in | std::ios::binary);
    
    //check if file was opened
    if(!m_stream.is_open())
    {
        std::cout << "File error: " << filename <<
            "\nThis file could not be opened for input.\n";
        return false;
    }
    
    //set up some stuff
    m_line = 0;
    error_count = 0;
    m_roots = new Node;
    m_roots->parent = 0;
    m_roots->children_type = c_NODE;
    
    //read one character to start with
    GetNextChar();
    
    //reading loop (per line mainly)
    while(m_look != 0)
    {
        m_line++;
        if(!ReadLine())
            error_count++;
        SkipNewLine();
    }
    
    std::cout << "\nThere were " << error_count <<
        " errors during loading.\n\n";
    
    //close file
    m_stream.close();
    
    return true;
}
 
Last edited:
Ah great the ReadLine() function is soon finished (unless it's harder than expected I should be able to finish file loading this weekend). After that I figured I should try to make some buffered input system, as I'm right now reading one character at a time from file, which is not too efficient with all those function calls. However this is not of such a high priority, and of course the most important thing is that the loader works.

After that I plan to implement the save function. It will probably be many times easier than the loading function, mostly due to the fact it is just to iterate through the tree structure and emit code without any consideration to the previous code emitted. Once this is finished someone should start to consider to convert it to Java since that's what this project will use.
 
I think we should apply for some free webspace provider, with no respects to commercials etc. The more important thing is whether their connection is stable or not. I have a ~50 MB webspace on my website too, however I do not really want to give away the password for the FTP upload. In the case we'll use it instead you'll have to send me compressed files via email, and even then it's not too good since my email server provider automatically reject files with certain endings. I know .zip is one of these endings, so you'd had to rename it to .111 or something before you sent it.

A few more notes about my implementation. This is the first project I've relied that heavily upon the Standard Template Libarary. Even though the version of the library that comes with DevCPP is quite unimplemented (at least when it comes to the std::string class), it still contains the basic useful functions. For everything else I use legacy C functions (again quite often with the std::string). Another quirk for Java conversion is the fact I in my tree node structure have a std::vector that can be filled with void* pointers to the node's children. These points can point to doubles, std::vectors or other nodes when necessary. I'd say this can cause trouble for Java, since I do not know what similar abilities that language possesses. Else you will have to figure a new way to add child nodes to the tree... :eek:

Unfortunely (or fortunely ;)), I got sick today and as such I was home from school. I have almost finished the reading function by now; it now reads nodes, UL strings and numbers like a charm. The only thing left to add to ReadLine() is support for DL strings.
 
Last edited:
I spent 6 hours yeasterday trying to figure out the only bug which prevents me from reading the last 25% of a Victoria .EUG save game... Apparently I somehow manage to read to the end of file while the state machine in the reading loop thinks that it has only come half ways.

EDIT:
Apparently I made a faulty assumption when I wrote this and assumed the equal signs were unimportant. Now I found what caused the error:

preference = { 6160401 = 20.000 6160401 = 100.000 6160401 = 50.000 6160401 = 10.000 6160401 = 20.000 6160401 = 20.000 6160401 = 20.000 6160401 = 20.000 6160401 = 20.000 6160401 = 20.000 }

As you can see node names can also consist of digits... In my opinion this is a pain in the _ss, but since Paradox decided to implement it this way I guess I have no choice but to add a lot of extra code to work around it.
 
Last edited:
I have not heard from him, but then again I haevn't communicated with him in private.

The loader takes longer time than expected due to that new found error which forces me to change much of the logic in the reading loop (before I could assume a number either was correctly placed like data or invalid). Now I have to take into account whether a number is a node name or not as well; something which is not always easy to tell.

I'll see how much time I can dedicate the coming week because I have a major deadline on Thursday next week. Hopefully I can finally finish the loader without any major bugs left though.
 
Do anyone know if there is a list of all new tags that were addded to the recent EU2 betas? These could complicate things a bit, since I am not entirely sure there are now enough Victoria tags to cover the huge amount of EU2 tags...

Tunch Khan: Yes we might need your help later (most probably actually since ID converting is a lot of work). However, I'll get back to you later because I'll have to see what kind of exact format we need for the IDs. After that I think we need to start a separate thread that keeps track on who's doing what; this thread is a bit overworked right now.
 
Last edited:
My two week vaccation will start next week, I can almost guarantee I'll finish the currents bugs in the loader then so that it is usable for conversion to Java, although all manipulation functions still have to be coded (currently you cannot perform any editing on the data that is loaded).

By the way, I think I soon will start up that fresh thread that gathers the working team for this. We need to organize for the province ID translation and country translation as soon as we know what format the data should be entered in. Like I've said earlier I think something like this below should work:

EU2_prov_id VIC_id1 VIC_id2 VIC_id3 VIC_idn etc.
234 756 738 738 475
269 1264 478 1273 etc.

It is just to read a number string until a whitespace is found, and if a new-line or end-of-file character is found the current entry is finished.
 
Since my vaccation starts this weekend I plan to finish the loading code then, and thus the real programming shall begin ;). Actually, we still need to write a more formal description of what the conversion utility is supposed to do. It would be fun to get something working within 3 months though.
 
Msvnconsolegenerale, can I send the code to your e-mail address even though it's unfinished? (and because it's in editing it won't even compile like it did a few weeks ago). My reason is I don't have enough time to finish it properly the coming two weeks. The idea is that you should be able to familiarize yourself with the coding style and actually begin to lay the groundwork in Java (if you have the time).
 
"This message is larger than the current system limit or the recipient's mailbox is full. Create a shorter message body or remove attachments and try sending it again." The file size was less than 600 KB, I'll try to strip it down further by removing all unnecessary test files.
 
How do I upload a file on the board? I searched all those buttons above the posting area but I couldn't find it. By the way, doesn't the copyright go to Paradox if I do that according to the board rules? Not that I care; I don't Paradox will try to stop our project, but just out of curiousity I ask.

EDIT: Lord G-Klav, that's exactly the format of the province IDs we wish! Keep up the good work. :)
 
My summer vaccation is two weeks off now. If there's any time I shall get started for real it is then (although I have one trip to Croatia and one trip to India planned).

EDIT: Can everyone who's still remotely involved make a post? It feels like everything is dead (which again is the reason to why I make this post).
 
Last edited:
Yeah Italy would be nice too.

On our project, if anyone feel inclined to try to manufacture an absolute minimal Victoria scenario I'd be grateful. When I say minimal I mean the absolute simplest scenario that can be made and still be run by the game engine. This is important since we will generate brand new Victoria save games from the EU2 save games, and it would be nice to know how little content the game engine can handle before it crashes. Why I ask is because I remember having trouble creating EU2 scenarios from scratch due to certain restrictions.