minetest-mods / digtron

A modular tunnel boring/construction machine mod for Minetest.
https://forum.minetest.net/viewtopic.php?f=9&t=16295
Other
22 stars 29 forks source link

Add seat node #3

Open numberZero opened 7 years ago

numberZero commented 7 years ago

Currently, you have to follow your digtron as it digs, even in automatical mode. That’s unhandy. Although you can add panels and stand on them, that’s unreliable. So I suggest to add a node where you can sit and be reliably attached to the digtron, not leaving it on server lag, not falling when it crosses holes, etc.

FaceDeer commented 7 years ago

Well, there's already code that moves the triggering player along with the Digtron if they're within the Digtron's physical boundaries. You can make it more reliable by positioning yourself nearer to the center of the Digtron array. Try using "structure" nodes, perhaps, you can climb inside those.

I'm not aware of any moving chairs in Minetest, the API didn't seem to be designed with vehicles like this in mind. Do you know of any mods that add moving chairs that I could look at for additional ideas on how to do such a thing?

numberZero commented 7 years ago

The current system is inherently unreliably, mostly due to the (network) latency and the fact that usual movement is handled on the client. If you move (including rotation) simultaneously with the digtron moving you, either movement is lost. What I suggest is to disregard player own movement (when he sits). I see 2 ways to do that:

  1. Simple, but bug-prone: after the player sits down (right-clicks the seat), his position is reset on each digtron movement to the seat position, disregarding his previous position.
  2. Better: a seat creates an entity and handles its position that way; when the player right-clicks the seat, he is attached to the entity. That’s better as it’s obvious for the player he is attached; disconnection, death, etc. should be handled by MT itself as well. (see MTG carts for details)