- © 2010 - 2013 DesuraNET Pty Ltd. All Rights Reserved. June 18th, hug an indie day.
- Privacy Policy
- Terms of Use
How far can you make it? Battle through randomly generated lands and 1000 randomly generated dungeons. Slay monsters, gather resources, and craft new an powerful weapons. All to see just how far you can go. Die in dungeon 999? Start over from one. This is a war of perseverance.
0 comments by trihex on May 8th, 2013
So for the past week or so, most of my development time was spent on getting some lighting and shadowing into the game. I had implemented the same basic functionality in Java using Slick2D, and in a previous version of Torque2D, so I didn't think it was going to be all that tough. Yea, you know what happened.
Since I was in Torque2D, I decided to start with my previous shadowing code that I used in the older version. It took maybe an hour or so to get the code to the point where it would compile. If only that meant it would work too. After running the initial compiling version, I was treated with absolutely nothing. No shadows, no nothing. Just the dungeon as usual. Time to take a look at what's going on.
The old code grabbed objects based on the group they were in. Torque2D allows you to assign objects to specific groups and layers, and then you can control various things (like collision or rendering order) on the group and/or layer. It's a very handy feature. The latest version still has this information, but getting it out of the scene is bit more tricky. And that is were the first issue was, the scene is not where my information was.
When I was initially doing the pick area to grab the objects, I was doing so on the scene and only ever getting 3 things back. No matter what I tried, all I ever got back was 3 items. Why you may ask? Well, because the scene only contained 3 items. It contained a composite sprite, a sprite, and the shadow object. The items I want are on the composite sprite, not in the scene individually. So first update was to change the code to take a composite sprite object and update the selection code to select sprites in group 6 (the group I designated for blocking line of sight). Stepping through the code once more, I now see that I'm getting back 4000+ objects. On the right track! Let's see what what we got, lovely shadows? No.

What we got was a jumbled mess of black things, that somewhat resembled shadows, but were not aligned to the walls of the dungeon. As an added issue, when the player moved, the shape of the shadows did not. Older versions of Torque2D had a mounting feature where you could "attach" one sprite to another with specific offsets, and the two would move as one. The new version no longer has this feature, replacing it instead with Box2D joints. The joints provide a much more powerful way of linking objects together, but it also more complex; especially if you are not familiar with Box2d and its joints, which I'm not. So after playing around for a bit trying to use a joint to get the shadow objects position to move with the players, I just implemented a very basic event system in script that allows objects to subscribe to specific events (like player movement) and have an update method called automatically. So now the shadows are moving with the player, but they have this odd habit of just disappearing as you reach the edges of the map.

In part two, we will finally track down the final piece to the shadow puzzle and tie it into some actual game play. As always, you can track the development of the game at our website, and follow us on Twitter.
Latest tweets from @bloodytonguegam
May 17 2013, 8:14am
Only in Japan... Only. NO FAIR! T.co
May 16 2013, 4:47pm
I hope the new update sat with every one well... can't wait to put our first video together for part 2. #gamedev
May 9 2013, 5:06pm
shadows are moving with the player, they have this odd habit of just disappearing as you reach the edges of the map. T.co
May 8 2013, 4:42pm
shadows are moving with the player, they have this odd habit of just disappearing as you reach the edges of the map. T.co
May 8 2013, 4:40pm
Now the shadows are moving with the player, but they have this odd habit of just disappearing as you reach the... T.co
May 8 2013, 4:34pm
For those on Reddit: T.co
May 8 2013, 4:29pm
Update Finally!! WE have been a all rather sick... next one we are hoping for video. T.co T.co
May 8 2013, 4:05pm
Update coming, got to get the code split so everything renders good. That shouldn't be more than 1 or 2 sessions to complete. #gamedev
May 1 2013, 12:31pm
Nice concept here, will there be a special ending for those few that do manage to reach the end?
Hmm... I hadn't really thought about that, but there should be something. I remember back in the olden days some games would give you a certificate you could print out if you completed it. That might be a cool idea. I will have to come up with something.
Thanks for the suggestion!
This is a really interesting concept, though I doubt I would survive dying in one of the last 850 dungeons...
Tracking.
Well, there will be things for you to build to help you on your journey. The game will have a crafting system that will help you to reach the end. Perhaps, and just a perhaps, there will be an item that may save you from such a fate. Once or twice anyway.
This is starting to look very cool! Tracking
Thanks! The parts are coming together pretty good at the moment. I'm hoping to have an initial alpha build ready sometime in mid to late January.
Thanks for checking it out, and we should have some more news for you soon.