Zelda-Style Background/Map

Get help using Construct 2

Post » Wed Dec 26, 2012 4:36 am

How Do I Make a Better Map?

Okay, I started making a top-down game based on the ghost-shooter tutorial. Things are going well, but I'm worried about the size of my game now.

The basic concept is to make a background that isn't simply a single repeated tile. At the moment, I have a 2000x2000 pixel image that serves as my background, and I've used about 20 sprites or so to create walls for my character to collide with and enemies to climb over.

This serves fine for demonstration purposes, and people are enjoying the game- they just want more of a map to explore.

My first thought was to set up "Edge of the Map" sprites, so when the hero runs over them, the layout disappears, and a new one appears in its place, with the hero standing in the appropriate place. In other words, Zelda 1 Style.

This is where my problems occur. I don't want to bog down my loading or my game with 20 2000x2000px maps... I'd rather just use 15 100x100 pixel images and make some tile maps.

I did this once in Visual Basic 6... I made a subroutine that would read a text file and create the map I wanted accordingly on Form Load. (Layout start, here.) For example-

W,W,W,W
W,G,G,W
W,G,G,W
W,W,W,W

These four lines of text would be translated into a 4x4 grid that would have 4 Grass tiles surrounded by 12 Wall tiles. But in everything I've read, I don't know if Construct2 even has this capability.

THUSLY...

1. Would 20 large background images (like 2000x2000 pixels) be too much for a game I hope to use on mobile devices?

2. If that's a bad idea, then what about the text file approach? Using only 15 small images sounds like it would save a lot of space, but does the technology support it? I'm not after random maps here, I'm after a 20x20 grid that has a purposeful arrangement.

3. Is there a better way? Something I'm totally missing? I'm not married to any particular method. I just can't accept having one small image tiled a thousand times without any variety.

I know this is an incredibly long post, and I thank anyhow who reads it. I doubly thank any who reply, even if it's only to tell me that my post is too long.havenrocket2012-12-26 04:39:37
Everybody got to come out of the closet... does that mean I'm allowed to come out of the corner? Is that even funny anymore? Do parents still make their kids stand in corners when they mouth off?? These are the questions that keep me out of the really good schools.

havenisle.net
B
11
S
3
G
3
Posts: 27
Reputation: 2,695

Post » Wed Dec 26, 2012 11:59 am

Try using an array that stores the data you need to check...an array will even let you alter the map and update the info as needed...look up up the various tutorials on the forums and the manual entry on arrays..they can be used in just about any way you can imagine

Hope it helps...its basically what you are doing anyway....CS2 has a built in function for that...:-)
When in doubt..or you are lost in a Zombie apocalypse or someone is giving you a hard time..Remember one thing..... Read the Construct 2 Manual..it will save your life.:)
B
30
S
11
G
8
Posts: 313
Reputation: 7,360

Post » Wed Dec 26, 2012 12:18 pm

1. You'd have to test it and see, and then it would also depend on the device. Generally the size of the image doesn't affect speed. Image size does affect memory usage, and keep in mind that mobile devices have less memory than PCs.

2. You can do that approach. Load the text file with the ajax object and utilize the System text expressions to read parts of the text.
B
79
S
24
G
54
Posts: 4,749
Reputation: 40,761

Post » Wed Dec 26, 2012 8:05 pm

[QUOTE=R0J0hound] 1. You'd have to test it and see, and then it would also depend on the device. Generally the size of the image doesn't affect speed. Image size does affect memory usage, and keep in mind that mobile devices have less memory than PCs.[/QUOTE]

Yeah, this is true, you can't be sure of anything until you've tested it thoroughly. I'll have to believe that if angry birds can have a ton of unique maps, then so can I...

[QUOTE=R0J0hound]
2. You can do that approach. Load the text file with the ajax object and utilize the System text expressions to read parts of the text.[/QUOTE]

Okay, so Ajax, eh? I had no idea... I will try to research this more.

Thanks @ROJOhound.
Everybody got to come out of the closet... does that mean I'm allowed to come out of the corner? Is that even funny anymore? Do parents still make their kids stand in corners when they mouth off?? These are the questions that keep me out of the really good schools.

havenisle.net
B
11
S
3
G
3
Posts: 27
Reputation: 2,695

Post » Wed Dec 26, 2012 8:21 pm

[QUOTE=mystazsea] Try using an array that stores the data you need to check...an array will even let you alter the map and update the info as needed...look up up the various tutorials on the forums and the manual entry on arrays..they can be used in just about any way you can imagine

Hope it helps...its basically what you are doing anyway....CS2 has a built in function for that...:-) [/QUOTE]

Thanks Mystazsea.

Arrays are a great tool, I just wish I understood them better. I've read the tutorial and several forum entries, but I still have no practical way of understanding them...

For example, I could do something like:

System / On Level2 Start /
     System Create S at 0,0 //create sand tile
     System Create G at 100,0 //create grass tile
     System Create W at 200,0 //create wall tile
     etc...

But that's like a hundred lines of "System Creates" for five levels of 5x5 grids. 5 levels of 20x20 grids would be astronomical...

I'm not looking for somebody to make my game, but any help on formulating the proper way to make such an array would earn somebody an Associate Producer credit...
Everybody got to come out of the closet... does that mean I'm allowed to come out of the corner? Is that even funny anymore? Do parents still make their kids stand in corners when they mouth off?? These are the questions that keep me out of the really good schools.

havenisle.net
B
11
S
3
G
3
Posts: 27
Reputation: 2,695

Post » Thu Dec 27, 2012 4:10 pm

So, if somebody has already tackled this, maybe you could point me towards that tutorial/thread? I don't mind searching the forums on my own, but I've been at it for about two weeks without much luck...
Everybody got to come out of the closet... does that mean I'm allowed to come out of the corner? Is that even funny anymore? Do parents still make their kids stand in corners when they mouth off?? These are the questions that keep me out of the really good schools.

havenisle.net
B
11
S
3
G
3
Posts: 27
Reputation: 2,695

Post » Thu Dec 27, 2012 5:12 pm

Hope this will help.
http://www.scirra.com/forum/saving-and-loading-an-array-to-webstorage-capx_topic50970.html
B
10
S
3
G
2
Posts: 23
Reputation: 2,177

Post » Thu Dec 27, 2012 5:28 pm

Might want to look into the TMX Importer plugin by RexRainbow. It allows you to use tiles in your game without building your own editor since C2 isn't really made for that stuff.
Image
B
225
S
27
G
13
Posts: 1,774
Reputation: 18,024


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 0 guests