Beta Updates

This thread will be updated with information about updates to the Beta.

I have just added in some code that automatically splits up the world into smaller chunks, this way it makes it easier to hide things that aren't on screen. Hopefully it will get some speed boosts when on the device.

The next stage of this is to have it so only a couple of these "chunks" are actually moving at a time which I'm hoping will get another big speed boost.

As my iPhone is currently dead it would be great if you guys could try out the latest code on your devices to see what speeds you get. If you try small, medium and large maps with differing amounts of layers and physics etc that't be fantastic.

The latest code is here - http://dl.dropbox.com/u/571145/LimeBeta0.2.zip

It looks like loading large maps causes the device to crash due to it taking too long, I am looking into ways of fixing this.

To go along with the new tutorial - http://justaddli.me/tutorial.php?t=0&id=8 - I have also uploaded the new version of the main code to here - http://dl.dropbox.com/u/571145/LimeBeta0.3.zip

Hopefully I haven't introduced any more bugs :-)

New update up - http://dl.dropbox.com/u/571145/LimeBeta0.4.zip

Just a simple change to allow you to now use this:

1
map:move(x, y)

Just uploaded another version, just a small change though. You can now add propertyListeners as described here - http://justaddli.me/api.php?c=map&m=addPropertyListener

Fairly simple to use and similar to object listeners.

The type paramamter passed to the listener function can be either "tile", "layer", "map", "objectLayer" or "object"

The object parameter is the actual item that has the property on it.

Also, while I'm here, how do people like the updates. Would you prefer I hold off on the Beta updates so I release something every couple of days or just stick with releasing it whenever I have added something new?

Another small update, this one to go along with the first gameplay-specific tutorial.

The update is here - http://dl.dropbox.com/u/571145/LimeBeta0.6.zip

The new tutorial is here - http://justaddli.me/tutorial.php?t=0&id=9

Hopefully the new tutorial will come in useful, it is a pretty short one but I hope to create more soon. I think my next gameplay-specific one might be for moving platforms or pickups, unless anyone else has any suggestions?

To those that are interested, the main code addition to this update is mentioned at the end of the tutorial. Basically properties of Tiled Objects that are used to create Corona physics bodies (such as the terrain) are now copied over so that in a collision event you can get access to them.

Nice

New update in, all this does is temporarily disable the chunking stuff until I can find a way to deal with it better. I'm not sure the chunking really made a speed difference anyway.

http://dl.dropbox.com/u/571145/LimeBeta0.7.zip

Graham,

I tried the new setPosition method in version 0.7:

map:setPosition(20, 20)

and I get the following error in the terminal:

Runtime error: /Users/robsta/code/spart_lua/lychee.lua:1309: attempt to call field 'setCameraPosition' (a nil value)
stack traceback:
[C]: in function 'setCameraPosition'
/Users/robsta/code/spart_lua/lychee.lua:1309: in function 'setPosition'
/Users/robsta/code/spart_lua/main.lua:7: in main chunk

Am I doing something wrong?

Cheers!

Rob

Nope it was me doing something wrong, new code here - http://dl.dropbox.com/u/571145/LimeBeta0.8.zip

Thanks, that works now ;-)

Awesome!

New update is up, just a small one that should have gone up a couple of days ago. The main additions are that files are now sortof namespaced to go along with a feature request, you will want to delete your lime, lychee, mango etc files and replace them with the new ones lime-lychee.lua, lime-mango.lua etc

Oh and also, I have a bad feeling that iOS might not like hyphens in filenames, could someone please test on hardware just to see if it runs atall, simple change if it explodes.

I have also added in two new functions on the map object as documented here and here

Can we have the link to the update please? Thanks

duplicate post due to server error deleted.

Got it. Thanks

A new update is in - http://justaddli.me/downloads/builds/beta/LimeBeta1.0.zip

The only addition is that there is now a new function in the utilities module, and also I had forgotten to document the utilities module before so the API will get updated soon with these functions.

The new function is this:

screenToWorldPosition(map, position)

map is your actual map object loaded through Lime.

position is a table with an X and Y position.

It will return a table with the new X and Y positions in world co-ordinates.

There is also screenToTilePosition and worldToTilePosition, I will update this thread when the API listing has been updated.

Congratulations on reaching v1.0! That sounds like one step closer to release. Happy New Year.

@GrahamRanson:
why does it return a table while lua can return 2 values for a function? It will increase readability and lines of code, ex: new_x, new_y = screenToWorldPosition(map, position)
as opposed to: new_x, new_y = unpack(screenToWorldPosition(map, position))
and unpacking is a performance hit, a big one.

It returns a table simply because I am from an OOP background so that is what I am more used to, if people would prefer it to return 2 variables then that can be changed.

I just find objects (tables) easier as that way if I wanted for example to return other things in that table you wouldn't need to change any of your code if you didn't want to use that data.

I had also never used or even seen the unpack method before, I simply would access the variables via table.x and table.y

What is easiest for everyone?

Graham,

I'm from a similar background so returning tables makes sense to me. However, I'm new to Lua and so don't know if there is also a performance hit for calling table.x rather than using separate variables?

Cheers!

Rob

Yea some testing will need to be done to see if there are any performance hits.

I personally prefer the tables as that way if for any reason I decided to change the order or the return variables or add in new ones it wouldn't break any of your code. The same goes for passing data to functions as well.

However I may own Lime but it is still a community based project so naturally if more people prefer multiple return variables or they offer some other tangible benefits then I will change to use them.

@GrahamRanson, tecnhohead2000:
unpack performance: http://trac.caspring.org/wiki/LuaPerformance (Test 3)

@technohead2000:
performance hit for referencing an index is very minimum e.g bla.x, it's in the same performance test as above.

@GrahamRanson:
I shall then convince you from another angle! (I should be a lawyer)
Coding convention, even in Corona functions would return 2 values if it is meant to return 2 values, let's observe exhibit A: http://developer.anscamobile.com/node/4356 or exhibit B: http://developer.anscamobile.com/reference/index/objectlocaltocontent

You make a good point, I will give it a proper think and return with my answer (most likely being a "best of both worlds" type answer)

But now back to the Beta Updates, I have just uploaded a new version - http://justaddli.me/downloads/builds/beta/LimeBeta1.1.zip - with a little bit of new code, basically it is an early test for parallax scrolling.

As I am still undecided I will put up this new version without any proper documentation and with the full expectation that it will not be what you guys want, but here goes anyway.

To get it to work you will first want to set up some background (or foreground) layers in Tiled (I plan to allow repeating blocks as well as pre-made images for these in the future) and then give them an "IsParallax" property as well properties for the parallax factor, these are "parallaxFactorX" and "parallaxFactorY", you will probably want these between 0 and 2 but give it a go and play, you can also leave out either one of the values to lock the player on that axis (so if you don't the layers to move up and down just leave out the Y factor)

You will most likely want lower values for the layers that are further away making them move slower then layers that are closer to the camera with higher values.

To get it to work in game you currently just have to call the following function:

1
     lime.setParallaxPosition(map, x, y)

Hi Graham,

have you looked at Cocos2D much (in particular the parallax stuff)? i'm sure there implementations of Parallax scrolling etc have had much though and user input put into them, so might be a good structure to look at?

http://www.cocos2d-iphone.org/api-ref/latest-stable/interface_c_c_parallax_node.html
http://www.cocos2d-iphone.org/archives/22
http://www.cocos2d-iphone.org/forum/topic/3414

there's also features we can be requesting from Ansca maybe such as the GL REPEAT
http://www.learn-cocos2d.com/knowledge-base/cocos2d-iphone-faq/learn-cocos2d-public-content/manual/cocos2d-general/14538-how-to-draw-an-endlessly-repeating-parallax-background/

regards
J.

It looks like they've done a similar thing, I guess we will only find out what is right for Corona/Lime once people start playing with it.

Yea that GL REPEAT looks perfect, exactly what I would need for the background layers.

Parallax as it is works perfectly.

Edit. My TileMap is based on a 80x80 system. I made a huge png background at 640,960 and added that to my map as new tileset. I find that you can still put it in a parallax layer and get it to work!!! Well done!

Awesome, very glad to hear it. That will allow me to clean up the implementation a bit and get to work on extra things like using pre-made images etc.

Well, thats what I'm saying. You can take any premade image and load it into Tiled as a parallax layer and it will work. Not sure if you need to do anything more for premade images. Just make sure they are smaller than 999 by 999 pixels as this is the max Tiled will allow for each tile size.

Can't seem to get 2 layer Parallax to work. I used duplicate later function in Tiled and then changed the visual but I only get the first layer when I execute my app. Is there anything I need to do to get the second layer going?

My bad. Its working.

Oops, I posted my reply before I saw your edit. All I was going to do was allow a blank layer to have something like an "image" property but your method is a much more intuitive method! :-)

I subscribe to the KISS philosophy.

Hi Graham,
I am way behind on my Lime update but I am afraid to update because of the performance impact, is there any update on Lime's performance?

The KISS philosophy is a good one. Both for programming and music choice.

At present there have been no real improvements in performance so you should be free to update but naturally keep a back up just in case. I hope to have some good news on the performance front soon.

New version is up - http://justaddli.me/downloads/builds/beta/LimeBeta1.2.zip

In this version is the fix to multiple tilesets as well as the tile properties bug.

Note: There is one limitation to external tilesets that I hope to resolve, for some reason they cant have hyphens in their names.

To go along with the new version, here is the tutorial on animated characters - http://justaddli.me/tutorial.php?t=0&id=11

A new build is up - http://justaddli.me/downloads/builds/beta/LimeBeta1.3.zip

In this are modified camera movement functions, please note that these changes *may* mess up your current project, I am really sorry for any possible problems caused. If you do have any please post on here or email me and I will help you sort them out.

I have also written a nice and simple tutorial to go along with the map movement functions - http://justaddli.me/tutorial.php?t=0&id=13

Do you have a rough timescale as to when the performance issues will be fixed? This is the big killer for Lime at the moment.

I have word from Carlos that him and I will be discussing the performance issues and possible solutions this week so I hope to have more info (and hopefully good news) soon.

I agree that it is very much holding everyone back, myself included as I actually want to make games with it too :-)

That's good to hear!

Quick question, I'm just trying to figure out how to do simple sprite versus tile collision (if collide, then don't move), but can't quite figure out how to go about this. I'm not looking to use physics here, just simple boundary detection.

The tiles have a property of collide = true. The player is a sprite that can move in four directions (created by newSprite). Sometimes the map moves, sometimes the sprites moves; but player.x and player.y remain constant, that's what I'm looking to test against.

So, if I'm moving right, if player.x + {number} would cause a collision with a tile with {collide = true}, how would I go about checking for this?

Thanks.

If I'm understanding correctly you want to be able to get a tile at a certain position and see if it has a collide property, correct?

If so then the following API calls will help there:
http://justaddli.me/api.php?c=map&m=getTileAt
http://justaddli.me/api.php?c=map&m=getTilesAt
http://justaddli.me/api.php?c=layer&m=getTileAt

With access to the tile you could then check if it has the collide property with this function - http://justaddli.me/api.php?c=tile&m=getProperty

And then stop player movement if it does.

Assuming this is what you were after, would a tile:hasProperty() function be useful, as well as for layers, objects etc as sometimes you don't need to know what the value of the property is just whether it has it or not.

If this wasn't what you needed then I'll try again :-)

That should work great, close to 2am here (as you know); and my brain died when looking through the documentation.

Hmm, a hasProperty function would be pretty useful in the long run I think :).

My brain usually survives till around 3 before I start getting code-blindness, little while to go yet :-)

The hasProperty stuff will be in the next drop. I'm also working on an exciting new feature, Berries. More information to come shortly when I have something to show of it.

Can't wait to see the next version :). Should have a Youtube video that is a few minutes long to showcase what we're making in the next few days (hopefully).

We've also put an advert for Lime on our blog (which has a meagre 500~ uniques per day at the moment).

http://udesign.me/blog/?p=13

Can't wait to see more of what you are working on, your first screencast was awesome! Bring on the vid :-)

Thanks for the shout out and 500 uniques a day is good :-) If I got 1% of that as paying customers a day (hell even a week) I'd be very happy.

If you have any specific requirements etc don't forget to add them to the Feature Requests thread.

P.S. I also love your use of the .me domain, only cool people use that extension :-)

@GrahamRanson
+1 on the performance issue bug, any news on the incorrect coordinate bug on isometric? I have been working around the issue.

Graham,

Using layer:getTile... I'm getting an error message of "attempt to perform arithmetic on field 'x'".

1
2
3
4
5
6
7
local layer = map:getLayer( "Collision" )
                                
                                local tile = layer:getTileAt({x=pos.x, y=pos.y})
                                
                                local value = layer:getPropertyValue( "collide" )
                                
                                print( value )

Berries are yummy!!!

Glad to hear you and Carlos are going to have a pow-wow. I actually think you should be getting the beta peeks from them under the NDA to see if what they are doing is helping or breaking your library.

views:1955 update:2011/10/13 16:39:51
corona forums © 2003-2011