Bay 12 Games Forum

Other Projects => Curses => Topic started by: The Cheshire Cat on August 18, 2018, 02:24:42 am

Title: An LCS Remake
Post by: The Cheshire Cat on August 18, 2018, 02:24:42 am
I've posted about this in another thread but I'm gearing up to the point where I'm ready to call it "feature complete" so I figured it was time to post in a thread of it's own.

https://the-cheshire-cat.itch.io/lcs

(https://i.imgur.com/JW712zC.png)
(https://i.imgur.com/r1cEeC5.png)
(Screenshots are from the current update-in-progress - I'm doing a big graphical push)

This is a project I've been working on for the better part of a year at this point - it's a full re-implementation of Liberal Crime Squad (based on the source code when I started which was version 4.07.3 I think). It's not quite at feature parity yet but it's pretty close. I've been building the whole thing in Unity and once I reach the point where it's roughly equivalent to the original version I'm planning to upload the project/source files to the itch.io page in case anyone is interested in modding it.

My goals for this project were to try to make it easier to mod the game by externalizing a lot of data - even without source access you can easily add new creatures, items, and locations to the game by editing a few xml files. It's not as extensive as I'd like it to be, but it's relatively easy to understand so adding stuff can be done by anyone with a basic text editor. I also wanted to redesign the interface, not just to make it mouse-driven, but also to reduce the amount of screen-swapping needed to manage your Liberals - one of my biggest annoyances with the original game is how things like assigning activities, equipping liberals, creating squads, moving bases, etc. are all done on separate screens. Now basically everything related to managing a Liberal is done in one place, and a similar logic applies to managing bases.

Updates to this project will be posted on the itch page every so often - I don't have a set schedule but it's usually been once every week or two depending on how big the thing I'm working on is (the current update might take a bit longer since I'm not an artist so doing graphics is slow). The current version is playable, but there are still some bugs in the current release that may cause issues in certain cases. Let me know if you encounter any bugs and if possible include pastebin link to the output_log.txt Unity generates (you'll see a little notification in the lower left corner when an exception happens - that's why the game is still in "Development Build" mode).
Title: Re: An LCS Remake
Post by: Jonathan S. Fox on August 18, 2018, 10:50:52 am
This is really exciting. I saw screenshots before, but after playing with it I'm even more impressed. You've put a lot of thought into reworking the UI, and it shows; especially the overcomplicated "base mode" screen and its various sub-screens.

I really like the investigation board and the way it replaces several screens at once. I'm also a big fan of how you attached congresspeople to individual States.

I'm looking forward to seeing the source code!
Title: Re: An LCS Remake
Post by: SlatersQuest on August 19, 2018, 10:59:42 am
This is awesome! I can't wait to update Terra Vitae onto this! I plan to do that as soon as my current vacation is over (and the bugs mentioned in the TV thread are found, those that can be found).
Title: Re: An LCS Remake
Post by: Megaman_zx on August 23, 2018, 03:05:17 pm
Thanks for the update on this project. Really exciting stuff to see people still improving this game.
Title: Re: An LCS Remake
Post by: The Cheshire Cat on August 31, 2018, 07:58:47 pm
Just posted an update to the itch page - I finally got most of the item graphics done so it should be a lot more visually interesting now. News stories still have blank pictures, mainly because I haven't completely figured out how I want to handle those yet.

All that's really left to be done now is the "Disband and Wait" option, and some text/visual differences for news stories published by the Liberal Guardian instead of the mainstream paper. Both of those will likely be the next update, so at that point I'm also going to post the project files on the itch page.
Title: Re: An LCS Remake
Post by: nenjin on September 01, 2018, 02:44:28 pm
This is very incredibly liberal of you.

Tempted to fire it up but I think I'd like to wait until you're calling it feature complete before I dive in.

Great work.
Title: Re: An LCS Remake
Post by: The Cheshire Cat on September 06, 2018, 12:11:19 am
I've just done an update now, putting in some of the final missing features, so at this point it's basically feature complete. There's still a few omissions (The Bank location hasn't been added yet, and there's no news story variations for the Liberal Guardian), but for the most part it's done. So that being said, I decided it was time to upload the project files to the itch page along with the first non-development build.

The code is probably a bit hard to follow since I sort of learned how to do things as I was writing it, but I can try to answer any questions anyone might have about it.
Title: Re: An LCS Remake
Post by: SlatersQuest on September 06, 2018, 01:38:04 pm
Whoo boy! New programming language!

First off, Cheshire Cat, thank you very much for doing this!

So, starting questions: what kind of compiler do I need to compile this? I use a Mac, but I have WINE-using applications that can run Windows software. I can also try to compile it for a Unix system (Mac presently is Unix, but the language obviously isn't C).

Second, when I start modding this, I'm going to need to ask you where the code for various things are. I hope you're okay with that.  :)
Title: Re: An LCS Remake
Post by: IsaacG on September 06, 2018, 02:21:11 pm
Huzzah!  Well done Cheshire Cat.

I'm going to spend the next few weeks days going over this.
Title: Re: An LCS Remake
Post by: The Cheshire Cat on September 06, 2018, 05:10:34 pm
So, starting questions: what kind of compiler do I need to compile this? I use a Mac, but I have WINE-using applications that can run Windows software. I can also try to compile it for a Unix system (Mac presently is Unix, but the language obviously isn't C).

The language is actually C# but it's built in Unity so it required loading in the whole project to actually build. I built it on Windows but there is a Unity version available for Mac too, and the code should be cross-platform so there's no extra steps needed there. If you're familiar with C++ then you shouldn't really have much trouble with C# - a lot of the syntax is the same and C# is if anything, LESS complex than C++. It's very similar to Java if you have any experience with that.

You can download Unity here: https://unity3d.com/get-unity/download/archive I used 2017.1.1 to build this so that's the version I'd recommend. It takes a bit of getting used to since it's not working with pure code - although most of the functional stuff is basically pure code anyway, UI stuff like adding new buttons requires interfacing with the Unity framework. I didn't do anything particularly fancy with it but it's still something that needs getting used to if you're coming from a pure code background.

At some point in the near future I will try to type up some basic documentation for how I arranged all my code so that it at least seems like it makes sense - there's honestly a lot of complexity in there that doesn't need to be, but a lot of that was based on mistakes I made in the design early on that by the time they started to become annoying I'd built too much off of it to change anything.
Title: Re: An LCS Remake
Post by: tykavanaugh on September 13, 2018, 10:14:15 am
Holy shit this is the only recent LCS build I can get to run on my mac. Awesome!

Any way we can help? I'm interested in learning some about Unity.
Title: Re: An LCS Remake
Post by: The Cheshire Cat on September 13, 2018, 11:17:30 pm
Honestly at this point it's basically done so there's not really a need for any help on the building/design front. At this point I'm just playing with details - the last few days I've added in a bunch of face accessories and tweaked how they get used so portrait generation is spitting out some interesting results:

(https://i.imgur.com/1oClNWQ.png)
(https://i.imgur.com/slegRsW.png)
(https://i.imgur.com/5Y0ZKHc.png)
Title: Re: An LCS Remake
Post by: Senator Jim Death on September 14, 2018, 02:10:43 pm
I'm getting one of those Unity "failed to load mono" problems when I run the exe. I unzipped the LCS.zip standalone to a directory and ran it from that directory. OS is Win 7.
Title: Re: An LCS Remake
Post by: The Cheshire Cat on September 14, 2018, 04:42:53 pm
I looked at it and I think I uploaded the zip with the wrong data folder (it was the Linux build). I've re-uploaded the Windows LCS.zip and it should run correctly now.
Title: Re: An LCS Remake
Post by: SlatersQuest on September 14, 2018, 10:38:28 pm
I'm getting ready for this, but I'm busy and planning a mod, just not ready yet.  ;)
Title: Re: An LCS Remake
Post by: Senator Jim Death on September 14, 2018, 11:01:47 pm
I looked at it and I think I uploaded the zip with the wrong data folder (it was the Linux build). I've re-uploaded the Windows LCS.zip and it should run correctly now.

Yep, runs without a problem now. Thanks for the quick fix.
Title: Re: An LCS Remake
Post by: The Cheshire Cat on September 16, 2018, 05:39:38 pm
So this is going to be a weird question coming from me, given that I'm the one that made the thing, but are interrogations too easy? It's been this constant thing that's been nagging me this whole time - I seem to be able to flip people a LOT easier than I remember being able to in the curses version, but I copied the code from that version pretty much directly so I can't figure out if it's just a perception thing or if I made a typo somewhere. Are people supposed to turn really easily if you have a Liberal interrogating them with moderate persuasion skill, barely any psychology skill, and you just talk to them and let their rapport build up?
Title: Re: An LCS Remake
Post by: Jgray on September 16, 2018, 07:38:18 pm
So this is going to be a weird question coming from me, given that I'm the one that made the thing, but are interrogations too easy? It's been this constant thing that's been nagging me this whole time - I seem to be able to flip people a LOT easier than I remember being able to in the curses version, but I copied the code from that version pretty much directly so I can't figure out if it's just a perception thing or if I made a typo somewhere. Are people supposed to turn really easily if you have a Liberal interrogating them with moderate persuasion skill, barely any psychology skill, and you just talk to them and let their rapport build up?

In my experience that would not be the case but I am not a high level player so I could be wrong.
Title: Re: An LCS Remake
Post by: The Cheshire Cat on September 16, 2018, 07:50:30 pm
Of course the minute I post this I find the typo that's been eluding me for months. I was ADDING the target's wisdom to the attack roll instead of subtracting it. So basically the more Conservative someone was, the easier they were to convert.
Title: Re: An LCS Remake
Post by: Senator Jim Death on September 17, 2018, 04:46:49 pm
Bug report: I lost a game by having my leader be killed. I immediately started a new game and skipped the chargen questions. Now, the bug: my old game's apartment safehouse (Clark) is still listed in my safehouses list, with the items from my last game in it, and my new game's initial apartment safehouse (McLaughlin) doesn't show in the safehouses list. I can mark items to transfer from Clark to McLaughlin, and liberals are hiding out in McLaughlin as shown by their individual character details, but I can't otherwise manage McLaughlin since it doesn't show in the safehouse list.

Far as that goes, I've got Homeless Shelter listed twice in my list of properties when I'm transferring stuff. I also cancelled my McLaughlin apartment and rented one in the projects, and the Manage Safehouses interface doesn't show the new apartment. I guess I'll restart this playthrough since it seems pretty badly messed up at this point.
Title: Re: An LCS Remake
Post by: The Cheshire Cat on September 17, 2018, 05:04:49 pm
Yeah I've been trying to work out that bug for a while - it happens because at some point some data from the previous game is for some reason being retained by the UI. A lot of that stuff was built a while ago and is very hacky so I need to go back and redo it. To avoid that happening you can just quit and restart - that will clear out the UI state and you should see everything go back to normal without needing to restart your playthrough.

*edit* I've posted an update with that bug fix, as well as a few others I've been poking at for the last couple of days.
Title: Re: An LCS Remake
Post by: Megaman_zx on September 19, 2018, 01:04:40 pm
How easy is this to mod? Is it similar to normal LCS, easier, harder?
If it is really different, can you post a modding guide?
Title: Re: An LCS Remake
Post by: tykavanaugh on September 19, 2018, 01:26:36 pm
How easy is this to mod? Is it similar to normal LCS, easier, harder?
If it is really different, can you post a modding guide?

It's a unity engine game, totally different under the hood, though it plays almost identically to the old LCS.
Title: Re: An LCS Remake
Post by: The Cheshire Cat on September 19, 2018, 07:48:12 pm
How easy is this to mod? Is it similar to normal LCS, easier, harder?
If it is really different, can you post a modding guide?

Depends what you're trying to mod. You can add new items, creatures, locations etc. just by editing xml files. The directions for these are inside the files themselves. Adding new functionality is a bit trickier since you need to import the project into Unity to build it, and the general design of the code is much different than the original game so you'd need to kind of re-learn how things are put together. At some point I am planning to post an explanation of how the code is structured but it'll probably take a while to write up.
Title: Re: An LCS Remake
Post by: Megaman_zx on September 19, 2018, 10:49:33 pm
I'm curious if there is a way to import custom faces, based on gender and profession.

I'm not an artist, but I remember using baldur's gate facepacks to add 150+ new character faces to the game. I wonder if there is a way to set up something like that so we can import custom images, or mod the texture packs for different vibes.
Title: Re: An LCS Remake
Post by: The Cheshire Cat on September 19, 2018, 11:10:55 pm
Fully drawn custom faces like the old face packs for Baldur's Gate are only possible by species (you could put in custom icons for the HUMAN species and it would pick randomly between them, but there's no gender/profession breakdown), but putting in custom face elements (Like new noses or eyes or whatever) is the intended way to edit human faces in the game, and you can do it without editing any code or needing to rebuild the game in Unity.

The main file you want to look at is LCS_Data/StreamingAssets/XML/PortraitDefs.xml. In there is a brief explanation of how to add new face parts to the game. It's a pretty flexible system, allowing you to restrict parts to certain genders or political alignments, and also allowing you to define custom tags which can be used to restrict parts to only appear on certain creature types (or NOT to appear). The file LCS_Data/StreamingAssets/XML/CreatureDefs.xml, which is where creatures are defined, explains how to use those custom tags to make the association between parts/professions. There's already a few of these in use so you can see examples of how you might implement it but it's very freeform so you can pretty much do what you want.

In the LCS_Data/StreamingAssets/Graphics folder is a file "PortrtaitExample.png" which shows you how each particular facial feature will be placed in-game (there's a bit of variation because some parts will also have an x or y axis offset randomly applied; the example image shows the base location before offsets), and the LCS_Data/StreamingAssets/Graphics/Portraits folder is where all the facial graphics actually sit so you can see examples of how the ones I've already made are done.

If you wanted to do a full graphical swap, you could do it by just swapping out the PortraitDefs.xml with a different one that had its own graphical references and definitions, and the game would be fine with it (although doing so midgame might break your save, since the saved character portraits will be using references to the id names from the old xml file. If the new file uses the same id names though, it will swap in with no issues). A "portrait pack" could be set up pretty easily by just zipping up a bunch of face part png files and the PortraitDef.xml that uses them.

Currently some aspects of the facial generation system are still hard-coded - skin-colour is a set 5 tone palette, natural hair colours and dyed hair colours are also defined in the engine rather than external file, so editing any of these requires doing so in Unity and rebuilding the game. I may externalize these at some point but for now they're still essentially fixed values.
Title: Re: An LCS Remake
Post by: Azerty on September 20, 2018, 04:54:58 am
How easy is this to mod? Is it similar to normal LCS, easier, harder?
If it is really different, can you post a modding guide?

Depends what you're trying to mod. You can add new items, creatures, locations etc. just by editing xml files. The directions for these are inside the files themselves. Adding new functionality is a bit trickier since you need to import the project into Unity to build it, and the general design of the code is much different than the original game so you'd need to kind of re-learn how things are put together. At some point I am planning to post an explanation of how the code is structured but it'll probably take a while to write up.

One thing we can be sure is that object-oriented programming will be more proeminent than in the original code, thereby ensuring things will be more easily added or modified.
Title: Re: An LCS Remake
Post by: Megaman_zx on September 20, 2018, 01:19:19 pm
Thanks for the info, that's really cool. I'll take a look.
Title: Re: An LCS Remake
Post by: The Cheshire Cat on September 20, 2018, 10:46:57 pm
How easy is this to mod? Is it similar to normal LCS, easier, harder?
If it is really different, can you post a modding guide?

Depends what you're trying to mod. You can add new items, creatures, locations etc. just by editing xml files. The directions for these are inside the files themselves. Adding new functionality is a bit trickier since you need to import the project into Unity to build it, and the general design of the code is much different than the original game so you'd need to kind of re-learn how things are put together. At some point I am planning to post an explanation of how the code is structured but it'll probably take a while to write up.

One thing we can be sure is that object-oriented programming will be more proeminent than in the original code, thereby ensuring things will be more easily added or modified.

Well, for the most part yes, but bear in mind that I'm not really a better programmer than anyone else who worked on the original and a lot of this was learning as I went, so it's not really "well designed" even if it is more OO than the original. Like, you won't really deal with as much "spending 10 minutes to try to figure out where this variable is actually set/used" as you would in the old LCS code, but I haven't really broken up my classes as much as they could be and there's a lot of weird stuff I do that I don't think is very good C# practice.

I would like to do a bunch of refactoring to try to improve the usability of the code overall and to break up some of the "superclasses", but it's not as high a priority for me as just generally fixing bugs and making the player experience roughly match the original game.
Title: Re: An LCS Remake
Post by: moderate guardian on September 25, 2018, 01:34:01 am
Great job Cheshire Cat!
Request: Please add an OS X build for us Mac people.  :)
Title: Re: An LCS Remake
Post by: The Cheshire Cat on September 25, 2018, 02:41:52 am
Uploaded an OSX build to the itch page. Same disclaimer on this as with the Linux build - I can generate it but I don't have any way of testing it, so I have no way of knowing if it doesn't work unless someone tells me.
Title: Re: An LCS Remake
Post by: Rolan7 on September 25, 2018, 08:31:00 am
Posting to download as soon as I get home! This looks great!
Title: Re: An LCS Remake
Post by: IsaacG on September 25, 2018, 09:47:30 am
Well, for the most part yes, but bear in mind that I'm not really a better programmer than anyone else who worked on the original and a lot of this was learning as I went, so it's not really "well designed" even if it is more OO than the original. Like, you won't really deal with as much "spending 10 minutes to try to figure out where this variable is actually set/used" as you would in the old LCS code, but I haven't really broken up my classes as much as they could be and there's a lot of weird stuff I do that I don't think is very good C# practice.
And don't get me started on the while(true) loops, the nested for loops within switch statements, and the 2000 line method.

It's amazing you've managed to port it to Unity at all, let alone creating a new GUI.
I would like to do a bunch of refactoring to try to improve the usability of the code overall and to break up some of the "superclasses", but it's not as high a priority for me as just generally fixing bugs and making the player experience roughly match the original game.
The code is a beast.  There's a reason I've spent the last three years refactoring, and I'm not even done yet.
Title: Re: An LCS Remake
Post by: The Cheshire Cat on October 01, 2018, 07:55:15 pm
Well, for the most part yes, but bear in mind that I'm not really a better programmer than anyone else who worked on the original and a lot of this was learning as I went, so it's not really "well designed" even if it is more OO than the original. Like, you won't really deal with as much "spending 10 minutes to try to figure out where this variable is actually set/used" as you would in the old LCS code, but I haven't really broken up my classes as much as they could be and there's a lot of weird stuff I do that I don't think is very good C# practice.
And don't get me started on the while(true) loops, the nested for loops within switch statements, and the 2000 line method.

It's amazing you've managed to port it to Unity at all, let alone creating a new GUI.

Well bear in mind it's not a straight "port", it's a remake. I used the source code as a reference for how various mechanics were implemented so that the rolls and such being done would match up, but it's not a straight up "put everything from the original game into Unity" copy. So when it came down to something really confusing rather than just copying it over directly I tended to try to just determine the intention behind what was being done, and implemented it in a way that was simpler to me. Like the actual flow of say, a round of combat is basically the same as the original game, but the way it's being handled is different.
Title: Re: An LCS Remake
Post by: R0 on October 07, 2018, 11:28:27 am
Great project. I've come about two or three problems though playing the Linux build:
* Faces aren't generated, the only Portraits I've come across are the ones made of one part e.g. Monsters and Guard Dogs. The other ones are just grey boxes.
* When I try to cheat by exiting the game before going to the main screen after a failed escape or something similar, I sometimes can't load the savestate anymore (where is it stored btw.?), I'll just get a black screen with the games frame, which is somewhat frustrating.
* I don't see a way to promote seduced members, although I don't exactly remember if this was possible in older versions of LCS. It is very useful though and I'd like to have this feature.
Title: Re: An LCS Remake
Post by: The Cheshire Cat on October 07, 2018, 02:23:33 pm
Great project. I've come about two or three problems though playing the Linux build:
* Faces aren't generated, the only Portraits I've come across are the ones made of one part e.g. Monsters and Guard Dogs. The other ones are just grey boxes.
* When I try to cheat by exiting the game before going to the main screen after a failed escape or something similar, I sometimes can't load the savestate anymore (where is it stored btw.?), I'll just get a black screen with the games frame, which is somewhat frustrating.
* I don't see a way to promote seduced members, although I don't exactly remember if this was possible in older versions of LCS. It is very useful though and I'd like to have this feature.

Hmm, I'm not really sure why faces wouldn't be working in the Linux build - there may be some weirdness with how they're rendered that Linux specifically doesn't like. I wouldn't think it would work differently on Windows and Linux since it's all built in Unity functionality (which should be OS agnostic) but I am using it in kind of an awkward way. I don't really have a way to test Linux builds though so the only way this will really get addressed is if someone with a Linux machine can take a look at it and see what's going on.

Likewise, the blank screen is probably due to an issue with the save being corrupted. This doesn't happen on a "cheat" exit on Windows (I specifically set it up so it wouldn't be an issue - if people want to savescum I'm fine with that), but Linux may handle things differently than windows when a program is force-terminated. It might also have to do with WHEN you're quitting exactly - I made some changes to the autosave behaviour in the last build and there may be some issues if you quit out at particular times that I hadn't seen when I was testing it.

As for where it's saved - $XDG_CONFIG_HOME/unity3d/Lazy Dog Software/LCS (XDG_CONFIG_HOME defaults to ~/.config). This folder will also have a log file that can contain exception information that might be helpful to diagnose what's happening - can you trigger the black screen on a failed load, and then upload the Save.sav and output_log.txt from that folder somewhere so I can check them? Actually, the output_log.txt might also have some helpful information on the blank portrait issue too (if it's being caused by an exception), so a copy of one from after you see that happen would be helpful too. Bear in mind that Unity will overwrite this file every time you start the game up so you'd need to make copies of this file for each issue separately (i.e. enter the game, try to load the bad save file, get the black screen, quit, copy/rename the output_log.txt to somewhere else, enter the game again, start a new game and go until you see a grey box portrait, quit, then copy/rename the output_log.txt file again).

Right now you can't promote anyone manually - promotion will happen automatically if someone's current leader dies as long as THEIR leader has space to lead their new subordinates. If the person being promoted was seduced, they will only promote if they have more than 100 Juice (they will promote as a regular member though, so they still take up a recruitment slot on their new leader even though they didn't on their previous one). Otherwise, they aren't committed enough to the cause to want to continue after their lover is killed and they will just leave the LCS. This is all directly from the code I was referencing so if there was a version that used to allow you to manually promote seduced liberals, it was older than the one I based my code on. I may add manual promotion back in at some point but it would probably still not be allowed for seduced members unless they meet that 100 juice requirement.
Title: Re: An LCS Remake
Post by: R0 on October 10, 2018, 08:14:11 am
Okay, I needed some time due to technical issues, but here we go.
I couldn't find an output_log.txt, but a Player.log, so I'll upload these. While I started a new game for the save with the blank portraits, I couldn't trigger the save file corruption on it, so I uploaded a different, further progressed one for that.
https://files.catbox.moe/7ti4ys.zip
Title: Re: An LCS Remake
Post by: The Cheshire Cat on October 10, 2018, 04:26:46 pm
Hmm, the save and log file for the portrait issue look fine so I can't really tell what the problem is there. It may be some Linux specific thing. I'll look into some of the details on the methods I'm using to generate portraits to see if there are any system specific aspects to them that might be cause the problem.

The save corruption looks like it's due to the CEO entity not having saved correctly - there's a hanging reference to them in the Government entity but no matching entity to be referenced. Do you remember specifically what you'd done just before you quit out that might have caused that to happen? The CEO handling is a bit hacky so it's very likely there's some edge case that I've missed.

*edit* yeah looks like there's a LOT of edge cases I've missed. I'm looking at how persistent non-liberal entities are being handled and there are a ton of holes where they could be created in-game and registered to persistent handlers, but not persisted themselves, so the save game would be left with the same kinds of references to entities that don't exist as far as the game is concerned. It looks like the CEO is especially bad about this, because it is created as soon as you activate the special tile in the CEO house, but it's not actually saved unless you recruit them.
Title: Re: An LCS Remake
Post by: The Cheshire Cat on October 11, 2018, 09:03:43 pm
I've uploaded a build with some fixes for these issues - see if the changes I've made resolved the portrait issues (I had some other people test the game on their Linux machines and they didn't get the same issue you did, so it might be a hardware thing. The changes I made should "simpler" for different GPUs to handle since I don't do anything with rendering to textures anymore).

If you want to fix the save that you had that'd stopped working, you can open it up in a text editor and find the line that says "<ceo>45446</ceo>" and replace it with "<ceo>null</ceo>". It should load fine after that and it'll just generate a new CEO the next time you activate the special tile.
Title: Re: An LCS Remake
Post by: R0 on October 12, 2018, 07:05:24 pm
Yeah, works now for me.
Another thing I noticed is, that trying to give your founder an alias while choosing his background that includes a,b,c,d or e will instantly pick the corresponding answer.
Title: Re: An LCS Remake
Post by: jhxmt on October 13, 2018, 12:23:51 pm
As someone who is just starting out learning Unity (I'm past the "Hello World" stage and into the top-down-shooter-controls-and-camera nightmare that traditionally comes next :P), I am so incredibly grateful to you for sharing it as a Unity project.  Just being able to look at a feature-complete game that I'm relatively familiar with (I've played many previous iterations of the LCS codebase) is going to be hugely helpful in getting my head around some of the ways-you-can-use-Unity concepts.

So, thank you.  And that's without even having played it yet.  ;)  Downloading now!
Title: Re: An LCS Remake
Post by: The Cheshire Cat on October 13, 2018, 01:11:23 pm
As someone who is just starting out learning Unity (I'm past the "Hello World" stage and into the top-down-shooter-controls-and-camera nightmare that traditionally comes next :P), I am so incredibly grateful to you for sharing it as a Unity project.  Just being able to look at a feature-complete game that I'm relatively familiar with (I've played many previous iterations of the LCS codebase) is going to be hugely helpful in getting my head around some of the ways-you-can-use-Unity concepts.

So, thank you.  And that's without even having played it yet.  ;)  Downloading now!

I should probably warn you up front that this isn't a GREAT use of Unity. I ended up fighting it a lot and in retrospect I think it would have worked better had I made more use of the Unity interface rather than trying to handle everything in code. I guess it does serve as a demonstration of how you can do that (some Unity games are set up like this - as I understand it the Roguelike Caves of Qud is also designed this way), but it's not what I would recommend as an approach if you're planning to really get in to Unity.
Title: Re: An LCS Remake
Post by: tykavanaugh on October 22, 2018, 02:07:43 pm
This is really awesome! Is the CCS and such implemented it? I haven't been able to get them active while testing.
Title: Re: An LCS Remake
Post by: The Cheshire Cat on October 22, 2018, 08:18:55 pm
They are implemented, but won't show up until public opinion shifts about 60% liberal.
Title: Re: An LCS Remake
Post by: tykavanaugh on October 28, 2018, 11:29:52 am
Is there a way to make the election screens run faster?
Title: Re: An LCS Remake
Post by: The Cheshire Cat on October 28, 2018, 02:32:55 pm
Press F1.
Title: Re: An LCS Remake
Post by: SlatersQuest on November 01, 2018, 07:20:36 pm
I am finally downloading Unity and going to look into the code to start my new total conversion mod. Expect updates in the next couple of weeks with their own thread.  :)


EDIT: nm. seems to be working now!
Title: Re: An LCS Remake
Post by: SlatersQuest on November 01, 2018, 08:50:27 pm
Addendum: I have found a couple of bugs.

1. conservatives can go straight from looking at you suspiciously to an alarm cry in the same turn, if the conservative panic happens in the same turn.

2. It's possible to fade into the shadows while being naked.
Title: Re: An LCS Remake
Post by: Taberone on November 01, 2018, 08:50:54 pm
Are there any sound effects?
Title: Re: An LCS Remake
Post by: SlatersQuest on November 01, 2018, 08:53:37 pm
Not found sound effects yet, but haven't had my earbuds plugged in.

Also, bug #3. you can train skills up at speeds greater than one rank/day.
Title: Re: An LCS Remake
Post by: The Cheshire Cat on November 01, 2018, 11:32:55 pm
Addendum: I have found a couple of bugs.

1. conservatives can go straight from looking at you suspiciously to an alarm cry in the same turn, if the conservative panic happens in the same turn.

I've seen this happen but I think it might be more of a display issue than an actual internal issue - what happens is that the conservative panic triggers on the step you take just before the encounter, but you don't get the popup warning about it until the next time the game is prompted to check, which is after you take your next action (which, if it includes a failed disguise check, since the enemy is already suspicious will cause them to sound the alarm, which will queue up an "alarm" popup behind the already queued "suspicious" popup, so you get both at once).

I haven't quite found a way to rearrange the order here that doesn't break something else so it's something I still need to fiddle with.

Quote
2. It's possible to fade into the shadows while being naked.

This isn't really a bug so much as it is a consequence of nakedness prompting a disguise check even in unrestricted areas before you've committed any crimes (normally no check is made here at all). Basically you HAVE to make a stealth check or else everybody notices that you're naked and panics (except in the sweatshop where nudity is considered a valid disguise).

Not found sound effects yet, but haven't had my earbuds plugged in.

Also, bug #3. you can train skills up at speeds greater than one rank/day.

This also isn't a bug so much as I just never bothered to implement the daily training cap since I didn't really see the need for it as a mechanic. It doesn't really do anything to discourage skill grinding - it just forces you to tediously split up your grinding sessions across multiple in-game days.

Also yeah, there's no sound effects or music in the game. I don't think implementing them would actually be particularly complicated and I already sort of have a framework in place where code can send events to the UI when it's called (I use this approach for dialogue bubbles), so a similar approach could be used to play sound effects for actions.
Title: Re: An LCS Remake
Post by: SlatersQuest on November 02, 2018, 05:08:09 pm
I discover to my disappointment that the remake is single-city only, and I want my total conversion to be multi-city. I also am having a difficult time with the code. For example, the code for LawAlignmentDisplay is the following:

Code: [Select]
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using LCS.Engine;

public class LawAlignmentDisplay : MonoBehaviour {

    public MouseOverText mouseoverText;
    public Text t_LawName;
    public Image i_CC;
    public Image i_C;
    public Image i_M;
    public Image i_L;
    public Image i_LL;

    public Sprite smallPip;
    public Sprite largePip;

// Use this for initialization
void Start () {

}

// Update is called once per frame
void Update () {

}

    public void setLaw(string def, Alignment align)
    {
        t_LawName.text = GameData.getData().lawList[def].name;
        Color alignColor = Color.white;

        switch (align)
        {
            case Alignment.ARCHCONSERVATIVE:
                alignColor = Color.red;
                i_CC.sprite = largePip;
                i_C.sprite = smallPip;
                i_M.sprite = smallPip;
                i_L.sprite = smallPip;
                i_LL.sprite = smallPip;
                break;
            case Alignment.CONSERVATIVE:
                alignColor = Color.magenta;
                i_CC.sprite = smallPip;
                i_C.sprite = largePip;
                i_M.sprite = smallPip;
                i_L.sprite = smallPip;
                i_LL.sprite = smallPip;
                break;
            case Alignment.MODERATE:
                alignColor = Color.yellow;
                i_CC.sprite = smallPip;
                i_C.sprite = smallPip;
                i_M.sprite = largePip;
                i_L.sprite = smallPip;
                i_LL.sprite = smallPip;
                break;
            case Alignment.LIBERAL:
                alignColor = Color.cyan;
                i_CC.sprite = smallPip;
                i_C.sprite = smallPip;
                i_M.sprite = smallPip;
                i_L.sprite = largePip;
                i_LL.sprite = smallPip;
                break;
            case Alignment.ELITE_LIBERAL:
                alignColor = Color.green;
                i_CC.sprite = smallPip;
                i_C.sprite = smallPip;
                i_M.sprite = smallPip;
                i_L.sprite = smallPip;
                i_LL.sprite = largePip;
                break;
        }

        mouseoverText.mouseOverText = GameData.getData().lawList[def].description[align];

        t_LawName.color = alignColor;
        i_CC.color = alignColor;
        i_CC.SetNativeSize();
        i_C.color = alignColor;
        i_C.SetNativeSize();
        i_M.color = alignColor;
        i_M.SetNativeSize();
        i_L.color = alignColor;
        i_L.SetNativeSize();
        i_LL.color = alignColor;
        i_LL.SetNativeSize();
    }
}

I understand what this code does and when in the game this code is used, because I've seen it in action and can figure out what the various parts refer to, but how is this class called? If, for example, I wanted to make it possible to access the liberal agenda screen while in site mode as well as in base mode, how would I go about doing it?
Title: Re: An LCS Remake
Post by: The Cheshire Cat on November 02, 2018, 06:16:38 pm
Doing multi-city actually wouldn't be a HUGE extension of the existing code - as far as the game is concerned a location is just a thing independent of any organizational structure and how they're arranged is more for the convenience of the player than a hard requirement. You'd basically just need to add another layer to the hierarchy where you have a "Country" entity that holds a list of "City" entities and then up date the UI to reflect that. The biggest change would probably just be in the logic that loads the city definition from the xml files. Some logical changes would probably be needed in a few methods like when someone gets arrested or sent to the hospital - right now those assume that only one of the relevant location exists (they would technically still work in that they would send them to a location of that type - but it might not be the local one). I'll look into adding support for this but I've been taking a bit of a break from anything too major on this so I don't want to make any promises.

For the class you've mentioned, any class that extends MonoBehaviour is a Unity object and works through the Unity editor's interface rather than the code itself. For that specific example, it's a script used on a prefab (called "LawAlignment", stored in the Assets/Prefabs/Base Screen folder). None of those variables are set in code and it isn't created through a constructor the same way you'd be used to - rather in the Unity editor all of those fields are set in the hierarchy or on the prefab definition (a prefab is basically just a specific saved copy of a hierarchy object that you can freely duplicate either in the editor or at runtime), and it gets instantiated by setting a reference to the prefab on another object (In this case, it's an object in the hierarchy itself, under Main Camera -> Canvas -> Base Screen -> Liberal Agenda, and the LiberalAgendaImpl script on that object), and then calling Instantiate in the code with that reference as input.

For this kind of stuff you're probably going to want to familiarize yourself with how Unity structures things in general, since that's where all the UI logic lives. Unity does things in a way that's slightly different than how you'd expect to handle them in code, and basically requires using the editor interface to do a lot of stuff. To give an example of how you'd do the thing you asked, what you could do is copy the Liberal Agenda object from under the Base Screen object in the hierarchy and paste it as a child of the Site Screen object. In this copy you'd want to remove any of the UI elements that you won't want accessible on the Base Screen (Like maybe the poll or map buttons), and rearrange anything that doesn't fit in nicely with the Site interface. Since this is all just layout on a copy, there's no code changes needed and nothing will be affected on the original agenda screen. Once you've got the UI arranged how you want in the hierarchy, you'd just need to modify the SiteScreenController to give it a "public LiberalAgendaImpl LiberalAgendaView;" variable to set in the editor with a reference to the screen you just added, then add a method that will call the "show()" method of that object and hide any elements you don't want displayed while it's there, and then add a button on the Site Screen UI that will call that method.
Title: Re: An LCS Remake
Post by: The Cheshire Cat on November 04, 2018, 11:23:19 pm
So I decided to take a crack at multi-city support this weekend and I sort of have it in, although I have probably broken a dozen other things by doing so. NationDefs.xml can now be modified to add extra cities to the game and if there is more than one city defined, a "TRAVEL" button will appear in the "Go forth to stop evil!" menu. Travel between cities costs $200 per person and if you travel as a squad it will send you to the Homeless shelter in the target city (you can also reassign liberals without a squad to other cities in the Liberal detail screen. It still costs $200). If you can't afford to travel it will just cancel the action when you wait until the next day.
Title: Re: An LCS Remake
Post by: SlatersQuest on November 06, 2018, 12:29:37 pm
Cool - I am at a scientific conference right now so haven't been able to play it/learn more about Unity and won't be until I get back, but I will get to it soon!
Title: Re: An LCS Remake
Post by: Kyros on November 12, 2018, 03:28:00 am
Hey, man good job porting this game to Unity. Wanted to ask you a question, how can I dismiss one of my recruits like in regular LCS ver. by IsaacG? Can’t find it, and if it’s not in the game maybe you will consider adding it. (Same with recruiting option, which is not in the game right now)
Title: Re: An LCS Remake
Post by: Taberone on November 12, 2018, 11:17:01 am
Hey, man good job porting this game to Unity. Wanted to ask you a question, how can I dismiss one of my recruits like in regular LCS ver. by IsaacG? Can’t find it, and if it’s not in the game maybe you will consider adding it. (Same with recruiting option, which is not in the game right now)

You could always have them commit suicide by carjacking. Let them try to carjack, have them get caught, keep fighting the cops until they die. At least, that's how it works in the other versions of LCS. Haven't tried that myself yet in this remake version.
Title: Re: An LCS Remake
Post by: The Cheshire Cat on November 12, 2018, 05:26:07 pm
Yeah currently there's no way to dismiss a Liberal other that suicide by cop - I will probably add it at some point along with manual promotion.

The recruitment option is a bit trickier because I'd probably have to set up a whole custom interface for it that's more complex than other activities (I seem to recall even the original game could get buggy when you used it). I'd originally planned to include it but it was one of those things where the amount of effort involved vs. the actual value it added to the game kind of made it into a low priority thing.
Title: Re: An LCS Remake
Post by: Little on November 13, 2018, 06:03:09 pm
Talking to people and hijacking cards need keyboard shortcuts. I'm sure there's a few other spots as well,

Other than that, fantastic job!
Title: Re: An LCS Remake
Post by: SlatersQuest on November 21, 2018, 12:19:12 pm
So, I downloaded your latest code and tried to compile it (without changing anything), and got the following error:

Code: [Select]
[home directory]/LCS remake/LCS.CSharp.csproj(11,11): Error MSB4226: The imported project "/Library/Frameworks/Mono.framework/Versions/5.12.0/lib/mono/xbuild/SyntaxTree/UnityVS/2015/UnityVS.CSharp.targets" was not found. Also, tried to find "SyntaxTree/UnityVS/2015/UnityVS.CSharp.targets" in the fallback search path(s) for $(MSBuildExtensionsPath) - "/Library/Frameworks/Mono.framework/External/xbuild/" and "/Applications/Visual Studio.app/Contents/Resources/lib/monodevelop/AddIns/docker/MonoDevelop.Docker/MSbuild" . These search paths are defined in "[home directory]/Library/Caches/VisualStudio/7.0/MSBuild/14822_1/MonoDevelop.MSBuildBuilder.exe.config". Confirm that the path in the <Import> declaration is correct, and that the file exists on disk in one of the search paths. (MSB4226) (LCS.CSharp)
Can you tell me what this is about?


Addendum: you said that there is a LiberalAgenda object under the BaseScreen object. Where do I find these? I find a script with the name LiberalAgenda, which is located in a folder called BaseScreen, but no hierarchical objects like you describe. Certainly the LiberalAgenda script has no child objects of its own...
Title: Re: An LCS Remake
Post by: The Cheshire Cat on November 21, 2018, 03:59:43 pm
Are you opening it through Unity and the "Open C# project" menu option in that, or just directly in visual studio? The thing about Unity projects is that they aren't actually standard C# code and you can't just compile them with VS.

The hierarchy I was talking about isn't the scripts, but the scene hierarchy in the Unity editor:

(https://i.imgur.com/A0xwplt.png)
Title: Re: An LCS Remake
Post by: SlatersQuest on November 21, 2018, 06:18:26 pm
There does not appear to be an "Open C# project" menu option in this version of Visual Studio (perhaps because I'm developing this on a Mac?).

What I did to open the file was File -> Open -> LCS.CSharp.csproj

Is there another way to open it?


Edit: I also don't recognize your screenshot. There is no "Main Camera" object that I have been able to find anywhere...

Edit to edit: found out that I was opening the wrong Unity. Now I can see the window you are showing there, but I cannot find where the scripts are that actually contain the code!
Title: Re: An LCS Remake
Post by: The Cheshire Cat on November 21, 2018, 08:04:41 pm
In the Unity "Assets" menu there should be an "Open C# project" option at the bottom which will open visual studio with a connection to the Unity editor, which will allow it to read and compile the scripts properly.
Title: Re: An LCS Remake
Post by: SlatersQuest on November 22, 2018, 04:18:26 pm
All right, got that. Now, how does Unity attach each script to each element in the hierarchy? For example, I am looking at the object entitled 'Liberal Agenda' in the hierarchy, but I don't see any reference to LiberalAgendaImpl or any of the other script elements. How are these connected?
Title: Re: An LCS Remake
Post by: The Cheshire Cat on November 23, 2018, 09:06:17 pm
That's related to Unity's component interface. Here's a screenshot of the Liberal Agenda game object selected in the inspector (note: your layout might not look exactly like this since I don't remember what the default arrangement is but all of the elements should be there somewhere):

https://i.imgur.com/l0vTMFL.png
(linked because it's a fullscreen image)

On that object are two components, the Rect Transform (which is a default component that will be on every UI element) and the actual Liberal Agenda Impl script. The various things inside the second component are all the hooks for the public members of the class - basically this is how Unity sets the default values of a monobehaviour instead of using a constructor. So for a few examples, the UI Controller is, in the script code itself "public UIControllerImpl uiController;" - just being public exposes it to the Unity interface. Then it's set by just dragging in an object that has on it a UIControllerImpl component (in this case, the MasterController object that's farther down the hierarchy window). Not all of those references are to other objects in the scene - some of them might be image or prefab references being pulled from the asset explorer in the project tab in the bottom right. If you want to see where any of the actual referenced objects are, you can just click on them once on the LiberalAgendaImpl component and it will highlight it in the hierarchy/project window.

You might want to look up some basic Unity tutorials if you want to dig into editing the code/interface itself. Basically everything I did was very simple usage of the built in UI system, which is mostly playing with layouts, and then having some master objects to handle all the logic and read data from the game state to feed into the UI.
Title: Re: An LCS Remake
Post by: SlatersQuest on December 12, 2018, 01:40:42 pm
I just posted a thread (link (http://www.bay12forums.com/smf/index.php?topic=172776.0)) about the new game I want to design and leave for discussion as to which version of LCS to start with to modify from.
Title: Re: An LCS Remake
Post by: Dragon239 on January 16, 2019, 03:34:22 pm
I can't figure out any pattern about what causes it, but sometimes upon attempting to leave areas (I've had it happen with at least the courthouse and the garment place with differing characters), the game locks up when I walk onto the exit tile.
The only thing I can do at that point is close the game and re-load, and it loads me to before entering the area, but I've had it happen a couple times where the save seemingly corrupts, and loading it just produces a black screen.
Further, if the save didn't corrupt and I attempt to go back to the place where it locked up, it'll lock up again. I did this with the garment place about 5 times in a row before I gave up and just did another activity.

Another thing: Sometimes when I leave an area it'll have conservatives chasing me, but it sort of just immediately skips that and I flee without having to actually do anything. I've never seen it not just skip over that. Not a very critical bug, but still weird.

I'm on Windows 10, using your Windows version.
Title: Re: An LCS Remake
Post by: The Cheshire Cat on January 16, 2019, 04:11:56 pm
Next time you get the black screen can you post the output_log.txt from C:\Users\(your username)\AppData\LocalLow\Lazy Dog Software\LCS (You might need to enable hidden files to be able to see it)? It sounds like there might be an uncaught exception which would be recorded in there. Your save file is also in that folder and might also be helpful.
Title: Re: An LCS Remake
Post by: Dragon239 on January 16, 2019, 05:19:45 pm
Yeah, I kept the save of the most recent one, where it messed up when my character Alias'd as "Suave" tried to leave the courthouse.
Restoring it it and loading it produces this in the output_log:
Spoiler (click to show/hide)

If you want to download the save:
https://www.mediafire.com/file/jfi9mbd0eatuc6j/LCS_error.7z/file

Would it be possible for you to make it so the game keeps a backup save in addition to its main save? To mitigate corruption ruining saves.
Title: Re: An LCS Remake
Post by: The Cheshire Cat on January 16, 2019, 06:32:19 pm
I've posted a quick update that addresses your issues - I'm not really sure what was causing the crash when you were exiting a site since I can't seem to reproduce it, but it might have been related to the save corruption. The new version should be able to correctly load your save now - there was an issue of an item recorded in a safe house inventory that no longer existed in the save. When you load it now the game will just purge the bad reference and continue.
Title: Re: An LCS Remake
Post by: Reelya on February 02, 2019, 04:06:38 am
I've done Android builds from Unity before, I could have a go at making one for this.

However, to work well with touch-screen, all keyboard shortcuts should also be exposed as clickable elements on the UI. It's not going to go well on a phone if you need to keep accessing the Android keyboard.
Title: Re: An LCS Remake
Post by: BigD145 on February 02, 2019, 10:01:37 pm
I've done Android builds from Unity before, I could have a go at making one for this.

However, to work well with touch-screen, all keyboard shortcuts should also be exposed as clickable elements on the UI. It's not going to go well on a phone if you need to keep accessing the Android keyboard.

I wouldn't mind even a hook for a hardware keyboard. Bluetooth. Or a gamepad and selectable options but that's tougher.
Title: Re: An LCS Remake
Post by: Reelya on February 02, 2019, 10:14:13 pm
It should handle a bluetooth keyboard automatically. Android handles that at the operating system level, so apps/games don't have to do anything about that.

The main thing is that to do an Android build from Unity you have to download and install a stack of stuff including the official Android SDK, and that takes a bit of homework to get it all working.
Title: Re: An LCS Remake
Post by: EuchreJack on February 03, 2019, 08:24:55 pm
I was originally skeptical about the graphics (the game having graphics, I mean), but there is something about this version that just a tad bit more addictive than the original.  The little touches that you've done with the graphic interface is what really intrigues me, like how the managing liberal section looks like a police cork board of known associates from cop shows, or how equipment has descriptions and pictures.

EDIT: Would it be possible to bring back the Ride of the Valkyries music for the Car Stealing scene?  For some reason, it just seems iconic to me.

EDIT2: The game sometimes crashes if I try to rent a room.  It also seems to be less stable the longer I play.
EDIT3: Ok, the game didn't crash this time when I rented the room, but it keeps crashing when the cops raid my abandoned safehouse.
Title: Re: An LCS Remake
Post by: The Cheshire Cat on February 07, 2019, 01:21:25 am
Can you post a copy of the output_log.txt and your save from the folder C:\Users\(your username)\AppData\LocalLow\Lazy Dog Software\LCS from after a crash? Also is it an actual hard crash to desktop?
Title: Re: An LCS Remake
Post by: EuchreJack on February 07, 2019, 03:54:13 am
Can you post a copy of the output_log.txt and your save from the folder C:\Users\(your username)\AppData\LocalLow\Lazy Dog Software\LCS from after a crash? Also is it an actual hard crash to desktop?
I used the old workaround where I sent someone over to surrender to the cops, and then it ran properly.  It was a freeze, not a crash to desktop.

...Its strange how the game might use a different engine, but I swear the bugs are the same, lol.  Specifically, in this case the game seemed to have trouble processing the dead bodies, which tended to happen in the original LCS from time to time.

I'll remember to look that up in the future and post.
Title: Re: An LCS Remake
Post by: The Cheshire Cat on February 08, 2019, 12:52:23 am
To be honest the way I'm handling base inventories (which includes dead bodies and hostages) isn't great and is prone to a lot of synchronization issues. I've done a re-write of the system to handle it better, but I haven't tested it much yet so I probably won't post a new build yet. I'm working on some general refactoring to try to simplify the game logic overall, although most of this isn't going to be visible from a player's perspective.
Title: Re: An LCS Remake
Post by: methylatedspirit on February 08, 2019, 01:37:58 am
Interesting. Are you eventually going to implement the features from the unofficial LCS 4.07.0 version?
Title: Re: An LCS Remake
Post by: EuchreJack on February 09, 2019, 02:57:12 pm
To be honest the way I'm handling base inventories (which includes dead bodies and hostages) isn't great and is prone to a lot of synchronization issues. I've done a re-write of the system to handle it better, but I haven't tested it much yet so I probably won't post a new build yet. I'm working on some general refactoring to try to simplify the game logic overall, although most of this isn't going to be visible from a player's perspective.

Well, the original LCS had the same problems in several versions, so you're in good company.  It's obviously a tough area.
Title: Re: An LCS Remake
Post by: The Cheshire Cat on February 10, 2019, 11:21:42 pm
Interesting. Are you eventually going to implement the features from the unofficial LCS 4.07.0 version?

I'd actually used 4.07.4 as my base for mechanics when building this version, so most of the complete features from that are in this version - I emphasize "complete" there because part of the nature of an open source project is there's a lot of half-finished cruft in there that people added over the years but ended up being abandoned, so it's technically accessible but doesn't actually work. So things like the Stalinist Crime Squad or the white house site aren't things I'm planning on adding to my version - although ideally I'd be able to get it into a state where someone could mod that stuff in if they wanted it.
Title: Re: An LCS Remake
Post by: The Cheshire Cat on February 14, 2019, 11:59:05 pm
I just published a new build which should address some of the issues people have been having - I tracked an earlier save corruption issue to a bad item being placed in base inventories when you had sleepers snooping around and they send evidence to the homeless shelter. I've also changed up how base inventories work in general so there should be less problems related to them going forwards - these changes also apply to hostages and dead bodies.

Actually new in this build is sneak attacks, which I had stubs for ages but never actually got around to implementing. They work the same way they did in 4.07, where knife type items can be used to make a special high damage attack against enemy wisdom instead of dodge, and if it kills them, you won't trigger an alarm.
Title: Re: An LCS Remake
Post by: SlatersQuest on March 27, 2019, 12:16:38 am
After looking through your code in more detail, I have come to appreciate the monumental task that it must have taken to make this. You basically rebuilt LCS from the ground up. Well done, Cheshire!

I am going to make a suggestion, though, and that is for more/better documentation. You'll notice in the original LCS the includes.h file not only lists all of the functions needed for the compiler, but also comments what they do, and which of the game's many .c files each one is contained in. Adding a similar file to your source would greatly aid any future coders seeking to update, improve, or otherwise modify this awesome piece of work that you've done.  :)
Title: Re: An LCS Remake
Post by: Bidyhackier on March 30, 2019, 06:57:35 pm
Not sure if a bug or intended, but it seems Liberal Teaching cant teach skills past the user Natural Stat
https://imgur.com/gallery/TILKQ7m (https://imgur.com/gallery/TILKQ7m)

At this example, i got an Agent to train my liberals in urban warfare. then i checked the LCS Wiki(that i am aware is outdaded). it said you had to train the Teacher in Teaching till his level was at least 2 levels inferior to the skill you want trained. the guy had dodge at 9, so i trained him to teaching 7 via college courses. then i set him off to teach, money was being spent at the classes... then it stopped. the training stopped at level 5 and i was wondering why. then i noticed it was because my founder actual stat for agility, without factoring in his boosts from liberal rank, was 5.
Title: Re: An LCS Remake
Post by: The Cheshire Cat on March 30, 2019, 08:13:14 pm
That sounds like it's a bug - I found a few other spots where I was accidentally using the base value of the stat when I'd meant to use the modified value as well. The wiki info might not always 100% match the way it works in my version since it's based on the original release, but for the most part I tried to match mechanics 1:1.
Title: Re: An LCS Remake
Post by: Bidyhackier on March 31, 2019, 10:38:34 pm
i am also having a serious problem with the Supreme court. its already blue, with 6 chairs occupied by liberals(blue) and 3 by arch conservatives, yet they usually approve conservative laws 8-1, and tend to not approve liberal laws, i have no idea of why. i would have won the game already if they did'nt set back the agenda all the time
Title: Re: An LCS Remake
Post by: The Cheshire Cat on March 31, 2019, 10:44:14 pm
Generally the way that the supreme court works is that they will vote to move laws towards their preferred alignment. This means that moderate liberals will actually vote with the conservatives if a law is at L+. For a supreme court that pushes all laws to elite liberal, they need to be majority elite liberal themselves.
Title: Re: An LCS Remake
Post by: SlatersQuest on May 09, 2019, 07:17:45 pm
I'm getting an error trying to build the game, as follows:

Code: [Select]
/Users/[my home directory]/Documents/LCS material/Cheshire Cat's LCS remake/LCS.CSharp.csproj(11,11): Error MSB4226: The imported project "/Library/Frameworks/Mono.framework/Versions/5.18.1/lib/mono/xbuild/SyntaxTree/UnityVS/2015/UnityVS.CSharp.targets" was not found. Also, tried to find "SyntaxTree/UnityVS/2015/UnityVS.CSharp.targets" in the fallback search path(s) for $(MSBuildExtensionsPath) - "/Library/Frameworks/Mono.framework/External/xbuild/" and "/Applications/Visual Studio.app/Contents/Resources/lib/monodevelop/AddIns/docker/MonoDevelop.Docker/MSbuild" . These search paths are defined in "/Users/[my home directory]/Library/Caches/VisualStudio/8.0/MSBuild/1426_1/MonoDevelop.MSBuildBuilder.exe.config". Confirm that the path in the <Import> declaration is correct, and that the file exists on disk in one of the search paths. (MSB4226) (LCS.CSharp)

(Note: I have replaced the name of my home directory)


Title: Re: An LCS Remake
Post by: The Cheshire Cat on May 09, 2019, 07:32:12 pm
It looks like you might be missing the Unity libraries for visual studio (or you have them but they aren't enabled) - you have to set it up to work with it: https://docs.microsoft.com/en-us/visualstudio/cross-platform/getting-started-with-visual-studio-tools-for-unity?view=vs-2019
Title: Re: An LCS Remake
Post by: SlatersQuest on May 13, 2019, 11:57:54 am
I installed Unity and I still get the same error. I am trying to compile from within Visual Studio, however. How do I open up the project in Unity?
Title: Re: An LCS Remake
Post by: The Cheshire Cat on May 14, 2019, 03:14:50 pm
Ah, yeah, just trying to open up the project in VS won't work because it needs to hook in to the editor. The way Unity is set up is kind of weird - VS is used to WRITE the code but doesn't actually build it, the editor will do that. What you want to do is unzip all the project files into their own folder, then through the launcher, choose "open" or "add" (depends on what version of the launcher you have) and go to that folder. It will import the project into the editor and then from the editor you can edit the code via the Assets/Open C# Project menu.
Title: Re: An LCS Remake
Post by: SlatersQuest on May 14, 2019, 06:37:23 pm
Success! Thank you very much!

At least now I have one version of LCS that I can write and compile other than the TV mod!  8)
Title: An LCS Remake
Post by: halander1 on August 05, 2019, 06:38:59 am
Do you intend on expanding upon the features of the original in ways different from LCS 4.12.37?
Title: Re: An LCS Remake
Post by: The Cheshire Cat on August 08, 2019, 08:21:15 pm
I don't have any specific plans aside from the enhancements I've already done. I have a few concepts I've thought about playing around with but I would likely do them as some sort of offshoot rather than roll them into the main project.
Title: Re: An LCS Remake
Post by: The Cheshire Cat on April 13, 2020, 02:34:06 pm
So.

I have been pretty quiet on this for a while, mainly because I haven't really had anything else to add - I'd gotten it to the point where I felt happy with the state it was in and aside from some small tweaks here and there I haven't really needed to update anything. However, lately I've been feeling like coming back to it and trying to clean up a few more of the tiny little issues that bugged me over the months and have a very minor update that I am working on, nothing super noticeable, just some behind the scenes adjustments to how certain things are calculated.

So since I'm already working on it, I'm curious if there are any features that people might find interesting that I could potentially add to make this update a bit more substantial. The game is already almost at feature parity with the original - if there are any minor things that I'm missing that I've just forgotten about, feel free to point those out, but I'm also curious about broader suggestions that might just make the game better regardless of whether or not the original had it.
Title: Re: An LCS Remake
Post by: SlatersQuest on April 13, 2020, 04:14:48 pm
I'm close to releasing version 2.0 of the TV mod, complete with factions that can be customized with text files. I'm wondering if something similar could be implemented here?  ;)

(I've been wanting to make a TV version of your remake, but not knowing where things are, this would be something I would need to collaborate on)


EDIT: Sorry for blowing my horn so hard. That was arrogant of me. :-[
Title: Re: An LCS Remake
Post by: The Cheshire Cat on April 13, 2020, 04:32:27 pm
I have wanted to try externalizing more data; I haven't played your mod though so I'm not really sure how exactly factions should work. My assumption is that it's something kind of like the CCS where they have their own safehouses and issues that they can push the country towards? That seems like something I could set up definitions for since the CCS behaviour isn't that complex and could be generalized without too much trouble.
Title: Re: An LCS Remake
Post by: SlatersQuest on April 13, 2020, 06:58:29 pm
Factions are a completely new and as of this post unreleased feature; they will be added in 2.0, which I plan to get up as soon as I get the rest of the ground work done and some of the bugs tested.

At the moment, factions can interact with each-other but don't directly interact with the player. Eventually I plan to add functionality such that they behave more like the CCS with safehouses of their own, yes.
Title: Re: An LCS Remake
Post by: EuchreJack on April 21, 2020, 02:50:28 pm
Glad to hear development continues.  I was actually looking to see if there was an update a few weeks ago.
Title: Re: An LCS Remake
Post by: varsens on August 17, 2020, 05:12:04 am
Whenever I click the movement buttons or use the arrow keys I immediately leave the location rather than move in the intended direction so that the game is effectively unplayable. I realize that I must be doing something goofy but can't figure out what it is. Any help would be much appreciated.  Playing on a new laptop with win10.
Title: Re: An LCS Remake
Post by: The Cheshire Cat on August 17, 2020, 03:54:25 pm
Hmm, that was an issue a while ago during development but I'm not sure why it would only be hitting you - it's kind of an all or nothing thing. Are you running the most recent version? It should say "version: b12" in the bottom left corner of the title screen if you are.

It's possible there might be some weirdness with how input is handled in win10 or by your laptop but again if it's a win10 thing I would expect more people would be having that issue. Does the output log have any exceptions in it? You can find it in C:\Users\(your windows username)\AppData\LocalLow\Lazy Dog Software\LCS. It will only have data from your most recent play session so you'd need to boot it up and reproduce the issue and then quit.
Title: Re: An LCS Remake
Post by: Little on September 14, 2020, 05:54:38 pm
Notes:

Someone is passing by," passing is spelled as pasing. Could use some periods in the start options text. General proofreading.
Doesn't seem to be a way to adjust interrogation options?
Talking to people could be more streamlined.

Still great that this exists and would love to see more development in the future.
Title: Re: An LCS Remake
Post by: The Cheshire Cat on September 14, 2020, 08:22:59 pm
Interrogation is different from the base version - instead of choosing every single time, you select it by going to the hostages on the safe house tab and selecting the hostage. Then your interrogators will just repeat whatever tactics you selected until you change them.
Title: Re: An LCS Remake
Post by: ssbob90 on September 14, 2020, 09:51:30 pm
I would like it if you can add in we didn't start the fire and nightmare mode
Title: Re: An LCS Remake
Post by: Little on September 15, 2020, 05:49:19 pm
Police don't disassemble your safehouses anymore, would be nice to see that back in.
Title: Re: An LCS Remake
Post by: The Cheshire Cat on September 15, 2020, 07:41:02 pm
They will, but only in the situation where you had liberals at the base and surrendered (or tried to fight and lost). If they raid an empty safehouse they'll confiscate all the items there and recover corpses/hostages but not touch any investments you had. This is consistent with the version I was basing my code on, but looking at the original code it looks like there were stubs in place to make police also dismantle your base when raiding empty safehouses that weren't active in that specific version, so they may have been finished after I'd started working on mine. It would make sense for cops to dismantle all the (illegal) investments in an empty safehouse.

CCS won't capture safehouses in my version, but this was kind of broken in the original as well so that was a conscious decision not to implement it since there's a lot of hackery around CCS bases and how they get captured which wouldn't play well with safehouses that weren't originally owned by them (long story short they need to be a custom map, with a "CCS Boss" tile, or else you can never take them back because killing the boss is what triggers the capture).
Title: Re: An LCS Remake
Post by: SlatersQuest on September 16, 2020, 11:18:26 am
The newest edition of the TV mod has CCS-controlled safehouses capturable.
Title: Re: An LCS Remake
Post by: Basilleus on December 17, 2020, 11:18:57 pm
Will nightmare mode be available? Is the CCS going to be active? Will you be able to raid the White House?
Title: Re: An LCS Remake
Post by: The Cheshire Cat on December 18, 2020, 01:08:25 am
Nightmare mode isn't currently available (but it's fairly easy to modify the save file to set all laws to -2 if you really want it). The CCS is already active - they will start taking action once the country has partially liberalized. The White House is not in since it didn't really work in the version I was basing mine off of and I was trying to stick with things that were 100% complete to port over to this one (this is also why I didn't include the Stalinist Crime Squad option).
Title: Re: An LCS Remake
Post by: Kait on March 04, 2021, 01:04:25 pm
I've got a black screen when i try to load my save.
Here's what i got if i press F2.

(https://i.imgur.com/bc3FnYb.png)

Any way to save my save ?
Title: Re: An LCS Remake
Post by: The Cheshire Cat on March 04, 2021, 02:38:23 pm
Unfortunately my in-game debug logs aren't very helpful for diagnosing save issues (they are more for active testing purposes). If you go to C:\Users\(Your Username)\AppData\LocalLow\Lazy Dog Software\LCS, you'll find an output_log.txt file and the save file itself - if you upload those somewhere I can take a look to see what the issue might be.
Title: Re: An LCS Remake
Post by: Kait on March 04, 2021, 02:54:48 pm
Thank for your quick answer.
(Awesome work by the way, it's so much better to play LCS this way IMO !) 

https://www.dropbox.com/s/fp46ye8bx8huw79/save_log.zip?dl=0
Here's my save file and the log. Thank you in advance to take a look.  :)

Title: Re: An LCS Remake
Post by: The Cheshire Cat on March 04, 2021, 03:06:10 pm
I've found the problem and should be able to get a fix out later today that should recover your save - the issue is that it's having a problem trying to load the portrait information for a guard dog you've recruited, because I forgot when setting up that logic that guard dogs don't have generated portraits, so it's trying to process a bunch of null values into numbers.
Title: Re: An LCS Remake
Post by: The Cheshire Cat on March 04, 2021, 03:51:32 pm
I've posted an updated version on the Itch page that fixes the issue, you should be able to load the save after downloading the new version.
Title: Re: An LCS Remake
Post by: Kait on March 04, 2021, 03:54:56 pm
It worked !
Thank you a lot, that was fast.  :)
Title: Re: An LCS Remake
Post by: Kait on March 05, 2021, 06:34:02 pm
Sorry, me again.

Every time I engage combat in a siege, whether I win or lose, the game get stuck.

The ingame log:
(https://i.imgur.com/zpVHTeD.png)

The outpot log :
Spoiler (click to show/hide)

If anyone got any idea how to fix it, thanks a lot !

EDIT :  Well actually if every Liberals die I'm not stuck on this screen.
Title: Re: An LCS Remake
Post by: The Cheshire Cat on March 05, 2021, 07:09:57 pm
Hmm, it looks like there's a few issues going on there and honestly I probably need to dissect the handling of siege escapes a bit more overall to debug it. It's something I put together a while ago and was very hacky so likely some of those hacks are leading to issues in the turn processing order.
Title: Re: An LCS Remake
Post by: The Cheshire Cat on March 06, 2021, 12:07:47 am
I've just published a new version which should hopefully resolve your issue - the siege/chase logic is a real snarl so I'm not 100% confident it will work perfectly but it should at least avoid the softlock issue.
Title: Re: An LCS Remake
Post by: Little on August 14, 2022, 05:00:49 am
Saw you posted a minor bugfix update, stoked you're still working and tinkering on this.
Title: Re: An LCS Remake
Post by: The Cheshire Cat on August 21, 2022, 03:36:06 pm
I am mostly only doing updates when someone suggests something or has a bug issue - I don't really have any active plans to add new features but I'm still keeping an eye on things and tackling any problems people might report.
Title: Re: An LCS Remake
Post by: Laterigrade on August 31, 2022, 08:24:40 pm
Praise the coder! You’ve done good work.