The Daily Click ::. Forums ::. Klik Coding Help ::. Simple top down tile-based level editor for an RPG (non-platform)
 

Post Reply  Post Oekaki 
 

Posted By Message

Del Duio

Born in a Bowling Alley

Registered
  29/07/2005
Points
  1078

GOTW WINNER CUP 1!GOTW WINNER CUP 2!GOTW WINNER CUP 3!GOTW WINNER CUP 4!Evil klikerHasslevania 2!The OutlawSanta Boot
2nd December, 2011 at 18:07:45 -

Hi guys, just curious as to how easy it'd be to create a tile-based level editor for a top down RPG game? I've seen some examples on TDC but they're mostly for platform games or not what I'm looking for exactly.

What I'd want would be to make a big map, say maybe 200 x 200 tiles, and then only display a 5 x 5 grid centered around the main character. I've done this before with Visual Basic where you draw the guy at X,Y and then do a big for / next loop to draw the tiles at (X-5, Y-5) , (X-4, Y-5), (X-3, Y-5) and etc to fill out that 5 x 5 grid. When the player presses one of the arrow keys, the value of X,Y would change and the 5 x 5 grid redraws itself with the guy still in the middle. For collision's sake, it could be extremely simple. Some tiles you can move on and some you can't (0 or 1 value, I'd guess) and the array would probably need another "Z" layer to it for chests and loot and other stuff on some tiles.

It's exactly like how old computer games like Ultima did it.

But with MMF, things that could be easy as an array and 2 For / Next loops are hard for me. Is there any current example available for anything similar to this? I already drew a ton of grass, water, and desert tiles (they are all 20 x 20 in pixels) so I figure the hard part's mostly out of the way.

Thanks guys!

Edited by Del Duio

 
--

"Del Duio has received 0 trophies. Click here to see them all."

"To be a true ninja you must first pick the most stealthy of our assorted combat suits. Might I suggest the bright neon orange?"

DXF Games, coming next: Hasslevania 2- This Space for Rent!

Sketchy

Cornwall UK

Registered
  06/11/2004
Points
  1971

VIP MemberWeekly Picture Me This Round 43 Winner!Weekly Picture Me This Round 47 WinnerPicture Me This Round 49 Winner!
3rd December, 2011 at 01:55:31 -

It depends what you want to do exactly.

If you just want the screen to scroll one whole tile at a time (see Pixelthief's "GridQuest"), that's extremely easy - it doesn't even need any kind of loops. eg. https://skydrive.live.com/redir.aspx?cid=b1e7ee094271bbda&resid=B1E7EE094271BBDA!425&parid=B1E7EE094271BBDA!288&authkey=!
I personally wouldn't do that though, because it does look awful (it pretty much ruined GridQuest for me).

If you want the player to move smoothly, and the screen to scroll smoothly, that'll be a bit trickier, but it should still be quite do-able.

Either way, the biggest problem is keeping track of objects outside the field of view - especially things like monsters, that move around and act intelligently (eg. if you need to check the distance between two objects which are both off-screen).

 
n/a

GamesterXIII



Registered
  04/12/2008
Points
  1110

I am an April Fool
3rd December, 2011 at 02:14:36 -


(it pretty much ruined GridQuest for me).




Sorry to be offtopic, but I agree with Sketchy. PLEASE don't do this. I'm skeptical and hard-to-please so I didn't have high hopes or expectations for grid quest. As soon as I saw the scrolling I wanted to kill myself.

 
n/a

nivram



Registered
  20/07/2006
Points
  171
3rd December, 2011 at 15:46:20 -

I have a open source World Editor on my website and it supports scrolling.

Marv

 
458 MMF2 & CTF 2.5 examples and games

http://www.castles-of-britain.com/mmf2examples.htm

Del Duio

Born in a Bowling Alley

Registered
  29/07/2005
Points
  1078

GOTW WINNER CUP 1!GOTW WINNER CUP 2!GOTW WINNER CUP 3!GOTW WINNER CUP 4!Evil klikerHasslevania 2!The OutlawSanta Boot
5th December, 2011 at 13:04:32 -


Originally Posted by Sketchy
It depends what you want to do exactly.

If you just want the screen to scroll one whole tile at a time (see Pixelthief's "GridQuest"), that's extremely easy - it doesn't even need any kind of loops. eg. https://skydrive.live.com/redir.aspx?cid=b1e7ee094271bbda&resid=B1E7EE094271BBDA!425&parid=B1E7EE094271BBDA!288&authkey=!
I personally wouldn't do that though, because it does look awful (it pretty much ruined GridQuest for me).

If you want the player to move smoothly, and the screen to scroll smoothly, that'll be a bit trickier, but it should still be quite do-able.

Either way, the biggest problem is keeping track of objects outside the field of view - especially things like monsters, that move around and act intelligently (eg. if you need to check the distance between two objects which are both off-screen).



Yeah, that's what I was aiming to do. I figured it would be a lot easier than a smooth style movement. That jumping around effect doesn't bother me (like Gridquest and Ultima have), but I'm old and all those RPGs used to have that. I have the rose-colored googlie goggles on

 
--

"Del Duio has received 0 trophies. Click here to see them all."

"To be a true ninja you must first pick the most stealthy of our assorted combat suits. Might I suggest the bright neon orange?"

DXF Games, coming next: Hasslevania 2- This Space for Rent!

Del Duio

Born in a Bowling Alley

Registered
  29/07/2005
Points
  1078

GOTW WINNER CUP 1!GOTW WINNER CUP 2!GOTW WINNER CUP 3!GOTW WINNER CUP 4!Evil klikerHasslevania 2!The OutlawSanta Boot
5th December, 2011 at 13:04:55 -


Originally Posted by nivram
I have a open source World Editor on my website and it supports scrolling.

Marv



I'll check it out, thank you nivram.

 
--

"Del Duio has received 0 trophies. Click here to see them all."

"To be a true ninja you must first pick the most stealthy of our assorted combat suits. Might I suggest the bright neon orange?"

DXF Games, coming next: Hasslevania 2- This Space for Rent!

Windybeard Games



Registered
  14/04/2005
Points
  219

You've Been Circy'd!VIP MemberCandy Cane
5th December, 2011 at 20:57:07 -

You could just use large maps that load at the start of screen and then when player leaves that area the it loads the next area. It would scroll smooth within the zone and would have to transition between zones. It would look great and would be easy to do and efficient.

But maybe i have misunderstood what you are asking?

 
n/a

Del Duio

Born in a Bowling Alley

Registered
  29/07/2005
Points
  1078

GOTW WINNER CUP 1!GOTW WINNER CUP 2!GOTW WINNER CUP 3!GOTW WINNER CUP 4!Evil klikerHasslevania 2!The OutlawSanta Boot
6th December, 2011 at 13:25:07 -

Okay, I looked at the examples you guys suggested and went with Sketchy's.

It's amazing to me what you were able to do with only 4 lines of code (more or less) however I did have some questions about how I could expand upon it:

1) I replaced the grass tile with my own grass and the brick walls with trees. I see you did what Pixelthief did for Gridquest and stored the tileset in the tiles themselves, and used directional values to call them back. Does that mean directional value 0 = grass, 1 = tree, and so on? I have a ton of graphics for this, mostly "fringe tiles" that transition stuff like grass to desert, coastlines and etc. How would I make it so that I could put objects on top of these ground tiles? This would be cool because I could then put trees on top of grass / dirt or whatever and not use up a ground tile.

2) How would on-screen enemies for something like this work? Would they too be like objects on top of ground tiles that just compare the ground for obstacles and change position?

3) What did you use to fill in the array? Are there any size X/Y limitations to what I could use with the example? For instance what in your opinion would be the best sort of editor to create the world that's going to be called back in the gama exe?

Here's a screenshot of what I have so far, mind you it's very basic. I'm using a window control object so you can resize the screen 3 different sizes to make it better. The hero's sprite will change depending on his current class so right now this is a regular run of the mill warrior.

Image

Thank you!

Edited by Del Duio

 
--

"Del Duio has received 0 trophies. Click here to see them all."

"To be a true ninja you must first pick the most stealthy of our assorted combat suits. Might I suggest the bright neon orange?"

DXF Games, coming next: Hasslevania 2- This Space for Rent!

Windybeard Games



Registered
  14/04/2005
Points
  219

You've Been Circy'd!VIP MemberCandy Cane
6th December, 2011 at 13:46:09 -

What i do is not use direction values, i use animation values, that way you can have almost endless amounts of tiles, I use direction tiles for the different "class" of tile for example grass, sand, snow etc. To drop tiles onto of tiles i have several loops run one after another. I have a loop which drops terrain tiles, then another that drops the decoration and other stuff, then another which drops mobs and interactive stuff. You can also implement into your editor a layer system which i did and it works well, so i can decide during the editro process which layer i want the tiles to print onto.

For enemies, crates etc i place a marker which holds the type of enemy details on it and with fast loops i get the marker to shoot the object required at 0 speed and then the marker destroys itself.

To fill the arrays you have to crate a level editor, create some sort of tile selection and dropping system and then when you have created your level in the editor it saves each tile placed to the array, then you only need have one gameplay screen which loads the level via fast looping at the start of the frame.

I save each level i create to a different array and then have a folder of level arrays which the game calls for each level when it is entered.

Im not sure if there is a x/y limitation and if there is it will be massive!!

I would create a basic 32x32 or similar size level editor. the basic drop and save/load stuff can be found in loads of examples here but once you get the hang of it you can start doing some really great things that not only make your game faster to make, it dramatically reduces file size and gives you unlimited amounts of freedom to do what you want. Plus if you make a nice level editor you can bundle it with the game.



 
n/a

Sketchy

Cornwall UK

Registered
  06/11/2004
Points
  1971

VIP MemberWeekly Picture Me This Round 43 Winner!Weekly Picture Me This Round 47 WinnerPicture Me This Round 49 Winner!
6th December, 2011 at 15:26:49 -

I agree with pretty much everything Windybeard Games has said.

Here's how I handle terrain transitions / fringing...
Firstly, I set up all the tile images like this:

Image

(Yes, it's isometric, but the same rules apply).
Animation 0 contains water tiles diagonally adjacent to land.
Animation 1 contains water tiles directly adjacent to land. Note that pink represents transparency here.
Animation 2 contains land tiles.
Further animations might contain forest / desert / mountain / etc tiles.

Now, each water tile is actually composed of two different tiles - with Animation 1 layered directly on top of Animation 0 (the transparency allows some parts of Animation 0 to be visible underneath).
What we do next, is set the direction of Animation 0 according to which diagonally adjacent tiles contain land; and set each direction of Animation 1 according to which directly adjacent tiles contain land.
We do this by adding to them the values shown below.

Image

So for example, if there is land North and South, we would add 1 and 4 (= 5) to the direction of Animation 0. Now if you go back to the first image, you'll see that direction 5 contains patches of sand in the North and South corners.

Here's a more complete example:

Image


There's an article and some example files here:
http://www.create-games.com/article.asp?id=1869

 
n/a

Del Duio

Born in a Bowling Alley

Registered
  29/07/2005
Points
  1078

GOTW WINNER CUP 1!GOTW WINNER CUP 2!GOTW WINNER CUP 3!GOTW WINNER CUP 4!Evil klikerHasslevania 2!The OutlawSanta Boot
7th December, 2011 at 12:33:07 -

Sounds complicated, but thank you for your help guys

I'll make something work

 
--

"Del Duio has received 0 trophies. Click here to see them all."

"To be a true ninja you must first pick the most stealthy of our assorted combat suits. Might I suggest the bright neon orange?"

DXF Games, coming next: Hasslevania 2- This Space for Rent!

Neil Butcher



Registered
  06/06/2010
Points
  133
11th December, 2011 at 02:22:11 -

If you haven't seen it yet, You could check out this level editor I made. If nothing else, just look through the included example file to see how it works.

Here is a link to the website where you can download it.
http://www.ultimateworldcreator.x10.mx

Here is a link to the project page here on TDC.
http://www.create-games.com/project.asp?view=main&id=2221

 
_____________________________________
UWC - http://www.ultimateworldcreator.x10.mx
MMF2 Examples - http://www.neilbutcher.ultimateworldcreator.x10.mx/examples_01.html

Jacob!



Registered
  17/06/2011
Points
  153
17th December, 2011 at 21:21:15 -

You may have a use for this example I made: http://community.clickteam.com/showthread.php?t=66263

 
Have you even been far as decided to use even go want to do look more like?
   

Post Reply



 



Advertisement

Worth A Click