Commit Graph

90 Commits

Author SHA1 Message Date
Auke Kok
e737b1c271 Nodebox: Allow nodeboxes to "connect"
We introduce a new nodebox type "connected", and allow these nodes to
have optional nodeboxes that connect it to other connecting nodeboxes.

This is all done at scenedraw time in the client. The client will
inspect the surrounding nodes and if they are to be connected to,
it will draw the appropriate connecting nodeboxes to make those
connections.

In the node_box definition, we have to specify separate nodeboxes for
each valid connection. This allows us to make nodes that connect only
horizontally (the common case) by providing optional nodeboxes for +x,
-x, +z, -z directions. Or this allows us to make wires that can connect
up and down, by providing nodeboxes that connect it up and down (+y,
-y) as well.

The optional nodeboxes can be arrays. They are named "connect_top,
"connect_bottom", "connect_front", "connect_left", "connect_back" and
"connect_right". Here, "front" means the south facing side of the node
that has facedir = 0.

Additionally, a "fixed" nodebox list present will always be drawn,
so one can make a central post, for instance. This "fixed" nodebox
can be omitted, or it can be an array of nodeboxes.

Collision boxes are also updated in exactly the same fashion, which
allows you to walk over the upper extremities of the individual
node boxes, or stand really close to them. You can also walk up
node noxes that are small in height, all as expected, and unlike the
NDT_FENCELIKE nodes.

I've posted a screenshot demonstrating the flexibility at
    http://i.imgur.com/zaJq8jo.png
In the screenshot, all connecting nodes are of this new subtype.

Transparent textures render incorrectly, Which I don't think is
related to this text, as other nodeboxes also have issues with this.

A protocol bump is performed in order to be able to send older clients
a nodeblock that is usable for them. In order to avoid abuse of users
we send older clients a "full-size" node, so that it's impossible for
them to try and walk through a fence or wall that's created in this
fashion. This was tested with a pre-bump client connected against a
server running the new protocol.

These nodes connect to other nodes, and you can select which ones
those are by specifying node names (or group names) in the
connects_to string array:
      connects_to = { "group:fence", "default:wood" }
By default, nodes do not connect to anything, allowing you to create
nodes that always have to be paired in order to connect. lua_api.txt
is updated to reflect the extension to the node_box API.

Example lua code needed to generate these nodes can be found here:
    https://gist.github.com/sofar/b381c8c192c8e53e6062
2016-03-12 12:08:17 -05:00
est31
d494733839 Add minetest.register_lbm() to run code on block load only 2016-03-07 19:54:26 +01:00
Auke Kok
47464c9344 Fix backface culling when connecting to new servers.
Introduce a new contentfeatures version (8). When clients
connect using v27 protocol version, they can assume that
the tiledef.backface_culling is trustable, but if clients
connect to servers providing contentfeatures version 7,
then the v27 clients know that backface culling settings
provided by the server in tiledefs are bogus for mesh,
plantlike, firelike or liquid drawtype nodes.

thanks to hmmmm, est31, nerzhul.

Tested on new client - new server, new client - old server
old client - new server.
2016-02-10 00:10:51 +01:00
Auke Kok
735e3b7059 Backface culling: Ignore setting in tiledef from old servers.
Outdated servers are always sending tiledefs with culling
enabled no matter what, as the value was previously entirely
ignored.

To compensate, we must (1) detect that we're running against
an old server with a new client, and (2) disable culling for
mesh, plantlike, firelike and liquid draw types no matter what
the server is telling us.

In order to achieve this, we need to bump the protocol version
since we cannot rely on the tiledef version, and test for it
being older. I've bumped the protocol version, although that
should have likely happened in the actual change that introduced
the new backface_culling PR #3578. Fortunately that's only 2
commits back at this point.

We also explicitly test for the drawtype to assure we are not
changing the culling value for other nodes, where it should
remain enabled.

This was tested against various pub servers, including 0.4.13 and
0.4.12.

Fixes #3598
2016-01-23 16:33:24 +01:00
paramat
0bbbc6e13d Liquids: Flow into and destroy 'floodable' nodes
Add new node property 'floodable', default false
Define "air" as floodable = true in C++ and lua
2016-01-07 05:57:19 +00:00
est31
b0523adc5f Add new ContentParamType2 "CPT2_DEGROTATE"
This might break some mods, but it is important for all uses of the param2 to
be documented.

This doesn't need a serialisation version or network protocol version change,
as old clients will still work on new servers, and it is bearable to have
new clients getting non rotated plants on old servers.
2015-10-04 23:59:41 +02:00
RealBadAngel
655fc6010f Fix relief mapping issues 2015-07-16 15:36:48 +02:00
RealBadAngel
ffd16e3fec Add minimap feature 2015-06-27 03:42:01 +02:00
rubenwardy
603297cc35 Add texture overriding 2015-05-19 21:27:07 +02:00
kwolekr
f091bbd563 Fix compilation for non-client builds, and fix signed comparison warning 2015-05-08 01:21:34 -04:00
kwolekr
656575b59d NodeResolver: Remove NodeResolveMethod
This simplifies NodeResolver logic and makes some interfaces cleaner.
2015-05-07 02:36:01 -04:00
kwolekr
633af58a05 NodeDefManager: Improve const-correctness of interfaces
- Add ability to explicitly reset NodeResolve state (useful for unittesting)
- Remove non-essential NodeResolve methods modifying state from INodeDefManager
- Add const qualifier to NodeDefManager and ContentFeatures serialize
2015-05-05 16:52:06 -04:00
kwolekr
479f38973e Schematics: Refactor NodeResolver and add NodeResolveMethod
NodeResolver name lists now belong to the NodeResolver object instead of
the associated NodeDefManager.  In addition to minimizing unnecessary
abstraction and overhead, this move permits NodeResolvers to look up nodes
that they had previously set pending for resolution.  So far, this
functionality has been used in the case of schematics for
serialization/deserialization.
2015-04-16 16:27:05 -04:00
kwolekr
26153bab7d Revert "Fix issue #2441: crash on respawn, since a conversion std::list to std::vector on Environment.cpp"
This reverts parts of commit 9749d9fee6db99da1ab861dc04ec63ef973db3e0, which breaks node resolver
list clearing
2015-03-20 18:41:26 -04:00
est31
e4f7c92cff Finer progress bar updates when initializing nodes
The bar is only drawn when the user will notice a change, which prevents time overheads that this commit would cause, resulting from useless draws.
2015-03-15 22:01:52 +10:00
Loic Blot
9749d9fee6 Fix issue #2441: crash on respawn, since a conversion std::list to std::vector on Environment.cpp
* Also change some std::list to std::vector for ClientMap::renderMap
* Remove disabled code in ClientMap::renderMap, disabled since a long time
2015-03-05 15:36:20 +01:00
Loic Blot
0d1eedcccc Replace std::list to std::vector into tile.cpp (m_texture_trash) and move tile.hpp to src/client/ 2015-03-05 11:59:40 +01:00
kwolekr
cd4d213ae0 NodeResolver: Perform callback immediately if node registration phase finished
Also add NodeResolver callbacks on the client
2015-01-04 16:32:31 -05:00
kwolekr
6fdb32361a Remove freezemelt (the remainder of proller nonsense) 2015-01-04 03:30:10 -05:00
kwolekr
d91559b8f0 Fix crash if NodeResolver destroyed before pending any node resolutions 2015-01-03 11:05:31 -05:00
kwolekr
08d259cf41 Set fallback content if resolving content vector requires everything 2014-12-27 22:20:04 -05:00
kwolekr
b67f37f27e Redefine NodeResolver interface and replace with callback mechanism 2014-12-27 02:12:21 -05:00
kwolekr
2c9bbe2736 NodeResolver: Fix some comments and use const references for params 2014-12-12 14:21:41 -05:00
kwolekr
c07f15e910 NodeResolver: Fix cancelNode and cancelNodeList 2014-12-11 00:41:54 -05:00
kwolekr
1cb6ea6346 Refactor decoration-related code
Split up ModApiMapgen::l_register_decoration()
Define and make use of CONTAINS() and ARRLEN() macros
2014-10-29 01:56:37 -04:00
kwolekr
4a3592ff9a Add NodeResolver documentation
Set content to fallback on AddNode failure
Consider node list requests with no results as failed
2014-10-28 02:23:45 -04:00
kwolekr
d274cbfce6 Add NodeResolver and clean up node name -> content ID resolution system 2014-10-26 23:55:45 -04:00
RealBadAngel
e5652cb75c Custom collision boxes node property. 2014-10-19 20:48:21 +02:00
RealBadAngel
0066bd77d2 Add meshnode drawtype. 2014-10-18 16:42:23 +02:00
BlockMen
f48f686930 Add optional framed glasslike drawtype 2014-10-02 11:35:15 +02:00
TriBlade9
9a685a4f2e Add firelike drawtype 2014-09-21 15:50:27 -04:00
RealBadAngel
e66bb9b864 Allow use all 6 faces for special tiles.
Protocol version bump.
2014-08-25 12:47:06 +02:00
RealBadAngel
6c98fd6658 Unite nodes shaders.
Pass drawtype and material type to shaders.
Move shaders generation to startup only.
Allow assign shaders per tile.
Initial code to support water surface shader.
2014-06-15 05:40:33 +02:00
RealBadAngel
2330267d22 Shaders rework. 2013-12-03 18:55:25 +01:00
BlockMen
7b13d119ed Add support for different drowning damage and allow drowning in other nodetypes 2013-08-06 17:49:39 +02:00
proller
0e89bca173 Leveled nodebox backward compatibility 2013-08-02 00:50:58 +04:00
proller
3aedfac968 Weather support 2013-07-27 23:21:48 +04:00
PilzAdam
413f0d0353 Add liquid_range to nodedef 2013-07-20 20:41:17 +02:00
Kahrl
112dbba7c4 Change ContentFeatures array to a vector 2013-07-14 23:06:31 +02:00
proller
9733dd5b5e Leveled nodebox 2013-07-13 22:13:24 +04:00
Kahrl
8161ab573f Remove texture atlas / AtlasPointer, rename getTextureRaw to getTexture 2013-07-02 03:03:10 +02:00
PilzAdam
53066024f6 Add drowning 2013-06-19 15:47:00 +00:00
Perttu Ahola
bc3072b35e Fix compatibility of RBA's NDT_GLASSLIKE_FRAMED 2013-04-25 11:51:28 +03:00
RealBadAngel
625a4c2e66 Add new drawtype GLASSLIKE_FRAMED 2013-04-24 21:45:18 -04:00
kwolekr
414f0275cf Optimize CNodeDefManager::getIds 2013-03-30 19:14:42 -04:00
Jürgen Doser
dacc8cdb3a Include backface_culling flag in serialization format for TileDefs
This way flowing liquids actually show the backface when specified to
do so. Without this, TileDefs where by default initialized with
backface_culling = true and never set otherwise.

For backwards compatibility, an old client connected to a new server,
or a new client connected to an old server will behave like before
i.e., backface_culling is always true.
2013-03-23 23:10:47 +01:00
Sfan5
6d0ea26c2d Update Copyright Years 2013-02-24 20:15:24 +01:00
PilzAdam
497ff1ecd6 Change Minetest-c55 to Minetest 2013-02-24 18:49:03 +01:00
Jeija
365c169b43 Disable placement prediction for nodes that use on_rightclick 2013-02-19 20:02:40 +01:00
Perttu Ahola
23913f26cd Support serialization of protocol 13 ContentFeatures 2012-11-29 22:08:25 +02:00