I really like the idea of a camera mod. Create an image of what you see and put it on a wall later. This could be used for various creative things. The picture taking itself works fine but is oddly done with a command rather than an item or something.
Sadly, due to the limitations of Minetest, there are several drawbacks and limitations:
Only b/w images
Objects and players are invisible to the camera
Custom block shapes are not supported. In the photo it either becomes a full block or no block. E.g. plants are not drawn correctly
Picture calculation is slow, it can take several seconds
Making a picture blocks the entire server. So while the picture is calculated, everything else comes to a screeching halt
While the first 3 limitations may be acceptable, the performance problem is the biggest show stopper right now.
This mod clearly tries to put Minetest to its limits and it's definitely worth checking out because it's something very unique. But I don't recommend this mod for actual gameplay or server use. Consider this mod experimental.
The images are grayscale bcause Minetest is not giving me the actual color of the pixel or even node I hit. I started this mod thinking that the engine may expose a node's minimap color – but currently it only does this on the client side. So I am basically making the colors up myself. I could probably get the color by parsing server-side textures files, but I really think I should not have to. Funnily enough, this is a stylistic choice – I only want the minimap olor of the node so I can assign an appropriate grayscale value.
Objects and players do not have to be invisible. The main issue here is that I would be hitting their collision boxes only, i.e. they would appear as cuboids. For a game in which players or entities appear as boxes or ghostly shadows, this could work. Hitboxes being as crude as they are is an engine limitation.
Custom node shapes work, but only as far as their collision box is concerned. As you can see in the screenshots, tables and chairs look perfectly fine.
Raytracing is slow, it is just the nature of the matter. Raytracing will always be slow, unless I reduce quality. Maybe I can do that, but I think waiting a few seconds for a photo of a scene in a game is not too much. You have to wait a bit of time for in-game map item generation in mcl_maps and xmaps as well, or for anything that emerges a lot of terrain.
That making a picture blocks the server is mostly the fault of the Minetest engine right now. For example, async environments do not get any usable vectors (metatables are missing). However, if I had a way to spread the calculation out over time to only block the server for non-noticeable amounts of time, I would certainly prefer that.
I really like the idea of a camera mod. Create an image of what you see and put it on a wall later. This could be used for various creative things. The picture taking itself works fine but is oddly done with a command rather than an item or something.
Sadly, due to the limitations of Minetest, there are several drawbacks and limitations:
While the first 3 limitations may be acceptable, the performance problem is the biggest show stopper right now.
This mod clearly tries to put Minetest to its limits and it's definitely worth checking out because it's something very unique. But I don't recommend this mod for actual gameplay or server use. Consider this mod experimental.
To elaborate on this (I am the author of Xcam):
mcl_maps
andxmaps
as well, or for anything that emerges a lot of terrain.You can do something like this:
appgurueu/luatic has shown me how to spread calculations over several server steps using coroutines: https://gist.github.com/appgurueu/f566cafa9482b0fc74eb6050417e3ed5
@Wuzzy as of xcam release 2023-11-25, you can vary photo size, rendering distance and supersampling. All of these should affect performance.
Setting supersampling to 1 (from 4) should immediately make the photo rendering 4 times as fast, but the photo looks more pixelated.
With photo size at or below 80×80 and supersampling set to 1 the
/snap
command take less than a second on a T60.Please tell me which photo-taking speed with which settings you deem acceptable performance-wise.