Bay 12 Games Forum

Please login or register.

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

Author Topic: Procedural String Support (Custom NewGame and Custom Pickup Lines!)  (Read 2657 times)

IsaacG

  • Bay Watcher
  • Mad Engineer
    • View Profile

Now anyone can customize pickup lines, the battle text, name generation, all sorts of stuff (that has no direct impact on gameplay).  Also newgame, which has impact on gameplay.
Also, Updated so 4.12 is on GitHub
https://github.com/King-Drake/Liberal-Crime-Squad


(includes source and a Visual Studio 2015 workspace)
Experimental (and crazy buggy):
http://www.mediafire.com/file/3a1890vmjbpi3zu/v4.11.2+Custom+Newgame.zip
(includes source and a Visual Studio 2015 workspace)
Stable: 150 MB
http://www.mediafire.com/file/hw6gkrbmktvof53/LCS+v4.12+STABLE.zip
(includes source and a Visual Studio 2015 workspace)
Stable w/o Source Code: 75 MB
http://www.mediafire.com/file/pbedi1gj4699022/LCS+v4.12+STABLE+no+src.zip

Stable w/o Source Code and Without Music: <10 MB
http://www.mediafire.com/file/d9ut1a4uawsuc3p/LCS+v4.12+STABLE+no+music.zip


Custom NewGame!  You know those ten questions at gamestart?  Change them however the heck you want, mostly.  Change the starting year, founder's birthday, all stats and skills, allows adding, subtracting, and resetting, money, juice (just not armor).  All just by changing newgame/founderQuestions.txt and no recompiling.

Custom Pickup Lines!  All 47 vanilla pickup lines have been extracted to an external file that is scanned on execution.  Swap out the old easily, or make new ones entirely.
Additionally, most battle messages, courtroom dialogue, and about every string that's selected at random in the vanilla game is customizable without recompiling.
Also, news articles!  There, there are a lot of those.  Roughly a third of the data files correspond to those...

The 196 files of custom strings have been sorted into 15 folders placed inside the art folder.
.\defaultSlogans.txt (change the default slogans, but that only activates once in 20 anyway)
activities (mostly have to do with personnel descriptions and hotwiring cars)
chase (mostly car chase stuff)
creature (customize the names of Hicks and CCS members!)
date
fight (combat messages, mostly)
interrogation (almost everything pertaining to interrogation)
justice (juries and prison life)
locations (customize the names of everything from vegan co-ops to forced labor camps)
majorevent (news article customization)
names (all names generated at random, including city names)
siege (Mostly random generated news programs, which was in siege.cpp for some reason)
stealth
talk (pickup lines, conversion attempts, bank robbing)
talk_combat (mostly hostage stuff)
titlescreen (the quote that generates on game start)

And the coup de grace:
newgame\founderQuestions.txt
Customize the questions at the start of the game!  Allow anywhere from 1~10 answers per question, with as many in game impacts (mostly stat and skill for the founder, but also starting funds, birthday, even starting year!)  Allow as many questions as you want.

Forked from (and attempting to merge to):
4.10 (Augmentation)
https://github.com/Kamal-Sadek/Liberal-Crime-Squad

2016 11 27 Update:
I added in easy_compile mode.  A while back I removed the externs.h and includes.h files, well easy_compile mode adds them back in, for all but about ten files that I changed too much to easily reinclude it.
Thus on a file by file basis, most of my changes can be migrated to 4.10 (Augmentation) without issue.

2016 12 29 Update:
I rolled back my changes.  All that "enumerators are our friends" and "externs.h is the enemy", while true in spirit, isn't worth introducing a whole mess of bugs to implement.  The only changes now are the ones that I keep talking about.  Custom pickup lines, custom newgame, custom cities, custom names, etc.  Customize to your heart's content without needing to recompile!
« Last Edit: March 01, 2017, 03:11:40 pm by IsaacG »
Logged
Procedural String Support (Custom NewGame and Custom Pickup Lines!)

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.

Akumetsu: it's pretty much Liberal Crime Squad in comic book form.

Taberone

  • Bay Watcher
    • View Profile
Re: Procedural String Support (... Again)
« Reply #1 on: July 21, 2016, 12:21:35 am »

Does this mean that I'll finally be able to do things like editing combat messages, car chase messages, nerf Secret Service agents always seeing through disguises, etc without having to recompile, and that there will be less hardcoded stuff in LCS? Having creature weapons be hardcoded because that creature is affected by weapon laws when you could just do <WeaponAtLawX>WEAPON_SEMIPISTOL_9MM</WeaponAtLawX> instead(rather than hardcoding) is frustrating.
« Last Edit: July 21, 2016, 12:23:47 am by Taberone »
Logged

IsaacG

  • Bay Watcher
  • Mad Engineer
    • View Profile
Re: Procedural String Support (... Again)
« Reply #2 on: July 21, 2016, 03:27:17 am »

Does this mean that I'll finally be able to do things like editing combat messages, car chase messages, nerf Secret Service agents always seeing through disguises, etc without having to recompile, and that there will be less hardcoded stuff in LCS? Having creature weapons be hardcoded because that creature is affected by weapon laws when you could just do <WeaponAtLawX>WEAPON_SEMIPISTOL_9MM</WeaponAtLawX> instead(rather than hardcoding) is frustrating.
Combat messages and car chase messages, yes.  Nerf secret service agents seeing through disguises, no.  I'd need to be more familiar with the code to even attempt that.
That weapon law thing, I hadn't even thought of that, but that seems like something that is doable.
First up is the messages, though.  Those are about as straight forward as it gets.
Logged
Procedural String Support (Custom NewGame and Custom Pickup Lines!)

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.

Akumetsu: it's pretty much Liberal Crime Squad in comic book form.

SlatersQuest

  • Bay Watcher
    • View Profile
Re: Procedural String Support (... Again)
« Reply #3 on: July 23, 2016, 11:45:15 pm »

This is an interesting idea, but will be a great deal of work and require some tricky design decisions. For example, there are a lot of instances where the in-game text refers to the character, the location, the laws, etc. For example, when you refer to the courthouse, is it the courthouse (death penalty laws L+ to C) or the Hall of Ultimate Judgement (C+)?
Logged

IsaacG

  • Bay Watcher
  • Mad Engineer
    • View Profile
Re: Procedural String Support (... Again)
« Reply #4 on: July 24, 2016, 01:33:10 am »

This is an interesting idea, but will be a great deal of work and require some tricky design decisions. For example, there are a lot of instances where the in-game text refers to the character, the location, the laws, etc. For example, when you refer to the courthouse, is it the courthouse (death penalty laws L+ to C) or the Hall of Ultimate Judgement (C+)?

This is part of why I dropped it last time, as I didn't have the expertise necessary to answer that.
Currently I plan to have it use either XML or custom escape characters.  I'm leaning towards the latter, like every time the string "\S" appears, the game will replace it with the LCS slogan.
There are definitely specific instances of greater difficulty, such as the various words that get replaced when free speech is especially low, or like the CEO code that rejects seduction attempts based on the seducer's gender.  These especially specific cases are where I expect to find the greatest difficulty, but many of the simpler cases can be transferred to external files first.

tl;dr
Long term there are quite a few changes, but right now I'm focusing on custom messages that rely on little or no internal logic, such as the pickup lines (excluding when CEOs are involved).
Logged
Procedural String Support (Custom NewGame and Custom Pickup Lines!)

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.

Akumetsu: it's pretty much Liberal Crime Squad in comic book form.

IsaacG

  • Bay Watcher
  • Mad Engineer
    • View Profile
Re: Procedural String Support (... Again)
« Reply #5 on: August 19, 2016, 02:38:28 pm »

Quote
on: August 18, 2015

Holy hell, it's been a year and a day (exactly...) since I started this, and I have completed my originally stated goal.
CUSTOM PICKUP LINES!

I've spent the past year learning how to code in C++, and it has been unpleasant.  Self-study is not a course of action I recommend for anything complicated.
Logged
Procedural String Support (Custom NewGame and Custom Pickup Lines!)

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.

Akumetsu: it's pretty much Liberal Crime Squad in comic book form.

IsaacG

  • Bay Watcher
  • Mad Engineer
    • View Profile
Re: Procedural String Support (Custom Pickup Lines, and MORE)
« Reply #6 on: September 04, 2016, 07:27:27 pm »

Updated to include another 35 files.
New custom strings to make custom messages without recompiling.
I also refactored the source code a fair amount, but I am yet to find out the results there.
Logged
Procedural String Support (Custom NewGame and Custom Pickup Lines!)

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.

Akumetsu: it's pretty much Liberal Crime Squad in comic book form.

IsaacG

  • Bay Watcher
  • Mad Engineer
    • View Profile
Re: Procedural String Support (Custom Pickup Lines, and MORE)
« Reply #7 on: September 30, 2016, 11:47:59 am »

DONE!
122 files split into 13 folders.  .exe filesize decreased by several percent.
This is just about all the text data that can be removed safely, moving from hard-coded to freely editable .txt.
As a demonstration for how easy it is, I present Marklar Mode!

http://www.mediafire.com/file/ior81baeabqboxf/v4.10.i+Marklar+Mode.zip

Edit: Whoops, it turns out if you alter the code to make there only be one last name, the game doesn't run.  Marklar Mode works now, but last names aren't all "Marklar".  Whatever, it's a gag mod.
« Last Edit: October 04, 2016, 08:26:57 am by IsaacG »
Logged
Procedural String Support (Custom NewGame and Custom Pickup Lines!)

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.

Akumetsu: it's pretty much Liberal Crime Squad in comic book form.

Taberone

  • Bay Watcher
    • View Profile
Re: Procedural String Support (Custom Pickup Lines, and Marklar Mode!)
« Reply #8 on: September 30, 2016, 09:14:27 pm »

Holy shit. LCS really is being dragged into the modern world kicking and screaming. Thanks, man!
Logged

IsaacG

  • Bay Watcher
  • Mad Engineer
    • View Profile
Re: Procedural String Support (Custom Pickup Lines, and Marklar Mode!)
« Reply #9 on: October 05, 2016, 08:13:10 am »

Holy shit. LCS really is being dragged into the modern world kicking and screaming. Thanks, man!
So far, I've done most of the kicking and screaming, but LCS is having a turn.
Logged
Procedural String Support (Custom NewGame and Custom Pickup Lines!)

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.

Akumetsu: it's pretty much Liberal Crime Squad in comic book form.

IsaacG

  • Bay Watcher
  • Mad Engineer
    • View Profile
Re: Procedural String Support (Custom Pickup Lines, and Marklar Mode!)
« Reply #10 on: October 27, 2016, 12:11:16 pm »

Updated to include 10 more files, mostly building name generation.  Also I moved the populate_from_txt() method to its own file, so I don't have to reopen game.cpp every time I want to add a few new strings.
I think I'm going to work on that "Secret Service Agents see through disguises" thing, try to migrate it out into the XML.
Logged
Procedural String Support (Custom NewGame and Custom Pickup Lines!)

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.

Akumetsu: it's pretty much Liberal Crime Squad in comic book form.

Orlanth

  • Escaped Lunatic
    • View Profile
Re: Procedural String Support (Custom Pickup Lines, and Marklar Mode!)
« Reply #11 on: October 27, 2016, 10:52:34 pm »

Woww what a liberally awesome idea!  :) Would it eventually be possible to expose some more of the game data to modding by XML? I see there are XML files for Creatures and Loot etc (although there is some hardcoding there); other things that would be great to mod would be Activities/Crimes and their associated Juice and Heat values, and possibly Locations with tags referring to the Creatures and Loot encountered there.

« Last Edit: October 30, 2016, 11:00:44 am by Orlanth »
Logged

IsaacG

  • Bay Watcher
  • Mad Engineer
    • View Profile
Re: Procedural String Support (Custom Pickup Lines, and Marklar Mode!)
« Reply #12 on: October 31, 2016, 09:27:19 am »

Woww what a liberally awesome idea!  :) Would it eventually be possible to expose some more of the game data to modding by XML? I see there are XML files for Creatures and Loot etc (although there is some hardcoding there); other things that would be great to mod would be Activities/Crimes and their associated Juice and Heat values, and possibly Locations with tags referring to the Creatures and Loot encountered there.
That is pretty much the goal.
Logged
Procedural String Support (Custom NewGame and Custom Pickup Lines!)

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.

Akumetsu: it's pretty much Liberal Crime Squad in comic book form.

IsaacG

  • Bay Watcher
  • Mad Engineer
    • View Profile
Re: Procedural String Support (Custom Pickup Lines and News Articles!)
« Reply #13 on: November 02, 2016, 12:43:41 pm »

I feel justified in calling this release "4.11".
I've extracted the strings from majorevent.cpp, making the news articles largely customizable.  (64 new files...)
Logged
Procedural String Support (Custom NewGame and Custom Pickup Lines!)

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.

Akumetsu: it's pretty much Liberal Crime Squad in comic book form.

IsaacG

  • Bay Watcher
  • Mad Engineer
    • View Profile
Re: Procedural String Support (Custom Pickup Lines, and Marklar Mode!)
« Reply #14 on: November 27, 2016, 06:56:00 pm »

I added in easy_compile mode.  A while back I removed the externs.h and includes.h files, well easy_compile mode adds them back in, for all but about ten files that I changed too much to easily reinclude it.
Thus on a file by file basis, most of my changes can be migrated to 4.10 (Augmentation) without issue.

The zip contains an image that lists all the files without easy_compile support.
Logged
Procedural String Support (Custom NewGame and Custom Pickup Lines!)

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.

Akumetsu: it's pretty much Liberal Crime Squad in comic book form.
Pages: [1] 2 3