NPCs and A.I., if that's even possible? + A few other things

Hi all! First let me say I love this website and my very first serious game project is coming along very well. However, while I want to stay on the subject of the main title of this topic, I have to derail to detail a few other things (read: bugs) that I don't know how to fix as I am using Quest and while I am somewhat familiar with it, I am currently limited to the web player/version of Quest because life and hotel computers.

More context: My game is about myself IRL as a patient in a behavioral health hospital. Just so you don't get too confused.

First, the bugs:

  • Upon reaching 0 health, both the standard Game Over for dying from anything that would kill you normally and the bad ending of getting sent to the state hospital by the Magistrate would print at the same time. I partially fixed this by temporarily removing the state hospital ending, yet the game still continues even after I die. Perhaps I could program a "dead" response similar to Hitchhiker's Guide To The Galaxy?

  • Apparently pencils are capable of exploding if you write on anything other than paper... I removed this. Why I even programmed an explosion to happen in the lobby of a behavioral hospital I'd rather not disclose, it's kind of embarassing...

  • I added a room called Scare Space which stems from a nightmare I once had while still a patient at that hospital, which you can normally only access by going into your room and GOing DOWN. You are supposed to be able to exit by GOing UP (you lose 20 health every turn you are inside Scare Space) but for some reason there is also an exit to the NORTHWEST of the room that can be accessed vice versa the SOUTHEAST of the main living area. Coincidentally by entering Scare Space from the SOUTHEAST of the living area, the only way to exit from there is to GO UP... how did I even do this?!

Now, the main topic.

As the game takes place in a behavioral hospital, I need there to be NPCs of other patients and likewise, staff that work at the hospital, including nurses, counselors and doctors. I want them to have their own A.I. and "schedules" in which they go off and do their own thing, including breaking the rules on their own free will (patients), among other random events such as the following:

  • As mentioned above, fellow patients need to be able to cause misconduct and misbehave
  • Occasionally with every other day that passes there needs to be someone that comes in with a support animal, the animal needs to be determined randomly (dog or cat) and have their own A.I. somehow, that will stay for a set number of turns and then leave for the day
  • Some of the doctors' backstories are intended to be malicious and secretly evil (this will be revealed to the player later in the plot, and ultimately defended against), and so they need to be programmed to periodically attempt these "schemes" as they could be thought of, against the player, usually in the form of survey-like questions or brief conversations asking for a certain type of information about something the player did previously; some of these are intended to be legitimately harmless, and in some instances I plan to have a few of these conversations actually assist the player or at least make some puzzles easier, but other times they are malevolent trick questions that will cause a game over in some instances
  • As this game takes place in a behavioral hospital, obviously one thing that needs to happen is that the unit your are staying in will be periodically let out to other parts of the hospital like the cafeteria, gym etc. for certain activities; a few of these (gym, fresh air time etc.) are optional but others (breakfast/lunch/dinner, blood draw, medicine etc.) are required. I'm not sure how I could do this easily, if it can be done at all.

I love this game engine and found it the easiest to work with. I would really appreciate and be thankful of any helpful feedback I could get. Thank you!

npc/A.I. behavior (via "scheduling" as you got correct) is done two ways within quest:

  1. real time clock/stop-watch ticking, using the 'timer' Element

  2. using the 'internal turns' (these are just any actions you do during playing the game: typing in something into the command box and hitting enter, clicking on a blue hyperlink text in the big text box on the left, or clicking on one of the "buttons"/objects/places on the right side of the screen and using/doing/selecting one of their verbs/"buttons") of the game, which is done via using the 'turnscript' Element (I think this might not be available as a GUI option, but can't remember and/or if the newer versions of quest have it to in as a GUI option now, and I've not been using quest for awhile, so I'm a bit rusty with using it, forgetting how you would access the 'turnscript' Element via the GUI, though if worse comes to worse, you can create it as a script)

now, the "scheduling" (including randomized if so desired) can be as simple as the order of scripts (your order of actions/events you want to happen) and/or when you enable/disable the 'turnscript' and/or 'timer' Elements or various multiple 'turnscript' and/or 'timer' Elements (note that working with the 'timer' Elements especially can get really messy, as working with real time, is extremely messy, lol), or can be much more complex, involving setting up a whole date (days, weeks, months, years) and time (seconds, minutes, hours) (and/or hours of the day: night, twilight, dawn/sunrise, morning, noon/mid-day, afternoon, dusk/sunset, evening, twilight, night, mid-night, as well as: day-time vs night-time, too) system within your game, and have the NPC/A.I. behavior be based upon those times (hours, minutes, seconds) and/or dates (days, weeks, months, years) (and/or hours of the day: night, twilight, dawn/sunrise, morning, noon/mid-day, afternoon, dusk/sunset, evening, twilight, night, mid-night, as well as: day-time vs night-time, too)

npc/A.I. "movement" behavior is similar as well and/or involving 'randomization' selection of what places/rooms/objects to "move" to, as well

and there's also having 'following' behavior as well, which can also include "pathfinding" too (this merely involves creating a 'y_coordinate' Integer Attribute and a 'x_coordinate' Integer Attribute, or also a 'z_coordinate' Integer Attribute if you want to delve into doing 3D, lol, creating a "grid system", for every single room, and using 'greater than or lesser than operations' comparing the two locations' "coordinate values" checking scripts and arithmetic scripts: addition/subtraction to move in the desired direction and/or towards or away from your Player Object or whatever other Object, meh, though it can be more complex if you want more complex programming-game behavioralism, such dealing with locked doors and etc, in where they can "move" to and can't move to, with your "pathfinding" behavioralism)

Log in to post a reply.