Community Tile-Based Level Editor? You don't say!

For questions about using Classic.

Post » Wed Jan 19, 2011 3:00 am

[quote="Cloud_GL":dsprs65x]Well I think all those who want some kind of tile editor want to (in my opinion):

-to be able to "paint" with the mouse click tiles that are placed orthogonally (like some kind of by default snap to grid), these tiles having the ability to be over or below moving elements/characters/player. Or being able to draw the tiles in the different layers and they fit accordingly.[/quote:dsprs65x]

Yeah snap to grid would probably be something everybody would want, but the tiles would still be 4 sided, so iso/ ortho would already be available that way.

[quote="Cloud_GL":dsprs65x]-the tiles to be grouped in one "single large image" or "single set of images" where you can select 1 or a few more to do something like a cluster of tiles paint (for example a tree is made of 3 tiles so you can repeat the middle tile to make taller trees, but selecting the 3 tiles at the same time lets you draw many trees doing 1 click per tree).[/quote:dsprs65x]

I guess this is the most important or basic.[/quote]

Sounds nice, but would require a lot more events than its probably worth.

[quote="Cloud_GL":dsprs65x]But Tokimsom ask for tiles that has properties/values in it; making sound per tile can be done by using an invisibles areas below the graphics if you ask me no need for precision there, but a graphical transformation per tile touched can get tricky without per tile interaction...mmmh...[/quote:dsprs65x]

Um, yeah you cant really import private variables, or create new objects.
That's just way too specialized.

Basically you want it to be as simple as possible, so that everybody can use it.
But set up so that you can do more if you want.
Image Image
B
161
S
48
G
90
Posts: 7,356
Reputation: 66,767

Post » Fri Jan 21, 2011 4:37 pm

[quote:2wdbch4u]Basically you want it to be as simple as possible, so that everybody can use it.
But set up so that you can do more if you want.[/quote:2wdbch4u]

Yeah I guess it would be best if it's easy and useful for everyone, personally I would like to be able to "draw" big stages using a few tiles easily, and as it was showed in the "platform school" games, using the graphics only as that and below of them having the real physical objects and events, this last part doesn't necessarily needs to be tile based, I think.
B
2
G
2
Posts: 32
Reputation: 714

Post » Sat Jan 22, 2011 5:37 pm

Well I guess this isn't actually going to happen. There are too many different ways to build a level editor and a single editor won't suit everyone, so. I suppose we can keep this around for general level editor discussion though.

With that said..It's been established that using sprite objects as tiles is a bad idea. For collision & special tiles they would be good, but definitely not for graphical tiles that serve no purpose but to sit there and look pretty.

That being the case, what do you think would be the best way to import these 'graphical tiles?' You would need to be able to upload an image, then cut out a single (or multiple) tiles to place somewhere on the editor. How would you go about this? What object would you use for the tile?
Image
B
225
S
27
G
13
Posts: 1,774
Reputation: 18,024

Post » Sat Jan 22, 2011 7:42 pm

- use TiledBackground object to store the tileset texture
- change the TiledBackground size and image offsets accordingly to pick the desired tile (for example if you use 32x32 tileset and want to use a tile at 64x32 within the tileset, you set tiledbackground size to 32x32 and image offset to 64, 32 respectively to get the desired tile)
- set position at desired location, paste into Canvas
- optional: apply color filter (if you use white tiles, you can get them to be of any color!)

This is much more efficient than sprites.
B
62
S
21
G
12
Posts: 1,910
Reputation: 13,155

Post » Sat Jan 22, 2011 9:31 pm

I also thinked that using sprites seemed a bad idea, but how to select what to tile inside the tiledbackground image object?, and then how to switch from one selection to another easily?
B
2
G
2
Posts: 32
Reputation: 714

Post » Sat Jan 22, 2011 10:02 pm

[quote="Mipey":2bu9voeo]- use TiledBackground object to store the tileset texture
- change the TiledBackground size and image offsets accordingly to pick the desired tile (for example if you use 32x32 tileset and want to use a tile at 64x32 within the tileset, you set tiledbackground size to 32x32 and image offset to 64, 32 respectively to get the desired tile)
- set position at desired location, paste into Canvas
- optional: apply color filter (if you use white tiles, you can get them to be of any color!)

This is much more efficient than sprites.[/quote:2bu9voeo]

Clever.

However, could you elaborate on that a bit?

When 'selecting' a tile from the tileset, would you create a whole new tiled background object with the offset to place in the array? We do need to save this data after all. Also, you mentioned pasting into a canvas. I assume this is after loading the tiles who's offsets are saved in the array?
Image
B
225
S
27
G
13
Posts: 1,774
Reputation: 18,024

Post » Sat Jan 22, 2011 10:15 pm

Here is a simple example:

http://dl.dropbox.com/u/629300/tileset.cap

Note that the texture MUST be power of 2 in order for image offset to work.

Of course you can save those offsets, I'd use hashtable and string tokens, like this:

Hashtable Key: "BigBadMonster"
Hashtable Value: "128,32,64,64"

The value is a string, you can compose it like this 128&","&32&","&64&","&64

So when you read the value at key "BigBadMonster", you use the GetToken expression to get values (it is a string, so there is int() function to convert into number):

Tileset: set Width to int(GetToken(Hashtable.Value("BigBadMonster"), 3, ","))
Tileset: set Height to int(GetToken(Hashtable.Value("BigBadMonster"), 4, ","))
Tileset: set image offset to int(GetToken(Hashtable.Value("BigBadMonster"), 1, ",")), int(GetToken(Hashtable.Value("BigBadMonster"), 2, ","))

This way you get exactly what you want - the texture of 64x64 at 128x32 within TiledBackground.

You can spawn as many tiled background objects as you want ,I guess, doesn't seem to be that big of a performance hit. Or you can use the Canvas paste method. The texture remains the same, so you don't use up extra memory by using multiple instances of Tileset (TiledBackground object).
B
62
S
21
G
12
Posts: 1,910
Reputation: 13,155

Post » Sat Jan 22, 2011 11:34 pm

https://sites.google.com/site/bgeatelie ... ects=0&d=1

Here I modified a little bit the file so it draws the tiles in a more grid snap way, but didn't really understand how to write and read the map created :\

Also I'm starting to doubt the usefulness of this, even if we manage to make a good tile map creator, it will only be a text file that the game after started will read and then draw the scene. Unless there were a way to make the drawn map appear later on the editor...
B
2
G
2
Posts: 32
Reputation: 714

Post » Sun Jan 23, 2011 12:50 am

Thanks Mipey! This is indeed much better than using sprite objects for graphic tiles, and will make selecting multiple tiles much easier.
Image
B
225
S
27
G
13
Posts: 1,774
Reputation: 18,024

Previous

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 4 guests