• 0

    posted a message on Villager Bunking
    Lots of posts about what people want villagers to do or what new villagers should be added. Mine is a more simplistic request. I want to see village housing be more intelligent. We all know that they know where the doors are, and a house has to have an inside and an outside. However, I want this to be expanded upon in a new patch. I want them to be able to tell how big the "house" is. That way given the size of the structure only X villagers will try to bunk in it at one time. Currently in my village of 100+ doors and 30+ villagers, every single one of them runs to the same door when it starts to rain. Since I'm in SMP they all bump through the walls and glitch out. So not only is half my town empty of live, but the other half looks stupid and buggy.

    A side detail about this code change, if it was implemented, is that if your code can tell you the square footage of a village's "safe" housing, you could use THAT number to determine potential villagers instead of doors. The door count is completely silly to use since you end up with door packed facilities for breeding or what I was doing for a while when I want more villagers which is putting doors randomly around the sides of buildings. Wouldn't it make more sense that one would have to build more actual buildings to get more villagers? Plus what if I make a HUGE house with 1 door... I get a third of a villager more? 1 villager to 3 doors given the current model of village buildings leads to a lot of empty rooms...

    This change would also remedy another bug. If you knew the spots that were "safe inside" spots, you could store that knowledge say based on the solid blocks that make up the floor of the house. This code change would be similar to how the code currently stores doors as part of a village but this time it would be the floor blocks instead. This not only gives safe zones, but limits them height wise. No more villagers running into caves under the houses to feel safe, and no more villagers under my raised houses looking like village idiots.

    What would the code look for to find this though? Simple, you have the code that finds doors, and it looks around the door for blocks to check for inside and outside. Change the code to look left and right instead of up. Look for walls instead of ceilings since clearly "houses" will end up being enclosed, and ceilings don't protect from zombies much. If a door is in the middle of 2 rooms, then count both rooms as safe. This clears up bedrooms inside houses. What level should you look for the floor at? Check the enclosed room for every block with nothing on top of it at the same level as the block below the door. This would mean that the code would be smart enough to detect the safe areas of a multistory house, and tell the villagers to use all the floor space as safe space.

    This just seems like such an easy change to make villages seem MUCH more intelligent which if I'm not mistaken is a clear goal of the devs. :-)
    Posted in: Suggestions
  • 0

    posted a message on Village Info
    Quote from trunkz

    Okay, I think I found the problem... It has something to do with inconsistent distance checks and rounding problems.

    (1) When wooden doors close to villagers are determined (happens every few ticks) the game checks if they are part of the village. To do that, it uses the radius first. But the radius gets rounded down. For example: Imagine a very big village with a radius of 100m. House A now gets added with a distance of 113,4m. The new radius will be 113m. The next time it check for that house, the check will not fail, because 113.4m > 113.0m and therefore the house is not considered to be part of the village at that point.

    (2) In the next step, the game tries to determine the villages of these "new" houses. The game now goes through all villages and checks if the door is in the range of (radius + 32m). So House A would get added to the same village, because 113,4m < 145m.


    To put it in a nutshell, houses at the edge of a village can (will) be counted multiple times. The more villagers close to those houses, the bigger the effect.


    What I noted from use with SSP was that the problem was mainly with multiple villages near each other. Where the +32M range would count doors of the OTHER village. When you have the issue you mention the village freaks out for a while, but as long as the door is of the same village ID, the center and radius adjust over about 2 game days and the door count stabilizes to the correct value give or take a couple. After it is stable, adding another door causes the same freak out, but slow steady adding is fine if done in moderation. I was able to get a 200 radius town with 170+ doors (an actual count) working with little problems in SSP.

    The problem here for me is getting this on SMP so I can easily tweak my village there which is much more complicated.
    Posted in: Minecraft Mods
  • 0

    posted a message on Another Villager Issue
    Fences do not work as this is SMP and they hop the fences occasionally during chunk reload. This is due to villagers/farm animals/mobs spawning in game before the blocks (something you can see when you tp). When this happens they are placed on or above the blocks (fence) and then jump off into water anyways. Same would be true of a wall blocking the water.

    I also do not wish to make a killing booth as I am limited my village to their own natural buildings. Any other thing would be out of place.

    The bigger problem I wanted to point out in the original post though was how they are seeking shelter UNDER my houses on stilts. I believe that to be a problem/bug with their coding and wanted to get awareness out to that fact. The squares of the house must be marked as "safe" somehow and they are going to them no matter where in terms of height the safe area is. I'm pretty confident this would work above houses as well if you had multiple layers. Just something silly and unrealistic that could be easily changed.
    Posted in: Recent Updates and Snapshots
  • 2

    posted a message on Another Villager Issue
    So besides the fact that villagers spawn like crazy in large villages, I ran into another problem with them.

    I made a nice coastal town for them and included some buildings in the water raised up by wooden pillars. Think stilted buildings? They had little bridges connecting them and it looks sweet. Anywho, I bring in the villagers and they walk around and go crazy. At night though, if any of them are in the water (due to being pushed by the infinite village count >_<), they all rush UNDER their houses. Any on land however take the long way around and up the bridges into the houses.

    Is there a way to code them such that they feel an urgency to leave the water when they fall in? Shouldn't they panic about being in water? Just saying...

    Also, please fix the infinite villager problem. My village looks stupid without doors! lol
    Posted in: Recent Updates and Snapshots
  • To post a comment, please or register a new account.