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
Assertion "dataSize == 256" failed
Author Message
dreamer10 

Joined: 25 Sep 2014
Posts: 9
  Posted: 2016-09-24, 11:39   Assertion "dataSize == 256" failed

I tried to build and run with the latest commit on "develop" branch. When running vcmiclient directly on my Ubuntu 14.04 (64-bit) machine, wired thing happened:

CObjectClassesHandler.cpp:119 : virtual std::vector<JsonNode> CObjectClassesHandler::loadLegacyData(size_t): Assertion "dataSize == 256" failed.

So I attached gdb to this and printed out the dataSize when it failed. The dataSize was 0. I then read the code:

CLegacyConfigParser parser("Data/Objects.txt");

size_t totalNumber = parser.readNumber(); // first line contains number of objects to read and nothing else
parser.endLine();

for (size_t i=0; i<totalNumber; i++)
{
ObjectTemplate templ;
templ.readTxt(parser);
parser.endLine();
std::pair<si32, si32> key(templ.id.num, templ.subid);
legacyTemplates.insert(std::make_pair(key, templ));
}

std::vector<JsonNode> ret(dataSize);// create storage for 256 objects
assert(dataSize == 256);

I'm sure I have installed data from Heroes3 correctly. Anybody can help? Thank you!
_________________
Connecting dots.
Last edited by dreamer10 on 2016-09-25, 21:24; edited 1 time in total  
 
     
SXX 

Age: 25
Joined: 04 Jul 2014
Posts: 291
Posted: 2016-09-24, 11:40   

Are you running GOG version of H3 data? Some localization?
 
     
dreamer10 

Joined: 25 Sep 2014
Posts: 9
Posted: 2016-09-24, 11:43   

SXX wrote:
Are you running GOG version of H3 data? Some localization?


Exactly, I'm running with the data from GOG. Seems like you've known the answer already :)

I'm not sure what localization means here though..
_________________
Connecting dots.
 
     
dreamer10 

Joined: 25 Sep 2014
Posts: 9
Posted: 2016-09-24, 12:38   

SXX wrote:
Are you running GOG version of H3 data? Some localization?


After looking into it for a while, it's when the

handlers.insert(std::make_pair("objects", ContentTypeHandler(VLC->objtypeh, "object")));

was called that failed the assertion.
_________________
Connecting dots.
 
     
SXX 

Age: 25
Joined: 04 Jul 2014
Posts: 291
Posted: 2016-09-24, 13:31   

Can you please get full backtrace from GDB?
 
     
SXX 

Age: 25
Joined: 04 Jul 2014
Posts: 291
Posted: 2016-09-24, 13:47   

And yeah while I not sure if everything valid with your assets and config location, but can you try to built older version of code? Better one from end of 2015 since after that we merged some filesystem refactoring changes.

I just switched to 16.04 and can't even check how it's works on 14.04.

PS: And if older version of code works then git bisect will help to find what's break it.
 
     
dreamer10 

Joined: 25 Sep 2014
Posts: 9
Posted: 2016-09-24, 17:28   

SXX wrote:
And yeah while I not sure if everything valid with your assets and config location, .....


Thanks for the help SSX. I'll post the gdb statck trace. I just rolled back all the way to the commit that is just before the loadLegacyData function was checked in. But when I tried to build, I got these errors:

make[2]: *** No rule to make target `../include/vstd/CLoggerBase.h', needed by `lib/cotire/vcmi_CXX_prefix.hxx.gch'. Stop.
make[2]: *** Waiting for unfinished jobs....

And this was the error I got when I switch back to the master branch. I'm not that familiar with CMake and couldn't figure out the cause after a while. Could you tell me the cause and how to fix it? Thanks a lot.
_________________
Connecting dots.
 
     
SXX 

Age: 25
Joined: 04 Jul 2014
Posts: 291
Posted: 2016-09-25, 16:00   

Sorry. Wish to answer yesterday, but had unexpected networking loss.
All you need is just do "make clean" or run CMake again so it's make new PCH.
 
     
dreamer10 

Joined: 25 Sep 2014
Posts: 9
Posted: 2016-09-25, 20:22   

SXX wrote:
Sorry. Wish to answer yesterday, but had unexpected networking loss.
All you need is just do "make clean" or run CMake again so it's make new PCH.


Yeah, thanks SXX. I figured it out myself. I spent a lot of time yesterday building a real "executable" vcmiclient, but without luck. I've tried multiple versions such as 0.95, 0.93, 0.92, 0.91.. all the way back to 0.90 until some outdated boost functions couldn't be found. Non of them worked for me.

Then I found the old vcmi repository on my laptop which was pulled from SVN in the past. I compiled the version 0.95, it worked fine and I spent some time playing with it.

In sum, none of the versions from Github worked for me. The code from SVN worked well. I believe SVN used to be the old repository for VCMI of Linux? Could you tell me how did you configured your Ubuntu to work with the latest development code on Github? Thanks!
_________________
Connecting dots.
 
     
SXX 

Age: 25
Joined: 04 Jul 2014
Posts: 291
Posted: 2016-09-26, 21:15   

You shouldn't really spend so much time on building it.
I just meant is that might be broken just in few last months.

All you need to make is working is make sure that you built with valid prefix:
Code:
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=/usr -DENABLE_LAUNCHER=1

Also all files is in "~/.local/share/vcmi/Data" directory:
Code:
H3ab_ahd.snd  H3ab_ahd.vid  H3ab_bmp.lod  H3ab_spr.lod  H3bitmap.lod  H3sprite.lod  Heroes3.snd  VIDEO.VID

Contents of "Mods" directory from repository must be in:
Code:
/usr/share/vcmi/Mods/

And "config" content should be in:
Code:
/usr/share/vcmi/config


I'll re-test it with Ubuntu 14.04 livecd and hopefully find out what's wrong.
 
     
SXX 

Age: 25
Joined: 04 Jul 2014
Posts: 291
Posted: 2016-09-26, 23:12   

So I successfully built and run it on live VM under Ubuntu 14.04.5.
All works fine with assets I use which is weird.

I also tried to install assets from GOG using vcmibuilder:
Code:
vcmibuilder --gog setup_homm3_complete_2.0.0.16.exe

Again that worked just fine.
 
     
dreamer10 

Joined: 25 Sep 2014
Posts: 9
Posted: 2016-10-01, 22:34   

SXX wrote:
You shouldn't really spend so much time on building it.
I just meant is that might be broken just in few last months.
.....


Thanks a lot SXX. Sorry for my late response. I've sucessfully built it and got it run. I did get several issues though, including linking problem, rmg exception, libgl issue, which seems not smoothly. I guess the main reason is I had some legacy library installed and some link file linked to incorrect places.

The libgl error is mainly because I ssh to my ubuntu laptop and typed
Code:
vcmiclient
run command on my mac terminal. Somehow the X11-server can't be run correctly on my Mac (it worked for the build on SVN trunk (0.95)). But it's not the concern here.

Anyway, it builds and runs successfully. Thanks a lot for you help. BTW, when I was reading at the code, I'm wondering what exactly is the CStack? What is the main purpose of maintaining such a data structure? Is it used to represent the creatures queue in the battle?
 
     
SXX 

Age: 25
Joined: 04 Jul 2014
Posts: 291
Posted: 2016-10-02, 07:35   

dreamer10 wrote:
Somehow the X11-server can't be run correctly on my Mac (it worked for the build on SVN trunk (0.95)). But it's not the concern here.
Actually VCMI can now run natively on MacOS just fine since @vmarkovtsev fixed all related problems.

dreamer10 wrote:
BTW, when I was reading at the code, I'm wondering what exactly is the CStack? What is the main purpose of maintaining such a data structure? Is it used to represent the creatures queue in the battle?
What exactly you mean as "used to"? It's actually does.

There are situations in H3 where stacks in battle isn't same thing as CArmedInstance army since there at least special merging rules when someone attack town with visiting hero in it and armies has to be merged (this is not implemented in VCMI just yet, but it's critical for gameplay).

Also there is tons of different option you may note CStack have that simply not used outside of battle. Another thing is that's handy for CStack to be separate bonus node since that way it's easier to make sure all battle-wide bonuses only are only remain in battle.

PS: Also if you wish to contribute feel free to jump on IRC #vcmi at freenode.net
We also setup Slack yesterday, but there no invite page for it yet.
So you can ask any questions there if you want to work on something and need operative answers.

UPD: Just in case: army merging does implemented :-)
 
     
dreamer10 

Joined: 25 Sep 2014
Posts: 9
Posted: 2016-10-07, 18:46   

SXX wrote:


PS: Also if you wish to contribute feel free to jump on IRC #vcmi at freenode.net
We also setup Slack yesterday, but there no invite page for it yet.
So you can ask any questions there if you want to work on something and need operative answers.

UPD: Just in case: army merging does implemented :-)


Hi SXX, thanks for the info. I'll try my first pull request later today. Could you tell me when will this event happen? Is there a link to the events on freenode and slack?
_________________
Connecting dots.
 
     
SXX 

Age: 25
Joined: 04 Jul 2014
Posts: 291
Posted: 2016-10-08, 18:15   

dreamer10 wrote:
Hi SXX, thanks for the info. I'll try my first pull request later today. Could you tell me when will this event happen? Is there a link to the events on freenode and slack?
Sent PM to me or Dydzio: we'll give you invite on slack. Everyone allowed to give invites to anyone since it's not anything private.

UPD: Forgot to say. If someone want access to slack then please PM your email since for now it's only way to do that. Later on we'll have page that will sent invites automatically.
 
     
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
Template Chronicles modified by Nasedo modified by Tow.
© VCMI Team
Page generated in 0.06 second. SQL queries: 12