Omnimaga

Calculator Community => Other Calc-Related Projects and Ideas => TI Z80 => Topic started by: simplethinker on October 22, 2009, 04:09:27 pm

Title: Sprite/tileset Editor- need input
Post by: simplethinker on October 22, 2009, 04:09:27 pm
As proof that I haven't accomplished nothing in the long time since my last public update to Chip's Challenge, I decided to finally release the sprite and tileset editor (for computer; written in Python) that has distracted me every time I get the motivation to work on CC.

The big features are:
- Ability to save and edit tiles
- Give names and numbers to tiles (to ease integration into the Tilemap editor I'm also working on)
- See what the tile looks like and how it compares to the old one (if editing)
- Output/export the tiles in various formats (this is the thing I need input on; see below)
- All the above but with entire tilesets
- Looks cool :)
- User-friendly (which, if you know me, you realize is pretty darn amazing :o)
- Probably more things that I've just forgotten about.

Because of my short attention span and new ideas that required complete re-writes (or at least sloppily patching things together), this has remained in limbo for months with really only the final touches left to do.  One of the biggest road blocks to finishing things up has been what to do with the tiles once they've been made.  Here are the ideas I've come up with (when I say "export" I mean either writing to a text file or printing to the screen):
1) Do nothing.  I'm not dismissing this since the editor was initially created to streamline the process of making sprites, not to help with actual coding or format conversions.
2) Export as binary or hex strings (e.g. '10010110' or '95', etc...).  The hex string could be used for Celtic3's det(17 command; not sure about uses of binary
3) Export in Asm format (using the .db's and stuff).
4) Create an actual .8xs (string) with the hexadecimal format so it could be used by C3's identity(5.  I don't think this would be too useful, but I'm just throwing it out there.
5) Create a .8xi picture variable.  This could be most useful for tilesets, since you could create the tiles and then have the picture conversion automated.
6) <insert other ideas here>

I'd love everyone's opinions on this.  I could do one of those, all of those, or anything in between.  I'm also open to any other ideas.

Also, as I stated above, I'm not sure if I should write things to a file or just print them to the screen (or a mix), so input on that would be good too.
Title: Re: Sprite/tileset Editor- need input
Post by: trevmeister66 on October 22, 2009, 11:16:03 pm
I'd go with doing a combination of exporting to Bin/Hex String AND .8xi Pic Var. That way the user can choose whichever, depending on how they plan to use the data.
Title: Re: Sprite/tileset Editor- need input
Post by: DJ Omnimaga on October 23, 2009, 01:03:32 am
i would say both ASM and BASIC format like Trev said, so it can be used by everyone

Title: Re: Sprite/tileset Editor- need input
Post by: cooliojazz on October 23, 2009, 01:08:29 am
thirded. also FINISH THIS. I DEMAND YOU. something like that would be awesome! =D
Title: Re: Sprite/tileset Editor- need input
Post by: DJ Omnimaga on October 23, 2009, 01:11:12 am
Then Cooliojazz can release an awesome xLIB RPG :D
Title: Re: Sprite/tileset Editor- need input
Post by: Eeems on October 23, 2009, 01:51:13 am
Then DJ will release a secret 3D uber lif3 c0un73r 0f d00m that he has been working on for the last couple of months
:P
Title: Re: Sprite/tileset Editor- need input
Post by: cooliojazz on October 23, 2009, 01:52:04 am
EDIT: err, @DJ:yep! well, Paperworld isn't nesesarrily an RPG per se. Well, maybe...
10 seconds..... Rraar!
Title: Re: Sprite/tileset Editor- need input
Post by: jsj795 on October 23, 2009, 10:15:05 am
I fourth it too... It'll help me make TLM Xlib version...
lol i must finish the basic version first :P
Title: Re: Sprite/tileset Editor- need input
Post by: simplethinker on October 23, 2009, 05:27:50 pm
I'd go with doing a combination of exporting to Bin/Hex String AND .8xi Pic Var. That way the user can choose whichever, depending on how they plan to use the data.
Thanks ;D  It should be easy to add in a drop-down menu to select what the user wants.
Title: Re: Sprite/tileset Editor- need input
Post by: cooliojazz on October 25, 2009, 11:22:06 pm
Could you also maybe have something where you can preview your current tile in, say, a 4x4 map of itself, just to make sure it stacks nicely and stuff?
Title: Re: Sprite/tileset Editor- need input
Post by: DJ Omnimaga on October 25, 2009, 11:34:05 pm
A map editor (maybe not necessarly with the ability to save yet, but just to test the tiles) would be good
Title: Re: Sprite/tileset Editor- need input
Post by: simplethinker on October 26, 2009, 05:05:06 pm
Could you also maybe have something where you can preview your current tile in, say, a 4x4 map of itself, just to make sure it stacks nicely and stuff?
That's an excellent idea!

A map editor (maybe not necessarly with the ability to save yet, but just to test the tiles) would be good
A full map editor is the plan ;D
Title: Re: Sprite/tileset Editor- need input
Post by: DJ Omnimaga on October 26, 2009, 11:16:28 pm
cool ^^
Title: Re: Sprite/tileset Editor- need input
Post by: simplethinker on October 27, 2009, 06:29:55 pm
As for exporting, should it default to just printing to the screen but have the option for putting it in (or appending to) a file?  Also, I think I might be able to copy things to the clipboard (where data for cut/copy/paste is stored).  If I do that, should I still keep printing to screen (or file) as the default?

With regards to undo/redo, is 20 actions (defined by a full-screen change like inverting/clearing, or setting/resetting a bunch of pixels at once) enough to keep, or should I save more?
Title: Re: Sprite/tileset Editor- need input
Post by: DJ Omnimaga on November 18, 2009, 12:14:25 pm
hmm to be fair, i am unsure if Undo would be  a good idea on calc, unless you can keep the RAM/speed requirements small. If you can, then I guess 20 would be more than enough, or maybe 10
Title: Re: Sprite/tileset Editor- need input
Post by: Geekboy1011 on November 18, 2009, 10:29:33 pm
maby user defined in a config menu???
Title: Re: Sprite/tileset Editor- need input
Post by: simplethinker on November 27, 2009, 12:20:46 pm
There are two things I'm looking for input on; see below.

Notes:
With the way I've programmed the undo/redo, the undo depth is determined by a global constant, so as long as you guys promise not to look at the code (or at least the section where I abuse global variables) I'll add an option for the user to change the undo depth ;) (the reason I was wondering about how many are needed is that I forgot computers have hundreds of megabytes of RAM and not two dozen kilobytes XD).

Some more things I'm planning on:
- Tilemap editor (I already said this, but it was sort of hidden in the first post)
- A picture editor (probably separate program, but the engine should be nearly the same)
- Manually organize the tiles for exporting as a picture
- Different "brush" sizes/types (see below)

Things I might add:
- Non byte-wide tiles (depends on whether I can figure out the bitmap format for them)
- Grayscale (if I can figure out the relevant bitmap format).  I could probably have it export them as multiple sprites representing the masks

"Below":
1) About the brush sizes/types: what should I have besides something that fills/clears pixels?  Right now, the brush only does one tile, and left-clicking darkens it, and right-clicking clears it.  All I can think of right now is having larger sizes, and I'm not sure about shapes (keep in mind most tiles will probably be no larger than 16x16).

2) What kind of whole-tile operations should there be?  As of right now, there is:
- Reset back to what it originally was
- Clear the whole thing
- Invert the colors
- Rotate
- Flip
- (others?)
Title: Re: Sprite/tileset Editor- need input
Post by: DJ Omnimaga on November 27, 2009, 10:37:19 pm
Zoom in/out by 2x? (would cause quality loss if zoomed out and tile to be truncated when zoomed in)

I am unsure though, for now x.x, sorry. I am glad this is still alive, though.

Title: Re: Sprite/tileset Editor- need input
Post by: simplethinker on November 28, 2009, 10:51:26 am
I suppose a picture of what this actually looks like might be useful :).  I haven't updated the menu/sidebar for a while, so there actually is more than just clear and reset ;)
Title: Re: Sprite/tileset Editor- need input
Post by: DJ Omnimaga on November 28, 2009, 05:08:20 pm
Mhmm, will it be possible to edit multiple sprites at once? Like, an entire tilemap from a picture, for example? I kinda like to see the other tiles near the one I am editing for example when I edit castle walls with different sprite for each sides
Title: Re: Sprite/tileset Editor- need input
Post by: Galandros on November 28, 2009, 05:16:01 pm
Try to output in every format you can. Even output in .bin files. (sometimes useful)

Add an optional greyish light grid, 4x4 would be excellent.
Also for tilesets keep user friendy when there is need to move tiles around. I hate the work to move tiles around in Graphics Studio...
Title: Re: Sprite/tileset Editor- need input
Post by: ztrumpet on November 28, 2009, 06:55:03 pm
Looks nice!
I agree with the light grid.
Title: Re: Sprite/tileset Editor- need input
Post by: simplethinker on November 30, 2009, 05:34:34 pm
Mhmm, will it be possible to edit multiple sprites at once? Like, an entire tilemap from a picture, for example?
I might be able to do something like that, such as editing a few tiles at once.  Being able to do an arbitrary number would be tricky, and I don't think I would be able to organize the screen reliably.  If you want to be able to do an entire tileset in a picture, it would be probably easiest (for me :P) to use the picture editor and I can add an option for it to split the pic into separate tiles.

For full tilesets, I was planning on letting the user arrange them in a picture (drag-and-drop) themselves.  Would that work?

Earlier in this thread cooliojazz suggested a preview of a 4x4 (or some other number) map of itself.  I could modify it so it shows a map of the tile surrounded by other tiles, so you can see how it connects to the others.

Add an optional greyish light grid, 4x4 would be excellent.
I think I know what you mean.  I've attached a picture of what I have (ignore the bright red background, but the more closely-spaced blocks are carrying over to the actual editor).  Since the grid has to be visible when surrounded by both gray and black, I had to add a blueish-redish tint.

Quote
Also for tilesets keep user friendy when there is need to move tiles around. I hate the work to move tiles around in Graphics Studio...
How does Graphics Studio do it (I've never used it before), and how do you think I should do it?  I was just thinking of drag-and-drop with the option to either swap two tiles, or insert a tile between two others.
Title: Re: Sprite/tileset Editor- need input
Post by: DJ Omnimaga on November 30, 2009, 11:53:27 pm
Being able to edit an entire 8xi format tilemap at once would be cool, providing there are options to add red guides between tiles
Title: Re: Sprite/tileset Editor- need input
Post by: Galandros on December 06, 2009, 12:07:25 pm
Add an optional greyish light grid, 4x4 would be excellent.
I think I know what you mean.  I've attached a picture of what I have (ignore the bright red background, but the more closely-spaced blocks are carrying over to the actual editor).  Since the grid has to be visible when surrounded by both gray and black, I had to add a blueish-redish tint.
[/quote]
The screenshot is exactly what I asked. Nice work.

Quote
Also for tilesets keep user friendy when there is need to move tiles around. I hate the work to move tiles around in Graphics Studio...
How does Graphics Studio do it (I've never used it before), and how do you think I should do it?  I was just thinking of drag-and-drop with the option to either swap two tiles, or insert a tile between two others.
Graphics Studio is simply a hassle, so no bother on explaining. I don't remember thoroughly how I did last time, too. I needed to make Lost Legends I font compatible with ASCII. (ease my life after some work on Graphics Studio). I think I had to insert tiles, copy/paste to there then delete the other one.

Drag-and-drop multiple tiles is as friendly as I wish. Selecting and doing one action on multiple tiles should be made by now, I guess.

Another request: the tiles appear in more than 1 row. This is another problem I found in Graphics Studio.

Keep up the progress.
Title: Re: Sprite/tileset Editor- need input
Post by: DJ Omnimaga on December 06, 2009, 01:24:28 pm
LL1 is still alive? That would be cool, I was kind of worried it was dead (or never started at all) :<
Title: Re: Sprite/tileset Editor- need input
Post by: Galandros on December 06, 2009, 02:33:52 pm
LL1 is still alive? That would be cool, I was kind of worried it was dead (or never started at all) :<
I picked it. I basically just cleaned the house by now. Changed source code around and correct one or two bugs. :)  (resaved maps and a text display error)

The design appears to be done and completed by Zera. It eventually will need some balance on the monsters and bosses.
Liazon almost completed the graphics code.
The rest is up to me.

I should update the svn when I have a chance...
Title: Re: Sprite/tileset Editor- need input
Post by: DJ Omnimaga on December 06, 2009, 03:06:52 pm
Yeah I remember Liazon did some coding on the tilemapper IIRC. However, I think after you mentionned you worked on it again half a year ago, I heard nothing anymore about it :(, I am kinda glad you still work on it, though.
Title: Re: Sprite/tileset Editor- need input
Post by: Galandros on December 06, 2009, 04:22:22 pm
Yeah I remember Liazon did some coding on the tilemapper IIRC. However, I think after you mentionned you worked on it again half a year ago, I heard nothing anymore about it :(, I am kinda glad you still work on it, though.
half a year passed quickly. -.-

Let's get back on topic.

About exporting, it could be cool your own file format that even include comments about tiles and a name that you give to each tile/map.
Allow to export both in binary and hex text with .db directive.

Binary can be useful for tiles because you can see how the sprite looks like directly on source code if you have good eyes and imagination. But hex is more compact on source code.

Exporting .bin files is useful, too. SPASM and maybe other assemblers can include that on the program.
And even exporting maps and tilesets to .bmp or .png would be excellent.
Title: Re: Sprite/tileset Editor- need input
Post by: TIfanx1999 on December 06, 2009, 07:08:26 pm
I'd have to agree, I think being able to export a map as a .bmp would be really cool. If you have support for making maps that is. =)
*edit* I see that you already have a map maker planned for this as well. I think grayscale would be a must. Importing sprites of variable size from a .bmp would be nice too.
Title: Re: Sprite/tileset Editor- need input
Post by: simplethinker on December 21, 2009, 02:44:52 pm
A little update since I noticed it's been nearly a month:  With all of the cool ideas you guys have given me, I realize this is going far beyond the simple little tile editor it started as, so the project status has gone from just adding the finishing touches to still needing to implement most things.  Because of this, I'm planning on releasing a scaled-down version (one sprite at a time; monochrome; not as many choices for exporting) in the next few days :) (it's actually got more stuff that the original plan, so it's not that bad :P)
Title: Re: Sprite/tileset Editor- need input
Post by: DJ Omnimaga on December 21, 2009, 07:44:15 pm
mhmm nice, I like the idea of having some sort of lite version and full version
Title: Re: Sprite/tileset Editor- need input
Post by: simplethinker on December 22, 2009, 02:19:52 pm
Okay, since my grandma and uncle are staying here until Christmas, the "next couple days" for the mini version is going to be "within a couple days after Christmas" (I would feel like a jack ass if I was on the computer while they were here :()
Title: Re: Sprite/tileset Editor- need input
Post by: DJ Omnimaga on December 22, 2009, 07:12:06 pm
x.x that sucks. Usually my parents didn't mind if I went on the computer while family was home but only if I stayed on it for like 5 or 10 minutes maxĂ 

I hope to see some progress after Christmas :P
Title: Re: Sprite/tileset Editor- need input
Post by: TIfanx1999 on December 23, 2009, 09:52:26 pm
I don't remember if this has been mentioned yet or not, but horizontal/ vertical sprite mirroring would be cool.
Title: Re: Sprite/tileset Editor- need input
Post by: simplethinker on December 30, 2009, 04:48:41 pm
Here's the demo/lite version.  All you need to run it is Python 2.5.* or later (but not Python 3k).  The included features/restrictions are:
- Single monochrome tile editing
- Only byte-wide tiles (height has no restrictions)
- Can set a default tile to revert to (to easily get back to the last "good" tile)
- No saving
- Only exports as a hex string
- Whole-tile operations
- Undo/redo

To start:
- Run Editor.py
- You'll be prompted for the tile size
To use:
- Left-click to set pixel, right-click to clear it
- The menus have the rest of the things you need

(Please note I got tired of all the rewrites that this is pretty much hacked together and not very well organized)
Title: Re: Sprite/tileset Editor- need input
Post by: Eeems on December 30, 2009, 06:30:27 pm
crap, I can't get anything past python 2.3 working on my comp...:/
Title: Re: Sprite/tileset Editor- need input
Post by: simplethinker on December 30, 2009, 06:36:51 pm
crap, I can't get anything past python 2.3 working on my comp...:/
What kind of problems are you having? (during the installation, during execution, compiling, etc..)
Title: Re: Sprite/tileset Editor- need input
Post by: Eeems on December 30, 2009, 07:15:04 pm
just wont install, it fails...
and I can't try again, I'd need my dad's password...
Title: Re: Sprite/tileset Editor- need input
Post by: TIfanx1999 on December 30, 2009, 11:25:01 pm
I'll give this a look later and give you some feedback.
Title: Re: Sprite/tileset Editor- need input
Post by: DJ Omnimaga on December 31, 2009, 02:42:47 am
Nice ^^ I'll try later, I think I alerady got python installed
Title: Re: Sprite/tileset Editor- need input
Post by: Galandros on December 31, 2009, 05:07:07 am
You can try to use a portable version of Python.
http://www.portablepython.com/
It doesn't seem to install anything, just unpack and copy the files...
Title: Re: Sprite/tileset Editor- need input
Post by: Eeems on January 01, 2010, 01:04:41 am
Oh right! I forgot about that! And I do have it installed on my USB stick
Title: Re: Sprite/tileset Editor- need input
Post by: simplethinker on January 18, 2010, 01:23:37 pm
Progress has slowed a bit since school started, but I'm still chugging along.

Things completed:
- I've written the methods to convert tile(sets) to binary/hex strings and the asm ".db" formats
- Added the code for creating .8xi (picture), .8xs (string), and .8xm (matrix, for the eventual tilemap part)

In-progress:
- Implementing larger brush sizes
- Saving the tile(sets) (I finally know exactly which data is relevant, so I can decide on a format for the save file)

Has anyone tried the demo yet?  What do you think?
Title: Re: Sprite/tileset Editor- need input
Post by: DJ Omnimaga on January 18, 2010, 11:34:54 pm
Sorry didn't try it yet :(, got side tracked by other stuff :(, hopefully maybe i may get some time eventually.

Glad this is still progressing, though. So we can now do sprite/tilemap conversion and stuff? It may speed things up for those who prefered to draw sprites in images rather than type them in hex but would like to take advantage of hex