Outdoor swimming

Discuss coding questions, pull requests, and implementation details.
User avatar
Interkarma
Posts: 7236
Joined: Sun Mar 22, 2015 1:51 am

Re: Outdoor swimming

Post by Interkarma »

There's no console command for raising skills (probably not a bad idea), but you could edit the "savedata.txt" file and change the swimming skill to 100. It's just a plain text JSON file and should be easy to find the value.

User avatar
MeteoricDragon
Posts: 141
Joined: Mon Feb 12, 2018 8:23 pm

Re: Outdoor swimming

Post by MeteoricDragon »

Is there a convenient way to have an EnemyTileMapIndex to prevent enemies from swimming in water? Or determine if the enemy moving forward would put it in a water tile? This seems pretty complex.

User avatar
Interkarma
Posts: 7236
Joined: Sun Mar 22, 2015 1:51 am

Re: Outdoor swimming

Post by Interkarma »

It's definitely possible, I'd just have to make this super-efficient. It would be fairly trivial in cities as they have a navgrid for this purpose. The wilderness needs full terrain checks like player however as enemies can spawn anywhere the player can be.

Out of curiosity, how does DF handle enemies and outdoor water? I haven't tested this and don't have any trusted memories of the behaviour.

User avatar
Jay_H
Posts: 4061
Joined: Tue Aug 25, 2015 1:54 am
Contact:

Re: Outdoor swimming

Post by Jay_H »

Enemies in classic simply don't submerge outdoors. They all walk on outdoor water.

User avatar
MeteoricDragon
Posts: 141
Joined: Mon Feb 12, 2018 8:23 pm

Re: Outdoor swimming

Post by MeteoricDragon »

Jay_H wrote: Sat Jul 07, 2018 5:15 am Enemies in classic simply don't submerge outdoors. They all walk on outdoor water.
That feels like a developer oversight.
We could have enemies sink down and move at swim speed like the player?

User avatar
Nystul
Posts: 1501
Joined: Mon Mar 23, 2015 8:31 am

Re: Outdoor swimming

Post by Nystul »


User avatar
Jay_H
Posts: 4061
Joined: Tue Aug 25, 2015 1:54 am
Contact:

Re: Outdoor swimming

Post by Jay_H »

Wow. Dang, that's something entirely new to me. I suppose that's because they're stationary, which never happened to me in classic. Thanks Nystul.

User avatar
Interkarma
Posts: 7236
Joined: Sun Mar 22, 2015 1:51 am

Re: Outdoor swimming

Post by Interkarma »

Thank you guys! I'll work in the ability for enemy motor to detect if they're on a water tile so that swimming can be built into their AI at some point.
Nystul wrote: Sat Jul 07, 2018 5:30 pm guards submerge...
https://www.youtube.com/watch?v=0Agh6-bgVsY
This is hilarious. :D Something I must do is try to kite some guards down to open water outside of a town to see if they do the same outside of location.

User avatar
MeteoricDragon
Posts: 141
Joined: Mon Feb 12, 2018 8:23 pm

Re: Outdoor swimming

Post by MeteoricDragon »

There's a rare bug that I can't seem to get rid of easily. It happens when you are in outside water, and load a game where the save has you crouched. The bug makes you standing instead of crouched when you load the game because the height changing action taken whenever the controller is removed from water tile is to stand up from the water. I can tell it to crouch, but then it goes to stand up from the water anyway after that.

User avatar
Interkarma
Posts: 7236
Joined: Sun Mar 22, 2015 1:51 am

Re: Outdoor swimming

Post by Interkarma »

Interesting - I'm not sure on this one. The crouch status is being restored as part of loading a game. Perhaps the height changer needs to capture the onload event and update internal state based on the crouch state applied by the load process? Or possibly just clear some internal state when loading a game so everything is cleansed for the new character just loaded.

Post Reply