World History Mod Conversation

Assert Failed

File: CvXMLLoadUtilitySet.cpp
Line: 593
Expression: NUM_YIELD_TYPES == GC.XMLlength
Message: XML read error. "" is used more than once

I am thinking it can't be an xml issue, because I get this assert popup before the loading bar screen even appears.. which means it must be something not right in the .dll... right?

it goes on to pop the GOLD assert and crash when it is doing the xml loading... but that first message must have some other meaning... some other importance... I just don't know what..
 
nope doesn't give me anything new to work with... so still well and truly stumped...

for anybody feeling brave, this is everything minus sound and art from assets. Which are the same from M:C.

World History Mod (approx 15Mb)

I have gone through all the xml files that are affected by yields:

yieldinfos
terraininfos
improvementinfos
unitinfos
unitclassesinfos
professionsinfos
buildinginfos
traitinfos

I think those are all the ones with changes, but most of those shouldn't be connected to the yield list issue, I think.

I am having a look at it, I am showing the same errors as you. What all files have you changed, ones that will be different than M:C?
 
The solution is really simple and in fact it has been mentioned several times on the forum and the wiki. In fact I think I mentioned it in this thread as well.

Makefile.settings said:
CUSTOM_CFLAGS = -DWORLD_HISTORY
Without this line the compiler thinks it compiles for M:C and will use the M:C yield files.

However I noticed a few issues.
CvDefines.h said:
#ifndef COLONIZATION_2071
#ifndef WORLD_HISTORY
#define MEDIEVAL_TECH
#define USE_NOBLE_CLASS
#endif
#endif
The red text needs to be added.

Also Yields_World_History.h is broken. Somehow the last lines are missing :confused:
I will need to generate a new one eventually. In the meantime use the one attached here. It will assert because yield groups aren't set up correctly. That is ok and can safely be ignored for now. It just mean the AI will not treat the yields correctly, but that is an issue for a distant future.

There is one very serious problem with what you have done so far. You made lots of different things and nobody (not even you) can keep track of it anymore. That is a recipe for disaster. I will make a branch for World History and commit this in several steps to attempt to keep at least some order to it.

Getting updates
Once there is a branch for WH, it will get the DLL updates from M:C simply because the WH branch will not have a source code of its own. It will use the master branch and set Makefile.settings to make a DLL for WH. The schema files for XML will automatically be copied from master branch using a perl script. In fact the branch will end up with only XML and maybe python changes. Graphics should not be added to github because M:C alone will violate the server diskspace limit if we did that.

Wiki guide
Looks like I will have to make a picture book for inexperienced git users. The idea for git is very clearly completely missed with what I have seen now.
 

Attachments

I am having a look at it, I am showing the same errors as you. What all files have you changed, ones that will be different than M:C?

Well, I managed to get the game to the main menu. However, I noticed you have left some of the older yields in some of the the XML files, Emphasize and BonusInfos. Ones like Yield_Tools, Yield_Silver, Yield_Furs, and Yield_Salt. Also, Yield_Silver is left in the
GlobalsDefineAlt.xml

Code:
<Define>
	<DefineName>DEFAULT_TREASURE_YIELD</DefineName>
	<DefineTextVal>YIELD_SILVER</DefineTextVal>
</Define>

Another main issue I see is in the Yields_World_History.cpp, you have left some of the old yields in there as well. You have to remember (and I am guilty of it too) when you change or remove a Type, there may be references to it in other files.

Code:
void Check_YieldGroup_AI_Buy_From_Europe::build()
{
	YieldVector.push_back(YIELD_LEATHER_ARMOR);
	YieldVector.push_back(YIELD_SCALE_ARMOR);
	YieldVector.push_back(YIELD_MAIL_ARMOR);
	YieldVector.push_back(YIELD_PLATE_ARMOR);
	YieldVector.push_back([COLOR="DarkRed"]YIELD_TOOLS[/COLOR]);
	YieldVector.push_back([COLOR="DarkRed"]YIELD_WEAPONS[/COLOR]);
	YieldVector.push_back(YIELD_HORSES);
	YieldVector.push_back(YIELD_POTTERY);
	YieldVector.push_back(YIELD_SPICES);
}

What do you use to edit your XML files?
 
Another main issue I see is in the Yields_World_History.cpp, you have left some of the old yields in there as well. You have to remember (and I am guilty of it too) when you change or remove a Type, there may be references to it in other files.
There is one tool, which is ideal to deal with cases like that: grep. Unfortunately Windows doesn't come with it by default (more or less all other OSes does), so we will have to install it ourselves.
http://www.wingrep.com/
Very short what it does: it is like search, except it searches all files in a directory and subdirectories. It can however use regular expressions, but it is quite useful even if you don't know what that is.
 
Thanks for the help guys!

You have to remember I have never claimed to be anything other than a novice with code!

I don't remember you making any mentions of the cvdefines.h file... I did ask if there was anything in that group of files I sent you that was missing or needed.

So as far as I can tell it wasn't an xml issue, and wasn't connected to the files I changed?

It was instead connected with the makefile and cvdefines.h?

I had just fixed those weapons and tools references, just after sending you the files :D

the other unfixed references were in files that I think hadn't loaded yet, so I didn't know that they were in there, I just went through the error messages 1 by 1 and fixed them, but I guess it crashed before loading the other files. I also have to change MAIL to CHAIN in a lot of files, I am still finding all those references as well. :D

I use notepad++ to edit files.

Thanks for setting up the git for me Night, I have tried to wrap my head around it a few times but just not successfully yet.

The problem is that I have health problems, you made the joke on the dll coding thread that I should see a doctor about it, I have been visiting the doctor for a decade now and they still don't have a cure for what I have.. basically imagine doing a full day of work, then 5 minutes before collapsing in bed trying to learn a new skill while having a headache and having done long distance running the day before and suffering for it... that is basically my life.

Hopefully I won't have to do too many changes to the .dll, and hopefully most of those will come from fullerenes USSR work, one thing I know that I will have to look at at some point is the whole Luxury food mechainc as I have 2 more of those food types..
but that is a headache for another day.

so right now I have to change cvdefines.h and the makefile right?
 
Ok....I am trying to clean my solution to rebuild it and see if I can get it working, but..

I am getting that old nmake issue, I remember the solution was to move the nmake file into the folder with all the source code, but for the life of me I can't remember where I get the nmake file from!! I also can't remember wherfe we had the conversation about it to check!!

Nevermind, found it in my fallout source code folder! :D
 
I added a World_History branch as well as updated the master branch. I added a DLL to WH, but if you want to compile one yourself, then you need to do: https://github.com/Nightinggale/Medieval_Tech/wiki/GIT-usage

In short: you have master branch somewhere, edit Makefile.settings with
YOURMOD = path to WH in MODS (relative or absolute)
CUSTOM_CFLAGS = -DWORLD_HISTORY

When you compile this master, then it will compile for WH and then copy the compiled DLL to the path specified. Do note that the makefile append Assets, meaning you shouldn't. There is no DLL source code in WH branch.

There are still some asserts left. It asserts a lot about bCargo and virtual/non-virtual yields. These checks are leftovers from old code and should be safe to ignore. I will remove them in the near future.

There are some other asserts about yield types being used in XML without being set in the yield XML. I didn't even try to fix those. They will crash the game, but should be easy enough to fix based on the assert messages.

While working on this I noticed my XML read rewrite introduced a bug. The DLL/XML yield sync check were no longer called. I fixed that and call the check way earlier meaning it will provide useful assert messages. The game will likely crash if the asserts are ignored, but they will tell you which yield is causing the issue.
 
Now, what is the difference between World History and World History Experimental branches?

edit:

Ok, WH is XML/Python branch? And Experimental is for DLL changes? Should the Yield list be merged to experimental too?


edit2:

btw, the multiple invasion code has left my computer... I hope it's still on git server.
 
Ok, WH is XML/Python branch? And Experimental is for DLL changes? Should the Yield list be merged to experimental too?
We could merge them, but strictly speaking it doesn't matter. Once multiverse is done, it will merge back into the master branch. The yields will only have to go into multiverse if it actually relies of yields. If it doesn't then I think it would be best not to. After all master is fairly stable and WH isn't meaning master is a better platform for developing something new.

btw, the multiple invasion code has left my computer... I hope it's still on git server.
I haven't deleted anything from github and I don't plan to delete code changes at all. In that if I delete anything, it would be to reduce disk usage, in which case it would be DLL files from last year, which goes, but not the source code for them. That will stay forever.
 
hooray! I got to the menu screen!!

I take it when you compiled Spice got turned back to Spices?

Another curious thing is I seem to have aerial parts in four times... I don't know if this is a text string label issue, or something has gone funny and the aerial yields have been duplicated, I will look closer to see if anything is missing and figure it out from there. EDIT: Looks like your script generated trade goods, tools, and weapons and gave them the text string aerial parts...

Another weird this is it keeps saying the YIELD_SILVER is in formationinfos.xml, but it isn't... I think i fixed it... I think it was pointing to the wrong file, I found 1 occurence of silver by searching the whole asset folder.

I have another one about

No rule to set price of (YIELD_X) where would I go to fix these? is it the dll again?

I also get a python error.(see screen) Is this the same thing that was happening with 2071? Or do you think this is connected to a too many yields problem? Or is it something completely different?...

Well, while that gets figured out I guess my next job is adding in all the new text strings....
 

Attachments

  • python building error.jpg
    python building error.jpg
    171 KB · Views: 90
I take it when you compiled Spice got turned back to Spices?
It was called YIELD_SPICE in some locations and YIELD_SPICES in some. I had to pick one of them.

EDIT: Looks like your script generated trade goods, tools, and weapons and gave them the text string aerial parts...
I added those 3 yields as they have a special meaning for the AI and the DLL can't compile without them. However I forgot to change the description when I copy pasted. Minor issue compared to what I fixed ;)

Another weird this is it keeps saying the YIELD_SILVER is in formationinfos.xml, but it isn't... I think i fixed it... I think it was pointing to the wrong file, I found 1 occurence of silver by searching the whole asset folder.
It might be a DLL issue. Silver has a special meaning and is mentioned somewhere there. However I can't remember precisely what it is.

No rule to set price of (YIELD_X) where would I go to fix these? is it the dll again?
First of all it is the value the AI assigns to yields when it figures out what to produce. Anything without a value will get the value 0 and presumably not be produced. For now it can be ignored.

The way to fix it is to set up the groups in the WH cpp file and then run the script to set up the groups in the header.

I also get a python error.(see screen) Is this the same thing that was happening with 2071? Or do you think this is connected to a too many yields problem? Or is it something completely different?...
I know what the problem is. However I will not try to fix right now as I plan to rewrite the building system today. The problem is that the python file has building placement on city screen and it knows M:C and col2071, but not WH. With a little luck the building placement will be in XML within the next 24 hours and the problem will go away. If this fails, then I will fix it as I know precisely where the problem is.

It reminds me that I did miss one thing when add WH to the DLL, which is to add python access code to tell which mod the DLL is compiled for.

Well, while that gets figured out I guess my next job is adding in all the new text strings....
How about committing the changes you made so far? If you screw up now it would be nice to revert to last commit. Think of it kind of like a savegame for source code. It is also much better to have a decent log to keep track of what has been done, specially if multiple people work on the source.

You will need a github account to be able to push (upload) your commits. PM me with your account name and I will give you write permission.
 
I added those 3 yields as they have a special meaning for the AI and the DLL can't compile without them.

Ok so I need to find out where those are handled and figure out some fixes, as I have 3 kinds of tools and several kinds of weapons..

It might be a DLL issue. Silver has a special meaning and is mentioned somewhere there. However I can't remember precisely what it is.
[/QUOTE]

I think I managed to fix this one.

First of all it is the value the AI assigns to yields when it figures out what to produce. Anything without a value will get the value 0 and presumably not be produced. For now it can be ignored.

The way to fix it is to set up the groups in the WH cpp file and then run the script to set up the groups in the header.

I figured it was something like that.

I know what the problem is. However I will not try to fix right now as I plan to rewrite the building system today. The problem is that the python file has building placement on city screen and it knows M:C and col2071, but not WH. With a little luck the building placement will be in XML within the next 24 hours and the problem will go away. If this fails, then I will fix it as I know precisely where the problem is.

It reminds me that I did miss one thing when add WH to the DLL, which is to add python access code to tell which mod the DLL is compiled for.
Sounds good!

How about committing the changes you made so far? If you screw up now it would be nice to revert to last commit. Think of it kind of like a savegame for source code. It is also much better to have a decent log to keep track of what has been done, specially if multiple people work on the source.

You will need a github account to be able to push (upload) your commits. PM me with your account name and I will give you write permission.

Yeah I have forgotten my login details, so I will need to make a new account..
 
Back
Top Bottom