Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    rom1504bot
    @rom1504bot
    <Ic3Tank> How does prismarine-physics work? I have a listener for bot.on physics that does something but it produces this output js builder:move pos (-944.53 256.00 1261.31) dist 0.808 velocity (0.00 -0.08 -0.10) +0ms builder:move Sprinting to next pos false +0ms builder:move pos (-944.53 256.00 1261.11) dist 0.611 velocity (0.00 -0.08 -0.11) +62ms builder:move Sprinting to next pos false +1ms builder:move pos (-944.53 256.00 1260.91) dist 0.406 velocity (0.00 -0.08 -0.11) +59msthis does not look like it is making sense? Why would the bot move further then the velocity it currently has? How is the velocity calculated when producing the next position? Because it does not seam like physics just add the current velocity to the current position to produce the next position.
    rom1504bot
    @rom1504bot
    <Frostify> making a bot to kill kill aura hackers
    rom1504bot
    @rom1504bot
    <natman99> by becoming a kill aura hacker
    <natman99> If you cant beat ‘em join ‘em
    rom1504bot
    @rom1504bot
    This message was deleted
    <Frostify> no
    rom1504bot
    @rom1504bot
    This message was deleted
    rom1504bot
    @rom1504bot
    <Ic3Tank> @U9G What is the proper way to get a ChatMessage instance from a MessageBuilder object in prismarine-chat? The toJSON function just returns an object according to the type definitions?
    rom1504bot
    @rom1504bot
    <U9G> out of curiousity why do you need a chatmessage instance
    <Ic3Tank> The set a motd on a server
    <U9G> can you not just use the .toJson()
    <Ic3Tank> And in typescript it complains that it is an object where it should be a ChatMessage
    <Ic3Tank> well in the index.d.ts toJSON() returns an object and not a ChatMessage. If toJSON() does indeed return a ChatMessage I would use that
    <U9G> it doesnt return a chatmessage, it indeed returns an object. that object is in the format that mcprotocol wants tho…
    <U9G> mcprotocol doesnt want a chatmessage object
    <Ic3Tank> It looks like MessageBuilder is missing a function to convert the output off toJSON to a ChatMessage instance?
    <U9G> its not
    <U9G> new ChatMessage(mb.toJson())
    <U9G> but you dont want that in this case…
    rom1504bot
    @rom1504bot
    <Ic3Tank> hm yeah I think you are right
    rom1504bot
    @rom1504bot
    <nea> what exactly is complaining
    rom1504bot
    @rom1504bot
    <Ic3Tank> It was just because I used the wrong thing when I made my script. I thought motd was a chatmessage instance but it's not
    rom1504bot
    @rom1504bot

    <olie> If you were still looking for an answer to this, the reason is that at the velocity when the physics event happens is not what is used for the position calculation. At that time (probably before the movement function but not 100% sure), drag and whatever else has been applied. The movement function takes in the previous velocity (with drag) and applies any forces from movement input, slipperiness, collisions, etc; I don't think the velocity used for the position calc is stored. You can see that if you are sprinting then there is a difference in the stored and calculated velocity but if there is no user input (or other forces) to accelerate the player, then the velocity stored is the same as what is used for the calc:
    Player Accelerating:

    STOR VEL: (0.0, -0.0784000015258789, 0.0)
    CALC VEL: (0.0, 0.0, -0.12740001240968724)
    STOR VEL: (-8.518694311707909E-18, -0.0784000015258789, -0.0695604148553142)
    MOVE VEL: (0.0, 0.0, -0.19696042726500143)
    STOR VEL: (-8.518694311707909E-18, -0.0784000015258789, -0.10754040577779149)
    MOVE VEL: (0.0, 0.0, -0.23494041818747874)
    STOR VEL: (-8.518694311707909E-18, -0.0784000015258789, -0.12827748323013013)

    Player Deaccelerating:

    STOR VEL: (-8.518694311707909E-18, -0.0784000015258789, -0.15321679421194379)
    MOVE VEL: (0.0, 0.0, -0.15321679421194379)
    STOR VEL: (0.0, -0.0784000015258789, -0.08365637935662959)
    MOVE VEL: (0.0, 0.0, -0.08365637935662959)
    STOR VEL: (0.0, -0.0784000015258789, -0.045676388434152296)
    MOVE VEL: (0.0, 0.0, -0.045676388434152296)
    STOR VEL: (0.0, -0.0784000015258789, -0.024939310981813654)
    <olie> hopefully that is helpful to anyone looking at the movement stuff, I got pretty confused looking through all that 😅
    rom1504bot
    @rom1504bot
    <Ic3Tank> Hm yeah that makes sence. For my case I ended up using mineflayer-pathfinders physics abstraction functions to simulate the player movement into the future given the current input. I wanted to know if the next tick in the bots movement would still be within a given range and if not snap the bot to the maximum allowed distance. The current approach works pretty good but sometimes has some weird stuff going on when the process is lagging a bit.
    <olie> Are you trying to solve issue where we have to manually set the velocity and position on a stop?
    <olie> also you should take a look at my PR in the physics repo if you haven't PrismarineJS/prismarine-physics#75
    <Ic3Tank> No I needed a system that works like sneaking to the edge off a Blick while keeping peak velocity. So I had to do some math to know when to force stop the bot to keep it from falling off a block while sprinting towards rhe block edge.
    rom1504bot
    @rom1504bot
    <Ic3Tank> It is cheating the physics system by resetting velocity but the server I am building this for does not care about velocity canceling
    <Ic3Tank> Is there an easily accessible 1.18 Java source we could compare these changes against? Also I want/need to looks at a few issues and pull request and I don't have lot off time so I might need a bit to review the change.
    <olie> I have a 1.18 development environment where I have breakpoints in the necessary places to log the velocity and position, then I have a similar thing in the physics engine for comparison. If you want I can throw a copy of the recordings in there, for just normal sprint jumping the values match exactly
    rom1504bot
    @rom1504bot
    <olie> done*
    rom1504bot
    @rom1504bot
    <Xare> Dude, frее subsсriрtion fоr 3 mоnths DISCОRD NITRО - https://cutt.ly/qXLSOav
    rom1504bot
    @rom1504bot
    <natman99> @U9G
    <U9G> 👍
    rom1504bot
    @rom1504bot
    <UᴡU> BRО
    FRЕЕ GIFТ DISСОRD NIТRO
    https://clck.ru/32GCpn
    rom1504bot
    @rom1504bot
    <natman99> @rom1504 ^^^
    rom1504bot
    @rom1504bot
    <rom1504> Done
    rom1504bot
    @rom1504bot
    <natman99> thanks
    <Rubin> 👍
    rom1504bot
    @rom1504bot
    <GamingFrazix> BRО
    FRЕЕ GIFТ DISСОRD NIТRO
    https://clck.ru/32GCpn
    rom1504bot
    @rom1504bot
    <FAPMASTERFLEXXX> everyone here Loot nitro - https://disoord.com/egiftpremium
    rom1504bot
    @rom1504bot
    <FAPMASTERFLEXXX> everyone here Loot nitro - https://disoord.com/egiftpremium
    rom1504bot
    @rom1504bot
    <FAPMASTERFLEXXX> everyone here Loot nitro - https://disoord.com/egiftpremium
    rom1504bot
    @rom1504bot
    This message was deleted
    rom1504bot
    @rom1504bot

    <Tanjiro_Nezuko> Free discord nitro full for 3 months, FOR ALL, from steam.
    In honor of the major, Steam is giving everyone a nitro discord for 3 months, you don't have to be a new user!

    Get it from the link -
    https://majorfreee-skins.ru/FREEGIFT43Jjksdf53
    https://discord.gg/AjwSshneVp 18+

    rom1504bot
    @rom1504bot
    <BRAVE SPIRIT_12> 👑﹒Are ​​you looking for a server to make new friends and play minecraft or to spend some of your free time? PixelCraft is for you.
    ────────────────────────────
    🔴﹒ Active server
    🟠﹒ Minecraft factions, crackshots
    🟡﹒ Polling Bot and Entertainment
    🟢﹒ Helpful and competent staff
    ────────────────────────────
    ﹒Join our server to meet new people!
    https://discord.gg/eKMvCPehxr
    rom1504bot
    @rom1504bot
    This message was deleted
    rom1504bot
    @rom1504bot
    <1gdgdccf> look what i found ;) enjoy
    https://discord.gg/liza-love
    everyone
    rom1504bot
    @rom1504bot
    <ItsCharzion> look what i found ;) enjoy
    https://discord.gg/liza-love
    everyone