0 Favourites

How do I fix this Procedural Dungeon possible bug?

  • Hi there!

    I am busy testing out C2. I bought the personal version after making a simple game with the free version and now I am trying to step it up.

    I am working on a game with a procedural dungeon. The basic problem in a nutshell is that when I run the game in C2 it works fine. When I export it to html it gets all crazy.

    Like instead of sticking to the array, grid and the rules that I developed like this:

    or this

    It's goes a little nuts like this:

    The only difference is running it in C2 or exporting it as HTML5 and running it.

    It still seems to be following the rules, but making all arrays involved bigger which in turn makes the dungeon crazy.

    I have one array that is the grid the maze is laid out on. usually 80,80,2 the second layer of depth stores information about what kind of tiles lie next to a tile so I can tell where there are corners or entrances to rooms and such.

    I have another array that stores the dimensions and coordinates of the rooms. The array is 2,2,(number of rooms) The example you see has twenty.

    Here is the game in html format.

    Is there a know issue with arrays? I can't find anything online. Should I post this as a bug, or am I missing something?

    PS, this was made for a gameboy style game jam which is why it is all green.

    EDIT - I fixed it. It is a weird thing though in that it doesn't happen on export as long as I define and clear the arrays explicitly at the start of the layout. I don't know why it fixes the problem, but one cannot always look a gift horse in the mouth. Maybe something was writing to or reusing some specific memory address/ i don't really know.

  • I can't really see the intended behavior as I play the game. I am not really sure what the bug is in this case.

    This is what it looks like on Safari :

    Do you mean that all the tiles seem to be stretched?

    edit : Ok, sorry. I see what you mean now. I didn't understand properly the first time I read your post. Still, haven't heard any problem like this before on the forums...

  • It's kinda hard to tell without looking at the actual code.

    Try exporting with NodeWeb-kit and check if the problem remains.

  • will do

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • same problem with Node Webkit.

  • As caiorosisca mentioned, please post/attach your capx/project.

    Do you use third-part addons ?

    Without the code/event sheets to look at, no way to tell/guess what's going on.

    As far as we know, there is no issue with the array plugin.

  • I am attaching the capx.

    I have added the M key zoom in and out so you can see the map.

    It is fine in c2 but on the web and in node it seems to happen every third time or so.

    it must have something to do with how the map is generated, but it makes no sense that it only happens after export. Did not use third party plugins.

    i made the randome dungeon based on this tutorial :

    There are a list of global variables so you can change the room number. Map size is linked to layout size

  • file did not attach so here is a link.

  • UPDATE: Solved. See first post.

  • I will remove the capx, but if anyone wants it please let me know and I will send it to you.

  • I will remove the capx, but if anyone wants it please let me know and I will send it to you.

    Hi SupremeRobot, I'm a totally newbie in procedural level generation, and your capx would be very helpful for me. Can you please send it?

  • EDIT - I fixed it. It is a weird thing though in that it doesn't happen on export as long as I define and clear the arrays explicitly at the start of the layout. I don't know why it fixes the problem, but one cannot always look a gift horse in the mouth. Maybe something was writing to or reusing some specific memory address/ i don't really know.

    Presumably, you know that Arrays don't start blank. They start with 10 slots, all filled with 0's. I discovered this by outputting the JSON to a debug Text object.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)