Jump to content

[1.8] Synchronizing custom Movement


meneken17

Recommended Posts

hey guys

 

I'm new to minecraft modding and building a rollercoaster mod.

The movement it based on quaternions which are store in the TileEntitys of the rail and in the wagon entity.

 

The coaster wagon is spawned by right clicking with an item on the rail.

The problem is that an (as it should be) server-side spawned wagon mainly moves on horizontal lines, jumps to the next position and is upside down the whole time.

 

For testing I've spawned a wagon on client side (I know it's wrong) and it moves completely fine and smooth.

 

So my question is now, do I have to take care of my whole movement with custom Packets or the DataWatcher or is there an easier way?

Link to comment
Share on other sites

Why can't you move entity on both sides? TileEntity/Entity should be readable for both sides, so as long as entity's movement has reference to it you can use it on client side and move client side entity. Same code = same movement on both sides and in case of desyncho - server will correct position (as it does for all entities).

 

Unless I am missing you point:

What do you mean: "is upside down"?

1.7.10 is no longer supported by forge, you are on your own.

Link to comment
Share on other sites

(as it does for all entities).

 

*Except boats.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

yeah. thats pretty much what I thought, too.

 

I have removed the side check on spawning and captured this.

 

width=800 height=607https://dl.dropboxusercontent.com/u/77974524/2015-04-06_22.47.55.png[/img]

 

The upper one is the client-side one.

The one below it the server-side one. It is set correct on the server (internal), but it gives some crappy informations to the client.

Link to comment
Share on other sites

Then your descriptive packet for the entity is bad.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

If your Entity holds data that is directly changing movement:

- If data is set once: IAdditionalSpawnData

- If data is small, but every tick: DataWatcher

- If data is bigger use IMessage and IMessageHandler

 

 

1.7.10 is no longer supported by forge, you are on your own.

Link to comment
Share on other sites

  • 2 weeks later...

Its been a while but now i have some time again.

 

So your answers throw up more questions.

 

1) My whole movement logic is some calculation based on the values of the TileEntitys, which are set once and dont change after.

So my first thought was that server and client should probably do the same calcualtion with the same result.

 

2) Descriptor Packet. Is there some packet method to send the data, like those in the TileEntity class?

 

3) IAdditionalSpawnData. What kind of thing is this?

Google has 3 results that contains this word. One is this post. I cant find a thing called like this in my whole workspace.

Link to comment
Share on other sites

1. If your TileEntity's values are set only once you shouldn't create relation Entity-TileEntity, this is not a smart design. Correct me if I am wrong - what you want: You spawn cart into world, cart pulls values from some TileEntity (values are not changed), then based on those values you make movement - do those values EVER change?

 

2. Yes, I alredy told you 3 ways to send data (previous post). Here is long tut:

http://www.minecraftforum.net/forums/mapping-and-modding/mapping-and-modding-tutorials/2137055-1-7-x-1-8-customizing-packet-handling-with

 

3. Sorry, it's IEntityAdditionalSpawnData, you implement it to Entity and write stuff straight into spawn packet. Spawn packet is one that is sent from server to client when server tells client to spawn entity that will be mirror of server's entity.

 

1.7.10 is no longer supported by forge, you are on your own.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.