[Mod] Towntest [towntest] - Grow a town in minetest.

Sokomine
Member
Posts: 4276
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine
IRC: Sokomine
In-game: Sokomine

Re: [Mod] Towntest [towntest] - Grow a town in minetest.

by Sokomine » Post

The buildings from this mod can now be used in mg_villages as well. Just install the village_towntest mod.

A village with towntest buildings in winter, using minetest_game:
Image

Another towntest village, using ethereal:
Image
A list of my mods can be found here.

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

Re: [Mod] Towntest [towntest] - Grow a town in minetest.

by bell07 » Post

Hi,
I did some changes/rewrites on this mod. Please see / review my changes at https://github.com/bell07/minetest-towntest. Pull request is set to upstream.

Main changes:
- Support fir newer WE-Files added. So you can save a building using the latest WorldEdit, move the we file to the towntest_chest/buildings and it is buildable.
- Metadata handling is there, so the chests can be full after building if stored in the template file ;)
- Special blocks like doors:hidden are handled, Glass pane, Coffee Table are no problem too
- Ignoring of unknown nodes in the file. So if you try to build a home with equipment from homedecor mod in a game without this mod, no problem, just the homedecor nodes will be not placed
- More intelligence for NPC. He builds not just line for line but search for shorter ways, but not perfect. Its funny to look how the NPC decide which block should be placed at the next
- Crafting recipe added to build the chest in survival (The builder is no problem for survival because you need to provide all used nodes for the building)

Code: Select all

        output = 'towntest_chest:chest',
        recipe = {
                {'default:mese_crystal', 'default:chest_locked', 'default:mese_crystal'},
                {'default:book', 'default:diamond',    'default:book'},
                {'default:mese_crystal', 'default:chest_locked', 'default:mese_crystal'},
        }
Some screenshots:

All nodes placed by the NPC:
Image

The NPC follows the building structure instead of build line-per-line
Image
Attachments
screenshot_20160918_210046.png
screenshot_20160918_210046.png (454.3 KiB) Viewed 1382 times
screenshot_20160918_203323.png
screenshot_20160918_203323.png (940.13 KiB) Viewed 1382 times
Last edited by bell07 on Sun Sep 25, 2016 06:38, edited 1 time in total.

User avatar
azekill_DIABLO
Member
Posts: 7507
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO
Location: OMICRON
Contact:

Re: [Mod] Towntest [towntest] - Grow a town in minetest.

by azekill_DIABLO » Post

awesome...i lost my words.
Gone, but not dead. Contact me on discord: azekill_DIABLO#6565
DMs are always open if you want to get in touch!

im-poke
Member
Posts: 1084
Joined: Sat Apr 18, 2015 15:50
IRC: poke
In-game: poke
Location: Somewhere in the Universe, on a weird planet called Earth/

Re: [Mod] Towntest [towntest] - Grow a town in minetest.

by im-poke » Post

Great mod
ARE YOU A NYAN CAT?????
--ABJ

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

Re: [Mod] Towntest [towntest] - Grow a town in minetest.

by TheReaperKing » Post

I'm using Bell's repo but every time I create a chest it crashes the game. I don't get much of an error message, just:

Code: Select all

2016-09-24 19:17:23: ACTION[Server]: singleplayer places node towntest_chest:chest at (-602,29,107)
2016-09-24 19:17:23: ACTION[Server]: facedir: 3
2016-09-24 19:17:23: [Server]:  >> === FATAL ERROR ===
2016-09-24 19:17:23: [Server]:  >> Unknown exception (Exception 0xC0000029) at 0x77370F4E
2016-09-24 19:17:23: [Server]:  >> Saved dump to C:\Users\M\Desktop\d\testinggrounds\minetest_160918\minetest_release\bin\..\minetest.dmp
I'm using the latest dev version compiled on Sept 18th. I also had originally tried with base 0.4.14 with no dice. Have other people gotten it to work? Thanks and take care!
-Mike
Become A Real Life Superhero - http://SuperheroHill.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: 604
Joined: Sun Sep 04, 2016 15:15
GitHub: bell07

Re: [Mod] Towntest [towntest] - Grow a town in minetest.

by bell07 » Post

@TheReaperKing : yea, it is the reason why I do not like Windows. If something does not work you get a crypted message only. Seems like https://github.com/minetest/minetest/issues/3148

I removed a not working "chat_send_player" from the mod, so please check out the last version and try again.

If it does not work, anything in debug.txt?
Please edit the "init.lua" and remove the leading --" in the line 24 to enable debug-print "print(unpack(arg))"

Does the last version works for you not touched by me?

Code: Select all

git checkout f8813e3
Is anyone on Windows there and can confirm the mod is working or not working?

im-poke
Member
Posts: 1084
Joined: Sat Apr 18, 2015 15:50
IRC: poke
In-game: poke
Location: Somewhere in the Universe, on a weird planet called Earth/

Re: [Mod] Towntest [towntest] - Grow a town in minetest.

by im-poke » Post

I'll check it mate (however, i should use my linux more instead (-: )
ARE YOU A NYAN CAT?????
--ABJ

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

Re: [Mod] Towntest [towntest] - Grow a town in minetest.

by TheReaperKing » Post

It still crashed after I updated the git but I'll try it in Linux. Also what version of minetest are you using? Nothing interesting in debug.txt, just that message even with the debug-print enabled.

EDIT - Here is what I get when using it on Linux. I'll test with the version not edited by you:

Code: Select all

2016-09-25 10:47:33: ACTION[Server]: singleplayer places node towntest_chest:chest at (5,4,1)
2016-09-25 10:47:33: ACTION[Server]: facedir: 1
2016-09-25 10:47:33: ERROR[Main]: ServerError: Lua: Runtime error from mod 'towntest_chest' in callback item_OnPlace(): Runtime error from mod 'towntest_chest' in callback node_on_construct(): ...st/bin/../mods/minetest-towntest/towntest_chest/init.lua:24: module 'lfs' not found:
2016-09-25 10:47:33: ERROR[Main]: 	no field package.preload['lfs']
2016-09-25 10:47:33: ERROR[Main]: 	no file './lfs.lua'
2016-09-25 10:47:33: ERROR[Main]: 	no file '/usr/share/luajit-2.0.4/lfs.lua'
2016-09-25 10:47:33: ERROR[Main]: 	no file '/usr/local/share/lua/5.1/lfs.lua'
2016-09-25 10:47:33: ERROR[Main]: 	no file '/usr/local/share/lua/5.1/lfs/init.lua'
2016-09-25 10:47:33: ERROR[Main]: 	no file '/usr/share/lua/5.1/lfs.lua'
2016-09-25 10:47:33: ERROR[Main]: 	no file '/usr/share/lua/5.1/lfs/init.lua'
2016-09-25 10:47:33: ERROR[Main]: 	no file './lfs.so'
2016-09-25 10:47:33: ERROR[Main]: 	no file '/usr/local/lib/lua/5.1/lfs.so'
2016-09-25 10:47:33: ERROR[Main]: 	no file '/usr/lib/x86_64-linux-gnu/lua/5.1/lfs.so'
2016-09-25 10:47:33: ERROR[Main]: 	no file '/usr/local/lib/lua/5.1/loadall.so'
2016-09-25 10:47:33: ERROR[Main]: stack traceback:
2016-09-25 10:47:33: ERROR[Main]: 	[C]: in function 'require'
2016-09-25 10:47:33: ERROR[Main]: 	...st/bin/../mods/minetest-towntest/towntest_chest/init.lua:24: in function 'get_files'
2016-09-25 10:47:33: ERROR[Main]: 	...st/bin/../mods/minetest-towntest/towntest_chest/init.lua:317: in function 'formspec'
2016-09-25 10:47:33: ERROR[Main]: 	...st/bin/../mods/minetest-towntest/towntest_chest/init.lua:355: in function <...st/bin/../mods/minetest-towntest/towntest_chest/init.lua:348>
2016-09-25 10:47:33: ERROR[Main]: 	[C]: in function 'add_node'
2016-09-25 10:47:33: ERROR[Main]: 	/home/m/Desktop/test/minetest/bin/../builtin/game/item.lua:285: in function </home/m/Desktop/test/minetest/bin/../builtin/game/item.lua:197>
2016-09-25 10:47:33: ERROR[Main]: stack traceback:
2016-09-25 10:47:33: ERROR[Main]: 	[C]: in function 'add_node'
2016-09-25 10:47:33: ERROR[Main]: 	/home/m/Desktop/test/minetest/bin/../builtin/game/item.lua:285: in function </home/m/Desktop/test/minetest/bin/../builtin/game/item.lua:197> 	[C]: in function 'add_node'
2016-09-25 10:47:33: ERROR[Main]: 	/home/m/Desktop/test/minetest/bin/../builtin/game/item.lua:285: in function </home/m/Desktop/test/minetest/bin/../builtin/game/item.lua:197>
2016-09-25 10:47:33: ERROR[Main]: stack traceback:
2016-09-25 10:47:33: ERROR[Main]: 	[C]: in function 'add_node'
2016-09-25 10:47:33: ERROR[Main]: 	/home/m/Desktop/test/minetest/bin/../builtin/game/item.lua:285: in function </home/m/Desktop/test/minetest/bin/../builtin/game/item.lua:197>
Become A Real Life Superhero - http://SuperheroHill.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: 604
Joined: Sun Sep 04, 2016 15:15
GitHub: bell07

Re: [Mod] Towntest [towntest] - Grow a town in minetest.

by bell07 » Post

I use the stable minetest-0.4.14 (compiled trough gentoo-portage) and the stable-0.4 branch of minetest_game. Nothing special.
My guess is your installation have an issue to read towntest_chest/buildings directory

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

Re: [Mod] Towntest [towntest] - Grow a town in minetest.

by TheReaperKing » Post

Just as a note the original one does work. I'm using the latest codebase of both minetest and minetest game freshly compiled today. I'm currently on Lubuntu 16.04
Become A Real Life Superhero - http://SuperheroHill.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: 604
Joined: Sun Sep 04, 2016 15:15
GitHub: bell07

Re: [Mod] Towntest [towntest] - Grow a town in minetest.

by bell07 » Post

Code: Select all

module 'lfs' not found
is the issue. Already forgotten, initially I had to install this "lfs" package too to get the mod working. The one of the last commits by Elinvention on the original was the change to "lfs" to read the buildings folder.

In Gentoo I had to install the package

Code: Select all

[I] dev-lua/luafilesystem
     Verfügbare Versionen:   1.5.0 ~1.6.2
     Installierte Versionen: 1.5.0(23:06:08 07.09.2016)
     Startseite:             https://keplerproject.github.com/luafilesystem/
     Beschreibung:           File System Library for the Lua Programming Language
Please find out and install this lua module to your Lubuntu and/or Windows

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

Re: [Mod] Towntest [towntest] - Grow a town in minetest.

by TheReaperKing » Post

lfs looks like kind of a pain to set up in Windows. What exactly does it add to the mod? Also it'd probably be good to mention it as a dependency. Perhaps it could be included with the mod. I imagine a lot of people won't want to go through the work of installing it.

Also are you going to set up a separate mod thread for this? It would be a lot easier for people to find your changes I'm sure. Thanks for your hard work on this, I feel like it is one step closer to my dream of millenaire aka http://millenaire.org/ on minetest!!

Take care.
-Mike
Become A Real Life Superhero - http://SuperheroHill.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: 604
Joined: Sun Sep 04, 2016 15:15
GitHub: bell07

Re: [Mod] Towntest [towntest] - Grow a town in minetest.

by bell07 » Post

The LuaFileSystem is a OS independent library for FS activities, but the same can be done native using io.popen and command line (as it was implemented before).
I implemented again the old way using "io.popen" and fixed the old workaround so the mod can be used on RO-file systems. So please try again, the mod should be works now without the LuaFS module. If anyone needs the LuaFS implementation, it is not removed, just disabled in code and can be activated using c_use_lfs line at begin of init.lua

The other question: separate mod thread. I am a newbie here and don't know how is the right way. My work should not be a independent fork, I just contribute to existing project. But I am unsure how the project is organized. And I am unsure if my goal is the same as the project owner.
My goal: I am lazy, so instead of build the buildings by myself I like to develop a tool that does it for me. I am not really interested on a villages simulation. My goal is to be able to define what the NPC should build for me and the NPC should just do it. But it will be nice to see the towntest-NPC as a Villager ;) If you search for something like millenaire you may should have a look to mg_villages, the project seems to have the same goal, to generate villages.

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

Re: [Mod] Towntest [towntest] - Grow a town in minetest.

by TheReaperKing » Post

It works!!! Nice job! Thank you for not making the LuaFS a requirement, that wouldn't have been so much fun to set up on the school computers either. Too bad you have to compile it and do all the setup work for luarocks too, boo.

To make it a separate mod you could post it in the WIP Mods if you wanted. You could call it something like Towntest Extended or whatever and say how it is based on Towntest. Best case I'd think so is cornernote responds and you two work together :) If you do end up having different goals then the separate mod would be the way to go I'd think and then people could always have the option to try both. The main reason I suggest the mod post is because it seems like cornernote hasn't updated the mod in a bit and it'd give your changes a lot more exposure. Also it'd be way more organized because right now your git link will get lost in the thread pages vs being in the first post of a new thread. Just an idea of course :)

I really like the idea of them building for the player!! Also I see he was trying to get lumberjacks in gear. Maybe farmers and miners would be cool too? Maybe even hunters! Just ideas. Take care!
-Mike

EDIT - I noticed they try to build in already existing blocks, would it be possible for them to mine away stuff that is in the way?
Become A Real Life Superhero - http://SuperheroHill.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: 604
Joined: Sun Sep 04, 2016 15:15
GitHub: bell07

Re: [Mod] Towntest [towntest] - Grow a town in minetest.

by bell07 » Post

EDIT - I noticed they try to build in already existing blocks, would it be possible for them to mine away stuff that is in the way?
My daughter asked me already for this feature. A second thing that I intend is to take flatten the building place in both directions, remove existing blocks from building inside and to flat the ground bellow the building. Currently in most cases the building is hanging in the air at the one site and is built in in the hill at the other site. But currently I plan to get stabilized the current state, there are some bugs like the NPC runs away for unknown reason or does not like to accept already placed blocks. And for now I have less time to work on the mod.

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

Re: [Mod] Towntest [towntest] - Grow a town in minetest.

by TheReaperKing » Post

Thanks so much already for the awesome work you've done! I'm definitely going to be playing this with my students tomorrow. I'm excited as well to try to take some buildings they created and let them watch as the NPCs build it :) Right now I have so many buildings being put up. I also really like how you added the crafting recipe for survival.

Perhaps the first thing the NPCs would do is to clear away the area that the blueprint space would occupy?

Since you want the NPCs do work for you it reminds me of another mod I liked in addition to milleraire, here is mining colony for minecraft, figured it might be some inspiration, specifically the workers page I'm linking:
http://www.minecolonies.com/workers

I wonder if we can make the NPCs do anything interesting after they are done building. Maybe they'd ask you if they can build anything else or maybe even as an option chill what they made. That of course would be super low priority but it would bring a little more life to it.

Thanks again for your hard work! Take care.
-Mike

EDIT - I also noticed when they return to the chests they are facing 90 degrees to the right. Also maybe a "repair" option would be nice especially if you accidentally break an area or for me when making the factory the lava dumped all over the place and burned the chests and signs haha. Maybe when it goes inactive it could do a check to see if any blocks need adjustment/replacement?
Become A Real Life Superhero - http://SuperheroHill.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: 604
Joined: Sun Sep 04, 2016 15:15
GitHub: bell07

Re: [Mod] Towntest [towntest] - Grow a town in minetest.

by bell07 » Post

I also noticed when they return to the chests they are facing 90 degrees to the right
I seen that too the looking direction is not right. But it is low-priority for me.
Also maybe a "repair" option would be nice especially if you accidentally break an area or for me when making the factory the lava dumped all over the place and burned the chests and signs haha. Maybe when it goes inactive it could do a check to see if any blocks need adjustment/replacement?
Already implemented ;) Just remove the chest and set the chest again at the same place and select the same building. In the first calculation what should be done the there is a search for already existing nodes that will be removed from building plan. Each "inactive" is not meaningful because of automatic changes like the dirt is changed to dirt_with_grass or something like

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

Re: [Mod] Towntest [towntest] - Grow a town in minetest.

by TheReaperKing » Post

I agree the turning angle is low priority, I wasn't sure if it was a quick fix but I definitely don't mind.

I have noticed that with some of the bigger structures they take forever. Would it be hard to add a second or third worker to help? If it is then it isn't a big deal.

Good idea with the repair! Is the building always supposed to be built relative to the direction the chest is facing? What I mean is the first castle built to the NE of where I put the chest and that is with the lock facing me. But the second one it built SE I think. I'll test more tomorrow and hopefully I can even help a bit :) Though my coding skills are rather basic, but gotta start somewhere!

I think this mod is so awesome and thanks again for helping to continue it!! I've been messing with it all day haha. Take care.
-Mike
Become A Real Life Superhero - http://SuperheroHill.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: 604
Joined: Sun Sep 04, 2016 15:15
GitHub: bell07

Re: [Mod] Towntest [towntest] - Grow a town in minetest.

by bell07 » Post

Also I see he was trying to get lumberjacks in gear. Maybe farmers and miners would be cool too? Maybe even hunters!
The lumberjack inventory was already implemented by cornernote but there is no functionality at the place. It will be nice to get other helpers, but first the builder should work as exepected,
Perhaps the first thing the NPCs would do is to clear away the area that the blueprint space would occupy?
My idea is to do it on demand. But in detail I need to play with them how is the best way to do it. It is the next point on my roadmap as soon as I am satisfied with builders building skills.
I have noticed that with some of the bigger structures they take forever. Would it be hard to add a second or third worker to help? If it is then it isn't a big deal.
I thinked already about that. But currently there is an other issue with bigger buildings. MT disable nodes and entitys if no player is nearly. The mod works currently only if the builder AND the chest are active. For some building it is enough to place the player between the chest and the builder position. For other you need 2 players, one nearly the chest and the second one runs with NPC.
One of my personal goals is to get viewtopic.php?p=121294#p121294 buildable with this mod. If the NPC does the first node placed from this building I like to think about optimizations like more NPC's. Currently the NPC just runs away after looking to the building plan and is hidding so I cannot find them ;(
Is the building always supposed to be built relative to the direction the chest is facing?
There is no rotation implemented. The building is always to the same direction, relative to the coordinates in the WE file (in most files +x/+y/+z direction). The chest position corresponds to the 0,0,0 node in the file.

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

Re: [Mod] Towntest [towntest] - Grow a town in minetest.

by bell07 » Post

I have noticed that with some of the bigger structures they take forever.
Forgotten to say, try to deposit apples to the chest ;-) (Thanks to cornernote for this)

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

Re: [Mod] Towntest [towntest] - Grow a town in minetest.

by TheReaperKing » Post

Thanks for all the info!

Maybe this would help in keeping the entities persistent?
viewtopic.php?f=9&t=12943

I have to fly to work, take care!
-Mike
Become A Real Life Superhero - http://SuperheroHill.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

Sokomine
Member
Posts: 4276
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine
IRC: Sokomine
In-game: Sokomine

Re: [Mod] Towntest [towntest] - Grow a town in minetest.

by Sokomine » Post

bell07 wrote: One of my personal goals is to get viewtopic.php?p=121294#p121294 buildable with this mod. If the NPC does the first node placed from this building I like to think about optimizations like more NPC's. Currently the NPC just runs away after looking to the building plan and is hidding so I cannot find them ;(
Guess the NPC's afraid of all the time it would take him to build some of the larger structures :-)
bell07 wrote: There is no rotation implemented. The building is always to the same direction, relative to the coordinates in the WE file (in most files +x/+y/+z direction). The chest position corresponds to the 0,0,0 node in the file.
The build-chest in my handle_schematics mod takes care of rotation and can import a wide variety of schematic formats. The chest was inspired by cornernotes towntest chest. There's no npc associated with my chest, and building takes (or would take, if it where enabled) diffrent steps - i.e. stone and tree materials are requested first in order to build the frame, after that wood is added, then a roof, last a garden. I think that looks more natural than a building "raising" out of the ground. The downside is that all those blocks from the previous steps would block the NPC from reaching inside locations; moving the bed in after the house has been built requires more intelligence than those mobs usually come with ,-) But then, watching the NPC actually build something is only fun for a limited time. He ought to "continue" while you're away gathering further materials.
A list of my mods can be found here.

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

Re: [Mod] Towntest [towntest] - Grow a town in minetest.

by bell07 » Post

Just for imformation: cornernote did merged all my changes to upstream.
I started a fork named "townchest" that is a full rewrite of towntest_chest, currently in very early development stage: viewtopic.php?f=9&t=15704

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 26 guests