Dismiss Notice
Wynncraft, the Minecraft MMORPG. Play it now on your Minecraft client at (IP): play.wynncraft.com. No mods required! Click here for more info...

Tool Aledar's Cart Plugin

Discussion in 'Your Work' started by appleptr16, Apr 25, 2021.

Thread Status:
Not open for further replies.
  1. appleptr16

    appleptr16 Well-Known Adventurer CHAMPION

    Messages:
    63
    Likes Received:
    57
    Trophy Points:
    49
    Minecraft:
    [​IMG]

    I made Aledar's cart, except it doesn't separate into smaller pieces on occasion

    [​IMG]
    Watch this epic trailer made by fox!
    youtube.com/watch?v=XU5xmtzZtUY

    Watch this one made by me if you want. It's less cool..
    youtube.com/watch?v=3m3nStwS9OQ
    • It actually only took three and a half hours to make Aledar's cart (modeling and coding) with all the infrastructure and tools set in place.

    • I actually even make a "misc" mob with a model with the file-name defined in the spawn command. So technically, you dont even have to code anything to make a custom model if all you want is a generic zombie AI with the custom model.

    • It's surprisingly not laggy at all. To test this, we spawned 150+ custom mobs with 10ish armor stands each within a few chunks. The server (hosted on a personal computer) still had 20.0 tps without any struggle at all with 1800 entities. The only reason we stopped spawning more was because the client was struggling really bad. The client struggles much quicker than the server. That's a perfectly acceptable situation though unless you wanted to completely horde the player with a ton of custom models (80+ custom models).
    There's more images in the album link!
    https://imgur.com/a/PDqHLcU
    [​IMG]
    [​IMG]
    [​IMG]
    [​IMG]
    [​IMG]
    [​IMG]
    This section is mainly for nerds who understand Minecraft plugins and some NMS.
    • Concern: You might think that teleporting the armor stands that make up the custom models would be super laggy.
    • Response: It would definitely be laggy if everything was done through teleporting entities every tick rather than overriding movement of the main mob and the sub-mobs. It's surprisingly not laggy at all. To test this, we spawned 150+ custom mobs with 10ish armor stands each within a few chunks. The server (hosted on a personal computer) still had 20.0 tps without any struggle at all with 1800 entities. The only reason we stopped spawning more was because the client was struggling really bad. The client struggles much quicker than the server. That's a perfectly acceptable situation though unless you wanted to completely horde the player with a ton of custom models (80+ custom models).
    • Concern: It takes too long to make custom models with plugins and then turn those models into mobs.
    • Response: It would take too long if I didn't make a tool to save custom models that were created (probably with command blocks) into a .yml file and then use that .yml file to load the schematic for a custom mob. It actually only took three and a half hours to make Aledar's cart (modeling and coding) because of all the infrastructure and tools that I set in place. I actually even make a "misc" mob with a model with the file-name defined in the spawn command. So technically, you don't even have to code anything to make a custom model if all you want is a generic zombie AI with the custom model.

    • Concern: You might be concerned that my solution doesn't scale easily. (Meaning with more players and custom models, everything would become out of sync a lot more often)
    • Response: Because of how I group packets to send and queue all the prepared packets at the same time with a high priority Thread that only queues packets, it's actually much less likely that entity move packets are sent with other packets in the middle.
    • Concern: You might still be concerned about the lack of scalability because of the child-entities always looking for where the parent-entity is and relocating based on that which could become laggy.
    • Response: I actually don't do that. The movementTick and move methods for the child-entities are literally empty which means that the child-entities literally check where the parent is ever. This reduces lag so much. I can get away with this because when the parent moves, I simply tell the children to move as well. It keeps everything in sync much better.
    • Concern: But math! Rotating an armor stand that has a rotation of theta degrees rotates differently than an armor stand that has a rotation of 0 degrees!
    • Response: These rotations can 100% be understood and programmed. Armor stands are definitely hard to rotate perfectly, but it's completely doable. I'm going to be vague because a full answer would take too long. My solution for this particular problem was to decompose the facing direction into two points before rotating, then rotate by rotation+facingYaw, then reassemble the points into a newFacing vector.
    • Concern: Wouldn't armor stands that aren't actually the main mob block hits to the actual mob?
    • Response: This is a super simple solution. You just have to redirect all damage (besides suffocation) to the parent-mob.
    Conclusion:
    I used NMS and packets to make custom mobs with custom models super simple easy and fast without sacrificing performance or aesthetics or customizability.

    Let me know of any cool ideas you have for custom models! Ima definitely be using them a lot more ^-^
    My discord is appleptr16#5054 if you wanna talk about this!

    Credits:
    - @Fox
    made the more epic video and took the better pictures of Aledar.
    - @i_am_me made the custom model for the parasite/bug and a custom model for the turret that rotates and was the first proof of concept of turning entities into mobs.
    - @Keldo127 made the custom model for the eye plant.
    - @MeowCatPanda made the custom model for the cube shields mob
    - @appleptr16 did some stuff, I guess.
     
  2. thepicferret

    thepicferret Chief of Avicia, Send help wynncraft addicted HERO

    Messages:
    856
    Likes Received:
    1,555
    Trophy Points:
    148
    Guild:
    Minecraft:
    he drifts
    really nice to see it stay connected for longer wished it was as smooth on wynn so aledar cart's glory could be shown at it's finest
     
    starx280, appleptr16 and Fox like this.
  3. EvanOrizam

    EvanOrizam Just your average Fruman supersoldier. VIP+

    Messages:
    391
    Likes Received:
    937
    Trophy Points:
    91
    Guild:
    Minecraft:
    I am a simple guy. When i read "aledar cart", I clicked.
     
  4. appleptr16

    appleptr16 Well-Known Adventurer CHAMPION

    Messages:
    63
    Likes Received:
    57
    Trophy Points:
    49
    Minecraft:
    By the way, this is just the start of my NMS and custom model making. I'm enjoying creating custom mobs with custom models way too much right now. I'm actually making parasites that spawn in the nether and make their way to the overworld and infect passive mobs. I made the AI for it wanting to go from the nether to the overworld and then change it's AI once it's in the overworld. Of course turning the model into a mob was the easiest part ;D

    Also, if anyone wants to make custom models or learn how to make custom models, I'm down to work together for a project.
     
    starx280 and thepicferret like this.
  5. BTK2000

    BTK2000 helo im btk CHAMPION

    Messages:
    469
    Likes Received:
    2,216
    Trophy Points:
    91
    Minecraft:
    MOLEMOLEMOLE

    Good job apple :)
     
Thread Status:
Not open for further replies.