Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
illuna-minetest
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
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
illuna-minetest
Commits
4a6b9a6a
Commit
4a6b9a6a
authored
13 years ago
by
Perttu Ahola
Browse files
Options
Downloads
Patches
Plain Diff
Some work-in-progress stuff and many comment updates
parent
e0329a3c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
src/environment.cpp
+3
-3
3 additions, 3 deletions
src/environment.cpp
src/environment.h
+13
-0
13 additions, 0 deletions
src/environment.h
src/main.cpp
+18
-9
18 additions, 9 deletions
src/main.cpp
src/mapnode.cpp
+3
-0
3 additions, 0 deletions
src/mapnode.cpp
src/mapnode.h
+9
-1
9 additions, 1 deletion
src/mapnode.h
with
46 additions
and
13 deletions
src/environment.cpp
+
3
−
3
View file @
4a6b9a6a
...
...
@@ -739,7 +739,7 @@ void ServerEnvironment::step(float dtime)
if
(
1
)
{
MapNode
n_top
=
block
->
getNodeNoEx
(
p0
+
v3s16
(
0
,
1
,
0
));
if
(
content_features
(
n_top
.
d
).
walkable
==
false
&&
if
(
content_features
(
n_top
.
d
).
air_equivalent
&&
n_top
.
getLight
(
LIGHTBANK_DAY
)
>=
13
)
{
n
.
d
=
CONTENT_GRASS
;
...
...
@@ -796,10 +796,10 @@ void ServerEnvironment::step(float dtime)
// Convert mud under proper lighting to grass
if
(
n
.
d
==
CONTENT_MUD
)
{
if
(
myrand
()
%
4
==
0
)
if
(
myrand
()
%
10
==
0
)
{
MapNode
n_top
=
block
->
getNodeNoEx
(
p0
+
v3s16
(
0
,
1
,
0
));
if
(
content_features
(
n_top
.
d
).
walkable
==
false
&&
if
(
content_features
(
n_top
.
d
).
air_equivalent
&&
n_top
.
getLightBlend
(
getDayNightRatio
())
>=
13
)
{
n
.
d
=
CONTENT_GRASS
;
...
...
This diff is collapsed.
Click to expand it.
src/environment.h
+
13
−
0
View file @
4a6b9a6a
...
...
@@ -112,6 +112,19 @@ class ActiveBlockList
private
:
};
/*
Active block modifier interface
*/
class
ActiveBlockModifier
{
public:
ActiveBlockModifier
(){};
virtual
~
ActiveBlockModifier
(){};
//TODO
//virtual void
};
/*
The server-side environment.
...
...
This diff is collapsed.
Click to expand it.
src/main.cpp
+
18
−
9
View file @
4a6b9a6a
...
...
@@ -85,6 +85,10 @@ SUGG: Server-side objects could be moved based on nodes to enable very
lightweight operation and simple AI
- Not practical; client would still need to show smooth movement.
SUGG: Make a system for pregenerating quick information for mapblocks, so
that the client can show them as cubes before they are actually sent
or even generated.
Gaming ideas:
-------------
...
...
@@ -211,6 +215,9 @@ FIXME: Server sometimes goes into some infinite PeerNotFoundException loop
FIXME: The new optimized map sending doesn't sometimes send enough blocks
from big caves and such
Environment:
------------
TODO: A list of "active blocks" in which stuff happens.
+ Add a never-resetted game timer to the server
+ Add a timestamp value to blocks
...
...
@@ -289,18 +296,20 @@ Mapgen v2:
Misc. stuff:
------------
* Make an "environment metafile" to store at least time of day
* Move digging property stuff from material.{h,cpp} to mapnode.cpp...
- Or maybe move content_features to material.{h,cpp}?
* Maybe:
Make a system for pregenerating quick information for mapblocks, so
that the client can show them as cubes before they are actually sent
or even generated.
* Move digging property stuff from material.{h,cpp} to mapnode.cpp
- ...Or maybe move content_features to material.{h,cpp}?
Making it more portable:
------------------------
* Some MSVC: std::sto* are defined without a namespace and collide
with the ones in utility.h
Stuff to do before release:
---------------------------
- Player default privileges and default password
- Chat privilege
- Some simple block-based dynamic stuff in the world (finish the
ActiveBlockModifier stuff)
- Protocol version field
- Consider getting some textures from cisoun's texture pack
======================================================================
...
...
This diff is collapsed.
Click to expand it.
src/mapnode.cpp
+
3
−
0
View file @
4a6b9a6a
...
...
@@ -252,6 +252,7 @@ void init_mapnode()
f
->
pointable
=
false
;
f
->
diggable
=
false
;
f
->
buildable_to
=
true
;
f
->
air_equivalent
=
true
;
i
=
CONTENT_WATER
;
f
=
&
g_content_features
[
i
];
...
...
@@ -303,6 +304,7 @@ void init_mapnode()
f
->
solidness
=
0
;
// drawn separately, makes no faces
f
->
walkable
=
false
;
f
->
wall_mounted
=
true
;
f
->
air_equivalent
=
true
;
f
->
dug_item
=
std
::
string
(
"MaterialItem "
)
+
itos
(
i
)
+
" 1"
;
i
=
CONTENT_SIGN_WALL
;
...
...
@@ -314,6 +316,7 @@ void init_mapnode()
f
->
solidness
=
0
;
// drawn separately, makes no faces
f
->
walkable
=
false
;
f
->
wall_mounted
=
true
;
f
->
air_equivalent
=
true
;
f
->
dug_item
=
std
::
string
(
"MaterialItem "
)
+
itos
(
i
)
+
" 1"
;
if
(
f
->
initial_metadata
==
NULL
)
f
->
initial_metadata
=
new
SignNodeMetadata
(
"Some sign"
);
...
...
This diff is collapsed.
Click to expand it.
src/mapnode.h
+
9
−
1
View file @
4a6b9a6a
...
...
@@ -151,13 +151,20 @@ struct ContentFeatures
// This is used for collision detection.
// Also for general solidness queries.
bool
walkable
;
// Player can point to these
bool
pointable
;
// Player can dig these
bool
diggable
;
// Player can build on these
bool
buildable_to
;
// Whether the node has no liquid, source liquid or flowing liquid
enum
LiquidType
liquid_type
;
// If true, param2 is set to direction when placed
// If true, param2 is set to direction when placed
. Used for torches.
// NOTE: the direction format is quite inefficient and should be changed
bool
wall_mounted
;
// If true, node is equivalent to air. Torches are, air is. Water is not.
// Is used for example to check whether a mud block can have grass on.
bool
air_equivalent
;
// Inventory item string as which the node appears in inventory when dug.
// Mineral overrides this.
...
...
@@ -183,6 +190,7 @@ struct ContentFeatures
buildable_to
=
false
;
liquid_type
=
LIQUID_NONE
;
wall_mounted
=
false
;
air_equivalent
=
false
;
dug_item
=
""
;
initial_metadata
=
NULL
;
}
...
...
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