Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 5 6 [7] 8 9 ... 57

Author Topic: Terra Vitae Fork (version 2.0 released!)  (Read 338849 times)

Liberal Elitist

  • Bay Watcher
  • I'm more liberal than you are!
    • View Profile
    • The Liberal Crime Squad wiki
Re: Mod Planning: Terra Vitae mod
« Reply #90 on: September 15, 2014, 09:07:38 pm »

Umm, OK... I got the code updated and synchronized with the latest SVN revision, and then put out a new SVN revision of the vanilla game full of fixes and improvements from the Terra Vitae mod, revision 848. Look at its changelog here. The vast majority of the fixes and enhancements in that revision are YOUR contributions to the game, SlatersQuest... 6 bugfixes and 3 enhancements as I counted it. (Although one of the 3 enhancements is making it tougher to win over high-juice Liberals or moderates during dating or recruitment, but since dating and recruitment are separate, you could consider that 4 enhancements instead of 3.)

And I'm about to put out a new SVN revision to fix some more issues that I encountered while play-testing Terra Vitae that'll fix things in both Terra Vitae AND the vanilla game (issues that also exist in the vanilla game). Mainly an issue with the Vice President, and the rest of the issues are all, well, ISSUES, whose text displays on the Status of the Liberal Agenda screen.

Oh and I've fixed a bunch of bugs in your mod and improved some stuff in it. I should have a version of it available for download in a day or two. I think I will use a service called Sendspace to host the download, that service allows free users to post stuff and the files stay online for 30 days and anyone with a link to the files can download them. Then after 30 days, poof! They disappear off that hosting service forever. So if you (SlatersQuest) download it within this 30-day timeframe, then you can use it as your codebase, for your future work on the Terra Vitae mod.

Anyway the only thing holding me back from just uploading it already is I haven't found and fixed that bug involving superheroes yet. I fixed some other stuff including a bug with newspapers among other things.

Oh yeah and could you set the program you edit files with to indent by 3 spaces instead of 4? That's what we use for this project. Your indentation was one of the major hurdles to synchronizing with the latest SVN because I had to go through line by line and fix it to match the indentation of the vanilla game so that the SVN diff and merge tools could match up lines and diff and merge things correctly so that I'd have an easier time updating it. But I did manage to get it synchronized, right now it's synchronized with the latest revision 848, and in fact the code I've written for the next revision I've put in both the vanilla game and your mod but haven't uploaded either of them yet... when I try to synchronize them (that'll probably have a revision number of 849 once it's out unless someone else claims that first), those lines where I changed the same thing in both the vanilla game and the mod will show up as conflicts in SVN, but I've had plenty of practice resolving those, it'll be easy.

But at least I got 2 main things accomplished already: 1) Synchronized the Terra Vitae mod with the latest SVN code. 2) Added all relevant bugfixes and enhancements from Terra Vitae that belong in the vanilla game back to the vanilla game.

Now all that's left is to clean up a few bugs here and there like this superhero one you keep going on about. I have managed to duplicate it using "Cheat Test Super". Oh, and I've also done quite a good job integrating Terra Vitae with the Stalinist code. (Naturally the Stalinists dislike Terra Vitae and vice versa.) But I haven't found the cause of the bug or fixed it yet. I actually DO understand C++ object-oriented code quite well, maybe if you told me which code was causing the problem I could fix it. I don't think going back to old-fashioned C-style code is the solution, C-style code is less safe than C++-style code and more likely to cause segfaults, not less. Anyway I wanted to get all this stuff done first before I started working on this particular bug, I like to do things in a certain order.

Anyway I might just share you the code I have now even though that superhero bug isn't fixed yet, just so you can use it and apply all your changes since version 0.11 to it. Oh and the reason I like Sendspace is there are several different download sites used by EmuCR, a site that compiles SVN and Git versions of video console emulators that have all the latest fixes and such and makes them available for download, and it is the best-working one, it works with download managers, it doesn't bother you too much with ads or having to wait before downloading, and generally it gives a better experience than the other free download sites that EmuCR uses... and I use EmuCR to get my emulators (specifically VisualBoyAdvance-M and FCEUX) with the latest versions. My download would disappear after 30 days but EmuCR's downloads stay there forever... probably because they have a paid account instead of a free account. So basically, I've downloaded plenty of files from Sendspace and I like how easy that is so that's why I'm picking it, so it's easy for other people to download. I just hope I don't go over their filesize limits, then I might need to find a different service.
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

SlatersQuest

  • Bay Watcher
    • View Profile
Re: Mod Planning: Terra Vitae mod
« Reply #91 on: September 16, 2014, 06:44:55 am »

I've got some RL things to do this morning but will hopefully be able to get to this later this evening, such as find all of the places where the segfault is happening.

I will see what I can about the indentations. I use X-code by default, and have the default settings for indents. And I agree: TV would not like the SCS and vice-versa! :)
Logged

SlatersQuest

  • Bay Watcher
    • View Profile
Re: Mod Planning: Terra Vitae mod
« Reply #92 on: September 16, 2014, 11:23:02 pm »

I believe I have found the bug. It has something to do with the reading of the XML file into crimesquad. Here's what I did:


In getweapontype(), I used fprintf() statements to find out that the weapon id % for WEAPON_MAGIC in the array is 36. This occurs right before the segfault in Weapon::get_name().

I also checked to find out if weapon number 36 is ever referenced in the beginning of the game (by printing every time that getweapontype(), returns anything), when the game is loading all of the weapons. It is not.

So, somehow, the weapontype vector is not being populated out to include the new weapons. Where in the code does this happen?
« Last Edit: September 16, 2014, 11:26:10 pm by SlatersQuest »
Logged

Liberal Elitist

  • Bay Watcher
  • I'm more liberal than you are!
    • View Profile
    • The Liberal Crime Squad wiki
Re: Mod Planning: Terra Vitae mod
« Reply #93 on: September 17, 2014, 10:33:00 am »

Eh, I am not sure, but I have gotten my merge of the latest SVN release of Liberal Crime Squad (SVN revision 852) merged with the Terra Vitae mod version 0.11, with additional bugfixes and enhancements, completed and ready for you to download and use as your codebase. It also has Windows binaries. It is hosted by SendSpace, and I am using a Free account to host it there. That means download speeds are limited to 80 kilobytes per second (it'll take maybe 5 minutes to download), and the download will be removed from SendSpace in 30 days (since I posted it on September 18, 2014, it will be removed on October 18, 2014).

Here is the download link: https://www.sendspace.com/file/0we666

Download it! Download it! Download it! In 30 days it will be gone from teh Internets! It is only there temporarily!

Please, SlatersQuest, use this source code as the basis for your mod now, and apply any changes you've made since version 0.11 to it. Other people can download and try it out too (it has complete source code and Windows binaries). Also use the makefiles, art files, workspace files, in fact all of the files here, since they are set up so that it can be compiled and built using a makefile or in MS Visual C++ or in Code::Blocks using MinGW-GCC.

I'd also mention that the PDCurses.dll file is now in the root directory rather than the workspaces directory, the .dll files used by the game need to all be there. So you can simply copy and paste this over your existing code but if you do that you'll have 2 PDCurses.dll files, you can delete the one in the workspaces directory and keep the one in the root directory, that's what you should do.

Anyway I hope you use this and have fun with it, and figure out how to fix that segfault bug, I didn't manage to find or fix it, but I did fix plenty of other bugs and add some new features, including being able to Stalinize public opinion or laws using the cheat codes among other things! Later! ;D
« Last Edit: September 18, 2014, 05:30:18 pm by Liberal Elitist »
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

Liberal Elitist

  • Bay Watcher
  • I'm more liberal than you are!
    • View Profile
    • The Liberal Crime Squad wiki
Re: Mod Planning: Terra Vitae mod
« Reply #94 on: September 17, 2014, 12:31:16 pm »

Now about that segfault bug:

The weapontype vector is populated by the following line in game.cpp:
Code: [Select]
xml_loaded_ok&=populate_from_xml(weapontype,"weapons.xml",xmllog);
This populate_from_xml() function is declared and implemented in game.cpp. It is a template function (a fancy C++ thingie). So when it's called on weapontype, it is called on the type "vector<WeaponType *>". The key line from it is this:
Code: [Select]
while(xml.FindElem()) types.push_back(new Type(xml.GetSubDoc()));
In the case of WeaponType, it calls the WeaponType constructior on the XML data, and then pushes it back to the weapontype vector (adding a new element to the end of the vector, and the vector can be addressed similarly to an array).

So then the thing to look at next would be the WeaponType constructor for XML data. It is the very first function in /items/weapontype.cpp.

Most likely there is some error in your XML code in /art/weapons.xml that this WeaponType constructor cannot interpret properly.

The XML parsing itself is done by the CMarkup class although it is quite a well-written class used by many different projects and we do not ever modify the code for it, we just use the latest version of it. We don't modify the code for PDCurses or ncurses or SDL2 or SDL2_mixer either.

Oh, and for every attack listed for a weapon, the WeaponType constructor calls the attackst constructor and adds it as an attack with a given priority and such. So the attackst constructor, also in /items/weapontype.cpp, also needs to be looked at.

Also of course game.cpp, weapon.cpp, weapon.h, item.cpp, item.h, itemtype.cpp, itemtype.h, creature.cpp, and creature.h (as well as other .cpp and .h files in the /creature directory) need to be looked at too, along with weapontype.cpp and weapontype.h, I think.

And also the skill_string_to_enum() function in /common/stringconversion.cpp too, which handles the skill strings in the XML.

Anyway I can't see what the problem is yet. Just by eyeballing the code, both your XML code and the code that parses and deals with it, I don't see anything wrong.

Now I did notice some of your description strings in the XML are rather long, longer than for other weapons. This SHOULDN'T be a problem, since the relevant classes such as WeaponType use std::strings which can handle any length string.

HOWEVER, there are fixed-length C-strings in the game. I am starting to suspect the cause of this segfault bug is, one of your weapon description strings for what happens when you use it or something like that is too long for a fixed-length C-string used somewhere else in the game where weapons are used. Since segfaults occur during character creation of a new character with superpowers, we'll need to examine creature.cpp and creature.h and other .cpp and .h files in the /creature directory to see if they use C-strings for this type of stuff.

Also I can't use the GDB GNU debugger to find the source of this bug. Why? Because GDB, for some reason, changes the number of rows PDCurses can use from 25 to 24 leaving the 25th row of the screen empty and stuff that should go there goes on the 24th row instead and this causes problems when I try debugging in Code::Blocks on Windows using GDB (the debugger to use with stuff compiled with GCC). Among other things, entering a name for a character doesn't work at all when debugging using GDB... not just in Terra Vitae but the vanilla game too... because PDCurses behaves differently when it is run inside a debugger. This is a real pain in the arse and prevents me from being able to use a debugger. And I can't find anything wrong with the code when I eyeball it, looking for the cause of the segfault.

Looks like you're having better luck getting to the cause of the segfault anyway. I bet your debugger doesn't have that problem, since on UNIX-based systems you use ncurses, not PDCurses, and ncurses probably doesn't have this odd behavior like PDCurses does (24 rows on the screen instead of 25, and entering a name being broken), when run inside a debugger. Maybe PDCurses when it is being run in a debugger reserves the bottom line of the screen for debugging messages, so if I temporarily changed the number of lines on the screen from 25 to 26 just when I am debugging, this
could maybe fix the 25th line not working when run inside a debugger. I am not sure if PDCurses also does this in MS Visual C++'s debugger. Probably a 50/50 chance of that.

Anyway, make sure you are using the SVN revision 852 merge with Terra Vitae 0.11 that I uploaded in the previous comment as your codebase please. It doesn't have this bug fixed since I have no idea the cause of this bug. But it has plenty of other stuff fixed and improved.

Here is the download link again: https://www.sendspace.com/file/0we666. That link will expire in 30 days on October 18, 2014, you have 30 days to download it and then that file will disappear from that site. Please be sure and get it and use it as the basis for all your future coding on this mod, I put a lot of work into it.
« Last Edit: September 18, 2014, 05:29:19 pm by Liberal Elitist »
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

SlatersQuest

  • Bay Watcher
    • View Profile
Re: Mod Planning: Terra Vitae mod
« Reply #95 on: September 17, 2014, 06:50:58 pm »

Version 0.12 is released, courtesy of Liberal Elitist! (updated link on the opening post)

It's the version that Liberal Elitist has been so diligently working on (thank you very much!). I'm going to try to get the new weapon segfault fixed as soon as possible so that I can release version 0.2, but if I can't get that done in a few days, I'll upload version 0.13 which will have the "what if your recruit is married?" that is written but needs to be added to the new code.

Now that it's up on DFFD, we shouldn't have to worry about sendspace.com's 30-day limit. :)


*

I notice that you changed the order of the weapons in the xml file, so I'm guessing that the id numbers in the array will be different.

Unfortunately, I do not have a debugger. I can't install ddd on my new machine for some reason that I cannot understand. All of the debugging that I've been doing so far has been through the use of fprintf statements to stderr. But I will try to find out what the new id numbers are of the different weapons and see if they get loaded correctly. I'll also fiddle with the lengths of the strings and see if that could be a simple solution.


Edit: It occurs to me - Magic, Powers, and Blasters are the only ranged weapons in the game that do not use ammo. Could this be causing it somehow?

Edit to edit: Crap! I can't compile your code! I type 'make' and get the following error message: No targets specified and no makefile found.  Stop.

Edit to edit to edit: I notice your download has no makefile. Would the 0.11 makefile work if copied over?
« Last Edit: September 17, 2014, 07:26:33 pm by SlatersQuest »
Logged

Liberal Elitist

  • Bay Watcher
  • I'm more liberal than you are!
    • View Profile
    • The Liberal Crime Squad wiki
Re: Mod Planning: Terra Vitae mod
« Reply #96 on: September 18, 2014, 12:09:04 am »

Version 0.12 is released, courtesy of Liberal Elitist! (updated link on the opening post)

It's the version that Liberal Elitist has been so diligently working on (thank you very much!). I'm going to try to get the new weapon segfault fixed as soon as possible so that I can release version 0.2, but if I can't get that done in a few days, I'll upload version 0.13 which will have the "what if your recruit is married?" that is written but needs to be added to the new code.

Now that it's up on DFFD, we shouldn't have to worry about sendspace.com's 30-day limit. :)


*

I notice that you changed the order of the weapons in the xml file, so I'm guessing that the id numbers in the array will be different.

Unfortunately, I do not have a debugger. I can't install ddd on my new machine for some reason that I cannot understand. All of the debugging that I've been doing so far has been through the use of fprintf statements to stderr. But I will try to find out what the new id numbers are of the different weapons and see if they get loaded correctly. I'll also fiddle with the lengths of the strings and see if that could be a simple solution.


Edit: It occurs to me - Magic, Powers, and Blasters are the only ranged weapons in the game that do not use ammo. Could this be causing it somehow?

Edit to edit: Crap! I can't compile your code! I type 'make' and get the following error message: No targets specified and no makefile found.  Stop.

Edit to edit to edit: I notice your download has no makefile. Would the 0.11 makefile work if copied over?

Cool... OK, first of all.. the Makefile. The old makefile that you made you generated using the configure.ac script (.ac short for Autoconf). Now that the project has additional dependencies (SDL2 and SDL2_mixer), and the configure.ac script has changed, and both Makefile.am files have changed to include more files (.am short for Automake), you need to re-run the "configure" command prior to running the "make" command, as explained in the INSTALL file and the README_LINUX.txt file. Re-using the old Makefile from before I merged with the recent SVN releases will not work. It has the necessary files for Autoconf and Automake. In fact the files I included are the EXACT SAME FILES that are in the SVN repository on SourceForge with the addition of ONE NEW FILE, /src/title/additionalchars.cpp. People on Linux-based systems have been compiling recent SVN released perfectly fine using this system, I think it will work fine for you too on Mac OS X. So yes you will need to re-run the configure.ac script with the "configure" command before you have a makefile generated with appropriate parameters for your system. If you want music to work on Mac OS X you should install the SDL2 and SDL2_mixer libraries, the configure.ac script automatically detects whether or not you have these. If it has the required dependencies of SDL2 and SDL2_mixer, it links against them when compiling and produces a binary that has music support. If the required dependencies for music are missing, the configure.ac script disables those dependencies and disables the music subsystem of Liberal Crime Squad, and you will get a binary that works perfectly except it won't play back any music. The script will give you warning messages about this if this happens, but still compile correctly, they will be warning messages not error messages and you should still be able to compile. I actually had to study a bit about Autoconf scripts to get that all working.

Secondly, the weapons, armors, skills, and other things like that were alphabetized so that if you look at your skill list in the game the skills are in alphabetical order or if you look at items you have in your equipment, items of the same type are in alphabetical order (although they are grouped... for instance ranged weapons are grouped before melee weapons, and I grouped your 3 new weapon types along with WEAPON_NONE in a group at the beginning for weapons that you can use while unarmed but they are all alphabetized by their shortname). As for my re-ordering of the lawflags (i.e. crimes you can commit), the existing crimes are sorted from most heinous crime (Treason) to most inoffensive and petty, harmless crime (Loitering). I used the ordering of the crimes that you had for siege mode to determine where the crimes you added would fit in... and you left out Sexual Treason from that list of crimes in siege mode, but looking at the code I found out it's the most serious crime of all, even worse than treason, guaranteed to get you a death penalty even with a lenient judge, so it's listed first.

Your mention about those being the only ranged weapons that don't use ammo might be the problem, yes. I don't know what the problem is. I have tried to figure it out so far but failed. It is a hard bug for me to figure out. It was easier for me to fix a bunch of other things I found, and do loads of code-merging, than to figure out how to solve this one bug. Now I know someone who probably could fix it: Jonathan S. Fox. Unlike me he knows how to use a debugger and his debugger actually works, he uses MS Visual C++ and it apparently has a good debugger that isn't all messed up like the GNU Debugger port to MS Windows that I use in Code::Blocks which seems to have trouble getting along with PDCurses. I had a bug in the past that was also a segfault and I tried really hard to find the cause and couldn't and he was the one who solved it using the MS Visual C++ debugger. Now on Mac OS X you are using Apple's XCode developer tools, the recent versions of which are based on the LLVM/Clang project and other stuff, and I am not sure how good their debugger is but I bet it is probably better than the one I'm using (you were able to pinpoint which line in the code crashed and because I can't even enter in names in review mode to activate the "Cheat Test Super" cheat, I can't test the bug, at least not using that method). There might be other people besides Jonathan who can debug stuff really well but he's a real pro at this stuff. He's just rather busy most of the time but maybe if you ask him if he can find the bug he'd probably be better than me at finding what causes the segfaults.

Plus I am going on vacation on Tuesday and will be away for a month and not on the Internet. I am going to Vienna, Austria and Sicily, Italy. Well I will probably have some time to go online for maybe a little web browsing, but I won't be on any computers that have source code or compilers or such and I won't be doing any programming during that time.

Ah yes and there is a line in includes.h that defines a macro, I think it is called PACKAGE_VERSION. This is supposed to be the version number. I changed it from 4.07.5 beta to 0.11, since 0.11 is the version of Terra Vitae I was basing it on. Anyway that line you can use for the version number.

The Windows binaries (both Release and Debug builds) I compiled work fine if you use the .DLLs for PDCurses and SDL2 and SDL2_mixer plus if you want Ogg Vorbis music instead of MIDI you also need the 3 .DLL files for Ogg Vorbis music... all the necessary .DLL files are in the root directory of the .ZIP file. Basically the packaging instructions for Windows are all in the README file, just follow it if you are on Windows and want to play this version. And on Linux or Mac OS X follow README_LINUX.txt and the INSTALL file.

Anyway I hope this works and you can compile a Mac OS X version successfully. SDL2 and SDL2_mixer, on Mac OS X, integrate with Mac OS X's CoreAudio subsystem and this ought to provide all the necessary music playback capabilities. On Windows, they integrate with the MME (MultiMedia Extensions) subsystem. On Linux they integrate with ALSA (Advanced Linux Sound Architecture). Anyway they are cross-platform and meant to work on as many operating systems as possible, you should probably not have any trouble with it. You might need to download the SDL2 and SDL2_mixer dependencies if you wish to compile and link against them. There are downloads for it here: https://www.libsdl.org/download-2.0.php and http://www.libsdl.org/projects/SDL_mixer/. Both of those have .dmg disk image files for Mac OS X 10.5+, which ought to provide you with further instructions on how to use them. You will probably need both the development libraries AND the runtime libraries. The development libraries are needed to link against when you are compiling and linking the binary for Mac OS X, and the runtime libraries are needed at runtime.

But if you don't feel like linking against those you can just build it without the SDL2 or SDL2_mixer dependencies, and the configure.ac script will define the C++ macro DONT_INCLUDE_SDL, and the source code will check for this macro and notice it is enabled and then disable the music subsystem so it compiles correctly without those dependencies, so it will compile correctly automatically even if you don't have those dependencies. In other words it will work the same way it did before, but the new feature of music won't happen unless you have the dependencies for it and the configure.ac script is able to detect them. The configure.ac script works on Linux, I think it will work on Mac OS X too.

This article from Apple's website might be helpful, although it's slightly out of date with changes in more recent versions of XCode and the dropping of support for PowerPC: https://developer.apple.com/library/mac/documentation/porting/conceptual/portingunix/compiling/compiling.html Still it explains things pretty well.
« Last Edit: September 18, 2014, 12:31:38 am by Liberal Elitist »
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

SlatersQuest

  • Bay Watcher
    • View Profile
Re: Mod Planning: Terra Vitae mod
« Reply #97 on: September 18, 2014, 06:39:54 am »

Ugh - Configure isn't working either (command not found). I'm doing this in the parent directory that contains all of the files, not the src directory. Typing configure.ac gets the following error:

Code: [Select]
: command not founde 3:
./configure.ac: line 4: syntax error near unexpected token `2.6'
'/configure.ac: line 4: `AC_PREREQ(2.6)


Following the full directions, 'chmod 744 bootstrap' appears to have worked, but './bootstrap' also gives a command not found message (and everything downstream of that also doesn't work).


EDIT: Would downloading and reinstalling the original LCS source using SVN, then copying over and replacing the modified files (makefile.am, weapons.xml, armors.xml, and everything in the /src directory) work? If so I'll do that after my current RL job this morning is over.
« Last Edit: September 18, 2014, 10:44:27 am by SlatersQuest »
Logged

Liberal Elitist

  • Bay Watcher
  • I'm more liberal than you are!
    • View Profile
    • The Liberal Crime Squad wiki
Re: Mod Planning: Terra Vitae mod
« Reply #98 on: September 18, 2014, 11:54:48 am »

Oh duh I just realized the problem. All the files in the .ZIP file have Windows/DOS style line endings instead of UNIX style line endings. The SVN repository is configured to use an eol-style of native, so that files appear with Windows/DOS style line endings if you download them on Windows (like when I do it), and UNIX style line endings if you download them on any other system such as Linux or Mac OS X (like when you do it).

And various shell scripts, configure.ac Autoconf scripts, and Makefile.am Automake scripts probably need UNIX-style line endings to work.

Specifically these files: bootstrap code-clean.sh configure.ac conflict-find.sh crimesquad.desktop Makefile.am Makefile.old todo.sh ./dev/flavor.pl ./dev/newgame.diff .man/crimesquad.6 ./src/Makefile.am ./src/sdl/libSDL2.la ./src/sdl/libSDL2_mixer.la ./src/sdl/pkgconfig/sdl2.pc ./src/sdl/pkgconfig/SDL2_mixer.pc

I have fixed this problem as well as a wrong URL in the Mac OS X build directions and the download is available at https://www.sendspace.com/file/0we666.

(This comment used to be much longer and have lots of directions in it that SlatersQuest tried out and the directions didn't work so I deleted them from this comment since there's no point having incorrect directions that don't work posted here, I've updated this comment and all the other recent ones I've made to have correct information.)
« Last Edit: September 18, 2014, 05:35:10 pm by Liberal Elitist »
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

SlatersQuest

  • Bay Watcher
    • View Profile
Re: Mod Planning: Terra Vitae mod
« Reply #99 on: September 18, 2014, 04:33:52 pm »

Well, the first method deleted every line of text from every text file in the directory! I'm downloading the code you wrote again and am going to try #3... :)
Logged

Liberal Elitist

  • Bay Watcher
  • I'm more liberal than you are!
    • View Profile
    • The Liberal Crime Squad wiki
Re: Mod Planning: Terra Vitae mod
« Reply #100 on: September 18, 2014, 04:39:31 pm »

Well, the first method deleted every line of text from every text file in the directory! I'm downloading the code you wrote again and am going to try #3... :)

Sorry! I was using code samples I found on the Internet and combining them together to get something I thought would work, but couldn't test it firsthand.

Anyway I uploaded a fixed version that has the correct line endings and will work.

Here is the download link: https://www.sendspace.com/file/0we666. This is based on SVN revision 852 in which I fixed the URL for Homebrew in the Mac OS X build directions, and I also fixed this line ending problem in the preceding revision 851 so it has both fixes.
« Last Edit: September 18, 2014, 05:25:25 pm by Liberal Elitist »
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

SlatersQuest

  • Bay Watcher
    • View Profile
Re: Mod Planning: Terra Vitae mod
« Reply #101 on: September 18, 2014, 04:39:40 pm »

Uck - I don't know what is going on. According to the read me:

Quote
To get SVN:
  Install XCode via the App Store
  Open XCode, then go to the Downloads tab of the preferences menu
  Click the 'install' button next to "Command Line Tools"
To get autoconf: (in terminal):
  ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"
  brew install automake
To build LCS:
  svn co http://svn.code.sf.net/p/lcsgame/code/trunk lcsgame
  cd lcsgame/
  ./bootstrap
  LIBS="/usr/lib/libiconv.2.dylib" ./configure
  make
To play:
  src/crimesquad

the line 'ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"' gets the error message "curl: (22) The requested URL returned error: 400 Bad Request"...
Logged

Liberal Elitist

  • Bay Watcher
  • I'm more liberal than you are!
    • View Profile
    • The Liberal Crime Squad wiki
Re: Mod Planning: Terra Vitae mod
« Reply #102 on: September 18, 2014, 04:48:44 pm »

Sorry, I have been editing messages instead of posting new ones, a bit.

Here is the download link for the version of Terra Vitae with this fixed: https://www.sendspace.com/file/0we666 (based on SVN revision 852)

Those Mac OS X compiling directions in LINUX_README.txt apparently use an old URL for Homebrew, it seems it has moved. I have fixed it in revision 852, which the above download is based on, plus the above download also fixes the line endings to be UNIX-style. The line endings were fixed in revision 851.

Here is revision 852 of LINUX_README.txt, the only file changed in revision 852 (you can copy and paste it):

Code: [Select]
================================================================================
                      Liberal Crime Squad Linux Notes
================================================================================
2004-08-17 - Kevin Sadler (sadler@geodude.eclipse.co.uk)
2009-02-22 - Jonathan Stickles (jonathansfox@gmail.com)
2011-07-26 - Christian Sergelius (cribozai@member.fsf.org)
2013-09-13 - Rich McGrew (mcgrew_rich@yahoo.com)

Updated notes for compiling and playing under Linux for 4.xx.x versions
=======================================================================

Thanks to the Bay12Games forums user named xczxc who rightly pointed out the
need to update this document.

To compile LCS under Linux you will need to obtain the tools for building
under your specific distribution. You will also need to development libraries
for ncurses. The ncursesw version with wide character support should also
work.

To do this under Ubuntu (and most likely Debian too) issue the following
commands:

sudo apt-get install build-essential autoconf libncurses5-dev

The actual compilation will be done by changing your working directory to the
lcs folder and issuing:

chmod 744 bootstrap
./bootstrap
./configure
make

If the compilation was successful no errors should be issued but you will
see a myriad of warnings displayed all of which are safe to ignore.

At the moment due to continuous development of the game it is probaby
safer to not install the game systemwide and thus the best option is to
play it from the games own directory that resides in your home folder.

To do this with little trouble issue the following command while in
the LCS game folder:

cp src/crimesquad .

To run the game just type:

./crimesquad

To make everything display properly you should resize your terminal to 80x25
because the default of 80x24 sometimes makes the last lines information
appear in the wrong place.

Other good to know information
==============================

The savefile and highscores are independent of the game folder and reside
in a hidden folder on your home are with the name .lcs and you can navigate
there using your newly aquired terminal skills with the cd command as follows:

cd ~/.lcs

Build notes for Mac OS X
========================
(written by shibby1295 at bay12forums.com, Sep. 2013)

I just got the latest version of LCS running on my Macbook Pro. It took just a
smidgeon of doing, so I thought I'd document what I did. It's mostly the same
as building on Linux, with just a few changes.

This is on OSX 10.84, 64 bit intel. Your mileage may vary. Also, I haven't
played very much yet, so there could be bugs hiding in specific gameplay areas.

To get SVN:
  Install XCode via the App Store
  Open XCode, then go to the Downloads tab of the preferences menu
  Click the 'install' button next to "Command Line Tools"
To get autoconf: (in terminal):
  ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  brew install automake
To build LCS:
  svn co http://svn.code.sf.net/p/lcsgame/code/trunk lcsgame
  cd lcsgame/
  ./bootstrap
  LIBS="/usr/lib/libiconv.2.dylib" ./configure
  make
To play:
  src/crimesquad

Troubleshooting
===============

My game does not compile properly, what is wrong?!

The problem can be one of many and depends on too many things to give
a simple answer. You can get help by contacting me (email address in
the beginning of this document). Just copy the last screen of output
that you were given and I will see what I can figure out.

---------------------------------------------------------------

My games runs smoothly and everything worked out fine untill I wanted to
load a saved game. All I got was a screen with errors and my terminal
seems messed up somehow. What gives?

This is a problem that is distribution and compiler version dependant.
The reason is quite complicated and as of yet I have had no time nor
want to figure out exactly what the problem is. But luckily there is
an easy fix that does not make you lose the saved game!

While in the game folder issue the following:

make clean
./configure CFLAGS=-g CXXFLAGS=-g
make
# Wait for it to compile, check your email and take a sip of your beverage
cp src/crimesquad .

Then run the game again. Hope it worked for you.


Important Update as of Version 3.18
===================================

This file hasn't been updated in a long time, so I'll try to give a few
key notes that will update the information contained below.

BUILDING THE GAME
If you have this file, it's probably because you checked out the source
code from SVN. The new build commands are:

  bootstrap
  ./configure
  make

GRAPHICS AND TERMINAL SIZE
The graphics for the Linux version of LCS are unaltered since 3.09. I have
endeavored to ensure that future updates of LCS use strictly portable ASCII
so that futher problems are not created for the port. The note below about
terminal size remains important.

FLAG BURNING
The flag burning bug was fixed, and you can now safely burn flags in Linux.

AUTOSAVING
The game still autosaves, but instead of autosaving to autosave.dat, it
autosaves directly to save.dat.

ADDITIONAL REQUIRED FILES
There are several new files that you must keep accessible to the LCS
executable. These are found in the /workspaces directory that you probably
checked out from SVN alongside this file. The list is below:

  sitemaps.txt


Linux Notes for Version 3.09
============================

New features in this version (Windows and Linux):

Autosave - The game is automatically saved each turn (after wait is pressed)
           to a file called autosave.dat. If crimesquad crashes you can
   rename this to save.dat to recover (you may want to rename the
   original save.dat in case the autosave.dat contains something
   which causes a repeatable crash, so you can revert to that one.
   (but send Tarn Adams and me the bad save file so we can work on
   the bug!)). See below for details on Save Files.
   
Cursor Keys Use the cursor keys to move your squad. Once you've been
playing for a bit the WADX keys become a bit of a habit,
but the cursor keys should make it easier for new players.

New Features for Linux:

Curses Graphics The DOS CP437 graphics characters did not display correctly
on Linux so a fix has been worked on (3.08 works if you
install a font as described below). An "ASCII Hack" is
now used where either the source code specifies a character
by name rather than value or where a CP437 value gets converted
to the native value. The conversion isn't perfect as there
are a lot of characters that are not available (half blocks
for example) and so are represented by a character that looks
vaguely like it - you can tell what it's supposed to be now...
In the future we can use Unicode/UTF-8 and we should be able
to use exactly the same symbols. See the "Fonts" section
below.

Bugs for Linux:

Flag Burn If you burn a flag under Linux the game will hang.

Terminal Size Not really a bug but... the LCS screen size is 80x25
the size of a DOS window, your default xterm window
may be 80x24, the size of a VT100 screen, and so this
may result in the last line of the display being misplaced.
Simply increase the size of the terminal by resizing it
by one or more lines (With the KDE Konsole from the
menu select Setting > Size > 80 x 25 (IBM PC) to set the
right size).



LCS Linux History
=================

Version 3.08 of Liberal Crime Squad (LCS) was ported to Linux and compiled
with the GNU g++ compiler (GCC 3.3.2) and linked with the ncurses library
(rather than the pdcurses library used on the Windows version).


LCS on UNIX
===========

It is likely that this code will compile on other versions of UNIX, but this
has not been verified yet. Provided you have a g++ compiler and ncurses you
should be in with a fighting chance. Read the header of the Makefile for some
clues for what to do.


LCS on Cygwin
=============

LCS compiles on Cygwin (a free Linux-like API/Environment for Windows
http://www.cygwin.com ) with the Makefile supplied exactly as it does
for Linux, use PLATFORM=Linux in the Makefile. Cygwin will need to have
packages for development (eg. the gcc compiler and make) and the ncurses
library.


LCS on MinGW32
==============

MinGW32 is is a free Minimalist GNU compiler for Windows.
( http://www.mingw.org ) It compiles with MinGW32 and the Msys
enviroment and PDcurses. There is a section for MinGW32 in the Makefile,
just uncomment it (and comment out the section for Linux above it).


Build
=====

Unpack the tar archive into a suitable directory (e.g. /usr/local/src),
in the examples below assume nnn is the version number, eg 3.08:

  cd /usr/local/src
  tar -zxvf lcs_source_nnn.tgz

  cd lcs_nnn
 
  make
 
This will compile the crimesquad executable.


Installation
============

Currently the make file does not install LCS but it is very
simple.

LCS can be installed in two steps:

1. Copy the crimesquad executable to a suitable bin directory that is
   specified in PATH. If you have suitable permissions you may wish
   to copy it to /usr/local/bin, or to a bin directory in your home
   directory.

2. Install the art directory. The source directory has a subdirectory
   called art which contains some files used by the game. The game needs
   to know where these files are and will look in the following
   locations:
   
   /usr/share/lcs
   /usr/local/share/lcs
   
   To install the directory in /usr/local/share do the following:
   
   mkdir -p /usr/local/share/lcs
   cp -R art /usr/local/share/lcs/.
   
   Alternatively LCS will look for art in the current directory, or
   the environment variable LCS_ART_DIR may be set to the directory.
   An example of this using the bash shell:
   
   export LCS_ART_DIR=/usr/local/src/lcs_nnn/art
   
   Typically one would set this in .profile or .bashrc files.

3. Install the init.txt configuration file (optional, but lets you set
   additional configuration options). The game looks for this file in the
   current directory.
 
Fonts
=====

The first port, 3.08, output the DOS style CP437 codes for the curses graphics
which came out as accented characters and looked rather screwed up. The work
around for this was to install a CP437 font on UNIX as described below.

With 3.09 the "ASCII Hack" was developed which maps the CP437 codes onto
either curses alternative character set characters (the ACS_ macros) or
onto characters that (vaguely) look like what we need, it works reasonably
well.

The "perfect" solution is to use Unicode. This would require the use of
ncursesw (wide) which may need some code changes. The Unicode translation
is coded up but some more work is probably needed.

See cursesgraphics.h for more info.

By default the ASCII Hack is now used for Linux, if you have the CP437
fonts and like using them you could hack the code to define CH_USE_CP437
instead of CH_USE_ASCII_HACK.


CP437 Fonts
-----------

LCS uses DOS CodePage 437 characters for it's graphics (the flag, the map,
and the newspaper headlines). Linux doesn't support this as is, however
you can download some fonts from Emil Mikulic's website that you can use:

http://dmr.ath.cx/misc/cp437/

http://dmr.ath.cx/misc/cp437/fonts.tar.bz2

It is suggested that they be installed to /usr/share/fonts/cp437

The following line should be added to /etc/X11/XF86Config:

    FontPath   "/usr/share/fonts/cp437"

To run crimesquad in an xterm with these fonts type:

xterm -fn cp437-8x12 -e crimesquad


Why are the fonts different?
----------------------------

In simple terms the graphics characters binary codes lie above the portable
ASCII values and the character set that you are using on Linux renders
this as a different "glyph" to that which appears under DOS using CP437.
The fonts are just a hack - they change the glyphs under Linux to look
like those under DOS.

The "proper" way to fix this is to use unicode, or UTF-8, and ncursesw
(ncurses for wide characters) and remap the CP437 values to their UTF-8
values. This will mean that LCS could be played on Linux in your favourite
font. The downside, apart from the porting required, is that not all Linux
boxes may be configured with UTF-8 support or have the ncursesw library
installed, though most of the latest distros should be able to cope.


Save Files
==========

The Windows crimesquad save files (save.dat) are binary compatible with
Linux on ix86 (don't expect them to work on PowerPC (eg. Macs, RISC) due
to endianess).

Under Linux/UNIX LCS creates a sub-directory in the user's home directory
called .lcs in which the save.dat file is stored. To transfer your file
to another user just create that directory:

mkdir ~/.lcs

and copy the file into it.

With version 3.09 LCS creates an automatic save just before the "wait"
command is processed (before the days activities, such as squad raids
are carried out). This file is called autosave.dat and is stored in the
same place as the save.dat file (~/.lcs on UNIX or the game directory on
Windows). In the rare event that the game should crash ;) you may rename
the autosave.dat file to save.dat to recover, under UNIX:

mv -f ~/.lcs/autosave.dat ~/.lcs/save.dat

SDL2 and SDL2_mixer
===================

Liberal Crime Squad can use SDL 2.0.3 and SDL_mixer 2.0 for audio.
The headers and libraries for those are included in the /src/sdl
directory. However the libraries to link against only work with
Microsoft Visual C++ (32-bit) and MinGW-GCC (32 bit), the 2 main
compilers used on MS Windows. On other platforms such as Linux and
Mac OS X you will probably need the SDL2 and SDL2_mixer libraries to
link against as dependencies, in order for it to compile correctly
with audio support. Currently this is used for MIDI or Ogg Vorbis
background music.

So you have a couple alternatives:

1) Compile with SDL2 and SDL2_mixer. You will need a MIDI device.
Both Windows and Mac OS X have native MIDI that is supported by
SDL_mixer, along with support for Timidity. On Linux you have several
options for MIDI support: Timidity, which uses Gravis UltraSound
Patches (NOT Timidity++, which uses SoundFonts), is built-in, but
you'll need to put the Gravis UltraSound Patches in the location
specified by the SDL2_mixer documentation. That location is
Win32 in C:\timidity, and on UNIX in /usr/local/lib/timidity/.
There also might be native MIDI support on Linux but only with some
sound drivers and not others.

2) Use FluidSynth or JACK. Both of them are external programs but if
you install them, SDL2_mixer can use them for MIDI support.
FluidSynth is recommended if you want the best sound quality. It uses
SoundFonts. Personally I am fond of the Arachno SoundFont 1.0 which
you can find here: http://www.arachnosoft.com/main/soundfont.php. It
is designed to sound very nice with video games, but it takes up
148 megabytes. There are plenty of other great SoundFonts, including
many that take up less disk space, that one's just my personal
favorite, you might like a different one better.

I am not quite sure about how the MIDI support in JACK works. Maybe
it is just an alternative for ALSA, for the people on *BSD systems,
since SDL and SDL_mixer don't support the native OSS on *BSD. Anyway,
if you are on something like FreeBSD, OpenBSD, or NetBSD, you will
need JACK along with either the built-in Timidity or an external
FluidSynth. If you are on Linux rather than some other UNIX you have
ALSA so you don't need JACK, since SDL and SDL_mixer can use either one.
And as for Mac OS X/Darwin, it might be BSD-based but it has CoreAudio
and CoreMIDI, both supported natively by SDL and SDL_mixer. Well actually
CoreMIDI is just on iOS but SDL and SDL_mixer support both Android and
iOS.

3) Use Ogg Vorbis instead of MIDI if you wish. Along with SDL2 and
SDL2_mixer, you should have libogg, libvorbis, and libvorbisfile installed.
Ogg Vorbis has better sound quality than MIDI but larger file size.


4) If all else fails, uncomment the line that says #define DONT_INCLUDE_SDL
in common.h. This will disable SDL, SDL_mixer, and audio, and let
you compile and build Liberal Crime Squad without any SDL dependencies.
The only downside to this is you don't get any audio.
« Last Edit: September 18, 2014, 05:23:15 pm by Liberal Elitist »
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

SlatersQuest

  • Bay Watcher
    • View Profile
Re: Mod Planning: Terra Vitae mod
« Reply #103 on: September 18, 2014, 04:58:02 pm »

I am completely hosed.

configure.ac generates the following error:
Code: [Select]
./configure.ac: line 4: syntax error near unexpected token `2.6'
./configure.ac: line 4: `AC_PREREQ(2.6)'

And bootstrap generates this error:
Code: [Select]
./bootstrap: line 2: autoreconf: command not found

I am also finding myself unable to install LCS from the SVN trunc, for the same error in bootstrap. I am trying to unpack the tarball of autoreconf from Sourceforge, and it seems to have hung up tar. I'm beginning to think that I need the help of a Unix weenie to do anything, now...
Logged

Liberal Elitist

  • Bay Watcher
  • I'm more liberal than you are!
    • View Profile
    • The Liberal Crime Squad wiki
Re: Mod Planning: Terra Vitae mod
« Reply #104 on: September 18, 2014, 05:02:00 pm »

Eh, look at my last comment please, I have updated it, the directions for Mac OS X had the wrong URL for Homebrew, I fixed it.

Also are you using the version I just uploaded a couple minutes ago? It's at https://www.sendspace.com/file/0we666. Try using that version, it has both the UNIX-style line endings fixed and has the fixed URL for Homebrew in LINUX_README.txt and is based on SVN revision 852.
« Last Edit: September 18, 2014, 05:21:03 pm by Liberal Elitist »
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
Pages: 1 ... 5 6 [7] 8 9 ... 57