Namespaces, Packages and shared resources

For people working on the C++ code.
Post Reply
jamesbooker
New member
Posts: 2
Joined: Mon Jul 30, 2012 13:51

Namespaces, Packages and shared resources

by jamesbooker » Post

I think it would be easier for mod (game) makers and texture pack creators if there were some sort of standard way to create texture packs etc that weren't part of a specific game or mod, but rather were universal. I know that there is the /textures directory, but for shared texture packs this could get very full if they're not organised in some way (especially if two people use the same filename for their textures)

I was wondering whether it might make sense to introduce the concept of 'namespaces' and a 'packages' directory in the root of the minetest directory (or in ~/.minetest for dist-installed users) where mods and texture packs can be installed.

Obviously then the game.conf file could have a [depends] section, which references packages. So if someone creates a texture pack called 'UltimateGrassTextures' and it was in the global packages directory, any game could have a depends=Package:UltimateGrassTextures entry in game.conf (which would be checked it existed, and if not obviously the game wouldn't be started). A corresponding node declaration in a mod's init.lua could be as follows:

minetest.register_node("impassableFoliage:bamboo", {
description = "Bamboo",
drawtype = "glasslike",
tile_images = {"UltimateGrassTextures/reeds.png"},
light_source = 14,
groups = {igniter=2,dig_immediate=3},
drop = '',
walkable = false,
})

Whereby there's a mod called impassableFoliage made by someone, who is registering a node called bamboo, but using a texture from the UltimateGrassTextures package.

It'd be even more awesome if there were a package registry on the web which the client could automatically download the 'UltimateGrassTextures' package if it were connecting to a game which used a texture pack that it didn't already have installed.

I would be willing to put some work into this, but I'm unsure whether anyone wants it (and whether it's already been done) - i've not tried connecting two PC's together and connecting via multiplayer, so I don't know how much of this already happens.

For example, if I develop a new game on a server, and someone else connects to it, does the client already need a copy of the game folder for it to work?

Thanks

User avatar
PilzAdam
Member
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam
Location: Germany

by PilzAdam » Post

1. Games normally containing the textures they need. Theres no need for them to be in textures/all
2. All datas are copied from the server to the client so the client only needs the engien and no game.

jamesbooker
New member
Posts: 2
Joined: Mon Jul 30, 2012 13:51

by jamesbooker » Post

PilzAdam wrote:1. Games normally containing the textures they need. Theres no need for them to be in textures/all
Which is fine for the server side, where the files are only used once, but what if I connect to several different servers to play different games? Say for example both server A and server B use the grass textures described above, and i like to play on both servers, i would have to download them twice. For the person running the server, allowing clients to download textures they potentially already have is just a waste of bandwidth.
PilzAdam wrote:2. All datas are copied from the server to the client so the client only needs the engien and no game.
This is great to know, but it still doesn't solve (1) above

Post Reply

Who is online

Users browsing this forum: No registered users and 7 guests