Jump to content

Issues with Pathfinding Underwater


redw0lf

Recommended Posts

Hi there,

 

I'm currently fiddling a little bit with Minecraft modding, currently I'm working on some kind of a hostile squid. For this purpose I created the according classes (render entity ...) and coppied most of the behaviour from the Zombies AI.

 

The AI is modified in the way, that the Swimming behaviour is disabled, hence the mob sinks down to the ocean floor. On the floor it behaves exactly like a zombie, i.e. it tracks the player and moves towards the player and attacks when the player is within reach.

Now there comes the problem with the pathfinding: The mob doesn't recognize the water block as a sufficient block to kind of "walk" onto, hence it isn't used for pathfinding.

This problem can be come over while activating the swimming behaviour (which kinds of lets the mob jump to swim up). The problem with this solution nonetheless is, that the behaviour gets called to often and therefore somehow messes up the EntityAIAttackOnCollide behaviour which tracks the mob towards the player (but not on the y axxis.). What basically happens is that the swim behaviour is called to often and the mob swims to the water surface. In addition the mob cannot pathfind (because it has no solid ground beneath).

 

 

Another way to correct the pathfinding would also be to fizzle with the navigator. But when settings either canSwim or avoidsWater to the opposite of the default value the pathfinding is also messed up. With this option i'm guessing it consumes to much time to actually find one of the bests times and hence stops pathfinding (or something like this).

 

What I'm asking for is, if someone has found or is using a good way for mobs to pathfind under water? I'm out of guessing.

Hopefully someone will be able to help

Link to comment
Share on other sites

The basic problem is mainly that the water block is not recognized as a pathable block. Hence the pathfinding does not work. So the basic question would be: How do I change the Water Block/pathfinding algorithms in such a way that the water block is pathable.

Link to comment
Share on other sites

You'd probably have to write your own pathfinder and AI task class.

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

I was thinking you could perhaps look into the squid and see how it moves around, I guess it just moves at random but at least any water filled block is a valid pathing target :P

 

Squid pathfinding is "go down, that's it, down, yess....downwardssss...."

AFAIK it doesn't actually care if there's water there or not, it just tries to sink.

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

I'm not at my PC atm so I can't check but is it the same shit with bats?

Because if it isn't then that could give a clue on how to do it.

 

Edit:

The way we did sharks in the mod I'm working on now was simply by inheriting from

net.minecraft.entity.passive.EntityWaterMob;

and then writing our own attack logic into the update method.

If you guys dont get it.. then well ya.. try harder...

Link to comment
Share on other sites

I'm not at my PC atm so I can't check but is it the same shit with bats?

Because if it isn't then that could give a clue on how to do it.

 

Edit:

The way we did sharks in the mod I'm working on now was simply by inheriting from

net.minecraft.entity.passive.EntityWaterMob;

and then writing our own attack logic into the update method.

 

That sounds really interesting. I'll try to look into this one. (And: The basic squid movement it more or less random movement and tentacle swinging). But don't you have problems with this when you try to add other AI Tasks e.g. the Zombie swarming or so (this may be really interesting for sharks)

 

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



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • [13abr.2024 23:04:08.876] [main/INFO] [cpw.mods.modlauncher.Launcher/MODLAUNCHER]: ModLauncher running: args [--username, thehappiestdeus, --version, 1.20.1-forge-47.2.23, --gameDir, C:\Users\********\AppData\Roaming\.minecraft, --assetsDir, C:\Users\********\AppData\Roaming\.minecraft\assets, --assetIndex, 5, --uuid, 6947100bd693327a9d73af48e609bc8e, --accessToken, ????????, --clientId, 0, --xuid, 0, --userType, msa, --versionType, release, --width, 854, --height, 480, --launchTarget, forgeclient, --fml.forgeVersion, 47.2.23, --fml.mcVersion, 1.20.1, --fml.forgeGroup, net.minecraftforge, --fml.mcpVersion, 20230612.114412] [13abr.2024 23:04:08.900] [main/INFO] [cpw.mods.modlauncher.Launcher/MODLAUNCHER]: ModLauncher 10.0.9 10.0.9 main.dcd20f30 starting: java version 17.0.8 by Microsoft; OS Windows 11 arch amd64 version 10.0 [13abr.2024 23:04:12.324] [main/INFO] [net.minecraftforge.fml.loading.ImmediateWindowHandler/]: Loading ImmediateWindowProvider fmlearlywindow [13abr.2024 23:04:12.626] [main/INFO] [EARLYDISPLAY/]: Trying GL version 4.6 [13abr.2024 23:04:15.807] [main/INFO] [EARLYDISPLAY/]: Requested GL version 4.6 got version 4.6 [13abr.2024 23:04:16.706] [pool-4-thread-1/INFO] [EARLYDISPLAY/]: GL info: NVIDIA GeForce GTX 1050/PCIe/SSE2 GL version 4.6.0 NVIDIA 551.61, NVIDIA Corporation [13abr.2024 23:04:18.403] [main/WARN] [gg.essential.loader.stage1.EssentialLoaderBase/]: Found newer Essential Loader (stage2) version 1.6.0 [stable], skipping at user request [13abr.2024 23:04:18.405] [main/INFO] [gg.essential.loader.stage1.EssentialLoaderBase/]: Starting Essential Loader (stage2) version 1.4.1 (4b3b87be87d34916028dffa85460d085) [stable] [13abr.2024 23:04:18.631] [main/INFO] [mixin/]: SpongePowered MIXIN Subsystem Version=0.8.5 Source=union:/C:/Users/********/AppData/Roaming/.minecraft/libraries/org/spongepowered/mixin/0.8.5/mixin-0.8.5.jar#100!/ Service=ModLauncher Env=CLIENT [13abr.2024 23:04:18.982] [main/WARN] [gg.essential.loader.stage2.EssentialLoaderBase/]: Found newer Essential version 1.3.1.3 [stable], skipping at user request [13abr.2024 23:04:20.965] [main/WARN] [net.minecraftforge.fml.loading.moddiscovery.ModFileParser/LOADING]: Mod file C:\Users\********\AppData\Roaming\.minecraft\libraries\net\minecraftforge\fmlcore\1.20.1-47.2.23\fmlcore-1.20.1-47.2.23.jar is missing mods.toml file [13abr.2024 23:04:20.974] [main/WARN] [net.minecraftforge.fml.loading.moddiscovery.ModFileParser/LOADING]: Mod file C:\Users\********\AppData\Roaming\.minecraft\libraries\net\minecraftforge\javafmllanguage\1.20.1-47.2.23\javafmllanguage-1.20.1-47.2.23.jar is missing mods.toml file [13abr.2024 23:04:20.981] [main/WARN] [net.minecraftforge.fml.loading.moddiscovery.ModFileParser/LOADING]: Mod file C:\Users\********\AppData\Roaming\.minecraft\libraries\net\minecraftforge\lowcodelanguage\1.20.1-47.2.23\lowcodelanguage-1.20.1-47.2.23.jar is missing mods.toml file [13abr.2024 23:04:20.991] [main/WARN] [net.minecraftforge.fml.loading.moddiscovery.ModFileParser/LOADING]: Mod file C:\Users\********\AppData\Roaming\.minecraft\libraries\net\minecraftforge\mclanguage\1.20.1-47.2.23\mclanguage-1.20.1-47.2.23.jar is missing mods.toml file [13abr.2024 23:04:22.047] [main/WARN] [net.minecraftforge.jarjar.selection.JarSelector/]: Attempted to select two dependency jars from JarJar which have the same identification: Mod File: and Mod File: . Using Mod File: [13abr.2024 23:04:22.056] [main/WARN] [net.minecraftforge.jarjar.selection.JarSelector/]: Attempted to select a dependency jar for JarJar which was passed in as source: curios. Using Mod File: C:\Users\********\AppData\Roaming\.minecraft\mods\curios-forge-5.7.2 1.20.1.jar [13abr.2024 23:04:22.056] [main/WARN] [net.minecraftforge.jarjar.selection.JarSelector/]: Attempted to select a dependency jar for JarJar which was passed in as source: resourcefullib. Using Mod File: C:\Users\********\AppData\Roaming\.minecraft\mods\resourcefullib-forge-1.20.1-2.1.24.jar [13abr.2024 23:04:22.058] [main/INFO] [net.minecraftforge.fml.loading.moddiscovery.JarInJarDependencyLocator/]: Found 22 dependencies adding them to mods collection [13abr.2024 23:04:31.937] [main/INFO] [mixin/]: Compatibility level set to JAVA_17 [13abr.2024 23:04:31.989] [main/ERROR] [mixin/]: Mixin config firstperson.mixins.json does not specify "minVersion" property [13abr.2024 23:04:32.169] [main/ERROR] [mixin/]: Mixin config entity_model_features.mixins.json does not specify "minVersion" property [13abr.2024 23:04:33.081] [main/INFO] [mixin/]: Successfully loaded Mixin Connector [com.sonicether.soundphysics.MixinConnector] [13abr.2024 23:04:33.089] [main/INFO] [cpw.mods.modlauncher.LaunchServiceHandler/MODLAUNCHER]: Launching target 'forgeclient' with arguments [--version, 1.20.1-forge-47.2.23, --gameDir, C:\Users\********\AppData\Roaming\.minecraft, --assetsDir, C:\Users\********\AppData\Roaming\.minecraft\assets, --uuid, 6947100bd693327a9d73af48e609bc8e, --username, thehappiestdeus, --assetIndex, 5, --accessToken, ????????, --clientId, 0, --xuid, 0, --userType, msa, --versionType, release, --width, 854, --height, 480] [13abr.2024 23:04:33.497] [main/INFO] [ModernFix/]: Loaded configuration file for ModernFix 5.15.0 mc1.20.1: 77 options available, 0 override(s) found [13abr.2024 23:04:33.500] [main/INFO] [ModernFix/]: Applying Nashorn fix [13abr.2024 23:04:33.544] [main/INFO] [ModernFix/]: Applied Forge config corruption patch [13abr.2024 23:04:33.869] [main/INFO] [Embeddium/]: Loaded configuration file for Embeddium: 172 options available, 3 override(s) found [13abr.2024 23:04:33.873] [main/INFO] [Embeddium-GraphicsAdapterProbe/]: Searching for graphics cards... [13abr.2024 23:04:34.631] [main/INFO] [Embeddium-GraphicsAdapterProbe/]: Found graphics card: GraphicsAdapterInfo[vendor=NVIDIA, name=NVIDIA GeForce GTX 1050, version=DriverVersion=31.0.15.5161] [13abr.2024 23:04:34.632] [main/INFO] [Embeddium-GraphicsAdapterProbe/]: Found graphics card: GraphicsAdapterInfo[vendor=INTEL, name=Intel(R) UHD Graphics 630, version=DriverVersion=31.0.101.2111] [13abr.2024 23:04:34.644] [main/WARN] [Embeddium-Workarounds/]: Sodium has applied one or more workarounds to prevent crashes or other issues on your system: [NVIDIA_THREADED_OPTIMIZATIONS] [13abr.2024 23:04:34.645] [main/WARN] [Embeddium-Workarounds/]: This is not necessarily an issue, but it may result in certain features or optimizations being disabled. You can sometimes fix these issues by upgrading your graphics driver. [13abr.2024 23:04:34.668] [main/WARN] [mixin/]: Reference map 'entity_model_features_forge_1.20.1-forge-refmap.json' for entity_model_features.mixins.json could not be read. If this is a development environment you can ignore this message [13abr.2024 23:04:34.868] [main/WARN] [mixin/]: Reference map 'yungsextras.refmap.json' for yungsextras.mixins.json could not be read. If this is a development environment you can ignore this message [13abr.2024 23:04:34.879] [main/WARN] [mixin/]: Reference map 'yungsextras.refmap.json' for yungsextras_forge.mixins.json could not be read. If this is a development environment you can ignore this message [13abr.2024 23:04:35.002] [main/WARN] [mixin/]: Reference map 'nitrogen_internals.refmap.json' for nitrogen_internals.mixins.json could not be read. If this is a development environment you can ignore this message [13abr.2024 23:04:35.135] [main/INFO] [Radium Config/]: Loaded configuration file for Radium: 125 options available, 1 override(s) found [13abr.2024 23:04:35.152] [main/WARN] [mixin/]: Reference map 'trashslot.refmap.json' for trashslot.mixins.json could not be read. If this is a development environment you can ignore this message [13abr.2024 23:04:35.360] [main/WARN] [mixin/]: Reference map '${refmap_target}refmap.json' for corgilib.forge.mixins.json could not be read. If this is a development environment you can ignore this message [13abr.2024 23:04:35.404] [main/WARN] [mixin/]: Reference map 'coroutil.refmap.json' for coroutil.mixins.json could not be read. If this is a development environment you can ignore this message [13abr.2024 23:04:35.599] [main/WARN] [mixin/]: Reference map 'chiselsandbits.refmap.json' for chisels-and-bits.mixins.json could not be read. If this is a development environment you can ignore this message [13abr.2024 23:04:35.634] [main/WARN] [mixin/]: Reference map 'cristellib-forge-refmap.json' for cristellib.mixins.json could not be read. If this is a development environment you can ignore this message [13abr.2024 23:04:35.822] [main/INFO] [Essential Logger - Plugin/]: Starting Essential v1.3.1.1 (#3a090c5c88) [stable] [13abr.2024 23:04:40.482] [main/WARN] [mixin/]: Error loading class: dev/tr7zw/skinlayers/render/CustomizableModelPart (java.lang.ClassNotFoundException: dev.tr7zw.skinlayers.render.CustomizableModelPart) [13abr.2024 23:04:42.465] [main/WARN] [Radium Config/]: Force-disabling mixin 'alloc.blockstate.StateMixin' as option 'mixin.alloc.blockstate' (added by mods [ferritecore]) disables it and children [13abr.2024 23:04:43.118] [main/WARN] [mixin/]: Error loading class: vectorwing/farmersdelight/client/renderer/HangingCanvasSignRenderer (java.lang.ClassNotFoundException: vectorwing.farmersdelight.client.renderer.HangingCanvasSignRenderer) [13abr.2024 23:04:43.129] [main/WARN] [mixin/]: Error loading class: vectorwing/farmersdelight/client/renderer/CanvasSignRenderer (java.lang.ClassNotFoundException: vectorwing.farmersdelight.client.renderer.CanvasSignRenderer) [13abr.2024 23:04:45.276] [main/WARN] [Embeddium/]: Force-disabling mixin 'features.render.world.sky.WorldRendererMixin' as rule 'mixin.features.render.world.sky' (added by mods [oculus]) disables it and children [13abr.2024 23:04:45.277] [main/WARN] [Embeddium/]: Force-disabling mixin 'features.render.world.sky.ClientWorldMixin' as rule 'mixin.features.render.world.sky' (added by mods [oculus]) disables it and children [13abr.2024 23:04:45.278] [main/WARN] [Embeddium/]: Force-disabling mixin 'features.render.world.sky.BackgroundRendererMixin' as rule 'mixin.features.render.world.sky' (added by mods [oculus]) disables it and children [13abr.2024 23:04:45.285] [main/WARN] [Embeddium/]: Force-disabling mixin 'features.render.gui.font.GlyphRendererMixin' as rule 'mixin.features.render.gui.font' (added by mods [oculus]) disables it and children [13abr.2024 23:04:45.285] [main/WARN] [Embeddium/]: Force-disabling mixin 'features.render.gui.font.FontSetMixin' as rule 'mixin.features.render.gui.font' (added by mods [oculus]) disables it and children [13abr.2024 23:04:45.286] [main/WARN] [Embeddium/]: Force-disabling mixin 'features.render.entity.shadows.EntityRenderDispatcherMixin' as rule 'mixin.features.render.entity' (added by mods [oculus]) disables it and children [13abr.2024 23:04:45.286] [main/WARN] [Embeddium/]: Force-disabling mixin 'features.render.entity.fast_render.ModelPartMixin' as rule 'mixin.features.render.entity' (added by mods [oculus]) disables it and children [13abr.2024 23:04:45.288] [main/WARN] [Embeddium/]: Force-disabling mixin 'features.render.entity.fast_render.CuboidMixin' as rule 'mixin.features.render.entity' (added by mods [oculus]) disables it and children [13abr.2024 23:04:45.291] [main/WARN] [Embeddium/]: Force-disabling mixin 'features.render.entity.cull.EntityRendererMixin' as rule 'mixin.features.render.entity' (added by mods [oculus]) disables it and children [13abr.2024 23:04:46.387] [main/INFO] [MixinExtras|Service/]: Initializing MixinExtras via com.llamalad7.mixinextras.service.MixinExtrasServiceImpl(version=0.3.5). [13abr.2024 23:04:51.658] [pool-6-thread-1/INFO] [net.minecraft.server.Bootstrap/]: ModernFix reached bootstrap stage (53.35 s after launch) [13abr.2024 23:04:52.021] [pool-6-thread-1/WARN] [mixin/]: @Final field delegatesByName:Ljava/util/Map; in modernfix-forge.mixins.json:perf.forge_registry_alloc.ForgeRegistryMixin should be final [13abr.2024 23:04:52.023] [pool-6-thread-1/WARN] [mixin/]: @Final field delegatesByValue:Ljava/util/Map; in modernfix-forge.mixins.json:perf.forge_registry_alloc.ForgeRegistryMixin should be final [13abr.2024 23:04:52.518] [pool-6-thread-1/INFO] [ModernFix/]: Injecting BlockStateBase cache population hook into getNeighborPathNodeType from me.jellysquid.mods.lithium.mixin.ai.pathing.AbstractBlockStateMixin [13abr.2024 23:04:52.519] [pool-6-thread-1/INFO] [ModernFix/]: Injecting BlockStateBase cache population hook into getPathNodeType from me.jellysquid.mods.lithium.mixin.ai.pathing.AbstractBlockStateMixin [13abr.2024 23:04:52.520] [pool-6-thread-1/INFO] [ModernFix/]: Injecting BlockStateBase cache population hook into getAllFlags from me.jellysquid.mods.lithium.mixin.util.block_tracking.AbstractBlockStateMixin [13abr.2024 23:04:57.799] [pool-6-thread-1/INFO] [net.minecraft.server.Bootstrap/]: Vanilla bootstrap took 6125 milliseconds  
    • k i opened rit and luanched. no matter what launcher i use, it always says 2 mods loaded, but it has 0 mdos loaded. i tried several times with multiMC
    • i downloaded it. what do i do next? how do i open the luancher
    • It happened suddenly to me and a friend and we don't know how to fix it Blocks like the lava, the "UGH" sound, the door sound, etc.
  • Topics

×
×
  • Create New...

Important Information

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