Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1] 2

Author Topic: Linux versions?  (Read 2254 times)

kynalvarus

  • Bay Watcher
    • View Profile
Linux versions?
« on: July 14, 2008, 01:26:00 am »

Just curious, is there anywhere we can get a Linux build of LCS 3.12? Speaking for myself, I'm a programmer, and I could compile it from source, but I didn't bother since the game runs fine under wineconsole. Still, I did see the 3.11 versions in RPM form on the SourceForge page, and as a Linux user I always like to see open-source projects supporting open-source OSes - it's the Liberal thing to do, don't you know? ;-)
Logged

Mover#005

  • Bay Watcher
    • View Profile
Re: Linux versions?
« Reply #1 on: July 14, 2008, 02:20:17 pm »

How did you get it running in WINE? It allways bugs out for me
Logged

kynalvarus

  • Bay Watcher
    • View Profile
Re: Linux versions?
« Reply #2 on: July 15, 2008, 03:09:12 pm »

You have to use wineconsole, not wine.

Code: [Select]
wineconsole crimesquad.exe
Logged

Shades

  • Bay Watcher
    • View Profile
Re: Linux versions?
« Reply #3 on: July 17, 2008, 05:16:25 am »

Ahh thats what I'm doing wrong. Excellent I can play the new version now :)

Edit: The colours seem inversed in some way, the options I can't use for example are light grey and the ones I can are dark.

Is this something with my setup for wineconsole? or something thats common with it? any help would be nice :)
« Last Edit: July 17, 2008, 05:51:24 am by Shades »
Logged
Its like playing god with sentient legos. - They Got Leader
[Dwarf Fortress] plays like a dizzyingly complex hybrid of Dungeon Keeper and The Sims, if all your little people were manic-depressive alcoholics. - tv tropes
You don't use science to show that you're right, you use science to become right. - xkcd

kynalvarus

  • Bay Watcher
    • View Profile
Re: Linux versions?
« Reply #4 on: July 17, 2008, 05:52:39 am »

I have the same issue - so far I've just been living with it. I'll post again if I find a fix or workaround.
Logged

Liberal Elitist

  • Bay Watcher
  • I'm more liberal than you are!
    • View Profile
    • The Liberal Crime Squad wiki
Re: Linux versions?
« Reply #5 on: July 17, 2008, 09:09:13 am »

The current source code is here for the 3.11.4 branch, which 3.12.2 seems to be based off of.  However, that source code has been updated since the 3.12.2 beta release.  The 3.12.2 beta release seems to be based off of revision 208 of the 3.11.4 branch, since it was released on the same day and the file size of the executable matches.  Unfortunately, revision 208 does not seem to compile under Linux, and the closest revision before that which compiles under Linux is revision 201.  The compiler errors should be fixable, though, mostly disagreements between caller and callee over how big ints are.  All of this information I have relayed to you is from someone at wikidot.com who uses Linux and wrote a wonderful table on the Juice page on the LCS wiki using information from the source code for revision 208.  (I do not use Linux, I use Windows, and I don't fully understand this information I am relaying.)  I hope this information I have relayed to you is useful.  ;)
Logged
The Liberal Crime Squad wiki is your friend.

Quote from: Lielac
Edit: Figured it out via a little bit of trial and error and oH MY GOD WHAT IS THIS MUSIC WHAT IS THIS MUSIC WHAT THE HECK IS IT SPACEBALLS MUSIC? WHATEVER IT IS IT IS MAGICAL

Dryn

  • Bay Watcher
    • View Profile
Re: Linux versions?
« Reply #6 on: July 20, 2008, 06:02:08 am »

The latest revision that I can compile is version 202, though with screeds of error messages.
Logged
You come back from the mansions of sleep with your pockets full of silverware.

Ari Rahikkala

  • Bay Watcher
    • View Profile
Re: Linux versions?
« Reply #7 on: July 24, 2008, 03:41:54 pm »

I'm working on getting 31104branch r216 to compile and run on Linux. http://omploader.org/vbXAx/linux-compile-fixes.patch handles the former, but the game segfaults after the opening questions still... I'm looking into that at the moment. (considering the obvious typos in this revision that would have prevented it from building on any compiler, I'm afraid it was not buildtested, and so obviously not playtested either)

(incidentally, please remind me that the next time I go around looking for answers to obscure linker errors... I check if all the project files even get compiled first)
Logged

Ari Rahikkala

  • Bay Watcher
    • View Profile
Re: Linux versions?
« Reply #8 on: July 24, 2008, 03:55:07 pm »

Ahh, it was crashing on not having a police organisation to set as the owner of the police station. Fixed by copying workspaces/configfile.txt to ~/.lcs/ :). Playtesting now...

* copies sitemaps.txt over too, just to be sure *
Logged

Ari Rahikkala

  • Bay Watcher
    • View Profile
Re: Linux versions?
« Reply #9 on: July 24, 2008, 04:20:45 pm »

I only played for a very little while but did find two things that have gone wonky: You can't clear a liberal's codename by giving an empty name, and saving/loading is broken. I'll have a look at them tomorrow... but won't be offended if someone beats me to the punch :p
Logged

Jonathan S. Fox

  • Bay Watcher
    • View Profile
    • http://www.jonathansfox.com/
Re: Linux versions?
« Reply #10 on: July 24, 2008, 09:55:04 pm »

Re: codename clearing: I don't think that works that way in the windows version either, if memory serves.
Logged

odd2k

  • Bay Watcher
    • View Profile
Re: Linux versions?
« Reply #11 on: July 25, 2008, 06:27:28 am »

Ari, you are awesome! I tried fixing it myself, but got really stumped on the linker errors!

With your patch, the game seems to work perfectly. Saving/loading seems to work fine as well. Can you not save at all, or is there some action that triggers the save/load failure on your end?

I'm just guessing here, but could it have something to do with data type sizes of your environment? I see the typedefs (uint32, int16 and so on) are only half-way implemented in the code. My system uses long 32, int 32, short 16, char 8.
Logged

Ari Rahikkala

  • Bay Watcher
    • View Profile
Re: Linux versions?
« Reply #12 on: July 25, 2008, 02:48:10 pm »

Ah, I figured the save/load bit out. The symptom, in case you're interested, was that saving would seem to work normally, but when I tried to load the game it'd put in random funky values for the various items in the title screen, and crash (usually from trying to allocate a huge string) when I tried to start the game.

The cause? The game currently both saves and loads in two phases. Organisations are handled with Puzzlemaker's niftyish new serialization code (which opens files using the standard fstream interface), whereas everything else is handled by a more direct means of serialization (which opens files using the LCS_IO interface). Yes, that does mean that files get opened and closed twice during saving and loading - in saving, the latter code just opens the file in append mode, whereas in the former mode, it gets passed an offset where to start reading the file from.

Now, the LCS_IO code makes sure to open these files in your LCS home directory (~/.lcs/ by default on Unix), whereas Puzzlemaker's code opens files in your cwd. So, if, you're running the game from, say, ~, it saves the organisation data to ~/save.dat and the rest of the data to ~/.lcs/save.dat. The loading code would work just fine - if it started reading from the beginning of the file. Instead, it starts reading starting from the offset where the organization data would have ended, and so ends up reinterpreting everything in a meaningless way.

I don't know how to make svn diff easily give a diff against changes I already made earlier, so here's a diff with both the compilation fixes and some rather silly code for making both saving/loading phases work on the same file.
Logged

odd2k

  • Bay Watcher
    • View Profile
Re: Linux versions?
« Reply #13 on: July 26, 2008, 07:01:10 am »

Alright, I'm just cleaning some of the code up, and currently trying to resolve the linux text color issue.

On windows, setting color to BLACK,BLACK somehow makes it dark gray. This is used to gray inaccessible stuff out. On linux, however, this makes the text invisible like it should. I see that curses uses a single bit for red, green and blue respectively. So basically, there's no way to explicitly set the color to gray? Or is there some workaround, or different curses method to call to support more colors? If there's no such thing, then I guess the "graying out" code should be removed altogether, although that would also suck.
Logged

Blacken

  • Bay Watcher
  • Orange Polar Bear
    • View Profile
Re: Linux versions?
« Reply #14 on: July 26, 2008, 09:39:20 am »

Dark gray is "bright black". I don't know the curses codes for it, but setting the ANSI bold/high-intensity bit and setting the forecolor to "black" should work. If it doesn't, your terminal is misconfigured.
Logged
"There's vermin fish, which fisherdwarves catch, and animal fish, which catch fisherdwarves." - Flame11235
Pages: [1] 2