Pink Petal Games

Game Discussion => General Discussion & Download => Topic started by: DocClox on November 20, 2009, 05:50:34 PM

Title: Linux Users!
Post by: DocClox on November 20, 2009, 05:50:34 PM
I know we had at least one query about this on the old board:

We're pretty close to being able to offer a native Linux version of WM. I've got one running locally on my Debian desktop box. My main concern is how to distribute it, given the fact that different distros are going to have different SDL libraries installed (or not installed).

So, question is this: who's interested, and what are you running? If I know what you've got, I'll try and sort out compatible builds for you.
Title: Re: Linux Users!
Post by: Nuller on November 25, 2009, 10:46:52 PM
I've been running WM via wine (which seems to run it fairly well, its a little difficult to tell if the crashes are WM or wine related) on ArchLinux. I would actually be fine with a source tarball and a list of dependencies.
Title: Re: Linux Users!
Post by: DocClox on November 26, 2009, 04:26:44 AM
That's the way I'd prefer to distribute it as well. Only trouble is that the source isn't mine to distribute.
Title: Re: Linux Users!
Post by: Nuller on November 26, 2009, 05:21:42 AM
In that case a precompiled binary will have to do. Are there any dependencies other than SDL to worry about?
Currently my libSDL.so points to libSDL-1.2.so.0.11.3 btw - in case it matters, and either 64-bit or 32-bit intel binaries would work for me.
Title: Re: Linux Users!
Post by: DocClox on November 26, 2009, 06:32:09 AM
OK, try this (http://www.mediafire.com/?m1o2lxcikin#). It's the last trunk commit I that I can vouch for as being reasonably stable. The main issue is that the "send to dungeon" button is borked. The button works, it just displays as a greyed out "release".

There's a fix in the tree, but this will do for a test case.

Title: Re: Linux Users!
Post by: Nuller on November 26, 2009, 03:34:30 PM
Seems to work mostly fine. From a quick (<5 minute) test I found it occasionally still crashes, there are no brothel icons on the town map and the buy and sell buttons in the shop aren't displaying. I'll do a more thorough check later today when I get back.
Oh, and this displays on the command line every time I choose the talk to option in the dungeon:
loading font: segoeui.ttf
probably not important at the moment but seems like unnecessary redundancy.
Title: Re: Linux Users!
Post by: delta224 on November 26, 2009, 04:07:22 PM
The brothel icons on the town screen are due to the nae being off.  Change the name of the image file to brothelon.png and brotheloff.png, caps might be off though.  The buy sell issue is a coding issue, crashing, eh this thing is still very buggy, and the loading font thing is a little redundant, but is there for debugging purposes.
Title: Re: Linux Users!
Post by: DocClox on November 26, 2009, 04:31:31 PM
plus, it's something of a development snapshot. I'll make sure there's Linux binary in the next release though, and we can see how that goes.
Title: Re: Linux Users!
Post by: Nuller on November 26, 2009, 10:52:14 PM
I mostly mentioned those issues because they don't appear under wine and thus figured they might be a linux specific issues.
Title: Re: Linux Users!
Post by: Solo761 on November 27, 2009, 09:17:23 AM
I suppose that would be because windows version currently available to public is 1.29.2, and linux one is from current trunk (or whatever subversion DocClox managed to compile :) ).
Title: Re: Linux Users!
Post by: DocClox on November 27, 2009, 11:02:22 AM
Yeah, it's my development branch which isn't particularly stable at the best of times.

I just wanted to see if Nuller could run my binaries without problems, really.  Now that I know he can, I'll co-ordinate a Linux build with the main release
Title: Re: Linux Users!
Post by: DocClox on November 30, 2009, 07:26:32 PM
OK: here's a linux binary pre-release v1.29.4 (http://www.mediafire.com/?xidymkjznyj#). This should be comparable with the windows app, but without the XML issues.

You'll need the 1.29.3 windows upgrade, or at least the files inside of it. Well, you probably have them all already, but you know what I mean...
Title: Re: Linux Users!
Post by: Nuller on December 10, 2009, 09:34:44 PM
Any chance of an updated executable to match the changes to the windows version?
Title: Re: Linux Users!
Post by: DocClox on December 11, 2009, 12:20:22 AM
Not unless solo fancies committing his current maintainence code to svn. We had a branch for the 1.29.3.* code, but like a complete twit, I checked in a half finished change, and it's been taking a while to get it stable again.

Failing that, I should be done with this early next week (the weekend stands to be busy) and we'll sync things up then.
Title: Re: Linux Users!
Post by: Nuller on December 11, 2009, 12:23:36 AM
Cool, was just wondering whether maybe you had forgotten/discontinued linux support.
Title: Re: Linux Users!
Post by: DocClox on December 11, 2009, 12:27:43 AM
No, just bogged down in a big gold handling rewrite. Linux is my primary OS and development environment, so as long as I'm coding, there's going to be linux support :)
Title: Re: Linux Users!
Post by: DocClox on December 15, 2009, 04:24:41 AM
New Linux binary.  Needs the 1.29.4.0 windows upgrade.

Gold is buggy as hell. Working on that, but you may want to stay with the previous version for now :)

[edit]
This version has a fix for the gold problem.  Probably still a lot of gold bugs, but at least it's possible to turn a profit :)

http://www.mediafire.com/?j3zdmmwyntm#
Title: Re: Linux Users!
Post by: Nuller on December 15, 2009, 07:50:16 AM
ScreenMode.txt isn't being read.
ran with strace, looks like a missed windows->linux directory conversion:
open(".\\ScreenMode.txt", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
renaming it to .\ScreenMode.txt works of course, so not a big deal.
Title: Re: Linux Users!
Post by: DocClox on December 15, 2009, 08:41:06 AM
Thanks for the report. Here's a fixed version:

http://www.mediafire.com/?42gzty2mntm#

Do you get an oversized "Weapon Level" button on staff management when you whack up the screen size?
Title: Re: Linux Users!
Post by: Nuller on December 15, 2009, 09:14:19 AM
Sure do, as well as anything that's not a 4:3 resolution cutting off all the buttons.
Just noticed something else, not sure how pertinent it is, could just be a display issue, but the console report for the end of week income has the exact same value for both cash outs:
Code: [Select]

Week End begins: value    = -30821
               : income   = 1140
               : upkeep   = 946
               : cash in  = 0
               : cash out = -1301 <----
Added Bothel 0: value    = -30821     |
               : income   = 24909     |
               : upkeep   = 31726     |
               : cash in  = 0         |
               : cash out = -1301 <-- these two are always the same
Week End Final : value    = -37638
               : income   = 0
               : upkeep   = 0
               : cash in  = 0
               : cash out = 0
Title: Re: Linux Users!
Post by: DocClox on December 15, 2009, 09:24:40 AM
I've got a fix for the big "+" button. Scaling the buttons properly for widescreen aspect ratios will need a little more thought. I should also  see about scaling up the fontsize in step with the screen size

[edit]

It's like waiting for a bus, I expect. Nothing for ages, then three come at once. 1.29.4.2:

http://www.mediafire.com/?iwd1nmqnyqj#
Title: Re: Linux Users!
Post by: DocClox on December 16, 2009, 12:12:58 PM
1.29.4.3

http://www.mediafire.com/?mjyjwxyynzt# (http://www.mediafire.com/?mjyjwxyynzt#)
And for once it's completely in step with the windows version :)

[edit]

1.29.4.4: http://www.mediafire.com/?tj0auinemfm# (http://www.mediafire.com/?tj0auinemfm#)
1.29.4.5: http://www.mediafire.com/?ywgwbnywyzg# (http://www.mediafire.com/?ywgwbnywyzg#)
1.29.4.6: http://www.mediafire.com/?zmzuzixnzmo# (http://www.mediafire.com/?zmzuzixnzmo#)
Title: Re: Linux Users!
Post by: DocClox on May 15, 2010, 04:33:31 AM
Arise, My Undead Servant!

In case anyone's interested, I've just committed a handful of minor fixes to get the native Linux version working again. Revision 379 is running here on my laptop.  Now that the source is available, I expect most people will prefer to build the game for themselves, but if anyone has problems, I can always upload a binary
Title: Re: Linux Users!
Post by: slate on May 15, 2010, 07:41:26 AM
http://pinkpetal.org:9053/whm_trac/ticket/63
Title: Re: Linux Users!
Post by: DocClox on May 15, 2010, 08:08:44 AM
fixed in 382
Title: Re: Linux Users!
Post by: slate on May 16, 2010, 02:36:26 AM
I still cannot build and install the game from svn with neither r382 nor r385.
on r385 make says:
main.cpp:8:22: error: Revision.h: No such file or directory
make: *** [makefile.deps] Error 1


What is the build process?

The svn does not seem to contain all the data files needed. If I can use the resources from 1.30 than it is ok.
Title: Re: Linux Users!
Post by: slate on May 16, 2010, 02:52:19 AM
Also r384 introduced an undefined function: cJobManager.cpp:644: error: ‘random_shuffle’ was not declared in this scope
Apparently the developers do not make a clean build on every commit.

Title: Re: Linux Users!
Post by: Dagoth on May 16, 2010, 03:02:15 AM
random_shuffle() is part of the STD library, and it's working fine on Windows; as far as I know it should work the same on Linux, but I don't have a Linux build environment to test it in.

Revision.h should be generated automatically to contain the SVN revision, though I don't know if Doc has added that to the Linux build yet or not.
If you just want to add the file in for now, just create it and plop this into it:
Code: [Select]
static char svn_revision[] = "385";
Title: Re: Linux Users!
Post by: slate on May 16, 2010, 03:07:40 AM
succesfully built 382 on linux.
I have made the following hacks:
copy 1.30 (r342 release) to ~/wm

cp Revision.wcrev Revision.h
Edited Revision.h:
put in r382
inserted pragma once in the first line, because make complained about circular include
edited install section in the makefile:
install: WhoreMaster
        cp WhoreMaster ~/wm
        cp -r Resources/* ~/wm/Resources/
Title: Re: Linux Users!
Post by: DocClox on May 16, 2010, 03:25:02 AM
The mk_rev script ought to create a new version of Revision.h whenever any of the cpp files are out of date. I'm not sure it works very well. The circular dependency problem suggests that it isn't working that well...

Of course, it would work MUCH better if I remembered to add it to svn...

This is the binary I'm currently playing, if anyone's still having problems

http://www.mediafire.com/?3mnjwnmyxtr (http://www.mediafire.com/?3mnjwnmyxtr)

I get the random_shuffle thing, too, btw. Turns out cJobManager.cpp needed #inlcude <algorithm> at the top. Presumably one of the MS headers includes it somewhere deep in the include tree, where the GCC headers don't.

Fixed and committed: svn 38v, which just built locally.
Title: Re: Linux Users!
Post by: necno on May 16, 2010, 06:10:22 PM
Your free to distribute the source from my end.
Title: Re: Linux Users!
Post by: slate on June 07, 2010, 04:48:39 PM
on r424 lua.h and other lua includes are not found in the gcc flags.
fixed this by adding: -I /usr/include/lua5.1
Title: Re: Linux Users!
Post by: DocClox on June 07, 2010, 05:16:36 PM
Thank you - should be fixed in svn. I didn't commit last night's changes for some reason
Title: Re: Linux Users!
Post by: slate on June 16, 2010, 01:53:16 PM
Linux version is crashing on r445
the log:
rm -rf trunk
svn co svn://pinkpetal.org:3693/whm_svn/trunk
cd trunk/BrothelMaster/
make (does not find lua)
vim Makefile (set gcc flag -I lua/src)
make (some other lua thing)
cd lua
make linux
cd ..
make (some revision thing)
./mk_rev
make (success)
make install (*.png not found)
vim Makefile (comment out *.png copy)
make install
cd
cd wm
./WhoreMaster
segfault

The last lines on the console before segfault:
registering ID 0 to name 'UseAntiPregToggle'
registering ID 1 to name 'PrevButton'
registering ID 2 to name 'NextButton'
registering ID 3 to name 'AccomUpButton'
registering ID 4 to name 'AccomDownButton'
registering ID 5 to name 'InventoryButton'
registering ID 6 to name 'SendDungeonButton'
registering ID 7 to name 'ReleaseDungeonButton'
registering ID 8 to name 'InteractButton'
registering ID 9 to name 'TakeGoldButton'
Segmentation fault (in native language)

Title: Re: Linux Users!
Post by: DocClox on June 16, 2010, 03:12:24 PM
ummm... ok. I've been using the lua libs installed on my box rather than compile the code in directly. But since that's how the windows side is handling the dependency, I guess the best thing is for the linux side to do likewise.

I'll sort it out. Meanwhile, you might try installing the lua 5.1 runtime and seeing if that's sufficient to get it running :)

[edit]

OK, I've added the lua files into the makefile and given it a quick test run here. Let me know if there's any further problems.
Title: Re: Linux Users!
Post by: slate on June 16, 2010, 03:35:54 PM
I do not think that the segfault is related to lua.
I removed the complete lua subdirectory and included the os' lua5.1 files.
The result is the same.
Maybe some datafiles causing the crash.
Where can I download the resources? How can I make a clean full install?
Title: Re: Linux Users!
Post by: slate on June 16, 2010, 03:45:47 PM
I have unzipped the 1.30 into a new directory and copyed the compiled binary there.
It is working.
Maybe some downloaded additional character is causing the bug.

However crashing is not nice:)
Title: Re: Linux Users!
Post by: DocClox on June 16, 2010, 03:47:32 PM
Maybe some datafiles causing the crash.
Where can I download the resources? How can I make a clean full install?

Just unpack the windows download, and then copy in the Linux WhoreMaster executable. That's all I do anyway :)

Can you run it under gdb and get a stack trace by any chance?

[edit]

I'm too slow - you beat me to it :)

Glad you got it working!

Maybe some downloaded additional character is causing the bug.

However crashing is not nice:)

Agreed. And I try to make the game fail gracefully whenever possible.

Looking at the log file, i suspect the problem was a missing XML screen file. I'll have to take a look at how  that handles missing files
Title: Re: Linux Users!
Post by: slate on June 16, 2010, 03:55:10 PM
The following line in the Makefile causing the binary to crash:
cp Resources/Interface/* ~/wm/Resources/Interface

If I do not execute this, the binary is working, however set house% is not.
Title: Re: Linux Users!
Post by: DocClox on June 16, 2010, 06:37:44 PM
Humm... probably because I'm assuming your game is installed into ~/wm - which is a bit daft, since even mine isn't there at the moment. One of these days I'm going to have get my head around automake and set this all up properly.

Meanwhile, consider the make install option as broken and just build and copy the library. It's not like there's a full resource tree in svn anyway, so you're still tied to the windows d/l for resources. the makefile just builds a linux binary at the moment.

I suppose a comment to that effect in the makefilewould probably be helpful.
Title: Re: Linux Users!
Post by: slate on August 28, 2010, 06:30:38 PM
checked out revision: 527
cListDragBar.h  and cpp is missing, downloaded from the myrikhan  branch
build is succesfull.
The binary fails with segfaults after:
CLogInner::init
Loading configration variables from './Resources/Data/config.xml'
calling init
Initializing Graphics
Reading Screen Mode
Initializing SDL
Setting Window Icon
Determining Fullscreen or Windowed Mode
Setting Window Caption
Initializing TTF
Graphics Initialized
Background Image Set
Loading InterfaceColors
Loading Main Menu Screen
Loading MainMenu
Loading Load Game Screen
Adding listbox...
initializing listbox
creating listbox
enabling events
getting scrollbar ID
adding scrollbar
initializing scrollbar
creating scrollbar
segmentation fault
Title: Re: Linux Users!
Post by: DocClox on August 29, 2010, 02:04:42 AM
Yeah, sorry about that. I've spent most of this month in hospital, so the linux build has been a little neglected.

I'll take a look at it later today if I feel up to it.
Title: Re: Linux Users!
Post by: slate on August 29, 2010, 07:23:17 AM
Get well!
Title: Re: Linux Users!
Post by: slate on October 12, 2010, 01:10:09 PM
checked out r 534
It did not compile. I attach the logs.
Title: Re: Linux Users!
Post by: DocClox on October 12, 2010, 04:53:10 PM
Hmmm, good point. I put off sorting that out until I could merge in the changes I was working on about four months ago. I suppose it's time I bit the bullet and had a look at it.

I'll go at it tomorrow :)
Title: Re: Linux Users!
Post by: DocClox on December 28, 2010, 05:53:09 PM
Sorry for the delay. Revision 599 should build OK.

There does seem to be a crash on exit. glibc is reporting a double-free so there may be memory problems lurking - I've not given this much more than a cursory test. See how you get on :)
Title: Re: Linux Users!
Post by: slate on December 28, 2010, 09:08:25 PM
Yes it can be compiled and run.

I had to edit the Makefile to add lua include path and manually run mk_rev.

After that I copied the binary into the unzipped distrib and it worked.
Title: Re: Linux Users!
Post by: DocClox on December 29, 2010, 03:47:37 AM
Good enough for me. I'm surprised the makefile fix didn't get into svn though.

Anyway, at least the game is buildable again