Announcement

Collapse
No announcement yet.

Matrix or workarround?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Matrix or workarround?

    Hi there,
    I' ve been working on a procedural generator of cities. I know how to "spawn" chunks of the level into a permanent one in the shape of a grid. I got to that following a youtube tutorial (this one). The fact is that I wanna generate more complex things (like it is done in this video (yeah, it's Unity, but the explained generation algorithm seems fine)) like streets or intersections, but in order to do that matrices are required. I'm doing all of this using blueprints and I wanna keep it that way, but
    Is there any way of making matrices in blueprints or some kind of workarround?

    This is a simple sketch of what I'm trying to achieve:

    #= house
    - = road
    + = intersection

    ##########
    #-##-###-#-#
    #-##+----+-+#
    #-##-######
    #+--+---------#
    ##########

    Thanks for your time.

    #2
    You can define new struct that has array as one of elements.
    Or you build your own multidimensional array. Which is imo better method.
    - create array
    - create function that changes linear index N into youyr multidimensional index on x,y,z ...
    - create opposite function that calculates N while given x,y,z ...
    - create 2 functions to put item and get item out of array.

    And you are done, you have multidimensional array.

    Comment


      #3
      Nawrot, don't you run into problems if you want it dynamic?

      Comment


        #4
        I think I'm going to do this with an int vector and some bitmasks operations to store the type of level it should be streamed along its position bit by bit. Thanks for the help.

        Comment

        Working...
        X