Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 14 15 [16] 17 18 ... 23

Author Topic: LCS 4.12.68  (Read 239139 times)

IsaacG

  • Bay Watcher
  • Mad Engineer
    • View Profile
    • JJoseph on Deviantart
Re: LCS 4.12.33 Now With a Save Editor (And other flags... sort of)
« Reply #225 on: February 02, 2019, 01:36:20 pm »

You've moved a lot of things around in the code, but you should really be focusing on moving things out of the code.
That is the goal.  Back in Nov 1, 2017, 4.12.04 I introduced 196 external files of formerly hard-coded data.
I've mixed feelings about a string:string mapping system.  Typos can bungle things up real fast, I'll have to include a fail-fast setup where if a new creature/weapon/etc. is created, but has no way to spawn in-game, it autogenerates a warning.  Maybe even refuses to load.  My experience with modding, spending more time trying to spawn my new armor than I spent making it.

'cuz if I want to build it, I have to research it.  But to research it I have to mod in a new research category for the new equipment, then I have to add it to the list of items that can be manufactured at the heavy-armor smithing station, and then I have to calculate the influence quality levels have on the final product even though I don't want it to have quality levels to begin with.  And then, even though I copied the texture straight from Samurai Armor, it spawns without an inventory icon, and whenever someone wears it it appears on the character in solid white, but Samurai Armor isn't solid white, despite this being a line-for-line copy of Samurai Armor.  Then the game crashes whenever I have a Shek player character try on the pants, so I upload to the Steam workshop version 0.4 where Shek aren't able to wear the modded pants.  It wouldn't be so bad, but the game map is enormous, and starting up the game requires loading the entire map, so there's no fast way to test minor changes.  Still, it's the easiest, most intuitive modding system I've ever used.
Whatever you do, strongly avoid any desire to add new features. Turn code into external data, and let others play with the data to make mods. This is your most efficient way forward.
Absotively
For the naming convention, I think adding in some prefixes for the cpp file and function name that use the strings would be advisable. It would make things much clearer than just "WILL_STEAL" since you've now removed the semantic information that this had something to do with "sleepers", which makes it less clear what the string is intended to be for. For example, if the "WILL_STEAL" string is used in sleepers.cpp by a function called actions (for example), you could name it "SLEEPERS__ACTIONS__WILL_STEAL". So, just be reading the name you can tell where to look for uses of that string (note the double-underscore between parts of the name to clarify what's what).
Valid consideration.  The context information is valuable, but I do not believe it should be tied to cpp filenames.  The whole file structure is based off C style procedural programming.  e.g. The code that determines news headlines is the same code that transfers those headlines to the screen.
It leads to a fair amount of redundancy and duplicate code.  Just separating these from one another has drastically reduced filesizes.
Ideally, the code that generates the string "X reaches to find xer head missing." doesn't know or care whether it's being used by the sleeper prompt, combat log, or news headline.  There are about six thousand lines of hard-coded text still remaining in LCS.  The data structure that will hold these will probably be grammar based.
After that, make it so that it reads the string:string mappings from a JSON file, and translators can then just mod a text file to make language-specific full conversions, no compile needed.

However, when that happens, I'd suggest sill maintaining a hard-coded list of "known" strings in the code (by their "name"), which the JSON-strings get loaded against. Then, each code-type mod can maintain their own list of known strings, and there could be a command-line option to just spit out the "list of strings" (e.g. "lcs -dumpstrings") that each variant of the game needs. This would allow translators to pull out a list of all the strings they need to implement for each and every mod that is compliant with the system. e.g. if Terra Vitae mod was adapted, then any translator could just spit out a list of strings needed for Terra Vitae mod and start adapting their translation to Terra Vitae without looking at the source code whatsoever.
That is a very good idea.  I almost want to go back and remove what I said about string:string mapping.
I'm going to try to make that a reality.
Logged
LCS 4.12 Thread
https://discord.gg/HYbss8eswM
Quote
Many people, meeting Aziraphale for the first time, formed three impressions: that he was English, that he was intelligent, and that he was gayer than a tree full of monkeys on nitrous oxide.
Constitution of the Confederate States
Article I Sec. 9 4
No bill of attainder, ex post facto law, or law denying or impairing the right of property in negro slaves shall be passe

Azerty

  • Bay Watcher
    • View Profile
Re: LCS 4.12.33 Now With a Save Editor (And other flags... sort of)
« Reply #226 on: February 02, 2019, 03:58:01 pm »

It could make the work easier for translators.
Logged
"Just tell me about the bits with the forest-defending part, the sociopath part is pretty normal dwarf behavior."

Reelya

  • Bay Watcher
    • View Profile
Re: LCS 4.12.33 Now With a Save Editor (And other flags... sort of)
« Reply #227 on: February 02, 2019, 08:05:40 pm »

I'm going to try to make that a reality.

Actually, I just remembered something about stringification macros. You can have the strings but keep the benefits of having enums if you like. There are various approaches to that.

This is one way to do it, which I'd recommend since it's straightforward and doesn't use any bleeding edge C++14 trickery that nobody will understand:

http://www.jakeshirley.com/2014/11/

In this example, you have an input file, the example given is this:
Code: [Select]
FRUIT(Banana)
FRUIT(Apple)
FRUIT(Strawberry)
FRUIT(Pineapple)
FRUIT(Snozberry)

The trick here is that each CPP file is free to define the macro "FRUIT" any way they like. e.g. this file creates a fruit enum:

Code: [Select]
// Fruit Enum
#define FRUIT(x) x,
enum Fruit
{
#include "FruitDeclarations.h"
  Count
};
#undef FRUIT

And this file creates an array of fruit strings:

Code: [Select]
// Fruit Strings
#define FRUIT(x) #x,
const char *FruitStrings[] = {
#include "FruitDeclarations.h"
  "Invalid"
};
#undef FRUIT
 

... you can see where this is going. You get the benefit of still using the enums for the hard-coded parts, which ensures that compile-time checking picks up typos, but you get all the strings for the tokens auto-generated, to match, at compile time, so they can be spit out by the program and also used for parsing a translation file.

To make this approach work for LCS, you'd need to refactor in several steps
 
first you need to get rid of the individually named strings in favor of an array referenced via enums. To make that easier, you can use a std::map (what follows is entirely pseudocode so YMMV)

So, you have the list of enums:

enum string_tokens =
{
  WILL_STEAL,
  WILL_EMBEZZLE,
  (etc)
}

and a map

std::map string_values =
{
    {WILL_STEAL, "String for will steal"},
    {WILL_EMBEZZLE, "String for will embezzle"}
    {etc, etc}
}

Note, that all direct accesses to these string literals must now be passed through the map lookup, but preferably through a new function to keep the boiler-plate to a minimum.

However, this part could be touchy since you'll need to convert every call to drawing the strings directly into a call to the "lookup the needed string" function. If they're not all changed, it could try and print out the numerical value of the enums and not the strings. So, if you're going to rename the tokens, this would be the point at which to do it, to ensure the compiler picks up everywhere you need to change to the new string-lookup-function.

After this is achieved, then the code can be refactored again using the code from the FRUIT example given above: make a separate file called string_tokens.h and move all the enum names in there written as:

S(WILL_STEAL) 
S(WILL_EMBEZZLE) 
etc
(calling the macro "S" will minimize the boiler plate. I'm hoping to find better methods that will do away with the need for the S-macros completely, which I believe exist but can't find).

After that, the game can be modded so that it also generates the string array from this file (as shown in the FRUIT example) and at run-time it then looks for translation files, and parses them against the keys, over-writing any string in the map which matches a key. This would allow anything from partial fixes/mods to complete text rewrites for users without compiling. Also, a benefit for the main developers: if someone reports a typo, there's no need to recompile, merely have a typo-fixing translation file that's pulled in before any other translation file, and you can issue short-term patches without needing recompilation. Typos would then be folded into the code once the next code version is released.

Another benefit of having all the string literals in a map or table is that you can write a function to dump out all the moddable text from the game at runtime, for example, a "-dumpstrings" command-line option, but it can be expanded with a few sub-parameters to expand the usefulness. Here are some ideas about how that could work:

LCS -dumpstrings // dump all tokens and current strings (after translation)
LCS -dumpstrings changed // only dump ones where a file changed the string
LCS -dumpstrings not-changed // only dump ones that were not changed by a file
LCS -dumpstrings default // dump the original/default strings - would stack with changed/not-changed
LCS -dumpstrings tokens // only dump token names - again, would stack with changed/not-changed
LCS -dumpstrings both // show tokens, plus both default and translated strings.

I think that set of command line parameters relating to the strings would give people all the tools they need to quickly see what needs to be updated if the version changes and they're working on a language / mod.
« Last Edit: February 02, 2019, 09:05:39 pm by Reelya »
Logged

IsaacG

  • Bay Watcher
  • Mad Engineer
    • View Profile
    • JJoseph on Deviantart
Re: LCS 4.12.34 Now With a Save Editor (And other flags... sort of)
« Reply #228 on: February 13, 2019, 07:04:43 am »

X    Encounter warnings no longer work
X    Some people you encounter in neutral places (e.g the apartment buildings) cannot be talked to but instead have an option to "release oppressed". Doing so in front of others alerts conservatives but doesn't actually count as having caused a crime (as checked by inspecting a liberal's status after doing so.
X- When the Liberal Guardian publishes a news story about my valiant actions, the LCS is referred to as the CCS in the article text.
X- Got a feature in one my newspaper reports which tells me I've found a bug: https://imgur.com/a/G615ez9. This also shows what I mean in point 4 where my troops are called the CCS
Fixed in 4.12.34

The sell option at the pawn shop is not on the menu of possible actions, but can still be accessed by pressing "s"
This one is already in 4.10, so it predates my involvement :D
Not sure how to fix it.

- Potential recruits, through dating and meetings, often turn up naked when you'd expect them to be clothed - this is however rather funny if you imagine LCS takes place in a nudist USA.
- At the IT cafe site, the CPUs never actually spawn with people using them. When you walk up to a computer and the game prompts "The Computer is occupied" no one is ever actually there.
:'(
These have come up before.
- When liberals are sentenced, it sometimes doesn't tells you the result. It will say "The jury leaves to discuss..." but doesn't show the result. I find this is more common with innocent verdicts.
- The display for vehicles is broken for me. I cannot see more than one car on my vehicles screen.
Reprinting as a self-reminder.
Logged
LCS 4.12 Thread
https://discord.gg/HYbss8eswM
Quote
Many people, meeting Aziraphale for the first time, formed three impressions: that he was English, that he was intelligent, and that he was gayer than a tree full of monkeys on nitrous oxide.
Constitution of the Confederate States
Article I Sec. 9 4
No bill of attainder, ex post facto law, or law denying or impairing the right of property in negro slaves shall be passe

Bill Chompski

  • Bay Watcher
    • View Profile
Re: LCS 4.12.34 Now With a Save Editor (And other flags... sort of)
« Reply #229 on: February 27, 2019, 02:22:27 am »

I dunno if this is a problem to bring up here, but whenever I try to buy masks at the oubliette, the game crashes
but other than that, it's been smooth as butter
oh yeah, and I can't buy/upgrade hideouts anymore. is this a new thing, or can I just not figure it out?
« Last Edit: February 27, 2019, 03:59:33 pm by Bill Chompski »
Logged

IsaacG

  • Bay Watcher
  • Mad Engineer
    • View Profile
    • JJoseph on Deviantart
Re: LCS 4.12.34 Now With a Save Editor (And other flags... sort of)
« Reply #230 on: February 28, 2019, 03:07:16 am »

I dunno if this is a problem to bring up here, but whenever I try to buy masks at the oubliette, the game crashes
Happens on my end, too.  Will fix for 4.12.35
but other than that, it's been smooth as butter
oh yeah, and I can't buy/upgrade hideouts anymore. is this a new thing, or can I just not figure it out?
I'm not sure the exact requirements, but you should get a screen like this if a location can be upgraded.  Press Z to cycle between locations.  If upgrades are possible, "I - Invest in this location" should appear.
Code: [Select]
Smith Auto Insurance, Jan. 1, 2013                                Money: 219537

 You are not under siege...  yet.

 FORTIFIED COMPOUND            PRINTING PRESS         BUSINESS FRONT
 CAMERAS ON     BOOBY TRAPS      AA GUN       TANK TRAPS     GENERATOR
 1774 Daily Rations           32 Eating           55 Days of Food Left

 I - Invest in this location               TAB - Next Squad   Z - Next Location
Doesn't apply to apartments or homeless shelters.
Logged
LCS 4.12 Thread
https://discord.gg/HYbss8eswM
Quote
Many people, meeting Aziraphale for the first time, formed three impressions: that he was English, that he was intelligent, and that he was gayer than a tree full of monkeys on nitrous oxide.
Constitution of the Confederate States
Article I Sec. 9 4
No bill of attainder, ex post facto law, or law denying or impairing the right of property in negro slaves shall be passe

IsaacG

  • Bay Watcher
  • Mad Engineer
    • View Profile
    • JJoseph on Deviantart
Re: LCS 4.12.35 Now With a Save Editor (And other flags... sort of)
« Reply #231 on: February 28, 2019, 03:37:21 am »

I dunno if this is a problem to bring up here, but whenever I try to buy masks at the oubliette, the game crashes
Fixed in 4.12.35
« Last Edit: March 08, 2021, 05:22:29 am by IsaacG »
Logged
LCS 4.12 Thread
https://discord.gg/HYbss8eswM
Quote
Many people, meeting Aziraphale for the first time, formed three impressions: that he was English, that he was intelligent, and that he was gayer than a tree full of monkeys on nitrous oxide.
Constitution of the Confederate States
Article I Sec. 9 4
No bill of attainder, ex post facto law, or law denying or impairing the right of property in negro slaves shall be passe

OzgeKatip

  • Escaped Lunatic
    • View Profile
Re: LCS 4.12.35 Now With a Save Editor (And other flags... sort of)
« Reply #232 on: March 09, 2019, 06:25:51 am »

Greetings, fellow Liberals, I'd like to thank first of all the people involved in maintaining this game updated. The versatility of the gameplay is quite something, and quite literally enlightening. Both the wiki and the forum (which I had lurked until now) provide useful information whenever I am puzzled this or there as well.

Unfortunately, I do have to come out of the lurking to raise the following issue, for which I have been unable to find proper answers through a comprehensive search of both this thread and the forum. I have been playing with 4.12.35 on Windows 10.

The attribute growth system does not seem to work for me as described in both the src, wiki and various forum replies: as my liberals rank up, the only thing that seems to increase is their Wisdom (+1 per rank), and none of their other attributes, even those high enough (>=10) to begin with.
This happens in both Music and non-Music versions, with and without various mutators such as National NCS and Nightmare Mode, with and without verbose save files enabled, with and without more random RNG generation. My default text viewing software is Sublime Text 3, in case this information would be relevant as well.
I am posting here, provided it is appropriate to do so, the link for a OneDrive repository of my current game (National, non-verbose) with its Day 1 save and where I left it off, if it may help further. https://1drv.ms/f/s!AlSOGMp-z9qEhMVPH_9dOzUl14tBlQ

Have a Liberal day/night everybody!
Logged

IsaacG

  • Bay Watcher
  • Mad Engineer
    • View Profile
    • JJoseph on Deviantart
Re: LCS 4.12.36 Now With a Save Editor (And other flags... sort of)
« Reply #233 on: March 09, 2019, 04:39:36 pm »

Greetings, fellow Liberals, I'd like to thank first of all the people involved in maintaining this game updated. The versatility of the gameplay is quite something, and quite literally enlightening. Both the wiki and the forum (which I had lurked until now) provide useful information whenever I am puzzled this or there as well.

Unfortunately, I do have to come out of the lurking to raise the following issue, for which I have been unable to find proper answers through a comprehensive search of both this thread and the forum. I have been playing with 4.12.35 on Windows 10.

The attribute growth system does not seem to work for me as described in both the src, wiki and various forum replies: as my liberals rank up, the only thing that seems to increase is their Wisdom (+1 per rank), and none of their other attributes, even those high enough (>=10) to begin with.
This happens in both Music and non-Music versions, with and without various mutators such as National NCS and Nightmare Mode, with and without verbose save files enabled, with and without more random RNG generation. My default text viewing software is Sublime Text 3, in case this information would be relevant as well.
I am posting here, provided it is appropriate to do so, the link for a OneDrive repository of my current game (National, non-verbose) with its Day 1 save and where I left it off, if it may help further.

Have a Liberal day/night everybody!
Fixed in 4.12.36

I should have known this bug would come back to bite me.  The interrogation stat-growth bug.  But I was wrong, it wasn't that one.  High levels of juice boost stats, but there's a safeguard to prevent liberals from gaining wisdom and conservatives from gaining heart from juice.  That safeguard was reversed, so liberals ONLY got boosts to wisdom from juice, and conservatives heart.  Oddly poetic, if I'm being honest.  Almost makes me wish it was intentional.

Because of the way stats are stored in LCS, you can use the same savefile without issue.
Ozge Katip:
Heart: 20
Int: 14
Wis: 1
Hea: 17
Agi: 14
Str: 12
Cha: 20
Rather serious boost from the start.
« Last Edit: March 08, 2021, 05:22:55 am by IsaacG »
Logged
LCS 4.12 Thread
https://discord.gg/HYbss8eswM
Quote
Many people, meeting Aziraphale for the first time, formed three impressions: that he was English, that he was intelligent, and that he was gayer than a tree full of monkeys on nitrous oxide.
Constitution of the Confederate States
Article I Sec. 9 4
No bill of attainder, ex post facto law, or law denying or impairing the right of property in negro slaves shall be passe

ShinQuickMan

  • Bay Watcher
  • Resident Mook
    • View Profile
Re: LCS 4.12.36 Now With a Save Editor (And other flags... sort of)
« Reply #234 on: March 20, 2019, 09:09:32 am »

Seems like there's some errors with character creation. Choosing to have a lawyer contact also gives $1000 bucks as a bonus. Furthermore, starting as a college student also grants the founder a team of armed gangsters, much like with the criminal.

EDIT: Things are a bit more confounding than it first seemed. I think whenever you make a choice for the founder's background, they gain many of the benefits of both the chosen option and the preceding one (wrapping around to E when choosing A). This definitely grants equipment, cash, skills, and personnel from both options, though attribute bonuses and starting location seems to be unchanged.

EDIT2: Correction. Some choices seem to double bonuses, and there are one or two options that do indeed give more attributes than accounted for. An example starter I just made with choices C-C-C-A-A-E-A-E-D-C (generally a super-intelligent college student) began with, among other things:

  • Strength and health one point higher than expected, and charisma two points higher
  • Two points in seduction, and one point in psychology, both unaccounted for
  • Eight points in teaching (twice as much as expected!), and six points in writing (one and a half times greater than expected)
  • An extra grand in addition to a lawyer sleeper
  • Everything a college student starts with, plus four armed gang members
« Last Edit: March 20, 2019, 10:29:00 am by ShinQuickMan »
Logged

Taberone

  • Bay Watcher
    • View Profile
Re: LCS 4.12.36 Now With a Save Editor (And other flags... sort of)
« Reply #235 on: March 20, 2019, 09:52:17 pm »

Furthermore, starting as a college student also grants the founder a team of armed gangsters, much like with the criminal

  • Everything a college student starts with, plus four armed gang members

The thought of a college student having a gang with him is amusing. This is also an interesting glitch, too. An "easy mode" LCS start.
Logged

Azerty

  • Bay Watcher
    • View Profile
Re: LCS 4.12.36 Now With a Save Editor (And other flags... sort of)
« Reply #236 on: March 21, 2019, 02:32:04 pm »

Furthermore, starting as a college student also grants the founder a team of armed gangsters, much like with the criminal

  • Everything a college student starts with, plus four armed gang members

The thought of a college student having a gang with him is amusing. This is also an interesting glitch, too. An "easy mode" LCS start.

IRL, the Weather Underground was formed by Students for a Democratic Society members.
Logged
"Just tell me about the bits with the forest-defending part, the sociopath part is pretty normal dwarf behavior."

ShinQuickMan

  • Bay Watcher
  • Resident Mook
    • View Profile
Re: LCS 4.12.36 Now With a Save Editor (And other flags... sort of)
« Reply #237 on: March 21, 2019, 07:35:14 pm »

Dunno if it's intentional or otherwise, but persuasion is significantly more difficult to use early on. Even crackheads won't be moved if the speaker isn't at least moderately skilled (like skill level 5+ in persuasion). I could only manage to get results when I had someone with an expensive suit, 10+ charisma and intelligence, and a few points in persuasion/science/religion/business/law.
« Last Edit: March 21, 2019, 08:23:52 pm by ShinQuickMan »
Logged

IsaacG

  • Bay Watcher
  • Mad Engineer
    • View Profile
    • JJoseph on Deviantart
Re: LCS 4.12.36 Now With a Save Editor (And other flags... sort of)
« Reply #238 on: March 21, 2019, 11:05:13 pm »

Seems like there's some errors with character creation. Choosing to have a lawyer contact also gives $1000 bucks as a bonus. Furthermore, starting as a college student also grants the founder a team of armed gangsters, much like with the criminal.

EDIT: Things are a bit more confounding than it first seemed. I think whenever you make a choice for the founder's background, they gain many of the benefits of both the chosen option and the preceding one (wrapping around to E when choosing A). This definitely grants equipment, cash, skills, and personnel from both options, though attribute bonuses and starting location seems to be unchanged.

EDIT2: Correction. Some choices seem to double bonuses, and there are one or two options that do indeed give more attributes than accounted for. An example starter I just made with choices C-C-C-A-A-E-A-E-D-C (generally a super-intelligent college student) began with, among other things:

    ...
Day I get back from vacation, and here is a highly detailed, clearly written bug report.
It must be my birthday.

Actually, my birthday is tomorrow.  Fascinating coincidence.

Edit: Amusing coincidence, anyway.

I'll get right on it.

Dunno if it's intentional or otherwise, but persuasion is significantly more difficult to use early on. Even crackheads won't be moved if the speaker isn't at least moderately skilled (like skill level 5+ in persuasion). I could only manage to get results when I had someone with an expensive suit, 10+ charisma and intelligence, and a few points in persuasion/science/religion/business/law.

I'll get right on this as well.
« Last Edit: March 21, 2019, 11:08:15 pm by IsaacG »
Logged
LCS 4.12 Thread
https://discord.gg/HYbss8eswM
Quote
Many people, meeting Aziraphale for the first time, formed three impressions: that he was English, that he was intelligent, and that he was gayer than a tree full of monkeys on nitrous oxide.
Constitution of the Confederate States
Article I Sec. 9 4
No bill of attainder, ex post facto law, or law denying or impairing the right of property in negro slaves shall be passe

Ikaruga

  • Bay Watcher
    • View Profile
Re: LCS 4.12.36 Now With a Save Editor (And other flags... sort of)
« Reply #239 on: March 22, 2019, 07:15:24 am »

Hi,

Happy birthday, Isaac ! :D

I noticed a bug : it is still possible to sell stuff in the pawn shop but the option doesn't appear on screen ...

Also, in nightmare mode, not everything is for sale in TheOubliette. Sometimes, just a mask, sometimes work clothes... Is it normal ?
Logged
Pages: 1 ... 14 15 [16] 17 18 ... 23