[mod] TownChest (townchest)

bell07
Member
 
Posts: 534
Joined: Sun Sep 04, 2016 15:15
GitHub: bell07

[mod] TownChest (townchest)

by bell07 » Mon Oct 17, 2016 21:33

Hi!

at the first I started to contribute to the towntest (viewtopic.php?p=233784#p233784) but I was not able to stop myself and did a full rewrite of the mod oO, now named as TownChest, to tribute the original towntest_chest. In second iteration the most logic was moved to own mod "schemlib" so this mod depends on schemlib now. The new vision is the townchest is the server admin tool for schemlib based mods

Image
Image
Github: https://github.com/bell07/minetest-townchest

Dependencies:
- default (unsure?)
- schemlib: viewtopic.php?f=9&t=18084
- schemlib_builder_npcf (optional): viewtopic.php?f=9&t=18085
- npcf (optional, schemlib_builder_npcf requires it). NOT the npcf_builder or whole pack, the framework "npcf" only): https://github.com/stujones11/minetest- ... aster/npcf

Features:
The chest does manage 1 schemlib building plan
- Select building file: WorldEdit or Mts
- Building tasks without file: fill with air, fill with cobble, a box, a plate (you need to enter the size only)
- Clear and flat the place of the building
- Instant build the building without NPC

NPC-Management (if schemlib_builder_npcf installed)
- Disable the walking and own builds by schemlib_builder_npcf
- Can spawn the Larry builder
- Provide building plan to the schemlib_builder_npcf as buildable, that results in all builder start working on it
- Multiple NPC's per chest allowed

ToDo:
- Material management - means the NPC needs own inventory, all nodes needs to be obtained before build.
- Porting building preview from handle_schematics
-Survival mode - Restrictions getting the chest and a NPC live cycle

Concept ToDo's
I need a idea for the "Survival mode". how is the best way to spawn NPC's in survival? The current (creative) state is unlimited spawning by button "Spawn NPC" in the chest. Is it ok to get unlimited NPC's in survival? Is the restriction enough the needed nodes should be provided? What's about the other site, how to handle the lifetime/death of the NPC's? Currently the NPC cannot be killed. Planed enhancement is the NPC drop his inventory in case of the death. Or should I use the bones for npc?

A Remark for NPC's: The townchest does not provide own NPC's anymore so without npcf / schemlib_builder_npcf only the instant build is available. The most building specific npc code I moved to schemlib's "npc_ai" part in a way usable with any other mobs/npc framework. So if anyone like to get an other NPC working with schemlib I can support them. But the other framework needs a important feature: It should be able to go to ANY position to place the nodes without stuck. In townchest I did written own logic for this, the logic I ported to the NPCF framework called "movement", and stu accepted my changes in upstream repo. If needed the movement framework could be ported to other mobs/npc implementation too.

Any ideas welcome!
Any contribution and github pull-requests welcome!
Attachments
screenshot_20180731_072758.png
(242.33 KiB) Not downloaded yet
screenshot.png
(408.51 KiB) Not downloaded yet
Last edited by bell07 on Tue Jul 31, 2018 06:44, edited 9 times in total.
 

User avatar
TheReaperKing
Member
 
Posts: 529
Joined: Sun Nov 22, 2015 21:36

Re: [mod] TownChest (townchest)

by TheReaperKing » Mon Oct 17, 2016 23:38

Maybe there is a way to combine it with this mod?
viewtopic.php?f=9&t=15382

Some neat insight in here too:
viewtopic.php?f=3&t=13488
Resources on happiness and life management - http://MikesHappyPlace.com
Project Lead of the Doom 3 Mod Last Man Standing - http://Doom3Coop.com
Project Lead of Platinum Arts Sandbox Free 3D Game Maker - http://SandboxGameMaker.com
Youtube Channel - https://www.youtube.com/user/PlatinumArtsKids
 

bell07
Member
 
Posts: 534
Joined: Sun Sep 04, 2016 15:15
GitHub: bell07

Re: [mod] TownChest (townchest)

by bell07 » Tue Oct 18, 2016 07:18

Thank you for the links.
Sociedades: I seen it but ignored because the most is written in a language I do not understand. But will try the mod in the next time.

The discussion about villagers: I readed the topic already
My motivation is not to create a "Reality simulation" trough villages. The townchest is a helper for me to build something. The idea is more allied to "Maidroid" (viewtopic.php?f=9&t=14808) and I investigated already if the townchest should be a core-chip for the Maidroid. But I decided not to use it.
The Maiddroid and the most Villagers / NPC's are to match "Real", that means he follow gravity and does collide to blocks. This make it impossible to get proper paths to the nodes to be placed. So I decided to stay on a noclip and no-gravity creature, the townchest-NPC is a "Ghost" or a "Geany" for me (And the chest is the lamp?). A Ghost have a simple pathfinding: just set direction and speed, and then check if destination reached.

So I know I need a new creature instead of NPC. Any contributions welcome! It will be nice to have a flying creature with animations for moving, working (place/remove nodes), boring and to be overwhelmed ;)
 

bell07
Member
 
Posts: 534
Joined: Sun Sep 04, 2016 15:15
GitHub: bell07

Re: [mod] TownChest (townchest)

by bell07 » Thu Nov 17, 2016 19:50

A significant step is done. I replaced the "towntest" NPC to the "npcf" based one. Of course the npcf mod is required for now. I used the npcf_builder as template but, did a rewrite the code. The npcf_builder mod is not required, the framework only.
For now the NPC does not just floating but walk and can fall at work. Because of no perfect path finding possible the NPC can teleport himself closer to the target in case of stuck.

PS: The idea of "Geany and the lamp" is discarded for now, this mod is now like the other "Building Chest" Mods. But that does not bother me, it is just for fun development for me.
 

Sokomine
Member
 
Posts: 3616
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine

Re: [mod] TownChest (townchest)

by Sokomine » Sat Dec 03, 2016 04:24

Multiple builders assigned to the same build chest sounds very good :-) Towntest suffered a bit from large buildings taking too much time. And while it is fun to watch them build for a while, it does get annoying if the player constantly has to babysit the NPC so that they stay active. If there'd be a mod handling village population, workers could be assigned to building projects by such a mod.

Regarding pathfinding/flying/noclip: handle_schematics still has the scaffolding node from my original random_buildings mod. The idea is to place scaffolding where the house will later be. NPC don't have to worry about weather they can reach a particular point or not - they always can (at least if they build from bottom to top) because there will be scaffoldinig which allows climbing around. Building from bottom to top may not look good as houses are usually not build that way.

Perhaps it could be sufficient to just have workers walking around, without them actually bothering to be in the right place and just head for a convenient place, move their arms around a bit and pretend to look busy.
A list of my mods can be found here.
 

bell07
Member
 
Posts: 534
Joined: Sun Sep 04, 2016 15:15
GitHub: bell07

Re: [mod] TownChest (townchest)

by bell07 » Wed Dec 14, 2016 22:56

Thanks for your feedback Sokomine and sorry for the late answer. Currently the non-cubic real-life does not let me go.

There are some ideas for the mod in my head but no time to develop them :(

Towntest suffered a bit from large buildings taking too much time. And while it is fun to watch them build for a while, it does get annoying if the player constantly has to babysit the NPC so that they stay active. If there'd be a mod handling village population, workers could be assigned to building projects by such a mod.
I do not have a idea currently how the gameplay should be of this mod. You are right, if I need just the houses I can just spawn them as "mg_villages" does. The gameplay win only of the builder-npc is to watch his work, and serve them providing needed materials. There are next ideas:
- building simulation to get build progress in case the NPC is not loaded. So the NPC needs not to be babysitted. The npcf framework does have some initial handling of unloaded entitys that can be enhanced
- Generated building plan like "Remove wood nodes in area and set seedlings to some places" that should be usable as lumberjack daily working plan
- Replace the chest by "construction manager NPC"
- Use default chests for items exchange
A gameplay feature is already implemented: you can build together with the NPC's. If you place right nodes to the right place, the NPC does detect them and remove it from building plan as done.

Regarding pathfinding/flying/noclip

scaffolding nodes seems to be a nice idea and can be helpful (and would be eye-candy), but is additional complexity that does not solve the nodes reaching problem in general. An excessive sample is a building task "Replace dirt by stone" (basement building). I solved is by teleporting of NPC in case of stucking. So the task "Replace dirt by stone" is solvable by teleporting trough dirt and stone. But I will thing about the scaffolding feature.

Build from bottom to top is not allways possible in case the material needs to be provided. If The NPC get stone he can build stone only, independ of the high. Currenty the "target priorization" is implemented to prefer lower nodes in case of building and prefer higher nodes in case of node removal (placing air). I did a lot of balancing of target priorization to get a not-stupid build order. But in fact the NPC's are blind. He notice a barrier after stumble and falls each cliffs. I miss a "navigate_to({x,y,z})" method in NPC-Framework that navigates the NPC to the position with some intelligence. Currenty there is some simple implementation of "avoided nodes" using minetest.get_node() in "npcf_deco" available, but since voxel_manip exists a more complex pathfinding can be implemented.

The next milestone I will work on is to port usable things from handle_shematics. I opened the "Issue 7" on github, but you can close it for the time. I seen the parts I like to use I need modify at the first. A sample: the handling of "on_constr" and "after_place_node" I will remove from "analyze*" files because it should be handled after nodes replacement mappings. So for the first I will take a fork of handle_schematics as a part of townchest. If I am done with my changed I will look what can be merged to handle_schematics upstream. You did cutted out the handle_schematics from mg_villages, I like more strip them to "schematics framework lib/api" that can be used in any other building mod. That means no formspecs, no chests, no mappings, no NPC's just functionality and API.

Now I just have to find the time....
 

User avatar
theFox
Member
 
Posts: 163
Joined: Sun Feb 12, 2017 14:08
Location: Germany
GitHub: theFox6
In-game: theFox

Re: [mod] TownChest (townchest)

by theFox » Tue Feb 14, 2017 15:20

This is another thing missing on a mod I'm currently making. It's a mod with villagers who run tasks (eg. a lumberjack). Maybe I will have a look whether I can implement your mod into it later.
my mods and subgames (ง'̀-'́)ง
 

bell07
Member
 
Posts: 534
Joined: Sun Sep 04, 2016 15:15
GitHub: bell07

Re: [mod] TownChest (townchest)

by bell07 » Tue Feb 14, 2017 15:38

Hi theFox,

the most things of TownChest I moved to the https://github.com/bell07/minetest-schemlib in the meantime. So you can use the "plan"'s without the chest using the shemlib plans. See my first attempt: https://github.com/bell07/minetest-npcf/blob/master/npcf_builder/init.lua
But keep in mind the lib is in development that means there is not stable API. The next step is to split the "plan" class to "generic" and inherited "building"-specific class, that means there should be plans possible without any grounding information. After this I plan to port TownChest to schemlib that will mutate to "schemlib-admin-mod". The next steps on then roadmap is to get more "handle_schematics" features ported into the lib like rotation, nodes replacement or preview-formspec. So much to do and so little time :/
 

bell07
Member
 
Posts: 534
Joined: Sun Sep 04, 2016 15:15
GitHub: bell07

Re: [mod] TownChest (townchest)

by bell07 » Sun Jul 16, 2017 00:45

Mayor update: I ported the townchest to schemlib, so viewtopic.php?f=9&t=18084 is required now to get it working. Basically the most of the functionality is moved from townchest to schemlib

No or just slight visible changes at the first, the first step was to get the mod working again using the new basis.

A Remark for NPC's: The townchest does not provide own NPC's anymore so without npcf / schemlib_builder_npcf only the instant build is available. The most building specific npc code I moved to schemlib's "npc_ai" part in a way usable with any other mobs/npc framework. So if anyone like to get an other NPC working with schemlib I can support them. But the other framework needs a important feature: It should be able to go to ANY position to place the nodes without stuck. In townchest I did written own logic for this, the logic I ported to the NPCF framework called "movement", and stu accepted my changes in upstream repo. If needed the movement framework could be ported to other mobs/npc implementation too.
 

bell07
Member
 
Posts: 534
Joined: Sun Sep 04, 2016 15:15
GitHub: bell07

Re: [mod] TownChest (townchest)

by bell07 » Tue Jul 31, 2018 06:34

Update: The townchest uses the new schemlib plan/persistance manager now. Visible change is after server reboot the "reload" process is away, the NPC's does start directly work after reboot. The files loading and building preparation is faster now. Please update the schemlib and schemlib_builder_npcf to thest the changes.
 

User avatar
StarNinjas
Member
 
Posts: 194
Joined: Wed Mar 14, 2018 00:32
Location: aincrad
GitHub: starninjas
IRC: StarNinjas
In-game: J1
 

User avatar
StarNinjas
Member
 
Posts: 194
Joined: Wed Mar 14, 2018 00:32
Location: aincrad
GitHub: starninjas
IRC: StarNinjas
In-game: J1

Re: [mod] TownChest (townchest)

by StarNinjas » Tue Aug 28, 2018 21:25

Hello bell07!
I have a few requests:
Townchest shouldn't be craftable
And I made a we file that I hope you'll be able to use it!
I will give you the file asap
 

bell07
Member
 
Posts: 534
Joined: Sun Sep 04, 2016 15:15
GitHub: bell07

Re: [mod] TownChest (townchest)

by bell07 » Wed Aug 29, 2018 20:48

Thank you for the positive feedback. ;-)

The recipe was a try to get the townchest useable in survival. But still no idea for gameplay, so I commented out the crafting recipe now.

About new WE files (mts is supported too) you need have a look to the Share Your WorldEdit Files! You can downoad the files to the buildings folder, the file is available in chest without server restart or something like. Of course you can upload your WE files to the topic
 

User avatar
StarNinjas
Member
 
Posts: 194
Joined: Wed Mar 14, 2018 00:32
Location: aincrad
GitHub: starninjas
IRC: StarNinjas
In-game: J1
 

bell07
Member
 
Posts: 534
Joined: Sun Sep 04, 2016 15:15
GitHub: bell07

Re: [mod] TownChest (townchest)

by bell07 » Wed Aug 29, 2018 21:15

Thank you! Added to the townchest "preinstalled buildings" ;-)
 

User avatar
StarNinjas
Member
 
Posts: 194
Joined: Wed Mar 14, 2018 00:32
Location: aincrad
GitHub: starninjas
IRC: StarNinjas
In-game: J1
 

User avatar
TK Ethan
Member
 
Posts: 21
Joined: Wed Aug 29, 2018 18:04
Location: Colorado,USA
IRC: MangoNinja
In-game: MangoNinja

Re: [mod] TownChest (townchest)

by TK Ethan » Thu Aug 30, 2018 03:34

Cool Mod! Now I will have to make My own building some time.
Jesus Loves You!
My in game name is MangoNinja.Servers to find Me in -> MustTest. Lag World. And sometimes Capture the flag.
 


Return to WIP Mods



Who is online

Users browsing this forum: texmex and 9 guests