This commit is contained in:
Paul Liverman III 2019-03-07 13:15:06 -08:00
commit cd6c5af141
5 changed files with 315 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
*.lua

15
I am a piece of shit.txt Normal file
View File

@ -0,0 +1,15 @@
Cloaking Device
Flight Deck
Hanger
Cargo Space
Maintenance Supplies
Medbay
Sickbay
Engineering Section
Main Engineering
Medical Hall
Hospital Section
Cryogenic Storage System
Cryogenic Transport Module
Terraforming Module
Habitat

16
ideas.notes.txt Normal file
View File

@ -0,0 +1,16 @@
J3 Cloaking Device
Mk.4 Experimental Ventilator (that would be life support/medical)
J-class Deflector (type of shielding or engine/nav equipment)
Type B2 Coil (weapon? sensor? battery?)
Class 6 Uranium Containment System
S-Type Nuclear Generator
ECM Computer Mark 7
"Intrepid" Warp Manifold
Kelvin-class Reactor
"Machinator" Destructor
AK-Type Radio Sensor
Type Yg Thermal Radiation Disperser
Insulator #423-J
Metallic Compound 7 (armor)
Use a more broad form of generator, then assign properties based on their name.

149
src/main.moon Normal file
View File

@ -0,0 +1,149 @@
G = {}
G.split = (str, pattern=".") ->
tab = {}
for i in string.gmatch str, pattern
table.insert tab, i
tab
grammar = {
brand: { "Intrepid", "Chakra", "Kelvin", "Lotus", "Sovereign", "Chad" }
numeral: { "{digit}", "{digit}{digit}", "{digit}{digit}{digit}" }
Seq: { "{capital}", "{capital}{capital}", "{capital}{letter}", "{capital}{digit}" }
seq: { "{Seq}", "{numeral}" }
mark_: { "Mk.", "Mark ", "Class ", "Type " }
_mark: { "-class", "-Type" }
unique: {
"{Seq}"
"{Seq}{_mark}"
"{mark_}{seq}"
"{brand}{_mark}"
"\"{brand}\""
"\#{numeral}"
"\#{numeral}-{capital}"
"\#{numeral}-{letter}"
}
sensor_: {
"Geometric", "Geographic", "Planteoid", "Surface", "Heat", "Thermal",
"Energy", "Higgs", "Gravity", "G", "Boson", "EM", "Electronic", "Dust",
"Electromagnetic", "Mag", "Radio", "Microwave", "UV", "Infrared", "Gas",
}
_sensor: { "Detector", "Sensor", "Scanner" }
sensor: { "Magnometer", "{sensor_}{_sensor}", "Spectrometer" }
fn_: {
"Cloaking", "Medical", "Ventilation", "Warp", "Containment"--, "Charge"
}
-- _device: { "Device" }
auto: { "Automated", "Automatic", "Computerized" }
adj_: {
"Nuclear", "Experimental", "Augmented", "Emergency", "Active"--, "{auto}"
"Main", "Hardened", "Battle", "Support", "Secondary", "Backup"--, "Lithium"
}
_fn: {
"Generator", "Thruster", "Deflector", "Shield"--, "Hospital", "Infirmary",
"Reactor", "Charger", "Battery", "Capacitor"
}
_suffix: {
"Bay", "Module", "Deck", "Section", "Hall"--, "System"
}
ship: { "Fighter", "Shuttle", "Ship", "Craft", "Parasite", "Pod" }
content_: {
"Uranium", "Radioactive", "Fuel", "Thorium", "Hydrogen", "Helium",
"Deuterium", "Oxygen", "Lithium", "Metallic"
}
item: { "Coil", "Manifold", "Compound" }
}
classes = {
Supply, Colonization, Support, Manufacture, Offense, Command, Recon
}
-- old system had module prefixes and suffixes
ECM Computer #
# Destructor
# # Radiation Disperser
Insulator #
"hanger suffix": { "Hanger", G.unpack "module suffix" }
"{hanger prefix} {hanger suffix}"
"{module prefix} {hanger prefix} {hanger suffix}"
}
}
"sickbay prefix": { "Medical", "Hospital", "Infirmary" }
"sickbay": {
props: { support: true }
blacklist: { "Hospital Facility", "Infirmary Facility"}
{
"Sickbay": 0.05
"{sickbay prefix} {module suffix}"
"{module prefix} Sickbay": 0.05
"{module prefix} {sickbay prefix} {module suffix}"
"{module prefix} Infirmary"
"{module prefix} Hospital"
}
}
"engineering": {
props: { support: true }
"Engineering {module suffix}", "Maintenance {module suffix}",
"{module prefix} Engineering", "{module prefix} Maintenance {module suffix}"
}
"tankage": {
"Fuel Tank", "{module prefix} Fuel Tank"
}
"cargo": {
"Cargo {module suffix}", "Cargo Handling {module suffix}",
"{module prefix} Cargo {module suffix}"
}
"quarters prefix": { "Troop Transport", "Troop Quarters", "Crew Quarters", "Cryogenic" }
"quarters": {
props: { supply: true, colonization: true }
"{quarters prefix}": 0.1
"{quarters prefix} {module suffix}"
"Troop {module suffix}", "{module prefix} Troop {module suffix}"
"{module prefix} Transport", "Transport {module suffix}"
"{module prefix} {quarters prefix}"
"{module prefix} Crew {module suffix}"
"Crew {module suffix}"
}
"magazine type": { "Missile", "Ballistic", "Shell" }
"magazine": {
"{magazine type} Magazine", "{module prefix} Magazine"
"{module prefix} {magazine type} Magazine"
"Magazine {module suffix}", "{module prefix} Magazine {module suffix}"
"{module prefix} {magazine type} Magazine {module suffix}"
}
"geosensor": {
props: { colonization: true, scouting: true }
"{geosensor type} Sensor", "{geosensor type} Sensor {module suffix}"
"{module prefix} {geosensor type} Sensor"
"{module prefix} {geosensor type} Sensor {module suffix}"
}
"terraforming": {
props: { colonization: true }
"Terraforming {module suffix}"
"{module prefix} Terraforming {module suffix}"
"Terraforming System": 0.05
"Terraforming Systems {module suffix}"
"Atmospheric Processing {module suffix}"
"Atmospheric Processing System": 0.05
"Atmospheric Processor"
}
-- continue: cloak, c&c, etc
-- these generics should be available built-ins
"letter": G.split "abcdefghijklmnopqrstuvwxyz"
"capital": G.split "abcdefghijklmnopqrstuvwxyz"\upper!
digit: G.split "0123456789"
symbol: "!@#$%^&*()_+-=[]{}\\|~`'\";:<>,./?"
}

134
src/original.moon Normal file
View File

@ -0,0 +1,134 @@
G = {}
G.split = (str, pattern=".") ->
tab = {}
for i in string.gmatch str, pattern
table.insert tab, i
tab
local grammar
grammar = {
"module prefix": { "Automated", "Emergency", "Advanced", "Main", "Hardened" }
"module suffix": { "Bay", "Deck", "Module", "Facility", "Section" }
"hanger prefix": { "Hanger", "Flight", "Parasite", "Fighter", "Ship", "Craft", "Shuttle" }
"hanger suffix": { "Hanger", G.unpack "module suffix" }
"hanger": {
props: { support: true } -- depending on mode, either requires this or sets this
-- TODO replace these w a default blacklist removing duplicated words
blacklist: { "Hanger Hanger", "Module Module" } -- if appears anywhere in results, it will be regenerated
{ -- assigning individual probabilities (numbered keys are divided among remaining probability)
"{hanger prefix} {hanger suffix}"
"{hanger prefix} {hanger suffix} Module": 0.05
"{hanger prefix} Module"
"{module prefix} {hanger prefix} {hanger suffix}"
"{module prefix} {hanger prefix} {hanger suffix} Module": 0.05
"{module prefix} {hanger prefix} Module"
}
}
"sickbay prefix": { "Medical", "Hospital", "Infirmary" }
"sickbay": {
props: { support: true }
blacklist: { "Hospital Facility", "Infirmary Facility"}
{
"Sickbay": 0.05
"{sickbay prefix} {module suffix}"
"{module prefix} Sickbay": 0.05
"{module prefix} {sickbay prefix} {module suffix}"
"{module prefix} Infirmary"
"{module prefix} Hospital"
}
}
"engineering": {
props: { support: true }
"Engineering {module suffix}", "Maintenance {module suffix}",
"{module prefix} Engineering", "{module prefix} Maintenance {module suffix}"
}
"tankage": {
props: { supply: true }
"Fuel Tank", "{module prefix} Fuel Tank"
}
"cargo": {
props: { supply: true }
"Cargo {module suffix}", "Cargo Handling {module suffix}",
"{module prefix} Cargo {module suffix}"
}
"quarters prefix": { "Troop Transport", "Troop Quarters", "Crew Quarters", "Cryogenic" }
"quarters": {
props: { supply: true, colonization: true }
"{quarters prefix}": 0.1
"{quarters prefix} {module suffix}"
"Troop {module suffix}", "{module prefix} Troop {module suffix}"
"{module prefix} Transport", "Transport {module suffix}"
"{module prefix} {quarters prefix}"
"{module prefix} Crew {module suffix}"
"Crew {module suffix}"
}
"magazine type": { "Missile", "Ballistic", "Shell" }
"magazine": {
props: { supply: true }
"{magazine type} Magazine", "{module prefix} Magazine"
"{module prefix} {magazine type} Magazine"
"Magazine {module suffix}", "{module prefix} Magazine {module suffix}"
"{module prefix} {magazine type} Magazine {module suffix}"
}
"geosensor type": { "Geometric", "Geographic", "Planteoid", "Surface" }
"geosensor": {
props: { colonization: true, scouting: true }
"{geosensor type} Sensor", "{geosensor type} Sensor {module suffix}"
"{module prefix} {geosensor type} Sensor"
"{module prefix} {geosensor type} Sensor {module suffix}"
}
"terraforming": {
props: { colonization: true }
"Terraforming {module suffix}"
"{module prefix} Terraforming {module suffix}"
"Terraforming System": 0.05
"Terraforming Systems {module suffix}"
"Atmospheric Processing {module suffix}"
"Atmospheric Processing System": 0.05
"Atmospheric Processor"
}
"thermal words": { "Heat", "Thermal", "Energy" }
"thermalsensor": {
props: { scouting: true }
"{thermal words} Sensor"
"{thermal words} Sensor {module suffix}"
"{module prefix} {thermal words} Sensor"
"{module prefix} {thermal words} Sensor {module suffix}"
}
"gravity words": { "Higgs", "Gravity", "G", "Boson" }
"gravsensor": {
props: {scouting: true }
"{gravity words} Sensor"
"{gravity words} Sensor {module suffix}"
"{module prefix} {gravity words} Sensor"
"{module prefix} {gravity words} Sensor {module suffix}"
}
"em words": { "EM", "Electronic", "Electromagnetic", "Mag" }
"emsensor": {
props: { scouting: true }
"{em words} Sensor"
"{em words} Sensor {module suffix}"
"{module prefix} {em words} Sensor"
"{module prefix} {em words} Sensor {module suffix}"
}
-- continue: cloak, c&c, etc
-- these generics should be available built-ins
"letter": G.split "abcdefghijklmnopqrstuvwxyz"
"capital": G.split "abcdefghijklmnopqrstuvwxyz"\upper!
digit: G.split "0123456789"
symbol: "!@#$%^&*()_+-=[]{}\\|~`'\";:<>,./?"
}