Converting Puzzle Moppet assets

Converting Puzzle Moppet assets

Postby Knitter » 06 Jul 2012, 13:16

Hi,

Status:
- Recreated repository and pushed initial commit to bitbucket, https://bitbucket.org/Knitter/puzzlemoppet
- Replaced all existing textures with the ones qubodup provided;

Repo folders:
/assets - contains source files for sound, model and some image assets, makes up for most of the current project size and increases repo size (sea.flac takes almost 15MB);
/puzzlemoppet - contains project files, source files and all the needed tools to build the game;

Next:
- Add build instructions to the wiki pages;

I chose to keep the source files for the assets so that all the needed files for the game are in one single place. Though the files won't change much it made little sense to place them in any hosting service or risk them disappearing, I understand that those files make the repository bigger but I think it is an acceptable disadvantage. If you prefer I drop the assets folder please say so I'll consider the majority of the votes.

Any suggestions are welcome, patches and bug reports are also much welcome and the project has a public issue tracker for everyone to use :) . I'll try to test the source and compile the project in the next days.

Edit: Updated status and list of next tasks.
Last edited by Knitter on 06 Jul 2012, 17:05, edited 3 times in total.
Knitter
 
Posts: 237
Joined: 03 Jul 2011, 22:52
Location: Portugal

Re: Converting Puzzle Moppet assets

Postby ctdabomb » 06 Jul 2012, 13:26

maybe you should move this to "art & assets" forum?
Some people are like slinkies... not really good for anything, but you still can't help smiling when you shove them down the stairs.
ctdabomb
 
Posts: 1075
Joined: 13 Dec 2011, 21:21
Location: halfway there

Re: Converting Puzzle Moppet assets

Postby qubodup » 06 Jul 2012, 14:07

ctdabomb {l Wrote}:maybe you should move this to "art & assets" forum?

Nah. This is about collaborating on a game project and might turn out into more than just art. Could have stayed in the same thread though. In any case, let's see where this takes us.
Knitter {l Wrote}:- Replaced sounds with the ones qubodup found, updated code with the file names (ogg -> wav);
- Check to see if the replaced WAV files perform well in-game or change them to OGG;

ogg->wav? You want to serve all sounds in releases as .wav? Or just a typo and you mean .ogg?
For reference:
Wav = lossless, uncompressed. BIG. Sometimes useful for sounds that need to be played back FAST.
Ogg Vorbis = lossy, compressed. SMALL. Should be better for sounds that are ok to have a bit of delay (win sounds, music, ambience).

I would try using .ogg only.

Any suggestions are welcome, patches and bug reports are also much welcome and the project has a public issue tracker for everyone to use :) . I'll try to test the source and compile the project in the next days.[/quote]
Great! I think your structure is fine. I would probably create a media_src or art-sources directory instead next to the existing media directory but there's not much of a difference there.

You did not link the project (please edit the first post to include it).

PS: I created a 5.2MB 30-seconds sea.flac. I think it would be better to use that one to save space/traffic: https://www.box.com/s/06ebc5a150fa720852cf

I believe one power of small games is the ability to reach people with slow internet connections, which is why I suggest using .ogg over .wav for packages.
User avatar
qubodup
Global Moderator
 
Posts: 1671
Joined: 08 Nov 2009, 22:52
Location: Berlin, Germany

Re: Converting Puzzle Moppet assets

Postby xDan » 06 Jul 2012, 14:32

I'm pretty sure the only sound format currently supported is ogg :) WAV could perhaps be loaded with alut, but I don't think I managed to get alut to work on Mac OS, so I avoided it.
xDan
 
Posts: 14
Joined: 30 Jun 2012, 21:17

Re: Converting Puzzle Moppet assets

Postby Knitter » 06 Jul 2012, 15:37

qubodup {l Wrote}:Could have stayed in the same thread though. In any case, let's see where this takes us.

Merge/move to any place you feel is better, since I suspected I would have some questions and comments specific to the conversion I created this topic, but I'm fine with a merge.

qubodup {l Wrote}:ogg->wav? You want to serve all sounds in releases as .wav? Or just a typo and you mean .ogg?

Not really a typo but maybe I expressed it wrong, I meant to say that I changed the code to use the provided WAV files instead of the original OGG files. I did this because I had some bad results while trying to convert from the FLAC file to OGG.

qubodup {l Wrote}:I would try using .ogg only.

It is my goal to replace the WAV files with proper OGG.

qubodup {l Wrote}:I believe one power of small games is the ability to reach people with slow internet connections, which is why I suggest using .ogg over .wav for packages.

I thought about that but the resulting package would be small, even if you pack the sources with any binaries. It is the assets folder with the blend and flac files that makes the repository large, after commit and push the size is around 30MB, but that is the size of the all repository with the .git folder and the source assets that a dev would have to download the first time.

xDan {l Wrote}:I'm pretty sure the only sound format currently supported is ogg :) WAV could perhaps be loaded with alut, but I don't think I managed to get alut to work on Mac OS, so I avoided it.

I'm trying to test that but I'm having some difficulty in compiling the game, under OS X I get some conversion issues (32bit vs 64bit?) and under GNU Linux I'm trying to find all the required libraries.
Knitter
 
Posts: 237
Joined: 03 Jul 2011, 22:52
Location: Portugal

Re: Converting Puzzle Moppet assets

Postby Knitter » 06 Jul 2012, 17:16

I edited the initial topic, though I don't really like to edit messages, so sorry the double post.

I've re-created the repository, if you were following it you'll need to go to bitbucket again. I noticed that there some files were duplicated and I also replaced the sea.flac with the smaller one making the repository a bit smaller, also converted all audio files to OGG and removed the WAV ones. Sox was distorting the sounds in OS X while converting but I tried in Linux and the result shows no sound artifacts/distortions.

There was a missing (was it really missing or does it come from some lib?) source file, stb_vorbis.c was not in the source archive, I think I've downloaded it from the correct location (http://nothings.org/stb_vorbis) and added it to the source.

I still can't build the game, in GNU Linux I still need to track all the external libraries since it was not linking to Irrlicht and some others, in OS X it fails to compile with the error "cast from pointer to smaller type 'u32'.
Knitter
 
Posts: 237
Joined: 03 Jul 2011, 22:52
Location: Portugal

Re: Converting Puzzle Moppet assets

Postby xDan » 06 Jul 2012, 18:35

Oh yes sorry, I forgot to add copying of *.c files in my source copying script. You've found the right file, that should be the only C file.

libvorbis is not required.

sorry, I don't have much tips for compiling the game, it's a while since I dared attempt it.

irrlicht is the only thing required in /thirdparty, other libs (ODE, OpenAL) were just make-installed to the normal lib locations.

I've a vague memory that I may have stored a pointer in a 32 bit integer at one point to hack around something or other. Sorry :S So maybe that needs fixing for 64-bit systems...

--> grep for "IrrlichtEvent" (in Engine.cpp):

{l Code}: {l Select All Code}
   // WARNING: This is a hack, until I have implemented all Irrlicht events in
   // this engine. Obviously this event cannot be stored or transmitted over a network
   // in case the pointer gets invalidated.
   // Also the pointer will probably not be valid on 64 bit systems.
   Event event("IrrlichtEvent");
   event["SEvent"] = (u32)&irrEvent;
   newEvents.push_back(event);


from a quick look through, I'm not sure that event is actually even used anywhere, you could just try commenting out those three line and see it it runs :S
xDan
 
Posts: 14
Joined: 30 Jun 2012, 21:17

Re: Converting Puzzle Moppet assets

Postby qubodup » 06 Jul 2012, 18:43

license-sounds replacement:
{l Code}: {l Select All Code}
speedcore.flac
  author: Daniel Frith <dan@xzist.org>
  license: WTFPLv2
  note: created using "HammerHead rhythm station" <http://www.threechords.com/hammerhead/>
User avatar
qubodup
Global Moderator
 
Posts: 1671
Joined: 08 Nov 2009, 22:52
Location: Berlin, Germany

Re: Converting Puzzle Moppet assets

Postby MCMic » 06 Jul 2012, 19:05

Does the game needs to be launched from a specific directory?
The bin one? the puzzlemoppet one? The root of the git or the assets one?

I managed to build the game as said here : viewtopic.php?f=22&t=3221&p=32019#p32013
But it won't launch without segfaulting :-/
I use archlinux and ode from the repositories. Besides the c++ flags thing for ODE, got no problem with compiling.
User avatar
MCMic
 
Posts: 723
Joined: 05 Jan 2010, 17:40

Re: Converting Puzzle Moppet assets

Postby xDan » 06 Jul 2012, 19:22

I'm pretty sure the directory wasn't supposed to matter, it finds and sets the directory to the correct one automatically.. However it is the bin directory it sets it to, yes. Unless there's a bug :)

are you launching from command line? is any message given? what about log files?

if not, try running with gdb... (enable debugging in the top level CMakeLists.txt)

it may be it can't find a correct shared library.
xDan
 
Posts: 14
Joined: 30 Jun 2012, 21:17

Re: Converting Puzzle Moppet assets

Postby MCMic » 06 Jul 2012, 20:04

http://pastebin.archlinux.fr/448878 -> Gdb is not really useful on this one, is it?
User avatar
MCMic
 
Posts: 723
Joined: 05 Jan 2010, 17:40

Re: Converting Puzzle Moppet assets

Postby MCMic » 06 Jul 2012, 20:06

Oh, I got it, it built with irrlicht 1.6.1 but is using 1.7 version when launching -_-

[EDIT] hum I uninstalled irrlicht 1.7, I managed to build irrlicht but it won't link :
/usr/bin/ld: /home/mcmic/dev/puzzlemoppet/puzzlemoppet/thirdparty/irrlicht-1.6.1/lib/Linux/libIrrlicht
.a(CIrrDeviceLinux.o): undefined reference to symbol 'XPending'
/usr/bin/ld: note: 'XPending' is defined in DSO /usr/lib/libX11.so.6 so try adding it to the linker co
mmand line
/usr/lib/libX11.so.6: could not read symbols: Invalid operation
collect2: erreur: ld a retourné 1 code d'état d'exécution
make[2]: *** [bin/PuzzleGame_FullVersion] Erreur 1
make[1]: *** [projects/Puzzle/CMakeFiles/PuzzleGame_FullVersion.dir/all] Erreur 2
make: *** [all] Erreur 2
User avatar
MCMic
 
Posts: 723
Joined: 05 Jan 2010, 17:40

Re: Converting Puzzle Moppet assets

Postby qubodup » 06 Jul 2012, 20:50

Thanks for posting the error message. It looks like https://bitbucket.org/alfonse/gltut/iss ... make-gmake might contain the solution.
User avatar
qubodup
Global Moderator
 
Posts: 1671
Joined: 08 Nov 2009, 22:52
Location: Berlin, Germany

Re: Converting Puzzle Moppet assets

Postby KIAaze » 07 Jul 2012, 18:44

I also gave it a go and managed to compile and run it, but it crashes with the following eror:
{l Code}: {l Select All Code}
ODE Message 2: mass must be > 0 in dMassCheck() File ../../../../../ode/src/mass.cpp Line 49

ODE Message 2: mass must be > 0 in dMassCheck() File ../../../../../ode/src/mass.cpp Line 49

ODE INTERNAL ERROR 1: assertion "dMassCheck(mass)" failed in dBodySetMass() [../../../../../ode/src/ode.cpp]
*** Crashed with return code: 0 ***


How I got it to compile on Kubuntu 12.04, 64bit:
1) Commented out the u32 lines in puzzlemoppet/source/Engine.cpp as suggested by Dan:
{l Code}: {l Select All Code}
diff --git a/puzzlemoppet/source/Engine.cpp b/puzzlemoppet/source/Engine.cpp
index 5b1c961..cb946a3 100644
--- a/puzzlemoppet/source/Engine.cpp
+++ b/puzzlemoppet/source/Engine.cpp
@@ -781,9 +781,9 @@ bool Engine::OnEvent(const SEvent &irrEvent)
        // this engine. Obviously this event cannot be stored or transmitted over a network
        // in case the pointer gets invalidated.
        // Also the pointer will probably not be valid on 64 bit systems.
-       Event event("IrrlichtEvent");
-       event["SEvent"] = (u32)&irrEvent;
-       newEvents.push_back(event);
+//     Event event("IrrlichtEvent");
+//     event["SEvent"] = (u32)&irrEvent;
+//     newEvents.push_back(event);
       
        // Send 'em all!
        for (u32 i = 0; i < newEvents.size(); i ++)


2) dependencies
{l Code}: {l Select All Code}
sudo apt-get install libode-dev libopenal-dev


3) Download&build Irrlicht 1.6.1
{l Code}: {l Select All Code}
sudo apt-get build-dep libirrlicht1.7a
cd source/Irrlicht && make


4) Cmake configuration:
If you put the "irrlicht-1.6.1" into "puzzlemoppet/thirdparty"
{l Code}: {l Select All Code}
cmake . && make

Otherwise:
Variables to add/change:
{l Code}: {l Select All Code}
CPATH = $HOME/src/irrlicht-1.6.1/include/
CMAKE_CXX_FLAGS = -DdSINGLE -L$HOME/src/irrlicht-1.6.1/lib/Linux

It's easier with "cmake-gui ."
Then configure, generate and
{l Code}: {l Select All Code}
make VERBOSE=1

(VERBOSE=1 helps with debugging)

I guess it will work on 32bit machines if the error is due to the commented lines. Will try later in a Virtualmachine. Hopefully I won't get 3D acceleration problems.
User avatar
KIAaze
 
Posts: 85
Joined: 08 Dec 2009, 17:34

Re: Converting Puzzle Moppet assets

Postby KIAaze » 07 Jul 2012, 22:26

Ok, tested in VirtualBox with Ubuntu 12.04, 32bit and it compiled without issues (*), but it segfaults with:
{l Code}: {l Select All Code}
Identified level: forbidden_land.lev
Identified level: confusion.lev
Identified level: pyramid_mining.lev
Identified level: finalscene1.lev
Identified level: finalscene2.lev
furthest save path: /home/toto/.Puzzle Moppet/puzzlegame.save.furthest
Level::Level: ../projects/Puzzle/levels/levels/titlescreen.lev

ODE Message 2: mass must be > 0 in dMassCheck() File ../../../../../ode/src/mass.cpp Line 49
Segmentation fault (core dumped)
toto@toto-VirtualBox:~/puzzlemoppet/puzzlemoppet/bin$ echo $?
139


(*) Updated previous instructions with missing libopenal-dev dependency. Put irrlicht into the thirdparty folder this time, so no need for changes to the cmake config. Also no changes to the source file.
Thanks for the great git repo and all the tips for compiling. :)

Still running it with gdb in VirtualBox, but it's taking some time.
Also, the precompiled binary from the official website ran in VirtualBox, so the segfault is not a virtualization issue.

edit: gdb backtrace:
{l Code}: {l Select All Code}
toto@toto-VirtualBox:~/puzzlemoppet/puzzlemoppet/bin$ gdb ./PuzzleGame_FullVersion
GNU gdb (Ubuntu/Linaro 7.4-2012.04-0ubuntu2) 7.4-2012.04
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-linux-gnu".
For bug reporting instructions, please see:
<http://bugs.launchpad.net/gdb-linaro/>...
Reading symbols from /home/toto/puzzlemoppet/puzzlemoppet/bin/PuzzleGame_FullVersion...done.
(gdb) run
Starting program: /home/toto/puzzlemoppet/puzzlemoppet/bin/PuzzleGame_FullVersion
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/i386-linux-gnu/libthread_db.so.1".
Litha Game Engine
Arg: /home/toto/puzzlemoppet/puzzlemoppet/bin/PuzzleGame_FullVersion
Actual executable path: /home/toto/puzzlemoppet/puzzlemoppet/bin/PuzzleGame_FullVersion
Settings path: /home/toto/.Puzzle Moppet/Puzzle Moppet.ini
Logging to /home/toto/puzzlemoppet/puzzlemoppet/bin/Puzzle Moppet.log
Also logging to /var/log/Puzzle Moppet.log
Original starting path: /home/toto/puzzlemoppet/puzzlemoppet/bin
Querying current desktop resolution...
Irrlicht Engine version 1.6.1
Linux 3.2.0-25-generic-pae #40-Ubuntu SMP Wed May 23 22:11:24 UTC 2012 i686
Cached original resolution: 1024x768
Irrlicht says: Irrlicht Engine version 1.6.1
Irrlicht says: Linux 3.2.0-25-generic-pae #40-Ubuntu SMP Wed May 23 22:11:24 UTC 2012 i686
Irrlicht says: Creating X window...
Irrlicht says: Visual chosen: : 252
Irrlicht says: Using renderer: OpenGL 2.1
Irrlicht says: Gallium 0.4 on llvmpipe (LLVM 0x300): VMware, Inc.
Irrlicht says: OpenGL driver version is 1.2 or better.
Irrlicht says: GLSL version: 1.2
Changing directory to /home/toto/puzzlemoppet/puzzlemoppet/bin
Current directory is now /home/toto/puzzlemoppet/puzzlemoppet/bin
Fullscreen: 0
VSync: 1
Max render FPS: 60.0
[New Thread 0xb7e38b40 (LWP 21642)]
[Thread 0xb7e38b40 (LWP 21642) exited]
[New Thread 0xb7e38b40 (LWP 21643)]
AL lib: pulseaudio.c:331: PulseAudio returned minreq > tlength/2; expect break up
[New Thread 0xb34ffb40 (LWP 21644)]
Shader level set to 1 (high)
Shader level set to 0 (low)
New shader instance, material ID is 24
AddEffect {320,240}.
Success!
Actual effect RTT size is {320,240}.
New shader instance, material ID is 25
AddEffect {320,240}.
Success!
Actual effect RTT size is {320,240}.
New shader instance, material ID is 26
AddEffect {320,240}.
Success!
Actual effect RTT size is {320,240}.
New shader instance, material ID is 27
Preloading media...
Finished preloading!
Entering start screen...
Identified level: intro.lev
Identified level: first.lev
Identified level: shiftblocks.lev
Identified level: tutorial_lifts.lev
Identified level: concept_level.lev
Identified level: tutorial_jump.lev
Identified level: icy_intro.lev
Identified level: tower.lev
Identified level: lalala_mini.lev
Identified level: alittlebridge.lev
Identified level: up_and_down.lev
Identified level: not_more_shiftblocks.lev
Identified level: icytraversal.lev
Identified level: splody.lev
Identified level: simple_aha.lev
Identified level: icystoppers.lev
Identified level: balloonacy.lev
Identified level: balloon_dispenser.lev
Identified level: balloonacy2.lev
Identified level: liftland.lev
Identified level: up_in_the_sky.lev
Identified level: balloons_and_boxes.lev
Identified level: balloonacy3.lev
Identified level: stack_sliding.lev
Identified level: discovery.lev
Identified level: stack_sliding2.lev
Identified level: craftymining.lev
Identified level: stack_sliding3.lev
Identified level: moonballoon.lev
Identified level: forbidden_land.lev
Identified level: confusion.lev
Identified level: pyramid_mining.lev
Identified level: finalscene1.lev
Identified level: finalscene2.lev
save path: /home/toto/.Puzzle Moppet/puzzlegame.save
Identified level: intro.lev
Identified level: first.lev
Identified level: shiftblocks.lev
Identified level: tutorial_lifts.lev
Identified level: concept_level.lev
Identified level: tutorial_jump.lev
Identified level: icy_intro.lev
Identified level: tower.lev
Identified level: lalala_mini.lev
Identified level: alittlebridge.lev
Identified level: up_and_down.lev
Identified level: not_more_shiftblocks.lev
Identified level: icytraversal.lev
Identified level: splody.lev
Identified level: simple_aha.lev
Identified level: icystoppers.lev
Identified level: balloonacy.lev
Identified level: balloon_dispenser.lev
Identified level: balloonacy2.lev
Identified level: liftland.lev
Identified level: up_in_the_sky.lev
Identified level: balloons_and_boxes.lev
Identified level: balloonacy3.lev
Identified level: stack_sliding.lev
Identified level: discovery.lev
Identified level: stack_sliding2.lev
Identified level: craftymining.lev
Identified level: stack_sliding3.lev
Identified level: moonballoon.lev
Identified level: forbidden_land.lev
Identified level: confusion.lev
Identified level: pyramid_mining.lev
Identified level: finalscene1.lev
Identified level: finalscene2.lev
furthest save path: /home/toto/.Puzzle Moppet/puzzlegame.save.furthest
furthest file did not exist...
Will attempt to create.
save path: /home/toto/.Puzzle Moppet/puzzlegame.save
furthest save path: /home/toto/.Puzzle Moppet/puzzlegame.save.furthest
*** WARNING at StartScreen.cpp:106:StartScreen: (failed)
Identified level: intro.lev
Identified level: first.lev
Identified level: shiftblocks.lev
Identified level: tutorial_lifts.lev
Identified level: concept_level.lev
Identified level: tutorial_jump.lev
Identified level: icy_intro.lev
Identified level: tower.lev
Identified level: lalala_mini.lev
Identified level: alittlebridge.lev
Identified level: up_and_down.lev
Identified level: not_more_shiftblocks.lev
Identified level: icytraversal.lev
Identified level: splody.lev
Identified level: simple_aha.lev
Identified level: icystoppers.lev
Identified level: balloonacy.lev
Identified level: balloon_dispenser.lev
Identified level: balloonacy2.lev
Identified level: liftland.lev
Identified level: up_in_the_sky.lev
Identified level: balloons_and_boxes.lev
Identified level: balloonacy3.lev
Identified level: stack_sliding.lev
Identified level: discovery.lev
Identified level: stack_sliding2.lev
Identified level: craftymining.lev
Identified level: stack_sliding3.lev
Identified level: moonballoon.lev
Identified level: forbidden_land.lev
Identified level: confusion.lev
Identified level: pyramid_mining.lev
Identified level: finalscene1.lev
Identified level: finalscene2.lev
furthest save path: /home/toto/.Puzzle Moppet/puzzlegame.save.furthest
Level::Level: ../projects/Puzzle/levels/levels/titlescreen.lev
 
ODE Message 2: mass must be > 0 in dMassCheck() File ../../../../../ode/src/mass.cpp Line 49
 
ODE Message 2: mass must be > 0 in dMassCheck() File ../../../../../ode/src/mass.cpp Line 49
 
ODE INTERNAL ERROR 1: assertion "dMassCheck(mass)" failed in dBodySetMass() [../../../../../ode/src/ode.cpp]
 
Program received signal SIGABRT, Aborted.
0x00132416 in __kernel_vsyscall ()
(gdb) bt
#0  0x00132416 in __kernel_vsyscall ()
#1  0x004191ef in raise () from /lib/i386-linux-gnu/libc.so.6
#2  0x0041c835 in abort () from /lib/i386-linux-gnu/libc.so.6
#3  0x001c65ee in dDebug () from /usr/lib/libode.so.1
#4  0x001d5332 in dBodySetMass () from /usr/lib/libode.so.1
#5  0x08282c50 in DynamicBody::DynamicBody(dxWorld*) ()
#6  0x00000000 in ?? ()


Dynamic libraries of the precompiled binary:
{l Code}: {l Select All Code}
        linux-gate.so.1 =>  (0xf775f000)
        libGL.so.1 => /usr/lib/i386-linux-gnu/mesa/libGL.so.1 (0xf76e0000)
        libXxf86vm.so.1 => /usr/lib/i386-linux-gnu/libXxf86vm.so.1 (0xf76da000)
        libXrandr.so.2 => /usr/lib/i386-linux-gnu/libXrandr.so.2 (0xf76d0000)
        libalut.so.0 => $HOME/Downloads/PuzzleMoppetFullVersion/bin/./libalut.so.0 (0xf76c8000)
        libopenal.so.1 => $HOME/Downloads/PuzzleMoppetFullVersion/bin/./libopenal.so.1 (0xf767c000)
        libstdc++.so.6 => /usr/lib/i386-linux-gnu/libstdc++.so.6 (0xf7597000)
        libm.so.6 => /lib/i386-linux-gnu/libm.so.6 (0xf756b000)                                                                                                                                           
        libgcc_s.so.1 => /lib/i386-linux-gnu/libgcc_s.so.1 (0xf754c000)                                                                                                                                   
        libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xf73a7000)                                                                                                                                           
        libX11.so.6 => /usr/lib/i386-linux-gnu/libX11.so.6 (0xf7273000)                                                                                                                                   
        libglapi.so.0 => /usr/lib/i386-linux-gnu/libglapi.so.0 (0xf725d000)                                                                                                                               
        libXext.so.6 => /usr/lib/i386-linux-gnu/libXext.so.6 (0xf724b000)                                                                                                                                 
        libXdamage.so.1 => /usr/lib/i386-linux-gnu/libXdamage.so.1 (0xf7246000)                                                                                                                           
        libXfixes.so.3 => /usr/lib/i386-linux-gnu/libXfixes.so.3 (0xf7240000)                                                                                                                             
        libX11-xcb.so.1 => /usr/lib/i386-linux-gnu/libX11-xcb.so.1 (0xf723d000)                                                                                                                           
        libxcb-glx.so.0 => /usr/lib/i386-linux-gnu/libxcb-glx.so.0 (0xf7225000)                                                                                                                           
        libxcb.so.1 => /usr/lib/i386-linux-gnu/libxcb.so.1 (0xf7204000)                                                                                                                                   
        libdrm.so.2 => /usr/lib/i386-linux-gnu/libdrm.so.2 (0xf71f6000)                                                                                                                                   
        libpthread.so.0 => /lib/i386-linux-gnu/libpthread.so.0 (0xf71db000)
        libdl.so.2 => /lib/i386-linux-gnu/libdl.so.2 (0xf71d6000)
        libXrender.so.1 => /usr/lib/i386-linux-gnu/libXrender.so.1 (0xf71cc000)
        librt.so.1 => /lib/i386-linux-gnu/librt.so.1 (0xf71c3000)
        /lib/ld-linux.so.2 (0xf7760000)
        libXau.so.6 => /usr/lib/i386-linux-gnu/libXau.so.6 (0xf71be000)
        libXdmcp.so.6 => /usr/lib/i386-linux-gnu/libXdmcp.so.6 (0xf71b7000)

Dynamic libraries of the binary I compiled:
{l Code}: {l Select All Code}
        linux-vdso.so.1 =>  (0x00007ffff73ff000)
        libGL.so.1 => /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1 (0x00007f4da91be000)
        libXxf86vm.so.1 => /usr/lib/x86_64-linux-gnu/libXxf86vm.so.1 (0x00007f4da8fb9000)
        libode.so.1 => /usr/lib/libode.so.1 (0x00007f4da8cca000)
        libopenal.so.1 => /usr/lib/x86_64-linux-gnu/libopenal.so.1 (0x00007f4da8a7a000)
        libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f4da877a000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f4da847f000)
        libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f4da8269000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f4da7eac000)
        libX11.so.6 => /usr/lib/x86_64-linux-gnu/libX11.so.6 (0x00007f4da7b77000)
        libglapi.so.0 => /usr/lib/x86_64-linux-gnu/libglapi.so.0 (0x00007f4da7952000)
        libXext.so.6 => /usr/lib/x86_64-linux-gnu/libXext.so.6 (0x00007f4da7741000)
        libXdamage.so.1 => /usr/lib/x86_64-linux-gnu/libXdamage.so.1 (0x00007f4da753d000)
        libXfixes.so.3 => /usr/lib/x86_64-linux-gnu/libXfixes.so.3 (0x00007f4da7337000)
        libX11-xcb.so.1 => /usr/lib/x86_64-linux-gnu/libX11-xcb.so.1 (0x00007f4da7135000)
        libxcb-glx.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-glx.so.0 (0x00007f4da6f1d000)
        libxcb.so.1 => /usr/lib/x86_64-linux-gnu/libxcb.so.1 (0x00007f4da6cff000)
        libdrm.so.2 => /usr/lib/x86_64-linux-gnu/libdrm.so.2 (0x00007f4da6af4000)
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f4da68d6000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f4da66d2000)
        librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f4da64c9000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f4da9444000)
        libXau.so.6 => /usr/lib/x86_64-linux-gnu/libXau.so.6 (0x00007f4da62c6000)
        libXdmcp.so.6 => /usr/lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007f4da60c0000)


Main different libraries:
precompiled:
{l Code}: {l Select All Code}
linux-gate.so.1
libXrandr.so.2
libalut.so.0
libXrender.so.1

from source:
{l Code}: {l Select All Code}
linux-vdso.so.1
libode.so.1
Last edited by KIAaze on 08 Jul 2012, 03:34, edited 1 time in total.
User avatar
KIAaze
 
Posts: 85
Joined: 08 Dec 2009, 17:34

Re: Converting Puzzle Moppet assets

Postby KIAaze » 08 Jul 2012, 03:09

A more useful backtrace:
{l Code}: {l Select All Code}
(gdb) bt
#0  0x000000000057edc2 in Level::CreatePlayer(irr::core::vector3d<int>) ()
#1  0x000000000059359e in Level::Level(MainState*, irr::core::string<char, irr::core::irrAllocator<char> >, std::deque<UndoState, std::allocator<UndoState> >*) ()
#2  0x00000000005cffa6 in StartScreen::CreatePreviewLevel(irr::core::string<char, irr::core::irrAllocator<char> >) [clone .constprop.294] ()
#3  0x00000000005d97c1 in StartScreen::StartScreen(MainState**) ()
#4  0x000000000056be33 in main ()


If anybody knows how to get gdb to show line numbers, I'm interested.
I replaced the debug flags with "-ggdb" since it is supposed to give more info.
The "mass error" occurs just after the following line in "Puzzle/Level.cpp":
{l Code}: {l Select All Code}
ICharacter *entity = world->AddCharacter(mesh, ANIM_IDLE, ANIM_WALK, ACTOR_PHYSICAL_HEIGHT);

Puzzle/main.cpp -> Puzzle/StartScreen.cpp -> Level.cpp

To save time for others:
The "source" folder actually only contains the custom "Litha game engine", while "Puzzle" contains the actual game code and the main() function.

I did finally get to the title screen, without any loaded level by disabling most things in StartScreen::StartScreen.
Menu is there, but selecting anything crashes game.
So sound and graphics work. Now to fix the ODE part...

@xDan: Any chance you used an ODE version different from 0.11.1?
User avatar
KIAaze
 
Posts: 85
Joined: 08 Dec 2009, 17:34

Re: Converting Puzzle Moppet assets

Postby KIAaze » 08 Jul 2012, 03:36

Patch to disable the trial version:
{l Code}: {l Select All Code}
diff --git a/puzzlemoppet/projects/Puzzle/CMakeLists.txt b/puzzlemoppet/projects/Puzzle/CMakeLists.txt
index abfa8ec..b390ab7 100644
--- a/puzzlemoppet/projects/Puzzle/CMakeLists.txt
+++ b/puzzlemoppet/projects/Puzzle/CMakeLists.txt
@@ -33,11 +33,3 @@ endif (projectProperties)
 target_link_libraries(${projectName}_FullVersion ${projectLibs})
 
 
-# Special for this project: Trial version!
-add_executable(${projectName}_TrialVersion ${sourceFiles})
-if (projectProperties)
-       set_target_properties(${projectName}_TrialVersion ${projectProperties} COMPILE_FLAGS -DTRIAL)
-else (projectProperties)
-       set_target_properties(${projectName}_TrialVersion PROPERTIES COMPILE_FLAGS -DTRIAL)
-endif (projectProperties)
-target_link_libraries(${projectName}_TrialVersion ${projectLibs})
User avatar
KIAaze
 
Posts: 85
Joined: 08 Dec 2009, 17:34

Re: Converting Puzzle Moppet assets

Postby KIAaze » 08 Jul 2012, 03:51

Managed to load a level directly with:
{l Code}: {l Select All Code}
./PuzzleGame_FullVersion ../projects/Puzzle/levels/levels/first.lev

Everything works, including gravity! :)
(and that's compiled on 64bit)

The level editor (./PuzzleGame_FullVersion -e name.lev) is also fully functional.

The only strange thing is that the moppet always falls in an empty level before the actual level starts. But that might be caused by all the things I commented out.
Even the precompiled binary behaves strangely now. Sometimes it starts with the moppet on the ground, sometimes falling and sometimes standing vertically in the air with the arms up in an empty level.

So I think it's some sort of level preloading issue for the titlescreen. I hope it's not caused by the commented out u32 code snippet, as I have no idea how to fix that at the moment.
User avatar
KIAaze
 
Posts: 85
Joined: 08 Dec 2009, 17:34

Re: Converting Puzzle Moppet assets

Postby qubodup » 08 Jul 2012, 05:03

Could the physics issues be related to having a newer version of ode?
User avatar
qubodup
Global Moderator
 
Posts: 1671
Joined: 08 Nov 2009, 22:52
Location: Berlin, Germany

Re: Converting Puzzle Moppet assets

Postby KIAaze » 08 Jul 2012, 05:06

After removing "~/.Puzzle Moppet" and "~/.Puzzle Moppet Configuration Utility", everything worked without any issues.
In the end, there weren't even any changes necessary apart from removing the u32 lines xDan mentioned.
Here's a patch for the git repo created with:
{l Code}: {l Select All Code}
git format-patch -2 master --stdout > 64bit.patch

Can be applied with:
{l Code}: {l Select All Code}
git am --signoff < 64bit.patch


Since .patch files cannot be attached here: https://bitbucket.org/Knitter/puzzlemop ... ue/1/patch

Could the physics issues be related to having a newer version of ode?

Doesn't seem to be the case. (unless the old binary with a static ODE version wrote some stuff into the files in ~/.Puzzle*)

edit: TODO:
-Save games to $XDG_DATA_HOME if it exists, otherwise to $HOME/.local/share/ (suggested by aanderse) (patch)
-Prevent the config app from always creating an empty useless ".Puzzle Moppet Configuration Utility" folder (or put the .ini file in there).
-start in windowed mode by default
{l Code}: {l Select All Code}
diff --git a/puzzlemoppet/projects/ConfigApp/main.cpp b/puzzlemoppet/projects/ConfigApp/main.cpp
index 459240c..0108981 100644
--- a/puzzlemoppet/projects/ConfigApp/main.cpp
+++ b/puzzlemoppet/projects/ConfigApp/main.cpp
@@ -13,7 +13,7 @@ VariantMap PROJECT_DEFAULT_SETTINGS()
        settings["appName"] = "Puzzle Moppet";
        settings["screenWidth"] = 1024;
        settings["screenHeight"] = 768;
-       settings["fullScreen"] = true;
+       settings["fullScreen"] = false;
        return settings;
 }
 
diff --git a/puzzlemoppet/projects/Puzzle/main.cpp b/puzzlemoppet/projects/Puzzle/main.cpp
index 95edc8c..d559cd5 100644
--- a/puzzlemoppet/projects/Puzzle/main.cpp
+++ b/puzzlemoppet/projects/Puzzle/main.cpp
@@ -104,7 +104,7 @@ int main(int argc, const char **argv)
        settings["appName"] = "Puzzle Moppet";
        settings["screenWidth"] = 1024;
        settings["screenHeight"] = 768;
-       settings["fullScreen"] = true;
+       settings["fullScreen"] = false;
       
        IEngine *engine = CreateEngine(argc, argv, &settings);
       

-compile with irrlicht 1.7 (with official debian/ubuntu repository packages). Compiled with the following changes, but then the ODE error reappeared (+not fixed by removing .ini files):
{l Code}: {l Select All Code}
diff --git a/puzzlemoppet/source/PostProcessingChain.cpp b/puzzlemoppet/source/PostProcessingChain.cpp
index 6fc6265..23ee298 100644
--- a/puzzlemoppet/source/PostProcessingChain.cpp
+++ b/puzzlemoppet/source/PostProcessingChain.cpp
@@ -62,12 +62,12 @@ void PostProcessingChain::AddEffect(video::SMaterial &material, IShader *shader,
       
        // Create RTT
        material.TextureLayer[0].Texture = rt;
-       material.TextureLayer[0].TextureWrap = video::ETC_CLAMP_TO_EDGE;
+//     material.TextureLayer[0].TextureWrap = video::ETC_CLAMP_TO_EDGE;
+       
       
-       /*
        material.TextureLayer[0].TextureWrapU = video::ETC_CLAMP_TO_EDGE;
        material.TextureLayer[0].TextureWrapV = video::ETC_CLAMP_TO_EDGE;
-       */
+       
       
        Effect effect =
        {
Last edited by KIAaze on 10 Jul 2012, 02:51, edited 2 times in total.
User avatar
KIAaze
 
Posts: 85
Joined: 08 Dec 2009, 17:34

Re: Converting Puzzle Moppet assets

Postby KIAaze » 08 Jul 2012, 16:22

To fix the ODE mass error, you need to set the correct flags in the cmake configuration:
{l Code}: {l Select All Code}
#if ODE was compiled with single precision (ex: libode-dev + libode1 packages):
CMAKE_CXX_FLAGS = -DdSINGLE
#if ODE was compiled with double precision (ex: libode-sp-dev + libode1sp packages):
CMAKE_CXX_FLAGS = -DdDOUBLE


But after compiling with -DdDOUBLE + double-precision ODE lib, I got a tiny moppet.

TODO:
-create HACKING.txt to help people get into the code with for example:
*debugging tools:
WARN << "FOO";
NOTE << "FOO";
*code layout:
source: Litha Engine
projects/Puzzle: game
projects/ConfigApp" Configuration utility
*Class diagram
Attachments
tinymoppet.png
Last edited by KIAaze on 10 Jul 2012, 02:51, edited 1 time in total.
User avatar
KIAaze
 
Posts: 85
Joined: 08 Dec 2009, 17:34

Re: Converting Puzzle Moppet assets

Postby KIAaze » 08 Jul 2012, 18:34

Not sure about the segmentation faults others mentioned, but for me everything is working fine now:
https://bitbucket.org/Knitter/puzzlemop ... rlicht-161

Thanks xDan for leaving in all the commented code for other library versions. The documentation is also quite good. :)

Other things to do:
-redirect warnings to stderr?
-package building
* build Litha engine separately with dynamic libs and then the game to create separate engine/game packages

P.S.: @Knitter: Could I please get access to the git repo, so I can push up changes directly? ;)
User avatar
KIAaze
 
Posts: 85
Joined: 08 Dec 2009, 17:34

Re: Converting Puzzle Moppet assets

Postby MCMic » 08 Jul 2012, 22:58

You should make the game XDG compliant too.

[EDIT]My bad, it's already done it seems
Last edited by MCMic on 08 Jul 2012, 23:10, edited 1 time in total.
User avatar
MCMic
 
Posts: 723
Joined: 05 Jan 2010, 17:40

Re: Converting Puzzle Moppet assets

Postby MCMic » 08 Jul 2012, 23:01

qubodup {l Wrote}:Thanks for posting the error message. It looks like https://bitbucket.org/alfonse/gltut/iss ... make-gmake might contain the solution.

Yeah that's it, I had to change target_link_libraries to add X11 and it built fine.

[EDIT] And it runs well too :-)
User avatar
MCMic
 
Posts: 723
Joined: 05 Jan 2010, 17:40

Re: Converting Puzzle Moppet assets

Postby MCMic » 08 Jul 2012, 23:03

KIAaze {l Wrote}:To fix the ODE mass error, you need to set the correct flags in the cmake configuration:
{l Code}: {l Select All Code}
#if ODE was compiled with single precision (ex: libode-dev + libode1 packages):
CMAKE_CXX_FLAGS = -DdSINGLE
#if ODE was compiled with double precision (ex: libode-sp-dev + libode1sp packages):
CMAKE_CXX_FLAGS = -DdDOUBLE



You can compute that with :
ode-config --cflags
User avatar
MCMic
 
Posts: 723
Joined: 05 Jan 2010, 17:40

Who is online

Users browsing this forum: No registered users and 1 guest