Zwoptex: Sorting By Name

One of the most requires features/support question I’ve been having is “Can I sort by name?”.

This feature was removed in the 1.0.0 series and doesn’t match the functionality of Flash and some may ask why?

The new layout algorithms do not pack sprites 1 by 1 always in the same order. The evaluate every single unpacked sprite for the next available spot and choose the best matching one based on a set of rules. They also do not always just pack new space instead they sometimes go back in the atlas and fill spaces that were left as gaps that would normally be wasted.

Mostly this is the reason I removed the sorting by name since it has relatively no use or reliability with any of the layout algorithms now.

Even still it is a very requested feature. Because of that I want a period of taking feedback as to -why- people want this feature. I need to know what the use of sorting by name is to figure out how to best implement it since it’s not as simple as the Flash version now. If you could kindly leave a comment on this post I’d be greatly appreciated.

I’ll probably get around to it in about 1-2 weeks as I’m currently busy on another project and plan to begin work on version 1.1 / 1.2 in the upcoming weeks.

-Robert

Zwoptex: 1.0.2 Generic Coordinate Format

With Zwoptex 1.0.2 I’ve introduced a new coordinate format ‘XML Generic’.

By default Zwoptex 1.0.2 will NOT use this new format. It will instead use ‘XML cocos2d’ which is supported in the develop branch of cocos2d.

The generic format contains a bit more information and re-organizes the key’s to make the coordinate list a bit more readable. We now have the following available in each frame:

  • aliases – This will be used in Zwoptex 1.1 for the aliasing feature
  • spriteColorRect – The {{x, y},{width, height}} that is the non-empty pixels in relation to the source sprite size
  • spriteOffset – The {x, y} offset the sprite needs to be moved to line up with the source sprite due to trimming
  • spriteSize – The {width, height} of sprite with trimming calculated
  • spriteSourceSize – The {width, height} of the sprite before trimming
  • spriteTrimmed – Whether or not the sprite is trimmed
  • textureRect – The {{x, y}, {width, height}} of the sprite in the texture image
  • textureRotated – Whether or not the texture is rotated

The main purpose of this is to make the keys a bit more verbose as to what they relate to and provide complete information about the sprite and it’s texture coordinates without the user having to manipulate anything due to trimming or rotation.

This new format is supported via the develop branch of the official cocos2d repository.

-Robert

Zwoptex: Rotated Untrimmed Sprites

I just discovered that there is a bug in how Zwoptex is rendering rotated untrimmed sprites in Zwoptex. The result is an inaccurate texture for the coordinates.

This only affects rotated sprites that are untrimmed. Rotated sprites that are trimmed work fine.

You can see the error in an example below. The red represents where the images should be rendered.

I’ll be fixing this in the next day or two and publishing an update along with a few other new little things ( nothing major! ).

Update: I’ve fixed the bug. I’ll be pushing update 1.0.2 out in the next couple of hours and posting some release notes!

-Robert

Server Updates: Completed

Server updates are done! Performance should be faster and my bill is getting smaller..

There will be rolling restarts still throughout the next day or two as I secure the server even more than I already have.

Update: I’ve completed all the updates. Thanks for the patience and sorry for any downtime issues. This blog as well as the Zwoptex site should have greatly improved performance due to it.

-Robert

Server Updates Part 2!

Over the past few months the traffic on my server has gone up quite substantially. Though it’s nowhere near a massive blog or anything it is quite a load for my server and logs show repeated memory warnings as well as slow responsiveness.

Currently I’m hosted on mediatemple (dv) base – 512mb server. It’s been a great experience though the next upgrade is quite costly and I wasn’t ready to spend quite that much just yet.

They recently just launched their (ve) server which is a barebones linux do it yourself sort of server. I’m not really a linux guru but I thought I’d give it a shot.

After about 4 days of reading a ton of tutorials and resetting the server about 20 times I actually have moved one of my domains over completely ( http://www.robertjpayne.com ) as well as the mail service behind it.

I set it up using nginx as a reverse proxy to apache. Basically that means nginx serves any static content and proxy’s any dynamic content to apache for processing. This reduces the server load A LOT and results in a lot faster response times.

Over the next day or so I’ll be moving this site as well as the zwoptex site over as well.

While migrating there may be problems with the following:

  • Frequent errors including 404′s, Forbidden and Internal Server Errors
  • Emails bouncing when sending email to any of the @zwoptexapp.com emails
  • Orders will process via paypal but may take awhile to process on my system and generate a registration key. Where applicable I’ll be emailing anyone that is affected and manually forcing it to process immediately.

With all luck it’ll be a very smooth transition with little issues and be up and running again in no time!

-Robert

Zwoptex: Patching cocos2d now for features that will be released later

As I move forward with the Sprite “Aliasing” updates I want to make sure that users can use these features as soon as they are ready in Zwoptex especially without having to manually patch cocos2d.

Since I’ve already implemented aliasing in some ways and have an idea on how the .plist will look I’m going to go ahead and patch support for it into cocos2d now and then it should be good to go as soon as Zwoptex is complete.

Aliasing will be simply in that each sprite frame in the .plist will have an array of “Aliases”. Loading the .plist you should first add all the normal sprites and then go back and add alias’s that have not already been created. This will prevent overwriting a real sprite with an alias.

The cocos2d implementation will work exactly like above. It’ll first add a CCSpriteFrame for each real sprite  in the .plist and then add a CCSpriteFrame for each alias that doesn’t already exist. If it does exists cocos2d will log a warning but not an exception.

The alias’d CCSpriteFrame will basically be a direct copy of the CCSpriteFrame it is aliasing but accessible via the alias name.

Hopefully this will alleviate some of the issues people have had with 1.0.0 and the rotational support when sprite aliasing comes out.

-Robert

Zwoptex site down for maintenance

In about 30 minutes ( 1:35 AM PST ) I’ll be brining down the zwoptexapp.com site for roughly 30 minutes to 2 hours depending on how long maintenance will take.

During this maintenance window I’ll be taking care of the following:

  • The site will be migrating from php to a django driven app.
  • I’ll be migrating the database to a new one and cleaning up along the way
  • Fixing some bugs that were affecting a very small amount of orders
  • Cleaning up the web root

Once I’ve finished the maintenance I’ll be testing it quickly to make sure it’s all running properly and then will get the main site up and running as fast as possible.

I’m sorry for any inconvenience this may cause anyone and hope it wont be long.

Update: http://www.zwoptexapp.com is back up and running fully functional.

-Robert

What’s Next for Zwoptex

Zwoptex isn’t ending at 1.0.0 though the development will probably slow slightly for the next few weeks as some stuff that was put off over the past two months needs to get done.

With that in mind there’s a few short term goals and long term goals.

Short Term:

  • Website
    • Website will be migrating from php to Django to allow for better scalability
    • Documentation to be added with some video tutorials
  • App
    • Option to export in different for the coordinates list ( de-coupling Zwoptex from specificly being used with cocos2d ). Cocos2d will still be heavily supported but so will more generic use of the tool with any OpenGL based application.

Long Term:

  • Sprite inspector – Panel that will show details about an individual sprite and allow some basic editing.
  • Sprite aliasing – Through the sprite inspector the ability to add/remove alias’s that the sprite is known as. This allows “grossini_01.png” to be seen as itself as well as “grossini_02.png”.
  • Merge & Alias Feature – Feature that automatically finds duplicate sprites and merged then into a single sprite with Alias’s.
  • Edge Padding  - This feature would allow you to pad the edges of a sprite with an extra 1-2 pixels of data. Thus making OpenGL always get a solid rectangle and avoid lines or artifacts when using sprites in tiles.

With all of that said there isn’t any hard timelines though it would be optimal to get most of this wrapped up by early August.

-Robert

Server Updates

Over the next 24 hours ( and you may have noticed the past 24 hours ) there may be intermittent 404′s or 503′s across zwopple.com or zwoptexapp.com.

I’m in the process of optimizing my webserver to handle traffic better and faster. To do so here is what I am doing:

  • Installing lighttpd webserver to serve non-dynamic content ( it’s way faster for this! )
  • Installing php optimizations and wordpress caching to speed up performance of blog TONS
  • Eventually converting all php on zwoptexapp.com to python running on django through wsgi

In the end it’ll mean a lot faster pages, downloads and less costs for myself.

Update: lighttpd is running and wordpress caching has been turned on. The blog should see some massive performance gains :)

Sorry for any inconvenience the intermittent downtime may cause.

-Robert

Comments are back.

Apparently the wordpress upgrade didn’t go as smooth as I thought. Comment forms were resulting in 404′s. I had to revert to an old version of the theme I’m using which may still be buggy unfortunately :( .

I’m going to look into it over the next couple days and get the “new theme” working again. But for now comments should work again!

-Robert