Million Tile Engine Beta Release

Just letting you know that the last update fixed our flip+rotate issue.

Thanks!

Good to hear, AlanPlantPot!

To those of you interested in pinch zoom and touch scroll, I’ve modified the main.lua of CastleDemo to demonstrate one way to accomplish these behaviors. To try it out rename or delete main.lua from the CastleDemo 0v821 project folder and replace it with this new file: https://docs.google.com/file/d/0B8zoywKO40aibnpuVDQ0RjRsbDA/edit?usp=sharing

The implementation is a slightly modified version of the Corona sample code available here: http://developer.coronalabs.com/content/pinch-zoom-gesture

I think physics is going to be a lot of fun for people when it comes to platforming/sidescrolling games. The attached video shows current progress. As you can see it is coming together quite nicely save for a few hiccups here and there when the map wraps. Physics objects and map culling work more or less seamlessly with each other. Physics objects can be added manually as in the case of the red player rectangle, or you can set them up in Tiled as in the case of all those green balls rolling around.

[media]http://www.youtube.com/watch?v=JndryRr8EOU[/media]

The best part by far is how Physics simplifies coding for the user. The main.lua of the Platformer - Angled sample project included in previous MTE releases was nearly 500 lines long, involving multiple collision detection functions and user-defined collision points for every sprite. Using physics, the same sample as seen in the video is only 122 lines long. This is the entirety of the enterFrame event powering all that action:

--ENTERFRAME-------------------------------------------------------------------------- local gameLoop = function(event) player:applyForce(acc \* 2200, 0, player.x, player.y) mte.debug() mte.update() end

I anticipate releasing an update containing the first round of Physics support by the end of next week.

This is pretty freaking amazing. I’m using it right now :slight_smile: (Bought an hour ago!)

This is good work my man, good work. 

Android device performance - mmm not so hot. Kindle runs kinda crappy and lags, a galaxy sii is OK. I believe the S3 and phones on par with it will be fine, but really I think you’ll have to do some device detection to ensure only people with higher end phones can run your game at publish (and filter devices out from seeing it) on the google play store / amazon etc.

Good stuff, good good good good stuff…

-Nick

Dyson - I never cease to be amazed by your speed and expertise!

Regarding the Line-of-Sight demo you posted before - I’m assuming you’re using Corona’s/Box2D built in Raycast feature for that rather then using your own take on Bresenham’s Algorithm?

Thanks SegaBoy and nicholasclayg! I always appreciate Kudos.

The Line-of-Sight demo was in fact using the rayCast function from Corona’s Box2D Physics API. It’s a lovely feature to work with. I know what you meant about working out the trigonometry manually, having done that for an as-yet-unseen project, so to be able to do it all in a single line is just fantastic!

I share your disappointment in Android performance, Nick. Unfortunately Android device performance has only recently begun to catch up with something as dated as an iPad 2. It is paradoxical because you can read all about the superior technical performance of XYZ Android SOC or GPU, only to see it fall so far behind in the real-world benchmarks.

Developers will definitely have to decide what kind of performance profile they have in mind and work from there. Device detection is the best way to go about it. The obvious performance variables to change would be FPS and blockScale. I’m thinking of tweaking MTE so that if you fade a layer to completely transparent the engine will remove it’s tiles from the display grid. It would give developers one more tool for tweaking the performance of their app. High end devices could be set up to run the game with all kinds of fancy parallax layers and what-not, while lower end devices could hide more and more of them to save on performance.

When you mentioned the Kindle, was that the Kindle Fire original non-HD, or the Kindle Fire HD? 

How does removeSprite work? I get an error mte.lua:754: attempt to index field ‘?’ (a nil value). Obviously doing something wrong and I cant find an example of this

 local setup = { kind = "sprite", layer = mte.getSpriteLayer(1), locX = pos1, locY = pos2 - 1, levelWidth = 24, levelHeight = 24 } tower1sprite = mte.addSprite(tower1, setup) mte:removeSprite(tower1sprite)

The correct syntax uses a period, not a colon, between mte and removeSprite(). 

“mte:removeSprite(tower1sprite)” should be “mte.removeSprite(tower1sprite)”

I have a requirement to be able to stop a moving sprite after having called moveSpriteTo().

I looked at Update() and it has the below snippet of code:

local spritesFrozen = false local cameraFrozen = false local tileAnimsFrozen = false local update = function()     for i = 1, #map.layers, 1 do         isMoving[i] = false     end          if not spriteFrozen then  

Notice that the variables are spritesFrozen (with an S ) and spriteFrozen (no S). I can set spriteFrozen and that stops all sprites from moving, but I really just want to stop one so I did this:

https://gist.github.com/devildog/5793166

local cancelSpriteMoveEx = function(sprite) --spriteFrozen=true if movingSprites[objects[sprite]] == objects[sprite] then local s = movingSprites[objects[sprite]] s.isMoving=false s.deltaX = nil s.deltaY = nil movingSprites[objects[sprite]] = nil end end M.cancelSpriteMove = cancelSpriteMoveEx  

Which seems to work and so far hasn’t caused any issues.

amazing video Dyson!

i am sure now this is the best engine in corona for platform games.

Thanks for your work

Txarly

Nicely done! If you don’t mind I will include this in the next release of MTE so everyone can take advantage. 

With the start of this week I continue to work on iso projection and iso maps. I’ll keep everyone posted.

Yes, feel free to include / modify / etc.

Hi Dyson,

Just wanted to say that I found your engine yesterday and was instantly impressed. I am just now getting into full-on development with Corona SDK and I have been looking for something like this to implement. I am a .Net developer so these tools make my life so much easier.

Just made the purchase based on your dedication and how amazing this engine is. Keep up the good work my friend!

John

Thanks, Txarly! Physics really opens up the realm of possibilities using Corona and MTE. I’m still on track for a friday release containing the work completed thus far.

Thanks, John! I don’t think I’ve done anything with .Net directly, but I did tinker with Microsoft XNA a few years ago and quite enjoyed using it. It’s a shame Microsoft hasn’t seen the value in continuing to support and develop the framework.

The Million Tile Engine continues to evolve as developer feedback comes in, so if either of you see an area in need of improvement or a feature you’d like included, feel free to let me know.

Dyson… awesome engine! I brought it the other day and have only run the demos so far. they run really well on Google Nexus 7.

Thanks so much!

The demos are great - there are several ideas that I want to develop and the engine is just a perfect fit for all of them!

I can’t wait for the isometric integration (looks amazing) and physics.

What an awesome contribution to the Corona community!

I’ll just say what everyone is thinking: When is Corona going to start paying Dyson to work full time.  haha

@cjc83486 - True.

lol … Whatever happens please just keep up the great work on MTE! :stuck_out_tongue:

I have just started to use this all today. I am kind of stuck. Is there going to be some youtube tutorial? Things don’t seem to ba making much sense to me. I am reading the “MTE Tilesets, Map Structure, Getting Started.pdf” document.

The tileset that is exported from TexturePacker is different in layout to my original tileset. In GIMP I have things nicely laid out and can see groups of tiles. In TexturePacker it seems to just place my blocks at random so when I open that tileset in Tiled… I see a random flipping collection of blocks that are totally unusable.

What am I doing wrong here? I really need to see in Tiled my tiles in the same order as they were in GIMP.