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 4 of 20 2 3 4 5 6 »
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#76

Caleb P

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

  • 1,424 posts
  • Corona SDK

Nice thinking :)

 

Side note: You can get tiles to overlap by making the tilewidth of the map 32 (or your normal width), and load your tileset as having 34 width (with an extruded image). Then, you paint with the bigger tiles and it should work.

 

- C



[TOPIC: post.html]
#77

cspence

[GLOBAL: userInfoPane.html]
cspence
  • Contributor

  • 338 posts
  • Enterprise

How does this compare to the Million Tile Engine?



[TOPIC: post.html]
#78

Caleb P

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

  • 1,424 posts
  • Corona SDK

[TOPIC: post.html]
#79

cspence

[GLOBAL: userInfoPane.html]
cspence
  • Contributor

  • 338 posts
  • Enterprise

How is the speed compared to the Million Tile Engine?



[TOPIC: post.html]
#80

Caleb P

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

  • 1,424 posts
  • Corona SDK

I'm not sure, as I don't own MTE.

 

I'd probably say MTE is faster than Dusk, simply because MTE was written for speed. That said, I've done to Dusk close to all I know to optimize things. Dusk, like MTE, has an automatic tile culling algorithm that runs quite fast (though I don't know the compared speeds).

 

It would be nice, now that you ask this, for someone who owns MTE to try both of them and let me know about the performance differences. Dusk and MTE might come out about the same right now (now that I think of it), but that's just speculation from what I know of MTE, so I could easily be wrong.

 

- C



[TOPIC: post.html]
#81

cspence

[GLOBAL: userInfoPane.html]
cspence
  • Contributor

  • 338 posts
  • Enterprise

I would love to see something done with Dusk if anyone has any examples.  Been wanting to get into tile game.



[TOPIC: post.html]
#82

tilen.curin

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

  • 99 posts
  • Corona SDK

Well I'm currently working on a fast paced sidescroller and honestly I think that Dusk will be just fine. I'm not worried about speed.

 

I may post some pictures or footage soon of how the game looks, but I need to solve some problems with the map first.



[TOPIC: post.html]
#83

lvl9hero

[GLOBAL: userInfoPane.html]
lvl9hero
  • Observer

  • 7 posts
  • Corona SDK

hi there,

 

i'm trying to figure out what these lines mean, if you could break it down for me it would be much appreciated..

 

-- Position player and star
player.x, player.y = map.tilesToPixels(map.playerLocation.x + 0.5, map.playerLocation.y + 0.5)
finish.x, finish.y = map.tilesToPixels(map.finishLocation.x + 0.5, map.finishLocation.y + 0.5)

i tried looking in your Dusk Docs but I think you're still working on completing it right?

I'm wondering how you positioned/determined where to place the objects... this is in your bob.lua file.

I tried opening your Tiled level files (mapdata/levels/...) but i only saw you drew in the level itself in your single layer called "tiles" but no object layer/player/stars

 

thanks

 



[TOPIC: post.html]
#84

soggybag

[GLOBAL: userInfoPane.html]
soggybag
  • Contributor

  • 256 posts
  • Corona SDK

I was having an issue with objects and different screen sizes. Here you can the iphone 4 size things are correct. In the ipad image, some of the objects are positioned weird. Not sure what's going on here, could be me.  The turtle (purple) and the spring (red) should sit on the ground as in the first picture. 

 

Screen-Shot-2014-01-05-at-11.56.51-PM.pnScreen-Shot-2014-01-05-at-11.56.30-PM.pn



[TOPIC: post.html]
#85

reyanthonyrenacia

[GLOBAL: userInfoPane.html]
reyanthonyrenacia
  • Contributor

  • 121 posts
  • Corona SDK

Just wanna give a shoutout to Caleb the Clever guy (:
Get ready for my questions soon brah, coz im planning to make a platformer game!  this better help! :P   :))



[TOPIC: post.html]
#86

Azmar

[GLOBAL: userInfoPane.html]
Azmar
  • Contributor

  • 140 posts
  • Corona SDK

I was having an issue with objects and different screen sizes. Here you can the iphone 4 size things are correct. In the ipad image, some of the objects are positioned weird. Not sure what's going on here, could be me.  The turtle (purple) and the spring (red) should sit on the ground as in the first picture. 

 

Screen-Shot-2014-01-05-at-11.56.51-PM.pnScreen-Shot-2014-01-05-at-11.56.30-PM.pn

How did you make physics objects smaller than the actual image and how did you make your bottom one complete physics object like that? Also how did you create physics objects like the circle with no image there, I only know how to make a physics object based off an image. Sorry for noob questions



[TOPIC: post.html]
#87

Azmar

[GLOBAL: userInfoPane.html]
Azmar
  • Contributor

  • 140 posts
  • Corona SDK

0i7DQ7t.png

 

I'm having troubles with the collision where my guy will get stuck on the 32x32 squares if he walks on a wall. I want one complete wall and not 32x32 walls that are all lined up. Also in Tiled there are these weird gaps when i bring it up in my app. I posted a picture to show the example, and I don't want them to be there because they cause problems.

 

Also I am using the Physics Editor for that one wall that I said "yes" as what I want (which is making the image false so you cant see it, but Physics Editor is causing me problems where I would rather do it through corona or tiled physics. Thanks for the help.


 



[TOPIC: post.html]
#88

soggybag

[GLOBAL: userInfoPane.html]
soggybag
  • Contributor

  • 256 posts
  • Corona SDK

The platforms, ground and wall objects are drawn as objects on an object layer. The spring thing, and the character at the bottom were created as tile/picture objects on an object layer. 



[TOPIC: post.html]
#89

Azmar

[GLOBAL: userInfoPane.html]
Azmar
  • Contributor

  • 140 posts
  • Corona SDK

Yes, ty very much! That solves a lot of problems!


Edit: That answer ended up solving my other question too, I'm just using objects now instead of using individual tiles every time. The object layer works perfectly and doesn't cause any collision problems anymore (I just create the objects for every wall on the tiled map), the new problem is now the screen flickers like crazy on the sides of the app when I move the player. If I delete the object layer the flickers go away too. They are like giant black small rectangles/lines that last 0.5ms, would not make the game fun lol. Any way to keep the object layer and get rid of flickers?

 

Also I noticed the examples from github dusk engine the screen flickers like mad too.....I think this would be a big problem for a game.



[TOPIC: post.html]
#90

lvl9hero

[GLOBAL: userInfoPane.html]
lvl9hero
  • Observer

  • 7 posts
  • Corona SDK

hi there,
 
i'm trying to figure out what these lines mean, if you could break it down for me it would be much appreciated..
 

-- Position player and star
player.x, player.y = map.tilesToPixels(map.playerLocation.x + 0.5, map.playerLocation.y + 0.5)
finish.x, finish.y = map.tilesToPixels(map.finishLocation.x + 0.5, map.finishLocation.y + 0.5)
i tried looking in your Dusk Docs but I think you're still working on completing it right?
I'm wondering how you positioned/determined where to place the objects... this is in your bob.lua file.
I tried opening your Tiled level files (mapdata/levels/...) but i only saw you drew in the level itself in your single layer called "tiles" but no object layer/player/stars
 
thanks


could anyone help with this question? sorry I'm totally new to any kind of programming but I'm really trying to learn thanks.

[TOPIC: post.html]
#91

Caleb P

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

  • 1,424 posts
  • Corona SDK

@lvl9hero:
Map -> Map Properties... holds the values the main map object has. Properties put there will show up in the main map object.
 
@soggybag:
I'll look into this. At the moment, try implementing a dynamic config as shown in "The Ultimate 'config.lua'" or changing your scale type.
 
@Azmar:

For the flicker issue, have you tried the screen texture filter settings:
display.setDefault("minTextureFilter", "nearest")display.setDefault("magTextureFilter", "nearest")

Otherwise, you'll have to try extruding your tilesets. If the problem is more than just flickering lines between tiles, please file an issue with a test case in it.

As for your physics body issue, the tiles on the left (after the PE wall) are like that because they're just that - tiles. Each tile is given its own physics body.

- C

[TOPIC: post.html]
#92

tilen.curin

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

  • 99 posts
  • Corona SDK

Hmm...I have a pretty wierd problem here.

 

My character object gets stuck in vertical tiles AKA walls, if it keeps moving towards them.

It keeps moving up and down a little.

 

Attached File  stuck.jpg   13.28KB   53 downloads

 

I don't know why the object can even overlap tiles in the first place. I'm guessing it has something to do with the body type, but I don't know how exactly I could solve this problem.

 

The character shouldn't be able to move slightly over tiles.

 

If the character wouldn't overlap into tiles, he wouldn't get stuck.

 

Any ideas?



[TOPIC: post.html]
#93

Azmar

[GLOBAL: userInfoPane.html]
Azmar
  • Contributor

  • 140 posts
  • Corona SDK

Hmm...I have a pretty wierd problem here.

 

My character object gets stuck in vertical tiles AKA walls, if it keeps moving towards them.

It keeps moving up and down a little.

 

attachicon.gifstuck.jpg

 

I don't know why the object can even overlap tiles in the first place. I'm guessing it has something to do with the body type, but I don't know how exactly I could solve this problem.

 

The character shouldn't be able to move slightly over tiles.

 

If the character wouldn't overlap into tiles, he wouldn't get stuck.

 

Any ideas?

Getting stuck on walls going vertical was exactly the same problem I was having. It's because you have those 32x32 blocks all attached making a wall and he will get stuck on each 32x32 block. After a lot of testing it seems to happen most the time going on any right wall lol. I think you are setting the properties to the walls in the tiled layers, but should be on object layer. Just make one complete object around that wall in the object layer that has the same properties as those walls so it will create a giant wall and not a 32x32 block attached with more blocks.

 

On a side note after you change everything to the object layer, let me know if you get any weird black flicker lines anywhere on your app, that happen a lot.



[TOPIC: post.html]
#94

tilen.curin

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

  • 99 posts
  • Corona SDK

Hmmm...in the layer properties I've only added physics:enabled. And added static body types to every seperate tile.

 

Make one complete object around that wall...you mean just display a rectagle or something where the wall tiles are?

 

Or is it possible to somehow group tiles into one object?



[TOPIC: post.html]
#95

Caleb P

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

  • 1,424 posts
  • Corona SDK

@tilen.curen:
You can try what Azmar said (though you'll need to be careful; objects are not culled like tiles are). I think what he means is, instead of making each tile physical, make them just tiles and draw objects to work as the walls. Then, you won't "stuck" on the boundary between tiles (if that's what's happening). If your player is actually moving into the tiles, it's probably happening (if you're setting the velocity each frame) because the collision isn't stopping the player. In that case, I'd set up a "collided" flag for walls and stop setting the velocity if the player is hitting a wall.

I'm going to go a bit "underwater" for a while, as I've got a deadline on a personal project I've got to finish. I'll be a bit less active for a while; though I won't be completely silent, I won't be available to help quite as much as usual.

- C

[TOPIC: post.html]
#96

Azmar

[GLOBAL: userInfoPane.html]
Azmar
  • Contributor

  • 140 posts
  • Corona SDK

@Caleb P:
The flicker problem is not the flicker inbetween tiles, that is a problem too and the  display.setDefault("minTextureFilter", "nearest")display.setDefault("magTextureFilter", "nearest") does not fix it enough. There is a new flicker with giant black lines on edges of screen that only starts when you create an object layer which makes no sense. I would like to send you a file report but its a pain to recreate it without sending my entire project... because the camera/movement/tiled file/engine/images is needed to recreate it. If I delete all object layers it goes away, but obviously I need my object layers. Oddly enough after hours of trying to fix it, if I have the object layer as my first and bottom layer it will still do its physics job, won't be seen by the program... but the flicker problem is completely removed. I've remade multiple maps and fiddled with my code a lot of different ways to figure out where the problem was, I'm pretty sure this is a bug?



[TOPIC: post.html]
#97

tilen.curin

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

  • 99 posts
  • Corona SDK

Is it possible to get coordiantes of individual tiles on your map?



[TOPIC: post.html]
#98

tilen.curin

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

  • 99 posts
  • Corona SDK

Ok, I've found out that it is possible to get coordiantes of tiles on your map.

 

By using map.tilesToPixels

 

@lvl9hero: thanks for asking, the answer was useful for me as well  :)

 

hi there,

 

i'm trying to figure out what these lines mean, if you could break it down for me it would be much appreciated..

 

-- Position player and star
player.x, player.y = map.tilesToPixels(map.playerLocation.x + 0.5, map.playerLocation.y + 0.5)
finish.x, finish.y = map.tilesToPixels(map.finishLocation.x + 0.5, map.finishLocation.y + 0.5)

 

Basically, when you add map properties to your map in Tiled, it looks like this:

 

name/ value

playerLocation/ !json! {"x" : 5, "y" :11}

 

Those X and Y values are units in Tiled AKA tiles. 5 means 5 tiles from left and 11 means 11 tiles from top.

 

Corona doesn't know what tiles are, so you have to convert those values to pixels.

Luckily, Dusk does that for you, by using map.tilesToPixels.

 

For example- If your tiles have a size of 80x 80, 1 tile is converted to 80x 80 pixels.

 

 

This is how I've solved the problem with my character getting stuck between vertical tiles.

I removed the physic bodies from my current wall tiles, as well as disabled physics for them (so that they don't fall down).

 

Then I've displayed objects to serve as walls (yes, thank you for recommending it to me).

 

And then, you just insert that object into one of the map layers, so that it doesn't follow around when your character moves.

 

Correct me if I'm wrong, but I think I understand this now.



[TOPIC: post.html]
#99

Caleb P

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

  • 1,424 posts
  • Corona SDK

@Azmar:
Yes, that does seem to be a bug :(

If it surfaces again, you can try filing a bug report on GitHub and I'll see what I can do. I'd like to ask, though: Have you seen it on any other maps (i.e. create a new blank map, add a tileset, make objects, and run it and the problem appears)?

@tilen.curin:
That's right :)

One thing off-topic that I'd mention is that because the properties "playerLocation" and "finishLocation" are prefixed with !json!, Dusk knows to send the rest of the property to the JSON reader. Thus, it creates a table according to the JSON notation that follows.

You could just as easily do this, because of the way Dusk (by default; it can be disabled if you need dots to be read literally) treats the dot character:

playerLocation.x = 5
playerLocation.y = 11


(another thing off-topic I'd like to mention is that I've written a notation parser for a future version of Dusk that takes notation in the exact form as a Lua table: {abc = 123, ["something else"] = 64.388} so as to remove the gap between properties and Lua code. I've also completed a fully-featured math solver with a complete implementation of the Shunting-Yard algorithm and variables; imagine this for a property: someWeirdValue = sin(map.width) * 64 + (map.height / cos(layer.alpha)))

- C



[TOPIC: post.html]
#100

tilen.curin

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

  • 99 posts
  • Corona SDK

I'm currently trying to get rid of another wierd problem.

When my character lands on the edge of the platform (if one part of the character object isn't touching the tiles), he will bounce back up a little.

If I print the character's y value, I can see that he moves up a little when he lands.

It's wierd, because I've set bounce to 0 on the character and the tiles.

 

This is problematic when it comes to sprite animations- when the character already lands, it still plays the falling animation.

 

I don't know what could be causing this to happen.

The function that check if the character moves up/ down is fine. There is nothing wrong with the functions for playing animations.

 

The character actually moves up a bit after he collides with the ground tiles. If it's not the bounce- what could it be?




[topic_controls]
« Page 4 of 20 2 3 4 5 6 »
 
[/topic_controls]