Turning all items and materials into scripts
- MirceaKitsune
- Member
- Posts: 924
- Joined: Sat May 21, 2011 22:31
- GitHub: MirceaKitsune
- IRC: Taoki
- In-game: MirceaKitsune
- Location: Romania, Bucharest
Turning all items and materials into scripts
Hello everyone. I've been trying out Minetest for a while. Just tried the latest version in the repository now, and wow! It's advancing fast, even if it still has a long way to go. Congratulations to celeron55 for the splendid work he's doing!
Anyway, I wanted to start off with a small suggestion. I mentioned this on IRC a while back, but here it should be easier to discuss. I heard about the upcoming scripting support, and that's very good! But I was thinking about something else that would be nice, and doesn't seem to have been done yet (not sure if it's planned, but still asking).
Could each and every object in Minetest (including natural materials / blocks and all items) be turned into scripts, and not hard coded any more? So basically, the Minetest code does not contain any information about any item itself, but just properties that can be used (what that item is and how it works). Then in a script file, each object is defined with a name, texture, and a property of what it is and how it works.
Here's an example: To make the stone rockpick, you would only create a texture for it, then something like this in a script file:
stone_rockpick
{
name: Stone_Rockpick
texture: data\stone_rockpick.png
type: tool #is an item you hold and use
crafted_with: a-plank-here a-stick-there bla-bla-bla #position of each item for crafting pattern
duration: 10 #lets say each dig reduces by 1, so you can dig 10 times with this
improvement: mining_stone 1.5 #says that while holding this tool, you mine stone half a time faster
}
Just a random example (in a random scripting language that came to mind) to illustrate what I mean. This could make Minetest VERY flexible and easy to edit in all ways, without having to change any code. One could add new tools very easily, remove tools they don't care about, and do anything they want.
Same could be done with everything... even blocks the world is generated with. You would define within the script if that block should be used by the world generator, and you could even invent new materials, stuff like alien trees (or whatever comes to mind) and make new worlds that way, without having to change any code.
I believe this would be really cool. So I just wanted to propose it here, since I wasn't sure if turning every item and object into scripts is planned with the scripting support. Hope it will happen
Anyway, I wanted to start off with a small suggestion. I mentioned this on IRC a while back, but here it should be easier to discuss. I heard about the upcoming scripting support, and that's very good! But I was thinking about something else that would be nice, and doesn't seem to have been done yet (not sure if it's planned, but still asking).
Could each and every object in Minetest (including natural materials / blocks and all items) be turned into scripts, and not hard coded any more? So basically, the Minetest code does not contain any information about any item itself, but just properties that can be used (what that item is and how it works). Then in a script file, each object is defined with a name, texture, and a property of what it is and how it works.
Here's an example: To make the stone rockpick, you would only create a texture for it, then something like this in a script file:
stone_rockpick
{
name: Stone_Rockpick
texture: data\stone_rockpick.png
type: tool #is an item you hold and use
crafted_with: a-plank-here a-stick-there bla-bla-bla #position of each item for crafting pattern
duration: 10 #lets say each dig reduces by 1, so you can dig 10 times with this
improvement: mining_stone 1.5 #says that while holding this tool, you mine stone half a time faster
}
Just a random example (in a random scripting language that came to mind) to illustrate what I mean. This could make Minetest VERY flexible and easy to edit in all ways, without having to change any code. One could add new tools very easily, remove tools they don't care about, and do anything they want.
Same could be done with everything... even blocks the world is generated with. You would define within the script if that block should be used by the world generator, and you could even invent new materials, stuff like alien trees (or whatever comes to mind) and make new worlds that way, without having to change any code.
I believe this would be really cool. So I just wanted to propose it here, since I wasn't sure if turning every item and object into scripts is planned with the scripting support. Hope it will happen
- titformatt
- Member
- Posts: 15
- Joined: Wed May 11, 2011 19:36
- Location: Ireland
I wrote:
Might be worth looking at this thread before making anymore posts here...
Scripting discontinued
- MirceaKitsune
- Member
- Posts: 924
- Joined: Sat May 21, 2011 22:31
- GitHub: MirceaKitsune
- IRC: Taoki
- In-game: MirceaKitsune
- Location: Romania, Bucharest
- MirceaKitsune
- Member
- Posts: 924
- Joined: Sat May 21, 2011 22:31
- GitHub: MirceaKitsune
- IRC: Taoki
- In-game: MirceaKitsune
- Location: Romania, Bucharest
Agreed. Hard coded items and materials are a bad way to go, in my opinion. And cut a flexibility that would make everything a lot more fun. Also, XML seems like the best way to me (and most common one).Fisherman wrote:It kinda looks like JSON or something. It's not really scripting, it's more a way to store structured data.
I agree that minetest should use something like that. Maybe YML, XML, JSON, ...
Hardcoding items seems like a Bad Idea (TM)
- jordan4ibanez
- Member
- Posts: 1923
- Joined: Tue Sep 27, 2011 18:44
- GitHub: jordan4ibanez
- IRC: jordan4ibanez
- In-game: jordan4ibanez
Decided to chime in. A form of scripting support may be a good idea overall. For the administrator, having scripting support isn't going to cause a rash of forks/clones. If anything it will help get more features available in minetest a lot faster.
If someone comes along and they have an idea for an item, if there's scripting available then they can make a script for that item. If there was a "user script directory" they could then share it and if it's good it could become an official minetest included script.
The drawbacks I see is the potential for slowdowns of gameplay, potential a**holes making damaging scripts and various clients not having access to same set of scripts.
The solutions to the above would be to have minetest come with a set of "official scripts" and on the script repo page (maybe on the wiki?) make sure the user understands the drawbacks of using any unofficial script.
An example of items:
* Let's say a number of people want beds. Make a bed script and put in wiki. Others could modify it to make it better and eventually get included in official minetest distribution.
* Say people want a monster that looks like dragon, script could be made by someone who really wants it and others could modify/improve it and maybe eventually get into minetest.
Might be a good idea to have community votes on if a script is worthy enough to be included in the official script set.
My two cents.
If someone comes along and they have an idea for an item, if there's scripting available then they can make a script for that item. If there was a "user script directory" they could then share it and if it's good it could become an official minetest included script.
The drawbacks I see is the potential for slowdowns of gameplay, potential a**holes making damaging scripts and various clients not having access to same set of scripts.
The solutions to the above would be to have minetest come with a set of "official scripts" and on the script repo page (maybe on the wiki?) make sure the user understands the drawbacks of using any unofficial script.
An example of items:
* Let's say a number of people want beds. Make a bed script and put in wiki. Others could modify it to make it better and eventually get included in official minetest distribution.
* Say people want a monster that looks like dragon, script could be made by someone who really wants it and others could modify/improve it and maybe eventually get into minetest.
Might be a good idea to have community votes on if a script is worthy enough to be included in the official script set.
My two cents.
"Before you speak, ask yourself: Is it kind, is it true, is it necessary, does it improve upon the silence?"
My mods: http://goo.gl/n4kpn
(Currently Various, Industrial, Fakeblocks, Jail, MoarCraft, Christmas, Replicator, minetest dev installer for linux, bash mod installer, windows mod installer)
My mods: http://goo.gl/n4kpn
(Currently Various, Industrial, Fakeblocks, Jail, MoarCraft, Christmas, Replicator, minetest dev installer for linux, bash mod installer, windows mod installer)
I have exact idea how the concept should look (by my personal thoughts) i'll split in into few points:
- minetest on its own should be only engine
- implementation of GUI, blocks, items, entities should be in LUA scripts
- scripts, that could be shared between client and server like blocks/entities definition
- it could use different communication protocols, implementation in LUA scripts/dynamic library (to be compatible with other blocky games)
- different chunk formats (dynamic library implementation)
this could make minetest pretty universal and moddable game.
I'm not pro, but i think, it could work
- minetest on its own should be only engine
- implementation of GUI, blocks, items, entities should be in LUA scripts
- scripts, that could be shared between client and server like blocks/entities definition
- it could use different communication protocols, implementation in LUA scripts/dynamic library (to be compatible with other blocky games)
- different chunk formats (dynamic library implementation)
this could make minetest pretty universal and moddable game.
I'm not pro, but i think, it could work
For the record.. there's a new version.
It has LUA mods (c55 says "mods" sounds cooler than "scripts").
C55's announcement:
http://c55.me/blog/?p=665
Kahrl requests help figuring out a TOC for a Mod Tutorial:
http://celeron.55.lt/~celeron55/minetes ... php?id=475
It has LUA mods (c55 says "mods" sounds cooler than "scripts").
C55's announcement:
http://c55.me/blog/?p=665
Kahrl requests help figuring out a TOC for a Mod Tutorial:
http://celeron.55.lt/~celeron55/minetes ... php?id=475
Unless otherwise specified: I use linux and run (and compile) the latest dev.
- MirceaKitsune
- Member
- Posts: 924
- Joined: Sat May 21, 2011 22:31
- GitHub: MirceaKitsune
- IRC: Taoki
- In-game: MirceaKitsune
- Location: Romania, Bucharest
Just checked the latest version of MineTest from GIT, and took a look at the LUA scripts. All items seem to have been moved from the code, and the script looks exactly like what I had in mind for defining them. Cheers for this great improvement It will make modding very easy, and I believe this is a huge advantage from MineCraft and any other forks.
- MirceaKitsune
- Member
- Posts: 924
- Joined: Sat May 21, 2011 22:31
- GitHub: MirceaKitsune
- IRC: Taoki
- In-game: MirceaKitsune
- Location: Romania, Bucharest
Who is online
Users browsing this forum: No registered users and 3 guests