Forum index VCMI Project - Heroes 3: WoG recreated
Forum of the project aiming to recreate best turn-based strategy ever!

FAQFAQ  SearchSearch  MemberlistMemberlist  UsergroupsUsergroups  StatisticsStatistics
RegisterRegister  Log inLog in  AlbumAlbum  DownloadDownload

Previous topic :: Next topic
[Archived] I want to help...
Author Message
OnionKnight 
VCMI Programmer


Age: 29
Joined: 19 Jul 2009
Posts: 77
Location: Sweden
Posted: 2009-12-24, 14:48   

I'm working on properly implementing combination artifacts, and I'm thinking it might just be better if these artifacts just set their own bonus and when the engine retrieves the bonus for an artifact it will collect the bonuses of the constituents at that point.
This means if a future script were to change a constituent artifact the combination artifact is automatically updated, same would also apply to adding/removing constituents.
 
 
     
Tow 
Project Lead
VCMI Programmer


Joined: 01 Feb 2008
Posts: 1407
Location: Kraków, Poland
Posted: 2009-12-29, 08:43   

Ivan wrote:
Just tell me how to use it. Registered on sf.net as ivan91.

I gave you SVN access, so you can commit your changes directly to the repository. "Howtos" depends on your system - I'm using TortoiseSVN but it's win-only. You may look for graphic Linux-compatible tools (like RapidSVN) or commit changes via terminal. Syntax is described in SVN manual ( http://svnbook.red-bean.com/en/1.1/re06.html ).
But I believe that if you've managed to download sources from SVN, you shouldn't have troubles with commiting your changes ;-)

I gave you also developer status at bugtracker, so you are now able to mark bugs as resolved.

Ivan wrote:
I'd wish to make some more changes in castle handling. Should I replace "old version" if I'll find it?

You may, especially when modifying that parts of interface. The code works same, it's an aesthetic difference.

There are also other new features introduced to GUI btw. It's possible to create parent - children hierarchy between CIntObject-s. If you put in the constructor OBJ_CONSTRUCTION_CAPTURING_AL macro, all CIntObjects subsequently created (till the end of scope) will be automatically assigned as children of that object. It's useful for automatic propagation of some calls among object.

All activate/deactivate/show/delete/move* calls will be also made on children controls if the defActions (for parent) and recActions (for child) are appropriately set.
Child object position is initialized with it's parent position (if it parent->defActions & SHARE_POS), so it's easy to code relative positions between GUI objects (just add rel pos to base value).

For examples of usage of modern GUI features, you may check CAdventureOptions, CSlider, or pregame classes.

OnionKnight wrote:
I'm working on properly implementing combination artifacts, and I'm thinking it might just be better if these artifacts just set their own bonus and when the engine retrieves the bonus for an artifact it will collect the bonuses of the constituents at that point.

Makes sense. :-)
It will be great to have combination artifacts working, good luck on your work!
Have you thought about spell scrolls handling?
I don't have a clean idea for them. They all have the same ID and therefore are considered as same artifacts. But we need another number to store id of spell - not possible within current CArtifact class. :/
_________________
VCMI is a work in progress.
VCMI is NOT an another mod.
 
     
Ivan 
VCMI programmer

Age: 25
Joined: 08 May 2009
Posts: 1438
Location: Ukraine
Posted: 2009-12-29, 17:12   

Actually command to download source code is present in linux.readme - but not diffs & commit commands. I've find out how to work with svn already so this is not a problem now.
Tow wrote:
There are also other new features introduced to GUI btw.

On weekend I've made a small bits of kingdom overview window. Nice place to try out them ;-)

Tow, after your recent changes (rev 1402 & 1403) I can not compile VCMI.
Code:
Connection.cpp:50: error: template<class Serializer> class CISer used without template parameters
Connection.cpp:51: error: template<class Serializer> class COSer used without template parameters

Files from previous revision compiled fine. But some new glitches appeared after end turn. Is that problem only on my side?
 
     
majaczek 

Age: 28
Joined: 12 Jun 2008
Posts: 474
Posted: 2009-12-29, 18:26   

@spell scrolls
I think its best to make spellscrolls make new type of herobonus tempspell and spellID willl be subtype of bonus

or is it indifrientable now which scroll contains which spell?

also maybe add to CArtifact a field
vector<HeroBonus> BindHBonuses
which will be handled as adding those bonuses to hero when equip?

then it will be able not only to check type of spellscroll, but also thee will be a possibility to enchant artifact which may be good subject of future mods
 
     
OnionKnight 
VCMI Programmer


Age: 29
Joined: 19 Jul 2009
Posts: 77
Location: Sweden
Posted: 2009-12-29, 19:41   

Tow wrote:
Makes sense. :-)
It will be great to have combination artifacts working, good luck on your work!
Have you thought about spell scrolls handling?
I don't have a clean idea for them. They all have the same ID and therefore are considered as same artifacts. But we need another number to store id of spell - not possible within current CArtifact class. :/

It seems inevitable that there needs to be a new class representing artifact instances which can hold these parameters. Will be a lot of work migrating from using CArtifact to that, though. :-(

@majaczek: The problem is that the CArtifact class represents the different artifact types, not each individual artifact you might encounter in the game. If you were to change bonuses of a CArtifact you would change bonuses for all artifacts of that type.
 
 
     
majaczek 

Age: 28
Joined: 12 Jun 2008
Posts: 474
Posted: 2009-12-29, 22:04   

So do class CScroll which derives from CArtifact :roll:

OR maybe create class which have function I though - class of individual artifact with CArtifact as friend... so things like Spell scrolls will be resolved also my thought of enchanting etc.
 
     
OnionKnight 
VCMI Programmer


Age: 29
Joined: 19 Jul 2009
Posts: 77
Location: Sweden
Posted: 2009-12-30, 15:46   

Ivan wrote:
Tow, after your recent changes (rev 1402 & 1403) I can not compile VCMI.
Code:
Connection.cpp:50: error: template<class Serializer> class CISer used without template parameters
Connection.cpp:51: error: template<class Serializer> class COSer used without template parameters

There's also a third error on line 52, which is some sort of circular dependency that gcc cannot figure out how to deal with (and neither can I).
Code:
Connection.h: In instantiation of 'CPointerLoader<CISer<CConnection>, CGTownInstance>':
Connection.h:482:   instantiated from 'void CISer<Serializer>::registerType(const T*) [with T = CGHeroInstance, Serializer = CConnection]'
../lib/RegisterTypes.cpp:23:   instantiated from 'void registerTypes1(Serializer&) [with Serializer = CISer<CConnection>]'
../lib/RegisterTypes.cpp:158:   instantiated from 'void registerTypes(Serializer&) [with Serializer = CISer<CConnection>]'
Connection.cpp:52:   instantiated from here
Connection.h:437: warning: 'class CPointerLoader<CISer<CConnection>, CGHeroInstance>' has virtual functions but non-virtual destructor

which keeps repeating until gcc throws in the towel.
majaczek wrote:
So do class CScroll which derives from CArtifact :roll:

OR maybe create class which have function I though - class of individual artifact with CArtifact as friend... so things like Spell scrolls will be resolved also my thought of enchanting etc.

Deriving CArtifact won't really change anything. If you stick to just using CArtifact you'll end up with a solution where you assign new artifact IDs to each spell, giving lots of different spell scroll artifacts.
 
 
     
majaczek 

Age: 28
Joined: 12 Jun 2008
Posts: 474
Posted: 2009-12-30, 19:55   

@deriving
understood. of course if CArtifact is assigned via artifact ID it wont change anything :roll: I feel like silly boy

@scrolls
I vote for Class which represent artifact instances! so instead having ID only we will be having this class. the most important field of this class will be artifact ID (so acces to CArtifact isn't broken) and a few more fields like
vector<CHeroBonus> UniqueArtHeroBonuses;
which will be applied if that instance of artifact will be worn and disapplied if it will be worn out. so we will make only one CArtifact for scrolls like now, we will have difffrient scrolls, and we will be able to enchant artifacts (add bonuses to one instance keeping rest the same) for a mod
 
     
Tow 
Project Lead
VCMI Programmer


Joined: 01 Feb 2008
Posts: 1407
Location: Kraków, Poland
Posted: 2009-12-31, 12:07   

OnionKnight wrote:
There's also a third error on line 52, which is some sort of circular dependency that g cc cannot figure out how to deal with (and neither can I).

The code you pasted is not about an error but about a warning.
But actually G CC is right. CBasicPointerLoader / *Saver should receive virtual destructors. And be deleted. There was a possible leak.
Fixed in r1411.
Are there any further issues with code on G CC?


PS. Mysterious g cc issue hit again :/
_________________
VCMI is a work in progress.
VCMI is NOT an another mod.
 
     
OnionKnight 
VCMI Programmer


Age: 29
Joined: 19 Jul 2009
Posts: 77
Location: Sweden
Posted: 2009-12-31, 15:19   

Tow wrote:
The code you pasted is not about an error but about a warning.
But actually G CC is right. CBasicPointerLoader / *Saver should receive virtual destructors. And be deleted. There was a possible leak.
Fixed in r1411.
Are there any further issues with code on G CC?


PS. Mysterious g cc issue hit again :/

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 :shock: , 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
Code:
g[b][/b]cc
 
 
     
Tow 
Project Lead
VCMI Programmer


Joined: 01 Feb 2008
Posts: 1407
Location: Kraków, Poland
Posted: 2010-01-02, 02:50   

OnionKnight wrote:
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 :shock: , but I guess that's to be expected with C++.

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!

OnionKnight wrote:
Here's a slew of warning output for these files, lots of non-virtual destructor complaints.

Should be better now. (r1415)

OnionKnight wrote:
I use a zero-width workaround by typing
Code:
g[b][/b]cc

Tricky! ;-)
_________________
VCMI is a work in progress.
VCMI is NOT an another mod.
 
     
Tow dragon 
VCMI Programmer


Joined: 01 Feb 2008
Posts: 1004
Location: Kraków
Posted: 2010-01-02, 12:03   

Tow wrote:
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!


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

Quote:
Compilation time for code that uses templates should now scale linearly with the number of instantiations rather than quadratically, as template instantiations are now looked up using hash tables.


CGameState.cpp instantiates a lot of templates... but then this issue should have been noticed long time ago (or nobody cared about compilation time?)
_________________
:)
 
     
Ozsy
Guest
  Posted: 2010-10-25, 06:19   Compiling problems

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.
 
     
Warmonger 
VCMI programmer


Age: 28
Joined: 07 Jun 2008
Posts: 1537
Location: Warsaw, Poland
Posted: 2010-10-25, 07:14   

Jezus...
http://forum.vcmi.eu/viewtopic.php?p=5215#5215

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.
_________________
Think twice if you really need to send me private message. Use public forum for general questions.
DJ Warmonger blog
beegee wrote:
Warmonger, you are the best!
 
 
     
Ozsy 

Age: 29
Joined: 25 Oct 2010
Posts: 4
Location: Szeged, Hungary
Posted: 2010-10-25, 12:05   

Warmonger wrote:
Jezus...
http://forum.vcmi.eu/viewtopic.php?p=5215#5215

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.
 
     
Display posts from previous:   
Reply to topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum
Add this topic to your bookmarks
Printable version

Jump to:  

Powered by phpBB modified by Przemo © 2003 phpBB Group

Hosting provided by DigitalOcean
Page generated in 0.03 second. SQL queries: 12