whos gonna help me with my new mars mod?

A m a z i n g!

Im not home now,, so ill do the things you suggested later in, as well as refer to what youce written here.

I waana say, that i have no knowledge in c++ and its functions, ive learnt a bit from all the code compiling.

I will move on to your make file, can you upload the one you converted?

Amyways, ill wtire you back more properlly later on when ill be home, but till then,
I thank you from my heart for this.

Perhaps you can elaborate what do i need to do in order to be able to debug without asking for help...

By the way, i think there are more crashs in the code, since i ran the game with other dll codes i have which did not have that code you found.

Anywaybim babbaling, ill write later, nightinggale, the world need more people like you.
 
I will move on to your make file, can you upload the one you converted?
I don't think you want that one. I wrote a bunch of hardcoded paths for my HD and stuff inside your makefile. It's not only ugly, it's also completely useless unless you happen to have everything in the same paths as I do. Since I don't have everything in the default paths, I say fat chance of that being the case :p

I have Makefile 2.5 in my signature. The included project files are for MSVC++2010 though. I recommend upgrading anyway as it has a better interface.

Have you considered using git? It not only keeps track of changes inside the files (helps when tracking new bugs), it also makes it a whole lot easier to ensure everybody has the newest version. I use sourceforge.net for mods because unlike the other free git servers, they don't have a size cap. This mean it's possible to add everything including graphics, which really ensures that people are using an up to date version. In fact not using git is a real hassle if development involves more than one person.

Some people use svn instead of git. I prefer git because it works offline and only need the internet when uploading or downloading changes. Svn needs a connection for most tasks, including just reading the log. Since laptops aren't always online, this difference can be quite significant.
 
hi man, im here after a long way,

so :

ok i understood what youve explained on the null problem and the edge of the screen,
also the a and b helped me understand, super great thanks.

as i said, im less familiar with c++ and all, but i try hard to learn as i go.
now ill ask a silly question - "assert" is basically a warning that the dll gives when it finds an error current?

now,
im a strong believer of - "give a man a fish, and he will be will eat it , give the man a fishing pole, and he will feed him self".
so , i hope that you can point me in the right direction in order to learn how to see the bugs and debug.

when i ran debug mode, and got the break at the vc++2008, i saw in the call stack some things i could not read, in other breaks, i got the option to see the source code - and by that locating the cause for the error,
in this ctd you solved me - my problem was -
that there was no "source code" available - it only took me to the "disassembly" which has no meaning and you can locate the source.

so - how were you able to pin point the line that caused the error? what did i miss or failed to do in order to see the problem?
i read in forums, about the pdb, dump files, symbols -but couldnt under stand what to do.
so you think you can write me some explanation? i hate bugging people for help....

also - there are very little active people here that can assist these days, so your a rare commodity :)


nmake - sure thing, actuality at one time, i did used your makefile, cant remember why i stopped - maybe i formated my cpu i guess.
so i will re use it as you suggested
i use vc++2008, but i have 2012 also installed on my cpu - should move there ?


git, sf, svn, i have thought about it, but i dont know, not many people play civ4 anymore, and it easier to use the backups i do on my cpu, but your right, perhaps i will go on sf, once im sure the mod i stable (cause i fear of more ctds........)

so, again, your a god send and i thank you a lot for this, i do hope our talk here will go on,
but i would not wanna burden you by any means.

p.s. i downloaded rare mod, i think i will check it out - havnet played col ( i bought all the civ versions up to civ5), since it came out :)

cheers :)
 
now ill ask a silly question - "assert" is basically a warning that the dll gives when it finds an error current?
It's not a silly question. Once in a while you assume something in your code and it's a bug, if that is not the case. You write those assumption as asserts. When asserts are enabled, those assumptions will be checked and you get a popup whenever they fail. If you are using a debug build, you should be able to press debug and the debugger will stay at the assert line (this assumes the debugger works and is attached).

Here is the clever bit. When compiling a release DLL, the compiler is set to make it as fast as possible. To do this, it ignores all asserts, meaning the players will not have to spend time on assert checks. This in turn makes the game run faster.

This mean it's a way to catch bugs in prerelease versions without adding code, which will slow down gameplay in a stable release.

Example:
PHP:
int getVectorVar(int i)
{
	FAssert(i >= 0 && i < m_aMyVector.size());
	FAssertMsg(i >= 0 && i < m_aMyVector.size(), "Vector index error");
	FAssertMsg(i >= 0 && i < m_aMyVector.size(), CvString::format("Vector index error. i = %d, vector size %d", i, m_aMyVector.size()).c_str());
	return m_aMyVector[i];
}
All 3 asserts do the very same. You will get printed something if the assert goes wrong. However in a stable release, your internal testing has ensured that the assert conditions are always true, which mean the function will just return the vector value.

The difference is only what is printed in the assert window. It can contain lots of info, but the 3rd is often overkill. Sometimes it can be useful to do something like this:
PHP:
FAssertMsg(a>b, CvString::format("Unit error: %s", GC.getUnitInfo(iUnit).getType()).c_str());
That one will look up the type written in the XML file for the unit in question. Depending on the type of error, that could make it easier to figure out how the code is working incorrectly.

im a strong believer of - "give a man a fish, and he will be will eat it , give the man a fishing pole, and he will feed him self".
so , i hope that you can point me in the right direction in order to learn how to see the bugs and debug.
I will charge 5 :science:/day for that treaty.

when i ran debug mode, and got the break at the vc++2008, i saw in the call stack some things i could not read, in other breaks, i got the option to see the source code - and by that locating the cause for the error,
in this ctd you solved me - my problem was -
that there was no "source code" available - it only took me to the "disassembly" which has no meaning and you can locate the source.
When that happens, the crash took place in a dll file or the exe. Alternatively the debugger failed to read the pdb file. I have seen several people complaining about failing to use the pdb file, but it always just work for me if I compile a debug dll myself and then attach to the process.

nmake - sure thing, actuality at one time, i did used your makefile, cant remember why i stopped - maybe i formated my cpu i guess.
so i will re use it as you suggested
i use vc++2008, but i have 2012 also installed on my cpu - should move there ?
2012 would be good too. I use 2010 because that is the agreed upon standard for colo modding. Using the same version mean everybody can use the same project files.

git, sf, svn, i have thought about it, but i dont know, not many people play civ4 anymore, and it easier to use the backups i do on my cpu, but your right, perhaps i will go on sf, once im sure the mod i stable (cause i fear of more ctds........)
Adding your files to git is not a release, even if they become publicly available on sf. It's a system where each time you make something new (fixed one bug or added one feature) you commit where you add a short log entry to tell what you did, like "Fixed crash in CvCity::canConstruct when city is close to map edge". Later when something goes wrong and it used to work, you can recall all revisions to get the code precisely as it was at each commit. This can pinpoint the buggy commit and you can get a diff to list all the individual lines, which was changed. That's great for bug hunting and you need to build the git history before you need to use it. If you need it tomorrow for something you added 3 weeks ago, then tough luck.

Also git is brilliant in the way that it can merge work from multiple people, usually automatically. Anybody who tried merging mods manually will know how great that is.

CvCity::canConstruct p.s. i downloaded rare mod, i think i will check it out - havnet played col ( i bought all the civ versions up to civ5), since it came out :)[/QUOTE]
I made a mod of a (now dead) mod. With the exception of traderoute automation and what I listed in the 2.5 changelog, my contributions are mainly bugfixes and performance boosts (reduced waiting time for AI turn by 40%! :eek:). The mod itself as in all the units, graphics and all that is done by other people. My greatest contribution is likely what you don't see (no bugs, low waiting time, no network desyncs etc). Oh yeah, the teacher list is also something I came up with.
 
One more post from my phone before i go to sleep...

Ok now the assert iss clearer i think, thanks.

So you chrage 5 science, sounds super, ill add in a hammer on the house:)

Ill try to get vc2010, its free right?

Well, now that you elaborate on git and such, i wasnt aware to it much. Coukd have saved me some headache during the last modding years.....

So basically, how to i see where is the source code of the bug wheb no source is showen?

Ill write more tommorow abiut the post youve written, im falling asleep here....

I stopped playing col cause it was a bit boring, never tried a mod on it.
And yeah, the best contributions are the ones yiu dont see in a mod, in its structure ans performance behind the scenes:)

Gnite dear friend:)
 
Ill try to get vc2010, its free right?
It is. However they have made it hard to find it. Google can find a direct link to it: https://go.microsoft.com/?linkid=9709969

It provides a free trial for 30 days. If you want to use it for longer, you have to sign up. It's free, but you have to give them a valid email address. At least that's how it was when I installed it. I'm not sure now that it's no longer listed in their regular download list.

Well, now that you elaborate on git and such, i wasnt aware to it much. Coukd have saved me some headache during the last modding years.....
You can try reading the Medieval Conquest git guide https://sourceforge.net/p/colonizationmodcollection/wiki/GIT/
Naturally they updated smartGit shortly after I took the screenshots, but the guide should still be valid. You can try to download, check log and stuff to see what git is like. I'm not saying you should mod M:C, but it's the only one I have offhand, with a written guide for people who never used git before.

Submodules are mentioned in this guide. It's a special thing for M:C and shouldn't be used in other mods (read: understanding them isn't important). The idea is that rather than include C++ and python, it links to it. Other mods can also do that and the result is multiple mods using the same code, but very different xml files. I came up with that concept because of a mod, which was dying due to DLL issues and no C++ programmer. Letting it "piggyback riding" on the M:C DLL ensures a maintained and bugfixed DLL even for mods without programmers at all.

So basically, how to i see where is the source code of the bug wheb no source is showen?
You set up the compiler correctly. I never had that problem and to my knowledge nobody has when using a Makefile and project files I have made.

I stopped playing col cause it was a bit boring, never tried a mod on it.
Yeah vanilla colo sucks and it's the only vanilla game using the civ4 engine I won't play. However I find colo to be a much better base for modding than bts and since all mods have the goal of moving away from vanilla, a much greater diversity showed up in the mods.
 
great thanks for the link,
i guess today im gonna have some work to do, install 2010 learn to use your nmake 2.5, arrange some of my stuff.
learning the git guide as well:)
thats nice, using something like a "global" dll code from another one, and keeping it under maintenance as a part of another mod, cool idea indeed.


interesting to know that the only reason i wasnt able to watch the source code of the crash is just cause of different debug compiling, how intriguing.
one more reason to try and see that i see the source code on the bug you found, maybe as a first trial, ill try to debug what you solved for me using your 2.5.



i remember in col, the ai was pretty boring, it didnt do anything, game pace watch sleeping and so on...im so up to y neck with civ4, that it hurts to move to another game :) i only play league of legends and civ4 modding (or creating ctds...).
i hope ill get some free time later on and give col a whirl and check it.
 
Project->(project name) properties->configuration properties->nmake
Enter the flags in make style, like /DKMOD_PATH_FINDER to define the flags. Multiple flags can be set here, separated by space. Be aware that you can switch configuration and each has a set of flags and you should add your flags to all of them. The reason for allowing different flags is that some configurations requires different flags, like /D_DEBUG should only be present in debug DLLs.

However setting this in vcproj might not do as you would expect. It sets the GUI, which mean it makes a visual change depending on if the code is included or not. For instance the code inside #ifdef _DEBUG #endif will be faint unless you selected a debug dll. The actual compilation is done by the makefile, which completely ignores the vcproj settings.

To set the flags in Makefile 2.5, edit Makefile.project (created the first time you try to compile)
Code:
PROJECT_CFLAGS = /DKMOD_PATH_FINDER
Again multiple flags is possible through the power of space. This one affects all types of DLL files and you don't have to add this for each.
 
so..... i should not have added it to the vcproj....like this:
Code:
<AdditionalOptions>/DWIN32 /D_WINDOWS /D_USRDLL /DKMOD_PATH_FINDER /DCVGAMECOREDLL_EXPORTS /D_DEBUG /DUSE_DATA_DIR</AdditionalOptions>

besides that -

got an error :

Code:
1>CvTextScreens.cpp(5): fatal error C1083: Cannot open include file: 'CvTextMgr.h': No such file or directory
1>NMAKE : fatal error U1077: '"C:\compile stuff\Microsoft Visual C++ Toolkit 2003\bin\cl.exe"' : return code '0x2'
1>  Stop.
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.MakeFile.Targets(38,5): error MSB3073: The command "set TARGET=Release
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.MakeFile.Targets(38,5): error MSB3073: nmake source_list /NOLOGO
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.MakeFile.Targets(38,5): error MSB3073: nmake fastdep /NOLOGO
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.MakeFile.Targets(38,5): error MSB3073: nmake dll /NOLOGO" exited with code 2.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

the file CvTextMgr.h was never in existence in the dll files and i haven't seen it,
it only appears as a blu2 # in CvTextScreens.cpp

oh, and this means anything?:

Code:
1>  Running fastdep
1>  bin\fastdep.exe: unrecognized option `--removepath=.\'
1>  bin\fastdep.exe: unrecognized option `--removepath=.\'
what to do?

edit:

removed the CvTextScreens.cpp to see what happens :

Code:
1>  KmodPathFinder.cpp
1>  	"C:\compile stuff\WindowsSDK\bin\rc.exe" /Fotemp_files\Release\CvGameCoreDLL.res /I"Boost-1.32.0/include" /I"Python24/include" /I"C:\compile stuff\Microsoft Visual C++ Toolkit 2003/include" /I"C:\compile stuff\WindowsSDK/Include" /I"C:\compile stuff\WindowsSDK/Include/mfc" CvGameCoreDLL.rc
1>  Microsoft (R) Windows (R) Resource Compiler Version 6.1.6723.1
1>  
1>  Copyright (C) Microsoft Corporation.  All rights reserved.
1>  
1>  
1>  Linking DLL
1>temp_files\Release\CvGameCoreDLL.res : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt
1>LINK : fatal error LNK1141: failure during build of exports file
1>NMAKE : fatal error U1077: '"C:\compile stuff\Microsoft Visual C++ Toolkit 2003\bin\link.exe"' : return code '0x475'
1>  Stop.
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.MakeFile.Targets(38,5): error MSB3073: The command "set TARGET=Release
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.MakeFile.Targets(38,5): error MSB3073: nmake source_list /NOLOGO
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.MakeFile.Targets(38,5): error MSB3073: nmake fastdep /NOLOGO
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.MakeFile.Targets(38,5): error MSB3073: nmake dll /NOLOGO" exited with code 2.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
 
so..... i should not have added it to the vcproj....like this:
Code:
<AdditionalOptions>/DWIN32 /D_WINDOWS /D_USRDLL /DKMOD_PATH_FINDER /DCVGAMECOREDLL_EXPORTS /D_DEBUG /DUSE_DATA_DIR</AdditionalOptions>
You can do that as well. There is plenty of options for setup if you edit the .vcproj file in notepad++ or similar and you can even do stuff you can't do from the GUI. However breaking the project file is also easy. Do make a backup.

Looks like the blacklist is broken. I did notice a problem, but I thought it was because I placed project files in a different directory than the source files. The really easy solution is to remove CvTextScreens.cpp. Firaxis added it by mistake. It is compiled into the exe, can't compile with the released files and Makefile 1.0 ignores it. Makefile 2.0-2.4 ignores it, but the relative paths in 2.5 might be an issue. I might have to make 2.6 :(

oh, and this means anything?:

Code:
1>  Running fastdep
1>  bin\fastdep.exe: unrecognized option `--removepath=.\'
1>  bin\fastdep.exe: unrecognized option `--removepath=.\'
what to do?
Makefile 2.5 comes with a new fastdep.exe. I fixed a few bugs and made it aware of relative paths. --removepath is something I added. If it's missing, then you are using the old version.


1> Linking DLL
1>temp_files\Release\CvGameCoreDLL.res : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt
I have never seen that error before. Try removing the .res file and see if that fixes anything. Also maybe try cleaning the project and then compile again.
 
Funny firaxis sticking files by mistake...
Yeah figured the fastdrp new thing, thanks.

humm.. ok, now im stuck with
1>temp_files\Release\CvGameCoreDLL.res : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt,

removed the file, still an error....
how can i clean more?

Maybe you could upload the project files yiu compiled for the debug yiu did for me. Maybe i missed something in my merges.
 
found it - googled the problem - turns out, my vs2012 install (that i removed just before getting 2010),
screwed something - heres the solution :

Code:
had this issue after installing dotnetframework4.5.
Open path below:
"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin" ( in 64 bits machine)
or 
"C:\Program Files\Microsoft Visual Studio 10.0\VC\bin" (in 32 bits machine)
In this path find file cvtres.exe and rename it to cvtres1.exe then compile your project again.


so - i shouldnt worry that i removed the cvtextscreen?
 
cool,
see, told ya im a learner :)

now ill try to solve some assert errors, along with 1-2 pythons errors i know of ...


say - i saw a "fast" release, "fast" assert, what are those?


maybe now after a 2 week bug hunting i can mod a bit, maybe also try ur colo mod.

thank you nightinggale, you now how much it means to me your help.

hope sometime i could help you in something in return.
 
now ill try to solve some assert errors, along with 1-2 pythons errors i know of ...
My general advice is to add enough or too many assert checks and fix everything triggering asserts. That should make a fairly stable DLL. Avoid using python for anything other than graphic interface. Python is much slower, can't be debugged and can't handle assert checks.

say - i saw a "fast" release, "fast" assert, what are those?
It's explained in the first post in the makefile thread. Normally the compiler will compile the files one by one, making a clean structured output, which is useful when looking at errors. However the compiler is singlethreaded, which mean it can only use one CPU core. The fast targets use JOM instead of NMAKE, which mean it will compile one file on each CPU core in parallel. You need to add JOM yourself though and since precompile and linking still uses a single CPU core, I "only" compile twice as fast on a quad core CPU. I added info on getting JOM somewhere, both in the thread and download if I recall correctly. This is actually what got me started working on the makefile. I got tired of waiting on a single CPU core knowing that GNU makefiles have no problem using all cores.

thank you nightinggale, you now how much it means to me your help.

hope sometime i could help you in something in return.
I fixed your DLL problem, now you can fix mine in M:C :p:lol:

Well if you want to help, feel free to do so. However I can't think of a good task offhand. My current DLL issue is one which gives me problems and I don't know anybody on the forum I dare to hand it over to, which mean I have no choice but to work on it myself. I redesigned civics, techs, traits and other stuff to share code and there is a glitch in it, providing at techs at startup... or whatever happen. I can make all improvements from turn 2 :crazyeye:
 
yes i know python is generally not that good, some mods i have, are python (i use a lot from platypings work, which i trust to be stable and well built).
but i do prefer to get things in the sdk, as much as i can find and scavenge for scraps from other codes.

i see, well i dont mind if it takes longer to compile, i remember years ago, it used to take 30 minutes to compile :)


well, as i said, im not much of a coder, mostly i merge stuff and try to see if i understand what im doing, but, id love to do something for you mod, if you need some xml stuff, simple art things, please do ask it from me and ill gladly do all i can.


:)
 
Back
Top Bottom