Jump to content

RWG, generation files ( features/ ) internalMobs dysfunctional


The Plum Gate
  • Branch: Live Branch Version: Steam Pending

internalMobs don't appear to be functioning correctly in geometric features.

This was noticed in the ColdRoom.yaml? file - this particular feature isn't generating the coldbreather ( wort ), as it once did. 1-3 worts/coldbreathers

Likewise in the jungle biome central feature -  smallroom morbs/glom isn't spawning in this biome feature. Similarly, floor spawn location for the glom seems touchy and difficult to tune.


Steps to Reproduce
Examine relevant features files, it appears internalMobs parameters are being ignored. Glom spawn floor location is touchy, I had better luck with air, yet then it was raining morbs in the jungle biome vs that of floor location with same density parameters as floor.



User Feedback




if (feature.internalMobs != null && feature.internalMobs.Count > 0)
{
	this.LogInfo("\t\t", "internal mobs", (float)feature.internalMobs.Count);
	if (!this.doneMobs)
	{
		if (!this.disableRoomMobs)
		{
		}
		this.doneMobs = true;
	}
}

I think they are aware.

For reference this is what it used to look like:

if (feature.internalMobs != null && feature.internalMobs.Count > 0)
{
	this.LogInfo("\t\t", "internal mobs", (float)feature.internalMobs.Count);
	if (!this.doneMobs)
	{
		if (!this.disableRoomMobs)
		{
			this.PlaceMobInRoom(feature.internalMobs, this.centerPoints, rnd);
		}
		this.doneMobs = true;
	}
}


 

Edited by Risu

Share this comment


Link to comment
Share on other sites

29 minutes ago, The Plum Gate said:

@Risu How are you getting this code anyway?

actually, this seems like frivolous not-code

Here's the whole decompiled method if you're curious:

private void ApplyForeground(Chunk world, TerrainCell.SetValuesFunction SetValues, float temperatureMin, float temperatureRange, SeededRandom rnd)
{
	this.LogInfo("Apply foregreound", (this.node.tags != null).ToString(), (float)((this.node.tags == null) ? 0 : this.node.tags.Count));
	if (this.node.tags != null)
	{
		FeatureSettings feature = WorldGen.Settings.GetFeature(this.node.type);
		this.LogInfo("\tFeature?", (feature != null).ToString(), 0f);
		if (feature == null && this.node.tags != null)
		{
			List<Tag> list = new List<Tag>();
			foreach (Tag current in this.node.tags)
			{
				FeatureSettings feature2 = WorldGen.Settings.GetFeature(current.Name);
				if (feature2 != null)
				{
					list.Add(current);
				}
			}
			this.LogInfo("\tNo feature, checking possible feature tags, found", string.Empty, (float)list.Count);
			if (list.Count > 0)
			{
				Tag tag = list[rnd.RandomSource().Next(list.Count)];
				feature = WorldGen.Settings.GetFeature(tag.Name);
				this.LogInfo("\tPicked feature", tag.Name, 0f);
			}
		}
		if (feature != null)
		{
			this.LogInfo("APPLY FOREGROUND", this.node.type, 0f);
			float num = feature.blobSize.GetRandomValueWithinRange(rnd);
			float num2 = this.poly.DistanceToClosestEdge(null);
			if (!this.node.tags.Contains(WorldGenTags.AllowExceedNodeBorders) && num2 < num)
			{
				if (this.debugMode)
				{
					Debug.LogWarning(string.Concat(new object[]
					{
						this.node.type,
						" ",
						feature.shape,
						"  blob size too large to fit in node. Size reduced. ",
						num,
						"->",
						(num2 - 6f).ToString()
					}), null);
				}
				num = num2 - 6f;
			}
			if (num <= 0f)
			{
				return;
			}
			HashSet<Vector2I> hashSet = this.DigFeature(feature.shape, num, feature.borders, rnd);
			this.availablePoints.ExceptWith(hashSet);
			this.LogInfo("\t\t", "claimed points", (float)hashSet.Count);
			this.ApplyPlaceElementForRoom(feature, "RoomCenterElements", this.centerPoints, world, SetValues, temperatureMin, temperatureRange, rnd);
			if (this.borders != null)
			{
				for (int i = 0; i < this.borders.Count; i++)
				{
					this.ApplyPlaceElementForRoom(feature, "RoomBorderChoices" + i, this.borders[i], world, SetValues, temperatureMin, temperatureRange, rnd);
				}
			}
			if (feature.internalMobs != null && feature.internalMobs.Count > 0)
			{
				this.LogInfo("\t\t", "internal mobs", (float)feature.internalMobs.Count);
				if (!this.doneMobs)
				{
					if (!this.disableRoomMobs)
					{
					}
					this.doneMobs = true;
				}
			}
		}
	}
}


 

Share this comment


Link to comment
Share on other sites

Looks like it chews through them without acting on them in that case. I imagine that global distribution is easier to manage via the mobs.yaml file.

Share this comment


Link to comment
Share on other sites



Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
  • Create New...