Commit Graph

93 Commits

Author SHA1 Message Date
Auke Kok 80cec4702d Fix connected nodes' selection boxes.
This allows the player to more easily target and punch connected
nodeboxes, especially if they have a fixed nodebox that is very
small, like technic cabling, or xpanes. Tried it on fences and
my xpane conversion, and happy with the result.
2016-03-21 17:42:20 +00:00
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
paramat 8aaae7db05 Mapnode: Replace rotateAlongYAxis with improved version
Get facedir by using lowest 5 bits of param2 and limiting to 23
More robust, frees up higher param2 bits for other uses
Change lookup table and table index to u8
2015-10-02 06:03:36 +01:00
paramat a56aedb4ea Mapnode: Add rotateAlongYAxisFull supporting 24 facedirs 2015-09-22 20:54:25 +01:00
David Jones 34b7a147dc Change i++ to ++i 2015-08-25 18:33:52 -04:00
paramat 9e1e4b6284 RotateAlongYAxis: For facedir case, return if param2 >= 4 2015-05-03 03:43:51 +01:00
Craig Robbins 9527984dbc Move globals from main.cpp to more sane locations
Move debug streams to log.cpp|h

Move GUI-related globals to clientlauncher

Move g_settings and g_settings_path to settings.cpp|h

Move g_menuclouds to clouds.cpp|h

Move g_profiler to profiler.cpp|h
2015-04-01 23:04:25 +10:00
Craig Robbins ced6d20295 For usages of assert() that are meant to persist in Release builds (when NDEBUG is defined), replace those usages with persistent alternatives 2015-03-07 22:41:47 +10:00
gregorycu 577701cabd Optimise MapBlockMesh related functions
Directely or indirectly optimises the following functions:

* MapBlockMesh::MapBlockMesh
* MapBlockMesh::getTileInfo
* MapBlockMesh::makeFastFace
* MapBlockMesh::getSmoothLightCombined
2015-02-23 23:20:31 +10:00
Craig Robbins caf8d2a9d1 Increase MapBlock::actuallyUpdateDayNightDiff() performance by 2-8x. ok @celeron55
Before patch, function consumes up to ~8% of the main server loop. After, ~0% (below level of 2 places of significance)
2015-02-10 16:23:37 +01:00
Craig Robbins d576235409 Fix facedir > 23 causes segfault in client
See issue #2017
Applied kahrl's gist
2015-01-09 15:42:03 +10:00
kwolekr 6fdb32361a Remove freezemelt (the remainder of proller nonsense) 2015-01-04 03:30:10 -05:00
Craig Robbins c5f6f9f77a Increase performance of getLight() by at least 2x
Leads to the following increases:
getSmoothLight() approx.     40% increase
getTileInfo() approx.        25% increase
MapBlockMesh::MapBlockMesh() 25-30%
2014-12-10 00:52:02 +10:00
Craig Robbins ea404979e1 Optimise getTileInfo()
getTileInfo() ~1.5x faster
getSmoothLight ~2.0x faster
2014-11-21 14:56:45 +10:00
RealBadAngel e5652cb75c Custom collision boxes node property. 2014-10-19 20:48:21 +02:00
kwolekr 747bc40840 Cavegen: Respect is_ground_content MapNode setting; fix some code formatting issues 2013-11-29 20:54:04 -05:00
proller 037e84d377 Better snow fall, finite liquid transform, leveled nodes api 2013-07-28 17:14:31 +04:00
proller 3aedfac968 Weather support 2013-07-27 23:21:48 +04:00
proller 9733dd5b5e Leveled nodebox 2013-07-13 22:13:24 +04:00
kwolekr fca4610f11 Fix wallmounted rotations along Y axis for 90 and 270 degree cases 2013-07-08 18:50:29 -04:00
kwolekr ce955f37ba Decoration: Handle facedir and wallmounted param2types with schematic rotation 2013-07-08 15:19:48 -04:00
RealBadAngel 6f8d40ef5d 6d facedir 2013-03-23 21:31:05 +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
Perttu Ahola 0cf1ed544c darkrose should work at a nuclear power plant.
It'd take years to figure out what caused the accident.
2012-07-24 16:36:50 +03:00
Perttu Ahola fd845f27f5 Fix map deserialization and remove old serialization code 2012-07-23 08:18:39 +03:00
darkrose ea62ee4b61 Increase node id/param0 to 16 bits, leaving param2 always with 8 bits 2012-07-23 08:18:39 +03:00
Kahrl 1575448b1a Custom boxy nodes (stairs, slabs) and collision changes 2012-06-17 16:34:39 +03:00
Perttu Ahola 9f031a6759 Optimize headers 2012-06-17 04:03:39 +03:00
Perttu Ahola d0ea6f9920 Properly and efficiently use split utility headers 2012-06-17 02:40:36 +03:00
Perttu Ahola 037b259197 Switch the license to be LGPLv2/later, with small parts still remaining as GPLv2/later, by agreement of major contributors 2012-06-05 18:54:07 +03:00
Kahrl 807a0d313b MapBlockMesh, mesh animation system, urgent mesh updates, athmospheric light, removed footprints 2012-03-15 21:45:44 +02:00
Kahrl c241902b40 Cleanup (some stuff went wrong when reverting 4-byte mapnodes); fix legacy_wallmounted 2012-01-22 17:31:20 +02:00
Kahrl 157a4cf18c Node placement / mineral / serialization / iron freq / node_dig callback
- Node placement code moved to Lua
- Mineral system removed (added default:stone_with_coal and default:stone_with_iron).
- MapBlock and MapNode serialization updated.
- Mapgen: Frequency of iron increased.
- node_dig callback and related changes.
2012-01-22 17:24:50 +02:00
Perttu Ahola eabfb370ac MapNode constructor to allow ndef+name 2011-11-29 19:13:47 +02:00
Perttu Ahola c0f6395cf0 Node definition names 2011-11-29 19:13:46 +02:00
Perttu Ahola ba762bcd49 Clean mapnode.h and fix other files accordingly 2011-11-29 19:13:44 +02:00
Perttu Ahola eed727c61b Completely generalized mesh generation; ContentFeatures serialization 2011-11-29 19:13:44 +02:00
Perttu Ahola c6fd2986d4 GameDef compiles 2011-11-29 19:13:42 +02:00
Perttu Ahola abceeee92f Create framework for getting rid of global definitions of node/tool/item/whatever types 2011-11-29 19:13:41 +02:00
Perttu Ahola 64996422c0 Move ContentFeatures to mapnode_contentfeatures.{h,cpp} and clean stuff 2011-11-29 19:13:40 +02:00
Perttu Ahola 045e32b6ec Fix water-glass and water-lava surfaces 2011-11-08 16:17:38 +02:00
Perttu Ahola e9fd3def90 Make CONTENT_IGNORE to not block the view when occlusion culling 2011-11-03 20:45:44 +02:00
Perttu Ahola 05ab58cd14 Automate texture listing for texture atlas making 2011-10-18 11:31:23 +03:00
Perttu Ahola 9e46cbf7ea Header file tweaking; mainly for speed 2011-10-12 13:53:38 +03:00
Perttu Ahola 8f42a8be0c lava! 2011-08-15 02:04:56 +03:00
Perttu Ahola d6a9bec843 Added MaterialItem conversion from old content type namespace to new 2011-07-31 02:20:40 +03:00
Perttu Ahola 90d793f8f3 extended content-type range 2011-07-23 16:55:26 +03:00
Perttu Ahola f706644a50 Fixed the problem of <=r548 clients fucking up maps on >=r549 servers. Also, already fucked up maps are now loaded correctly. 2011-07-22 18:51:49 +03:00
Perttu Ahola 329158f7d1 Fixed small error in mapnode.cpp (didn't cause any harm though) 2011-07-22 01:37:21 +03:00