[Archived] I want to help

Looks like I was wrong, I thought I fixed the errors and then it still wouldn’t compile. It compiles now (r1412), but the compile time is a bit extreme. gcc didn’t get stuck as I thought, it just took literally 3 minutes to compile CGameState.cpp. I suppose it’s a pathological template case. Here’s a slew of warning output for these files, lots of non-virtual destructor complaints.
All in all it takes about half an hour to compile VCMI from scratch with gcc :open_mouth:, but I guess that’s to be expected with C++.

I also still get the gcc posting issue, but I use a zero-width workaround by typing

g****cc

It is not, I think it must be some issue with gcc.
With MSVC it takes 10-12 secs to compile CGameState.cpp in debug mode or 7 secs in release mode. Rebuild solution in debug mode takes one minute. I have Intel i7 860 CPU which surely helps a lot but even on slow CPUs single file absolutely shouldn’t take 3 minutes!

Should be better now. (r1415)

Tricky! :wink:

Maybe this could be the answer for this problem (a part of GCC 4.5 changelog gcc.gnu.org/gcc-4.5/changes.html ):

CGameState.cpp instantiates a lot of templates… but then this issue should have been noticed long time ago (or nobody cared about compilation time?)

Hello everybody, I’m new on this forums. Yesterday I tried compiling the VCMI source code like it’s written here, but it didn’t compile.
The first problem I enountered was that a file named CMapInfo.h was missing (CGameState.cpp was trying to include it).
I was using windows XP SP3 and Visual C++ 2010 Express edition, I included the boost libraries afaik, and downloaded the sources with tortoisesvn (else I couldn’t have compiled:) )
I hope someone can help.
Thanks,
Ozsy

ps.: I tried to register yesterday, but the CAPTCHA is not showing up.

Jezus…
[forum.vcmi.eu/t/cant-register/335/4)

As to missing files, solutions may be outdated. Just add/ remove files to projects, following recent revision and compilation errors. With MSV it should be relatively easy.
I can’t see CMapInfo in repository anymore, possibly it was removed / renamed.

Thanks for the link, but I managed to find the post a bit after my last message.

So, after several hours of trying, I managed to compile and link VCMI_lib and genius, but not the client and server. I had to change back to revision 1817, because in revisions 1818 and 1819 CMapInfo.h is included in CGameState.cpp, which I still don’t have.

There was a problem with my boost install, but managed to solve it (the multithread debugger version was requied of the libraries).

I’ll try to compile revision 1817, then change to newer versions.

I lied, CMapInfo is indeed missing. I was not able to find such a file in repository at all, so it must have been added recently.

What a mess…

I’ve uploaded missing files, sorry for trouble.

Thanks, both of you it’s almost working now! I managed to compile all 4 projects (revision 1822), and link each except for the client. As far as I can tell, it misses the files of CMapHandler.
I managed to start the server, so I think it’s the only thing left before I can ask: “How can I help?”

Edit:
I managed to find it, it’s just called maphandler.cpp, the client is built succesfully.

Edit2:
The client is working, I managed to run 2 instances and start up a MP lobby :slight_smile:

So, how can I help?

Just have a look
wiki.vcmi.eu/index.php?title=TODO_list

However, it’s not a good moment to add new functionalities as old code is hardly working and needs fixes, though no one has time for that.

@Ozsy

You can always take an older, stable revision and improve our AI. The interface does not change significantly over time so merging with trunk when it’s more stable will be easy.

I don’t recommend bugfixing for beginners as it’s hard, not satisfying and time-consuming.

One more question: How much work should be done before updating the repository? I made some changes in BattleHelper (and a bit in BattleLogic).

Actually we don’t have precise guidelines but:

  1. the code in repository should always compile, especially trunk
  2. don’t commit more than 2 times a day if you don’t think it really necessary
  3. it’s good when you don’t break features that already worked, especially just before releases (but it’s not obligatory in some cases)
  4. don’t commit unnecessary files (like Warmonger did in rev 1822); if you accidentally do, remove them once you see what happened
  5. enjoy coding!

Next question: how can I get access to upload my files?

You’d need to create an account at sourceforge. But to start with you can post your changes in patch/diff format here (or send them directly to me) and I’ll upload them. :slight_smile:

Little question. As I’m currently peeking at code in various locations and I found many commented out lines, are patches cleaning up those and improving readability accepted? I think it would help other people that will join project. Well, I can improve documentation, too.

Most commented-out parts indicate that some part of code was rewritted / improved. It’s not necessary to remove them as long as they may be helpful if new code is wrong. These are usually removed by devs after few months, if they are sure this code won’t be needed anymore.

I’m not sure if code clearing will help anyone join the project (it looks clear enough now IMO), but documentation certainly can. We have entire Wiki to be filled with technical details. Also, player’s manual, entires and especially general info about the project are areas for improvement.

Warmonger, but if the new code is wrong you can always use version control system to “travel back in time” :slight_smile:

Comment just above or just below is much easier to notice and to handle. SVN is really poor at browsing the history of changes of a function. If I had super-fast blame tool integrated with IDE with a sider for selecting last revision to take into account, then version control would be better than those comments indeed.

github.com/kot-behemoth/VCMI/bl … rities.cpp

Do you really still think that git or other distributed systems are worse? :wink:

Well, if someone wants to check if sticking with “bullet-proof” SVN is better:

Mercurial intro: hgbook.red-bean.com/
Git intro: book.git-scm.com/

I personally use mercurial + HgSubversion extension for working with SVN repositories. I recommend trying that in spare time. Docs: mercurial.selenic.com/wiki/HgSubversion

About amount of dead code that can be removed: bitbucket.org/exine/vcmi-patche … code.patch