Introducing Lime - A module to import 2D tilemaps in your game.

i think it does slow it down… reading properties of display objects doesnt seem to be fast

also note my comment from the other thread

“the loop could be optimized because some objects in the array are not going to be anywhere near the visible screen anyway”

if it’s a horizontal scroller, if I plot by row then column instead of column then row, it’s easier to tell which chunk of the array I need to look at, because i can disregard tiles that are outside (viewport + speed) or whatever, although I haven’t worked that algorithm yet. This problem is made worse when objects can move as in this thread http://developer.anscamobile.com/forum/2010/11/22/scrolling-large-non-tiled-world-objects or if my scrolling is 4-way… in which case i need to probably be looking at strille’s method

[import]uid: 6645 topic_id: 3598 reply_id: 12512[/import]

I think what we really need is some input from Ansca as to what exactly happens to things off screen and what is the best way to do this sort of stuff as it seems that there are some odd things going on (especially that reading properties is slower than reading your own cached variables like you have done in your test). [import]uid: 5833 topic_id: 3598 reply_id: 12515[/import]

Hi All,

I am trying to work Bounty into my project, I got it up and running and I have several questions if you don’t mind me asking, they are:

  1. Why is there a folder hierarchy? I remember reading in several places that subfolders cannot be read in certain devices, it’s because the directory separator either “/” or “” are not considered as separators, I converted the module folders by the means of naming scheme e.g: bounty_loaders_isometric.lua

How do I draw on top of the map while still keeping the ordering sane? Example:
I have a layer called Path, where a bunch of enemies can walk on and I can shoot them and Trees just as decoration, how do I draw enemies or bullets on top of the map without messing up the layering scheme?

Thank you so much for making this module it has helped me tremendously. [import]uid: 11334 topic_id: 3598 reply_id: 12520[/import]

actually that isVisible code you suggested might have fixed it, will do further tests.

thanks
j
[import]uid: 6645 topic_id: 3598 reply_id: 12523[/import]

Hey, feel free to ask as many questions as you like :slight_smile:

  1. This was my bad :slight_smile: I didn’t realise that subfolders only worked on certain devices till earlier today (I have sub folders working on my device for art and sound yet this was the first time I had used them for code, I guess the require method doesn’t like sub-folders. This has been fixed in my current version and I completely forgot to post on the forums about that bug.

  2. If you want an item on the same layer as a particular object, such as bullets on your path layer you can do this:

  
 local layer = map:getLayer("Path")  
  
 if(layer) then  
  
 local image = display.newImage(layer.group, "image.png", 0, 0)  
  
 -- You could also use: layer.group:insert(image)  
 end  
  

Hope that helps, any more questions just ask away :slight_smile: [import]uid: 5833 topic_id: 3598 reply_id: 12525[/import]

Oh I hope it does :slight_smile: Happy investigating :slight_smile: [import]uid: 5833 topic_id: 3598 reply_id: 12526[/import]

Just wondering Graham (as Ansca have contacted with with regard your various tile map projects) if you are the best person to work with Ansca to get support for tilemaps in Corona to be fully implemented and supported in such a way that they could actually be used!

I’m seriously starting to wonder if Corona is powerful enough to write anything but a REALLY SIMPLE game. My first games run at 60 FPS on the simulator but I’m told that on an HTC Wildfire (Android 2.1) it runs like a DOG! :frowning:

My game has 8 images and 2 physics objects. Of course this isn’t the right place to discuss this particular problem but thought I’d mention it. [import]uid: 9371 topic_id: 3598 reply_id: 12545[/import]

i’d say forget physics on the android at the moment , until those bugs are fixed. test on iOS and see how that runs [import]uid: 6645 topic_id: 3598 reply_id: 12553[/import]

Which bugs ? I wasn’t aware there were any with physics on Android, any details? [import]uid: 9371 topic_id: 3598 reply_id: 12555[/import]

https://developer.anscamobile.com/issues/3150
[import]uid: 6645 topic_id: 3598 reply_id: 12557[/import]

Just so everyone is aware, Ansca are aware of this project and currently Carlos is looking into the jittery scrolling issues (hopefully it is something that can be sorted in Corona itself saving me from having to come up with some magic just to make it all run nicely thus allowing me to focus on more interesting features).

I am not sure if they are interested in integrating Bounty or just helping out when is necessary and maybe adding some features into Corona that we can take advantage of (such as Spacing in spritesheets).

Also, I now have external tilesets working which means making multiple levels with the same tileset (including properties etc) is easier as you just need to make a tileset once and them just embed it in as many maps as you like. [import]uid: 5833 topic_id: 3598 reply_id: 12604[/import]

great! I am not even sure the sub folders would work for assets too actually, dont quote me on this but I think the bug was discovered by someone who has sub folders for images.

I will try that method for enemies! Do I need to have different layers for bullets too? This is the first time ever coding for a game, excuse my ignorance.
[import]uid: 11334 topic_id: 3598 reply_id: 12673[/import]

Hey GrahamRanson, your Bounty package looks great! I especially look forward to banana, as I’ve tried doing my own tile-type system in the past, but it didn’t work. I think even if it’s not done 100%, I’d like to look at it and try it out, if you wanted to post banana. [import]uid: 8782 topic_id: 3598 reply_id: 12675[/import]

quick question on subfolders for images…

was it android and did he have 2 images with the same name but in different folders

eg

level1/platform.png
level2/platform.png

i think android caches resources based on the filename without the extension, so that could have possibly affected it

would be good to know for sure. [import]uid: 6645 topic_id: 3598 reply_id: 12692[/import]

as far as I know, is that android treats files with the same name as the same, as explained here http://developer.anscamobile.com/content/multimedia-features

ex: test.mp3 == test.wav is true [import]uid: 11334 topic_id: 3598 reply_id: 12695[/import]

I am having problem loading the isometric example, I think the rendering is all messed up, the image shows but it;s not the same as the way it’s created in Tiled, even for the default isometric example (the grass and snowy trees one)
here is an example how it is rendered in my simulator:

http://screencast.com/t/rrNhWFf6o

What gives?

EDIT:
There is a bug in the CSV loader it seems, the map is rendered perfectly fine if the data format is XML. [import]uid: 11334 topic_id: 3598 reply_id: 12696[/import]

Graham, with your various projects is it possible for me to load in my own ‘custom’ tile map rather than a TileMap one?

I guess I could always code the load function myself but it would be great if I could take advantage of ones of your libraries to then render the map.

Funnily enough I have a game written in Lua for FBA creator that runs on an aged Windows Mobile and it scrolls super smoothy so there must be a way to get it to work on these later more powerful devices.

I’ll wait to see what Ansca come up with as it would be far better for them to address the rendering… [import]uid: 9371 topic_id: 3598 reply_id: 12702[/import]

@NayGames

When I sort out a way of protecting the code I will certainly be looking for Beta testers.

@Newbie101

Not sure why CSV isometric maps aren’t working, maybe the order tiles get saved out in is wrong. Thanks for bringing this to my attention.

@dweezil

Currently only maps created in Tiled are supported and as for writing your own loader that is certainly possible however depending on how many maps you have it might be easier to just remake them in Tiled.

Oh and sorry for late/short replies everyone as I’m on my phone. [import]uid: 5833 topic_id: 3598 reply_id: 12704[/import]

Just a short note to say that I now have animated tiles working. All easily set up by the designer of the level.

I will soon be putting up some kind of form/survey thing to see what people would want in the full version and what they would expect from an Alpha and Beta version of it, so that I can start getting the right features working. [import]uid: 5833 topic_id: 3598 reply_id: 12941[/import]

I have made a simple form to get some responses of what the community want from Bounty, please submit as many features as you think would be useful and also pass the survey around to any Corona developers you know that might not know of this thread -

https://spreadsheets.google.com/a/monkeydead.com/viewform?formkey=dHduTlV6Y1NmMnh4UEFyekQ1anZDb0E6MQ [import]uid: 5833 topic_id: 3598 reply_id: 12946[/import]