traugdor Posted January 9 Report Posted January 9 I saw a thread yesterday where a player was using the sailboats and thought they were extraordinarily slow. I did some digging into the game's code on GitHub and found this: Another section that defines the value of the motion variable (used below): And finally: From my own testing, the sailboat cannot be controlled from the passenger seat and so it cannot exceed a STR rating of 1. The physics engine scales the motion so in case of lag spikes, the boat moves further during the spike instead of resetting its momentum (controlled by DT which gets larger as the framerate goes down). This would seem to indicate that the raft (with a passenger) could theoretically go faster than the sailboat since the passenger rowing adds 0.5 to the STR rating for a maximum of 1.5. This seems to indicate that the rowboat would indeed go 50% faster than the sailboat. In order for the sailboat to be worth it, the distance you would need to travel would have to exceed half reasonable distance that a rowboat could travel in a day to ensure that making round trips with the rowboat would be ineffective. Both are still slower than the elk so if there is a land-based route then it's possible that the elk would be the quickest way to get from point A to point B, but that's beside the point. The point is that sailing has always been faster than walking and the sailboat, as far as I can tell, is clamped to walking speed due to the nature of its control scheme (driver seat only, no passengers can assist with rowing, etc). Am I doing something wrong here or is the sailboat really that bad? 3
traugdor Posted January 9 Author Report Posted January 9 I should add that I didn't see a way to control the angle of the sails or that the wind direction had any bearing on the boat's speed. Also there didn't seem to be any way to use an oar to help paddle the boat. 1
Thorfinn Posted January 9 Report Posted January 9 Interesting. I figured it was more a proof of concept at this point. Simplifying the model makes a lot of sense. Until there is variable wind direction, there's not much point in writing code that uses it, if for no other reason that you can't really test the code. But it does not consider wind speed at all? I had thought there was a dreadful row about sailboat speed, but this morning, I see it was just a terrible nightmare. "[A]n undigested bit of beef, a blot of mustard, a crumb of cheese, a fragment of an underdone potato." But one dollop of unintended wisdom remains -- it's always easier to give than to take away. The Great Mining Speed Riot may well be the reason for things like a somewhat underwhelming glider and sailboat -- people will be happy to get improved versions, but will not tolerate them being nerfed. What comes as no surprise is that the SpeedMultiplier is already written into the code. Or is that walking speed? 1 1
Thorfinn Posted January 9 Report Posted January 9 1 hour ago, traugdor said: The physics engine scales the motion so in case of lag spikes, the boat moves further during the spike instead of resetting its momentum (controlled by DT which gets larger as the framerate goes down). What mention of dt there is in the code is consistent with it being the dt from calculus, but in this case, to allow it to be numerically calculated. Since you can't use the infinitely small dt of calc, you use the algebraic version, delta t, which would necessarily have to be adjusted by framerate. 1
LadyWYT Posted January 9 Report Posted January 9 1 hour ago, Thorfinn said: Interesting. I figured it was more a proof of concept at this point. Simplifying the model makes a lot of sense. Until there is variable wind direction, there's not much point in writing code that uses it, if for no other reason that you can't really test the code. But it does not consider wind speed at all? That's kind of what I was thinking--proof of concept/laying the groundwork for things to come. The boat is functional, but underwhelming for what it should be able to do, given the speed limitation. I'm not really shocked about the wind speed not affecting it, although it does seem a bit odd, given that it seems like it might be a trickier thing to code properly. 1 hour ago, Thorfinn said: What comes as no surprise is that the SpeedMultiplier is already written into the code. Or is that walking speed? I don't know that it's walking speed specifically, but I think it's the same value that player walk speed has. 2 hours ago, traugdor said: The point is that sailing has always been faster than walking and the sailboat, as far as I can tell, is clamped to walking speed due to the nature of its control scheme (driver seat only, no passengers can assist with rowing, etc). Hence my surprise that the sailboat was as slow as it was. Granted, I wasn't expecting to feel like Sonic, but I expected it to be on par with the elk, at least. It should really be a bit faster, since historically travel by water has been the fastest option, when it's available. The drawback, of course, is that the sailboat is a bigger resource investment, and there may not be water where you wish to go. 2 hours ago, traugdor said: Am I doing something wrong here or is the sailboat really that bad? I mean...I am not great at reading and understanding the magic math numbers. But the code + explanation does track with what I've experienced when tinkering around in the game. 1
Thorfinn Posted January 9 Report Posted January 9 (edited) 36 minutes ago, LadyWYT said: I'm not really shocked about the wind speed not affecting it, although it does seem a bit odd, given that it seems like it might be a trickier thing to code properly. I suspect the reason for not being included is that wind speed at sea level is not terribly impressive. Until late fall or winter, you can't count on being able to drive a quern at sea level with just a single set of sails. Might be fairly easily addressed -- I can see something like reducing the altitude penalty to windspeed by 1 for every block you are from shore, so at 50 distance from shore you are at the same windspeed as your windmill at 160. I don't think that would be that bad CPU-wise, though it would be more intensive than just the one-time calculation it needs to do for your windmill. [EDIT] If I were coding it, I think I'd put the penalty as an attribute of the rotor at the time it is placed. It will only ever change when you move the rotor. The boat's JSON is interesting in that it includes things like water resistance. Not sure how the physics there is done. IRL, it's a second -order differential equation. Does resistance increase as the square of the speed? Dunno. Edited January 9 by Thorfinn 2
traugdor Posted January 9 Author Report Posted January 9 8 minutes ago, Thorfinn said: Does resistance increase as the square of the speed? Dunno. I'll have to dive into the code when i'm not at work, but it would seem that the water resistance is only simulated at this point because the forward momentum of the boat is calculated as a limit. // Add some easing to it ForwardSpeed += (motion.X * SpeedMultiplier - ForwardSpeed) * dt; AngularVelocity += (motion.Y * SpeedMultiplier - AngularVelocity) * dt; Once the ForwardSpeed is the same as motion.X * SpeedMulitplier, then no more speed can be added to the boat. Increasing the speed multiplier would increase the top speed of the boat, and that ratio appears to be linear, though I do understand that 2 data points doesn't really make a good graph. so while this could simulate water resistance, it is not calculated here. 1
Thorfinn Posted January 9 Report Posted January 9 (edited) Oh, yeah, should have noticed. Subtracting ForwardSpeed in the parenthesis would set a limit, as it would drive the increment to 0*dt. Not quite the same thing as second order, but close enough. Closer to a Zeno's Paradox. You would have to do a lot of testing to see the difference. Edited January 9 by Thorfinn 1
Zelger Posted January 9 Report Posted January 9 The boat speed is baffling. Since there is nothing of intrest in the oceans you just spend 20 minutes holding down the w key while ocassionally pressing a / d. This feels wrong, if there is nothing of intrest in the water at least let us get through it faster so we could actually play the game! The method I use while sailing / swimming is just placing a small heavy object on the w key and leaving the game running while I go do something more interesting. Feels like shitty game design to me. I think, the boat speed should get doubled or increased even more, cause right now it is basically the same speed as swimming. 3
traugdor Posted January 9 Author Report Posted January 9 1 hour ago, Thorfinn said: Closer to a Zeno's Paradox. Hmm... and which one might that be??
traugdor Posted January 9 Author Report Posted January 9 17 minutes ago, Zelger said: there is nothing of intrest in the oceans ... yet ... 1
Thorfinn Posted January 9 Report Posted January 9 So what happens if/when it's discovered that doubled speed is too much, as in, unbalanced with the rest of the game, or causes other problems? What about when new hazards are introduced? Are you going to be OK with speed being adjusted? Is everyone else? Incidentally, that's kind of what @traugdor is investigating Is SpeedMultiplier at least derived from Walk Speed from worldconfig? If someone has a speed buff/debuff, is his sailing speed affected? 1
traugdor Posted January 9 Author Report Posted January 9 Just now, Thorfinn said: Incidentally, that's kind of what @traugdor is investigating Is SpeedMultiplier at least derived from Walk Speed from worldconfig? If someone has a speed buff/debuff, is his sailing speed affected? I'll have to dive deeper into it, but they appear to be separate. The boat speed is directly tied to the boat entity and doesn't reference player movement. 1
Thorfinn Posted January 9 Report Posted January 9 (edited) 11 minutes ago, traugdor said: Hmm... and which one might that be?? Oh, to get from point A to point B, you first have to go halfway. Then you have to go from the midpoint to point B. Then from 3/4 of the way to point B. Since the distance can always be split in half (mathematically) it will take an infinite number of steps, and therefore, can never reach point B. That's kind of what's going on here, but due to the number of digits, eventually it really is 0. And just like IRL, you can actually get to point B. 10 minutes ago, traugdor said: they appear to be separate. Interesting. Not surprising, as that's good coding practice, but interesting. It strongly suggests that the intent is at some point to fine-tune movement of the various means of transport by tweaking just the constants relative to each other, or maybe even put access to it in world settings. Edited January 9 by Thorfinn
Zelger Posted January 9 Report Posted January 9 1 minute ago, Thorfinn said: Oh, to get from point A to point B, you first have to go halfway. Then you have to go from the midpoint to point B. Then from 3/4 of the way to point B. Since the distance can always be split in half (mathematically) it will take an infinite number of steps, and therefore, can never reach point B. That's kind of what's going on here, but due to the number of digits, eventually it really is 0. Interesting. Not surprising, as that's good coding practice, but interesting. It strongly suggests that the intent is at some point to fine-tune movement of the various means of transport by tweaking just the constant, or maybe even put access to it in world settings. Is there an easy way of changing the speed of boats? Haven't seen any mods for it yet and would love to play around with faster boats in my world, see how it feels. 1
Thorfinn Posted January 9 Report Posted January 9 (edited) I didn't see one in the JSON, @Zelger, which is presumably what you meant by easy. I haven't done much looking around the git, and I've been told that not all all of the source is available. You could try making a fork and seeing if it will compile your changes. Whether or not that's "easy" depends on whether you are a c programmer with collaboration experience. If you are, first thing I think I'd try is bumping the SpeedMultiplier. But keep in mind that might break other parts of the game. Assuming there are link object files you cannot modify, it's kind of like yanking a random wire out of your computer to see what it does. [EDIT] I've not tried the mod, Joy of Sailing in a coon's age, but I've been told it incorporates faster boats. Might be worth a try. Edited January 9 by Thorfinn 1
traugdor Posted January 9 Author Report Posted January 9 Upon further investigation, there is only one reference to the SpeedMultiplier for boats that is in the BoatEntity.cs file where I got the original code. It's in the vssurvivalmod repo so if you can modify it, and compile it into working VSmod code, then you could theoretically try it. I don't have my computer setup for VSmod coding so I can't do it right now. 1
LadyWYT Posted January 9 Report Posted January 9 1 hour ago, Zelger said: The boat speed is baffling. Since there is nothing of intrest in the oceans you just spend 20 minutes holding down the w key while ocassionally pressing a / d. This feels wrong, if there is nothing of intrest in the water at least let us get through it faster so we could actually play the game! The method I use while sailing / swimming is just placing a small heavy object on the w key and leaving the game running while I go do something more interesting. Feels like shitty game design to me. I think, the boat speed should get doubled or increased even more, cause right now it is basically the same speed as swimming. Just a side note here, but 1.20 was supposed to include coral reefs as part of the package. Unfortunately, that feature wasn't working as intended, so the devs have pushed it back for a future update for now, which leaves the oceans mostly barren. I daresay that's also why the settings for default world generation haven't been changed to allow for proper oceans, despite the addition of a proper boat. Until there's more to see and do with large swaths of water, land maps will probably be more fun for players to play on an unmodded client.
traugdor Posted January 10 Author Report Posted January 10 1 hour ago, LadyWYT said: land maps will probably be more fun for players to play on an unmodded client. which is currently the default for anyone playing on an RC version of the game. 1
Thorfinn Posted January 10 Report Posted January 10 1 hour ago, traugdor said: I don't have my computer setup for VSmod coding so I can't do it right now. I don't even know what libraries they are using. Nor am I up to snuff on .NET7. So it's a safe bet that I won't be doing anything with it anytime soon.
Maelstrom Posted January 10 Report Posted January 10 17 hours ago, Thorfinn said: I've not tried the mod, Joy of Sailing in a coon's age, but I've been told it incorporates faster boats. Might be worth a try. In 1.19 Joy of Sailing had incredible speed that wasn't ridiculous like that one raft mod.
traugdor Posted January 10 Author Report Posted January 10 28 minutes ago, Maelstrom said: In 1.19 Joy of Sailing had incredible speed that wasn't ridiculous like that one raft mod. I'm ready for it to be updated to 1.20. I think the author said they were working on it.
Lodey Posted January 10 Report Posted January 10 (edited) 5 hours ago, traugdor said: I'm ready for it to be updated to 1.20. I think the author said they were working on it. Yes, the author is currently reworking the new vanilla boat so we can turn the sail and catch the wind for more speed, etc. I don't know if there's an ETA on that but I'm looking forward to it. Edited January 10 by Lodey
Recommended Posts