The Daily Click ::. Forums ::. Klik Coding Help ::. good level loading
 

Post Reply  Post Oekaki 
 

Posted By Message

MidnighT_RaveN



Registered
  20/09/2003
Points
  86
9th October, 2003 at 00:53:44 -

I made a level editor using arrays, and it works fine and all, but I want my engine to be able to load and hook multiple levels together. doesn't sound too hard (I did it before with inis) but the problem I've been running into, is that for obvious reasons when the tiles are loaded they paste themselves into the background and die. sounds great and all, but once the pasted tiles go off the screen it's curtains for them as well...

so how would I go about loading the only part of the level that the screen is currently on? or is there a way to paste objects with out them dissapearing everytime?

thanks guys

 
n/a

Radix

hot for teacher

Registered
  01/10/2003
Points
  3139

Has Donated, Thank You!VIP MemberGOTW WINNER CUP 1!GOTW WINNER CUP 2!GOTW WINNER CUP 3!GOTW WINNER CUP 4!
9th October, 2003 at 01:02:29 -

This is only a bandaid solution, but I'd simply tell them not to paste into the background if they're outside the playfield, and then when they enter, paste and destroy. Or, better yet, simply turn invisible so they can re-paste themselves when the edge of the play area passes them again.
Not great if you have enemies moving off-screen or something.

 
n/a

Daniel[Crazy_Productions]

Possibly Insane

Registered
  29/12/2002
Points
  2505
9th October, 2003 at 05:01:40 -

use the create background obstacle in mmf cause it doesnt dissapear when the game scrolls

 
Beware of life ...so far noone have survived it.......

DeadmanDines

Best Article Writer

Registered
  27/04/2006
Points
  4758
9th October, 2003 at 06:39:02 -

Daniel is exactly right. On the subject of storing multiple levels in one array file, I call this 'multiplanar' level design, and it works best with a system that uses strings as keys rather than numbers (I use Associative Array for this).

Basically, I name my keys in this format within AArray:

plane_x_y

where 'plane' is the name of the level/plane/dimension being defined, and 'x' and 'y' are obviously the tile coordinates. The tile parameters are then stored as the text value for that key. So the keyname for a tile at 32x256 on a plane/level named 'LevelOne' would be:

LevelOne_32_256

You then use 'add backdrop' to paste the object into the frame, and it won't ever get deleted again.

The cooler thing is that even though there is now NO way of accessing info about that tile from the standard event editor... we still have a record of its location and EVERY other variable parameter in the AArray... so if every background tile is 32x32, we can look up (x("player") mod 32) by (y("player") mod 32) and find out what tile the player is standing on! Even though it's a backdrop object now!

Think of the uses! You can make the player swim, make his physics change on different surfaces, make his footsteps sound different, you can do ANYTHING!

As you can see, I swear by custom level editors. They rock. And Rule. All day long.

 
191 / 9999 * 7 + 191 * 7

MidnighT_RaveN



Registered
  20/09/2003
Points
  86
9th October, 2003 at 17:38:55 -

ah thanks guys. you seem to be the man to see about level editors as well.
I have mmf 1.5... I remmember the backdrops dissapearing when I pasted them into the back ground...

but how would you go about level linking?
like, how would you refresh the board so that the old loaded levels are gone?

plus is there a way to resize the playfield?

Image Edited by the Author.

 
n/a

danjo



Registered
  15/01/2002
Points
  641

Acoders MemberGOTM NOVEMBER - 2009 - 3RD PLACEI am an April FoolVIP Member
9th October, 2003 at 18:16:43 -

"add backdrop" to background doesnt disappear, but "paste image to background" does.

 
n/a

MidnighT_RaveN



Registered
  20/09/2003
Points
  86
9th October, 2003 at 18:29:58 -

where is add backdrop??

 
n/a

Radix

hot for teacher

Registered
  01/10/2003
Points
  3139

Has Donated, Thank You!VIP MemberGOTW WINNER CUP 1!GOTW WINNER CUP 2!GOTW WINNER CUP 3!GOTW WINNER CUP 4!
9th October, 2003 at 18:53:39 -

I've never seen it before, so it must be in 1.5 somewhere.

 
n/a

MidnighT_RaveN



Registered
  20/09/2003
Points
  86
9th October, 2003 at 19:01:03 -

I found it.... X_X

thanks guys haha

 
n/a

ChrisB

Crazy?

Registered
  16/08/2002
Points
  5457
11th October, 2003 at 09:24:54 -

I don't think the method that Dines uses is very good... associative containers are very slow in comparison to normal arrays. What's wrong with saving levels to disk and loading them when necessary? (You could even load them to memory if you needed to...)

 
n/a

Kris

Possibly Insane

Registered
  17/05/2002
Points
  2017
11th October, 2003 at 11:16:51 -

if ass arrays are anything like PERL hash arrays then yes it's a very slow method

Image Edited by the Author.

 
"Say you're hanging from a huge cliff at the top of mt. everest and a guy comes along and says he'll save you, and proceeds to throw religious pamphlets at you while simultaniously giving a sermon." - Dustin G

MidnighT_RaveN



Registered
  20/09/2003
Points
  86
11th October, 2003 at 12:41:16 -

most classic NES and SNES games (I'm speculating) dont just load the whole smokin' level, it only loads the part that's currently on screen. what I'm planning on doing is making a map file in array format that tells the client what levels to load and such.

 
n/a

MidnighT_RaveN



Registered
  20/09/2003
Points
  86
11th October, 2003 at 19:46:18 -

that sure is a lot of work.


dang, whenever my levels load and I copy the tiles into the bg as obstacles, my detectors don't pick them up...

so the player falls right through them...

anything else that gets copied into the bg gets piced up tho. it's quite strange and iritating you see.

 
n/a
   

Post Reply



 



Advertisement

Worth A Click