Million Tile Engine Beta Release

corona5196, you can use updateTile(parameters) to remove a tile by setting it to 0. For example:

mte.updateTile({locX = 10, locY = 10, tile = 0, layer = 1})

SurfieldA, I suggest you try Corona’s Accelerometer sample in /CoronaSDK/SampleCode/Hardware/Accelerometer1/. Using the accelerometer to move a sprite would amount to choosing the force you wish to apply and applying it to the player in the accelerometer runtime event. If the player is a physics object you can use the standard physics object functions for applying force or linear velocity. Otherwise you can use mte.moveSprite(sprite, velX, velY). 

That sounds great!

We are really looking forward to the isometric support.

MTE v0.872 - http://gum.co/staO

The Million Tile Engine’s horizon is ever-expanding as more and more features fall into place! Version 0.872 marks the end of the heavy lifting for Physics integration and brings a slew of new improvements, features, and functionality to the engine. With the bulk of the physics work out of the way I’ll be setting my sights on the next major feature: isometric support. 

The most visually obvious addition in 0.872 is support for the remaining Tiled Objects; polygons, polylines, ellipses, and box/squares. All these objects can be rendered as vector objects by setting any combination of lineColor, fillColor, and lineWidth properties in the Tiled editor. You can define their physics properties as you would with the gid/tile objects of 0.844, but the new engine goes one step further: by setting an object’s shape property to “auto” you can have the correct physics shape generated for you at runtime. This includes multi-body shapes for convex polygons; draw any non-intersecting polygon in Tiled and MTE will find a combination of bodies to fill that space and make it collidable!

Tiled Objects are drawn en masse with the new function drawObjects(). If you gave the object a name in Tiled, the new display object will also have that name, and you will be able to call up a reference to that specific display object as needed. Additionally developers can draw a single object using drawObject(), or redraw an object with modified properties by calling redrawObject(). 

I touched on a few of the other new features in the forum. When you load a map, that map is now saved in memory by default. The next time you call loadMap(), that map will load from memory in a fraction of the time, rather than having to be parsed from it’s file all over again. New ‘unload’ arguments for cleanup() and loadMap() will override this feature and erase the map, perfect for conserving memory. The brand new functions preloadMap(), getLoadedMaps(), and unloadMap() allow for greater control over what map is available and when. 

New lookup functions make life amongst large numbers of sprites and tiles a lot easier! The function getSprites() takes many parameters and returns a convenient list of all sprites which match those parameters. getTilesWithProperty() does exactly what it says, returning every active tile with the matching property. 

More intriguing are the new listener functions. addPropertyListener() monitors the engine’s internal clockwork for spawning tiles into the active culling region. If a tile generates which has the specified property, the engine dispatches an event to your listener. The function addObjectDrawListener() works in much the same way, however it monitors the Tiled Object draw functions mentioned above and dispatches an event on a matching name rather than a property. 

There is much new to see! I recommend looking into the Platformer - Angled PHYSICS sample project. It includes a new map demonstrating the new Tiled Object physics and draw support, toggle-able by uncommenting lines in main.lua. The new LineOfSight sample demonstrates the possibilities of Physics Raycasting for obstacle detect and the sample’s namesake; line of sight. Definitely take a few moments to peruse the new API and Reserved Tiled Properties documentation as well.

A great deal has changed within the pre-existing MTE functions to improve stability and performance, and to enable MTE’s old movement functions to manipulate physics objects. If I’ve learned anything, it is that bugs love change! I’ll be keeping an eye on the forum for any bug reports. 

Enjoy!

Yay! Thanks Dyson for your hard work. Did you mean to say MTE 0v872 on the first line? Just wanted to be sure!

I can’t wait for Isometric support and what you’ve done with physics is truly amazing.

Thanks again!

Did you mean to say MTE 0v872 on the first line?

Yes I did! Thanks for pointing that out. It’s fixed now.  :slight_smile:

hah - just wanted to make sure!

Thanks again for the hard work and dedication to the project - it is looking awesome!

Brill! I think addPropertyListener() is going to be just what I need to spawn monsters in my cave game :slight_smile:

This is great! Thank you very much for your continued dedication and amazing work. 

@Dyson-  I’d just like to voice my appreciation for your tile engine.  I know it’s getting bigger and bigger, which probably means much more work.  My game wouldn’t have had all the little extra things without your hard work and dedication to your project.  Thanks a ton and I’ll keep you posted of any bugs or cool small extras you can add (though I don’t want to create too much work for you).  Thanks again!

I do appreciate that cjc83486, and you’re so very right about the complexity of the engine feeding back on itself. Adding Isometric support requires changes throughout the code. For example, if MTE did not include camera constraints, I would not have to update camera constraints to work with Isometric maps. Iterate this logic across several releases, and pretty soon minor changes require significant work.

I do have some neat things I’d like to add in addition to the new map support. I’m looking into importing Tiled’s terrain data and having updateTile optionally obey those rules. I think some other RPG makers call it automapping, you know, you paint a tile and it automatically adds the corresponding edge tiles around it. The data is stored in the XML format, so I figure I might as well add TMX map support to eliminate the need for json exporting as well.

The other thing I’ve mentioned here and there is perlin noise. I like perlin noise. As a major fan of such games as Terraria and Minecraft, I just love perlin noise. I already have a perlin noise function sitting around from MTE’s predecessor Terraria-clone-in-abandoned-progress, so I’ll be adding that. What people do with it is up to people. If you feed it 2D noise it will spit out delightfully natural cave shapes or world map continent shapes, depending on the setup perimeters. 1D noise will yield a pseudo-random series useful for animating the motion of… I don’t know, falling leaves? Snowflakes? Killer bees? It has its uses.

These are on the sidelines right now. The task at hand is getting MTE’s convert function to work with Isometric maps. It isn’t easy work, but it is satisfying to conquer these roadblocks as they rear their ugly heads. When the main work on MTE is finished I can divert some of my time to Coronastein3D, or maybe even use my engine to actually make a game myself. That would sure be nice!

But do definitely let me know if you encounter bugs. Bugs deserve to be squashed with extreme prejudice. 

Hi dyson,

great news, can’t wait to try out these great improvements.  Do you have a view on when the documentation will be revised?

I just spotted that you’ve provided the updated docs in the download files, so no worries right now.  I was looking at the docs on the website which are the previous versions.

Good catch, Coldwilson. I’ve updated the docs here in the sale thread.

@Everyone: I have a question for all MTE customers and prospective customers, which I’ve stashed in a separate thread to keep this one nice and neat: http://forums.coronalabs.com/topic/38235-mte-coronastein3d-price-increase/

Working on the Isometric sample project for next release. This will be a three map, storyboard sample.

1uz8.png

dyson, awesome work. now you only need to tell me that pathfinding, a* will be included for enemies :slight_smile:

I’m thinking of including the Jumper library for pathfinding in one form or another. Ill have to look into it further, but it appears to be a well developed and relatively mature library. 

The Isometric sample project is coming along nicely. In this case I’m also using it as a test bed to develop and debug the rest of the features, so Isometric support is not quite ready for prime time. Still, it’s coming along.

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

Wow, cool as Dyson! Slightly annoying because when you release this I will have to fiddle with it at the cost to my other projects :rolleyes:

dyson, awesome! do you think it will be possible to have enemies with collision detection and all? its really amazing what you did, this is a hell lot of work you did!

Collision detection is something you would set up in much the same way as in orthographic maps! The difference here is that you’ll want to put the collision points / physics body down near the enemy’s feet.

Speaking of physics, while there won’t be anything stopping people from using physics in an isometric map, it is important to remember that the map’s axis’ are skewed in relation to each other. We see this as perspective, but the physics API does not. For example, if you put a flat diamond shaped physics body near the player’s feet, basically the size and shape of one isometric floor tile, and you put the same body on a wall or stone or what have you, when the player hits the obstacle he will slide against it rather than coming to a stop. From our perspective he is walking directly against it, but in the physics simulation’s perfectly flat plane he is actually moving against it at a slight angle. I don’t believe the physics API can be configured differently, but if so someone please let me know!