• Our Minecraft servers are offline but we will keep this forum online for any community communication. Site permissions for posting could change at a later date but will remain online.

Mob Creep!

Lhos

Survivor
Joined
Sep 7, 2012
Messages
233
Reaction score
173
Most of the complaints I hear about SG 1/2/3 are that they're too big and that matches tend to get boring and slow. A quick idea for dealing with that: mob creep. Currently, hostile mobs are disabled (for gameplay reasons, I assume). Personally, I think it'd be pretty neat to have the "wilderness" slowly become more and more dangerous as matches progress. Starting at the first nightfall, mobs begin spawning in small numbers at the very edges of the map, but as time progresses, more and more of them spawn closer and closer to corn, squeezing players towards the center somewhat at night. Stragglers and campers will potentially starve or get killed off, and everyone else would (hopefully) be more likely to encounter each other. As an afterthought and tying in with the concept of tier 3 chests, perhaps a random chest or two near the outskirts of the map could be selected and refilled at some point after restock (or perhaps at second restock, when mobs are all out again).

Just tossing ideas out; I'd love feedback.
 

Stijn

District 13
Joined
May 5, 2012
Messages
6,458
Reaction score
1,391
Well I like the idea of pushing people to the middle of the map but I think this will be very hard to code.
 

Lhos

Survivor
Joined
Sep 7, 2012
Messages
233
Reaction score
173
  • The odds of a mob spawning at a particular location are decided by that location's distance from the crafting table at corn, the elapsed game time, and the light level of that location (although since some maps have permanently dark locations, perhaps light levels should be ignored in such areas)
  • A location's distance from the crafting table at corn is easy to calculate, though for speed's sake (lol calculating distance every time a mob tries to spawn), ring-shaped regions could be declared instead if such a plugin exists, all sharing the same center. All are safe regions (no mobs) at first, then one by one, they're no longer safe, starting with the largest region first.
  • A region's spawn chance modifier is zero when it first becomes unsafe, then scales up to 1 just before the next region becomes unsafe. The modifier is basically a percentage chance for a spawn attempt to fail. Alternatively, the frequency at which mobs attempt to spawn could be controlled (and would be ideal).
Personally, the math involved is simple. It's more about the lag.
 

Lhos

Survivor
Joined
Sep 7, 2012
Messages
233
Reaction score
173
You know what, here. I'm bored. A quick write-up. I don't think this would be difficult to code, it just might not be the most efficient way to solve the problem. I'm also unsure how much lag it would cause, if any. From what I've read, mobs caused server lag when simply switched on - controlling the population might change that.

=============================================================

Variables:

startTime -- When to start spawning hostile mobs
endTime -- When to fully close the spawning ring (IE mobs will be spawning as close to corn as they ever will be allowed to by this time)
currTime -- The elapsed game time (in seconds)
minDistance -- Mobs will never spawn closer to the corn crafting table than this distance.
maxDistance -- The max distance at which mobs will spawn. This should be large enough such that it overlaps the entire play area.
currDistance -- The current "safe" distance, no mobs will spawn closer to the corn crafting table than this.
startRate -- A maximum frequency at which to attempt to spawn hostile mobs when spawning first begins.
endRate -- A maximim frequency at which to attempt to spawn hostile mobs once the spawning ring is fully closed (IE at endTime)
spawnRate -- The current hostile spawn rate
spawning -- a simple boolean flag to enable/disable hostile spawning


Match starts:

--currTime is 0
--spawnRate is 0
--currDistance is equal to maxDistance
--spawning is set to false

As the match progresses:

--currTime keeps track of the elapsed play time in seconds


When currTime equals startTime:

--spawning is set to true

--currDistance begins to shrink at a rate such that it will equal minDistance when currTime equals endTime
---- More specifically: currDistance = maxDistance - ((maxDistance - minDistance) * ((currTime - startTime) / (endTime - startTime)))
---- if currTime > endTime, currDistance = minDistance

--spawnRate begins to grow at such a rate that it will equal endRate when currTime equals endTime
---- More specifically: spawnRate = startRate + ((endRate - startRate) * ((currTime - startTime) / (endTime - startTime)))
---- if currTime > endTime, spawnRate = endRate

Deciding whether to spawn or not:

--if spawning is false, prevent the spawn.
--If a spawn location's distance from the center of corn is shorter than currDistance, prevent the spawn.
 

G33ke

Community Engagement Team Representative
Joined
Jul 22, 2012
Messages
999
Reaction score
1,889
*Insert "nerd" talk here*
Uhh, It seems this is possible to do. :p
Anyway, yeah, it's more about the lag than anything. If the servers can handle it without lag...then this is actually a really nice idea. I personally like to get in as many games as possible, so I normally avoid voting for larger maps, but this could change that.
 

Members online

No members online now.

Forum statistics

Threads
242,192
Messages
2,449,550
Members
523,972
Latest member
Atasci