Total Miner > Creative Features

[NPCs] System NPC behaviours

(1/7) > >>

Craig:
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.


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


--- Quote from: amos 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. 

--- End quote ---



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.

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


--- Quote from: Clerical on January 04, 2016, 05:45:03 AM ---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

--- End quote ---



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.

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


--- Quote from: amos on January 11, 2016, 01:12:48 AM ---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.

--- End quote ---





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


--- Quote from: amos 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?)

--- End quote ---





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

Craig:
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

The Gold Knight:
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:
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.

Tom:
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.

Navigation

[0] Message Index

[#] Next page

Go to full version
Powered by Advanced Topic Prefix Pro