Voxelmanip Forums
foodyummy foodyummy
Posted on 2023-10-23 21:45, in foodyummy's minetest experiments Link | ID: 735
That's a destructor method for LuaVoxelManip (notice the tilde in the method name), which is called when a LuaVoxelManip object is deleted in C++.
whoops... well, I did say I'm not too familiar with c++... :LOL:
Huh? It should be possible to create a VoxelManip object outside of minetest.on_generated by using minetest.get_voxel_manip. Make sure you pass two arguments to the function, two corner positions which define the cuboid it will load from the map to allow for bulk manipulation. It will then return a VoxelManip object along with the minimum and the maximum emerge position, just like the VoxelManip mapgen object.
so I tried following your exact advice... I backed up the code and stripped it down to just the following:

local minp = {x = -8, y = -8, z = -8}
local maxp = {x = 8, y = 8, z = 8}

local vm1, emin1, emax1 = minetest.get_voxel_manip(minp, maxp)
minetest.log(tostring(vm1))

local vm2, emin2, emax2 = VoxelManip(minp, maxp)
minetest.log(tostring(vm2))

this is literally the only Lua code that's being run in the game... I tried calling both methods, outside of a mapgen thread, as plainly as possible.

here's the output from ~/.minetest/debug.txt:

2023-10-23 13:39:49: [Main]: Automatically selecting world at [~/.minetest/worlds/world1]
2023-10-23 13:39:59: [Main]: nil
2023-10-23 13:39:59: [Main]: nil
2023-10-23 13:39:59: ACTION[Main]: World at [~/.minetest/worlds/world1]
2023-10-23 13:39:59: ACTION[Main]: Server for gameid="extremesimpletest" listening on 0.0.0.0:52717.
2023-10-23 13:40:00: ACTION[Server]: singleplayer [127.0.0.1] joins game. List of players: singleplayer
2023-10-23 13:40:01: ACTION[Main]: Server: Shutting down

minetest.log simply prints nil, and any attempt to call the VM's methods results in a crash: attempt to index local 'vm1' (a nil value)

I don't really know what else to do... this is as plain and simple as it gets. both methods return nil :( I'm not sure if this is a bug or if it's intentional. The API documentation doesn't mention anywhere that voxelmanips can only be used in a mapgen thread, so it seems like a bug to me? I'm not a coredev so I can't be sure...

it seems my only alternative is to think inside the box :LOL: and try to hijack minetest's on_generated function... write my own function for managing the generation of each subworld... use emerge_area and delete_area to generate subworlds at will...

I mean, it all seems like a big hack to me, but if it's the only way to do it then I'll try it ¯\_(ツ)_/¯
foodyummy foodyummy
Posted on 2023-10-23 08:44, in foodyummy's minetest experiments (edited 2023-10-23 08:53) Link | ID: 733
here's another devlog, mostly just to complain about stuff ¯\_(ツ)_/¯

I'm deciding to hold off on hemispheres until I get some bugs under control. right now I'm focusing on just having Lua generate and handle multiple "subworlds" in a single minetest map. hemispheres will come when I'm ready for that :)

so, about those bugs: they cropped up in the middle of development, courtesy of minetest... :(

the biggest one in particular is that minetest's builtin perlin noise functions, as well as the entirety of VoxelManip, only work in a mapgen thread. considering that my demo revolves around being able to register and delete subworlds on the fly, this is going to be a problem...

the first issue was perlin noise, so let's start with that... I created a quick testing environment, ExtremeSimpleTest, and threw together some code in a single mod: https://pastebin.com/BsZzHhRL try it yourself! :D

now the official API documentation states that there are two methods to get a perlin noise generator: PerlinNoise() or minetest.get_perlin(). The sole difference is that minetest.get_perlin() adds the world's seed to its own provided seed.

I can only deduce it's the world seed feature of minetest.get_perlin() that causes it to crash... I mean, as far as I know, there's no other difference!

The solution was simple: replace minetest.get_perlin() with PerlinNoise(). it does mean I have to implement world seeds manually... although I'd probably have to do that with subworld mapgen anyway, so no loss :)

so by exploiting a small technicality, I was able to get perlin noise outside of a mapgen thread. however the next problem, voxelmanip, is still stumping me as of tonight: it seems that every time I call minetest.get_voxel_manip() or VoxelManip() outside of a mapgen thread, it returns nil.

so I looked through minetest's github repo. In particular I looked through minetest/src/script/lua_api/l_vmanip.cpp and I think I have found the culprit, starting at line 367:

LuaVoxelManip::~LuaVoxelManip()
{
if (!is_mapgen_vm)
delete vm;
}

check it out for yourself... https://github.com/minetest/minetest/blob/master/src/script/lua_api/l_vmanip.cpp#L367-L371

I don't fully understand c++ yet, but it seems here this function detects if the voxelmanip is in a mapgen thread or not and deletes the voxelmanip if it isn't. given that it was explicitly written like this, it has to be intentional, for reasons I don't know...

but maybe you can see how this is gonna be a huge problem for me? perlin noise works fine outside of a mapgen thread, but it's completely useless without voxelmanip... and what alternatives are there? minetest.set_node is way too slow for mapgen...

in addition to all of this, I was thinking about system a bit more last night, and some questions arose...

Some other questions I have about this tech demo
- how will fluid nodes be able to flow across the boundaries between hemispheres?
- how will any type of node be able to pass data from one hemisphere to the other?
- perlin noise can be interpolated across hemispheres, but what about the rest of mapgen? decorations, structures? how will things like trees and mineshafts be handled across boundaries?
- gravity. I'm so dumb. I just realized that my entire octahedron model doesn't account for physically correct gravity. In my current model, gravity can only work in two directions (along the planetoid's poles) but that's not how actual gravity works. Real gravity works in spheres, right? I mean, I know it's all just a simulation and an illusion and all, but still...

the only solution I can think of is, well... to manually make my own systems for all these. and while I'm sure it's all technically possible, I'm just concerned about how computationally expensive it'll be.

scientifically correct gravity, in particular, will require implementing my own realtime physics system and I don't know what kind of toll that'll take on a minetest server...

anyway, that's all for tonight. what do you think? :)
foodyummy foodyummy
Posted on 2023-10-22 02:33, in foodyummy's minetest experiments (edited 2023-10-23 07:27) Link | ID: 732
No joke this looks seriously interesting. I'd really like to see how this progresses, it could be a massive game changer.
Yes, looks quite interesting, I'm interested to see what this will become. :D
Think he'll implement the industrial revolution and global warming into it? And perhaps even the concept of colonisation, monarchy, totalitarian states, Boris Johnson's voxel-defying face and parties... you know, to make a true Earth Simulator in Minetest...
just you wait... :)

after a morning's worth of suffering I have managed this. the first build of MapLoopTest :D



just one hemisphere's worth of stone. I had to use an ugly hack to force minetest to generate only a limited section of terrain with user-set boundaries.

I know it's not much, but... I haven't done any proper programming in months... 8-) but everyone's gotta start somewhere... at least I'm doing something, though. hey, it's a start! :D

planned features that I'm mostly sure I can implement:
- creation of multiple planets on the fly, specifying the size and depth of their hemispheres, where in minetest's map they're stored, and planet-unique metadata
- keeping track of which players are on which planets, simple enough
- teleporting players across hemispheres when they cross the equator
- teleporting players between different planets
- choice of 1, 2 or 6 hemispheres for each planet (to support octahedron and cube planets and to appease the flat earthers 8-)
- simple map generation for each hemisphere using perlin noise
- seamless interpolation of that perlin noise across hemispheres to make the terrain match up, the more difficult part
- biome generation? colder biomes near the poles, warmer biomes near the equator? I have no idea how to do this, but it's here for completeness

and that'll be all for MapLoopTest, I think :)

anyway, I will keep you all updated on my progress. once I finish a prototype and get the license worked out, I'll post my code on github for roller to criticize 8-)
foodyummy foodyummy
Posted on 2023-10-20 05:13, in foodyummy's minetest experiments Link | ID: 719
back again after months of having completely forgotten about this site... regardless, here's something new from me :)

this thread I declare to be designated for my random minetest ideas, experiments and tech demos. after a long time away from minetest I decided to try my hand at it again to dust off my programming skills. we'll see how long this lasts... :P

I will keep all of you updated on my developments. here we go. here is the first experiment.

octahedron world

I have not yet begun actual development of this idea, although I would like to get a simple prototype working sometime in the following week. I think some simple Perlin noise and interpolation will do.

this is a proposed solution to the question of "simulating" a spherical planet in a minecraft-like voxel grid. I am not sure if anyone has actually asked that question (besides from me), but here it is nonetheless :LOL:

anyway: this solution is based on the premise that a sphere, the approximate shape of any real planet, can be split into two equal hemispheres. the below stock-free image explains this, using the Earth as an example:



here are top-down views of both of these hemispheres, centered on the poles:



(maybe you can already see where I'm going with this...? :D )

instead of generating one square map, we generate two, and assign each map to a hemisphere. We let their data rest side by side in the greater overall Minetest "map."



(pardon the crappy maps, I literally ripped them from a youtube thumbnail :LOL: )

So the center of each square sub-map will be the pole. Here we will find the arctic climates and biomes. The edges of each sub-map, then, becomes the equator, and the location of the tropics.

So our world isn't necessarily going to be a "sphere" ... sorry to let you down :( but we can go for the next best thing: an octahedron, the shape of a d8 dice.

we can pretend that we can "project" each square sub-map to the two halves of this octahedron, like so:



But all of this alone won't work. we need some extra systems in order to flesh out the simulation.

so how do we complete the illusion? one minetest mod has already figured it out: https://content.minetest.net/packages/Don/worldedge/ it detects when a player (or any entity, really) has walked past an arbitrary boundary, and warps them to the same position at the opposing boundary.

However, in our octahedron model, we wouldn't warp the players to the opposing boundary of the same hemisphere: rather, we warp them to the corresponding position of the other hemisphere, completing the illusion of travel.

so, from the player's perspective: if they travel in only one direction, they will "wrap around" from one hemisphere to the next in an infinite loop.



so the player's transition from one hemisphere to the next will be more or less seamless. but what about the hemispheres themselves? the natural terrain should match up between hemispheres.

it's simple: we interpolate the perlin noise used to generate each hemisphere so that it will generate the same terrain at the corresponding locations of the equator at each hemisphere.

does that make any sense? :LOL:

Limitations and faults of the model itself

of course there will be limitations... ¯\_(ツ)_/¯

one in particular is that this model assumes that the players won't have access to a large part of the world depth-wise. in order for the illusion to work effectively, there must be a relatively restricted underground and airspace. About the depth of the average minecraft world will do :)

in addition, the world is not a true sphere. It is an octahedron... of course, going for a true sphere is impossible without introducing severe distortion in the map voxel data, to the point where it's arguably unsuitable for a video game...

Minetest's implications on this model

minetest, the engine I will be working with, also introduces some snags along the way.

the first I can think of is what the players will see when they reach the boundary of a hemisphere (the "equator" of our imaginary octahedron planet).

due to the way that the hemispheres are stored in minetest's map data, across only one quarter of the equator should these hemispheres reliably match up: across the other three quarters, there will be a sharp cliff which must be walked over to teleport the players.

The only solution I can think of is to use VoxelManip to create copies of the hemisphere mapblocks, place them outside of the normal gameplay boundaries at the correct locations (please refer to the last image I posted) and update them periodically.

however, this may be intensive on the server and won't be a real-time accurate reflection of what's actually happening on the alternating hemispheres. so I'm kinda stumped on this one... :(

anyway, what do you think about all this? it's getting late and I'm kind of tired but I wanted to get this out before I forget about it.

are you confused? I am too. If you need me to clarify anything, just ask :LOL:
foodyummy foodyummy
Posted on 2023-04-16 22:07, in Infinitest... Minetest game inspired by Infiniminer (edited 2023-04-29 21:38) Link | ID: 629
Well, it's been over half a year since I last posted here... since then, Infinitest was pretty much dead, I'm sorry :(

To be honest, I had frankly lost interest in the project as I had other things to do with my life. I had ultimately lost interest in Minetest modding, and in this forum.

I was also concerned that very few other people would be interested in the game as well. While I am grateful that at least ROller seemed to care about Infinitest, I feel that as a competetive game, it seems to beckon for more interest and more potential players. Y'know what I mean?

However, as much as I was worried about Infinitest having too small of a community, I was also concerned if the game were to suddenly explode into too large of a community for me to handle. I was concerned about server maintenance.

I don't think I can necessarily afford to run a server out of my own home, let alone cope with attempting to moderate it. While I am also grateful to ROller that they offered to run a server for me, I don't want to feel like I am adding an extra hassle for them if that were to happen. :(

And, well, to be even more honest, I did not really have much of a direction or concrete plan in mind for the game in the first place... :| not to mention I'm not the most competent at coding. I am worried that Infinitest will be too big of a first "real" project for me to tackle.

I'm very sorry if a couple people on this forum were excited about Infinitest and now it seems as if I am letting them down. However...

Infinitest might still live on (even if as a zombie). I do have some free time, and I might try programming Lua again. I don't necessarily want to reply "yes" or "no" as to the question of whether I will work on Infinitest again, so... maybe I'll just respond with a "well, I'll try it again and let's see" ¯\_(ツ)_/¯
foodyummy foodyummy
Posted on 2023-01-02 00:43, in Linux/BSD general (edited 2023-01-02 01:06) Link | ID: 612
Happy new year everyone!

Alright, so I'm considering switching to Arch, like you roller :LOL: I tried installing the OS previously but my hard drive was getting old and starting to fail :( so once the new hard drive ships I'm installing the system again.

I've done plenty of reading and I've been using linux for a while so maybe I know a tiny bit about what I'm actually doing!?!? but feel free to correct me on anything :)

But I've actually been meaning to ask for a while since I got back from my trip: do you folks have any recommendations for desktop environments, window managers, boot loaders, etc.? I was thinking about using LXDE (i saw you guys talking about it in the thread) with Openbox and GRUB, but is there anything that might be "better" so to speak?

Is there anything else I should keep note of before really diving into arch? I know a bit about how to use pacman and stuff, and I've attempted to use it to install the OS before my hard drive just started spitting out
(Input/output error)
and crap like that. Like, I know
pacman -Syu
and whatnot, but is there anything else I should know that I don't?

(Is this the first time someone's used code formatting in a forum post!?!?!?)

Thank you for your time :D
foodyummy foodyummy
Posted on 2022-11-29 17:04, in Infinitest... Minetest game inspired by Infiniminer (edited 2022-11-29 17:05) Link | ID: 594
Well, I won't be able to post anything for the next few days (as if I've posted anything during the last few lol) as I'll be helping out some family with their moving. I'm going a few states away for the next four days. That means literally sitting in a car for like eight hours there and back... real fun. :(

Don't worry, though, the project is still very much alive :D I've just got some other stuff to do, y'know... I'll see all you wonderful folks on Saturday. :)
foodyummy foodyummy
Posted on 2022-11-18 22:34, in Infinitest... Minetest game inspired by Infiniminer Link | ID: 573
Well, on the 16th I had promised to post about some of my ideas concerning how to "flesh out" Infinitest. The project's still alive, you know :) Over the past few days I've been scrapping together a rough draft describing some of my ideas.

As I said in the first post, I don't think the game will be an exact port of Infiniminer (sorry if that's what you've been looking for :( ) but rather a "fresh take" on a game concept that hasn't been dusted off for over a decade now ¯\_(ツ)_/¯

Originally I had hosted the rough draft on google drive, but I don't know if anybody actually clicked the link. I think it'll get more visibility if it were posted directly in the forum (besides, I think it'll help spur discussion a bit :D ). I'd llke to make sure you're okay with that, Roller, before I continue.

I'd still like to keep my posts relatively easy to digest, though! So I think I'd probably be posting about the game concept in sections. And, of course, I'd much rather be using plenty of images to help describe my concepts. After all a picture's worth a thousand words :)

But I don't think anything is ready to post today, I've still got some proofreading to do ¯\_(ツ)_/¯
foodyummy foodyummy
Posted on 2022-11-17 05:18, in Infinitest... Minetest game inspired by Infiniminer (edited 2023-05-02 02:04) Link | ID: 570
Gee, it's been months since I last posted here... I'd completely forgotten about the whole site! I guess to be fair, it's kind of easy to... It's such a small little corner of the web. Not that I'm complaining :)

Any more progress on this? Sounds wonderful!
Thank you! :D I'd love to say I have made more progress, but ... I forgot to back up the game files when I was reinstalling my OS (for like the tenth time lol) and reformatting my hard drive :( It's all lost now...

I mean, looking on the bright side, the code was kinda crappy anyway :LOL: and maybe I can try remaking all this with a fresh eye :) I almost had no idea what I was really doing, after all... I remember a lot of the code was quite hacky. The map generator was especially dubious lol and ore generation didn't even work properly!?!?!?

I was actually thinking about playing the original Infiniminer some more (on that windows 8 laptop) to try and get a more solid idea of what I'm modelling my own work after. However, I would also like to take my own project some steps further. I've got plenty of ideas on how to flesh out Infinitest. I think I might post about them tomorrow and see what some of you on the forum think! :D

I've also got a Github account up and running, and I've even made a repo for the game!

https://github.com/foodyummy/infinitest

Granted, it's empty right now lol but hopefully soon I'll actually figure out how github even works and start filling it out.
foodyummy foodyummy
Posted on 2022-07-04 15:34, in Infinitest... Minetest game inspired by Infiniminer Link | ID: 149
Oh and are those skins supposed to look like Quote from Cave Story?
Totally, yeah!!! It's sure been a while since i played cave story but for some reason it was the first thing that came to my mind when i was thinking of what to do for the default skins lol :D
foodyummy foodyummy
Posted on 2022-07-03 17:27, in Infinitest... Minetest game inspired by Infiniminer (edited 2023-04-29 21:36) Link | ID: 145
Phew... after a couple of days I've managed all this! :D



Of course it's still unfinished though ... But i think i've got a solid teaming system going on, although it doesn't have proper randomizing of players yet. I also have the code for starting games, ending them, announcing it all, and tallying score. In between the games there are short interludes.

Right now the games are ten seconds long with five second interludes lol

The game can generate small maps (64x64x64) on the fly , using a dumb workaround with register_on_generated() and *probably exploiting* emerge_area and delete_area. I was actually kinda stumped on that one for like a day. :LOL: Although right now I'm still figuring out how to make ores generate, as for some reason generate_ores isn't working!?!??!?

Anyway, mapgen only generates one map right now, using the world seed, although I think it'll be pretty simple to randomize the seeds for the perlin noise.

The pickaxe can dig the dirt nodes (from a minecraft player's perspective i know that sounds cursed), but other than that none of the other tools in my hotbar (axe, trowel and slingshot) are functional yet. The fifth hotbar slot is reserved for class-specific equips.

I'd like to go on about more of the game's mechanics and such but I guess i'd like to keep my posts relatively short cause I know how everyone feels about big ol' walls of text lol
foodyummy foodyummy
Posted on 2022-07-01 22:42, in Infinitest... Minetest game inspired by Infiniminer Link | ID: 120
Ah, I see. Yeah, maybe I was just a little bit biased ... Thanks for correcting me. Maybe the laptop isn't so crappy after all :D
foodyummy foodyummy
Posted on 2022-07-01 21:08, in Infinitest... Minetest game inspired by Infiniminer (edited 2023-04-29 21:36) Link | ID: 117
So I'm very interested in seeing how this will end up looking like, maybe even running a server with it when that becomes a thing.
Not sure if you're offering to run a server Roller, but if you are, then, gee, that'd be just grand! I mean, i've got a crappy windows 8 laptop (that's like almost a decade old) to spare but idk if that even matches up to a potato :| I mean, even with my 5g connection and all I'd imagine 4gb of ram still doesn't quite cut it ...

Yeah, I'm interested to see where the project goes too. I'm actually reading up on some of minetest's docs right now and I'm excited to really get into programming it!
foodyummy foodyummy
Posted on 2022-07-01 19:49, in Infinitest... Minetest game inspired by Infiniminer (edited 2023-04-29 21:37) Link | ID: 114
Well, there's my little Minetest game I've just started working on for the past few days and I guess it's kind of experimental, but here goes I guess lol

So maybe some of you know that Minecraft was inspired by this real obscure game called Infiniminer. It was made by some guys called Zachtronics back in the day of like 2009.

It's a competitive game: two teams of miners, red and blue, dig for gold and diamonds and return them to the surface to make money. The team with the most money wins. Of course, people got kind of bored of that after a while and just started building stuff, and, well ... the rest is history :LOL:

(The description is kind of simple and doesn't do it much "justice" I guess. there's a lot more mechanics, such as player classes, interesting block types with unique abilities, etc.)

But I thought, well, since there's already plenty of stuff on Minetest for builders, maybe I felt there could be a niche for Infiniminer's original concept. Kind of re-discovering that competitive twist to digging and building. I haven't really started seriously coding yet as I've been working on the design and concept.

But I don't think the game will be an exact clone of Infiniminer, as I imagine maybe there could be some Minecraft-inspired content (trees that supply wood, rivers to pan for gold in, etc.)

But to be honest I'm still kind of trying to figure out Minetest in terms of how to program it, so I'm sorry if my code is really rough. I'm trying to improve. I'd still like to put the code on github once I get a basic alpha going on though. So i guess if anybody wants to help me improve my crappy code I'd sure appreciate that :)
foodyummy foodyummy
Posted on 2022-06-27 23:42, in The Voxelmanip Classic Server! Link | ID: 49
Oh well, I did it in the sky as a crappy attempt at protection against greifers LOL although yeah I think it looks kinda cute. Kinda kitschy almost :)
foodyummy foodyummy
Posted on 2022-06-27 23:23, in The Voxelmanip First Thread Link | ID: 47
Whoopsie, forgot I was supposed to introduce myself here, I did it in the Minetest thread instead XD
foodyummy foodyummy
Posted on 2022-06-27 23:21, in The Voxelmanip Classic Server! Link | ID: 46
Well I guess here's my little introduction onto this forum ...

Thanks for the help with the security question Roller, I've only been like 2 years outta high school and I already forgot what derivatives were ¯\_(ツ)_/¯

Here's a screenshot from yesterday of the cozy little cottage I built on the cozy little server ... there's supposed to be a river there but I got lazy with the "WATER" lol