Could you send me your tmxmap and images via PM.
I'll take a look at it.
A fast, easy to use, free, and community supported 2D game engine
Could you send me your tmxmap and images via PM.
I'll take a look at it.
I guess no help was wanted?
Hey skyhawk, this looks really cool. (Not sure how I missed it for so long! =) ) If i get time I'll give this a try this evening with my codebase and my generated TMX files. I could give porting my tile rotation code to this as well if anyone thinks they'd use it and assuming it's not changed too much from the existing codebase.
Found an interesting bug. If a layer is visible and empty(no tiles), all kinds of badness can happen.
Hey skyhawk, just sent you a PM.
Hey Skyhawk,
I attempted to merge in my rotation code to your HKTMXTiledMap. Unfortunately the one place I couldn't get going was the actual rotation. Previously tiles would be set up in a reused tile list, but in your code that list has been removed. I think the data should be rotated in draw and that's where the change should be. However my code expects to rotate a CCSprite and I don't think your code deals with sprites in the same fashion. I'm fuzzy on how to both rotate and slightly reposition a tile in the lower level code that you've got going. Previously it was fairly simple:
if (tileRotations_ && tileRotations_[z])
{
reusedTile_.rotation = tileRotations_[z];
reusedTile_.anchorPoint= ccp(0.5f,0.5f);
reusedTile_.positionInPixels = ccp(reusedTile_.positionInPixels.x + mapTileSize_.width /2, reusedTile_.positionInPixels.y + mapTileSize_.height /2);
}
Obviously I can't quite do the same thing. I'll look at it more later, but any help would be appreciated.
Edit: Looking further, I think I see where I'd need to adjust the position of the sprite, but I'm still at a loss on rotation. I expect that I'd need to change the quad point definitions, which I don't really understand. Maybe I'll leave these kinds of modifications to the professionals. =)
Hmm, I should probably make a note that tile atlases should be POT (Power of Two)
POT? I really am starting to feel out of my depth. =)
Whatever makes a game interesting these days, I guess..
Thanks for the clarification skyhawk. Quick question, what is the order of the points you're setting up in the screenGrid? I'm fuzzy on the order of the corners and haven't had much luck finding out what they would be... I've tried playing with a few of them but can't seem to get the point ordering correct, giving me all sorts of oddness for my simple 4 stage rotations.
I apologize for my stupidity, but I got it working. I was using the wrong GID's. Thank you skyhawk for putting together a so well thought out class!! This is amazing!
EDIT: But now I have a new problem when I change scenes. It crashes and I get in the console:
011-07-21 16:45:57.731 Flying Adventure[7533:207] *** Assertion failure in -[CCTextureCache addImage:], /Users/Admin/Documents/MyFiles/Me/iPad/cocos2d/current/libs/cocos2d/CCTextureCache.m:240
bump. see edit thanks
you should read the assert: NSAssert(path != nil, @"TextureCache: fileimage MUST not be nill");
Don't use nil images.
Thanks skyhawk! It was being caused by layers not having tiles. Without using your class the crash didn't happen. In a lot of my maps, not every map will tiles in every layer. So I'm fairly sure I know a way to work around this which I'm looking into now.
Yeah, map layers having no tiles on it is a "bug" that probably needs to be fixed, but it has an easy workaround. Perhaps I should update the original post with the current known issues list.
EDIT: nevermind, updating original post not an option =\
I now also keep getting this randomly
Program received signal: “EXC_BAD_ACCESS”.
warning: Unable to read symbols for /Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.3.5 (8L1)/Symbols/Developer/usr/lib/libXcodeDebuggerSupport.dylib (file not found).
kill
quit
Even though I never have that problem without this class.
What do you mean not updating your op is not an option? I'd really like to have that fix..
I cannot debug for you. I do not have what you have.
If you want me to debug your program for you, feel free to send your project along and I will take a look. Honestly I rather you figure out what the problem is, let me know, so that I can go fix it.
As for not being able to update my original post, I LITERALLY CANNOT EDIT MY ORIGINAL POST. That has nothing to do with the source code at all (which is located here, I'm taking down original link so people aren't tempted to use out of date code).
Any help for isometric slowness? I haven't really started my project yet, except to get an isometric map working with a guy moving around, but it runs ridiculously slowly for even a small 30x30 world (25 fps). Is this the nature of isometric?
I suppose switching to ortho would be ok, but I love the isometric look.
I have no plans of supporting isometric with this in the next 2-3 months (busy with entry to http://www.udevgames.com/)
As for your iso map running slow on a 30x30 world, how big are the tiles? because that doesn't sound right. Also is that in sim or on device?
Thats a 30x30 world on the device (iPod 3, iPad runs about 20 fps since the whole map can pretty much be viewed) with 32x32 tiles, and 3 layers. It's basically the sample project from Learn iPhone and iPad Cocos2d Game Development by Steffen Itterheim.
Also, I'm using XCode 4 and cocos2d 1.0.0-rc
Hi, I'm trying to run some tests using your extension. But I can't make it work, every tile it's rendered smaller except for the first one of every row, as you can see. There need to be a special TMX or an special image file?
Thanks! (Really thanks!, this extension is so damn useful!)
Tiled:

iPhone (Simulator && iPhone 4):
if you could host your tmx and sheet, I could test it for you, but I've honestly never seen anything like that at all.
Here it is. Another thing, im using iOS 5 beta 6.
Thanks for your time!
Can you make HKTMXTiledMap and HKTMXLayer just like the Cocos2D's originals but with the ability to animate tiles? It doesn't support tileAt, among other issues that make it hang, but work fine with the originals.
That's because it is not rendered like cctmxtiledmap. There are no ccsprites. It supports the tilegid, but you can't call tileat because there is no sprite .
Here is the full xcode project if you can't reproduce the error, maybe I'm setting something wrong.
Thanks again.
I can't for the life of me figure out why that is happening. When I created my own map that was that large, I had no problems. There was nothing unusual happening in the code that I could see, and nothing in the actual file that was bizarre either. I did notice that even editing the map outside of that little square produced 0 changes (as if it didn't want to draw anymore).
There's nothing wrong with your project file either, cause when I drop my map in, everything is just hunky dory.
So the problem (who knows why), is the map? Ok, I'll try creating a new one.
Thanks!
Mmm, I used tiled 0.7 to create it, Could be that the reason? Should I use the jar version? (I'll try anyway).
I haven't yet upgraded to Tiled .7 yet. I still use .6.1.
One moment please!
nope, maps in Tiled .7 work fine as well (assuming you don't use the flipping feature)
You must log in to post.