[GAME] Moontest! (Back from the Dead!) [GAME]

User avatar
HeroOfTheWinds
Member
 
Posts: 470
Joined: Wed Apr 23, 2014 23:16
GitHub: HeroOfTheWinds
IRC: WindHero

Re: [GAME] Moontest! (Back from the Dead!) [GAME]

by HeroOfTheWinds » Sun May 25, 2014 03:37

I originally wanted to use the on_generated function, and the code was commenced in that format. However, I couldn't get any answers on how to predict where exactly the player would spawn, so I had to switch to a point after generation... which led to this. I still am researching a way to predict the player spawn point during generation, but not getting any clear answers... I have considered just forcing the player to spawn at 0,0,0, but then it might be under a mountain, which could end up being weird.
The other alternative would be to stick the module generation where I currently have it, but stick it in a minetest.after() call, to give Minetest time to generate the map.
Nam ex spatio, omnes res venire possunt.
Why let the ground limit you when you can reach for the sky?
Back to college now, yay for sophomore year schedules. :P
 

paramat
Member
 
Posts: 2662
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat

Re: [GAME] Moontest! (Back from the Dead!) [GAME]

by paramat » Sun May 25, 2014 07:05

Perhaps instead of predicting where the player will spawn, choose and set the player's position, as in the spawnplayer functions i use in watershed, fracture and noisegrid. Spawning players inside landing modules is an excellent idea, something i would like to do myself.
For my moonrealm mod, it may be possible for the spawnplayer function to search for a suitable flat landing area by internally pre-generating terrain heightmaps, set the player's position there and then *somehow* create the module around the player.
 

paramat
Member
 
Posts: 2662
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat

Re: [GAME] Moontest! (Back from the Dead!) [GAME]

by paramat » Sun May 25, 2014 08:19

Just got this working as an experimental spawnplayer function in fracture mod, it creates a glass spawn cube around the player at newplayer and respawn, no bugs. The mapgen overwrites some of the glass nodes because mapgen happens after the glass cube is spawned.
To do the same as this in moontest it may be necessary to pre-generate mgv7 heightmaps in lua to find a suitable spawnpoint at the surface, problem is mgv7 is about to get rewritten with a complex new mapgen i could not recreate in lua, although i could recreate the current mgv7.
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
   function spawnplayer(player)
      local DENOFF = -0.4
      local TSTONE = 0.02
      local PSCA = 4 -- Player scatter from world centre in chunks (80 nodes).
      local xsp
      local ysp
      local zsp
      local np_terrain = {
         offset = 0,
         scale = 1,
         spread = {x=384, y=128, z=384},
         seed = 593,
         octaves = 5,
         persist = 0.67
      }
      local np_terralt = {
         offset = 0,
         scale = 1,
         spread = {x=237, y=79, z=237},
         seed = 593,
         octaves = 5,
         persist = 0.67
      }
      for chunk = 1, 64 do
         print ("[fracture] searching for spawn "..chunk)
         local x0 = 80 * math.random(-PSCA, PSCA) - 32
         local z0 = 80 * math.random(-PSCA, PSCA) - 32
         local y0 = 80 * math.random(-PSCA, PSCA) - 32
         local x1 = x0 + 79
         local z1 = z0 + 79
         local y1 = y0 + 79
   
         local sidelen = 80
         local chulens = {x=sidelen, y=sidelen, z=sidelen}
         local minposxyz = {x=x0, y=y0, z=z0}

         local nvals_terrain = minetest.get_perlin_map(np_terrain, chulens):get3dMap_flat(minposxyz)
         local nvals_terralt = minetest.get_perlin_map(np_terralt, chulens):get3dMap_flat(minposxyz)
   
         local nixyz = 1
         local stable = {}
         for z = z0, z1 do
            for y = y0, y1 do
               for x = x0, x1 do
                  local si = x - x0 + 1
                  local n_terrain = nvals_terrain[nixyz]
                  local n_terralt = nvals_terralt[nixyz]
                  local density = (n_terrain + n_terralt) * 0.5 + DENOFF
                  if density >= TSTONE then
                     stable[si] = true
                  elseif stable[si] and density < 0 then
                     ysp = y + 1
                     xsp = x
                     zsp = z
                     break
                  end
                  nixyz = nixyz + 1
               end
               if ysp then
                  break
               end
            end
            if ysp then
               break
            end
         end
         if ysp then
            break
         end
      end
      print ("[fracture] spawn player ("..xsp.." "..ysp.." "..zsp..")")
      player:setpos({x=xsp, y=ysp, z=zsp})
      local vm = minetest.get_voxel_manip()
      local pos1 = {x=xsp-2, y=ysp-2, z=zsp-2}
      local pos2 = {x=xsp+2, y=ysp+2, z=zsp+2}
      local emin, emax = vm:read_from_map(pos1, pos2)
      local area = VoxelArea:new({MinEdge=emin, MaxEdge=emax})
      local data = vm:get_data()
      local c_glass = minetest.get_content_id("default:glass")
      for i = -2, 2 do
      for j = -2, 2 do
      for k = -2, 2 do
         if i ^ 2 + j ^ 2 + k ^ 2 >= 4 then
            local vi = area:index(xsp + i, ysp + j, zsp + k)
            data[vi] = c_glass
         end
      end
      end
      end
      vm:set_data(data)
      vm:write_to_map()
      vm:update_map()
   end

   minetest.register_on_newplayer(function(player)
      spawnplayer(player)
   end)

   minetest.register_on_respawnplayer(function(player)
      spawnplayer(player)
      return true
   end)
 

User avatar
HeroOfTheWinds
Member
 
Posts: 470
Joined: Wed Apr 23, 2014 23:16
GitHub: HeroOfTheWinds
IRC: WindHero

Re: [GAME] Moontest! (Back from the Dead!) [GAME]

by HeroOfTheWinds » Wed May 28, 2014 03:57

That's some pretty neat code, paramat.

I ended up finding a different solution, using static_spawnpoint in minetest.config instead.

And so, moontest now has the game start with players inside a shared Apollo Lunar Module! 639 lines of code later...
Interesting note, trying to place mesecons wires and other mesecons objects with the Lua Voxel Manipulator is something I would not like to try again... you need to get the content id for each individual type of wire bend, e.g. mesecons:wire_10100000_on. So yeah.... doable, but painstaking.
Nam ex spatio, omnes res venire possunt.
Why let the ground limit you when you can reach for the sky?
Back to college now, yay for sophomore year schedules. :P
 

paramat
Member
 
Posts: 2662
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat

Re: [GAME] Moontest! (Back from the Dead!) [GAME]

by paramat » Wed May 28, 2014 21:45

My spawn egg in moonrealm was being overwritten by the vacuum nodes, so i edited the mapgen to only replace "air" or "ignore", any spawn vehicle created in 'register on newplayer' is now left untouched.

This is a good discovery ...
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
[noisegrid] chunk minp (-32 -32 -32)
[noisegrid] emin (-48 -48 -48)
[noisegrid] emax (63 63 63)

For the 'on generated' version of voxelmanip, the actual emerged volume extends 16 nodes (one engine mapblock) beyond all sides, this is why my mapgen trees rarely get chopped despite often extending above the chunk being generated.
 

User avatar
Zsoltisawesome
Member
 
Posts: 177
Joined: Sun Dec 18, 2011 18:07
GitHub: realtinymonster
IRC: zsoltisawesome microcarrot
In-game: ManOfMinetest24 Name zsoltisawesome

Re: [GAME] Moontest! (Back from the Dead!) [GAME]

by Zsoltisawesome » Mon Jun 02, 2014 22:07

HeroOfTheWinds wrote:I noticed that this hasn't been really updated lately, so I'll give a short rundown of recent additions and changes...

Zsoltisawesome wrote:Current issues: Spacesuits don't work, vacuum doesn't spread, caves spawn with air, not vacuum, vacuum only goes up to the normal water level...
I hate bugs...

All of these are now fixed! I am the vacuum master!
Lua Voxel Manipulator reigns supreme now.

Ores have been largely changed, only Mese and iron return from regular Minetest right now. In place of coal, we now have phosphorus. The new titanium has been added as a highly durable metal, and now there is a new ore called Lunarium that is better than even diamond. (Think of it as moon mese) Silicon can also be found, and it drops the same silicon used in Mesecons. Tools can be crafted from titanium and lunarium.

Light Crystals can now be crafted into light sticks, which have a recipe modeled after torches and give off light just tad bit dimmer than regular torches. Speaking of regular torches, they now go out and become unlit if they are placed in a vacuum. Place them in air from an airgen, though, and it's all good. To relight a torch that's gone out, rightclick it with a stick while in air.

Airgen was bugged, it would spread air out even in total vacuum. Also, if a sealed room became unsealed, the air wouldn't leave. Needless to say, fixed. Several similar errors occurred with liquids, those were also fixed.

Moon trees have been added to provide a source of wood. They are basically monochrome versions of regular trees, and spawn very few and far apart.

Zeg9's UFOs have been added, modified to travel faster and run on lunarium lumps instead of obsidian shards.

New node, half-functional, half-decorative: Air Shield. Can be passed through like trapstone from moreblocks, and has a snazzy animated texture. Use it for doors on buildings with air inside.

Stay tuned for more!


Thanks much for keeping it updated!
 

User avatar
Zsoltisawesome
Member
 
Posts: 177
Joined: Sun Dec 18, 2011 18:07
GitHub: realtinymonster
IRC: zsoltisawesome microcarrot
In-game: ManOfMinetest24 Name zsoltisawesome

Re: [GAME] Moontest! (Back from the Dead!) [GAME]

by Zsoltisawesome » Tue Nov 25, 2014 17:12

its gone guys, I just deleted moontest from my github...

its gone...







forever...

Bye guys!

EDIT: Amaz has taken over, see first post
 

User avatar
Krock
Member
 
Posts: 3598
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker

Re: [GAME] Moontest! (Back from the Dead!) [GAME]

by Krock » Tue Nov 25, 2014 19:07

Re: [GAME] Moontest! (Back from the Dead!) [GAME]


Zsoltisawesome wrote:<snip>

Why?
Newest Win32 builds - Find a mod - All my mods
ALL YOUR DONATION ARE BELONG TO PARAMAT (Please support him and Minetest)
New DuckDuckGo !bang: !mtmod <keyword here>
 

User avatar
Zsoltisawesome
Member
 
Posts: 177
Joined: Sun Dec 18, 2011 18:07
GitHub: realtinymonster
IRC: zsoltisawesome microcarrot
In-game: ManOfMinetest24 Name zsoltisawesome

Re: [GAME] Moontest! (Back from the Dead!) [GAME]

by Zsoltisawesome » Mon Dec 08, 2014 16:14

'twas a huge responsibility, and Amaz has done most of the work to date, so I figured that he could have it...
 

paramat
Member
 
Posts: 2662
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat

Re: [GAME] Moontest! (Back from the Dead!) [GAME]

by paramat » Fri Dec 19, 2014 12:14

Please could you add me as a contributor in the README? I wrote the footprints, air/vacuum spread and hydroponics codes. I also created 15 of the textures.
Also, i know that some of the air/vacuum spreading code has been rewritten, but you might want to revert to my original code as it was carefully designed and tested over months by mauvebic and myself. Some of the air/vacuum behaviour might have seemed odd but it was that way for good reasons, one of which is avoiding uncontrolled and exponential life support air spread which can cause an ABM server meltdown. If you experience unexplained server slowdown that might be the reason.
 

User avatar
HeroOfTheWinds
Member
 
Posts: 470
Joined: Wed Apr 23, 2014 23:16
GitHub: HeroOfTheWinds
IRC: WindHero

Re: [GAME] Moontest! (Back from the Dead!) [GAME]

by HeroOfTheWinds » Fri Dec 19, 2014 18:40

paramat wrote:Please could you add me as a contributor in the README? I wrote the footprints, air/vacuum spread and hydroponics codes. I also created 15 of the textures.
Also, i know that some of the air/vacuum spreading code has been rewritten, but you might want to revert to my original code as it was carefully designed and tested over months by mauvebic and myself. Some of the air/vacuum behaviour might have seemed odd but it was that way for good reasons, one of which is avoiding uncontrolled and exponential life support air spread which can cause an ABM server meltdown. If you experience unexplained server slowdown that might be the reason.


Regarding the air/vacuum rewrite: I was very careful to prevent said meltdown. I made it so that vacuum always had dominance, and rather than having air spread slowly from the source, I just had the LVM scan the maximum radius of the air generator, and fill all vacuum within range with air, just once, on placement. Thus, any air that gets generated outside the structure quickly gets eaten away by the vacuum. However, if you still see some possibility for error in that logic, I shall yield to your experience. In my tests, I didn't have much trouble, and your old code allowed air to exist in open spaces, while mine quickly (usually in 1-3 seconds max) cleans up air that shouldn't exist.
Nam ex spatio, omnes res venire possunt.
Why let the ground limit you when you can reach for the sky?
Back to college now, yay for sophomore year schedules. :P
 

Hybrid Dog
Member
 
Posts: 2460
Joined: Thu Nov 01, 2012 12:46

Re: [GAME] Moontest! (Back from the Dead!) [GAME]

by Hybrid Dog » Fri Dec 19, 2014 22:57

A few days ago, l made a little hole into the hull of the Apollo moon station. Then there was a little vacuum node in it. After that l closed the hole to avoid that more air moves out. But for any reason the whole air disappeared like flowing water disappears without source.
 

paramat
Member
 
Posts: 2662
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat

Re: [GAME] Moontest! (Back from the Dead!) [GAME]

by paramat » Sat Dec 20, 2014 02:10

Okay thanks HOTWinds, wanted to check it was done right. Your method sounds better actually, good idea.
 

Hybrid Dog
Member
 
Posts: 2460
Joined: Thu Nov 01, 2012 12:46

Re: [GAME] Moontest! (Back from the Dead!) [GAME]

by Hybrid Dog » Sat Dec 20, 2014 10:32

That were some of paramat's 15 textures?
https://github.com/Amaz1/moontest/pull/2/files

l know a function to get e.g. every water node of a sea, even if the sea is curved and l already use it:
https://github.com/HybridDog/extrablock ... t.lua#L302
 

paramat
Member
 
Posts: 2662
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat

Re: [GAME] Moontest! (Back from the Dead!) [GAME]

by paramat » Sun Dec 21, 2014 00:14

Out of those in your link, the original dust, dustprint1/2, soil and stone were mine CC BY SA.
 

User avatar
AMMOnym
Member
 
Posts: 682
Joined: Tue Sep 10, 2013 14:18
IRC: AMMOnym
In-game: AMMOnym

Re: [GAME] Moontest! (Back from the Dead!) [GAME]

by AMMOnym » Sun Dec 21, 2014 12:50

Could some asteroids float in the "air" ?
 

User avatar
12Me21
Member
 
Posts: 826
Joined: Tue Mar 05, 2013 00:36

Re: [GAME] Moontest! (Back from the Dead!) [GAME]

by 12Me21 » Mon Mar 09, 2015 15:33

is this still being worked on anywhere?

ANYWAY:
On the moon (in real life), the earth stays in the same position in the sky all the time. This is because the same side of the moon always faces the earth.
The moon has a day/night cycle lasting almost a month (29 days, 12 hours, 44 minutes, 3 seconds on average), which is 7.5 real-life hours when it is to scale with the normal in-game day/night cycle (96x faster than real life)
This might be inconvienent, however.
 

User avatar
HeroOfTheWinds
Member
 
Posts: 470
Joined: Wed Apr 23, 2014 23:16
GitHub: HeroOfTheWinds
IRC: WindHero

Re: [GAME] Moontest! (Back from the Dead!) [GAME]

by HeroOfTheWinds » Mon Mar 09, 2015 17:57

This is in fact still being worked on, primarily over on OldCoder's Moontest server. Nothing too big has been done yet, but I have something huge in development for it... just not ready yet. I will say this: Moontest may no longer be just the moon. There has been a lot of bugfixing going on in the background too, and there's an ingame wiki page on the server saying what other bugs are up for fixing. Progress will be better once I'm on break from college...
Nam ex spatio, omnes res venire possunt.
Why let the ground limit you when you can reach for the sky?
Back to college now, yay for sophomore year schedules. :P
 

Sokomine
Member
 
Posts: 2980
Joined: Sun Sep 09, 2012 17:31

Re: [GAME] Moontest! (Back from the Dead!) [GAME]

by Sokomine » Thu Mar 19, 2015 01:56

HeroOfTheWinds wrote:This is in fact still being worked on, primarily over on OldCoder's Moontest server. Nothing too big has been done yet, but I have something huge in development for it... just not ready yet. I will say this: Moontest may no longer be just the moon. There has been a lot of bugfixing going on in the background too, and there's an ingame wiki page on the server saying what other bugs are up for fixing. Progress will be better once I'm on break from college...

That sounds very promising! Moontest has such a nice background texture that it's fun to visit just in order to take a look at the stars. Gameplay as such could use some more improvements (another type of "tree" that fits more to the environment; maybe more like vines etc.)
A list of my mods can be found here.
 

paramat
Member
 
Posts: 2662
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat

Re: [GAME] Moontest! (Back from the Dead!) [GAME]

by paramat » Thu Mar 19, 2015 10:59

I plan to use your methods for air and vacuum in moonrealm mod as they seem better, thanks.
 

Previous

Return to WIP Mods

Who is online

Users browsing this forum: No registered users and 11 guests

cron