Modding Help What .monstertype parameter determines the monster's hittable area?

Discussion in 'Starbound Modding' started by DraikNova, Apr 3, 2018.

  1. DraikNova

    DraikNova Spaceman Spiff

    I have looked through .monstertype files, and have been trying to use /spawnmonster to find which of the various poly or poly-like parameters determines the area that the player can hit to damage a monster. I have found three, and none of them seem to have anything to do with this area: metaBoundBox doesn't seem to change this area, movementSetting's collisionPoly doesn't, and touchDamage's poly doesn't (although, like the hittable area, it doesn't get adjusted by the scale parameter). What parameter do I need to change to adjust this area?
     
    Last edited: Apr 3, 2018
  2. projectmayhem

    projectmayhem Spaceman Spiff

    I would have assumed its the touch or collision. are you in /debug with /boxes on?
     
  3. DraikNova

    DraikNova Spaceman Spiff

    Yes. I tried adjusting each parameter in /spawnmonster commands, and none of them seem to adjust the actual hittable area. Just the collision with the ground (movementSetting's collisionPoly), the area where you can suffer touch damage from (touchDamage's poly) or an abstract thing with no physical effect that appears to exist just to keep track of the monster for engine purposes (metaBoundBox).
     
  4. projectmayhem

    projectmayhem Spaceman Spiff

    maybe its the size of the monsters frame? so a monster that uses a 16x16 frame is hittable anywhere within that frame
     
  5. DraikNova

    DraikNova Spaceman Spiff

    That doesn't seem correct, since spawning in an adult poptop and turning on /debug and /boxes shows a hitbox that doesn't match its frame.
     
  6. Nexus Of Chaos

    Nexus Of Chaos Parsec Taste Tester

    the box shown with /debug and /boxes is the collision box, used for collision with tiles
     
  7. DraikNova

    DraikNova Spaceman Spiff

    That's the red box. However, there's also a yellow box for collision damage, which usually overlaps the red box.

    At any rate, is there really no information anywhere about what parameter actually defines this area?
     
  8. projectmayhem

    projectmayhem Spaceman Spiff

    The two boxes are the collision and touch boxes.... but maybe for players hits, the frame size - which is never shown, is the hit box? Most the monsters fill their frames pretty well, if you look at the vanilla assets.
     
  9. DraikNova

    DraikNova Spaceman Spiff

    If that's true, that still leads to the obvious question of how and where this is set in the assets, because it obviously can't be the whole story for multi-part monsters like the Ruin.
     
  10. projectmayhem

    projectmayhem Spaceman Spiff

    the monstertype file defines the parts of the monster as well as its health. I dont see why it couldnt lose health for any of its "parts" that are hit. Like for the dragon boss..

    Code:
     "type" : "dragonboss",
      "shortdescription" : "Bone Dragon",
      "categories" : [ "dragonboss" ],
      "parts" : [ "body", "head", "headlit" ],
    So my guess would be, anytime you hit a frame that of the body or head/headlit.... you damage the monster. the size of each frame is defined in the .frames file.
    like for the body...

    Code:
     "frameGrid" : {
        "size" : [350, 300],
        "dimensions" : [7, 3],
    so maybe hitting anywhere in the 350x300 body frame hurts the monster, touching anywhere in the hurt poly box hurts you, and the collision box just helps it looks more believable when moving around. Without the collision poly, monsters would try to jump over blocks, or walk up 1 block high ramps way too soon. Since their frame may be 30 pixels wide, but their feet only take up 10-15 pixels
     
  11. DraikNova

    DraikNova Spaceman Spiff

    The thing is, I checked this with the Ruin, and I found that the of two pairs of tentacles that surround the eye, all are parts of the monster but the outer pair doesn't have a hitbox.

    EDIT: I think I've figured it out...partially. The area is based on the collision with the ground, but is only calculated initially, as far as I can tell. The fact that the Ruin has a collision hitbox that doesn't actually collide with the ground seems to confirm this. However, this still doesn't tell me how this is set, so I'm going to go investigate Frackin Universe's code for their worms, because they seem like they'd have to do something weird to get their hitboxes working.
    EDIT2: Apparently, they don't. Huh.
    EDIT3: Current theory: overridecollisionparts, part of monster.lua that is called with every update to a monster, is constantly resetting the hittable area of monsters.
     
    Last edited: Apr 4, 2018

Share This Page