Tiles & Sprites

All topics about ZGameEditor goes here.

Moderator: Moderators

User avatar
Kjell
Posts: 1876
Joined: Sat Feb 23, 2008 11:15 pm

Tiles & Sprites

Post by Kjell »

Hi guys,

The very the first thing that is mentioned on the ZGameEditor features page is ..
a tool for creating small arcade style games
Personally when i hear "arcade", games like Pac-Man, Donkey Kong and Space Invaders come to mind* One of the things that these games have in common is that they are tile & sprite based. However, ZGameEditor currently doesn't have any components that truly embrace these concepts.

*Even though arcade is also a game style ( fast paced / pick up & play ) of course, not just a medium.

So, i've put together some pages that describe a possible way to implement ( some of ) this. Please let me / us know what you think, what you'd do differently and / or whether you think dedicated tile & sprite components should be part of ZGameEditor at all.

+ I've purposely left out tilemaps for now just to keep things simple. One thing at a time :wink:

K
User avatar
jonaspm
Posts: 89
Joined: Fri Jul 06, 2012 3:51 pm
Contact:

Post by jonaspm »

I would really appreciate the addition of these compontents to ZGE :D
User avatar
Rado1
Posts: 775
Joined: Wed May 05, 2010 12:16 pm

Post by Rado1 »

Even if I'm not a big fan of sprites (since it can be quite difficult to create good phases of animated sprites), I like the idea of font, especially the proportional font definition. Implementing just this feature would be useful and would save the current computation of character proportions stored in an array.

BTW is not the proposed Tileset just a special case of Spritesheet? What about to have just one component for both concepts? What are popular spritesheet and tileset editors? Are there some unified and widely used interchange formats?
User avatar
Kjell
Posts: 1876
Joined: Sat Feb 23, 2008 11:15 pm

Post by Kjell »

Hi Rado1,
Rado1 wrote:Even if I'm not a big fan of sprites (since it can be quite difficult to create good phases of animated sprites)
Sprites ( and tiles ) are not just for animations though. It's also a useful technique to render various graphical elements from a single texture ( which is great for performance ).
Rado1 wrote:I like the idea of font, especially the proportional font definition. Implementing just this feature would be useful and would save the current computation of character proportions stored in an array.
I only included the proportional stuff to illustrate how it differs from tiles and sprites .. but i wouldn't be opposed to having that built-in obviously :wink:
Rado1 wrote:BTW is not the proposed Tileset just a special case of Spritesheet? What about to have just one component for both concepts? What are popular spritesheet and tileset editors? Are there some unified and widely used interchange formats?
I personally think they are different enough to warrant separate components. Besides, if ZGE does eventually end up with a tilemap component ( which obviously can only work with a tileset .. and not with a spritesheet ), it would be confusing when you have a combined component that only works in a certain state.

K
User avatar
VilleK
Site Admin
Posts: 2274
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post by VilleK »

I think Kjells suggestion is well-written and interesting. I'll get back to commenting it more when I'm back from holiday later next week.
Last edited by VilleK on Sat Jan 03, 2015 12:22 pm, edited 1 time in total.
User avatar
rrTea
Posts: 475
Joined: Sat Feb 15, 2014 9:54 am

Post by rrTea »

Rado1 wrote:What are popular spritesheet and tileset editors?
For both editing and creating tiles / spritesheets, Pro Motion and Graphics Gale can be used (there are tons of other tools too, Tiled for level editing, GrafX2 which even works on Linux etc). Nowadays, Photoshop is the default option for creating spritesheets / tiles, but it does not support some tileset- and spritesheet-specific features and can't be used as an editor out of the box.

For example in Pro Motion you can both edit and use (as in, make a level out of them) tiles: "paint the map" as if you were using brushes from a "palette" of tiles, cut part of the map and put it elsewhere, export the tileset in all kinds of ways (including writing your own exporter, although I never tried that), paint one tile while it automatically updates in all instances of the map so you can see it in context (without exporting / reloading at all!), have it detect which tiles are not used in the map etc. With spritesheets you can automatically load a spritesheet into an animation (and export it too!), use AnimBrushes etc.
Last edited by rrTea on Thu Jan 08, 2015 12:31 am, edited 3 times in total.
User avatar
Kjell
Posts: 1876
Joined: Sat Feb 23, 2008 11:15 pm

Post by Kjell »

Hi guys,

There is a whole slew of standalone spritesheet generator tools ( as well ), such as TexturePacker, ShoeBox and darkFunction Editor .. but no idea which ones are the most popular, and whether or not they share any export formats.

K
User avatar
jph_wacheski
Posts: 1005
Joined: Sat Feb 16, 2008 8:10 pm
Location: Canada
Contact:

Post by jph_wacheski »

These are worthy ideas, well thought out,. and from the current samples already basically coded.

I agree that these will be useful additions to ZGE, making working with bitmaps for fonts, sprite, and tiles much easier for many people.

Perhaps looking at some of these available tilemap editors will provide more info. for features that would be useful for this.

http://www.mapeditor.org/
http://www.ogmoeditor.com/
http://www.gojieditor.com/
etc. ,. .
iterationGAMES.com
User avatar
rrTea
Posts: 475
Joined: Sat Feb 15, 2014 9:54 am

Post by rrTea »

Just wanted to comment on this bit from the "Font" page:
The proportional values are a array of 256 unsigned bytes which correspond to the width of each ANSI character in pixels.
Looks good, even though I'm not a big fan of using ANSI as a base.

One of the reasons is that it makes it inconvenient to use many already existing pixel fonts (which are very direct to make, customize and maintain, compared to vector fonts), since many old fontsheets don't conform to ANSI, for example sometimes the numbers are added after the characters etc. Additionally, if I want to add an uncommon glyph into the bitmap (say "π", "€" or "©"), I have to go and check whether it's even included in the ANSI, then find what field exactly should it go in...

It'd be more practical if there were a way to insert a bitmap and just tell ZGE what is in it by passing it a simple string with 1:1 mapping to what is in the bitmap. For example if I wanted to define a "digital clock" counter font, I'd use the attached bitmap and map the string

01234
56789

to it. Note that this method would not get in the way of people who find using ANSI practical, as you'd just map a standard ANSI block of text (or part of it) that the bitmap covers.

This'd also be a step in the right direction of the eventual Unicode implementation one day (that's how fonts are handled in Japanese engines sometimes). ANSI doesn't even cover all European languages properly, let alone CJK etc...
Attachments
Digital clock / counter, obviously trying to print "Hello!" using this font wouldn't produce anything visible.
Digital clock / counter, obviously trying to print "Hello!" using this font wouldn't produce anything visible.
fontDigitalCounterSmall.png (1.05 KiB) Viewed 34379 times
Last edited by rrTea on Tue Feb 17, 2015 3:51 am, edited 1 time in total.
User avatar
Kjell
Posts: 1876
Joined: Sat Feb 23, 2008 11:15 pm

Post by Kjell »

Hi rrTea,

I agree that being able to map which characters are in a font would be convenient .. especially for Unicode fonts. Unfortunately ZGameEditor doesn't support Unicode at the moment, but if it would it's simply a matter of adding another optional array ( just like the proportional values idea ) containing the Unicode ordinals that are available in the font texture.

Your digital clock example is a bit of a unfortunate choice though. I get what you're trying to illustrate, but ZGE doesn't support textures that are not a power-of-two in dimensions, and the numbers follow that exact order in the ANSI map as well, so you don't need a custom map. Attached is a example.

K
Attachments
Clock.zgeproj
(1.15 KiB) Downloaded 642 times
User avatar
VilleK
Site Admin
Posts: 2274
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post by VilleK »

rrTea, note that existing font component already has a FirstChar property that is the first char value of the font. See here. So for your bitmap with numeric characters you would use the value 48.

edit: I see that Kjell answered just now too.
User avatar
jph_wacheski
Posts: 1005
Joined: Sat Feb 16, 2008 8:10 pm
Location: Canada
Contact:

Post by jph_wacheski »

rrTea's idea is great for better convenience,. working with fonts, and would be when using the current font component for sprites, for GUIs, etc. as well.
iterationGAMES.com
User avatar
Kjell
Posts: 1876
Joined: Sat Feb 23, 2008 11:15 pm

Post by Kjell »

Hi jph,
jph_wacheski wrote:rrTea's idea is great for better convenience,. working with fonts, and would be when using the current font component for sprites, for GUIs, etc. as well.
Using the font component for sprites & tiles is exactly what i'm trying to prevent with this proposition though :? But you're free to disagree of course .. that's why i asked for feedback in the first place.

K
User avatar
jph_wacheski
Posts: 1005
Joined: Sat Feb 16, 2008 8:10 pm
Location: Canada
Contact:

Post by jph_wacheski »

i don't disagree with your proposed components,. however they don't exist yet. just saying the option to define the font's character order could be a useful one, as rrTea has pointed out.
iterationGAMES.com
User avatar
rrTea
Posts: 475
Joined: Sat Feb 15, 2014 9:54 am

Post by rrTea »

Heh yes, my example is really poorly chosen, sorry about that. Fortunately seems the point (mapping a string to a bitmap can be practical) got across. Just wanted to expand the original proposal, not disagree with it :)
Kjell wrote:Using the font component for sprites & tiles is exactly what i'm trying to prevent with this proposition though
I completely agree! I like specialized components.
Last edited by rrTea on Fri Jun 26, 2015 3:46 am, edited 1 time in total.
Post Reply