NPC making howto

All development conversation and discussion takes place here

Moderator: Moderator

Message
Author
Shoob
Reaper
Posts: 1535
Joined: Mon Jan 22, 2007 6:31 pm
Location: East of the sun, west of the moon

Re: NPC making howto

#16 Post by Shoob »

ok... how about monsters for the maze....

not really a tolkeinish place, but we know that every labyrinth is mainly going to have just the minotaur. but how about this:

crazed adventurers (fighters, mages, etc)
skeletons of all sorts (from dead people who got lost in the maze)
guards?
cave trolls

or maybe just everything.
Oliphant am I, and I never lie.

Shoob
Reaper
Posts: 1535
Joined: Mon Jan 22, 2007 6:31 pm
Location: East of the sun, west of the moon

Re: NPC making howto

#17 Post by Shoob »

ok... added about 7 snakes... note that something is wrong with the last one... not sure how, but one ended up poisoning me when it isn't supposed to. Also, I know they have low damage... is it too low? They seemed ok when I tested them (except for the above).

Code: Select all

newEntity{
   define_as = "BASE_NPC_SNAKE",
   type = "animal", subtype = "snake",
   display = "J", color=colors.WHITE,
   body = { INVEN = 10 },

   max_stamina = 110,
   
   autolevel = "warrior",
   ai = "dumb_talented_simple", ai_state = { talent_in=3, },
   energy = { mod=1.3 },
   stats = { str=5, dex=23, mag=5, con=5 },
   combat_armor = 1, combat_def = 1,
}

newEntity{ base = "BASE_NPC_SNAKE",
   name = "large brown snake", color=colors.UMBER,
   desc = [[This large snake hisses at you, angry at being disturbed.]],
   level_range = {1, 50}, exp_worth = 1,
   rarity = 3,
   max_life = resolvers.rngavg(20,30),
   combat_armor = 1, combat_def = 3,
   combat = { dam=2, atk=30, apr=10 },
}

newEntity{ base = "BASE_NPC_SNAKE",
   name = "large white snake", color=colors.WHITE,
   desc = [[This large snake hisses at you, angry at being disturbed.]],
   level_range = {1, 50}, exp_worth = 1,
   rarity = 3,
   max_life = resolvers.rngavg(20,30),
   combat_armor = 1, combat_def = 3,
   combat = { dam=2, atk=30, apr=10 },
}

newEntity{ base = "BASE_NPC_SNAKE",
   name = "copperhead snake", color=colors.SALMON,
   desc = [[It has a copper head and sharp venomous fangs.]],
   level_range = {2, 50}, exp_worth = 1,
   rarity = 3,
   max_life = resolvers.rngavg(30,40),
   combat_armor = 2, combat_def = 5,
   combat = { dam=3, atk=30, apr=10 },
   
	talents = resolvers.talents{ [Talents.T_BITE_POISON]=1 },
}

newEntity{ base = "BASE_NPC_SNAKE",
   name = "rattlesnake", color=colors.FIREBRICK,
   desc = [[As you approach, the snake coils up and rattles its tail threateningly.]],
   level_range = {4, 50}, exp_worth = 1,
   rarity = 3,
   max_life = resolvers.rngavg(30,50),
   combat_armor = 2, combat_def = 8,
   combat = { dam=5, atk=30, apr=10 },
   
	talents = resolvers.talents{ [Talents.T_BITE_POISON]=1 },
}

newEntity{ base = "BASE_NPC_SNAKE",
   name = "king cobra", color=colors.GREEN,
   desc = [[It is a large snake with a hooded face.]],
   level_range = {5, 50}, exp_worth = 1,
   rarity = 6,
   max_life = resolvers.rngavg(40,70),
   combat_armor = 3, combat_def = 11,
   combat = { dam=7, atk=30, apr=10 },
   
	talents = resolvers.talents{ [Talents.T_BITE_POISON]=2 },
}

newEntity{ base = "BASE_NPC_SNAKE",
   name = "black mamba", color=colors.BLACK,
   desc = [[It has glistening black skin, a sleek body, and highly venomous fangs.]],
   level_range = {7, 50}, exp_worth = 1,
   rarity = 7,
   max_life = resolvers.rngavg(50,80),
   combat_armor = 4, combat_def = 12,
   combat = { dam=10, atk=30, apr=10 },
   
	talents = resolvers.talents{ [Talents.T_BITE_POISON]=3 },
}

newEntity{ base = "BASE_NPC_SNAKE",
   name = "anaconda", color=colors.YELLOW_GREEN,
   desc = [[You recoil in fear as you notice this huge, 10 meter long snake.  It seeks to crush the life out of you.]],
   level_range = {10, 50}, exp_worth = 1,
   rarity = 11,
   max_life = resolvers.rngavg(100,120),
   combat_armor = 14, combat_def = 5,
   combat = { dam=12, atk=10, apr=10 },
   energy = { mod=0.8 },

   	talents = resolvers.talents{ [Talents.T_STUN]=5 },
}
Oliphant am I, and I never lie.

darkgod
Master of Eyal
Posts: 10751
Joined: Wed Jul 24, 2002 9:26 pm
Location: Angolwen
Contact:

Re: NPC making howto

#18 Post by darkgod »

Shoob wrote: the main problem is that manathrust can be maxed at clvl 2 now and do about 120 damage then and then at lvl 5 it can do 200+ damage (if you spend skill points like I do). So my guess is by the time one is encountered they would be able to be killed in 2 or 3 hits... (even with the 1500hp) not quite what I have in mind, so hmmmm... it is your game though so, I will do whatever. I have gotten a non-crit manathrust up to the 300-400's before.
WE can make levels of manauthrust (and others) reaquire a stat or level too
[tome] joylove: You can't just release an expansion like one would release a Kraken XD
--
[tome] phantomfrettchen: your ability not to tease anyone is simply stunning ;)

darkgod
Master of Eyal
Posts: 10751
Joined: Wed Jul 24, 2002 9:26 pm
Location: Angolwen
Contact:

Re: NPC making howto

#19 Post by darkgod »

Snakes should maybe have a "snake" movement AI :)
Why the capital on Anaconda ? you planned on it being a unique ?
[tome] joylove: You can't just release an expansion like one would release a Kraken XD
--
[tome] phantomfrettchen: your ability not to tease anyone is simply stunning ;)

Shoob
Reaper
Posts: 1535
Joined: Mon Jan 22, 2007 6:31 pm
Location: East of the sun, west of the moon

Re: NPC making howto

#20 Post by Shoob »

Why the capital on Anaconda ? you planned on it being a unique ?
hmmm... nope, just wasnt paying attention to my capitals... make it lowercase and it is done, I'll just edit it to make it lowercase.
WE can make levels of manauthrust (and others) reaquire a stat or level too
we? :P I havent done any coding yet :) but yeah... arcane knowledge needs to get higher as you learn it too. though what really makes a difference is finding a staff of power with +25spell power.
Snakes should maybe have a "snake" movement AI
what would it look like? move back and forth diagonally if possible? :P

and do you like their higher speed, high attack, and low damage? should I up the apr?

I will work on bears next. Looks like I am in an animal mood, though most of mine are low level. I guess they can inhabit the old forest or something.

and a thought... what category would you put mumakil in? and what else would fit in it? not like we really are going to have them in here soon though as they are massively ood like the ettin :mrgreen:
Oliphant am I, and I never lie.

darkgod
Master of Eyal
Posts: 10751
Joined: Wed Jul 24, 2002 9:26 pm
Location: Angolwen
Contact:

Re: NPC making howto

#21 Post by darkgod »

Hum ye probably too generous with the stats of power.

Level 9 ? Ah tha'ts great exacty inthe range I had planned :) (and this is why no ettenmoors, two places per starting znoe seems enough).

Yes .. snaking around :)

THe snakes look fine, I cant test test currently because I broke my AI code and no monster ever atatck me :)
[tome] joylove: You can't just release an expansion like one would release a Kraken XD
--
[tome] phantomfrettchen: your ability not to tease anyone is simply stunning ;)

darkgod
Master of Eyal
Posts: 10751
Joined: Wed Jul 24, 2002 9:26 pm
Location: Angolwen
Contact:

Re: NPC making howto

#22 Post by darkgod »

What is T_BITE_POISON definition ?
[tome] joylove: You can't just release an expansion like one would release a Kraken XD
--
[tome] phantomfrettchen: your ability not to tease anyone is simply stunning ;)

Shoob
Reaper
Posts: 1535
Joined: Mon Jan 22, 2007 6:31 pm
Location: East of the sun, west of the moon

Re: NPC making howto

#23 Post by Shoob »

Code: Select all

newTalent{
	short_name = "BITE_POISON",
	name = "Poisonous Bite",
	type = {"physical/other", 1},
	points = 5,
	message = "@Source@ injects poison into @target@.",
	cooldown = 1,
	range = 1,
	action = function(self, t)
		local x, y, target = self:getTarget()
		if math.floor(core.fov.distance(self.x, self.y, x, y)) > 1 then return nil end
		self.combat_apr = self.combat_apr + 1000
		self:attackTarget(target, DamageType.POISON, 2 + self:getTalentLevel(t), true)
		self.combat_apr = self.combat_apr - 1000
		return true
	end,
	info = function(self)
		return ([[Bites into the target, injecting it with poison.]])
	end,
}
I know I should be more creative, but I am too lazy. :D Do you think that I should do a longer or shorter cooldown than that? I eventually will want to make their attack poison and maybe remove the talent, but this is what I am doing for now.

and a comment... I would change

Code: Select all

if math.floor(core.fov.distance(self.x, self.y, x, y)) > 1 then return nil end
to

Code: Select all

if math.floor(core.fov.distance(self.x, self.y, x, y)) > range then return nil end
so if the range is changed you wouldn't have to change it twice.
Oliphant am I, and I never lie.

darkgod
Master of Eyal
Posts: 10751
Joined: Wed Jul 24, 2002 9:26 pm
Location: Angolwen
Contact:

Re: NPC making howto

#24 Post by darkgod »

True enough :)
[tome] joylove: You can't just release an expansion like one would release a Kraken XD
--
[tome] phantomfrettchen: your ability not to tease anyone is simply stunning ;)

Shoob
Reaper
Posts: 1535
Joined: Mon Jan 22, 2007 6:31 pm
Location: East of the sun, west of the moon

Re: NPC making howto

#25 Post by Shoob »

ok, I realized that either there is going to be a lot of talents or maybe there is a way to generalize this:

What I am thinking is maybe do add sub-talents (wrong word, but meh), that is we have base types (bite, sting, crawl, breath, etc), basically just how the damage is being done... then we tell it which damage type to use (poison, acid, cold, fire, etc). so it would look something like this in some cases (stun and knockback are fine atm)

Code: Select all

talents = resolvers.talents{ [Talents.bite(poison)]=1 }
the other way to do this is to have an even more general solution. that is instead of saying bites/crawls/stings/claws poison into the target, we say @source@ poisons the @target@. then we just have a poison talent instead of multiple poison types.

which way would you prefer? I would lean toward the former as it would be nice to set various cooldowns for each of them.

and something unrelated to the above: It would be nice to have an erratic movement (I was thinking of having it somewhat along the lines of what energy looks like, with 0 being not erratic, and 2 being very erratic, if not specified it defaults to 0.)

I have so many ideas for monsters right now... mostly just rats and bats and bears and ants and insects and birds and plants and felines but that is it.
Oliphant am I, and I never lie.

darkgod
Master of Eyal
Posts: 10751
Joined: Wed Jul 24, 2002 9:26 pm
Location: Angolwen
Contact:

Re: NPC making howto

#26 Post by darkgod »

Good I like people that have ideas about monsters ;)

Code: Select all

talents = resolvers.talents{ [Talents.bite(poison)]=1 }
That cant work because npcs are dynamic while talents are not.This means new talents would be defined while the game runs, and that would .. well .. not work.

Yes this will do many talents, but then, it's not really a problem either.

BTW you can get creative on the attacks, like a melee freeze-like talent that has one chance in X of freezing its target, based on physical resistance instead of spell resistance, ...

For resstances there are two kinds:
- "personal" resistances (Spell, Mental, Physical): they derive from a stat (mag, wil/cun, str) and have no bound. They work as a checkHit, it is the strength/spellpower/... of the ennemy against your resistance, just like a melee hit is a check of atatck against defense.
- "damage type" resistances (fire, cold, nature, .....): they are a % damage reduction for the given damage type

So the personal resists are more like saving throws.
[tome] joylove: You can't just release an expansion like one would release a Kraken XD
--
[tome] phantomfrettchen: your ability not to tease anyone is simply stunning ;)

Shoob
Reaper
Posts: 1535
Joined: Mon Jan 22, 2007 6:31 pm
Location: East of the sun, west of the moon

Re: NPC making howto

#27 Post by Shoob »

Code: Select all

newEntity{ --rodent base
	define_as = "BASE_NPC_RODENT",
	type = "vermin", subtype = "rodent",
	display = "r", color=colors.WHITE,
	can_multiply = 2,
	body = { INVEN = 10 },

	autolevel = "warrior",
	ai = "dumb_talented_simple", ai_state = { talent_in=3, },
	energy = { mod=1 },
	stats = { str=8, dex=15, mag=3, con=5 },
	combat_armor = 1, combat_def = 1,
}

newEntity{ base = "BASE_NPC_RODENT",
	name = "giant white mouse", color=colors.WHITE,
	level_range = {1, 3}, exp_worth = 1,
	rarity = 4,
	max_life = resolvers.rngavg(5,9),
	combat = { dam=5, atk=15, apr=10 },
}

newEntity{ base = "BASE_NPC_RODENT",
	name = "giant brown mouse", color=colors.UMBER,
	level_range = {1, 3}, exp_worth = 1,
	rarity = 4,
	max_life = resolvers.rngavg(5,9),
	combat = { dam=5, atk=15, apr=10 },
}

newEntity{ base = "BASE_NPC_RODENT",
	name = "giant white rat", color=colors.WHITE,
	level_range = {1, 4}, exp_worth = 1,
	rarity = 5,
	max_life = resolvers.rngavg(15,20),
	combat = { dam=7, atk=15, apr=10 },
}

newEntity{ base = "BASE_NPC_RODENT",
	name = "giant brown rat", color=colors.UMBER,
	level_range = {1, 4}, exp_worth = 1,
	rarity = 5,
	max_life = resolvers.rngavg(15,20),
	combat = { dam=7, atk=15, apr=10 },
}

newEntity{ base = "BASE_NPC_RODENT",
	name = "giant rabbit", color=colors.UMBER,
	desc = [[Kill the wabbit, kill the wabbit, kill the wabbbbbiiiiiit.]],
	level_range = {1, 4}, exp_worth = 1,
	rarity = 6,
	max_life = resolvers.rngavg(20,30),
	combat = { dam=8, atk=16, apr=10 },
}

newEntity{ base = "BASE_NPC_RODENT",
	name = "giant crystal rat", color=colors.PINK,
	desc = [[Instead of fur this rat has crystals growing on its back which provide extra protection.]],
	level_range = {1, 5}, exp_worth = 1,
	rarity = 6,
	max_life = resolvers.rngavg(35,50),
	combat = { dam=7, atk=15, apr=10 },
	combat_armor = 4, combat_def = 2,
}

newEntity{ base = "BASE_NPC_RODENT",
	name = "cute little bunny", color=colors.SALMON,
	desc = [[It looks at you with cute little eyes before jumping at you with razor sharp teeth.]],
	level_range = {1, 15}, exp_worth = 3,
	rarity = 200,
	max_life = resolvers.rngavg(15,20),
	combat = { dam=50, atk=15, apr=10 },
	combat_armor = 1, combat_def = 20,
}

newEntity{ base = "BASE_NPC_RODENT",
	name = "giant grey mouse", color=colors.SLATE,
	level_range = {1, 3}, exp_worth = 1,
	rarity = 6,
	max_life = resolvers.rngavg(5,9),
	combat = { dam=5, atk=15, apr=10 },
	talents = resolvers.talents{ [Talents.T_CLAW_POISON]=1 },
}

newEntity{ base = "BASE_NPC_RODENT",
	name = "giant grey rat", color=colors.SLATE,
	level_range = {1, 4}, exp_worth = 1,
	rarity = 7,
	max_life = resolvers.rngavg(15,20),
	combat = { dam=7, atk=15, apr=10 },
	talents = resolvers.talents{ [Talents.T_CLAW_POISON]=1 },
}
I put the 2 with talents at the bottom of the file... so as to avoid the unmeaningful gains of the talents.
also they seem to take over the forest, but now I have added back in my other animals so we shall see how popular they are now.
Oliphant am I, and I never lie.

darkgod
Master of Eyal
Posts: 10751
Joined: Wed Jul 24, 2002 9:26 pm
Location: Angolwen
Contact:

Re: NPC making howto

#28 Post by darkgod »

imported!
thanks
[tome] joylove: You can't just release an expansion like one would release a Kraken XD
--
[tome] phantomfrettchen: your ability not to tease anyone is simply stunning ;)

Shoob
Reaper
Posts: 1535
Joined: Mon Jan 22, 2007 6:31 pm
Location: East of the sun, west of the moon

Re: NPC making howto

#29 Post by Shoob »

heheh, I tried to put back in my old animals but they are not being imported for some reason... hmmm... I put the code in the zone, but it wasnt working, oh well, it is fine though, I can just add in more stuff and test it and then move it to the correct place.
Oliphant am I, and I never lie.

Shoob
Reaper
Posts: 1535
Joined: Mon Jan 22, 2007 6:31 pm
Location: East of the sun, west of the moon

Re: NPC making howto

#30 Post by Shoob »

Ok... bears are in mine, not sure if I am happy or not though... they are meant to be more mid range animals, they have more hp than trolls, but do less damage (with more apr though) I did do these rather quickly as I wanted to get them in on time for the release... if you want me to work on them more, let me know.

Code: Select all

newEntity{
	define_as = "BASE_NPC_BEAR",
	type = "animal", subtype = "bear",
	display = "q", color=colors.WHITE,
	body = { INVEN = 10 },

	max_stamina = 100,

	autolevel = "warrior",
	ai = "dumb_talented_simple", ai_state = { talent_in=5, },
	energy = { mod=0.9 },
	stats = { str=18, dex=13, mag=5, con=15 },
	
	combat_armor = 1, combat_def = 1,
	combat = { dam=resolvers.rngavg(12,25), atk=10, apr=10, physspeed=2 },
	life_rating = 13,
	tmasteries = resolvers.tmasteries{ ["physical/other"]=0.25 },

	resists = { [DamageType.FIRE] = 20, [DamageType.COLD] = 20, [DamageType.POISON] = 20 },
}

newEntity{ base = "BASE_NPC_BEAR",
	name = "brown bear", color=colors.UMBER,
	desc = [[The weakest of bears, covered in brown shaggy fur.]],
	level_range = {5, 50}, exp_worth = 1,
	rarity = 7,
	max_life = resolvers.rngavg(100,150),
	combat_armor = 7, combat_def = 3,
	talents = resolvers.talents{ [Talents.T_STUN]=1 },
}

newEntity{ base = "BASE_NPC_BEAR",
	name = "black bear", color=colors.BLACK,
	desc = [[Do you smell like honey, 'cause this bear wants honey.]],
	level_range = {6, 50}, exp_worth = 1,
	rarity = 7,
	max_life = resolvers.rngavg(120,150),
	combat_armor = 8, combat_def = 3,
	talents = resolvers.talents{ [Talents.T_STUN]=1 },
}

newEntity{ base = "BASE_NPC_BEAR",
	name = "cave bear", color=colors.DARK_SLATE_GRAY,
	desc = [[It has come down from its cave foraging for food. Unfortunately, it found you.]],
	level_range = {7, 50}, exp_worth = 1,
	rarity = 8,
	max_life = resolvers.rngavg(130,150),
	combat_armor = 9, combat_def = 4,
	combat = { dam=resolvers.rngavg(13,17), atk=7, apr=7, physspeed=2 },
	talents = resolvers.talents{ [Talents.T_STAMINA_POOL]=1, [Talents.T_STUN]=2, [Talents.T_KNOCKBACK]=1,},
}

newEntity{ base = "BASE_NPC_BEAR",
	name = "war bear", color=colors.DARK_UMBER,
	desc = [[Bears with tusks, trained to kill.]],
	level_range = {8, 50}, exp_worth = 1,
	rarity = 8,
	max_life = resolvers.rngavg(140,150),
	combat_armor = 9, combat_def = 4,
	combat = { dam=resolvers.rngavg(13,17), atk=10, apr=7, physspeed=2 },
	talents = resolvers.talents{ [Talents.T_STAMINA_POOL]=1, [Talents.T_STUN]=2, [Talents.T_KNOCKBACK]=1,},
}

newEntity{ base = "BASE_NPC_BEAR",
	name = "grizzly bear", color=colors.LIGHT_UMBER,
	desc = [[A huge, beastly bear, more savage than most of its kind.]],
	level_range = {10, 50}, exp_worth = 1,
	rarity = 9,
	max_life = resolvers.rngavg(150,170),
	combat_armor = 10, combat_def = 5,
	combat = { dam=resolvers.rngavg(15,20), atk=10, apr=7, physspeed=2 },
	talents = resolvers.talents{ [Talents.T_STAMINA_POOL]=1, [Talents.T_STUN]=3, [Talents.T_KNOCKBACK]=2,},
}
Oliphant am I, and I never lie.

Post Reply