-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Train Bogie Hitbox - Look for Update-Code after Cleanup #33
Comments
This is fairly trivial, look at the Ender Dragon. Another example from the Railcraft Tunnel Bore: |
That does help a bit, mostly it's just the mess is this entire nasty hitbox system needs a full replacement with something proper. |
Entity.getParts() is about as proper as it gets. Its how all the vanilla entities handle the problem. |
you're sugguesting changing the entire positioning system for how carts place next to eachother while moving. As it is right now it's built off hitboxes Add to it, theres issues with getParts because it can randomly be null, especially in 1.8+ (which i would assume this will get ported to eventually). so that would create more errors in place of this. |
Just trying to help, it's a tried and true system that works for vanilla and many other mods. Basically the master entity has one large hit box that encompasses the entire entity in any orientation, the collision detection uses this to determine if it should look closer. If it detects a possible collision, it then grabs the part entities from the entity and refines the collision detection against them. A collision is only determined to occur if part entity collision boxes intersect the entity being tested. I don't see what this really has to do with intercart positioning, and even if it does, it should be trivial to adapt anyway. As for nulls...I'm not sure why you'd even be calling getParts() anyway. That's for the collision detection subsystem to use. |
Frankly it should even be possible to link part entities from two different carts together to create links. You could even create a part entity specifically for the link attachment points. Then you'd just feed the positions for the two anchor part entities to the linkage physics (which unless the linkage physics code has been rewritten, used to be based on my code) and the physics code would keep the two anchor point entities close. Applying the spring forces might be a bit weird as you'd need to apply them to the parent entities, but I'm sure it's a solvable issue. In fact you could probably crank the spring and damping forces up for a much less bouncy and more solid connection as the two anchor points can be very close together. But that's just brainstorming off the top of my head. |
If we shouldn't be using getParts, why did you mention it, and then go on to explain it? I'll look into this when I have some more time to put into debugging. I know the hitbox setup was changed in TC 1.6.4 because a lot of related issues spawned there, suffocation in 3x3 tunnels but not 3x4 tunnels, this weird linkage between carts, the 3 hitboxes rather than one, along with them not moving. I've done a lot of hitbox work in .net, C++, and C. I know how it's supposed to be done, method wise anyway, but that doesn't mean I just magically know the forge API calls. The issues shouldn't even be the anchors, they work fine, producing working and reliable results with what they are given, but the hitboxes themselves are just all over the place, which would cause the anchors to seem a bit wonky. Don't get me wrong, I appreciate the effort to try and help, I just want to try and better convey the actual issue that's going on here. |
I said you had no reason to call the getParts() method. What you do want to do is return your child part entities to the method so that the game can use them during collision detection. As I said before, look at the Ender Dragon or Railcraft Tunnel Bore for working examples. As for Anchor I just mean a point where two cars would connect to each other, think coupler. |
About this issue, I try to solve this in my fork of Tc. Those hitbox are the hitbox of tileEntityBogie and not of EntityRollingStock. They don't move because entity boggie was not updated on the client side. When we use entityBogie, the function updateDistance() push them out of the rail on sharp if the train was too fast. To handle this I put the locomotive out of the track when I detect one bogie is not on the track. (This is not a good solution). I think we can handle this by a beter way by preventing entityBogie to be pushed out of track in updateDistance(). |
And the hitboxes are moving away from its positions. |
the displacement you are seeing is due to a delay in the positioning updating, it only updates every other tick in an attempt to improve performance since when I first got this mod working it was VERY laggy. |
Is this issue fixed? |
partially. it's still open because of a displacement in the hitboxes at high speeds. |
Trains have multiple hitboxes when they are placed but they aren't moving along with the train.
The text was updated successfully, but these errors were encountered: