Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Dusk Engine
Started by Caleb P Dec 13 2013 12:22 PM

490 replies to this topic
dusk engine tilemap game engine opensource
[TOPIC CONTROLS]
Page 2 of 20 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

kornjjuan

[GLOBAL: userInfoPane.html]
kornjjuan
  • Observer

  • 13 posts
  • Corona SDK

great! i hope i can start playing with dusk engine soon, just have a lot on my plate at the moment... but seems great and good job!



[TOPIC: post.html]
#27

soggybag

[GLOBAL: userInfoPane.html]
soggybag
  • Contributor

  • 256 posts
  • Corona SDK

Working with Tiled, I created some platforms from lines. I had a problem where the "player" object jumps visibly above a platform but it still passes through. If the player object gets high enough above the platform it will land on it. Trying to sort the problem out I was looking at the bounds of the platforms. The platforms were drawn as single lines with two points in Tiled. When I examine the bounds in Corona these lines appear to have a height of 12pixels! 

 

If I draw a platform as a box, with a height of 0, the bounds work out correctly. Though in Tiled it's impossible to get to the properties of an object with 0 height. 

 

This picture shows Tiled in the background. The red lines are platforms. In the Corona simulator in the foreground you can see magenta rectangles. I drew these using the contentBounds of each of the line platforms. 

 

Screen-Shot-2013-12-19-at-4.39.07-PM.png



[TOPIC: post.html]
#28

soggybag

[GLOBAL: userInfoPane.html]
soggybag
  • Contributor

  • 256 posts
  • Corona SDK

Not sure what I'm doing wrong here. I have an objects layer in Tiled. If I set properties on the Layer all the objects the properties. If I set the same properties on objects individually they don't seem to get the properties. For example, I set the layer properties as:

 

objects:collisionType = platform <-- works fine

 

Setting the same property on an object has no effect. Setting the property as: collisionType = platform, doesn't work either.

 

What am I missing here? 



[TOPIC: post.html]
#29

Caleb P

[GLOBAL: userInfoPane.html]
Caleb P
  • Corona Geek

  • 1,424 posts
  • Corona SDK

The platforms were drawn as single lines with two points in Tiled. When I examine the bounds in Corona these lines appear to have a height of 12pixels! 

This could be because of the display part of the line; Dusk gives line objects strokeWidth so that you can see them for debugging.

 

To see your line objects, use this:

dusk.setPreference("virtualObjectsVisible", true)

 

Everything is working for me, so I'm not sure what's happening. If this issue turns out to be a real problem, can you file an issue with a test case included at the GitHub page?

 

Same with the property thing; setting it on the object works for me.

 

- Caleb



[TOPIC: post.html]
#30

soggybag

[GLOBAL: userInfoPane.html]
soggybag
  • Contributor

  • 256 posts
  • Corona SDK

My work around was to use rectangles for platforms. In Tiled, if you set these to 0 height you can't select them, which is frustrating. Be sure to set the height! This was a problem I was having with the Platformer, in the previous Ceramic demos. Many of the platforms were unelectable, which I realize now was due to the 0 height. 



[TOPIC: post.html]
#31

Caleb P

[GLOBAL: userInfoPane.html]
Caleb P
  • Corona Geek

  • 1,424 posts
  • Corona SDK

So it's still not working for you? If not, please (please, please, please!) file an issue with a test case included.

 

- C



[TOPIC: post.html]
#32

tilen.curin

[GLOBAL: userInfoPane.html]
tilen.curin
  • Enthusiast

  • 99 posts
  • Corona SDK

Is there some sort of maximum allowed tile size for Dusk?

 

I'm trying to add a map, and the console tells me that it can't find a certain tile.

I'm 100% sure that the path is correct, and the image(tile) is .png format.



[TOPIC: post.html]
#33

Caleb P

[GLOBAL: userInfoPane.html]
Caleb P
  • Corona Geek

  • 1,424 posts
  • Corona SDK

What's your terminal output (starting with "Dusk Error:")?

 

- C



[TOPIC: post.html]
#34

tilen.curin

[GLOBAL: userInfoPane.html]
tilen.curin
  • Enthusiast

  • 99 posts
  • Corona SDK

Looks like this:

 

Tileset image <"Documents/coding projects/sidescroller/tiles/ground01.png"> not found.

 

State: Tileset #1 - "ground01"

Traceback: [Base]:[Build Map]:[Load Tilesets]



[TOPIC: post.html]
#35

Caleb P

[GLOBAL: userInfoPane.html]
Caleb P
  • Corona Geek

  • 1,424 posts
  • Corona SDK

And that's the correct directory and name of your tileset image?

 

- C



[TOPIC: post.html]
#36

soggybag

[GLOBAL: userInfoPane.html]
soggybag
  • Contributor

  • 256 posts
  • Corona SDK

So it's still not working for you? If not, please (please, please, please!) file an issue with a test case included.

 

- C

I just did a quick test to print the size of a line element in the terminal. It showed a height of 12 pixels with the virtualObjectsVisible true or false. I'll make a test example and file an issue later today. 



[TOPIC: post.html]
#37

tilen.curin

[GLOBAL: userInfoPane.html]
tilen.curin
  • Enthusiast

  • 99 posts
  • Corona SDK

And that's the correct directory and name of your tileset image?

 

- C

 

"Documents/coding projects/sidescroller/tiles/ground01.png"

 

I checked multiple times.

The image is definitely there.

 

If there is no maximum tile size, then I must have made a mistake somewhere. I'll try out some things...



[TOPIC: post.html]
#38

soggybag

[GLOBAL: userInfoPane.html]
soggybag
  • Contributor

  • 256 posts
  • Corona SDK

The iphone has a limit on the max image size. 1024 for iphone, and 2048 for retina devices. 



[TOPIC: post.html]
#39

tilen.curin

[GLOBAL: userInfoPane.html]
tilen.curin
  • Enthusiast

  • 99 posts
  • Corona SDK

Well...my tiles are 80x80.

 

I just wanted to have sharp graphics for my game.

 

Might think of scaling them down all.



[TOPIC: post.html]
#40

soggybag

[GLOBAL: userInfoPane.html]
soggybag
  • Contributor

  • 256 posts
  • Corona SDK

The limit is a maximum file dimension (width and height). Check the the dimension on your file, if it's larger you can break your tiles into two sheets. 

 

If you're testing in the simulator this is probably not a problem. I don't think the simulator recognizes this limit. 



[TOPIC: post.html]
#41

soggybag

[GLOBAL: userInfoPane.html]
soggybag
  • Contributor

  • 256 posts
  • Corona SDK

I just did a quick test. It appears that the height of a horizontal line is 12 px with virtualObjectsVisible on or off. I posted an issue to your Github project. 

 

I just posted the code into the issue. I can post my example files if you like. 



[TOPIC: post.html]
#42

soggybag

[GLOBAL: userInfoPane.html]
soggybag
  • Contributor

  • 256 posts
  • Corona SDK

Is it possible to set the shape of a physics object via Tiled? Imagine you've made an image or tile object on an object layer. You want the shape to be smaller or something other than a rectangle the size of the tile. 

 

I'm picturing something like the following added to an object in Tiled:

 

 

shape = {-10,-10,10,-10,10,10,-10,10}

 

 

or 

 

 

physics:shape = {-10,-10,10,-10,10,10,-10,10}

Of course neither of these seemed to be working. 



[TOPIC: post.html]
#43

Caleb P

[GLOBAL: userInfoPane.html]
Caleb P
  • Corona Geek

  • 1,424 posts
  • Corona SDK

Tables must be added via JSON, which is interpreted only if the value is prefixed with !json!. Somehow, this didn't get into the docs :)

 

physics:shape = !json! [-10,-10, 10,-10, 10,10, -10,10]

 

- Caleb



[TOPIC: post.html]
#44

soggybag

[GLOBAL: userInfoPane.html]
soggybag
  • Contributor

  • 256 posts
  • Corona SDK

Thanks! That seems to work well. 



[TOPIC: post.html]
#45

tilen.curin

[GLOBAL: userInfoPane.html]
tilen.curin
  • Enthusiast

  • 99 posts
  • Corona SDK

Ok!

I think I have found out why it would say that it can't find the tileset image.

 

I moved all the tileset images to another folder AFTER the mapname.lua was created.

 

I just deleted the old lua file containing map information, opened up Tiled and exported it again.

 

Works now.



[TOPIC: post.html]
#46

Caleb P

[GLOBAL: userInfoPane.html]
Caleb P
  • Corona Geek

  • 1,424 posts
  • Corona SDK

Glad you got it sorted :)

 

- C



[TOPIC: post.html]
#47

soggybag

[GLOBAL: userInfoPane.html]
soggybag
  • Contributor

  • 256 posts
  • Corona SDK

What's the best strategy for removing a map and loading a new map? 

 

I'm guessing map.destroy() removes everything, including physics objects. Q: does this also include objects added to the map that were not included in the map.json?



[TOPIC: post.html]
#48

soggybag

[GLOBAL: userInfoPane.html]
soggybag
  • Contributor

  • 256 posts
  • Corona SDK

Another question: What's the official name for this library?



[TOPIC: post.html]
#49

tilen.curin

[GLOBAL: userInfoPane.html]
tilen.curin
  • Enthusiast

  • 99 posts
  • Corona SDK

I prefer not to waste other people's time here on the forums, but I'm really having trouble understanding this error:

 

Dusk Error:

Invalid GID at position [1,9] <index #401> - expected [0 <= GID <= 24] but got 2684354572 instead.

 

State: Draw Tile <Layer #1 - "Tile Layer 1">

Traceback: [Base]:[Build Map]:[Register Tile Culling and Camera]



[TOPIC: post.html]
#50

Caleb P

[GLOBAL: userInfoPane.html]
Caleb P
  • Corona Geek

  • 1,424 posts
  • Corona SDK

@soggybag:

map.destroy() destroys the map. It should also destroy any added objects (that were added with layer:insert()), as it simply uses a display.remove() for everything (plus some internals).

 

The official name is "Dusk Engine" (oftentimes with "the" in front of it). When referring to it, you can use either one, though - Dusk or Dusk Engine. If you credit it in your game, use "Dusk Engine" (something like "Utilizes the Dusk Engine").

 

The repository hasn't been renamed, yet, so that might be a cause of confusion :)

 

@tilen.curin:

That error means Dusk came across a GID (which means the identifier of which "slice" of the tileset to draw) that was over or under the range of GIDs. For example, if you have 24 tiles in your tileset (as you seem to), a GID of 25 would throw an error because there aren't 25 tiles in your tileset.

 

Your error is likely coming of a flipped or rotated tile. I just pushed a commit that allows flipped tiles (no rotated, yet), so if you download it, flipped tiles should now work.

 

- Caleb




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