Jump to content

A simple thought


Theunknownspecimen

Recommended Posts

While reading the other forums I had a thought about ruins. What would happen to a village of all the villagers/citizens died. I noticed in minecraft it just sits there. Zombies kill or infect all the villagers and it stays in perfect condition. 

My thought is that there needs to be a way for the village to deteriorate whether it be that wood just rots over time or something else. It would allow for cool ruins to be made overtime as well.

Link to comment
Share on other sites

Such system has the potential to have a lot of unforseen consequences (e.g. what if the player decide to live in one of the houses, or extends it). If then perhaps all player made blocks can deteriorate/fall apart and for the wilderness survival playstyle. Not sure if it would add a lot to the game though, maybe already enough to just sometimes generate ruined villages in the first place.

Link to comment
Share on other sites

  • 3 weeks later...

Perhaps there would be small deterioration that happens randomly and is easy to fix, such as cobblestone growing vines or silverfish taking unwelcome residence in your wood wall. Such things would be simple to fix, but if left to its own devices accumulate and create an ruin atmosphere.

Link to comment
Share on other sites

Even when simple to fix, it still might annoy the heck out of players over a long time. Remember when mojang introduced the enderman? They were so annoying that with each update they could pick up less and less blocks (and now just flowers basically). What enderman did was easy to fix, but it accumulates over time. However! I find such mechanic completely fine for a hard mode "survival only" playstyle where there should be no focus in large base building anyway.

Using NPCs to build/repair structures is not really the focus of the game, for that there's castle story ;-)

 

Link to comment
Share on other sites

1 minute ago, Tyron said:

Even when simple to fix, it still might annoy the heck out of players over a long time. Remember when mojang introduced the enderman? They were so annoying that with each update they could pick up less and less blocks (and now just flowers basically). What enderman did was easy to fix, but it accumulates over time. However! I find such mechanic completely fine for a hard mode "survival only" playstyle where there should be no focus in large base building anyway.

Using NPCs to build/repair structures is not really the focus of the game, for that there's castle story ;-)

 

Perhaps, but will such features be easy to implement through mods? How is the game's modding API?

Link to comment
Share on other sites

Currently there is a server modding api, which already does all the terrain generation for example. Oddly enough just today I added some super basic features to add/remove NPCs (I needed it to test multiplayer). For me it's very easy to add new features to the mod api as well. Overally I think you could already build such a self regulating village system.

Link to comment
Share on other sites

The source code of the API is documented and my plan regarding API is as follows:

Step 1 - On first Release: Release API (including a lot of Math tools und helpful Datastructures) as open source. Will include 1-3 small examples.
Step 2 - Shortly after first Release: Make a 3-6 tutorial videos explaining each moddable component of the game
Step 3 - Long term: Gather comprehensive API documentation with examples and tutorials here on vintagestory.at

How much coding needed for a dynamic village system depends entirely on how many features you want in there and of the level of quality. Can be anything between 3 weeks and 3 years.

Link to comment
Share on other sites

Ok, let's define the bare minimum as creating a hollow log cube (=house) with door and one npc inside (that cannot be interacted with and does not move around). 

2016-08-16_20-20-21.png

 

This is the code that created this house using the chat command "/house". You save that as VillageMod.cs (or compile it to VillageMod.dll) and put it in your mods folder. Done. 42 lines of code. If you would want to do it as part of world gen you'd have to find a fitting spot first.
You can also save yourself the line "blockAccessor.Commit();" if you don't need fast block sync (e.g. for worldgen).

You don't even need a programming environment. Open the VillageMod.cs in notepad, edit and save. The Server automatically reloads the mod if it's been modified. Fast/Small enough for you? :-)

using System;
using Vintagestory.API;

namespace Vintagestory.ServerMods
{
    public class VillageMod : ModBase
    {
        ICoreAPI api;

        public override void Start(ICoreAPI api)
        {
            this.api = api;
            this.api.RegisterCommand("house", "Place a house with an NPC inside", "", CmdGenHouse, Privilege.controlserver);
        }

        private void CmdGenHouse(int clientId, int groupId, string[] args)
        {
            IBlockAccesor blockAccessor = api.World.GetBlockAccessorBulkUpdate(true, true);
            ushort blockID = api.World.GetBlockId("log-birch");

            BlockPos pos = api.Player.GetPosition(clientId).AsBlockPos;

            for (int dx = -3; dx <= 3; dx++)
            {
                for (int dz = -3; dz <= 3; dz++)
                {
                    for (int dy = 0; dy <= 3; dy++)
                    {
                        if (Math.Abs(dx) != 3 && Math.Abs(dz) != 3 && dy < 3) continue; // Hollow
                        if (dx == -3 && dz == 0 && dy < 2) continue; // Door

                        blockAccessor.SetBlock(blockID, pos.OffsetCopy(dx, dy, dz));
                    }
                }
            }

            blockAccessor.Commit();

            api.Player.AddNpc("Jeniffer", pos.UpCopy());
        }
    }
}

 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.