🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

defend sacred animals quest

Started by
12 comments, last by Norman Barrows 7 years, 10 months ago

looks like this quest gen is going to need some more work. i tried spawning the herd and hunters at the same time. but the herd is just a random wilderness encounter based on terrain type, which is often a critter the hunters can't really take on. and the hunters are using "defend location" AI, with the quest location as the location to defend. the critters follow their normal AI for their species, which is either "defend against weaker and flee from stronger" or that plus "hunt or pack hunt equal or weaker" (for predators). put it all together, and the hunters attack whatever is closest to their spawn point, even if its a herd animal they can't possibly kill. when they get close to a tough herd animal, the herd animal moves to attack them, and the hunters flee back to the spawn point, then turn and attack whatever is closest once again. if the player remains farther than the herd from the hunters, the hunters ignore the player. in some cases the herd is predators (american scimitar cat) and attacks and kills the player. in other cases the herd (woolly mammoth) kills the hunters! about the only thing left to try is spawning the herd far from the quest location, so the player is guaranteed to be the closest thing to the quest location the hunters are defending. that might get the desired basic behavior, but technically it wouldn't really be the desired behavior. the hunters should attack the player, not defend a location. or they should attack the herd until the player attacks them, then attack the player. and the herd should probably be something that hunters might hunt, and not a "sacred" sabertooth or some other impossible to kill critter.

hmm... why does everything always have to be complicated? <g>.

Norm Barrows

Rockland Software Productions

"Building PC games since 1989"

rocklandsoftware.net

PLAY CAVEMAN NOW!

http://rocklandsoftware.net/beta.php

Advertisement
I'm not much of a programmer, but maybe my attempt to help could be salvaged in some way, shape, or form. :P I'm going to play this off the awesome salt lick idea and using deer as an example herd.

Instead of using data and values, with my tiny brain I'mma refer to them as tags. Now what if you 'tagged' the hunters (going to just call it a red tag) and the deer (yellow tag). NPCs with the red tag could be set to ignore or be neutral to creatures except for those with the yellow tag, which they pursue. Yellow tags obviously try and avoid these.

Now to make the salt licks work, you could use them as the center of an invisible circle that NPCs with the yellow tags cannot pass. If a yellow tagged NPC hits the wall they're re-directed away from it.

Using some tagged animals would allow you to be a bit more selective in what happens, right? Red tags pursue purple and yellow tags. Purple tags aggro on red tags after x. Yellow tags flee red tags.

Will Design Games For Food.

I'mma refer to them as tags.

tags / variables - same difference.

only problem is you have to add any new tags and any new AI behaviors to the game engine that don't yet exist.

right now the only tags are:

what species the critter is

badguy or neutral for people

a tag if the critter uses "defend location" AI instead of the normal AI for its species or NPC type.

a tag if the person or animal is part of this quest.

and the only behaviors are:

non-predator: flee from stronger - defend against others.

predator: as non-predator + hunt or pack hunt not-stronger prey.

defend location: attack whatever is closest to some location that is a different species.

badguy: attack player and neutral NPCs

neutral: attack badguys

predator or non-predator is assigned on a per species basis. so for example, all sabertooths are predator AI by default.

a tag (flag / boolean variable) indicates if a critter uses defend location AI instead of the usual predator or non predator AI for its species. that way you can spawn a herd of anything you want and make them defend a location for a quest. defend location is fight to the death AI, it will never flee.

by making the hunters badguys, they will automatically attack the player. by making them defend location, they will attack anything near the "location".

both predator and non-predator AI include behaviors like wander, flock, and migrate. migrate makes them wander away after a while. defend location AI doesn't migrate or wander. if its far from the location, it moves to the location. else if there's anything near the location, it attacks, else it just stands, waiting for something to approach the location.

the problem is the existing tags and behaviors aren't exactly whats desired. or at least i haven't come up with a combo of setting that ought to work. spawning badguys (but not defend location badguys) at the quest location and spawning the herd some distance away might work. the badguys would only attack the player, not whatever is close.

but the herd sill might be a nasty critter (mammoth), and if its in the way, it might kill the hunters trying to get to the player.

or the herd might be a predator (sabertooth, etc) and eat everyone - hunters and player alike!

this might turn out to be a quest where the herd does the work for the player some of the time. unless i make the herd weak prey.

and there are no encounter tables for weak prey, only common, uncommon, and quest for each of 8 or 9 terrain types.

its not that its not do-able, its really a matter of how to do it with the least amount of effort.

Norm Barrows

Rockland Software Productions

"Building PC games since 1989"

rocklandsoftware.net

PLAY CAVEMAN NOW!

http://rocklandsoftware.net/beta.php

i changed the hunters from quest hostiles with defend location AI to ordinary hostile cavemen who just attack the player. the herd is still just an ordinary random animal encounter. i'm using "no hostile caveman within 500 ft of player" as the check for success (IE all dead / run off).

seems to work ok, but the herd can still be a predator, or a large animal capable of killing the player if they get too close.

of course, nothing said the herd animals weren't dangerous... just that they were "sacred". ; )

does this sound ok? or am i being a little too sneaky as a DM here? <g>.

Norm Barrows

Rockland Software Productions

"Building PC games since 1989"

rocklandsoftware.net

PLAY CAVEMAN NOW!

http://rocklandsoftware.net/beta.php

This topic is closed to new replies.

Advertisement