Archaaz

Member
I have a general question about spawns. I am using Nerun's Distro on a RunUO 2.2 server, and using mostly premium spawner (a few XML for talking NPCs).

I notice that for large spawns, for example hundreds of mobiles over a very large home range, the walking range is set to much less than the home range for prepackaged spawns (say 500+ for home range, 100-150 for walking range). If I understand correctly, and it may be that I misunderstand, creatures spawn to a maximum distance determined by the home range and wander over a distance determined by the walking range. If the walking range is less than the home range, they make their way toward the spawner. Whatever the case, creatures often end up lined up on one side of a river, unable to go further.

I seem to have more luck with local spawns, dealing with smaller areas (say 50 to 100 or so), and setting the walking range either equal to or greater than the home range. I also tend to group like creatures with like (carnivore, herbivore, evil, etc.), and have a few co-located spawners for each area. This seems to create a more natural effect.

Nevertheless, it would be advantageous to spawn certain creatures over a large range (wandering healers, for example), without having to create separate local spawns. What happens if mobiles are spawned over a large area, say 500+, and walking distance is equal to home range? Or am I misunderstanding the way it works?

Thanks in advance for any help/advice.
 
I've just tested with a stock "Spawner" type and set the HomeRange to 400, fully expecting the mob to spawn on the spawner, then wander around the spawner within 400 paces. That didn't happen. The mob spawned randomly about 300 paces away and simply wandered around, seemingly it would wander within the 400 range limit.

I would guess that Nerun's spawners (PremiumSpawner?) behave the same, but I believe you are correct in saying that the spawns will gravitate towards the home range, be it smaller or larger than the spawn range.
 
With the regular spawner with a high range they end up getting packed up on the home anyways, atleast on RunUO.
 
Thanks! I have been fiddling with it as well. Home range definitely determines how far from the spawner they spawn, and walking range determines how far they will wander from the spawner. I tried it with a smaller spawn, setting home range to 20 and walking range to 10. The mobile moves fairly quickly back to within the walking range and wanders within that range. In larger spawns this often looks like a bit of a migration. I suppose this is the problem, that the creature spawns on the other side of a river (or something similar) and tries to make it back to within walking range of the spawner, because it cannot go back or around. I guess leaving the walking range at default (-1) or setting it equal to the home range would work for spawns with greater home ranges as well. You would still get mobiles encountering obstacles and getting stuck unless you are very careful in placing them, but perhaps not in large groups and not as noticeably.

I suppose it was a bit of a stupid question to which I already knew the answer. Sorry about that. I guess I was looking for confirmation and perhaps some tips and tools of the trade.
 
Always better to ask when in doubt :)

This got me thinking... could a pathing algorithm be applied when spawners are picking a location to spawn?
Let's say you have the 400 range, but it's split right down the middle by a river (using your example)...
If the spawner were to perform a pathing check to a location on the other side of the river, it would fail and attempt to find another location until it is successful.
This would prevent the spawner from spawning mobiles in stupid unreachable places, or places they can not walk back to the spawner from.
This would likely be a good way to prevent the fact that some mobiles in dungeons spawn in the void, which is irritating.
 
Or perhaps setting fake homes so when they spawn 300 tiles away, they walk 15 tiles around where they initially spawned, that would be a bit less processing :p
Furthermore, keep in mind that with a spawner with a big range, if you have it set to 400, players can slay them all on one side of the area where they spawn, so the other side gets packed up.
Technically it's kinda realistic, but it just doesn't feel right.

Conclusion, it would be a good idea to make a LongRangeSpawner of some sort, that handles the placement depending of where the other npcs are spawned at so they don't packed up by "natural selection" in a corner or unreachable area. I'm bad at math, so i can't really explain much about filling a surface evenly with given points, or finding those said points.

What do you guys think?
[doublepost=1484704425][/doublepost]Something along those lines:
http://stackoverflow.com/questions/5837572/generate-a-random-point-within-a-circle-uniformly
 
Always better to ask when in doubt :)

This got me thinking... could a pathing algorithm be applied when spawners are picking a location to spawn?
Let's say you have the 400 range, but it's split right down the middle by a river (using your example)...
If the spawner were to perform a pathing check to a location on the other side of the river, it would fail and attempt to find another location until it is successful.
This would prevent the spawner from spawning mobiles in stupid unreachable places, or places they can not walk back to the spawner from.
This would likely be a good way to prevent the fact that some mobiles in dungeons spawn in the void, which is irritating.

I think that sounds like an excellent idea. A clear path would be required, perhaps of a certain size to accomodate randomized movement pattern (the mobiles do not quite make a beeline for the home range). Very, very far beyond me, but a great idea. Ithink for me, for now, the best bet is redoing the bad spawns using spawns with smaller home ranges; splitting rivers and such manually, using spawners on each side.

Or perhaps setting fake homes so when they spawn 300 tiles away, they walk 15 tiles around where they initially spawned, that would be a bit less processing :p
Furthermore, keep in mind that with a spawner with a big range, if you have it set to 400, players can slay them all on one side of the area where they spawn, so the other side gets packed up.
Technically it's kinda realistic, but it just doesn't feel right.

Conclusion, it would be a good idea to make a LongRangeSpawner of some sort, that handles the placement depending of where the other npcs are spawned at so they don't packed up by "natural selection" in a corner or unreachable area. I'm bad at math, so i can't really explain much about filling a surface evenly with given points, or finding those said points.

What do you guys think?
[doublepost=1484704425][/doublepost]Something along those lines:
http://stackoverflow.com/questions/5837572/generate-a-random-point-within-a-circle-uniformly

I think that is also an excellent idea (and equally beyond me). Perhaps a timer? If an spawned Npc has not moved in a certain amount of time, it respawns.
 
xml spawner has HomeRangeIsRelative but I don't think it has anything that makes things evenly spaced.
 
Well, with that system it would also make it possible to spawn them in unreachable locations, but not more than two, depending on the spawn density.
At that point, it's up to the staff to prevent spawning in certain areas.

Also, a module to specify locations in which npcs can't spawn would be quite useful too, ex: putting items simliarly to LOS blockers, a region group, etc.
[doublepost=1484708079][/doublepost]
Yes, but does it take into account the previous points placed?
 
Hmm, I do have this, I use it to uniformly distribute Halloween Spawners in all cemeteries, based on a certain density.
It's not the most efficient way to do it, but it works. The end result is that no spawner should overlap another in range or distribution.

(Note that 'bounds' is a Rectangle2D[] array, not a single Rectangle2D)
Code:
		public static void GenerateSpawners(string cemetery)
		{
			if (String.IsNullOrWhiteSpace(cemetery) || !Cemeteries.ContainsKey(cemetery))
			{
				return;
			}

			if (CMOptions.SpawnerDensity <= 0)
			{
				RemoveSpawners(cemetery);
				return;
			}

			var spawnedElite = false;

			foreach (var kv in Cemeteries[cemetery])
			{
				var map = kv.Key;
				var bounds = kv.Value;

				var allPoints = new List<Point2D>(bounds.Sum(b => b.GetArea()));

				foreach (var p in bounds.SelectMany(b => b.EnumeratePoints()))
				{
					allPoints.AddOrReplace(p);
				}

				allPoints.TrimExcess();
				allPoints.Shuffle();

				int density = 100 / CMOptions.SpawnerDensity,
					spawnerCount = Math.Max(1, allPoints.Count / density),
					spawnRange = Math.Max(1, Math.Min(100, density));

				while (--spawnerCount >= 0 && allPoints.Count > 0)
				{
					var p = allPoints.GetRandom();

					Type toSpawn;
					HalloweenSpawner spawner = null;

					if (!spawnedElite)
					{
						toSpawn = EliteSpawnTypes.GetRandom();

						if (toSpawn != null)
						{
							spawner = new HalloweenSpawner(toSpawn, TimeSpan.FromMinutes(Utility.RandomMinMax(15, 30)), 1, spawnRange);
							spawnedElite = true;
						}
					}
					else
					{
						toSpawn = SpawnTypes.GetRandom();

						if (toSpawn != null)
						{
							spawner = new HalloweenSpawner(
								toSpawn,
								TimeSpan.FromMinutes(Utility.RandomMinMax(5, 10)),
								Utility.RandomMinMax(1, 3),
								spawnRange);
						}
					}

					if (toSpawn == null)
					{
						return;
					}

					spawner.MoveToWorld(p.GetWorldTop(map), map);

					allPoints.RemoveAll(o => o.InRange2D(p, spawner.SpawnRange));
				}

				allPoints.Free(true);
			}
		}
 
I remember playing on Oceania years ago and camping in Swoops. It never failed to happen, after about an hour, one of the birds would spawn on the rocks to the north of the damned tree and get "stuck". You either had to call a GM, or use spells.

That being said: None of the spawning systems really take map configuration into account, and especially not for things that are not frozen. Sometimes you get lucky and the tiledata flag prevents mobs from spawning "on" that tile. I almost think a nicer solution would be another flag in tiledata that makes a static (frozen or not) behave like an LOS blocker (spawner wouldn't be able to "see" beyond it).
 
I almost think a nicer solution would be another flag in tiledata that makes a static (frozen or not) behave like an LOS blocker (spawner wouldn't be able to "see" beyond it).

This flag actually already exists, it's known as "NoShoot" and is used to prevent ranged attacks / line of sight. This is why archers and mages can't target through walls and such.
 

Active Shards

Donations

Total amount
$0.00
Goal
$1,000.00
Back