Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice
  4. Dismiss Notice

Question Anyone familiar with the level generator Daedalus' code? I need help.

Discussion in 'Scripting' started by LuckyDucky12, Oct 23, 2020.

  1. LuckyDucky12

    LuckyDucky12

    Joined:
    Feb 5, 2016
    Posts:
    16
    Remember Daedalus? Its a random dungeon generator that was made free a while back ago. I'm using it now, and its running perfectly, but I need to modify the script a bit to suit my needs.

    Out of the box, you can make the dungeons spawn an entrance and exit prefab to mark where the dungeon's entrance and exits are. I'm trying to modify it to spawn more markers, one for a shop. So far, all of my attempts have ended in catastrophic failure, causing unity to bug out in ways I've never seen before!

    I understand that Daedalus is relatively old, so no hard feelings if no one's willing to help.
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,780
    Never heard of it outside of Greek mythology. If it's code though, it can be reasoned about, but you have to at least identify what parts of the code are responsible for what before you can meaningfully change it. Once you identify that, I'm sure you can get support here for any issues you have.

    NOTE: modifying an existing codebase is an EXCELLENT way to gain engineering insight and get better at this stuff, but definitely start with something you can actually do. In this case, what about trying these steps: every time a dungeon entrance or exit is generated, inject your marker "just inside" the dungeon.

    At least with that you will have had some success, and then you could broaden out by:

    - learning how to find better places to put those markers

    or

    - remove the associated exit marker, leaving your new shop marker.

    etc.
     
  3. LuckyDucky12

    LuckyDucky12

    Joined:
    Feb 5, 2016
    Posts:
    16
    So I followed your advice and decided to handle this in a way that's on my skill level.

    By that, I mean I went into each individual tile type and placed a spawner in it. Then I made an array in the spawner script to spawn a few things.

    Now, on level generation, my tiles will spit out an enemy, a weapon, or nothing at all. I'll do the same thing to spawn a shop, too. I'll likely be changing this later, but for now, this is perfection when it comes to prototyping.

    I will be studying the code to get a better insight on coding. Especially since I didn't even know you can link variables in the way that the people who made Daedalus did so that togglable variables can appear in completely different scripts, and such.

    Anyway, thanks again for the advice. Its a shame the Daedalus script is so obscure, now; its is a fantastic free option for random dungeons.
     
    Last edited: Oct 24, 2020
    Kurt-Dekker likes this.
  4. orionsyndrome

    orionsyndrome

    Joined:
    May 4, 2014
    Posts:
    3,043
    nice, I like that you're finding good progress. as Kurt-Dekker says, that's the best way to learn how to approach things in code. I agree with your closing remark, I didn't know about it either (mostly because I'm at a point at which I yearn for more, so I pretentiously look for more daring things only to be baffled by them), but it could help many beginners or even small projects lift off the ground.

    if you have questions regarding the code or some practices, well I haven't seen it, but feel free to ask anyway, we should be able to figure out something or explain things if necessary.
     
    Kurt-Dekker likes this.