Author Topic: Tilemap Editor  (Read 26904 times)

0 Members and 1 Guest are viewing this topic.

Offline nemo

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1203
  • Rating: +95/-11
    • View Profile
Tilemap Editor
« on: June 29, 2010, 12:16:59 pm »
i've been debating releasing this for awhile, but here goes. it's a basic tilemapper. im releasing this right now as a beta (if you can call it that) since all i want is feedback.
some limitations:
1) tilemap editor cursor is inaccurate. i'm hoping to fix this by reordering the movement code.
2) you can't export the HEX string of the tilemap. my program won't display it, since it's obnoxiously long to copy anyway.
3) you cannot load/save tiles, even though it gives you an option to load a tilemap. that's for the future.
4) you can only navigate through the program tile editor -> tile mapper, as of right now.

buttons of use in tile editor:
arrows - move cursor
[2nd] - invert pixel
[ + ] - next tile
[ - ] - previous tile
[Alpha] - start tilemapping

buttons of use in tilemap editor:
arrows - move cursor
[2nd] - display next tile in tileset.
[ + ] - display tile number
[Clear] - exit program

this definitely isn't a useful program (yet). some of the things i'm hoping to implement:
1) compression techniques. 1 byte = 1 tile, 1 byte = 2 tiles and RLE. let me know if you want me to support any others.
2) saving/loading tilemaps and their corresponding tilesets.
3) more accurate cursors
4) 16x16 tiles. *maybe* unless i gain enough support, they're out.

TL;DR: download. find some bugs, think of useful features. post 'em.



Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Tilemap Editor
« Reply #1 on: June 29, 2010, 01:35:23 pm »
Ok I am trying it atm. The first suggestion would be to use getkey instead of getkey() for moving the cursor around, because otherwise, it's hard to move one spot or swap a pixel color only once. I always end up accidentally moving two spots because there are no key delay on the first keypress when holding down the key.

I would also allow the cursor to move to the opposite side when it reach edges, so we don't need to move all the way back to the other side. Inverting the entire sprite would be a nice addition too, or maybe also filling black/erasing.

For the tilemap editor, same suggestions, plus allowing me to select which tile I want. Half byte will be nice, btw. I tried making a tile editor before and failed.

Maps larger than 12x8 would be nice too

Otherwise, nice so far.

Offline nemo

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1203
  • Rating: +95/-11
    • View Profile
Re: Tilemap Editor
« Reply #2 on: June 29, 2010, 01:55:36 pm »
the getkey() vs getkey->K thing i will experiment. then again, i could make there be two modes. i've done it before  ::)

forgot about that. i just added it, thanks for reminding me. except i only added it for the tilemap editor, not the tileset. since at most, to get to the other edge you only need to move 8 pixels. on a tilemap i'll make it do that, though.

scrolling (maps larger than 12x8) will be implemented too, forgot to add that.

my main problem is tile selection. can anyone let me know how they would like to see a tilemap editor work? DJ, i can think of a few ways:
1) leave as is (with a button that will indicate to delete the tile being added)
2) have 1-9 and A-F be tile keys. so pressing 1 will get first tile, 2 = 2nd tile, 3 = 3rd, etc.
3) drop down menu displaying like so at the left side of the screen:
[tile 0][tile 8]
[tile 1][tile 9]
[tile 2][tile 10]
[tile 3][tile 11]
[tile 4][tile 12]
[tile 5][tile 13]
[tile 6][tile 14]
[tile 7][tile 15]
except the actual tile is visible there.
4) combine all three. 2nd would display the next tile, 1-9 + A-F would give corresponding tile, [Alpha] would open the menu.

thoughts?
also, i've decided copying tiles will be another feature. so you could copy the data from tile 1's memory slot to tile 5's memory and then go to tile 5 and be able to edit a variation of tile 1.


Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Tilemap Editor
« Reply #3 on: June 29, 2010, 02:01:51 pm »
Usually, I simply do like in Super Mario 83+, I open the actual sprite sheet and you select the desired tile from there. Otherwise, pressing + select the next tile and - the previous one.

Offline nemo

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1203
  • Rating: +95/-11
    • View Profile
Re: Tilemap Editor
« Reply #4 on: June 29, 2010, 02:12:08 pm »
i'm going to give myself a challenge and do 2,3 and then +, - for next/previous tiles. DJ, should the tiles loop? like if i'm at my last tile, and i press +, should i stay at the last tile or should i loop back to no tile?


Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Tilemap Editor
« Reply #5 on: June 29, 2010, 02:28:17 pm »
Yup, looping would be nice. It would also be cool to show the selected tile AND the tile number (either in HEX or base 10), so you know at which point you are in the tile selection.

Offline jnesselr

  • King Graphmastur
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2270
  • Rating: +81/-20
  • TAO == epic
    • View Profile
Re: Tilemap Editor
« Reply #6 on: June 29, 2010, 02:32:25 pm »
Yes, they should loop both ways.

I, personally, think the menu should depend on your tiles.  If you are using half-byte, you can have at most 16 tiles, so two rows at the right or left edge of the screen.  (Depending on where you are placing the tile.)

I also would like cross-linking tiles.  Eg.  Teleport, or doors.

Offline nemo

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1203
  • Rating: +95/-11
    • View Profile
Re: Tilemap Editor
« Reply #7 on: June 29, 2010, 02:36:25 pm »
working on looping. atm, there is a cut off limit of 16 tiles per tilemap.
by cross linking tiles, do you mean two different looking tiles with the same value in the tilemap? you'd have to have some tricky program logic to get that to work in your program.

DJ, you mean in like the upper right hand corner of the screen show "tile: [tile picture] tile num: [0-15]"?

edit: i'm having a bit of a fight with the + and - keys. apparently, if you hold down [ - ] and the left arrow key, the hardware/axe/the OS throws a hissy fit and won't let you move. also, the minus key and the up arrow held in conjunction make the cursor move up and right diagonally. not good  :-\
« Last Edit: June 29, 2010, 02:41:00 pm by nemo »


Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Tilemap Editor
« Reply #8 on: June 29, 2010, 02:40:39 pm »
cross linking tiles are something to code by your own in your program. It cannot be implemented in a tilemap. The trick is to make sure to group teleport tiles together if you have many so if conditions are easier to write.

Nemo: Yeah, kinda, altough make sure it's to the upper left when moving the cursor to the right half, down when moving cursor to the upper half and vice versa, so it won't always hide the first tile in the map

Offline nemo

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1203
  • Rating: +95/-11
    • View Profile
Re: Tilemap Editor
« Reply #9 on: June 29, 2010, 02:44:09 pm »
DJ, i think i'll have it display upper left if the cursor's in the lower half of the screen, and lower left if the cursor's in the upper half. then again, i'm still working on the menu/+/- keys for getting the correct tiles. i believe i've encountered another getkey() grouping problem. i edited an above post.


Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Tilemap Editor
« Reply #10 on: June 29, 2010, 03:05:38 pm »
Yeah I often had issues with the left key x.x

Kinda annoying at times. I think it's the key delay not being long enough or something. You migth want to report this to Quigibo in case

Offline nemo

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1203
  • Rating: +95/-11
    • View Profile
Re: Tilemap Editor
« Reply #11 on: June 29, 2010, 06:20:01 pm »
due to the obnoxious key problems, [2nd] will increase the tile number and [alpha] will decrease. i got looping to work. it's ridiculously unoptimized (i think i store to the tilemap about 8 different times... it's pretty bad) but i'll optimize it later.
next i'll work on getting the menu selection. i probably won't do the 1-9 + A-F selection for the tiles, since i'm anticipating a similar getkey() problem, but i'll try marginally. after the menu, i think i'll work on getkey() improvement. then better navigation, saving/loading, and another test release. oh, and the tile options DJ was talking about. except i'm just implementing inverting the sprite, and leaving it blank since filling it black can be done with a combination.


Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Tilemap Editor
« Reply #12 on: June 29, 2010, 06:21:52 pm »
Sounds like a good deal. Good luck :)

Offline nemo

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1203
  • Rating: +95/-11
    • View Profile
Re: Tilemap Editor
« Reply #13 on: June 30, 2010, 02:21:43 pm »
i'm waiting for geometry drawing to be in axe for the menu, since that will simplify it greatly. the getkey problem is done, i think. it uses BASIC's now. now onto some menu clean-up and tackling appvars (:


Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Tilemap Editor
« Reply #14 on: June 30, 2010, 02:31:36 pm »
aaah ok ^^ Hopefully Quigibo implement geometry drawing soon