[mod] TownChest (townchest)

bell07
Member
 
Posts: 140
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.

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

Dependencies:
- default
- npcf (NOT the npcf_builder or whole pack, the framework only). I developed and tested with the "npcf_ng" branch from rubenwardy repository: https://github.com/rubenwardy/minetest- ... pcf_ng.zip

Current state:

Chest:
- The chest does manage the work plan
- WorldEdit files compatible
- Write the metadata from WE-file to the placed nodes if available
- Clear and flat the place of the building
- Building tasks without file: fill with air, fill with cobble, a box, a plate (you need to enter the size only)
- Instant build the building without NPC

NPC:
- Physical NPC (npcf) with teleporting on stuck
- A NPC search for a chest with active building plan and served the chest
- Multiple NPC's per chest allowed
- If the chest is not active anymore - auto-reassignment to the next one

ToDo:
- Material management - means the NPC needs own inventory, all nodes needs to be obtained before build.
- Porting building preview from handle_schematics
- Porting MTS - File Support 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?

Any ideas welcome!
Any contribution and github pull-requests welcome!
Attachments
screenshot.png
screenshot.png (408.51 KiB) Viewed 1171 times
Last edited by bell07 on Fri Nov 25, 2016 21:43, edited 3 times in total.
 

User avatar
TheReaperKing
Member
 
Posts: 493
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
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: 140
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: 140
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: 2980
Joined: Sun Sep 09, 2012 17:31

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: 140
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: 10
Joined: Sun Feb 12, 2017 14:08
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 mod:
usefull_contraptions


(ง'̀-'́)ง
 

bell07
Member
 
Posts: 140
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 :/
 


Return to WIP Mods

Who is online

Users browsing this forum: No registered users and 44 guests

cron