Giant Elementals, A Crazy Idea that IS possible!

Discussion in 'WIP and Development Status' started by Splated, Apr 7, 2014.

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


  2. Offline


    I thought of 2 new problems, and a potential solutions.

    • Melee Attacking animations, my original plain was to have a target area about 5-10 blocks in front of the elemental. The problem is what if the target is above or below the hight of the foot?

    • If an elemental has a walking animation with 2 or more legs, and is walking up hill, the back legs will be flying off the ground, and the front will be trying to sink in the ground.
    A potential fix would be to plan the animations to go below the foot level, for example the elemental has both hands clasped together over its head and brings them slamming down ending the arc below its feet. if block explosions are off the blocks will get stuck on the ground, hopefully hitting the player target. feet would do the same thing plan the step animations to go past the ground.
    My other idea, more complex idea is to add "pitch shift" use the pitch angle of the target, or take measurement of ground angle and shift all the y measurements up or down accordingly. This would allow animations to punch a target at any hight, with in limits without needing to make animations for punch low,high, med.
  3. Offline


    Splated: Well... first of all: This is awesome!

    I also have a few "ideas": For the AI: You can add pre-build "patterns" to the AStar, e.g. jump over a hill.
    Using areas of Blocks (e.g. 5x5) in the Pathfinding AI should be faster for large distances and be more "realistic".

    And I run into a bug: If I modify a Giant, that is has more than 2 Blocktypes, it destroys itself, because the blockamount gets to high ;)
  4. Offline


    The "destroys itself" is a safe guard to prevent the block count from getting too high.
    Each golem part has 3 options for what to do with blocks,
    • Generate them: this is done by providing the name of the blocks on the "Material list".
    • Get them from a transfer: this is done with the "links" section.
    • Destroy them: if both the link and Material list are empty, the block is removed.
    If you have each part generating new blocks then you don't need the links.
    Post your config file ill take a look.
  5. Offline


    Splated: Well - One part had arround 1000 entities/FallingBlocks in its link section (For one part) ;)
    The general config file was the default one and I added GOLD_BLOCK to the RHAND and RBOW "lines"
  6. Offline


    Rhand should be the end where blocks are destroyed but now its making them so the hand keeps getting bigger until it hits max.

    try just adding GOLD_BLOCK to Rbow and leave Rhand at default see how that works.
    or remove the links on that hand see what happens.

    ill try to change it in next patch so that generator parts destroy the incoming.

    post your config so i can try on my server
  7. Offline


    Show Spoiler

    # See for details
    Name: Test Elemental

    MadeBy: ME_and_myself

    TurnSpeed: 10 # turn speed in degrees

    MoveSpeed: 1 # walk speed X2 for run

    MaxLife: 100 # max HP

    MaxScale: 2 # max size of the /cmd grow

    - Flying

    # PartName <> x, y, z <> shape:count:target <> Links <>Special Codes <> Material list
    - Foot <> 0.0, 0.0, 0.0 <> Ring:10 <> Torso <>Scale:2 <> DIRT
    - Torso <> 0.0, 5.0, 1.0 <> dot <> Back,RChest,LChest <>Spin:-0.1 <>
    - Back <> 0.0, 8.5, -1.0 <> ball:30 <> Head <> <>
    - Head <> 0.0, 10.0, 3.5 <> ball:30 <> <> <>
    - RChest <> -3.0, 9.0, 0.0 <> ball:40 <> Rbow <> <>
    - RBow <> -5.0, 5.0, -2.0 <> line:10:RChest <> RHand <> <> GOLD_BLOCK
    - RHand <> -5.0, 3.0, 2.0 <> line:10:RBow <> <> <>
    - LChest <> 3.0, 9.0, 0.0 <> ball:40 <> Lbow <> <> DIRT
    - LBow <> 5.0, 5.0, -2.0 <> line:10:LChest <> LHand <> <>
    - LHand <> 5.0, 3.0, 2.0 <> line:10:LBow <> <> <>





    - KeyFrame_20
    - RBow _ -5.0, 5.0, -2.0
    - RHand _ -5.0, 5.0, 5.0
    - KeyFrame_20
    - RBow _ -5.0, 9.0, 4.5
    - RHand _ -5.0, 9.0, 9.0
  8. Offline


    MisterErwin i tried a few different variations no problems on my end with the next version not sure why yours was getting killed.

    also i added Jump as a future ability.
  9. Offline


    Splated: Hmm... I'll have a further look...
    And jump sounds nice. Would you mind, if I try to add some A* pathfinding ;)
    I will send you my "results" then...
  10. Offline


    im not sure how you would try the pathfinders there just files in the package that don't ever get called yet.
  11. Offline


    Well, I don't even see any pathfinding packets/classes.
    But you could use Adamki11s' AStart lib and use the GoToSomePlace method to walk from Tile to Tile ;)
  12. Offline


    Splated and epicfacecreeper, I want some opinions on plugin integration/API stuff (anyone else can chime in if they want too)

    #1 - I'd like to integrate Magic with Essentials, so I can have direct-damage spells know about Elementals and be able to damage them. I'd be really cool if we could add a size modification method to the API (for my Shrink spell), but I wasn't sure if you can resize them on the fly?

    This is doable with the current Elementals API, but there's one missing piece. If I want to build against this plugin and keep my plugin easily buildable, we need a Maven repo. Otherwise anyone who wants to build Magic will also have to go find Elementals.. not a big deal I suppose, who's building my plugin besides me... but still.

    Would you guys be up for me adding Elementals to my elmakers Maven repo? It only exposes the class files, no source. I'd also like to add it to my CI server, but I have to make sure Jenkins hides the source from the workspace first.

    Anyway, this would mean a plugin dev only needs to add a dependency and repository to their pom file to integrate with the Elementals API, no classpath messing or jar downloading required.

    #2 - It'd be cool to have Elementals integrate with Magic, I was thinking of having it implement a spell to summon a different type of elemental, depending on what you're targeting (dirt, water, lava, etc). Each player could have one active at a time (still respecting the global server limit). This is secondary, though, you'd have to be OK with Elementals soft-depending on Magic and build-depending on MagicLib. (neither of which is a big deal, but I don't want to be pushy!)

    #1 + #2 brings up an interesting point though- what happens with two plugins soft-depend on each other? Is that possible?
  13. Offline


    If you want to set up a Maven repo go ahead just try to keep the source hidden if possible.
    I do want to make it easy as possible for other plugins to use this.

    1# You can resize on the fly look at /cmd grow we can add it to the API once i figure out how. :p

    2# I would prefer to keep the depends to as few as possible and possibly remove barAPI at some point.

    I think soft-depend and depend affect plugin load order so it may not be a good idea to depend on each other.

    If anyone thinks of something they want to do lets find a way to make it work in the API.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: Jun 7, 2016
  14. Offline


    got a new logo and i updated again

    Elementals B.1.4

    1. fixed bug with anmations getting inturpted with status changes
    2. fixed a bug with /cmd die on maxHP = 0 elementals.
    3. added SoThatsIt mob pathfind code
    4. added simple iron_golem AI
    5. added healing from elemental -> player / irongolem
    6. added new special code - AI:mobtype
    7. added stone.yml to test golem AI
    8. changed debug code
    NathanWolf likes this.
  15. Offline


    API Stuff

    If you want to hook into Elementals, it's now super easy- I've added it to the elmakers Maven repo, so as long as your plugin is Mavenized all you have to do is add a repository and a dependency. For detailed info, and API docs, see here:

    Splated, This also means people could download (unapproved, disclaimer, etc) builds of your plugin from the CI server. If you want, I can set you up with an account so you can trigger builds when you want. Otherwise it's not a big deal, I'll just keep it up to date as the API changes.

    I did make sure the workspace (and hence the code) is not visible to unauthorized users.

    Next step... Magic integration! I'll probably add size setting/getting methods to the API if that's easy, then I'll be off to my own plugin to implement damaging, summoning and shrinking Elementals with spells :)
  16. Offline


    NathanWolf I dub thee API coder. I'll leave all the API stuff to you. :D

    I'll try to do my plugin updates on fridays from now on.

    We can tweak the Golem_Constructor to handle strings from the API, so other plugins can build there own golems elementals without needing an yml file. or send it a yml file.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: Jun 7, 2016
    NathanWolf likes this.
  17. Offline


    That's a cool idea, we could also start heavily extending the API- like have "Golem" objects you can call methods to add parts to programatically. That gets a bit more complex though!

    I've added get/set Scale methods... testing integration with Magic now!
  18. Offline


    Can we just create an new GolemAPI object like you did for ElementalsAPI.
  19. Offline


    Yep, or, well, an interface. We can just call it "Golem" since the API has it's own namespace.

    So I got Magic hooked up! It gives me a few more spells I can use to fight Elementals, including Shrink, which is really cool.

    I played around a bit with the EntityDamageByEntityEvent, hoping I could make them react to TNT or player damage, but I had no luck. Sadly that event doesn't seem to fire for falling blocks in a useful way. It does register falling block vs falling block collisions, which is interesting, but caused some havoc on my initial experiments.

    Bummer, though. I've had a lot of luck capturing explosion damage that way, I was hoping it's work out.
  20. Offline


    I had an idea about causing "block damage" if we can just remove them from the part lists it will simply fall like a normal block again. So if you can get a list Entity affected by your magic blast and tell the golem part to remove the affected blocks maybe add some velocity.

    It would look really cool if you have 2 players in golem suits knocking each others blocks off.

    rock'em sock'em gol'ems
  21. Offline


    I love that idea! Do golems reduce their block count as they are damaged?
  22. Offline


    Original plan was to replace damage blocks with item stacks of 64 of the same material they just look smaller problem is the draw distance for dropped items is much shorter then falling blocks.

    also you can light item stacks on fire for fire damage.

    I'll restore the damage item block code for the first friday update.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: Jun 7, 2016
  23. Offline


    Cool! Lemme know when next update is, please, it'd be nice to have a non-snapshot build in the repo to build against.

    For the "knocking away blocks" idea I was thinking it would reduce the overall block count by 1, and then send the block flying off away from the player. We could do this anytime a player damages the golem (it'd work from the API, then). If there is no player reference, maybe we just drop the block straight down?
  24. Offline



    all done :p

    how do i tell subversion its a version?

    Remember the golem is constantly replacing its blocks to keep its shape removing one will be replaced in 5 ticks.

    However we can send a "blood" spurt away from the impact as a visual effect like 1 block per damage.

    So like a bomb blast of 100 damage sends 100 blocks out the golems back. we should have a damage source, the player, primed tnt, wither skull, etc so we can send them the opposite direction.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: Jun 7, 2016
  25. Offline


    I anticipated that in the API, when damaging you have to provide an attacker. Well it's optional.

    I was thinking it'd be cool to actually take a block away, like thin it out a bit as it's damaged- or is that too tricky?

    Oh, the version goes in pom.xml, make it like 0.1 (no -SNAPSHOT) for a real release.

    Forgive the late tag, but it now has 100% more Maven if you're interested in playing around.... :)

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: Jun 7, 2016
  26. Offline


    Did you see the image posted thats a golem at 10% of life 90% of the blocks created are item stacks.

    it looks sickly
    NathanWolf likes this.
  27. Offline


    Very interesting stuff, guys! At first I thought "Ugh, another stupid nms hack", but looking through the source code (which could definitely do with some cleanup, no offense), it looks like it's pure Bukkit. I didn't know you could spawn falling blocks of any block type, let alone affect its velocity vector.

    I've had an idea of "block bosses" for MobArena for a long time, but the only way I could think of doing it was by building some sort of model (with blocks) in various poses and then doing manual keyframe animation with automatic in-betweening. This is a much neater idea!

    I played around with trying to freeze a falling block in mid-air by applying a constant anti-gravity vector to it, until I gave up (I could never keep blocks perfectly still and they would eventually drop or fly upwards) and found the actual constants applied in the server source code (doh). Now I'm able to freeze blocks in the air, but they still "fall" on the client side, and then snap back up to their actual position (probably due to a dead reckoning approach on the client for smoother animations). It looks like the same thing is happening for you, but it's not as noticeable because of the amount of blocks.

    Now, performance. Have you done any profiling on this to see how rough it is for the server to keep these things alive? Have you tried spawning in more and more at a time to see how many you can keep going until performance starts to stagger?
  28. Offline


    How did you view the code? We are trying to keep it hidden.

    The blocks are really just getting a nudge to keep them where I want them. The current dirt golems are running about 600-700 blocks, and i think that can be reduced. The server seems to handle 3-4 with no problem. however the clients seem to have problems with all the blocks rendering on the screen.

    I have only tested on a localhost server so I'm not sure lag wise how it reacts.
  29. Offline


    If you want to try making the blocks smoother or more stable, you can use the constants applied to the y-coordinate in this method (lines 71 and 74 at the time of writing). Then you can apply whichever movement vector you want afterwards, and it should give you more "correct" movement (on the server side anyway, the client side might still exhibit the snapping).

    I'm going to try and see if I can make the classic atom model with the cental necleus and the orbiting electrons :3
  30. Offline


Thread Status:
Not open for further replies.

Share This Page