I like the idea, but it’s too specific. This is something other devs can implement easily enough on their own.
Hi dyson,
I’m wondering to know, how could we build the tile system which players can add/remove tiles dynamically like Terraria with MTE?
It seems like besides “setTileProperties” we also need an API like “changeTile”.
Do you have any tricks?
Hello phoenixongogo,
You’re looking for updateTile()
updateTile(parameters)
Changes a map tile.
parameters: (table) Describes the change to be made and where.
Format for parameters
locX: The X coordinate of the tile’s location.
locY: The Y coordinate of the tile’s location.
layer: (number) A layer in the tile map.
tile: (optional) The new tile index. Use 0 to remove the tile from the map and display.
levelPosX: (optional) The X coordinate of the tile’s position.
levelPosY: (optional) The Y coordinate of the tile’s position.
Example: mte.updateTile({locX = 21, locY = 19, tile = 7, layer = 1})
oops, I missed it :blink:
Thank you very much! :D :D
Hi Dyson,
I am using mte.constrainCamera({loc = {1,1,mapProp.width,mapProp.height}}), when my image is within these boundaries , there is much lag , the moves very slow. What could be the problem?
First I would comment out the constrainCamera command and relaunch your app. If the lag remains, you cal rule out constrainCamera as the specific cause, and you may have your map scale set to low.
Otherwise, check to make sure you aren’t calling constrainCamera every frame, or multiple times in an event. You only have to call constrainCamera once to setup your constraints.
Hi Dyson,
I have commented out the constrain camera and checked my app, its far better than the before. I couldn’t see much lag, its working fine. And more over i am calling constrain camera function only once. I am using two different json.scale (0.50,0.75) for different Characters. But i am in a situation that i should use constrain camera function . Pls tell me what should i change.
Thanks,
Kumar KS.
Camera constraints shouldn’t cause any noticeable lag. Can you post or PM me the contents of the LUA file in which you call constrainCamera?
Hi dyson,
function GameClass:addPlayer(player, scale)
local playerobj = allClasses[player].new – CREATING OBJECT AND SENDING PARAMS
{
}
Mteobject:constrainCamera(playerobj)
end
This is how i add my constrain camera, which is called only once. If this is not the issue , can u pls tell me which factors generally would cause these type of problems.
Thanks,
Kumar KS
HI dyson,
I have rectified the problem, its because in constrain camera holdSprite is set to true, when i make it false its working fine. But i have got some other problem , now i have updated to v984-7, in this consrain camera behaves differently . I have seen that in new version you are using levelPos instead of loc, here is my code
mte.constrainCamera({loc = {1,1,mapProp.width,mapProp.height}, holdSprite= false, time = 300})
how do i change this to levelpos , my map size is 1760*1248
Thanks,
Kumar kS.
The constrainCamera function accepts both levelPos and loc table parameters. I see nothing wrong with the line of code you posted. What are the symptoms you’re seeing? How is it behaving differently from before? Please be as detailed as possible.
Map stitching is coming along nicely at this point.
[media]https://www.youtube.com/watch?v=aCV5NYp3EbU[/media]
Using appendMap you can append a map to the current map at a specified location, beginning on a specified layer. The function uses preloadMap internally, so each successive time you load the same map it’ll take much less time. Towards the end of the video I add the current map to itself, duplicating all of it’s contents including appended maps at the location specified. You’ll notice some clipping unrelated to the appendMap implementation; this is a quick-and-dirty test using the same code from the 3rd tutorial (for which a video is in the works).
On an unrelated note, I will be away from my computer from this Friday until Monday and unavailable to answer questions, etc.
Hi dyson,
When i was using loc parameters for constrain camera it was behaving well in the older version . But when i changed to the latest version , when i move the player to certain distance , it automatically disappears and starts to move from the first , which i didnt specify in the code . The camera also not moving along with the player . Should i change anything else for the new version .
Thanks,
Kumar kS
That is exactly what I was hoping for! Thanks Dyson - great stuff!
The Million Tile Engine is finally up on Twitter and Facebook! Please let me know whether you have any problems with the pages, I’m not a huge Twitter or Facebook user and I’m not yet fluent with the platforms. I’ll be posting more frequently to Twitter, letting folks know what I’m doing on a day-to-day basis. I’ll continue to post longer, more detailed update news here and now Facebook as well.
https://twitter.com/MTEforCoronaSDK
https://www.facebook.com/pages/Million-Tile-Engine/729090240457650
The first half of the week was spent working on sample code for the MTE functions moveCameraTo, moveSpriteTo, addSprite, setCamera, constrainCamera, getObject, updateTile, and getSprites, with various minor bug fixes to the the engine happening along the way. Putting these functions through their paces was quite useful for that, actually.
On my schedule for Thursday and Friday are two more pieces of API sample code, work on a new tutorial, and an investigation into the feasibility of TMX map stitching; that is to say, a function allowing developers to load additional maps and insert their data into a pre-existing map. This is something I mentioned months ago but which fell off the truck, so to speak.
Any suggestions of API functions to cover in sample code or topics for tutorials would be most welcome!
Hi dyson122,
Thanks for the great work, I purchased your MTE engine a few days ago and am eager to get working with it. My suggesion for a demo would be an airplane flying over terrain where the motion of the plane (any maybe enemies) is independent of the tileset (maybe with momentum)?
A super engine!!!
Hello I am looking to make a Zelda-Link to the Past type game, would the Million Tile Engine be able to handle a game like that? If so, what would it be good at doing and bad at doing? So when I program I can be aware of it.
Now that I’m back I’ll start working through all the questions asked over the last four days. There’s been quite a bit of customer support activity, so it may take me a little bit to reach a specific question, but I’ll get there.
Kumarks, if you could email me your project, or a representative example of the problem you’re having, I’ll look into it for you. I need to see your code in order to troubleshoot this problem.
Azmar, running a game like Link to the Past would be trivial for MTE. I can’t think of anything in that game the engine would have trouble with. It really is one of those best-case scenarios I planned for from the beginning; a retro 16-bit style RPG. One thing to keep in mind however is that MTE is a tile engine, it does not handle things like dialog and combat mechanics; that will be up to you.
Thank you for the very quick response! As far as combat mechanics and dialog, should I be building those from scratch or are there other 3rd party tools that help support that? I got the Physics Editor and if from scratch Corona SDK can handle that?