RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
A couple questions

0 Members and 1 Guest are viewing this topic.

****
Rep:
Level 83
I am coding my own RPG engine and I have got to the stage where I am going to rewrite it and add graphics.
However, I am not sure how to handle the maps.
So here is my questions.

1) Is there any other way to handle 2D maps other then tile based?
2) If so, what are they?
3) If I go with (or stuck with) tile based maps, would it still be logical to use pixel coordinates to place events?

******
Rep:
Level 91
Well I'd stick with tiles.
When I did what you are doing now, I discovered a way that seemed easier to implement for me.
It's something really neat it goes kind of like that:
You use 2 maps for each map you have (this is also the biggest con of this system and the mere reason I am against it now)
the first is the top layer, the actual map.
the second is invisible to the user, he can never see it.

While the first is what the user sees the second is what you use to determine a lot of things:
1. pass-ability
2. special locations you might wish to use for npcs and portals and so on

You do this by basic colors.
For example you can color the map in 2 colors: grey and black.
The black part is where you stand on, you cannot go through or stand on black (unless of course your collision function allows it, for example when I did it I checked if it's thin black or thick black, and allowed to jump or drop through thin black marks, like you'd expect to be capable of doing in any platformer)
The grey is where you CAN walk.

Now, you simply load that second map and use your collision function to deal with it.
For example the input is the right arrow button, so you check if the next pixel, 3 pixels, 100 pixels your call, are black or grey, if it's grey you move the sprite, otherwise you don't.
Or rather, you want to check if it's not black, assuming you'd use the colors to place npcs and monsters.

This could be done by simply adding dots of various colors to the map, and then when you load the graphics you check the map for colors, let's assume all green dots mean monster 1, so when you go through the map and find a green pixel you call a function that would place a copy of monster 1 there
You do the same for just about anything you wish to place.

Pros:
-This is very intuitive and since you draw those maps in paint, it's very simple for you to say "alright I'll put my npc right... here!"
-It's also a pretty simple engine and you can really go wild with the colors

Cons:
-There are only that many colors to begin with and you'd need unique ones for a lot of things
You'll probably have to remember which colors you already used in the current map.
-Having 2 maps for every map costs in a larger download, despite the fact those maps are small.
-You'll need to make the actual map based on the color map (or the other way around, which is way harder in my opinion), sometimes it's not easy and not fun.
-Depending on your collision function, you'll have to be VERY careful when you draw the color map, a pixel out of place and well... bad things.


---
oh and assuming you go with tiles, pixel based might not be great, that's why it's called...tile-based.
You'd want to split the map into tiles to begin with and treat it as blocks.
Of course you want them to be big enough to be usable for your graphics without wanting to kill yourself and yet small enough to be suitable for the whole walking thing.
Avoid pixel-based unless you go color-map style.
« Last Edit: July 02, 2010, 10:22:13 PM by blueXx »
holy shit my sig was big!

****
Rep:
Level 83
Interesting. That's a nice idea. However, I am not sure how a user would like it. Thanks for the idea though

****
Rep:
Level 84
Is a New Zealander
I am a fan of pre-rendered backgrounds, and drawn backgrounds. They look way less monotonous than tile based mapping, but are a LOT of extra work. If this is a solo project, go with tiles.
I'm much too lazy to put an actual signature here.

****
Rep:
Level 83
Its definitely a solo project. I just want to create a decent, cross-platform, free RPG engine. So, it looks like I am going to have to go with tiles. Ehh, at least I have time to think about it.