0
\$\begingroup\$

I'd like to implement an AI for my game, which has agents that should be able to take care of themselves.

The Sims use a system of smart objects that advertise their services, a design pattern that seems very nice since all the logic is hidden away in the object to be used, and it seems simple enough to get started.

I am currently stumped though how to extend it to interactions between multiple people, and to people using objects together, especially when it doesn't make much sense to use an object together. (I don't want a character to set up a boardgame and wait, no one comes and he leaves again)

\$\endgroup\$
3
  • 1
    \$\begingroup\$ Can you tell us a bit more about the context of your game — what kinds of agents are likely to be around / what kinds of activities do they need to do together? Do they need to accomplish anything (eg. Dwarf Fortress — needs smart prioritization to avoid derailing the broader objectives of the community), or do they just need to create a plausible appearance of activity (eg. street life in a city game, where the core sim moves on with or without these agents)? \$\endgroup\$
    – DMGregory
    Commented Feb 23, 2020 at 12:02
  • \$\begingroup\$ They are your characters, the player is expected to look after them, and they do need some smart priorization to not starve/die of thirst/collapse of exhaustion \$\endgroup\$
    – Whitecold
    Commented Feb 23, 2020 at 12:07
  • \$\begingroup\$ Ah, so it's very much Sims-like, where the prioritization is about individual needs, not collective activity? That might make some things easier. :) \$\endgroup\$
    – DMGregory
    Commented Feb 23, 2020 at 12:08

1 Answer 1

1
\$\begingroup\$

You can extend the smart object idea by including a voting system.

An unused chessboard periodically broadcasts "Anyone up for a game of chess?" while there are at least two agents nearby.

Agents in the vicinity evaluate whether chess would be good for their current needs/priorities and reply yes/no.

If the chessboard gets at least two "yes" votes, then it elects two players from among those who accepted. (This may be a good moment to use a matching algorithm if you have many agents nearby, to favour selecting a pair who already have a relationship)

One of the elected pair then vocalizes to the other "hey, how 'bout a game of chess?" and they proceed with the activity.

If the chessboard gets fewer than the needed number of "yes" votes in a round of voting, it goes back to waiting, with no visible activity revealing to the player the negotiation that just transpired.

An interaction between two agents can also use the smart object concept — but the agents themselves are the objects.

Each agent can periodically run through the set of actions it can perform with another and decide which are appropriate/desirable in this context. Then it can broadcast them as a smart object interaction available to agents nearby. "I'm down to chit-chat or high-five"

If another agent accepts the interaction, "I too would like a high-five" then the two begin the activity together, getting into position to play the corresponding animations.

\$\endgroup\$
2
  • \$\begingroup\$ The problem I see is that each character can only give a weight for the activity, and if a character is interested in 1 chess game, then all chessboards someone will inevitably spam will also appeal to them, so then the chessboards have to talk to each other who grabs characters, and I don't see any way right now to preselect if they'd rather not play at all with certain characters \$\endgroup\$
    – Whitecold
    Commented Feb 23, 2020 at 13:25
  • \$\begingroup\$ You could extend the voting concept then. Chessboard asks "who wants to be player one?" and jots down a list of names. Then it asks "who wants to play with someone on this list?" and selects the top-scoring response after evaluating pair compatibility. You can use a single smart object to represent a group of interaction opportunities — like a board game nook advertising gaming, and eliding the fact that there are in fact five discrete tables/boards — it just fills them as it gathers pairs. \$\endgroup\$
    – DMGregory
    Commented Feb 23, 2020 at 13:30

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .