Cargo Ships


Adds massive cargo ships to the game, that function similarly to trains. Also adds deep sea oil, oil platforms, tanker ships, train bridges and other water based content.

Content
21 days ago
0.16 - 2.0
219K
Transportation Logistics Trains Mining Fluids Power

b [Fixed] Incompatibility with Noxys Swimming

3 years ago

I know this has been posted earlier, but the Swimming Mod by Noxys incorrectly slows boats down to a crawl. This issue has been brought up to Noxys (https://mods.factorio.com/mod/Noxys_Swimming/discussion/5d9cfe00f9ad13000cb6eb93) but he seems to either misunderstand or be unwilling to resolve the conflict.

Is it possible to address this in the Cargo Ships mod?

3 years ago

Should be way easier to fix it directly at the source! Just change the do_the_ripple function (lines 45-47 in Noxy's control.lua) to this:

local function do_the_ripple(player)
    if not player.vehicle then
        ripple_at_position(player.position, player.surface)
    end
end

(Not at a computer with Factorio right now, so I couldn't test this, but it should work.)

2 years ago
local function do_the_ripple(player)
    if not player.vehicle then
      ripple_at_position(player.position, player.surface)
  end
end

I tried this just now, and it did not have any effect on the boat speed. What I did figure, however, would be an easy work-around, if we were allowed to set the cargo ships speed modified to higher than 2. That way you could just multiply it up to whatever you want, after the swimming mod reduces it, right?

2 years ago
(updated 2 years ago)

I think you are right. The problem is in the water tile prototype, "vehicle_friction_modifier". There doesn't seem to be a way to change it for different vehicles based on the tile. Changing it on the boat entity will work, but if the deep and shallow speeds are different, the boat will speed up in shallow water (kind of the opposite of what you would expect).

2 years ago

If you have a chance to experiment with different speed bonuses on the boats, let me know what you think it should be.

2 years ago

This is gonna be a bit lengthy, but thanks for looking at this, since the Cargo Ships mod is super cool. I will try and come with a bunch of different input, so pick and choose as you see fit, I will happily help test out some stuff if you want.

You have a point regarding the shallow water, and making it differentiate there is gonna be a massive headache. The issue is, that Alien Biomes also adds additional shallow water variants, and those are NOT affected by Noxys Swimming mod at all, which means that the swimming mod only affects speeds on vanilla shallow and deep water, any other mod that adds additional water tiles, will not be modified by Noxys Swimming. To be fair, the Cargo Ships should not be able to sail across these added shallow water tiles, as they look like ankle deep water, as you can see the sand beneath. This does mean though, that if you set Noxys Swimming modifiers higher than defaults, then you speed up significantly when "swimming" in vanilla water, whereas sand, snow and shallow water from Alien Biomes will slow you down drastically.

To be fair, those tiles cannot be placed anyway, so it isn't a massive issue, and also something Noxys should address in their mod anyway - but thought I would mention it at least. Personally, I would be fine just setting both deep and shallow water swimming to the same modifier in Noxys swimming, as the slower speeds on deep water is a very game-y way of allowing cars to "swim", which is something you can toggle anyway, so that you can only swim in shallow water. For water based world gen however, you really want biters and yourself to be able to swim in deep water too tho.

I did some early game speed tests for vehicles driving on water, with Noxys swimming speed set to 1.0 for shallow and deep, and cargo ships with a modifier of 2
Tugboat does 31 km/h
Monowheel from IR2 does 48.9 km/h
vanilla car does 47.7

First off, I understand that tug boats are supposed to be slow, but from a game mechanic/progression side, it would be neat to have an early game water based vehicle that at least is comparable to that of land based vehicles, maybe one without an inventory, or a smaller one maybe?

For context, I am currently playing an Island World playthrough (https://mods.factorio.com/mod/islands_world), and the slow speed of the tug boat makes it a chore to use. I am also running Industrial Revolution 2, which allows for a monowheel as an early game alternative, and tug boats are now so far along the research tree, that I wont have any reason to use them once unlocked, due to how the movement speeds work out. Allowing the bugs to swim also means you have to protect all around the shoreline in the starting area, as they could come from anywhere across the sea. When that happens, it also means there is a lot of "swimming" required to get to the other side of the water, so you can take out alien bases and erect some defensive outposts. If I were restricted to using the tug boat at default Cargo Ships speed, then I would not have been able to keep up with the alien attacks, even when the Noxys Swimming modifiers are set to 1. There is simply so much traveling back and forth around your base defences and outer outposts, that you would never get anything done to progress your factory and research.

Going back to the swimming mod, I think the default modifier is about 0.45 for deep and 0.35 for shallow? I cannot quite remember. But assuming that, it would mean that for Cargo Ships, it would be nice to allow for at least ~5.0. That said, is there any reason not to allow a max modifier at around ~8, and then just let players fiddle with the numbers to their liking? I don't remember, but do the cargo ships benefit from stuff like braking speed modifiers for the trains?

At any rate, if land based vehicles end up being slowed down significantly in water, boats will obviously become more preferable. But having played on a map with a lot of water for a while now, I can say it would be annoying to play, if the tug boats, or some other early game vehicle, would not be as fast as a car.

I havn't gotten around to play with the cargo ships themselves yet, as IR2 prolongs the steam section of the game by a very long time. I am already seing large biters spawn in, even though I halved the evolution variables in the world settings, and I am just now getting electric assemblers, and the research done for stuff like trains and tug boats. Once I get further into it, I can make a better assesment on the actual cargo ships.

In summary, what I would do, is to just test what happens if you set the Cargo Ships modifier to ~8 without Noxys Swimming, and if nothing breaks, then it is up to the player to adjust it to their liking, but keep the Cargo Ships default settings as they are (since that is your envisioned use of your mod). If we can adjust the Cargo Ships setting all the way to 8, then those using Noxys Swimming, can fiddle around with the settings to their liking, until they are happy with it. I would personally just set the movement speed modifier of both deep and shallow water to the same (e.g. 0.45) in Noxys Swimming, and then adjust the Cargo Ships setting until I am happy with the tug boat speed, since it will probably act as a good reference to the speed of all the other ships.

Is there a way I can test the speeds at their extremes by editing the code locally? I havn't looked at it yet, but could be a way to test it, in case you don't want to push the change to the live version of the mod. Let me know :)

2 years ago

I think the best solution may actually be to set the boats [url=https://wiki.factorio.com/Prototype/Vehicle#terrain_friction_modifier]terrain_friction_modifier[/url] to 0. Then we can tune the speed of the boat and it won't be affected by the friction of the water tiles.

2 years ago

Makes sense, after all, there is no way to "improve" the speed over water tiles, like with concrete.

2 years ago

Adding the line indep_boat.terrain_friction_modifier = 0 at ships.lua line 318 did indeed make the boat go the same speed with and without Swimming installed. Might also go faster than they did previously in vanilla. Try it and see what you think.

2 years ago

I tested the change, using Swimming speed at 0.5 and Cargo Ships speed at 2.0

After accelerating for a long time, the tug boat capped out at 74 km/h - turning frequentyl makes the speed stay around a ~50km/h average, which is kinda what you want when there is this much water. Also noticed that the long acceleration also means a slow deceleration, which seems fine.

The vanilla car does 33.4 km/h in water, but also accelerates and decelerates instantly. On land, I can get it up to about 90 km/h, but it will drive faster if I had enough ground.

I should mention I have been using regular fuel from krastorio on both, so might be different from vanilla, but they are at least comparable to each other.

It will take a bit of playing to truly figure out how the Swimming mod will affect enemy difficulty, as they will be slowed down significantly, leaving more time for turrets to engage and eliminate them, if placed along the shoreline.

For increased compatibility when also using Industrial Revolution 2, though, an early game naval vehicle seems pretty important, else you will be stuck on your starting island until you have access to carbon steel, combustion engine and such, which has currently taken me ~33 hours to achieve. Since the boat will not run on coal, I also have to set up a fuel refinery and such before I can even use it, once research is done.

As I did mention though, I don't know how the speed modifier will affect defense against attacks, as that was the main reason for going away from your starting area/island. Industrial Revolution 2 makes it really easy to over-polute early on, meaning that large biters are already generating at an alarming rate, and I am still stuck with regular bullets for the turrets.

Speeds seem to my personal like at the moment, maybe the long winded acceleration for the tug boat is a bit much though, so having a vehicle with more control would be better for exploration. As I mentioned, some kind of earlier game naval vessel would be nice, but that is mostly because of Industrial revolution though, a collab could be super cool, as they already have an early game land based vehicle, the monowheel.

2 years ago

I just uploaded the simple fix for compatibility with Noxy's Swimming (0.1.14). The independent boat is no longer affected by tile friction (I did test the speeds before and after the change, and it has no other side effects). I also enlarged the setting ranges for speed and fuel consumption.

2 years ago

Awesome, just noticed the update. I have ships researched now, and can technically get fuel for them, so might give them a spin soon to see how well it all works with my setup :)

New response