Million Tile Engine Beta Release

Don’t have anything on-hand but I’ve been using MTE with the ultimate config.lua method for quite some time now. 

Preface:

  1. I’m building a game world with 16x16px tiles. So in Tiled, I’m working with the 16x16 assets. If I was using @2x I would build the world using the original assets, not the @2x.

  2. This is obviously too small for even the 3GS, so I scale up appropriately based on device. 3x (48x48) is great for phones, 4x for Tablets. The ultimate config.lua method (and device.lua) help you pinpoint what devices to feed what scale factor on startup.

  3. The scaling works because I use GL_NEAREST - which gives you pixel-perfect scaling. I’ve used @2x assets before with MTE but GL_NEAREST lets you skip it entirely and use one asset for all resolutions…providing you don’t need any kind of scale-smoothing done.

might be different to what I am after I think. I want to be able to have 3 different resolution versions of each tileset, with different prefixes on the file names per config.lua. Then I need MTE/COrona work together to load the right resolution version.

PS.  So just checked the Corona doco, so what I’m after is how to use MTE for Dynamic Image Selection per http://docs.coronalabs.com/guide/basics/configSettings/index.htmlhttp://docs.coronalabs.com/guide/basics/configSettings/index.html.  

Also, anyone know do you get the top/left of your map to start at the top/left of your screen?  I get black margins at the left and top.  Also I guess then in general, how do you get MTE to make sure you never have any black margins showing inside the content area?  (in my case I want the player to start somewhere typically in the top/left hand side of the map.  As the player moves to the right say, when they get towards the end of the right hand side of the map, the right hand side of the map should remain aligned with the right hand content area, and never go any more to the left exposing some black space)…

Thank you Dyson for the update - hopefully I will have some time to work with the new features. I can’t wait for Isometric maps and physics looks great!

Hi all,

First of all kudos to dyson122 on a great API that really helps to leverage Tiled so that it is pretty much a level editor.

I was wondering if anyone was seeing an issue with the FPS going insanely high? I’m using storyboards and everything works fine if I load straight into the gamescene with MTE running. However if I go from a basic menu into the game menu the FPS goes up to 1000. 

This also appears to happen when using the same menu to go into the storyboard demo project so I’m not sure if it’s my misunderstanding of storyboards or an issue with MTE. I’ve attached the code of the menu I go into first before the game. If you change the RotateConstrainStoryBoard demo project to load this scene first it ‘should’ replicate.

his only seems to happen when I use the widget to create buttons. If I just create an imagerect for a button it seems to be fine

cheers

local storyboard = require( "storyboard" ) local scene = storyboard.newScene() local myData = require ("mydata") local widget = require( "widget" ) ---------------------------------------------------------------------------------- -- -- NOTE: -- -- Code outside of listener functions (below) will only be executed once, -- unless storyboard.removeScene() is called. -- --------------------------------------------------------------------------------- local buttonHandler = function( event ) myData.prevMap = nil myData.nextMap = "map1" storyboard.gotoScene("scene") end -- Called BEFORE scene has moved onscreen: function scene:willEnterScene( event ) local group = self.view local button1 = widget.newButton { id = "button2", defaultFile = "buttonYellow.png", overFile = "buttonYellowOver.png", label = "Load map", labelColor = { default = { 51, 51, 51, 255 }, }, font = "Arial", fontSize = 22, emboss = true, onEvent = buttonHandler, } button1.x = 410; button1.y = 290 group:insert(button1) end -- Called immediately after scene has moved onscreen: function scene:enterScene( event ) end -- Called when scene is about to move offscreen: function scene:exitScene( event ) end -- Called prior to the removal of scene's "view" (display group) function scene:destroyScene( event ) end --------------------------------------------------------------------------------- -- END OF YOUR IMPLEMENTATION --------------------------------------------------------------------------------- -- "willEnterScene" event is dispatched before scene transition begins scene:addEventListener( "willEnterScene", scene ) -- "enterScene" event is dispatched whenever scene transition has finished scene:addEventListener( "enterScene", scene ) -- "exitScene" event is dispatched before next scene's transition begins scene:addEventListener( "exitScene", scene ) -- "destroyScene" event is dispatched before view is unloaded, which can be -- automatically unloaded in low memory situations, or explicitly via a call to -- storyboard.purgeScene() or storyboard.removeScene(). scene:addEventListener( "destroyScene", scene ) --------------------------------------------------------------------------------- return scene

Hey Folks,

I’m just trying to get a feel for the sample code provided (Angled PHYSICS 0v844), but there is a mystery that has me stumped.   I cannot see how the green (or in Angled 2, the red) balls are created.  From the paragraph above, it is obvious that you created them in Tiled and that was what I suspected anyway.  But when I look through your Tiled maps, I don’t see them.  Where do I look for them?  How can I see their properties?  Can you see them in the version of Tiled you are working with?  What version of Tiled are you working with?  

I am using the latest version of Tiled (0.9) and I’m wondering if maybe it’s not showing something you can see.  Any thoughts would be appreciated.

Michael

EDIT: I just created this post as it’s own topic.  Should have done that in the first place.  Sorry!

No problem, michael714, I answered in your other thread.

Neonyourself, I couldn’t reproduce your 1000 fps bug, but copying your menu file and modifying RotateConstrainStoryboard as instructed did cause other issues. Your buttonHandler event is calling storyboard.gotoScene(“scene”) twice in quick succession; once for each event phase. modifying your code to trigger on event.phase = “ended” fixed the issues on my end and may solve yours as well.

local buttonHandler = function( event ) if event.phase == "ended" then myData.prevMap = nil myData.nextMap = "map1" storyboard.gotoScene("scene") end end

Does MTE support the Tiled functions:

Insert Rectangle,

Insert Polygon,

Insert Polyline,

Insert Ellipse?

If It doesn’t, do you think you could add them in?  It would be nice to be able to draw the objects in Tiled, put “physics” in the objectlayer/objectproperties, and use those as physics objects (instead of just tiles).

Not currently, but yes, of course, I will add those to my todo list for the next update. I’m assuming you would want the physics body to take on the shape of the object itself, rather than specifying a shape in it’s properties, but how would you prefer these to be displayed if at all? The simplest way would be to draw a line/polygon of a user-specified color, but I can see other interesting possibilities as well.

We were wondering how easy would it be to insert a multi-facing sprite into an isometric scene, and have them update to face in a particular direction as the scene rotates?

Something like this (excuse the character’s lack of clothing):

http://www.blackhand.com/rmxp/8_way_large.png

does this support the world rotating

I’ve had MTE running for 24 hours no probs (the earth did a whole rotation in this time)  :)            sorry couldn’t resist

understand i have them urges from time to time

@dyson122 - some things I have noted when testing re enabling physics via Tiler

a) Layer properties doesn’t seem to work - add physics=true & bodyType=static to one of the layers does not cause the tiles in the layer to pickup the properties?   (I can put the same properties against specific tiles and it works, this is kind of important as I can’t work out how to do a bulk update of these properties against a bunch of tiles at the same time)

b) Object Layer - only the tile type objects seem to work - really need the other objects to work as this is invaluable - e.g. setting up landing lines, walking lines across multiple tiles etc - can we have this please?

Hi, I am having real problems with MTE. I have had the engine for a while now and have finally got round to testing it out (not the demos).  I am following along with the tutorial in “MTE Tilesets, Map Structure, Getting Started.pdf”.

My code is as follows…

local mte = require"mte" mte.loadMap("cavemap1") mte.goto({locX = 10, locY = 10, blockScale = 32})

I am receiving the following message when trying to launch my code…

Copyright © 2009-2013  C o r o n a   L a b s   I n c .
        Version: 2.0.0
        Build: 2013.1137
WARNING: Cannot create path for resource file ‘cavemap1.json’ b/c it does not exist.

Runtime error
d:\cliff\docume~1\outlaw\sandbox\23\mte.lua:5052: attempt to concatenate local ‘path’ (a nil value)
stack traceback:
        [C]: ?
        d:\cliff\docume~1\outlaw\sandbox\23\mte.lua:5052: in function ‘loadMap’
        d:\cliff\docume~1\outlaw\sandbox\23\main.l

Now if I manually copy the cavemap1.json file into that folder it is all fine. That is until the next error message…

Copyright © 2009-2013  C o r o n a   L a b s   I n c .
        Version: 2.0.0
        Build: 2013.1137
cavemap1.json loaded
World Size X: 128
World Size Y: 128
Levels: 1
Reference Layer: 1
Runtime error
d:\cliff\docume~1\outlaw\sandbox\23\mte.lua:3552: Incorrect number of frames (w,h) = (32,32) with border (1) in texture (w,h) = (512,512). Failed after frame 226 out of 227.
stack traceback:
        [C]: ?
        [C]: in function ‘newImageSheet’

What gives here? Am I missing something?

A little help would be appreciated. I don’t see what I am doing wrong and don’t think it should be this frustrating to get 3 lines of flipping code to run.

BTW, I am very new to corona etc, please help :slight_smile:

@corona5196-

You forgot to load the tileset you used to create the map.  Without and image, it can’t use the .json file.  I’m not sure what your tileset is called… or if it is .png or .jpg, (we’ll call it cave1mapTileSheet.png) but it will look like this:

local mte= require “mte”

mte.loadTileSet(“cave1mapTileSheet”, “cave1mapTileSheet.png”)  --this is your problem, you forgot this–

local map = mte.loadMap(“cave1map”)

mte.goto({ locX = 10, locY = 10, blockScaleX = 32, blockScaleY = 32})

@jstrahan-

What do you mean by world rotating?  …Do you mean device rotating?  If your answer is yes to the second question, then yes, it could support device rotating.  I currently am running my game in portrait mode and dyson’s examples are in landscape mode…  To make it efficient, however, one may have to change the height and width of the displayed screen tiles when rotation the screen (since the dimensions are different…).

Hey thanks for the reply. My code now reads…

local mte = require"mte" mte.loadTileSet("cavetiles1", "cavetiles1.png") mte.loadMap("cavemap1") mte.goto({locX = 10, locY = 10, blockScale = 32})

I am getting the following error…

Copyright © 2009-2013  C o r o n a   L a b s   I n c .
        Version: 2.0.0
        Build: 2013.1137
WARNING: Cannot create path for resource file 'cavemap1.js
ist.

Runtime error
d:\cliff\docume~1\outlaw\sandbox\23\mte.lua:5052: attempt
path’ (a nil value)
stack traceback:
        [C]: ?
        d:\cliff\docume~1\outlaw\sandbox\23\mte.lua:5052:
        d:\cliff\docume~1\outlaw\sandbox\23\main.l

Any suggestions?

@jstrahan; Yes if you don’t plan to use physics, no if you plan to use physics. You can rotate the world by getting the map obj and setting it’s rotation property as you would any group, but physics bodies steadily lose their minds the more the map rotates. I’ll look into that problem. Was there a specific effect you’re aiming for?

@greg; Tile’s take on layer physics properties only when they A) have the physics=true property and B) do not already have the physics properties in question. Changing the layer physics properties will not currently force an update to the tiles in the layer. I will add a means of doing so in the coming update.

I’m actually currently working on adding polygon, polyline, box, and possibly ellipse objects to the physics support! Those will be available in the next update as well.

@corona5196; The most common causes of these problems are misplaced files and misspelled filenames. Your code expects cavemap1.json to be in the root directory of your app. You should also make sure you aren’t missing any capitalization.

I’ve run out of time for now, but I will be on later today to help as well.

Basically my character will stay in middle of screen and my world will move down. Then I have controls to rotate the world but the world will always be moving down no matter the angle I rotate
Like the game
Spinner prologue

Basically my character will stay in middle of screen and my world will move down. Then I have controls to rotate the world but the world will always be moving down no matter the angle I rotate
Like the game
Spinner prologue