Making AI more interesting

    Joined
    Jan 11, 2017
    Messages
    168
    Reaction score
    83
    We're playing in a setting with AI. There's so many more places one could go with that idea.
    So, since I'm a giant NERD and logic is fun to play with, I decided to see if I could create a responsive computer terminal to be used aboard a ship. It's surprisingly easy to do, though it's not exactly simple or svelte...


    This mass of logic is just a couple of basic functions. It goes like this:


    We start with the "off" status message. If you do as it says and type {ACTIVATE}, you get this prompt.

    The "Welcome!" Pops up, then the second block of text pops up a second afterward as a little door panel opens.

    Once you enter your name, the panel will close. It will never open again unless you force it. Sadly in this test drive the door had a weird collision and broke, but the logic was sound. I just need to alter the door panel itself.

    The computer will now remember your name and address you as such in all of its dialogue. If you type {DEACTIVATE} You'll return to the prompt from the second image. If you activate it again, and you've already entered your name, it will jump straight to the "Greetings, (name)!" text, and ask you what you would like to do.

    {COMMANDLIST} Will open up another wall panel and show a static list of recognized commands. (I haven't actually built that part yet, but that's simple compared to getting this stupid thing to recognize and use your name!)

    From there, it should be simple to make the 'AI' do just about anything you can accomplish with logic via a text command.
    Ignite the engines, dim the lights, report position/status, activate the chain drive and/or parking break. All that jazz.

    One interesting possibility I've come up with that may or may not work would be to have the computer store the coordinates of the last sector you were in before you engaged the jump drive, and retrieve that information for you upon command.

    It also might be possible to create a kind of 'memory bank' where you could manually input the coordinates of a handful of specific sectors you want to save, and keep those stores for later recall.

    Me: "Where was that asteroid belt again?"
    Me: "Computer, {asteroid belt 5}"
    Computer: [-67,45,-179]
    Me: :)

    (I was advised to put this thread here in Logic instead of General. I've seen the work people on this forum do, and I'm comparatively a complete novice, so I was initially too intimidated. LoL)

    ---
    We're playing in a setting with AI. There's so many more places one could go with that idea.
    So, since I'm a giant NERD and logic is fun to play with, I decided to see if I could create a responsive computer terminal to be used aboard a ship. It's surprisingly easy to do, though it's not exactly simple or svelte...


    This mass of logic is just a couple of basic functions. It goes like this:


    We start with the "off" status message. If you do as it says and type {ACTIVATE}, you get this prompt.

    The "Welcome!" Pops up, then the second block of text pops up a second afterward as a little door panel opens.

    Once you enter your name, the panel will close. It will never open again unless you force it. Sadly in this test drive the door had a weird collision and broke, but the logic was sound. I just need to alter the door panel itself.

    The computer will now remember your name and address you as such in all of its dialogue. If you type {DEACTIVATE} You'll return to the prompt from the second image. If you activate it again, and you've already entered your name, it will jump straight to the "Greetings, (name)!" text, and ask you what you would like to do.

    {COMMANDLIST} Will open up another wall panel and show a static list of recognized commands. (I haven't actually built that part yet, but that's simple compared to getting this stupid thing to recognize and use your name!)

    From there, it should be simple to make the 'AI' do just about anything you can accomplish with logic via a text command.
    Ignite the engines, dim the lights, report position/status, activate the chain drive and/or parking break. All that jazz.

    One interesting possibility I've come up with that may or may not work would be to have the computer store the coordinates of the last sector you were in before you engaged the jump drive, and retrieve that information for you upon command.

    It also might be possible to create a kind of 'memory bank' where you could manually input the coordinates of a handful of specific sectors you want to save, and keep those stores for later recall.

    Me: "Where was that asteroid belt again?"
    Me: "Computer, {asteroid belt 5}"
    Computer: [-67,45,-179]
    Me: :)
     
    Last edited by a moderator:

    Jaaskinal

    ¯\_(ツ)_/¯
    Joined
    Jan 19, 2014
    Messages
    1,377
    Reaction score
    646
    • Legacy Citizen 4
    • Wired for Logic Gold
    • Thinking Positive
    if you press f5 or f6, you take an in-game screenshot.
     

    Fellow Starmadian

    Oh cool so thats what this is
    Joined
    Jun 7, 2014
    Messages
    227
    Reaction score
    87
    • Community Content - Bronze 1
    • Wired for Logic
    • Legacy Citizen 2
    Nice practical use of the regex system! about the last sector bit, when you display the current sector in a display block, it's not actually the text that would be transferred if you copied it to another block, you would only get the [sector] command. Meaning if you changed your sector the text displayed would change also. It almost seems like an oversight, because it removes a lot of functionality. I suppose it would be difficult to sort through the code that makes the command invisible and replaces it with the current sector.
     
    Joined
    Jan 11, 2017
    Messages
    168
    Reaction score
    83
    Nice practical use of the regex system! about the last sector bit, when you display the current sector in a display block, it's not actually the text that would be transferred if you copied it to another block, you would only get the [sector] command. Meaning if you changed your sector the text displayed would change also. It almost seems like an oversight, because it removes a lot of functionality. I suppose it would be difficult to sort through the code that makes the command invisible and replaces it with the current sector.
    Sadly, yes.
    I found that out in another (unrelated) thread just after posting this. From Jaaskinal no less!

    That idea is likely impossible (at least the way I had initially envisioned it) but the save file could still potentially work. Manually recording coordinates (or whatever else you need) and saving them for later review.
    [doublepost=1485309145,1485307955][/doublepost]So, Starmadian, what would you include in the list of system commands?
    There are so many possibilities that I'm having trouble sussing out what would actually be useful/practical.
     
    Joined
    Jan 11, 2017
    Messages
    168
    Reaction score
    83
    So I managed to put in a couple of hours of work on this today.

    Current functional commands include:
    Activate: If this is the first time the system has been engaged, this will que the name request. If it already has your name, it just jumps to the "how can I help you" screen.
    Deactivate: sets the screens to their initial display stating that the system is off.
    Commandlist: opens up a side panel and shows a list of commands.
    Oops: if the computer doesn't recognize the command, it will tell you so and recommend you check the commandlist.
    Spool warp drive: starts up the rail clock and begins charging the chain drive. However, it cannot activate the drive, as it will Auto stop as soon as one or more of the modules reaches 95% charge.
    Deactivate warp coil: shuts down the rail clock of the sensor hasn't already.

    Commands in progress:
    Cycle Cargo: moves cargo from main hold to cargo pods or vice versa.
    Cargo Sensor: will detect how full the cargo pods are. Sensor is operating, just not connected to any command functions yet.
    ForceShield sensor: my ships use a docked "backup" shield. This will display that shield's percentages.

    Potential commands (not yet built or tested, just loosely planned):
    Move to HUD: takes a display you've pulled up and moves it over to the piloting camera's field of vision.
    Prime engines: pretty engine lights, and a display beside the core that tells you that the engines are on and gives your speed.

    Thoughts?
     
    Joined
    Jan 11, 2017
    Messages
    168
    Reaction score
    83
    Pffft. It couldn't even beat me in chess. ;p
    LoL.
    No, but it could give you the correct response when you sing "YOU REMIND ME OF THE MAN."

    Also, Chess might be out, but I could totally program it to play "Global Thermonuclear War." ;P
     
    Joined
    Jan 11, 2017
    Messages
    168
    Reaction score
    83
    So I had some issues with my prototype "computer". Specifically, it could follow the correct sequence for requesting a name ONCE and then would completely get FUBARed if you tried to reset it for a new user, and it would sometimes get confused regarding the Warp Drive commands and would just send you hurtling through space like the unstoppable rollercoaster from Hel. So THAT was fun! XD
    So I had to rebuild it, and ended up with a far more efficient machine as a result.

    Here you can see the new computer (left) next to the old one (right). Much less space being used, and a far more organized layout.
    The functions can kind of be broken down by row. In the far left, that entire 6*4 first row is all ONE command sequence, and it's the most complicated piece.
    The first column is just the Deactivation/reset command. After that, everything else is set to detect either one of two possible states and respond accordingly. If you have not given the computer your name and you type {ACTIVATE} it will introduce itself as the Hrolfsson Heavy Industries shipboard AI. Then it will say "I don't believe we've met. To add your name to the crew manifest, please type [ADD]yournamehere in the display below."
    The first half of row 2 is just this door function. If there's no name present, it detects this, triggers the above dialogue pathway, and slides open a panel to reveal the name input display. Once there's a name typed in, it closes the panel and will not reopen it unless you use build mode to go in and delete the name in a manual reset of the computer.
    The rest of row 2 is all of the other commands the computer knows. (Which isn't many at the moment, admittedly.)
    Besides the name intake and greeting dialog which are considerably more complex, each command consists of 1 four block "tower" and an accompanying 2 block tower.

    1-1: A display with the name of the command, EX: {SPOOL WARP COIL}
    1-2: A sensor connected to the first display and the primary command entry display in the core room.
    1-3: An activation module which will trigger when the sensor detects a match. This gets connected to whatever device needs activating and to the 2nd tower.
    1-4: A 'not' gate connected to the activation module.

    Then:
    2-1: A display module with text acknowledging the command, EX: "Warp coil is charging. To activate jump, use the appropriate inner ship remote."
    2-2: a button which will be triggered by the activation module in tower 1, linked to the text response display module in the core room.

    The 'not' gate on top of each tower is for an "ERROR" code. If the command fails to activate ANY towers, and all Not gates are active, then they will trigger an And gate which will prompt its own response. "I'm sorry captain, but I do not recognize that command. To see a list of all available commands, type: {COMMANDLIST}.
    {COMMANDLIST} will open another side panel with a static list of orders the computer will recognize, which closes as soon as you type another command.

    The bottom right corner of the computer is all part of the chain drive. The Spool command will start the spinner and charge the jump drive computers. The 4 rows of activation modules are connected to a sensor which detects when any of the computers have reached 95% charge and deactivates the spinner UNLESS the inner ship remote is active, in which case the sensor is ignored and the drive will activate. :)

    I'd really love to hear what kinds of functions everyone things would be handy to have on a ship. I'm planning to upload this design to the dock, and I'm specifically trying to design it to be practical,responsive, and user friendly.

    What would you do with a computer like this? What are some logic functions you think would regularly come in handy?
     
    Last edited:

    NeonSturm

    StormMaker
    Joined
    Dec 31, 2013
    Messages
    5,110
    Reaction score
    617
    • Wired for Logic
    • Thinking Positive
    • Legacy Citizen 5
    The pathfinder AI
    You could create an AI with dictionaries.
    A basic AI can be a pathfinder in a web of word-equivalents (words, numbers, patterns, …).
    The difficulty is about which path to follow
    What the result should look like
    computer -> yes, my lord. what is your command?
    activate -> what should I activate?
    help -> do you want me to (1) list associated words, (2) list the current context or active words, …
    Howto
    The dictionary is what you need to link words together.
    String-entries containing 2+ words can help sorting the elements into the right order.
    Entries: "command option", "command list", "command associated", "option list", "list associated", "list context".
    Results:
    1. help → "command option list associated"
    2. help → "command option list context"
    3. command → option, list, context, associated, context
    …​

    The context is the most important association, the default value, the short term memory.
    1. him → a recently used Subject associated with male
    2. her → a recently used Object associated with female
    Each word used could reserve some space for context at a certain priority. The least prioritized must be forgotten to make new space available.
    Associated (or more explicitly "all associated") is a list of valid associations in the long-term memory:
    1. Adam → Adam&Eva
    2. Adam&Eva → Adam
    3. Adam&Eva → Eva
    The order of these associations can change depending on the context strengthening some search paths over others.
    1. Food + Poison → Bad ("poison→bad" is stronger than "food→good")
    2. Food → Good
    3. Food → Food_is_good_experiences
    4. Food → Food_is_bad_experiences
    Food_is_good_experiences → good; orange, apple, … (more common, stronger association)
    Food_is_bad_experiences → bad; poison, dirt, … (less common, weaker association)
    AIs can react differently in the same situation depending on their short-term-memory of extern conditions.
    These dictionary nodes doesn't need to be named. They can also be a numeric memory-slot reference as long as the memory is consistent.
    However, adding descriptions/names to these nodes help communicating with the user and understanding written commands.

    And when will AIs be like humans?

    There are many opinions on this, but I think to disable your AI from acting like humans, the safest way is to let it stop thinking about the "uncertain future".
    Terrorists can eliminate humanity, but AIs shouldn't think about that possibility so that they will never think about enslaving humanity to save humans.


    Another safety measure can be experiences of failure, so that the AI seeks for human assistance in decisions which are hard to revert, especially when the decision is about human behaviour a human should be consulted.
    But if AIs are actually "fully simulated humans", they themselves could fulfil their desire for certainty by asking others of their kind, unless you also add a desire for democratic votes and preserving minorities.​
     
    Joined
    Jan 11, 2017
    Messages
    168
    Reaction score
    83
    The pathfinder AI
    You could create an AI with dictionaries.
    A basic AI can be a pathfinder in a web of word-equivalents (words, numbers, patterns, …).
    The difficulty is about which path to follow
    What the result should look like
    computer -> yes, my lord. what is your command?
    activate -> what should I activate?
    help -> do you want me to (1) list associated words, (2) list the current context or active words, …
    Howto
    The dictionary is what you need to link words together.
    String-entries containing 2+ words can help sorting the elements into the right order.
    Entries: "command option", "command list", "command associated", "option list", "list associated", "list context".
    Results:
    1. help → "command option list associated"
    2. help → "command option list context"
    3. command → option, list, context, associated, context
    …​
    The context is the most important association, the default value, the short term memory.
    1. him → a recently used Subject associated with male
    2. her → a recently used Object associated with female
    Each word used could reserve some space for context at a certain priority. The least prioritized must be forgotten to make new space available.
    Associated (or more explicitly "all associated") is a list of valid associations in the long-term memory:
    1. Adam → Adam&Eva
    2. Adam&Eva → Adam
    3. Adam&Eva → Eva
    The order of these associations can change depending on the context strengthening some search paths over others.
    1. Food + Poison → Bad ("poison→bad" is stronger than "food→good")
    2. Food → Good
    3. Food → Food_is_good_experiences
    4. Food → Food_is_bad_experiences
    Food_is_good_experiences → good; orange, apple, … (more common, stronger association)
    Food_is_bad_experiences → bad; poison, dirt, … (less common, weaker association)
    AIs can react differently in the same situation depending on their short-term-memory of extern conditions.
    These dictionary nodes doesn't need to be named. They can also be a numeric memory-slot reference as long as the memory is consistent.
    However, adding descriptions/names to these nodes help communicating with the user and understanding written commands.

    And when will AIs be like humans?

    There are many opinions on this, but I think to disable your AI from acting like humans, the safest way is to let it stop thinking about the "uncertain future".
    Terrorists can eliminate humanity, but AIs shouldn't think about that possibility so that they will never think about enslaving humanity to save humans.


    Another safety measure can be experiences of failure, so that the AI seeks for human assistance in decisions which are hard to revert, especially when the decision is about human behaviour a human should be consulted.
    But if AIs are actually "fully simulated humans", they themselves could fulfil their desire for certainty by asking others of their kind, unless you also add a desire for democratic votes and preserving minorities.​
    Wow.
    Some of that dictionary sounds possible via RegEx commands, but it would be MASSIVE and I'm not skilled enough in the language to try it myself. XD
     

    NeonSturm

    StormMaker
    Joined
    Dec 31, 2013
    Messages
    5,110
    Reaction score
    617
    • Wired for Logic
    • Thinking Positive
    • Legacy Citizen 5
    Some of that dictionary sounds possible via RegEx commands
    Regex is a nice thing. Some sort of multi-dimensional binary logic.
    I, myself, are not very used to work with regex, but there is a thread showing you how to implement basic logic with regex commands.

    but it would be MASSIVE
    Yes, but remember that only a tiny part has to be done in regex. Regex is like the Graphics Card for SM-logic.
    You can do some parts with basic logic blocks
    and a huge part with configuration files (like database entries)

    (EDIT: copy+paste and configuration files allow external editing too)​
     
    Joined
    Jan 11, 2017
    Messages
    168
    Reaction score
    83
    Yes, but remember that only a tiny part has to be done in regex. Regex is like the Graphics Card for SM-logic.
    You can do some parts with basic logic blocks
    and a huge part with configuration files (like database entries)
    I know such things are possible, but I haven't the faintest idea how to accomplish them. That takes a level of programming knowledge that I just don't have. LoL.
    Some of the other folks around here totally do though. Jaaskinal might know how to work something like that.
     

    NeonSturm

    StormMaker
    Joined
    Dec 31, 2013
    Messages
    5,110
    Reaction score
    617
    • Wired for Logic
    • Thinking Positive
    • Legacy Citizen 5
    I know such things are possible, but I haven't the faintest idea how to accomplish them.
    I am not sure if you mean the regex or the AI database now …
    If you can organize it, separate peoples might work on the regex and database as soon as you know how the database parsing should work, as the database is the road-map of thoughts.​
     
    Joined
    Jan 11, 2017
    Messages
    168
    Reaction score
    83
    I am not sure if you mean the regex or the AI database now …
    If you can organize it, separate peoples might work on the regex and database as soon as you know how the database parsing should work, as the database is the road-map of thoughts.​
    I just meant the RegEx + logic systems required to make your responsive dictionary of words.
     
    Joined
    Jan 11, 2017
    Messages
    168
    Reaction score
    83
    Neonsturm! I thought you'd be interested in this development:

    This is awesome! Thank you!
    This regex allowed me to make more flexible entry commands for my logic core.

    With my old command towers, you had to type in the exact phrase to trigger any functions. So {SPOOL WARP COIL} would start your chain drive but "Turn warp drive on" would get you the "I don't recognize that command" prompt.
    With THIS, I can now set up a tower to not only recognize certain words in a sentence but recognize when they're used in conjunction! So while the tower on the right will only function with {SPOOL WARP COIL}, the one on the left will trigger if your command contains the word "warp" in conjunction with the words "activate" or "on". I can then make another 'warp' tower which recognized "warp" and "deactivate" or "off". :)

    The only issue is that this tower takes up a LOT more space, so this level of responsiveness might be limited to stations. Otherwise, my logic core could quickly become absolutely HUGE, and thus unreasonable for the average ship. As it is my logic core is already something like 40*30*9...
    Actually, now that I think about it, I could use this concept to create a kind "subject" row. I wouldn't even need to make separate towers for "on" and "off", I'd just need another column in the same tower.
    So the 'Warp' tower could be used to "read" any sentence that contains the word warp, basing it's interpretation of your request on the presence of other key terms in your sentence.
    So for my own system, one example might be "Charge 15 warp cells and activate when full."
    The system would trigger the 'Warp' subject row, which would then register the additional words "charge" "15" and "activate". Charge turns on the rail clock. 15 activates warp cell 15 and every cell in line before it. Activate will automatically trigger the ISR for warp as soon as all cells are either in the "charged" or "offline" states. But those secondary functions can only be triggered of the primary 'root' word (warp) is active.

    I could even include some extra words just to cover the bases. 'Charge' could also be activated by 'Spool' and 'activate' by 'on'. So the same set of functions could be triggered by saying: "Spool the drive and prep for 15 warp jumps. Turn on when ready."

    This ALSO means you could give multiple commands at a time!
    By typing something like: "Trigger red alert and spool the emergency warp drive" you could activate sensors in multiple columns and make the machine perform more than one function simultaneously!

    WOW this bit of code just opened up a LOT of possibilities for me...
     

    NeonSturm

    StormMaker
    Joined
    Dec 31, 2013
    Messages
    5,110
    Reaction score
    617
    • Wired for Logic
    • Thinking Positive
    • Legacy Citizen 5
    I thought a bit about it … if 40*30*9 is too much, report it to :schema::ROFLMAO: - "computers are bigger than 1990's".

    An AI needs a syntax parser first.
    This syntax parser could use brackets, but it's more comfortable for the user if the parser can -for example-
    - create "nation → the nation"
    - from "the nation" by knowing that the word
    - "the" is an "article" and that the word
    - "nation" is a "substantive" plus rules for these types of words.

    To know words, you need these database entries first
    1. "the → article"
    2. "nation → substantive"
    3. "article substantive → substantive"
    Context knowledge required:
    1. "nearest article → the"
    2. "nearest substantive → nation"

    A double translation and one reduction step to transform "the nation" to "article substantive → substantive" to "nation → the nation".


    Note: "A→B" means "A has a link to B"​
     
    Joined
    Jan 11, 2017
    Messages
    168
    Reaction score
    83
    Well now you're getting into freeform RESPONSES, and that's likely a bit beyond what Starmade can handle with logic gates and RegEx. LoL

    But making the system more user friendly by not requireing exact commands seems like a practical advance in tech.