Content: Slate Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate Marble
Background: Slate Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate Marble
Pattern: Blank Waves Notes Sharp Wood Rockface Leather Honey Vertical Triangles
Welcome to TerraFirmaCraft Forums

Register now to gain access to all of our features. Once registered and logged in, you will be able to contribute to this site by submitting your own content or replying to existing content. You'll be able to customize your profile, receive reputation points as a reward for submitting content, while also communicating with other members via your own private inbox, plus much more! This message will be removed once you have signed in.

  • Announcements

    • Dries007

      ATTENTION Forum Database Breach   03/04/2019

      There has been a breach of our database. Please make sure you change your password (use a password manager, like Lastpass).
      If you used this password anywhere else, change that too! The passwords themselves are stored hashed, but may old accounts still had old, insecure (by today's standards) hashes from back when they where created. This means they can be "cracked" more easily. Other leaked information includes: email, IP, account name.
      I'm trying my best to find out more and keep everyone up to date. Discord (http://invite.gg/TerraFirmaCraft) is the best option for up to date news and questions. I'm sorry for this, but the damage has been done. All I can do is try to make sure it doesn't happen again.
    • Claycorp

      This forum is now READ ONLY!   01/20/2020

      As of this post and forever into the future this forum has been put into READ ONLY MODE. There will be no new posts! A replacement is coming SoonTM . If you wish to stay up-to-date on whats going on or post your content. Please use the Discord or Sub-Reddit until the new forums are running.

      Any questions or comments can be directed to Claycorp on either platform.
Sign in to follow this  
Followers 0
ECC

Encounters, a fresh look at spawn mechanics

13 posts in this topic

For the sake of posting it:

Encounter:

What is an encounter: An encounter is a system to replace mob spawning and chunk protection. this system acts to spawn hostile, passive-aggressive, and passive mobs. Generation related spawns(IE, livestock) continue to function.

How it works: The Encounters system acts by tracking an analyzing data contributed by the world and players. Taking into account temperature, elevation, 'biome', local world, time of day, lunar cycle, and local population(mob), the system tracks the 'world'. based on this information it will move to the next step in the encounter progress, the Players data. Every chunk traveled over will record three new things that only the player can change. Travel, Stationary, last visit. These stats are all a chunk by chunk basis and alter the potential encounter. The other half of the player data is level, Held item, buff, health, hunger, Is mounted. These are all directly effected by the players condition. Once all of this data is recorded the final step in the process comes, Defining the region. Based on what region this chunk is defined as, certain steps are taken to spawn a mob. First, the game decides if the encounter is hostile, neutral, or passive. Once this is decided, the game then decides if this is an action encounter or a passage encounter. In the case of an action encounter, the mob is told to group with, attack, or avoid a target mob or player. If this is a passage encounter, it simply tells the mob to go from A to B ignoring all other input excluding hostile action(IE: Skelly runs by, you attack it, THEN it fights back). Finally it tells the mob 'Point A' where the mob will spawn. The game will attempt to spawn the mob on the nearest possible Y axis as possible to increase the odds of the encounter actually being an encounter. at that point, the AI takes hold and the mob carries out its simple task.

What defines a region: As mentioned above, a region is a chunk that has calculated all the data given by both the player and the world and is now preparing to spawn an encounter. This region should always be far enough away from the player that they should rarely see the actual spawn, but close enough to prevent unloading of a chunk. Regions are named based on the encounter it is most likely to produce. all regions may spawn any kind of encounter, however weighted values will usually produce only encounters based on the region name. IE: you'll almost never have a tundra nature encounter when in a desert city. It can happen, but it wont.

What kind of encounters are there: In short, there are only a few basic encounters. In long, there are upwards of a hundred. Each encounter defines a region, task, and a type. to name but a few,

Desert Road, Passage, Bandit -

Spawns a Hostile Desert-native bandit type mob native to (skeletons are the only current one to fall under this) that passes from A to B without doing anything in between unless attacked. Once it reaches B it follows normal despawn and AI routine.

Plains City, Task, Pest - Spawns a passive-aggressive plains-native pest type mob(lets go with silverfish, they are pretty close) that spawns and attacks livestock, dropped materials, players, crops, etc. Mobs are usually fairly weak.

Wooded Nature, Task, Bandit camp - Spawns a group of various Wooded-native bandits in an area that simply move about. this is an example of a 'oldschool' spawn, but done in a way that fits the system.

As you can see, thease 3 examples show a wide variety of ways this can add to the world. This gives the player a dynamic effect on his or her own world and keeps them entertained with a variety of new things. Some players may decide to stalk a mob, others may record mob battles, others may end up on the bad end of a massive bandit attack. there are more possibilities then I mention so I'll end this section with one last example of a spawn and tell you what the game would have read

Polar nature, Task, livestock - spawns a food producing mob that specifically passes by the player IE, a deer

what the game read was that this was a cold place, was not a road, the player was low leveled, low health, and hungry. not all encounters are bad, many would be just like this, helping a player along. I wont go into saying it will be common, but I will say it will occur.

Universal application for mobs: In order for this to function, all mobs spawned by this mechanic would need to ignore if they are supposed to despawn or stick around(hostiles despawn in current release, passives do not). Instead ones spawned by this would need to record when they were spawned. if the chunk is unloaded, then when the mob is reloaded, it quickly checks its birthday and if its been a while it 'dies'(despawn). ALL mobs spawned by this will have that mechanic. However, mobs tamed by the player(IE livestock) or spawned with eggs, would not have a birth/death mechanic and will not despawn unless killed or forced though some form of /butcher command

Extras necessary to make it function: Literally its simple on the surface: a command for every option that controls the world aspect of the encounter system. This allows admins to define what is a road ahead of time before players come though and break things. also, the ability to lock chunks from changing the region type they are so as to allow support for heavy RP servers, adventure maps, and similar. Fundamentally, this is to let us play the way we want to play. also, there needs to be a functionality to clear a region of data and define a region as a 'spawn protected' IE, for servers who have large player friendly spawns and dont want hostile mobs to constantly attack

so, anything I left out?

Come to the IRC, great place to actually talk things like this out.

and because I know how this forum is, Crypts were obviously dropped a while ago. Its a quote that got out of hand JUST like the NPC quote in the kingdoms thread. This is a new idea that is set up to allow many many new mobs and move us away from randomly spawning and doing nothing(vanilla style).

Edit: So apparently I forgot to explain what each tag in a region does or how its recorded. so here is the quick:

World: not a tag, just a catagory. Includes elevation, 'biome', local world, time of day, lunar cycle, and local population(mob)

Elevation: This is the Y latitude, telling you how high up or how low down you are. or a spawn case, it decides if this is a cave/mine, a valley, or a mountain. You should rarely come across a undead miner(example) while climbing Olympus Mons, but you may come across a mountain goat(example). Depending on how this is done, it could decide depth by what is the highest block exposed to daylight or it could be checking the Y axis relative to the world.

Biome: This is checking what exist within the chunk to decide what kind of biome this is. Biomes can be made artificially in this case and have no real effect on what vanilla actually calls a biome. In this case the encounter checks a 16 cubed area and records what is in the area. Lots of logs(tree logs) mean its a wooded/forested area. lots of water means its a swamp/ocean. its not that simple, but you get the idea. Ultimately it records whats there then chooses what mob fits best there based on the weighted values.

Local world: this is a simpler check that checks other biomes around the biome its spawning in. This simply acts to add more weight and prevent deep swamp monsters like a giant crock(example) from spawning at the edge of a swamp/plains.

Time of Day: this just checks if its day or night or noon, or witching hour/etc. This lets your oldschool spawn only at night mobs spawn such as a bat(example) or a newschool mob such as a flaming chariot horse(example) spawn at the respective time of day.

Lunar cycle: This checks what the moon is doing. Some mobs may spawn only under the full moon, others dont care. Its all about giving that feel that there might just be a warewolf(example) around the corner. you'll never know

Local population(mob): This records all nearby mobs within range of the player. If there are a lot of livestock, it may generate a hungry wolf(example). If there is a lot of existing hostile mobs, it may choose to not generate another hostile mob. this is about checking the population so as to not overload the player but keeps it at a nice average nonetheless.

Player: not a stat, another catagory. Includes Travel, Stationary, last visit, level, Held item, buff, health, hunger, Is mounted.

Travel: This counts how many times a player has passed over the chunk. the more passes, the closer this chunk becomes to being labeled as a road region.

Stationary: This counts how long players spend in a chunk. the longer, the more likely it is a home/town/city. The less, the more likely it is a road/wild

Last visit: this is simply a check to see when the last time a player was here. if a city becomes abandoned, after a while nature may take it back.

Level: this checks a players level. high levels require powerful hostiles. This acts to balance the mob for the player. if someone farms levels but really is an inept fighter, this may also kill such 'cheaters'

Held item: this checks what a player is currently holding. If the player is holding raw meat, predators may approach and prey may scatter. holding a weapon may also effect if your approached by a bandit or if they scamper off as well.

Buff: this checks the status buffs/debuffs of a player. if a player has speed, faster mobs may appear. if a player has bleeding, predators may seek them. each buff would weight different sets of monsters and wildlife

Health: This checks the health of a player. High health implies a harder target. it also implies that the player may be doing too good. Low health does similar.

Hunger: this checks the hunger of a player. no hunger may not effect play, but low hunger may present the player with a easy kill so they may eat. on the flip side it may also tell encounters to not spawn food bearing mobs and let you die. Nature is cruel

Is mounted: This is a yes/no check for if the player is riding a mob(or if a mob is following the player). If this checks yes, faster or more powerful mobs may approach, if its a no, then mobs geared to on foot battle may approach.

TL;DR: ultimately this is a replacement for the current mob spawning mechanics. it acts like a roll of a bunch of weighted multisided dice and based on that chooses what will spawn where and what it will do. Instead of mobs that wonder in circles, mobs will have simple tasks such as move from one point to another, attack a mob/player, follow a mob/player, and more.

6

Share this post


Link to post
Share on other sites

Dunk/Bioxx get in here and add this amazing idea in beta 3

0

Share this post


Link to post
Share on other sites

dont mind me, im only editing the post. it appears that in my haste I left out what each tag records and does when a region is being decided.

0

Share this post


Link to post
Share on other sites

naturally, I am done editing. and yes, I am aware this is a double post.

0

Share this post


Link to post
Share on other sites

This needs to be implemented.

0

Share this post


Link to post
Share on other sites

perhaps add a config to route spawn mechanics through the old system instead

this new one would play hell on slower computers

1

Share this post


Link to post
Share on other sites

perhaps add a config to route spawn mechanics through the old system instead

this new one would play hell on slower computers

Agreed. If the optimization could be done however, I really like this idea. The current mob system is extremely dated, and though the increased health and such do add some tension in TFC, this promises to make mobs actually interesting, rather than just a nuisance.

I especially like the idea that a player's actions can influence a 'region'. The concept that deforesting an area could change the mobs I encounter is just cool. A like for you, good sir!

0

Share this post


Link to post
Share on other sites

Still wanting this to be moved to TFC2 suggestions, where I intended this to go should it be made(and a week later it was)

0

Share this post


Link to post
Share on other sites

I'm a little bit confused. Are you defining what constitutes roads, etc. or do to have to configure it, or both? Because I could see having an interesting time defining trees as the only spaces where mobs could spawn. Cow trees, anyone?

0

Share this post


Link to post
Share on other sites

what defines a road is if a chunk is traveled over a number of times.

lets say in the code it needs... 60 times entering/leaving a chunk and less then 2 days spent time(record time) to be a road. Well, until I, or several players pass over it and meet those requirements(60 passes, >4800seconds record), it will not be classified as a road. the code defines what is a road, and the players act to build the data per chunk. Alternately, an OP could use a command to set the chunk data and lock it. Meaning admins could make a Desert Lake-bed Road spawn Arctic Mountain Wild mobs. Encounters if properly implemented would support map makers, server owners, and even dick greifers with Op who want to set homes to Hell.

0

Share this post


Link to post
Share on other sites

...Encounters if properly implemented would support map makers, server owners, and even dick greifers with Op who want to set homes to Hell.

Um... Is there a way to subtract the griefer part? I like the actual mechanic, but is there any way to make it less likely that people will abuse it?

0

Share this post


Link to post
Share on other sites

Um... Is there a way to subtract the griefer part? I like the actual mechanic, but is there any way to make it less likely that people will abuse it?

If griefer has OP, he won't need this system in particular to make your life hell.
3

Share this post


Link to post
Share on other sites

^ what transcengopher said

the griefer bit was mostly a joke at how any mechanic in any game could be used to grief(Including anti-grief)

0

Share this post


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