Jump to content
Aiteron

Testing the idea of towing a vehicle

Recommended Posts

I decided to make a car towing mod. I have some results, but this is not a simple mod. 

 

I changed the source code of the game (decompiled, modified, compiled) and wrote a mod for lua.

 

Stopped at the current state of the mod. (There is no point in continuing if the developers do not add the necessary code for the mod to the game and decompilation does not perfectly restore the code, so the decompiled files crash the game (I think the deadlock occurs))

 

I added the following code to the game source code:

1. OnVehicleUpdate event - trigger when vehicle update

2. Change vehicle position (like setDebugZ(float))

public void setDebugXYZ(float x, float y, float z) {
	this.tempTransform.set(this.jniTransform);
	this.tempTransform.origin.x = x - WorldSimulation.instance.offsetX;
	this.tempTransform.origin.y = z ;
	this.tempTransform.origin.z = y - WorldSimulation.instance.offsetY;
	setWorldTransform(this.tempTransform);
}

 

This is not real towing. I'm teleporting transport now.
Joints are needed for real towing. Now, as I understand it, the developers use the modified Bullet engine, and there are no joints in engine java api now.

 

What I want to achieve with this functionality:
1. Towing a car with a correct turn and physics similar to realism (imitation)
2. For towing you need a special device or a special car
3. Towing affects the movement of the car. (Depending on the weight of the towed vehicle)

 

What I've done:

 

 

 

How can I submit a request to developers for the methods I need?

 

Write what you think about the mod idea. If there are a lot of people interested, perhaps the developers will implement the required functionality.

 

Share this post


Link to post
Share on other sites
6 hours ago, EnigmaGrey said:

RJ set this up sometime last year, but we decided to hold off until it could be visually set up, in addition to tied with the physics system. So far, there’s just been no time to revisit it.

I understand you have other priorities now.

 

Having studied the code, I was shocked! You've done an insane amount of work.  I studied only a part of the code, but this is already tens of thousands of lines of code!  I am amazed.  I wish you a smooth transition to the new network code.  

 

question: what about the methods that i need for mods?  can i expect them in the next updates and what is the best way to request new functionality for use in lua code?  I tried to make a mod with minimal changes in the code.

 

 In the meantime, I'll switch to mods without changing the source code and try to extract everything I can.

Share this post


Link to post
Share on other sites
On 9/2/2020 at 1:26 AM, Aiteron said:

I understand you have other priorities now.

 

Having studied the code, I was shocked! You've done an insane amount of work.  I studied only a part of the code, but this is already tens of thousands of lines of code!  I am amazed.  I wish you a smooth transition to the new network code.  

 

question: what about the methods that i need for mods?  can i expect them in the next updates and what is the best way to request new functionality for use in lua code?  I tried to make a mod with minimal changes in the code.

 

 In the meantime, I'll switch to mods without changing the source code and try to extract everything I can.


It’s possible they’ll be added, but there’s enough work involved that’d it’d be pretty much equivalent to implementing towing ourselves. 
 

For other things, post your requests here or make your own thread and we’ll keep an eye on it: 

 

Share this post


Link to post
Share on other sites

That looks pretty darn fluid to me...  ESPECIALLY the part where you back up, and movement behaves accordingly as it would with slack given to the tow line... Then resuming again after you move far enough ahead making it taut before it affects the towed vehicle... When can we expect to be able to vacation with our RV's + Jeep in tow ??!!?  Amazing job...

Share this post


Link to post
Share on other sites
On 9/24/2020 at 4:06 AM, Arsenal26 said:

That looks pretty darn fluid to me...  ESPECIALLY the part where you back up, and movement behaves accordingly as it would with slack given to the tow line... Then resuming again after you move far enough ahead making it taut before it affects the towed vehicle... When can we expect to be able to vacation with our RV's + Jeep in tow ??!!?  Amazing job...

Main physics almost done. I also want to try to visually show the rope, but I need to check if this is possible.  there are already several new features that are not shown in the video :) I think about in the next couple of weeks I will open the mod as an open beta.

Share this post


Link to post
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
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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.

Loading...

×
×
  • Create New...