Custom Spritesheetz and the Level Editor


#1

Hi all! First and foremost I want to say: Great game, great engine and great attitude.

A buddy and I are currently developing a 2D platformer with all original content using the frogatto engine. He knows Java and C+ and I know…visual basic…and only a little at that. we’ve come up with a ground tile spritesheet but we are having trouble figuring out how to call from it when using the editor. The tileset is a 10x10 grid. From what we’ve gathered the config file for the arcade ground tiles uses the 3x3 tile set within the spritesheet and the little mnemonics are the pattern used.

Questions:

How does the editor pull the image from the spritesheet? I’ve seen some config files where the dimensions and location of each sprite on the sheet are used, but in arcade.cfg these are absent. How does it know what image to use?

What do the bits “Tiles: #” mean in the arcade.cfg? (I figured it was the number of tiles…but dont see how it matches the spritesheet)

When the editor places tiles does it randomly choose a PATTERN of tiles or does it randomly choose TILES to make up a pattern? (That may be a weird question so I hope you see what I mean haha)

What happens when a platform you want is larger than 3x3?

What do the ! and ? change or stand for in the sets of 3x3 mnemonics?

Thanks a bunch. We’ve hit a bit of a wall here.


#2

Hi, 8-Bit-Rex. Thanks. :slight_smile:
Jetrel wrote half an introduction to tilesets here: https://github.com/frogatto/frogatto/wiki/CreatingTilesets That might clear up some questions, but it’s not complete. Creating tilesets is one of the harder things to do, in my opinion – but I don’t know the process very well. However: If you want a 4x3 platform, you want to make a 4x3 multi-tile-pattern definition instead of a 3x3 one. Very straight-forward. The ! and ? characters are some sort of pattern-matching wildcard, but I’m not sure exactly what. I’m guessing maybe ‘empty space’ and ‘non-empty space’, but I’m probably not correct.

I’m not sure if this page is any help, but it might be: https://github.com/frogatto/frogatto/wiki/MakeTileset

I expect someone more knowledgeable will be along shortly.


#3

Thanks!

I’ve basically read through all the wikipages which have helped in general a little bit, but the ones on how the editor actual works is definitely missing a lot of detail (but that’s coming from someone who barely knows a programming language). I’ll keep your tips in mind for now until more info is thrown my way.


#4

This is f*#*ing awesome! We want people to do this, and we’ve been rather disappointed about how (relatively speaking) the fish haven’t bitten, yet. We’ve had one or two people talk about how they were doing mods or TCs, but it’s like … seriously, people. If you’re doing these, put them on the forum! Let’s get an actual community going around modding the game.

So yes, I’ll answer all the questions you posted, shortly. :slight_smile:


#5

Hey there I’m the other guy working on this project with 8-Bit-Rex. Glad to hear we are the only ones so far that is attempting a heavy mod of the game with original content. I hope I can contribute code and also help with documentation of not only our stuff but the source code you guys have so generously provided under the GPL/Qt-style dual-licensing model.

edit
I’m on the IRC channel btw.


#6

There are two ways this is done, because there are two major entities in the game. Everything in frogatto is either a tile, or an object. Objects can do pretty much anything, tiles are much more limited in what they can do (for example they can’t be animated) but are much easier to lay out on a map, and perform better (we have some special optimizations to spare drawing behind opaque tiles).

For both tiles and objects, there will be an image=filename.png

However, only objects specify a rectangular region. What tiles do, instead, is they use coordinates; it’s hard-coded to assume all tiles will be 16x16px (which may be something we can loosen up on). You tell a pattern which tile it uses (say, the 3rd tile down, and the 2nd tile to the right), and then it copies that whole tile.

It’s actually a coordinate. It’s two values, Y and X (in that order, which was a rare bit of pointless convention-breaking on dave’s part). The values are numbers, but in a really unusual twist, they’re not decimal (base 10), or hexadecimal (base 16) - instead, they’re base 36 (0-9, and then a-z; like hex, it counts from zero). There’s a good reason for this, which is that it means these coordinates will always be two letters - unless you’re using a ginormous texture bigger than 1024px in a given dimension, and … you both shouldn’t and can’t do that because we don’t allow more than 2 letters there.

You don’t need to anyways, because we have an automatic system to pull all of the textures out of the game, and “compile” them into a massive texture atlas that compacts them algorithmically (better than any human could ever hope to).

It does both. I think what you refer to by the former is what we call “multi-tile-patterns”; where we have a predefined image that spans several tiles, will only fit an exact pattern of underlying tiles (say, a corner), and can’t be cut into because it wouldn’t seam well with anything else.

What you refer to by the latter; where some modular tiles that would seam well with anything else happen to be laid down to form a complex shape, is what we call regular or “single” tile patterns.

We have limited support for larger patterns; I think we can also do 5x5, and have used it on a couple rare occasions. However, we’ve got a much more powerful and complicated concept called “multi-tile-patterns”, which I need to write a tutorial on. It’s rather unusual, and I’m not sure there are a lot of other games that use it - in fact it might be entirely a new innovation on our part.

There are regular expressions, although the ! may be unorthodox.

!, like in programming, means “NOT”. It means the tile must be “anything but” the type in question to match the pattern.

?, means that, to match, the tile must be either empty, or be the stuff in parentheses, to match. But it can’t be anything else.

Note that (following the rules of regex), these can be combined into groups; for example, a listing like (grs|grk|grb) means it has to be any one of those three (this is an OR operation). If you’re wondering, an “AND” operation is meaningless, since there can only be one tile per location on the map - at least, for that individual zorder.

Which leads to a fairly major point, which is that these tile-patterns only compare themselves within the same zorder. Our tiles are laid out in flat layers, and each layer is assigned a zorder which declared which go in front/back. Tiles will only be compared with each other to give them transitions inside the same layer.


#7

Here’s an old prototype I was using for ground/wall tiles. The new sprites look different but are the same size. 10x10 tiles that are 16x16px.

[URL=http://imageshack.us/photo/my-images/98/ground3.png/][/URL]

Thanks for the help!