DurandalCorp's Forum Posts

  • korbaach Thanks. Ill see if I can implement this into what I already have.

    R0J0hound Thanks for letting me know that C2 doesn't use radians.

  • I am trying to implement an algorithm that spawns sprites in a circle randomly and uniformly decided by its radius. The 1 would allow the angle to be 2pi.

    function getRandomPointInCircle(radius)
      local t = 2*math.pi*math.random()
      local u = math.random()+math.random()
      local r = null
      if u > 1 then r = 2-u else r = u end
      return radius*r*math.cos(t), radius*r*math.sin(t)
    end
    [/code:1bx258wg]
    math.random() = random float number between 0, 1
    
    My C2 code: t is replaced with q
    [img="https://i.gyazo.com/689198444e1b138b38fe3066f423ce13.png"]
    
    All I get is this:
    [img="https://i.gyazo.com/fb9ae2e2c42ff82650b66c81f32003bf.png"]
    
    When I want something like this:
    [img="https://i.gyazo.com/14aba38b587da1fd607060dc12f66e22.png"]
  • I saw the manual.

    random(a), goes from 0 to a without choosing a.

    random(a,b), goes from a to b including a.

    What I need in random(a,b) including both a and b.

    random(0,1) or random(1)

    Goes from 0 to 1 including both 0 and 1 in its selection.

    Edit: Changed the title to make it much more clear.

  • Just bought this. Would be nice if there was a video that explained some stuff.

    Trying to figure out how to build maps atm.

    I like the control scheme. Still not getting how the minimap and data saves work, but will try to go through with it line by line.

    What I have trouble most with is trying to follow the variables and function calls.

    Some lines don't reference where the variables originate from.

    All in all, it is something to learn from. I want to see if things are more modular.

  • Thanks so much. It worked.

  • [SOLVED]

    I can generate rooms randomly and stick them into a tile grid (16px by 16px).

    Now I want to record it into an array using some kind of stepping sprite.

    For example, I spawn a sprite the same size as the tiles I want it to be (16px by 16px), then I check to see if it overlaps a room.

    0 for nothing, 1 for room.

    I move it over by 16px.

    Once it reaches the end, I move the sprite down 16px and repeat the process.

    Can I do some thing like this?

    Project Demo: Generating Rooms

    https:// dl.dropboxusercontent. com/u/103945751/PhysicsProceduralGeneration/index.html

    -Can't post links yet-

  • Here is another crack at it:

    While debugging, my value for Closest_Room_Distance_02/Closest_Room_UID_02 and Closest_Room_Distance_03/Closest_Room_UID_03 are the same:

  • Am I going about this the correct way?

    I want to use 2 for loops to go through the array and find all the three shortest distance Big Rooms.

    If it comes across the same UID then skip. If it comes across a UID of 0 then skip.

    Once the slots are populated I want to check each slot too see if they are higher than the next. if they are I want them replaced.

    Here is a screen shot:

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I have a project that makes dungeons.

    Once certain width and height parameters are met they are changed to red.

    Those are now considered Big Rooms.

    Once those Big rooms are created I store the Big Room's UID in an array.

    I need to find the three closest Big Rooms to a selected Big Room, then do that for all the following Big Rooms.

    I don't know how to pick one instance and find the others inside of a for loop using the UID array.

    Then, I want to store the distances in either another array or instance variables with the starting Big Room's UID, UID of the three closest Big Rooms, Then the distance of the three closest Big Rooms.

    What the dungeons look like:

  • Thanks for replying. I've just tried increasing the time scale. It seems that the physics is what is limiting the speed.

    After some testing, it seems if you increase the spread then the rooms don't have to push on each other that much and results in better snapping times.

  • I want to speed up the physics, or speed up the games clock, so that I can get my physics based procedural generation to complete faster. Anyway to do that?

    It's a bit slow because I spawn 100 rooms and wait for them to stay still. I just want to speed that up.

    This is just the first part to generating the map. I hope to make hallways to connect big rooms together, then apply tiles to it. We'll see how this comes together.

    Demo:

    Right-click to restart Layout.

    https:// dl.dropboxusercontent. com/u/103945751/PhysicsProceduralGeneration/index.html

    capx:

    https:// dl.dropboxusercontent. com/u/103945751/PhysicsProceduralGeneration/Physics%20Procedural%20Generation.capx

  • I know it says MetroidVania, but will there be a Vania Type inventory System too?

    Item lists with quantity (meat x12)

    Equip slots (hand, torso, left/right hand)

    Drop items (leaving them on the floor)

    Special Commands to do actions (SOTN - Down, Up, Jump for Super Jump)

    More of the Vania side? Just wondering. I will pick this up though, when it comes out.

  • This looks really awesome. Would be a great tool for the community. Looking forward for your release.

  • www gamasutra com/blogs/AAdonaac/20150903/252889/Procedural_Dungeon_Generation_Algorithm.php

    Is this even possible in Construct 2? If it is already here, but in pieces post the links here. I want to implement this, but I don't get the math behind it, or have the know how on where to start in Construct 2.

  • Lemme take a shot at this. You may have it like this:

    Bullet on collision to enemy
    -- subtract bullet damage from hp[/code:333rfonw]
    
    when it should be something like this:
    
    [code:333rfonw]Enemy on collision with bullet
    -- subtract bullet damage from hp[/code:333rfonw]
    
    then, display the health bar. That way each monster calculates its own damage one bullet at a time, and not one bullet calculates all the damage to all enemies.
    
    I'll try the separate hp bars and see if I can get that working. Will post it if I come up with something.