Minetest structures & physics

For people working on the C++ code.
Post Reply
User avatar
prof
New member
Posts: 9
Joined: Sun Dec 02, 2018 02:01
GitHub: prof
IRC: prof
In-game: prof

Minetest structures & physics

by prof » Post

I've been playing MT for a bit now and would like to add my comments.

Granted this is a cubic world built of blocks. Some blocks can move (falling, etc) while most objects are stationary.

One thing which seems to be missing from the core system are certain spacial (as in "space": coord & attitude) supports. A block has a coordinate and so does a player. However there are other conditions which I'd suggest might improve the game. Object Grouping, Attitude and Viewpoints. Let me explain...

A block is a singular entity. However entities can be combined to build even larger groups of objects (I'll call "Group Objects" [non-programming] for lack of a better word). These Group Objects can and should operate together as if they were a single object/block. Perhaps a key block is the reference block, or even a key coordinate within any Group Object (initially a computed center of object) from which all events happen.

Such activities would be similar to "Sticky MoveStones" but with far extended capabilities of grouping and movements and even attitudes.

Events include change of position in space as well as change or orientation (even if block angles such as 90deg/180deg/270deg).

And example might be a moving airship. After building and calling some as-yet undefined command to define this object, the Group Object now operates (even moves) as a single entity. Any position which can be occupied by any block can occupied by the object (with collision detection).

Any intentional or unintentional collision with intersecting blocks undefines the Group Object with blocks separating from the Group Object's center according to their distance from that center -- which would create a realistic explosion. Of course this also requires some natural physics capability even for an ordinary block (such as ballistic trajectories rather than mere freefall).

Any Group Object can be controlled by a Player (privately or publicly) and are considered protect until the originating player or a collision undefines the Group Object.


My 2nd comment is upon the concept of Player Viewpoint:

Under certain conditions (e.g. outer space), a player's viewpoint should become fully rotatable not just along the X-Z axis but also the Y axis. Up/Down are simply from the player's viewpoint. Any construction continues to be in World coordinates without the player having to know/understand the true orientation of the blocks (other than from observation of his own coord changes).

This makes it possible, in Space, to make any direction look "up or down" to him. He can slip thru 1x1 hatches by changing his attitude to fit and restore attitude. Any furniture (which itself is already fully rotatable) can be seen in any attitude as "up" to a player.

This feature shouldn't be too complex to support as it simply requires the a players 1x2x1 block person to be utilized in any orientation. (2x1 under most circumstances, yet 1x1 under others). And in terms of game play, as long as the system understands it's own world orientation the player need not be concerned about his.

Any thoughts, considerations, ideas? I'd like to discuss them. I think Group Objects alone could be a major enhancement to Minetest for all players.

--prof

User avatar
rubenwardy
Moderator
Posts: 6972
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
Location: Bristol, United Kingdom
Contact:

Re: Minetest structures & physics

by rubenwardy » Post

prof wrote:A block is a singular entity. However entities can be combined to build even larger groups of objects (I'll call "Group Objects" [non-programming] for lack of a better word). These Group Objects can and should operate together as if they were a single object/block. Perhaps a key block is the reference block, or even a key coordinate within any Group Object (initially a computed center of object) from which all events happen.

...
We named this a "Voxel Area Entity" and it's on the road map: https://dev.minetest.net/TODO#Voxel_Area_Entities

prof wrote:This feature shouldn't be too complex to support as it simply requires the a players 1x2x1 block person to be utilized in any orientation. (2x1 under most circumstances, yet 1x1 under others). And in terms of game play, as long as the system understands it's own world orientation the player need not be concerned about his.
This is more difficult than you'd think, as a lot of the existing logic and maths is based on the assumption that up is always the same direction. Collision boxes is one of the most trickiest areas with this, as it is performance sensitive and the algorithm doesn't allow rotated cubes
Renewed Tab (my browser add-on) | Donate | Mods | Minetest Modding Book

Hello profile reader

User avatar
prof
New member
Posts: 9
Joined: Sun Dec 02, 2018 02:01
GitHub: prof
IRC: prof
In-game: prof

Re: Minetest structures & physics

by prof » Post

In space dynamics (I've worked on space simulators & spacecraft control systems with astronauts) there are two 3-dimensional values. The first is your position. The second is your attitude (or orientation). I'm just suggesting the incorporation of these two into Minetest -- somewhere in the core engine. This takes care of any future navigation, orientation requirements (even if only using 2 of the 3 -- such as X-Z rotations but not Y)

I'm describing a person as a 1x2x1 block dimension. Trying to enter a 1x1 door for a 1x2 person is blocked. However under another orientation his dimensions are now 1x1 and he successfully fits and traverses the passage.

As for collision boxes, these are true regardless of attitude of any group. In Minetest it is assumed that Group Objects (Voxel Area Entities) will always be in units of 90 degree units. So change of orientation is simply the transposition of these blocks to an easily computable new positions. All existing rules continue to be simple.

Even in the most complex terms of attempting special attitude changes (other than 90 deg), a collision is still the occupancy of any part of a box to any other occupied box. We don't need to compute anything more complex than that. I haven't looked at the core code for collisions in Minetest but I'm sure the simple 90 degree rule above shouldn't make anything too difficult anyway -- same rules, no special cases.

Even a special angle condition is simply matrix math -- which is the core function of GPU (that's all they do, matrix math). So I'm sure some clever programmer might incorporate that into use too.

There are solutions to everything.

My basic thoughts are the 6-Degrees of Freedom incorporated into the core engine. And then a definition of an object not restricted to a single block -- but a linked list of blocks with a shared 6DOF reference. Change the group's 6DOF values and apply them to all group members (easy).

--prof

User avatar
prof
New member
Posts: 9
Joined: Sun Dec 02, 2018 02:01
GitHub: prof
IRC: prof
In-game: prof

Re: Minetest structures & physics

by prof » Post

Say, Ruben, I can't seem to reach the links you've provided to Voxel-Area-Entities. Dead Links.

However, I most certainly have suggestions about how I'd do it if that were my project. It's not as difficult as first glance as long as the code is properly structured. The way I do things I write structures to which all rules apply (whether a single block or a group of blocks, following the same rules).

Unfortunately, I've seen (and corrected) all to many other programmer's code which makes things far too specific to just a single design. One should always code for universal applicability rather than a single-use context.

If you come across any interested persons on this I'd be more than happy to provide advice.

An object or a block really shouldn't have different rules.... if coded properly.

--prof.

User avatar
rubenwardy
Moderator
Posts: 6972
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
Location: Bristol, United Kingdom
Contact:

Re: Minetest structures & physics

by rubenwardy » Post

prof wrote:Say, Ruben, I can't seem to reach the links you've provided to Voxel-Area-Entities. Dead Links.
--prof.
I've fixed them now
Renewed Tab (my browser add-on) | Donate | Mods | Minetest Modding Book

Hello profile reader

User avatar
Mantar
Member
Posts: 584
Joined: Thu Oct 05, 2017 18:46
Contact:

Re: Minetest structures & physics

by Mantar » Post

prof wrote:However, I most certainly have suggestions about how I'd do it if that were my project. ....
If you come across any interested persons on this I'd be more than happy to provide advice.
The code's all open to the public, prof. You can read it, make your own branch, makes changes to that branch, and submit your changes in a pull request to be folded into mainline.
Though one caveat is that the core developers are a bit overtaxed right now, and there are a fair number of pull requests already waiting in line to be reviewed for acceptance.
Even so, the best way to make suggestions is with a pull request.
Lead dev of Exile, git repo: https://codeberg.org/Mantar/Exile

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest