[Help] Procedural Dungeon Generator

For questions about using Classic.

Post » Thu Jul 23, 2009 10:13 pm

I don't mean to bump unnecessarily, but I still haven't figured this out and I can't move forward without it. I could rewrite it to fit into the previous example, but I'm looking to learn and I've either misunderstood a function or cannot see the error in my logic.

Halp plox :|
B
2
G
3
Posts: 68
Reputation: 986

Post » Fri Jul 24, 2009 2:06 am

what are you doing with that global variable "edge"?
B
134
S
65
G
16
Posts: 1,765
Reputation: 19,188

Post » Fri Jul 24, 2009 2:08 am

[quote="alspal":1tauvpx6]what are you doing with that global variable "edge"?[/quote:1tauvpx6]

I was using it as an ELSE switch, because ELSE didn't seem to work and I was advised it wasn't functioning properly and might not work with all those ORs.
B
2
G
3
Posts: 68
Reputation: 986

Post » Fri Jul 24, 2009 10:35 pm

Ah, ha! Another peculiar find! (I am not having much luck with Construct at all)

Here is an updated version of what I have: [url:22rwgqi8]http://pub.gamingw.net/39880/construct.jpg[/url:22rwgqi8]

Now, I still can't see what I've done wrong with my logic, but I've noticed something off. We can ignore the GenerateMap function, because I've disabled it at the startup for testing purposes.

So the layout is clean and the entire array should be null save for the one tile at (3, 1) that I instruct to be turned on and set as a wall. But the output is this:



Where the hell is (1, 1) coming from? That should be null. Nothing is setting that value to 0. Unless this is some hidden aspect of arrays and there needs to be at least one value or something, but I doubt this because even when I turn GenerateMap back on (1, 1) is still always a wall tile no matter how many maps I generate.

I don't understand what is going on with this program. CPU usage is seemingly high still, and I cannot see where I have erred in my logic (see previous posts for an overview of what it should be doing). Sorry if I come off as a bit angry, but I'm just getting really frustrated. I hear Construct is supposed to do all these wonderful things even in beta (maybe it can and I am just wrong somewhere), but I can't even get what I consider BASIC things to work.
B
2
G
3
Posts: 68
Reputation: 986

Post » Fri Jul 24, 2009 11:30 pm

[quote:2vn3opxt]Unless this is some hidden aspect of arrays and there needs to be at least one value or something[/quote:2vn3opxt]

Why wouldn't the beginning of the array be 0?
You need to either fill the array, or use a different value for on/off.
Image Image
B
161
S
48
G
89
Posts: 7,347
Reputation: 66,249

Post » Fri Jul 24, 2009 11:33 pm

[quote="newt":rigovot5][quote:rigovot5]Unless this is some hidden aspect of arrays and there needs to be at least one value or something[/quote:rigovot5]

Why wouldn't the beginning of the array be 0?
You need to either fill the array, or use a different value for on/off.[/quote:rigovot5]

I assumed it would be null until filled. The rest of the array is null despite changes in size. Also this doesn't address the issue of that always remaining 0.

Well.. I just changed the values to 1 and 2 and that seems to be working, however (1, 1) is still always a wall. It's like I've solved a few little problems, but really the big issue is still there and I'm unable to continue until it is resolved.
B
2
G
3
Posts: 68
Reputation: 986

Post » Sat Jul 25, 2009 2:23 am

maybe post your .cap file if your desperate, would make it easier to help?
B
134
S
65
G
16
Posts: 1,765
Reputation: 19,188

Post » Sat Jul 25, 2009 2:51 am

[quote="alspal":28v9frt5]maybe post your .cap file if your desperate, would make it easier to help?[/quote:28v9frt5]

I thought I had, sorry.

Okay, so I opened Construct (it's addicting) and started an entirely new DirectX9 game. I rewrote most of the events, although the same basic structure remains. Despite it being essentially the same so far, results are confusing.

Here is the .cap: [url:28v9frt5]http://pub.gamingw.net/39880/ProcGen2.zip[/url:28v9frt5]

You'll notice that the Y2 row is walls as well. This isn't intended. However, strangely, disabling the event that checks if the CurrentY is equal to 1 (edge testing) causes it to render out fine. It also renders out fine if you change the CurrentY to check to see if the CurrentY is equal to 0 (??).

I stopped here, because there's no reason to advance if I can't get this part to work.

EDIT: Disabling the CurrentX is equal to 1 (again, edge testing) event causes the second row to render normally. Upon further experimentation I found that checking for anything else in addition to Y1 causes the double row of walls. I have no idea why, perhaps this is beyond my control.
B
2
G
3
Posts: 68
Reputation: 986

Post » Sat Jul 25, 2009 3:15 am

this is odd, it does seem to always make the Y1 a wall row even when you haven't told it to. When I changed it from Y1 to Y9 for example, it would make Y1 and Y9 and Y10 a row of walls. So it seems to always make 2 rows of walls when you set the Y value to something plus the first row will always be a wall.

I think the trouble was using an OR event, I made a work around.

http://files.getdropbox.com/u/1024727/ProcGen3.cap

I think I used the latest version of construct
B
134
S
65
G
16
Posts: 1,765
Reputation: 19,188

Post » Sat Jul 25, 2009 3:20 am

[quote="alspal":2kuxf69m]this is odd, it does seem to always make the Y1 a wall row even when you haven't told it to. When I changed it from Y1 to Y9 for example, it would make Y1 and Y9 and Y10 a row of walls. So it seems to always make 2 rows of walls when you set the Y value to something plus the first row will always be a wall.

I think the trouble was using an OR event, I made a work around.

http://files.getdropbox.com/u/1024727/ProcGen3.cap

I think I used the latest version of construct[/quote:2kuxf69m]

Sorry, I don't have that installed although I agree with your conclusion because we seemed to have developed similar solutions (presumably). Although it is sloppier (I am OCD about these things grrr construct get fixed), I am back to using separate events and a variable at the end to determine if it is an edge or not. This appears to be working so far. I will continue to rebuild it and post back if more STRANGE HAPPENINGS occur. Thanks for the help.
B
2
G
3
Posts: 68
Reputation: 986

PreviousNext

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 4 guests