Uncertain about handling game levels/maps

For questions about using Classic.

Post » Sun Jan 09, 2011 11:25 am

Hi guys.
At the moment i am working on a dungeon crawler and by biggest problem is how should i handle maps? Especialy as i will propably need loads of them and each is more or less randomly generated but player is able to go back and revisit previous map/level.
Methods that currently comes to my mind are:

1. Make hell load of layouts and copy/paste needed layout sheets
Its very strainght forward but i dont know if making hundreds of layouts by hand is something i am interested doing...
2. Use one layout as "base" and store the information is array and by "changing levels" i just reload the map with diffrent array
Sounds great but i suck with arrays soooo bad that i cant even wrap my head around storing the array info - left alone the rest.
3. Use one layout for all maps where one layer is one map
Seems pointless as i will have to do exactly the same like in point #1 but with layers instead of layouts and even making the previous layers "invisible" will propably slow down the PC

the best solution that comes to my mind would be Construct creating layouts with pre-determined values at runtime but i am preety sure thats impossible at the moment.

any ideas? thoughts?

Its also quite crusial for me as i want to use few difficulties settings and the numbers of layouts/level based on it (e.g easy dungeon: 50 levels, medium:100, hard:150). I would just make the top number of layouts (150) and then just make an event corresponding with difficulty setting should the game end at 50, 100, or 150th level BUT the dungeons has diffrent kinds linked to they number/depth, like lava, tombs, caves ect ect.

As always, if i made anything unclear please ask me so i clarify.
ImageImageImageImage
B
26
S
7
G
7
Posts: 572
Reputation: 6,097

Post » Sun Jan 09, 2011 1:18 pm

[quote="irbis":fef6e1p1]the best solution that comes to my mind would be Construct creating layouts with pre-determined values at runtime but i am preety sure thats impossible at the moment.[/quote:fef6e1p1]

That's basically just loading a level from file, which is very possible and definitely the way you should do it.

This topic seems to come up quite a lot lately, maybe you should have a look at these threads:
[url:fef6e1p1]http://www.scirra.com/forum/viewtopic.php?f=3&t=8216&start=0[/url:fef6e1p1]
[url:fef6e1p1]http://www.scirra.com/forum/viewtopic.php?f=3&t=8187&start=0[/url:fef6e1p1]
B
21
S
6
G
10
Posts: 1,024
Reputation: 7,445

Post » Sun Jan 09, 2011 2:27 pm

[quote="PixelRebirth":2xbqnkjb][quote="irbis":2xbqnkjb]the best solution that comes to my mind would be Construct creating layouts with pre-determined values at runtime but i am preety sure thats impossible at the moment.[/quote:2xbqnkjb]

That's basically just loading a level from file, which is very possible and definitely the way you should do it.

This topic seems to come up quite a lot lately, maybe you should have a look at these threads:
[url:2xbqnkjb]http://www.scirra.com/forum/viewtopic.php?f=3&t=8216&start=0[/url:2xbqnkjb]
[url:2xbqnkjb]http://www.scirra.com/forum/viewtopic.php?f=3&t=8187&start=0[/url:2xbqnkjb][/quote:2xbqnkjb]

Thank you PixelRebirth for your reply.
Ive checked both topics but they left me clueless.
Level editor? thats something beyond my capabilities :( i barely use array for storing stats informations. i just cant imagine something i havent seen before and array currently exists only in non-visual form.

Is there an alternative way for this?
Bear in mind - its not being lazy. I am just not able to wrap my head around arrays. And i havent started using Construct just today. thats just beyond me. :(
ImageImageImageImage
B
26
S
7
G
7
Posts: 572
Reputation: 6,097

Post » Sun Jan 09, 2011 3:36 pm

[quote="irbis":37zphfip]
Bear in mind - its not being lazy. I am just not able to wrap my head around arrays. And i havent started using Construct just today. thats just beyond me. :([/quote:37zphfip]

Let me quickly cite myself:

[quote="PixelRebirth":37zphfip]It doesn't really matter at this point if you know how to do it, the learning experience will be so much worth it! [/quote:37zphfip]

;)

[quote="irbis":37zphfip]i barely use array for storing stats informations. i just cant imagine something i havent seen before and array currently exists only in non-visual form.
[/quote:37zphfip]

If you need a visual array, you may just look at the following example:
[url:37zphfip]http://dl.dropbox.com/u/2306601/array_hash_unique.cap[/url:37zphfip]
(made for this thread)

[quote="irbis":37zphfip]
Is there an alternative way for this? [/quote:37zphfip]

The way I see it, you could basically do three things to create your levels.

1. Make a layout for every level. It's the least desirable option and will become very tedious if you had many levels.

2. Load your level from file into a single layout. This can be done with arrays, hash tables, inis or the S plugin. The last two mentioned options are favorable in most cases. Of course this will require a level editor. So it's more work to begin with, but it will pay off in the long run.

3. Procedurally generated levels. Most notable would be the Perlin noise plugin. Apart from that you need to rely on your eventing and math skills. This option won't be feasible if you need to specifically design your levels of course, as they'll be created in "controlled randomness".
B
21
S
6
G
10
Posts: 1,024
Reputation: 7,445

Post » Sun Jan 09, 2011 6:18 pm

[quote:3tgvh0w9]i barely use array for storing stats informations. i just cant imagine something i havent seen before and array currently exists only in non-visual form.[/quote:3tgvh0w9]
i know that PR. its just that - some things can be learned by some but theres not a singel thing that can be learned by everyone. just like pigs dont fly heh
well i am the pig in this case :\ and no, i am not proud of that...
[quote:3tgvh0w9]
2. Load your level from file into a single layout. This can be done with arrays, hash tables, inis or the S plugin. The last two mentioned options are favorable in most cases. Of course this will require a level editor. So it's more work to begin with, but it will pay off in the long run.[/quote:3tgvh0w9]
Never heard of S plugin before and when i try to search the forums it says that this sentence is too common. can someone provide me with a link to the thread about this plugin? i would be very greatfull

[quote:3tgvh0w9]3. Procedurally generated levels. Most notable would be the Perlin noise plugin. Apart from that you need to rely on your eventing and math skills. This option won't be feasible if you need to specifically design your levels of course, as they'll be created in "controlled randomness".[/quote:3tgvh0w9]

well every level in my game is randomly generated with a few guidelines and my life would be so much easier if the player could visit one map just once. then i would just reload the very same layout but with diffrent settings. but i want the player to be able to go back and revist previous levels. and this is what couses me the troubles.
about perlin noise - seen that plugin in action and ive been stuned. still though, the game uses pre-made tiles for map graphics so i cant really use perlin in this case.

oh well, so it apears i am stuck with the hand-set levels :\ at least till a miracle happends and one day ill woke up being capable of understanding array/file based levels.

i have my hands tied anyway currently because of this thread viewtopic.php?f=3&t=8218&p=62944#p62944

But thatnk you PR for you helpfull replies :)
ImageImageImageImage
B
26
S
7
G
7
Posts: 572
Reputation: 6,097

Post » Sun Jan 09, 2011 6:59 pm

[quote="irbis":2rva0y78]
i know that PR. its just that - some things can be learned by some but theres not a singel thing that can be learned by everyone. just like pigs dont fly heh
well i am the pig in this case :\ and no, i am not proud of that...[/quote:2rva0y78]

I thought of myself as a hopeless case in learning certain stuff too not so long ago. But then eventually I did learn it. Sometimes your self perception might just be a little off. You should try anyway.

[quote="irbis":2rva0y78]Never heard of S plugin before and when i try to search the forums it says that this sentence is too common. can someone provide me with a link to the thread about this plugin? i would be very greatfull[/quote:2rva0y78]

I probably should have told you that "S" stands for Superstructure in this case, so it would have been easier to track down. Here's the thread for the plugin:
[url:2rva0y78]http://www.scirra.com/forum/viewtopic.php?f=2&t=4791&start=0[/url:2rva0y78]
It's not that easy to get into either, I know I'm not using it to its full potential myself yet, but it's a very useful plugin and lucid's explanations are also very detailed. Not sure if it's still in development btw, but it's very useable in its current state.

[quote="irbis":2rva0y78]well every level in my game is randomly generated with a few guidelines and my life would be so much easier if the player could visit one map just once. then i would just reload the very same layout but with diffrent settings. but i want the player to be able to go back and revist previous levels. and this is what couses me the troubles.
about perlin noise - seen that plugin in action and ive been stuned. still though, the game uses pre-made tiles for map graphics so i cant really use perlin in this case.[/quote:2rva0y78]

Since the same seed will always give you the same result, if you don't change other settings, you can very well go back to old levels. It could also be done with premade tiles, the graphics themselves don't need to be procedurally generated and aren't in many cases.

[quote="irbis":2rva0y78]
i have my hands tied anyway currently because of this thread viewtopic.php?f=3&t=8218&p=62944#p62944[/quote:2rva0y78]

Well, it's a well known fact that the buildin save/load feature is a bit on the fishy side. So what you would want to do is create your own save/load system. You need to gather which information is needed to be remembered and put it in an external file. Again, this would be done with the usual suspects: arrays, hash tables, inis... or S. I'm afraid there might be no good way around learning this stuff after all. :P
B
21
S
6
G
10
Posts: 1,024
Reputation: 7,445

Post » Sun Jan 09, 2011 7:17 pm

[quote:3bng317c]I probably should have told you that "S" stands for Superstructure in this case, so it would have been easier to track down. Here's the thread for the plugin:
viewtopic.php?f=2&t=4791&start=0
It's not that easy to get into either, I know I'm not using it to its full potential myself yet, but it's a very useful plugin and lucid's explanations are also very detailed. Not sure if it's still in development btw, but it's very useable in its current state.[/quote:3bng317c]

in the middle of the opening post ive found myself under my bed sucking my thumb.
after ive read the whole thing my brain melted thru my ears and now i am a human vegetable.

on serious note... this is propably where my adventure with Construct ends.
Need to put my game on hold till i will not find someone capable of helping me... thx PR. Better to know the truth now then find it after another 6months of developing.
ImageImageImageImage
B
26
S
7
G
7
Posts: 572
Reputation: 6,097


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 3 guests