Best Practice: creating 30+ levels for 2D platformer

Get help using Construct 2

Post » Sat Apr 29, 2017 3:26 pm

so i'm pretty much done with my 2D platformer (8 levels so far) and i want to use the existing assets in new variations/combinations and create over 30 levels.

what is the best way of doing that?

shall i continue creating a new layout for each level? Is that how you guys do it? I've seen 2D platformers games that have over 100 levels, do they really have 100 pre-made layouts in the game? does that increase the download size, or loading size?

is there a more efficient way of creating 30 levels without creating 30 separate layouts? i don't have the skill set to create 2D levels via procedural generated algorithm, but was wondering if there was something short of that technique that allowed you to reuse existing layouts.

I'm stuck, the only thing I've come up with is this:
---use random generation technique to change platform size, platform angle, platform type (jump thru or not, conveyor belt or traditional platform) and also use randomly generation to place other assets (swinging vines, spring boards, etc) ...

but leaving all that to a random generator ends up creating some retarded levels...so something better is needed.

i have no problem hand crafting the 30+ layouts, one for each level....but my only concern is this: increase the download size, or forcing the player to wait forever while the giant game is loading.

any advice, and past experience you can share is GREATLY appreciated.

Thank you in advance for all of your help.
B
130
S
40
G
10
Posts: 131
Reputation: 13,420

Post » Sat Apr 29, 2017 3:40 pm

@hyem As long as you're using the same objects in each layout (i.e. not create lots of new art assets for new sprites etc) I don't think creating more levels should heavily impact the download size, but you can test this for yourself by duplicating your existing level layout in your project (right click on the layout name in the project tab and select "duplicate"), making a build and comparing the filesize to your original.

Alternatively you could use an array to store the positions of objects for each level and then call each level from the array, but this becomes a real headache as you can't easily call an object name directly from an array (in C2 at least, C3 allows it - yay!) and fixing bugs can be a pain without a visual reference.

Another approach is to have a single large layout with multiple levels on it and then scroll the camera between them, but it is then harder to reset and pause individual levels and if you have a load of levels on one layout then it will take a while for that layout to load up.

Generally it's much easier to balance, modify and debug levels from separate layouts, saving you plenty of time in the long run.
B
16
S
7
G
3
Posts: 395
Reputation: 3,693

Post » Sat Apr 29, 2017 4:01 pm

@mekonbekon, thanks a million for your feedback. I'll do as you suggested and create the pre-made layouts and test along the way. btw, there are no new no additional art nor assets....just the existing ones being used in different combinations...so I'm hoping that, in and of itself, should not impact the game download size.

thanks a lot for your help. :-)
B
130
S
40
G
10
Posts: 131
Reputation: 13,420

Post » Sat Apr 29, 2017 4:27 pm

@hyem You're welcome :)
B
16
S
7
G
3
Posts: 395
Reputation: 3,693

Post » Sat Apr 29, 2017 7:24 pm

mekonbekon wrote:Alternatively you could use an array to store the positions of objects for each level and then call each level from the array, but this becomes a real headache as you can't easily call an object name directly from an array (in C2 at least, C3 allows it - yay!)


+1. I have like 3 games in Limbo because I haven't mastered spawning by array yet.

mekonbekon wrote:C3 allows it - yay!)

That has to be the FIRST good thing I've ever read about C3.
Image Image Image
B
29
S
11
G
27
Posts: 729
Reputation: 16,995

Post » Sun Apr 30, 2017 9:06 am

@MPPlantOfficial

Yeah, spawning by name is going to be a real game-changer (literally!) - it's already enabled in the C3 beta if you wanted to give a spin.

For C2, I believe that Rex Rainbow's "Nickname" plugin and behaviour allow a workaround for calling objects from arrays:

viewtopic.php?t=74522&start=0

I haven't tried it though, so I'm not sure how much of a hassle it is to implement.
B
16
S
7
G
3
Posts: 395
Reputation: 3,693

Post » Sun Apr 30, 2017 4:21 pm

How I make levels in my games is I make each layout from scratch. (I also copy and paste the player movement events and stuff like that)
B
5
Posts: 21
Reputation: 269

Post » Sun Apr 30, 2017 4:23 pm

Message: Armored Pig DEV can only post plain text URLS until they have 500 rep. 2 URLS modified. Why?
mekonbekon wrote:@MPPlantOfficial

For C2, I believe that Rex Rainbow's "Nickname" plugin and behaviour allow a workaround for calling objects from arrays:

viewtopic.php?t=74522&start=0

With that plugin can you sort of give objects sort of like a class. I want to know because this might make my game way easier. :mrgreen:
B
5
Posts: 21
Reputation: 269

Post » Sun Apr 30, 2017 5:08 pm

Armored Pig DEV wrote:
mekonbekon wrote:@MPPlantOfficial

For C2, I believe that Rex Rainbow's "Nickname" plugin and behaviour allow a workaround for calling objects from arrays:

viewtopic.php?t=74522&start=0

With that plugin can you sort of give objects sort of like a class. I want to know because this might make my game way easier. :mrgreen:


Let's try it then.
Image Image Image
B
29
S
11
G
27
Posts: 729
Reputation: 16,995

Post » Mon May 01, 2017 1:26 am

Ultimately, you would want to create a save/load system for levels, using an array or dictionary (I personally find dictionary much easier to use for this type of data handling).

If you can do this, that means you can make your own level-editor (and maybe include that with the game itself) and just export the levels you build so that your game will simply load all data relevant to the level design. Use your different layouts as a way to control the tile-sets used if you like - but learning to use a dictionary to save and load can be super handy in the long run. It's actually easier than it seems (hey, I managed to do it, so it's gotta be easy!) to get a system working like that.

PseudoCode:

On SAVE
-> loop through objects or family type for object.count times
---> write to dictionary at line (loopindex) data.width, data.height, data.x, data.y, yoda.mmmyes

Loading is basically the same thing, but I find loading the data string into a global variable can be handy for a lot of stuff... but sometimes you will simply loop through the number of entries present to create objects from (again, using loopindex or dictionary line counts) to create the object and set it's data.

There's NOTHING WRONG with doing it the way you're doing it though... it just means that if there's any expansion to the game, you have to hand craft each and every layout. Sometimes it's faster to do it that way, but with enough levels and tile-sets... it can be worth spending the time to create a level editor and save/load feature for your levels. Ultimately it can SAVE time, depending how far you're gonna go with content.

~Sol
Tired of crappy file hosts that are crappy? Get DROPBOX - https://db.tt/uwjysXJF
Moderator
B
80
S
34
G
40
Posts: 3,029
Reputation: 30,393

Next

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 13 guests