The insta-crash thread (or "how to break the dungeon like a boss")

Discussion in 'Modding' started by bluehinter, Dec 14, 2012.

  1. bluehinter

    bluehinter Member

    How many times has this happened to you...
    You've just built the perfect mod, and having run it through the XML Validator, it comes back with a clean bill of health. Feeling pretty self-assured, you fire up Dungeons of Dredmor, load your mod, and...

    [​IMG]
    (Insert sad trombone noise here)

    Now it's time to start digging through your XML code and trying to figure out which part of your mod was too awesome to live.

    I'm hoping this thread will be a useful topic for other Dredmor modders, since nothing kills the buzz of creating something new, like having to spend nearly the same amount of time ripping it apart as you did building it, because of one persistent error. When I discover something which breaks the game (ie: causes it to crash to desktop) but doesn't show up as an error in XML Validator, I'll post it to this thread, and I encourage everyone else to do the same, so that others may look upon our misfortune and learn by example.
     
    OmniaNigrum likes this.
  2. mining

    mining Member

    Typically its something like there being a messed up image, in my experience.
     
    OmniaNigrum likes this.
  3. bluehinter

    bluehinter Member

    Okay, on my first mod, I ran into three insta-crash scenarios:

    #1) Trying to use a RGB .PNG file instead of an indexed .PNG file (and probably vice versa)
    Remember kids, just like the song by Loverboy... item .PNGs and spell/skill .PNGs just won't splice.


    #2) Trying to create a crafting recipe in craftDB.xml which took more than the maximum 4 input items.
    Pretty self explanatory, but it took me a long time to figure it out without knowing precisely what to look at.


    #3) Using a non-standard character in a description text tag.
    Always be wary of cutting and pasting text into your itemDB.xml and spellDB.xml. This particular little gremlin occurred for me when I tried to paste some cheesy movie dialogue into a spell and "I'm gonna take you to the bank... to the blood bank." just happened to have an ´ instead of an '. See the difference? No, neither did I.
     
    OmniaNigrum likes this.
  4. Alistaire

    Alistaire Member

    Using non-standard characters in the description isn't an instant crash, afaik. It just messes up things this bad that it gives every item an "artifact="1"" status, or breaks the whole damage and resistance system in the game.

    Also, I found out the mod validator does not care about non-existing items in the craftDB.xml.
     
    OmniaNigrum likes this.
  5. OmniaNigrum

    OmniaNigrum Member

    The most common problem mods have is the case of letters in the file names. In a file system, they matter none at all, since any modern file system will find abcd.jpg even if asked to find ABCD.JPG, and the opposite case as well. But in a zip archive, it distinguishes between the two and will *NOT* find abcd.jpg if the filename it is looking for is ABCD.JPG.

    Keep this in mind if you make a mod.

    Also, who exactly defines what is "Standard" in a character set? There are thousands of different character sets already in every operating system. Usually only a few are really used, but saying standard is like saying only English is a language. (French, Spanish, and other such things are all made up after all, right?)

    Even the ISO cannot agree what a standard character set should be for an English only system. ANSI has limited uses and is not the best system. (For examples and a detailed explanation of limitations, start here.)
     
    Kazeto likes this.
  6. mining

    mining Member

    I'm a fan of only using characters that you can represent with one byte.
     
    Essence and OmniaNigrum like this.
  7. I've just uploaded my first mod (a test skill mod) to the Workshop, and it validates okay, but whenever I try to select it as one of my seven skills, I can name my character, but when I press 'Done' the game dies. No 'Dungeons of Dredmor has stopped working' or anything. Just dies. What could be causing that?

    EDIT: Glazed's XML Validator also tells me there are no errors.

    Double EDIT: Fixed. It was either my "s or my
    <loadout type="weapon" subtype="NEW WEAPON" always="1" amount="2"/>. Changed amount to 1 and copied it, problem solved.
     
    OmniaNigrum likes this.
  8. bluehinter

    bluehinter Member

    First thing I'd check is that any custom artwork you've created exists where it's supposed to exist (ie: in the correct sprites\spells or sprites\skills folders) and that it's in the right format and size. Skill icons need to be 64x64 RGB .PNG's, spell icons usually need to come in both 64x64 and 32x32 RGB .PNG flavors (depending on what you're doing), and items need to be 32x32 Indexed color .png's. Try it with the wrong type, and it'll blow up in your face.

    I can't remember whether the XML Validator is smart enough to tell you if you're missing or have mislabeled an icon file, but I know it can't tell the difference between a RGB and Indexed .PNG, or one that's 65x65 pixels wide rather than 64x64.

    Also, if you ended up copying and pasting description text from somewhere, you can check for non-standard characters. (like the ´ versus ' I posted above) Oh, and watch out for extraneous or missing quote marks.

    If neither of those solutions work, what I'd recommend is either posting your code to a thread here so people can take a look at it, or save a copy of your completed mod into another folder, and then slowly start removing abilities and spells one by one. Hopefully, the game will eventually start working again, and you'll know the problem was somewhere within the spell you just deleted.
     
    Gorbax and OmniaNigrum like this.
  9. bluehinter

    bluehinter Member

    Found another couple on my current mod...

    #4 -- Capitalization matters! At least when specifying that icon="sprites/skills/Bowiemancy.png" when the file is actually named bowiemancy.png I imagine the same goes for sfx and soundfx as well.

    #5 -- Be careful where you put your description text! -- I'm not 100% sure on this one, but I did have my <description text="blah blah blah."/> inbetween a <buff> </buff> field, which I think was at least interfering with the functioning of my buff, even if it wasn't the causing the insta-crash.

    and #6 -- Be even more careful when messing around with the actual Dungeons of Dredmor game files! -- I spent 3 days checking my mod for errors, and literally ripping it apart piece by piece until there was nothing but a single icon left, before I finally thought to check the integrity of the game itself. (screenshot below if you've never had to do this before on Steam)

    fix_idiocy.jpg

    Obviously, I had a bit too much Diggle Nog over the holidays, and decided to go poking around inside one of the XML files in the \steamapps\common\dungeons of dredmor\game directory (probably while I was looking up examples of spell mines), and accidentally overwrote something I shouldn't have.

    Yep, that'll give you a crash alright.
     
    Rawk Hawk, mining and OmniaNigrum like this.
  10. Vitellozzo

    Vitellozzo Member

    Remember, kids, that if you use something that's altering the game files, this operation will overwrite your changes (this is expecially for those using 1.1.3 beta or Essence Skill Rebalance).
     
    OmniaNigrum likes this.
  11. bluehinter

    bluehinter Member

    #7 You apparently can't use custom monsters on level 15.

    Who knew? I was wracking my brain, trying to figure out why my Monstrous mod would only work when I eliminated my final monster, but changing <monster name="Kobro Commander" level="15"> to <monster name="Kobro Commander" level="14"> did the trick for some reason.
     
  12. mining

    mining Member

    They're indexed at 0 - so 0,1,2,3.... etc (iirc).
     
    Kazeto likes this.
  13. bluehinter

    bluehinter Member

    Not an instant crash, but it will crash the game as soon as your custom monster appears and tries to use the specified animation:

    #8) For custom monsters, always make sure the file name and locations in your movement animation files (ex: my_monster_attack_left.xml) are 100% accurate.

    For example, I rearranged a couple of frames of animation for my skull golem, and accidentally skipped from attack_left0005 to attack_left0007, but my xml file still listed attack_left0006:
    <frame delay="100">skull_golem_attack_left0005.png</frame>
    <frame delay="100">skull_golem_attack_left0006.png</frame>
    <frame delay="100">skull_golem_attack_left0007.png</frame>

    It took me a devil of a time to figure out why the game only crashed when the golem was facing one direction.
    I also had a similar problem with the bouncing skulls because I capitalized a couple of the file named on accident, so it was trying to call up skull_die0000.png and not recognizing Skull_die0000.png.
     
    Kazeto likes this.
  14. MOOMANiBE

    MOOMANiBE Ah, those were the days. Staff Member

    Nicholas can probably tell you how many crash bugs I caused during development by rushing through the new monster XML in Diggle Gods without proof-checking everything. TYPOS KILL.
     
  15. bluehinter

    bluehinter Member

    #9 - Specifying the wrong height (and probably width) on a user-created spell template in manTemplateDB.xml.

    I'm lucky I encountered this one after relatively minor alterations to my mod, so I had a rough idea of where to look for my mistake.
     
    OmniaNigrum likes this.
  16. codebracker

    codebracker Member

    Ugh, I'm not even counting the times that this has happened.
    Last time I had to copy the whole skill and crafting file into a new file (copy pasting the entire file, didn't change anything) and it mysticaly stopped crashing.

    Also the time I made a new spell that had "lockable" as the target, the game wasn't happy.

    Or when I was trying to make a multi-anti-buff-combo-trigger, actually I'm still working on that one.
     
    OmniaNigrum likes this.
  17. Bohandas

    Bohandas Member

    Are asterisks ok?
     
    OmniaNigrum likes this.
  18. bluehinter

    bluehinter Member

    As far as I can tell. I haven't used them in a spell description, but I've used them in an item description without any problems.
     
    OmniaNigrum likes this.