Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
caverealms
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Illuna-Minetest
caverealms
Commits
d310d2a1
Commit
d310d2a1
authored
10 years ago
by
Chris N
Browse files
Options
Downloads
Patches
Plain Diff
Allowed for variable cave size and rarity.
Use the CLUSAV and CLUSAM constants at the start to adjust.
parent
b52da304
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
init.lua
+9
-5
9 additions, 5 deletions
init.lua
with
9 additions
and
5 deletions
init.lua
+
9
−
5
View file @
d310d2a1
...
...
@@ -25,11 +25,13 @@ local ZMIN = -33000
local
ZMAX
=
33000
local
CHUINT
=
caverealms
.
config
.
chuint
-- Chunk interval for cave realms
local
WAVAMP
=
16
-- Structure wave amplitude
local
CLUSAV
=
-
0
.
5
--cave threshold, determines rarity of caves. -1 = small and rare, 0.5 = default, 0 = nearly half the volume.
local
CLUSAM
=
0
.
5
--cave size/density threshold. 0 is off, or little variation, 1 is max.
local
WAVAMP
=
24
-- Structure wave amplitude
local
HISCAL
=
32
-- Upper structure vertical scale
local
LOSCAL
=
32
-- Lower structure vertical scale
local
HIEXP
=
0
.
5
-- Upper structure density gradient exponent
local
LOEXP
=
0
.
5
-- Lower structure density gradient exponent
local
HIEXP
=
0
.
3
-- Upper structure density gradient exponent
local
LOEXP
=
0
.
3
-- Lower structure density gradient exponent
local
DIRTHR
=
0
.
04
-- Dirt density threshold
local
STOTHR
=
0
.
08
-- Stone density threshold
local
STABLE
=
2
-- Minimum number of stacked stone nodes in column for dirt / sand on top
...
...
@@ -197,7 +199,8 @@ minetest.register_on_generated(function(minp, maxp, seed)
else
grad
=
((
cavemid
-
y
)
/
LOSCAL
)
^
LOEXP
--for the floor
end
local
density
=
nvals_cave
[
nixyz
]
-
grad
--how dense is the emptiness?
--local density = nvals_cave[nixyz] - grad --how dense is the emptiness?
local
density
=
nvals_cave
[
nixyz
]
-
grad
-
CLUSAV
-
nvals_cluster
[
nixyz
]
*
CLUSAM
if
density
<
0
and
density
>
-
0
.
7
then
-- if cavern "shell"
--local nodename = minetest.get_node({x=x,y=y,z=z}).name --grab the name of the node
data
[
vi
]
=
c_air
--make emptiness
...
...
@@ -302,7 +305,8 @@ minetest.register_on_generated(function(minp, maxp, seed)
else
grad
=
((
cavemid
-
y
)
/
LOSCAL
)
^
LOEXP
--for the floor
end
local
density
=
nvals_cave
[
nixyz2
]
-
grad
--how dense is the emptiness?
--local density = nvals_cave[nixyz2] - grad --how dense is the emptiness?
local
density
=
nvals_cave
[
nixyz2
]
-
grad
-
CLUSAV
-
nvals_cluster
[
nixyz2
]
*
CLUSAM
if
density
<
0
and
density
>
-
0
.
7
then
-- if cavern "shell"
if
density
<
STOTHR
and
stable2
[
si
]
<=
STABLE
then
roof
[
si
]
=
roof
[
si
]
+
1
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment