Sign in to follow this  
DevBlog

Wurm Dev Blog: Crazy Creatures

Recommended Posts

A couple of years ago on Xanadu there was a lot of people not really finding anything to kill in areas they were trying to hunt in, despite the server having a much higher total creature population than any other server. At that time there was some investigation into these claims, to see just where all the creatures were and what they were doing – and that lead to a few tweaks on how the creatures spawned to help make things feel a bit better.

Just recently I saw another comment that was much the same as comments a couple of years ago before those changes, talking about not seeing any mobs to kill in their area and finding nothing substantial when out hunting. For a little while now I’ve had various plans to update the creature system in Wurm in a couple of ways – so this seems like a good place to start on what those changes are, why I’d like to do them, and how they might help out on any issues players might have relating to current creatures.

 

Current Creature Capabilities

First off, back when this was first looked at there was a new command added to the game for the devs to use to make the server dump out a map with all the current creature locations for the entire server. This map was used to find where problem areas might have been in how creatures spawned and moved, and to see why people were finding nothing to kill. The output of such map looks something like the below, and shows a marker on every tile where a creature is currently sitting.

creatures.png
Typical creature distribution in an area with little to no deeds.

With this view of everything on a server, it gives us a better look at where creatures are, how they are moving, and where they are avoiding. As expected and experienced by players, the areas near deeds and well travelled highways tend to be very sparsely populated by creatures because of a combination of players killing creatures they see, spirit templars and guard towers, and large amounts of areas being taken up by deeds and buildings where creatures do not spawn. In the creature pathing code you also have a tendency for most creatures to try and avoid deeds if possible – this doesn’t always happen as anyone with spirit templars will know, but they do try to avoid guarded deeds when they move. Adding onto this is the fleeing mechanic that controls how creatures behave when getting near other hostile creatures or near players.

creaturedeeds.png
How areas around some deeds may look. Happy hunting to those that recognise their deed.

With herbivores not liking the presence of players leading to them running away from them and other aggressive creatures, combined with them generally not spawning too close to deeds and buildings, and add in player’s proclivity to kill anything they see anywhere near their deeds, you can get some areas looking like the above – creatures finding their safe spaces in areas of land between deeds that are less travelled by players.

Now as if this isn’t enough, carnivorous creatures also like to hunt – and where do they go to get their feast on? To the large grouping of herbivores running away from the nasty players. All of these interactions can compound with each other until you get the odd worst-case scenario that pops up in a couple of small areas on each map.

packing.png
A piece of land squished between a large deed and a cliff. Farm animals galore.

This isn’t so much a widespread problem however, a large percentage of the map looks like the very first image above – good distribution of creatures across the large majority of the map. That’s not to say that some things cannot be improved though.

 

Corralling Confined Creatures

There are a few main areas where we could improve how creatures spawn and move around. The first is one that a large portion of the playerbase experience, and that is creatures that are penned up and stuck on deed trying to path their way outside of those pens and eventually all ending up stuck in various corners. This feature isn’t something that is unique to Wurm as I have seen the same behaviour in penned creatures in other games, and it comes with an interesting explanation. When a creature chooses a place to go, it will pick a tile in its range and then try its best to get to that tile – if it can find a valid path going around obstacles, through unlocked gates and around houses it will – but when it can’t it will most of the time just sit still instead, trying again for a different tile in range later.

Now when a creature is inside a pen there are a lot less valid tiles that it can move to. It can move inside the pen and that’s about it. If your prized cow is sitting in the center of a large pen it can move to every tile around it since its max range is still inside the pen. But after that movement the cow is now closer to the edge of the pen, and half of the tiles it can try to move to are outside of the pen – so half the time when it picks a new tile to move to, it will do nothing. Leave that running for long enough and the cow will eventually run itself into a corner tile, where 75% of the tiles in range are outside of the pen – so 75% of its new movements are doing nothing because it is trying to get to an invalid tile.

cowexample.png
Left: All tiles in range are valid. Center: Some tiles outside of the pen are invalid. Right: Majority of tiles in range are invalid.

A potential fix to this is actually reusing movement code that some other creatures use. Instead of picking a tile and trying to make their way to it, when these creatures have nothing better to move towards (like an easy kill while hunting) they will pick a direction and walk in that direction, turning every now and then, bouncing off obstacles like walls and fences, and just generally wandering aimlessly. Applying this code to penned creatures would mean less movement checks that end in them stuck in one spot, and more randomly moving around their available space – they will be able to walk up to the edge of their pen, then turn in a direction away from the fence or wall, and carry on in that other direction.

Looking at it from a different direction, another way to possibly fix this issue would be to make creatures want to avoid tiles that already have other creatures on them or nearby them when possible. Ideally this would make bunched up creatures naturally spread out when they have no specific tile they are pathing towards leading to more evenly spread pens, and would also help out with another issue described above with creatures naturally gathering at certain points on the map in large groups currently.

 

Counseling Cowardly Creatures

For the issue of creatures seemingly grouping up at similar distances from active deeds as shown in the map view with deeds earlier, one easy change that we’ll be testing is simply tweaking the range that these fleeing creatures react to players. This will make them far less likely to scatter from an area around a deed, and instead just try and keep their distance from players when they are in a more realistically visible range. Adding onto this is a new system I’d like to try on these creatures to make them a bit more smart in choosing where they are running to when fleeing.

At the moment when a fleeing creature is picking a new tile to run towards, it will take a look at all of the creatures it can see in range, and will attempt to run directly away from the first player or aggressive creature is sees in that list. This can mean that in their fleeing from one creature, they might run directly towards another that they would also rather not be near. To get them to choose their destination a little bit smarter instead of just running away from the first creature in their range, all of the tiles in their range will be weighted based on the relative distance and strength of enemy creatures nearby. This will give them a clear list of lowest risk tiles they should path to which can be used to decide where they move.

fleeingexample.png
Blue: Creature, Orange: Enemies, Green: Lowest risk tiles to move to.

As a secondary addition to this heatmap-like system that we may test down the line would be to include other non-aggressive mobs to the tile weighting, making creatures less likely to travel to a tile that already has some other creatures on it.

 

Changing Creature Creation

In a similar manner to the above heatmap system to be tested with fleeing creature movements, in the near future I’ll be testing out another heatmap system for creature spawns. This would be a cached version of all the map tiles with a weighting based on deeds, guard towers and highways. Tiles closer to guard towers or deeds with templars would be weighted based on their distance to the deed/tower and the number of templars or tower guards. What this would allow is more precision in spawning creatures based on how safe or wild the area is – areas closer to deeds and towers tend to be more safe, so more passive and weaker mobs would spawn in those areas. Moving further out from these areas would take you farther into wilderness with stronger creatures spawning.

This heatmap could then also be used to pick out best areas to spawn uniques or future more difficult creatures that we think up. We’d be able to safely spawn uniques out in the relative wilderness, out of the way of deeds and the destruction uniques may cause to them. This would ideally cause a more fluid system for hunting, with lower skilled players being able to feel relatively safe in areas that are well guarded or well travelled, while seasoned hunters will have a better idea of where they can travel to have a real fight.

Finally, just in relation to creature numbers and how rare some creatures are compared to others – we’ll be taking another look at those after the above changes are live and working. The current hope is that the spreading out of these wild creatures more will make it more obvious what creatures are around and what creatures are actually pretty scarce. From there we can once again look at tweaking the percentages in what some creatures spawn.

As for now though, we’re currently testing some of the changes and ideas talked about here on the test servers, with some of them due to be put onto one of the smaller Freedom servers in the near future for some better live testing. Once they are confirmed to be working as intended and not causing any extra stress on the servers they will be rolled out across all of the servers. We hope they’ll make a nice difference to your farms and hunting experiences.

// TODO: Insert outro here.
// @author: Budda

  • Like 27

Share this post


Link to post
Share on other sites

Thanks a lot for the explanation and showing the plans! It seems these could ease the issue - and hopefully will not ask for too much extra computing resources.

In my unprofessional view the desire to avoid tiles where other creatures are already present would distribute the wild flock and more importantly the diseased penslaves. I still deny to make 1x2 pens for the horses as those feel too tight, I hope my typical 3x3 or larger pens with 4-6 animals in each will be more sustainable soon :D

  • Like 2

Share this post


Link to post
Share on other sites

sounds good. maybe add 2 variables.

1. non aggressive creatures to have a 3rd check for running away from other non aggressive creatures.

2. land creatures to prefer to run to tiles higher than 2 above sea level, so they dont end up swimming by

the dozens.

  • Like 1

Share this post


Link to post
Share on other sites

Aye, that horde of swimming horses would be good to avoid.

I suppose the other issue, mobs on steep mountainsides are harder to avoid, that is not a simple heightcheck. Maybe that will be eased with the other changes anyway.

Share this post


Link to post
Share on other sites

Hunting uniques = look for a place where there are no cows. ;)

 

I'd also like to suggest that the more aggressive creatures may end up starving more frequently with the new system.  Can they be set to never starve, just in case all the non agros find a way to escape?

 

This looks extremely promising!

Share this post


Link to post
Share on other sites

It's very interesting to get an insight into what you are using to evolve your plans with this. Thank you for going into detail. I look forward to the implementation - can I volunteer Release as "one of the smaller Freedom servers"? =)

Share this post


Link to post
Share on other sites

glad this is being addressed, its bothered me for years.

Share this post


Link to post
Share on other sites

is there a way we can also incorporate into the system that animals who shouldn't be capable of climbing steep mountainsides be restricted from specific slopes? (not sure if this is already implemented or not, just suggesting)

 

also, will there be some kind of exception put in place for deeds that contain both hostile and non-hostile creatures in pens? The last thing I want is for all my horses to run to one side or corner of their pens because they might be too close to the hell horses or champ cats....

Edited by koroth
additional question
  • Like 3

Share this post


Link to post
Share on other sites

Might i suggest while you are looking at the animals that you allow the passive creatures the ability to swim so that we can get these farm animals back to your deeds. I see no reason to stop cattle, bison, sheep and all the other farm like animals from being able to be lead and brought back to our deeds by boat. (If you have to put a thing on them where they can only swim while they are being lead or something if that is an issue) 

  • Like 4

Share this post


Link to post
Share on other sites

All I wanna know is how this will affect server tick rates or cycle times?  Will it increase the lag at all for us or is it just compiling already available information for you?

Edited by Nomadikhan

Share this post


Link to post
Share on other sites

Get rid of the whole "docile critters run away" mechanic entirely. . I know it was supposed to be an AI "improvement", but honestly, it's been nothing but a pain in the ass from the very start.
 

1 hour ago, koroth said:

is there a way we can also incorporate into the system that animals who shouldn't be capable of climbing steep mountainsides be restricted from specific slopes? (not sure if this is already implemented or not, just suggesting)

We had a slope restriction years ago which ended up getting reversed.  IIRC, the team set it so that it only checked uphill climbs only. What ended up happening was people started digging pits all over the place to capture as many critters as they could. This became problematic because people forgot about their pits, or they quit the game, and the critters had no way of getting out of their imprisonment. So, while the critter numbers for the server looked good (it was only Indy at the time), it was getting harder and harder to find any critters to kill.... unless you happened to stumble on someone's pit, which usually had 50+ critters in them. 

Edited by As_I_Decay
  • Like 7

Share this post


Link to post
Share on other sites

I like the 1st option of animals not trying to avoid each other all the time.  I'm thinking that would make maybe hunting area sparse.  Right now there are good area on Xan to hunt.  Some places have 50 horses to kill which is great for grinding.

 

Also maybe see 2nd option pushing more creatures up mountains.

 

Can you add to the animals logic to not go up mountains or certain slopes all together?  Traveling around you'll see like 50 creatures on the side of a mountain with some being in ridiculous high up areas ..  Having creatures avoid mountains would be great to add as part of this.

 

I know hunting deer near mountains is pointless.  They just run super quick up mountain....Gone....

Edited by nicedreams
Spelling
  • Like 1

Share this post


Link to post
Share on other sites

Nice to see some action on this front.

 

I was never a big fan of the 'they run away' mechanic because it basically turned deer into something you couldn't catch even if you wanted to...

(It also created problems when they added the 'movement triggers a packed tile' thing...where they would run around so much until your whole pen was packed within less than a day...from full wild grass in a 5x5 to all packed..this gave me huge thatching gains but broke the ability to have a 'free range' pen and forced me to start participating in the 2x1 pens idea. Youngsters are especially bad about this..which I suppose is semi realistic, but is annoying instead as no matter how many times you replant, they just promptly destroy the grass you've grown and it never recovers...hence the suggestion many people had for a trough or something for our pens. Which would only work if the animals weren't so dumb to not ever move to the tile with food on it...)

 

...as they are constantly bolting at high speed away from you anytime you even see them...so trying to get them to stand still for a quick tame to bring home really sucked. You end up chasing them around for half an hour.

 

I can see why the predator/prey mechanic was useful...because it allowed hostiles to clean up/kill off/force a re-spawn of the mobs that just sit around...(And it was interesting to be out and about and hear a clash between a pair of animals going on and try and find them both).

They do end up sitting on mountains a lot, and since Xan has server height mountains galore, that means there's a lot of inaccessible creatures. Maybe make animals that shouldn't be hanging out on mountains unable to climb somehow, or force them to move down off them somehow...(I don't know whether it's possible to include a height check/what that would do lag-wise, but it's just a thought.) I'm personally in a really bad spot mountain-wise, and only really have a valley between two giant mountains down to me...and mobs probably just don't want to come off those mountains. It doesn't make sense for all of the mobs to hang out up on these mountains that are impossible to climb to get to them...so maybe the few that should be on the mountains could climb over/promptly move down the other sides...and the rest should just be contained in the valleys between them. (The downside I see to this is that with too many mountains/mountainous areas...you'd have mobs spawning on one side, that couldn't ever get to the other side...but this is slightly more realistic...because it's not like mountain-cows or whatnot make sense anyway...)

 

Anyway, thanks for looking into it and showing some progress/ideas on this...as it's been a personal pet peeve for a long time now. (I know, I gripe too much about it.)

  • Like 1

Share this post


Link to post
Share on other sites
3 hours ago, Nomadikhan said:

All I wanna know is how this will affect server tick rates or cycle times?  Will it increase the lag at all for us or is it just compiling already available information for you?

 

Budda and I, as well as the rest of the team, are very keen on complexity and reducing lag rather than adding to it.

 

I found the time to get some profiling running on Oracle (our test server) and we have plans to introduce it to live servers as well. The profiling of Oracle alone has already given us a few hot spots that we hadn't considered looking at yet, and that was with zero player load and a rather modest creature count.

 

It may be a good topic for another dev blog once we have some fixes in the pipeline and more data.

  • Like 5

Share this post


Link to post
Share on other sites
4 hours ago, Nomadikhan said:

All I wanna know is how this will affect server tick rates or cycle times?  Will it increase the lag at all for us or is it just compiling already available information for you?

 

Most of the changes shouldn't have a huge effect. The only one that might have any effect is the tile ranking that fleeing creatures will do, which is why I want to try it out on a smaller live server first so we can get some profiling data on it.

 

5 hours ago, koroth said:

is there a way we can also incorporate into the system that animals who shouldn't be capable of climbing steep mountainsides be restricted from specific slopes? (not sure if this is already implemented or not, just suggesting)

 

also, will there be some kind of exception put in place for deeds that contain both hostile and non-hostile creatures in pens? The last thing I want is for all my horses to run to one side or corner of their pens because they might be too close to the hell horses or champ cats....

 

Bred, branded and cared for creatures that are on deed will have special code to make it so they don't flee.

 

As for creatures on slopes, that one is a bit harder. As said by @As_I_Decaythe last attempt at that made them favour going downhill over uphill which got a lot of creatures stuck in pits, natural or otherwise. I actually used to have such a natural dip in the land near one of my deeds years ago that would regularly get 30+ wolves stuck in it. The difficulty for this comes in when deciding should they move up, and when should they move down? Having them check a large area to get the overall slope of the land can get quite expensive, so they have to make their decisions based on their immediate area (like a 4 tile radius or so). Even after making those decisions, it's still possible you're left with them favouring one direction over the other - so you'll either get hundreds of mobs sitting on mountain peaks, or in natural pits in the land - and that's not even thinking about what will happen to them at coast lines (like at the bottom of a steep cliff).

 

I am interested in finding a solution to it that works, but it won't be coming with the above changes.

  • Like 6

Share this post


Link to post
Share on other sites

Apologies for the dumb question, but if you have an animal check slope of adjacent tiles, and disallow them from going in a direction of more than X slope, and then you set the ELSE to be truly random, wouldn't that solve the problem of favoring downhills?

Share this post


Link to post
Share on other sites

Can't you just have something in the animal code that says if slope over 60 then can't move to it?  That would get new creatures to stay off mountain.

 

If riding horses can't go up steep slopes then hoping all creatures be the same unless it adds that extra server overhead calculation.

 

 

 

*Disclaimer...I'm no programmer so don't know if this is how it works.

Share this post


Link to post
Share on other sites
4 minutes ago, Finndar said:

Apologies for the dumb question, but if you have an animal check slope of adjacent tiles, and disallow them from going in a direction of more than X slope, and then you set the ELSE to be truly random, wouldn't that solve the problem of favoring downhills?

 

That would be one way of doing it, but that's not guaranteed to get existing animals off of slopes they're on now. They'll be stuck moving sideways on the slope only, not being able to go up or down - so you still want to give them some possibility to move up and down. It makes sense that given the choice they would choose down, but that leads to the pit problem.

  • Like 6

Share this post


Link to post
Share on other sites

I am reminded of a line from a Star Trek TNG episode.."Kill Zem, Kill Zem all before it is to late!"

Share this post


Link to post
Share on other sites
31 minutes ago, Budda said:

 

That would be one way of doing it, but that's not guaranteed to get existing animals off of slopes they're on now. They'll be stuck moving sideways on the slope only, not being able to go up or down - so you still want to give them some possibility to move up and down. It makes sense that given the choice they would choose down, but that leads to the pit problem.

 

Ah. I made a poor assumption in my reply.  I assumed that since you were considering making material changes, you would de-spawn all wild animals, then kick off the new code.  

Share this post


Link to post
Share on other sites
38 minutes ago, Budda said:

 

That would be one way of doing it, but that's not guaranteed to get existing animals off of slopes they're on now. They'll be stuck moving sideways on the slope only, not being able to go up or down - so you still want to give them some possibility to move up and down. It makes sense that given the choice they would choose down, but that leads to the pit problem.

 

Reminds me of the lakes full of dogs and walled/gated cave entrances full of everything else we used to get as well, which I remember well from Exodus and Epic when that began.

 

Making animals prefer to go down does have it's pitfalls, quite literally, so yes, slope constraints are good, but I too would rather avoid finding a pit full of scorpions or spiders such as those I used to see on Serenity.

 

As for animals stuck on slopes, well, time would fix that, everything ages ...

Share this post


Link to post
Share on other sites
8 minutes ago, Zenity said:

As for animals stuck on slopes, well, time would fix that, everything ages ...

 

Ya I see it like that.  New creatures not go up slopes and existing creatures stuck on side of mountains will die off and problem solved.

 

Maybe not let horses spawn in the water.  I know of 3 horse spawn areas in the middle of the water where I live.  Sea horses...

Share this post


Link to post
Share on other sites
48 minutes ago, nicedreams said:

Maybe not let horses spawn in the water.  I know of 3 horse spawn areas in the middle of the water where I live.  Sea horses...

If they made it so animals only swim when they are being lead then they can put in a thing that will drown them if they are on a water tile after a set time. This way if a player loses a horse while sailing they have time to go back and get them but if they stay in the water for a long time then they will start to die off. 

Share this post


Link to post
Share on other sites
15 hours ago, DevBlog said:

they will pick a direction and walk in that direction, turning every now and then, bouncing off obstacles like walls and fences, and just generally wandering aimlessly

Will we be able to play Pong with cows then?

 

oh btw if they move too much, they might start packing grass even more often

 

15 hours ago, DevBlog said:

 

packing.png

 

Maybe you could make it so that such herds would start moving across server together as one entity, opposing lone carnivores, trampling Mufasa, etc, i.e. like real herbivores do.

 

Edited by zigozag
  • Like 2

Share this post


Link to post
Share on other sites

Three words: tracking skill overhaul

 

And not just some vague message about an animal going left in certain tiles some hours ago. Although, the short lifespan of tracks is another major gripe.

 

Thinking something like ghost tracks, blood drops, and other types of sign superimposing terrain upon skill usage. Not to mention knowledge of water holes, animal paths, and prey's general habits. Greater radius at higher levels.

Edited by Klaa
  • Like 7

Share this post


Link to post
Share on other sites
Sign in to follow this