Compiling VCMI on raspberry

Ok I got pass last one changing resolution in file resolutions.json to native resolution of my display and it seems to load some windows but if flickers and closes. I get another error which now says:

terminate called after throwing an instance of 'std::runtime_error' 
   what(): Unable to create rerender 

So what is actual resolution of your display?

“Unable to create renderer” = internal error in SDL or wrong video backend selected. Try select another renderer:

  1. find in client log list of all available renderers.
  2. set one on them in “settings.json”: “video”:{“driver”:“name”}

I will give some detail about what I do. So first of all I start vcmi by comand “vcmiclient”. This is what i get in the console:

Creating console and configuring logger: 92
The log file will be saved to "/home/pi/.cache/vcmi/VCMI_Client_log.txt"
                  Initialization:  56
                  Data loading: 3607
                 Mod hanler:  1
File CONFIG/MODSETTINGS is not a valid JSON file!
At line 1, position 0 error: File is empty

                     Mod filesystems: 460
Basic initialization: 4128
Initialization logging system based on settings successfully.
Error: campaign movies was not found!
Error: campaign music was not found!
Loading settings: 4160
VCMI 0.97b (client)
Found 3 render drives
                  opengles2 (active)
                  opengles
                  software
terminate called after throwing an instance of 'std::runtime_error'
   what(): Unable to create rerender

I have also tried doing sudo but it does not help. Error is the same.

Actual resolution is 1280x1024. I have put this into resolutions.json file

Did you tried to set renderer (like “software”) as @AVS suggested?

PS: I’ll also appreciate if you upload binaries for testing. :wink:

I have tried all three modes.
How files are uploaded in this forum?

There is quite huge file upload limit (50MB), but only for registered users.

I need to find a way to stop guests from making posts altoghter…

Could you please name the files which I should send you. Cause my guess is they may be scattered around the file system.

It’s depend on how exactly you compiled/installed it. E.g if you used cmake without installation then everything should be in build directory, e.g:
[ul]
]BUILD/launcher/vcmilauncher/:m]
]BUILD/client/vcmiclient/:m]
]BUILD/server/vcmiserver/:m]
]BUILD/lib/libvcmi.so/:m]
]BUILD/AI/BattleAI/libBattleAI.so
BUILD/AI/BattleAI/EmptyAI.so
BUILD/AI/BattleAI/StupidAI.so
BUILD/AI/BattleAI/VCAI.so/
:m][/ul]
Though if files already installed across filesystem you may find them using command like:

# For executables
which vcmilauncher
which vcmiclient
which vcmiserver
# For libraries
ldd `which vcmiclient`
ldd `which vcmiserver`

Though if you used something like “make install” in future I recommend you to use “checkinstall” instead as it’s appropriately register installed files as debian package.

I am uploading files you have specified. It is 7 zipped into two files because whole size is over 50 MB. Before unzipping them you need to rename build001.7z to build.7z.001 and build002.7z to build.7z.002.
build002.7z (27.6 MB)
build001.7z (30 MB)

Thanks for uploading. I’ll be testing this build today on real Pi.
Hopefully I’ll manage to find out why it’s not worked for you.

So I finally managed to run it. Bypass resolution issue you noted and I think it’s related to fact that SDL check XRandr modes and on RPi only native available.

Though I set “driver” to “opengles2”, set fullscreen in launcher to “On” and it’s kind a run. Though menu load RPi CPU for 100%. :unamused:

So I’m end up not being able to run actual gameplay because lack of “fuzzylite” build. Can you upload it as well? :confused:

Could you please point the files which you need for fuzzlite.

I need “libfuzzylite.so.5.0” and if there any other files you built with VCMI please upload them too.

It is very easy to compile I will upload source. If you still need executables please reply.
fuzzylite-5.x.zip (1.81 MB)

Just want to let you know that I’m successfully started game, but client is extremely slow.

I’m attempted to run it under via:

valgrind --tool=callgrind

Sadly valgrind fail to run VCMI for some reason:

=27621== Callgrind, a call-graph generating cache profiler
==27621== Copyright (C) 2002-2011, and GNU GPL'd, by Josef Weidendorfer et al.
==27621== Using Valgrind-3.7.0 and LibVEX; rerun with -h for copyright info
==27621== Command: vcmiclient
==27621== 
==27621== For interactive control, run 'callgrind_control -h'.
disInstr(arm): unhandled instruction: 0xF1010200
                 cond=15(0xF) 27:20=16(0x10) 4:4=0 3:0=0(0x0)
==27621== valgrind: Unrecognised instruction at address 0x4831588.
==27621==    at 0x4831588: ??? (in /usr/lib/arm-linux-gnueabihf/libcofi_rpi.so)
==27621== Your program just tried to execute an instruction that Valgrind
==27621== did not recognise.  There are two possible reasons for this.
==27621== 1. Your program has a bug and erroneously jumped to a non-code
==27621==    location.  If you are running Memcheck and you just saw a
==27621==    warning about a bad jump, it's probably your program's fault.
==27621== 2. The instruction is legitimate but Valgrind doesn't handle it,
==27621==    i.e. it's Valgrind's fault.  If you think this is the case or
==27621==    you are not sure, please let us know and we'll try to fix it.
==27621== Either way, Valgrind will now raise a SIGILL signal which will
==27621== probably kill your program.
==27621== 
==27621== Process terminating with default action of signal 4 (SIGILL)
==27621==  Illegal opcode at address 0x4831588
==27621==    at 0x4831588: ??? (in /usr/lib/arm-linux-gnueabihf/libcofi_rpi.so)
==27621== 
==27621== Events    : Ir
==27621== Collected : 52916814
==27621== 
==27621== I   refs:      52,916,814
Illegal instruction

If you can find way to attach profiler to client it’s may be possible to find out why is lag so much.

Only suspicious thing that visible from outside is error related to sound system:

ALSA lib pcm.c:7339:(snd_pcm_recover) underrun occurred

PS: Already find out why valgrind not working, just commented out libcofi_rpi.so from /etc/ld.so.preload

Sadly now valgrind failed on other file:

==28302==  Illegal opcode at address 0x50A5BF0
==28302==    at 0x50A5BF0: ??? (in /usr/lib/arm-linux-gnueabihf/libSDL2-2.0.so.0.2.0)

Don’t think there is way to bypass it this time. :neutral_face: