Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Million Tile Engine Beta Release
Started by dyson122 Mar 25 2013 12:15 PM

568 replies to this topic
tile tiles lightning blazing engine tile engine
[TOPIC CONTROLS]
Page 2 of 23 1 2 3 4 »
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#26

dyson122

[GLOBAL: userInfoPane.html]
dyson122
  • Contributor

  • 590 posts
  • Corona SDK

Thanks for the advice, but MTE is a library, so it has no interface of it's own :P  As for testing devices, the bigger concern is keeping the engine running smoothly on low-end devices. Luckily Corona is pretty good about keeping the API's MTE uses compatible across the various supported platforms. The more I build onto MTE, the more eager I am to actually use it to make games myself! When I finally get enough free time to start my own projects again I may try funding them through Indiegogo. Kickstarter always struck me as something for larger projects, like Android game consoles or Imperial Death Stars. 

 

A few updates and notes:

 

I've finished debugging the MTE update and the new file will go out to everyone tomorrow along with patch notes and updated documentation. Current buyers should keep an eye out for an email from the address: my username at hotmail.com. I know, two weeks became three, but it can be hard to judge just how long a new feature might take to implement. 

 

I've received a whole bunch of questions about MTE over the past few weeks! I'll be updating the FAQ to answer the common ones.

 

Over the next three weeks I'll be working on a platforming/sidescroller sample project.

 

I've uploaded a short video to demonstrate just what I mean by "Culling." MTE's zoom function will expose the border regions of the display grid if you zoom out far enough. Here you can see the rows/columns of tiles being deleted and added as the camera moves through the map. No matter how large the map is, the device only has to manage this small number of display objects.

 



[TOPIC: post.html]
#27

dyson122

[GLOBAL: userInfoPane.html]
dyson122
  • Contributor

  • 590 posts
  • Corona SDK

Million Tile Engine v0.720 is now available! I've updated the information at the top of this thread! 

 

http://forums.coronalabs.com/topic/33119-million-tile-engine-beta-release/?p=171559

http://sbx.sk/A6c2

 

Changes and Updates:

https://docs.google.com/file/d/0B8zoywKO40aiV2o5Q3UzbHF5bWs/edit?usp=sharing

 

 

I've emailed the new files to current customers.



[TOPIC: post.html]
#28

cjc83486

[GLOBAL: userInfoPane.html]
cjc83486
  • Enthusiast

  • 34 posts
  • Corona SDK

... Oh.. my.. goodness..  *girl scream*.  



[TOPIC: post.html]
#29

dyson122

[GLOBAL: userInfoPane.html]
dyson122
  • Contributor

  • 590 posts
  • Corona SDK

Million Tile Engine v0.721 is now available. This bugfix corrects a problem in goto() when layer 1 is a parallax layer.

 

http://gum.co/staO

 

I've emailed the new files to current customers.



[TOPIC: post.html]
#30

icodemarine

[GLOBAL: userInfoPane.html]
icodemarine
  • Observer

  • 19 posts
  • Corona SDK

I've been playing around with this and so far like what I've found, but can't seem to get it to do something I think is simple. I want to scroll the viewport as a user moves their finger ( as well as use velocity scrolling ).

 

I've got the velocity, etc., but can't seem to get the mte window to move correctly. It appears I can either call mte.goto() or mte.moveCameraTo(). 

 

moveCameraTo is throwing errors that honestly don't make sense given my simply map so I've been focused on goto. It appears goto only moves by the size of my grid? Is that correct? So if I want to shift the viewport by 10 pixels and my grid is 32 I have to move by 32?

 

Should I be using moveCamera?

 

This is for a top down 2D strategy type game, not a scroller.

 

Any suggestions would be appreciated.

 



[TOPIC: post.html]
#31

dyson122

[GLOBAL: userInfoPane.html]
dyson122
  • Contributor

  • 590 posts
  • Corona SDK

MTE's movement functions move the map relative to the native size of the map. If your tiles are 32x32, you call goto() with a blockScale of 64x64, and you call moveCamera(2,0) the map will appear to move 4 pixels across the screen. I'd never thought of it from the perspective of moving the map with a finger swipe, but now that you mention it you would have to compensate for this difference.

 

I threw something together to see just what might be necessary to scroll a map via touch. This is just one way to go about doing it. You're correct that moveCamera would be best in this situation. Anytime you need to move the camera or a sprite on a per-frame basis, moveCamera() and moveSprite() are the preferred functions. moveCameraTo() and moveSpriteTo() are meant for longer motions taking many frames, during which the movement can't be modified. None of the movement functions will appear to do anything unless you call mte.update() in an enterFrame event.

 

local scaleFactor = blockScale / 32 --The ratio of the blockScale to the native size of your tiles

local startX, startY, currentX, currentY
local isDragging = false
local drag = function(event)
	if event.phase == "began" then
		startX = event.x
		startY = event.y
		currentX = event.x
		currentY = event.y
		isDragging = true
	end
	if event.phase == "moved" then
		currentX = event.x
		currentY = event.y
	end
	if event.phase == "ended" or event.phase == "cancelled" then
		startX, startY = nil, nil
		currentX, currentY = nil, nil
		isDragging = false
	end
end

local gameLoop = function(event)	
	if isDragging then
		mte.moveCamera((startX - currentX) / scaleFactor, (startY - currentY) / scaleFactor)
		startX = currentX
		startY = currentY		
	end	
	mte.update()
end

Runtime:addEventListener("touch", drag)
Runtime:addEventListener("enterFrame", gameLoop)

 

 

And here's the result, using the platformer test level because it was on hand. Sorry about the weird compression artifacts. The ground texture really seems to confuse Quicktime.

 

 

 

Speaking of the platformer/sidescroller sample project, it's coming along nicely. When finished there will be three little test maps, each in a seperate storyboard scene, each demonstrating more complicated movement and collision detection then the last. The first map will feature collision detection against entire tiles- each tile is either completely solid or completely passable. That is just about finished and you can see it in the video below. The second map will add sloped ground to the mix. The third will demonstrate how to go about making freeform ground surfaces within a tile using tile properties. 

 

 

I've been making incremental improvements to the Million Tile Engine as well. The next update will bring greatly improved convert() performance. 



[TOPIC: post.html]
#32

icodemarine

[GLOBAL: userInfoPane.html]
icodemarine
  • Observer

  • 19 posts
  • Corona SDK

Thanks for the detailed response. I was just about to post that I figured out moveCamera was the way to go and got it working. I was missing the call to update on enterFrame.



[TOPIC: post.html]
#33

dyson122

[GLOBAL: userInfoPane.html]
dyson122
  • Contributor

  • 590 posts
  • Corona SDK

Two weeks down and the first and second scenes of the sidescroller/platformer sample project are finished. The first scene in my previous post is comprised of a simple map in which tiles are either completely solid or completely passable, and the collision detection and movement code needed for the player sprite to act accordingly.

 

This newly completed second scene demonstrates one possible way to detect and collide with sloped surfaces; tiles can be completely solid or completely passable, or they can have a line segment transcribing them defined in tile properties. Upon a coliision the code calculates whether the player sprite is intersecting this imaginary line and moves it accordingly.

 

 

I'll be working on the third, last scene of the sample project next week. This last scene will be an extension of the second; each individual tile will be very large, but they will contain many collide-able surfaces defined in their properties. 

 

The next update to MTE is also in the works, thanks in no small part to the optimizations involved in making platformer movement work fluidly at 60fps on older devices. While it is perfectly possible to make a platforming game with the current release, the next release will incorporate  numerous performance improvements and a few helpful ease-of-use tweaks.



[TOPIC: post.html]
#34

J. A. Whye

[GLOBAL: userInfoPane.html]
J. A. Whye
  • Corona Geek

  • 1,689 posts
  • Corona SDK

Tried to buy but apparently SellBox sucks. The PayPal window never shows up. 

 

You may be missing more sales -- not everyone says something when the payment processor doesn't work,

 

 Jay



[TOPIC: post.html]
#35

richard9

[GLOBAL: userInfoPane.html]
richard9
  • Corona Geek

  • 1,118 posts
  • Enterprise

Jay, do you use Chrome? It silently blocks all pop-ups regardless of trust level. (?!) Basically you just need to allow Paypal in this instance; I believe there is a little red icon somewhere on the right side of the URL box.

[TOPIC: post.html]
#36

dyson122

[GLOBAL: userInfoPane.html]
dyson122
  • Contributor

  • 590 posts
  • Corona SDK

Thanks for bringing this to my attention, Jay. A cursory internet search shows others having problems buying through Sellbox on Chrome and occasionally Firefox as well. Not good news given the popularity of these browsers. I'll look into the problem and see if I can find another more Chrome/FF-friendly storefront. 

 

In the meantime I'd be interested to know whether richard9's suggestion works. 



[TOPIC: post.html]
#37

richard9

[GLOBAL: userInfoPane.html]
richard9
  • Corona Geek

  • 1,118 posts
  • Enterprise

Just tried it again and it works for me (manually re-enabling the specific popup). A real bummer that there's no popup notification on Chrome though.



[TOPIC: post.html]
#38

J. A. Whye

[GLOBAL: userInfoPane.html]
J. A. Whye
  • Corona Geek

  • 1,689 posts
  • Corona SDK

No, I'm using Safari on my Mac. Just tried again in case it was a temporary glitch -- no joy.

 

 Jay



[TOPIC: post.html]
#39

dyson122

[GLOBAL: userInfoPane.html]
dyson122
  • Contributor

  • 590 posts
  • Corona SDK

I couldn't make it work with Safari either. I've fired off an email to Sellbox. In the meantime I'll be looking for an alternative storefront.



[TOPIC: post.html]
#40

codingcake

[GLOBAL: userInfoPane.html]
codingcake
  • Contributor

  • 124 posts
  • Corona SDK

Hi

 Is any schedule to support isometric tiles  ?

That will be pretty cool



[TOPIC: post.html]
#41

binarymoon

[GLOBAL: userInfoPane.html]
binarymoon
  • Observer

  • 19 posts
  • Corona SDK

For payment processing I've heard good thins about gumroad.com - and apparently they have a system for sending out software updates. Not used them myself but heard good things about them.



[TOPIC: post.html]
#42

dyson122

[GLOBAL: userInfoPane.html]
dyson122
  • Contributor

  • 590 posts
  • Corona SDK

Thanks for the suggestion binarymoon. I've sent inquiries about software updates to both Gumroad and Quixly. Gumroad is interesting in that it takes credit card payments while Quixly takes PayPal. I can see advantages and disadvantages to both, but software updates will probably be the deciding factor.

 

EDIT: Actually, whether they work in all popular web browsers will be the deciding factor.



[TOPIC: post.html]
#43

dyson122

[GLOBAL: userInfoPane.html]
dyson122
  • Contributor

  • 590 posts
  • Corona SDK

MTE is now available through Gumroad! The relevant links have been updated. 

 

http://gum.co/staO

 

Codingcake: I do plan on adding isometric tile support, however given the complexity of the addition I have as yet no idea how long it will take to complete. I'll have a better idea after I finish the current update / platforming sample and begin working on it.



[TOPIC: post.html]
#44

SegaBoy

[GLOBAL: userInfoPane.html]
SegaBoy
  • Contributor

  • 635 posts
  • Corona SDK

Quick question - I've been looking at the Open Source Corona Tiled library that a couple of guys are developing. However I am interested in the MTE. I need to use A* pathfinding and for this I need a 2D array of the tiles. Currently CT doesn't have that built into the data structure so was wandering whether this is the case for MTE?

 

Quick synopsis - I've made a simple tile engine in a 2D array, storing the tile and relevant properties. A* library then runs through this 2D array to calculate shortest path. I do however want the luxury of maps designed via Tiled - hence why I'm lloking at CT and MTE.

 

Any answers would be appreciated...



[TOPIC: post.html]
#45

icodemarine

[GLOBAL: userInfoPane.html]
icodemarine
  • Observer

  • 19 posts
  • Corona SDK

I'm actually in the process of doing this right now. This isn't the most efficient approach, but what I've done so far is take the map and create an pathing array:

[lua=auto:0] 

local map = mte.getMap() 

 

 

     mapArray ={}
        local mapH  = map.height
        local mapW = map.width
        for i = 1, mapH do
                mapArray[i -1] = {}
            for j = 1, mapW do
                mapArray[i-1][j-1]=1
            end 
            
        end 
[lua=auto:0]
Now I set a flag in the object layer when a path is clear so the first step basically sets everything as non traversable. Next step run through the object layer setting values appropriately. My object layer items have x/y so it is simple:
[lua=auto:0]
local objLayer = mte.getObject({ layer=OBJ_LAYER})

        for x = 1, #objLayer do
            mapArray[objLayer[x].x][objLayer[x].y] =0
        end
[lua=auto:0]
Note that I've just set this up and haven't tested it yet :)


[TOPIC: post.html]
#46

SegaBoy

[GLOBAL: userInfoPane.html]
SegaBoy
  • Contributor

  • 635 posts
  • Corona SDK

I've got A* working perfectly - however it relies on having that 2D array structure. I'm assuming that, from your comments, MTE doesn't provide this structure, so have to do a workaround as I'm doing with Corona Tiled?

 

Thanks for the info...



[TOPIC: post.html]
#47

dyson122

[GLOBAL: userInfoPane.html]
dyson122
  • Contributor

  • 590 posts
  • Corona SDK

Hello SegaBoy,

 

You can access the 2D world arrays using mte.getMap(). For example:

 

local mapData = mte.getMap()

print(mapData.layers[4].world[7][15])     --access tile index at (7,15) on layer 4


[TOPIC: post.html]
#48

J. A. Whye

[GLOBAL: userInfoPane.html]
J. A. Whye
  • Corona Geek

  • 1,689 posts
  • Corona SDK

Regarding tiles for A* and other pathfinding... (I'm using Lime for my current project, but I don't think the tile engine matters in this case.)

 

I'm not using A*, but the Jumper library from Roland Yonaba (https://github.com/Yonaba/Jumper) and it wants a 2D array to know where the path can be.

 

In Tiled I created a tile layer that's at the bottom of the list (tiles in there are drawn first, everything else is drawn on top of those) and named it walkable.

 

On that layer I just placed tiles in every location that was NOT walkable -- walls, crates, etc. I ended up with a layer of lots of zeros and some other things. Jumper sees zeros as empty locations where it can place the path.

 

When you export that layer as Lua you get a table of data that's easy to change into what Jumper needs:

 

Original:

data = {
1,0,0,0,1,
1,1,0,0,1,
1,1,0,0,0
}

 

New:

 

data = {
{1,0,0,0,1},
{1,1,0,0,1},
{1,1,0,0,0}
}

 

Creating a utility to tweak the exported data automatically wouldn't be hard, but doing it by hand (even on a large map) takes less than a minute.

 

 Jay

 

 

 



[TOPIC: post.html]
#49

SegaBoy

[GLOBAL: userInfoPane.html]
SegaBoy
  • Contributor

  • 635 posts
  • Corona SDK

Hi Jay - thanks for the info.

 

The process I have at the moment is to build a simple 2D array and add attributes to the tile - A* then checks tiles and looks for any tiles with .isObstacle = true to discover the shortest path without obstacles.

 

I'm planning to have plenty of logic in the environment (interactive items, scent based pathfinding, etc..), but trying to build maps by hand is an absolute nightmare - hence why I want to use Tiled and a tiling engine that will allow all of this.

 

@dyson122 - thanks for the info, that pretty much sells MTE for me :)



[TOPIC: post.html]
#50

SegaBoy

[GLOBAL: userInfoPane.html]
SegaBoy
  • Contributor

  • 635 posts
  • Corona SDK

Just picked this up and beginning to dig into it but wanted to say that first impressions are amazing; one of the most astounding pieces of Corona code I've seen so far and everything appears to be really tidy.

 

Nice job.




[topic_controls]
Page 2 of 23 1 2 3 4 »
 
[/topic_controls]