Author Topic: [NPCs] System NPC behaviours  (Read 7566 times)

0 Members and 1 Guest are viewing this topic.

Craig

  • Developer
  • Extreme Member
  • ******
  • Posts: 6499
  • Dig Deep
  • Awards Developer 4 years on site+1000 posts 3 years on site+600 posts 2 years on site+300 posts Was in the top 10 of the forum stats page as of 4/12/15 Members who have unlocked the robotic avatar 1 year on site+100 posts Day 1 w/25+ posts (4/12/13)
    • View Profile
    • Twitter
    • Awards
[NPCs] System NPC behaviours
« on: January 02, 2016, 01:16:28 AM »
Amos think's it would be cool if each of the built in NPC types had behaviour unique to them, and I agree with him.

This topic is for everyone to discuss ideas on how they'd like to see each NPC behave and possibly some dialog too.

As part of the AI revamp, I'll do my best to mimic as many of the best idea's that I can into the default NPC behaviour.

Your ideas will also provide me with ideas on what new behaviour nodes we might need that I haven't yet added.

It will also be a good way to show case what is possible with the new AI system, and teach potential AI designers how the system can be used.

When you make a post, please clearly name the NPC you are providing behaviour ideas for. If you modify your behaviour, please modify your OP.


--------------------------------------------------------------------------------------------------------------------------

Guard- can be stationary or wander within a certain distance from the Spawner.  Attacks hostile mobs with ranged attacks if it can't reach with melee.  If an attacker is close and the guard's health is high enough, they'll try swinging a shield to lessen incoming damage.  If health is low they can eat up to 3 pieces of food before fleeing towards other guards if possible.  If fighting multiple attackers Guards try to finish off weaker level opponents before taking on the target with the lowest health. 



This works quite well:
Guard deactivates if no players are currently within 50 blocks of guard.
If the guards health < 60% he tries to equip his cooked beef he was given at spawn, and eat it.
If the guard is not under attack then he just wanders around within 10 blocks of the spawn block.
If the guard is under attack then
If the guards health is < 20% he tries to find another guard and if he does, he flees to that guard.
Otherwise if the weakest target (primary target) is further than 20 blocks from the spawn block, the guard breaks off the attack and returns to wandering around the spawn block.
Otherwise if the target is within sword range, the guard will equip his shield and sword and attack with melee, randomly swinging his shield if his health > 80%.
Otherwise the guard will equip his bow and arrows and range attack the target.

--------------------------------------------------------------------------------------------------------------------------

Policeman
Equip: steel sword
Shop: None
Compainion: None
Combat: Neutral, Will only attack if provokes by attacking either him or a near by NPC.
Details: Policeman would be similar to guards/templors and other protective NPCs, However they would be at the lower end of the spective due to police being generaly alot weaker then trained soldiers.

Patrols within 20 blocks of the spawner
will only attack the player if they try to attack passive animals or npcs
While in combat they will attack the player untill 30% health at this point they will attempt to eat low healing food untill that runs out
then they will attempt to flee once they reach 15% health



The script node adds some bread (no donuts) and a wood sword to the policemans inventory and the equip node equips the sword when he spawns. I opted for the wood sword over the steel sword as it's more akin to a batten.
The first IsHealth node checks if the policeman's health is <= 30%, if it is, he checks if he has some food in his left hand and if he does, he swings his left hand to eat it.
If the policeman is attacked, he messages other policemen that he's being attacked and if his health is > 15% then he attacks his attacker, otherwise he flees.
Otherwise if he's not being attacked, he wanders randomly up to 25 blocks from his spawn point. While he wanders he keeps an ear open for messages from other policemen or passive mobs who are under attack and if he hears one he will consider himself under attack by the same attacker, and therefor attack it via the IsTargeted node.

--------------------------------------------------------------------------------------------------------------------------

Entrepreneur could spawn with a little money that players could get by betting on who gets the highest random number, or killing him I suppose would work too.





--------------------------------------------------------------------------------------------------------------------------

Medic- Conversational dialog changes depending on your current hp, e.g.: "Good day!"/"Ouch! That looks painful, let's bandage that before it gets worse"/"Oh my word!  You require immediate medical attention!"

Responses e.g.:  "I'll survive"/"Yes, thank you. [pay x gold, where x = lost hp (just enough to be more expensive than eating food since there's no time/materials involved)]" and executes a healing script (maybe with a cooldown?)





--------------------------------------------------------------------------------------------------------------------------
« Last Edit: January 13, 2016, 10:33:34 AM by Craig »

Craig

  • Developer
  • Extreme Member
  • ******
  • Posts: 6499
  • Dig Deep
  • Awards Developer 4 years on site+1000 posts 3 years on site+600 posts 2 years on site+300 posts Was in the top 10 of the forum stats page as of 4/12/15 Members who have unlocked the robotic avatar 1 year on site+100 posts Day 1 w/25+ posts (4/12/13)
    • View Profile
    • Twitter
    • Awards
Re: System NPC behaviours
« Reply #1 on: January 02, 2016, 01:22:36 AM »
I'll start of with a simplistic example suggested by amos (as an example), and a full list of all built in NPC types.

Lumberjack:

He wanders around gathering wood and food, maybe even build a small shack (or one of the system component shops) while trying to avoid mobs too tough to defeat.


Of course we'd like to see a range of simple behaviour to extremely complex behaviour across the NPC list.

NPC List:

Duck
AyrshireCow
Sheep
Spider
Dryad
Skeleton
Djinn
Goblin
Orc
TrollChief
TrollBoy
TrollGirl
Werewolf
HighlandCow
Alpaca
Fish
Boy
Girl
Girl2
Girl3
Girl4
Original
Angel
Carpenter
Caveman
Chef
Cowboy
Diablo
Explorer
Entrepreneur
GoldenKnight
Handyman
Hippie
Indian
InvaderMan
Jamaican
Knight
Lumberjack
Madman
Medic
Ninja
Pirate
Prisoner
Pupil
Refugee
Robotic
Sage
Soldier
Terminator
TreeHugger
Alien
Bomberman
ElfBoy
ElfGirl
Farmer
Guard
Hobo
Templar
Zombie
Dwarf1
Dwarf2
Dwarf3
Dwarf4
Dwarf5
Dwarf6
Princess
King
Astronaut
Sailor
Fisherman
Policeman
DemiGod
DemiGoddess
HermesWraith
Testerman
Zeus
« Last Edit: January 02, 2016, 01:29:23 AM by Craig »

The Gold Knight

  • Elite Member
  • *****
  • Posts: 977
  • Ya hoser
  • Awards 3 years on site+600 posts Site art contributions/TPs in-game/Contest winners Donated a giveaway prize. (Must be a prize of cash value.) 2 years on site+300 posts Former MotM winners 1 year on site+100 posts Week 1 members w/25+ posts (4/13/13-4/20/13)
    • View Profile
    • Insert Clickbait Title Here!
    • Awards
  • Other: 何
Re: System NPC behaviours
« Reply #2 on: January 02, 2016, 02:00:12 AM »
Ideas for NPC behaviors, eh? Alright, I'll throw one out there.

NPC: Any, as it's more of a general behavior, but if one is to be specified, I see The Golden Knight or Refugee as working.

Behavior: A companion styled character like from Fallout where you can adjust their behaviors like follow distance, weapon preference, and even change their gear. They would follow you, and act as a bodyguard of sorts, and can be dismissed at any time when talking to them.

Gary

  • Tester
  • Supreme Member
  • *****
  • Posts: 2924
  • Steam: Conmaan ... ... Discord: Conmaan #9586
  • Awards 1 year on site+100 posts Was in the top 10 of the forum stats page as of 4/12/15 Former MotM winners
    • View Profile
    • Awards
Re: System NPC behaviours
« Reply #3 on: January 02, 2016, 02:28:29 AM »
I'm not sure if this is all possible, but here are my ideas. I built these assuming the gamemode is either survival or DD, and not necessarily creative.



Djinn:


Wanders around a tree. Becomes aggressive towards any other non-Djinn mobs that get close to it.

Goblin:

Seeks out chests and takes loot that then becomes attached to the Goblin's inventory. If there are no more chests, the goblin will retreat to where it came from.

Carpenter:


Will build a small wooden shack equipped with a crafting table, if given the necessary wood.

Chef:

Will install a kitchen if a shack is built with a carpenter in it (also requires some amount of stone and glass). Will cook food if given the necessary raw meat.

Cowboy:


Will seek out animals to hunt, and kill them on site. Gives leather when receiving gold.

Entrepreneur:


Will build an economized (or not economized) shop if a shack with a carpenter is available (also requires gold bars). Will trade rares + gold for other rares.

Handyman:

Will install a second floor on a shack if one is built with a carpenter in it.

Indian:

Will build campfires and protect animals from other mobs.

Knight:

Will patrol any castles if one is built with a King in it. Hunts trolls, goblins, diablos, and madmen.

Lumberjack:


Will collect wood if given the necessary tools.

Medic:

Will heal for gold.

Pirate:

Will build a boat, on water, if given the necessary wood and cloth. If a boat is built, will offer to collect and bring other NPCs for different costs.

TreeHugger:


Will seek out Djinns, for they prevent TreeHuggers around the world for hugging trees.

Farmer:

Will build a farm and tend it, if a shack with a carpenter is available, and if given the necessary dirt and tools.

Guard:

Hunts trolls, goblins, diablos, and madmen, but prefers to stay close to other NPCs.

Templar:


Hunts trolls, goblins, diablos, and madmen. Searches for Angels, and if one is found then the Templar will build a church.

King:


Will build a castle if given the necessary stone, glass, gold, wood, and if one princess and one guard and one templar are present.




Might touch up on this later and refine my ideas.
« Last Edit: January 12, 2016, 06:08:23 AM by Gary »


               

Link to my youtube channel:
https://www.youtube.com/channel/UCo4rmelSOUB9YMM0Is-zWyQ

Tom Snow

  • Global Moderator
  • Legendary Member
  • ******
  • Posts: 1373
  • "Witness me! I live, I die, I live again."
  • Awards 1 year on site+100 posts Former MotM winners 3 years on site+600 posts I AM THE LAW! 2 years on site+300 posts Was in the top 10 of the forum stats page as of 4/12/15 Day 1 w/25+ posts (4/12/13)
    • View Profile
    • Awards
Re: System NPC behaviours
« Reply #4 on: January 02, 2016, 06:16:40 AM »
TrollChief
Equipped with:
- Troll hide body
- Troll hide boots
- Troll hide guantlets
- Troll hide helmet
- Troll hide leggings
- Troll bow
- 2 Steel battle axes (Normally only one equipped.
- Steel shield

- TrollChief Deactivates If no player is within 20 blocks.
- It will summon 2 minions (plays mobs sound - war horn) when there is a player or mob is in the range of X when 12 < X < 20.
- TrollChief will equip a shield and battle to attack if the player is less than or equal to 12 blocks away.
-When the TrollChiefs health is less than 50% it will dual wield battle axes.
-When the TrollChiefs health is less than 30% and is random 1/20 (Plays mob sound - war horn) Spawns TrollChief.
-When the TrollChiefs health is less than 20% it will equip cooked beef and attempt to heal it self.

Pupil
Equipped with:
- A book

- Pupil will ask the player to help with there studies. If the player agrees they will ask a random question (Is random to choose a question) if the player answers correctly from a range of answers then the player will receive a random prize (food,coin or basic weapons( again using is random).
-Once the player has answered correctly they will recieve a prize and a history in order to stop the player farming the questions for rewards.
-The pupil will stop talking to the player once they have answered correctly.
-If the player answers incorrectly they will be given another chance.
-If the pupil is killed then they drop there book.
« Last Edit: January 12, 2016, 05:31:42 AM by </Tom_Botsky> »


(smacks you)

being stupid is gona start to hurt around here.

Houndeye

  • Member
  • ***
  • Posts: 232
  • Woof?
    • View Profile
    • Awards
Re: System NPC behaviours
« Reply #5 on: January 02, 2016, 06:37:07 AM »
The duck:
During Fall, ducks can be seen flying in a V-Formations across the map towards the south. If any duck is hit, that duck will drop to the back, and a new duck will take it's place. In the winter, they cannot be seen at all in the map. When spring arrives, the same happens, except the ducks can be seen flying in from the south, and scattering all over the map. During spring, ducks mostly wander about near water, and occasionally swim in it. During the summer, ducks swim around more often, as temperatures rise.


Jaz

  • Supreme Member
  • *****
  • Posts: 2948
  • ヽ(`⌒)ノ
  • Awards Awarded to exemplary forum members 3 years on site+600 posts Was in the top 10 of the forum stats page as of 4/12/15 Former MotM winners 4 years on site+1000 posts Donated a giveaway prize. (Must be a prize of cash value.) 2 years on site+300 posts 1 year on site+100 posts
    • View Profile
    • cluckinbellhappychicken
    • Awards
  • Xbox: Jaz the MAN 2
  • PSN: Jaz_the_MAN_2
  • Steam: Jaz the MAN 2
Re: System NPC behaviours
« Reply #6 on: January 02, 2016, 07:22:40 AM »
Hermes Wraith:
Hovers above the bedrock tower in hell and will attack you with fireballs, fire arrows, occasional ice arrows and spawn goblin minions. Our first boss.

Entrepreneur:
Walks around casually, if he finds an area where their is both a chest and a door (To show that it is probably a home) then he will set up a small shop selling overpriced items. Very useful for legendary maps, as long as the shop isn't cheap nor have high sell prices. The shop wouldn't include every item.

Angel:
1 in 10 chance that he/she will spawn in a cloud and fly around, drops pieces of diamantium armour.

Idian:
Can sometimes be seen roaming around areas with trees, will attack you and is friendly with the dryad.


Original:
Can only be seen if you are also playing as original, replaces Hermes Wraith boss.

"I know not with what weapons World War III will be fought, but World War IV will be fought with sticks and stones" ~ Albert Einstein

AlienizdPixel

  • Tester
  • Supreme Member
  • *****
  • Posts: 2612
  • Hello
  • Awards 3 years on site+600 posts Members who have unlocked the robotic avatar Awarded to exemplary forum members 2 years on site+300 posts Was in the top 10 of the forum stats page as of 4/12/15 1 year on site+100 posts
    • View Profile
    • Awards
  • Xbox: A1ienizdPixe1
  • Steam: Alienizd
Re: System NPC behaviours
« Reply #7 on: January 02, 2016, 08:23:08 AM »
Duck: Has a preference to stay near water, and at most will travel 10~ blocks away from a source. They will attack when attacked, but if any are around, they will join the fight. It's text would be quack.

Question, could we give the NPC's there own skills (Health, Attack, etc)?
-Alionz

Platinum Dryym

  • Supreme Member
  • *****
  • Posts: 4240
  • What's yours is mine. ~TM's Resident Master Thief~
  • Awards Members who have unlocked the robotic avatar Awarded to exemplary forum members 2 years on site+300 posts 3 years on site+600 posts Site art contributions/TPs in-game/Contest winners 1 year on site+100 posts
    • View Profile
    • Awards
  • Xbox: dryym
Re: System NPC behaviours
« Reply #8 on: January 02, 2016, 08:37:49 AM »
I'm not sure if this is all possible, but here are my ideas. I built these assuming the gamemode is either survival or DD, and not necessarily creative.



Djinn:

Wanders around a tree. Becomes aggressive towards any other non-Djinn mobs that get close to it.

You mean the Dryad. The Djinn are more or less Arabic demons. Dryads are tree sprites.

To add on to this, I believe Dryads should be neutral to players until they see a player either A cut down a tree, Or B attack another dryad.


Alright, Here we go.

Diablo: Wears Titanium Leggings, Gauntlets, And boots. (To reflect the avatar.) Spawns randomly with either their fists, A titanium sword, Or a Titanium Warhammer.

Diablos are smart and have the ability to pathfind around obstacles and traps.

When fought alone: A Diablo will strafe you whilst attacking you, When it's health gets below 25% it will attempt to retreat and regenerate. Diablos will receive an accelerated regeneration bonus when in lava.

When fought with other Diablos: When fighting multiple Diablos, They try to surround you to the best degree possible. Acting basically the same as solo combat other wise.

When fought with other mobs: When the Diablo sees another mob whilst in combat with you, It will call them into a formation dependant on the mob (See When rallied by Diablo.) and retreat to the back of the formation until all other mobs are killed.

The idea is that Diablos should be a sort of terrifying field general that makes mobs unite in formation to murder the player.


Orc: Spawns with iron armour, A steel shield, And a steel spear.

Orcs are rather stupid, They have a basic idea of how to avoid things that would get them killed. But in the heat of combat they may accidentally fall to their demise.

When fought alone: Orcs will play a more defensive role, Holding up their shield and waiting for you to move in close to attack.

When rallied by a Diablo: Orcs rallied by a Diablo will assume a phalanx formation. They synchronize their attacks so that large chunks of damage are done. When one of the front lines is killed, The orc behind it moves forward.

Orcs make good fodder, They are not weak, But they aren't strong. A good front line soldier that won't die immediately.

Feel free to make more militarized formation mobs, Ideally Diablos could rally up most mobs. I just can't think of many that would be a threat.


Spider: I'm assuming our spiders are like jumping spiders. Regardless, They need to be majorly buffed if this behaviour is to be added.

Spiders would run a check on their target to see if they could reasonably kill them. If so, They are labeled as prey, If not they are labeled as a predator.

A spider will attempt to stay behind it's prey, Slowly walking behind it until it gets within about 14 blocks away, At which point it will jump at them doing a large amount of damage if it hits.

If the spider can not kill the player within a few hits, It jumps about 25 blocks away (This is lower than realistic distance for a spider like that.) and continues to stalk them for another jumping attack.

This goes on until something dies.

If a spider labels something as a predator, It will flee if it gets closer.

Spiders would hunt and attack anything within a reasonable level of it.


Hermes Wraith: To me, The Wraith feels like it would be a great necromancer, It would attack you by launching fireballs from it's staff at long range, And hit you with it's sword at close range.

But the main danger of the wraith is that it summons zombies and skeletons which will not die until the wraith is killed.

Every 30 seconds the wraith will revive all dead minions back to 50% HP.
When the wraith dies, All summoned minions are killed.


Skeleton: The skeleton could spawn with any weapons and armour in the game, And is rather weak on it's own.

A ranged skeleton will stick back behind other mobs, And attack with it's weapon.

A melee skeleton will run forwards and attack with whatever weapon it has.

All skeletons in the world by default are summoned by necromancer wraiths.
When near a wraith, They can not die. Rather they are stunned when their HP reaches 0 and they will revive to 50% HP when the wraith uses it's revive ability.


Zombie: Spawns with nothing.

When a zombie attacks you, You have a chance to be poisoned. Draining HP at a rather slow rate until it wears off.

Zombies are really dumb, They cannot navigate the simplest of obstacles.

When near a wraith, They cannot die. Rather they are stunned when their HP reaches 0 and they will revive to 50% HP when the wraith uses it's revive ability.



Original: When you attack it, It becomes invincible until it either tries to attack you, Heals, Or moves.
Likewise, When it tries to attack you, It then waits to attack you until you either swing an item, Or move.

This is meant to sort of simulate a turn based combat system.
« Last Edit: January 06, 2016, 07:56:47 AM by Dryym »

Creator of the term "Deathmine "
Jared [19|Oct 07:12 PM]: "It changes everything" Dryym

amos

  • Member
  • ***
  • Posts: 231
  • Awards 1 year on site+100 posts
    • View Profile
    • Awards
Re: System NPC behaviours
« Reply #9 on: January 02, 2016, 10:52:36 AM »
Guard- can be stationary or wander within a certain distance from the Spawner.  Attacks hostile mobs with ranged attacks if it can't reach with melee.  If an attacker is close and the guard's health is high enough, they'll try swinging a shield to lessen incoming damage.  If health is low they can eat up to 3 pieces of food before fleeing towards other guards if possible.  If fighting multiple attackers Guards try to finish off weaker level opponents before taking on the target with the lowest health. 

I really like GK's idea with having follow, trade, and wait commands as conversation options.  Being able to set their follow distance and use either ranged or melee attacks would be great too.
« Last Edit: January 02, 2016, 11:21:31 AM by amos »

TM Charles

  • Supreme Member
  • *****
  • Posts: 2071
  • Awards Was in the top 10 of the forum stats page as of 4/12/15 3 years on site+600 posts Donated a giveaway prize. (Must be a prize of cash value.) 2 years on site+300 posts 1 year on site+100 posts
    • View Profile
    • ::)
    • Awards
  • Xbox: ETTP & Mr Zincy
Re: System NPC behaviours
« Reply #10 on: January 02, 2016, 11:02:38 AM »
Fish-These little water creatures will swim around (The air/warter) and have a chance to attack you. They have low health but pack a punch! commonly flees away from Fishermen.

I had to do fish there on the list!
« Last Edit: January 02, 2016, 11:06:51 AM by ETTP »



RavenPaw

  • Legendary Member
  • *****
  • Posts: 1025
  • Aka Cat
  • Awards 1 year on site+100 posts
    • View Profile
    • Awards
  • Xbox: Circle cat113
Re: System NPC behaviours
« Reply #11 on: January 02, 2016, 11:59:17 AM »
I should point out something this would be awesome! it would be like a minecraft mod called colony and with the lumberjack maybe if he brings stuff to you he will offer some to you for some gold (requires workbench and axe)? this would be quite awesome! 

maybe if you give Carpenter wood he will make something out of it? or he could buy some wood from lumberjack and craft it and sell it to you?  (requires workbench)

chef would buy ingredients from you and make stuff and sell it to you (Requires furnace)

#ButterThyStick( ͡ ͜ʖ ͡)

Jakub34

  • Member
  • ***
  • Posts: 227
  • Awards Members who have unlocked the robotic avatar 1 year on site+100 posts
    • View Profile
    • http://www.kongregate.com/games/Coolio_Niato/streamline?acomplete=streaml
    • Awards
  • Xbox: jakub34
Re: System NPC behaviours
« Reply #12 on: January 02, 2016, 12:40:20 PM »
Sage-Will pop up after collecting so many staffs and will help fight enemies and heal you when badly hurt.

Angel-Can be seen fighting off diablos and if you save one from death they will return with a reward and even say you from death.

Zeus-Will spawn if you kill a lot angels. If you manage to kill zeus he will drop many ores and armor.

Guard-Stays around houses to protect others from monsters

GoldenKnight-Proven to be the highest ranking of knights and is stronger than the ordinary knight and it is seen to carry greenstonegold tools.

Astronaut-Found near the top of the world and has many useful ores like titanium and diamond that can be earned if you get him/her certain items.




Craig

  • Developer
  • Extreme Member
  • ******
  • Posts: 6499
  • Dig Deep
  • Awards Developer 4 years on site+1000 posts 3 years on site+600 posts 2 years on site+300 posts Was in the top 10 of the forum stats page as of 4/12/15 Members who have unlocked the robotic avatar 1 year on site+100 posts Day 1 w/25+ posts (4/12/13)
    • View Profile
    • Twitter
    • Awards
Re: System NPC behaviours
« Reply #13 on: January 03, 2016, 06:45:45 AM »

amos

  • Member
  • ***
  • Posts: 231
  • Awards 1 year on site+100 posts
    • View Profile
    • Awards
Re: System NPC behaviours
« Reply #14 on: January 03, 2016, 12:51:57 PM »
Medic- Conversational dialog changes depending on your current hp, e.g.: "Good day!"/"Ouch! That looks painful, let's bandage that before it gets worse"/"Oh my word!  You require immediate medical attention!"

Responses e.g.:  "I'll survive"/"Yes, thank you. [pay x gold, where x = lost hp (just enough to be more expensive than eating food since there's no time/materials involved)]" and executes a healing script (maybe with a cooldown?)

If you wanted him to be more of an in-combat medic, he could follow a friendly target at a safe distance and swing food (or run a health script) on the ally with lowest health until everyone's above a certain threshold.  As a non-combatant if under attack he flees toward the nearest ally while healing himself to stay alive.
« Last Edit: January 03, 2016, 12:59:18 PM by amos »