"Triangle" - Ludum Dare Project Flash Rewrite

Anything related in any way to game development as a whole is welcome here. Tell us about your game, grace us with your project, show us your new YouTube video, etc.

Moderator: PC Supremacists

Re: "Triangle" - Ludum Dare Project Flash Rewrite

Postby flsfr on Mon Mar 24, 2014 3:52 am

The creator of the game Monaco: What's Yours is Mine, Andy Schatz, posted some Facebook notes back in 2010 on how his game did lighting. Personally, I found them to be an interesting read back then. I'm sure :worship: Falco has some edjukation resources that he could share on how he does lighting in the Elysian Shadows' engine.

A philosophical game developer.
Personal Website
User avatar
flsfr
ES Beta Backer
ES Beta Backer
 
Posts: 3
Joined: Wed Jul 10, 2013 7:40 pm
Location: Victoria BC, Canada

Re: "Triangle" - Ludum Dare Project Flash Rewrite

Postby RyanPridgeon on Mon Mar 24, 2014 9:06 am

flsfr wrote:The creator of the game Monaco: What's Yours is Mine, Andy Schatz, posted some Facebook notes back in 2010 on how his game did lighting. Personally, I found them to be an interesting read back then. I'm sure :worship: Falco has some edjukation resources that he could share on how he does lighting in the Elysian Shadows' engine.



That's really cool to see the similarities in our approaches. I never knew Monaco used a vector lighting method. I don't think Falco's lighting could be applied here though, as Flash doesn't play nice with buffers and shaders. :)
Ryan Pridgeon
C, C++, C#, Java, ActionScript 3, HaXe, PHP, VB.Net, Pascal
Music | Blog
User avatar
RyanPridgeon
Chaos Rift Maniac
Chaos Rift Maniac
 
Posts: 451
Joined: Sun Sep 21, 2008 2:34 pm
Location: UK

Re: "Triangle" - Ludum Dare Project Flash Rewrite

Postby ph0sph0ruz on Fri Mar 28, 2014 9:32 am

A game I saw today that looks similar to how you're doing the lighting.

https://back.nothingtohide.cc/
User avatar
ph0sph0ruz
Chaos Rift Newbie
Chaos Rift Newbie
 
Posts: 39
Joined: Sat Mar 22, 2014 4:52 am

Re: "Triangle" - Ludum Dare Project Flash Rewrite

Postby RyanPridgeon on Sat Mar 29, 2014 10:20 pm

I added some levers n doors n shit

Image

Image

And a new enemy type :)

Image

Image

As well as health bars!
Ryan Pridgeon
C, C++, C#, Java, ActionScript 3, HaXe, PHP, VB.Net, Pascal
Music | Blog
User avatar
RyanPridgeon
Chaos Rift Maniac
Chaos Rift Maniac
 
Posts: 451
Joined: Sun Sep 21, 2008 2:34 pm
Location: UK

Re: "Triangle" - Ludum Dare Project Flash Rewrite

Postby ph0sph0ruz on Sun Mar 30, 2014 6:28 am

A swarm! Nice. I'm digging this game.
User avatar
ph0sph0ruz
Chaos Rift Newbie
Chaos Rift Newbie
 
Posts: 39
Joined: Sat Mar 22, 2014 4:52 am

Re: "Triangle" - Ludum Dare Project Flash Rewrite

Postby RyanPridgeon on Sun Apr 13, 2014 7:18 pm

Decided to try plugging my controller in :)

Image

Been busy adding lots of stuff to the game, added some more prompts and made the game look better, and made a (maybe temporary) soundtrack.

Image

Might put a video up soon :)
Ryan Pridgeon
C, C++, C#, Java, ActionScript 3, HaXe, PHP, VB.Net, Pascal
Music | Blog
User avatar
RyanPridgeon
Chaos Rift Maniac
Chaos Rift Maniac
 
Posts: 451
Joined: Sun Sep 21, 2008 2:34 pm
Location: UK

Re: "Triangle" - Ludum Dare Project Flash Rewrite

Postby ph0sph0ruz on Sun Apr 13, 2014 10:11 pm

That first video looks like you are playing far away, an optical illusion with the lighting. :D

How many levels have you built so far?
User avatar
ph0sph0ruz
Chaos Rift Newbie
Chaos Rift Newbie
 
Posts: 39
Joined: Sat Mar 22, 2014 4:52 am

Re: "Triangle" - Ludum Dare Project Flash Rewrite

Postby RyanPridgeon on Mon Apr 14, 2014 9:50 am

ph0sph0ruz wrote:That first video looks like you are playing far away, an optical illusion with the lighting. :D

How many levels have you built so far?


I've only got the one test level in there at the moment, but the level editor is in so I've been slowly adding to it when I'm bored :)

Got a lot more stuff I want to get done before I get onto making levels, such as adding triggers/systems for enclosed battles and boss battles, more enemies, gun collecting/switching, more powerups and some traps and stuff maybe. The tools for it are all there though. I'm having shitloads of fun with this thing.

I really need to think of a better name than Triangle!

Image

Image
Ryan Pridgeon
C, C++, C#, Java, ActionScript 3, HaXe, PHP, VB.Net, Pascal
Music | Blog
User avatar
RyanPridgeon
Chaos Rift Maniac
Chaos Rift Maniac
 
Posts: 451
Joined: Sun Sep 21, 2008 2:34 pm
Location: UK

Re: "Triangle" - Ludum Dare Project Flash Rewrite

Postby dandymcgee on Mon Apr 14, 2014 10:28 am

ph0sph0ruz wrote:That first video looks like you are playing far away, an optical illusion with the lighting. :D

Haha, you're right. The shadows make the black squares look like really tall pillars. It's actually kind of awesome.
Falco Girgis wrote:It is imperative that I can broadcast my narcissistic commit strings to the Twitter! Tweet Tweet, bitches! :twisted:
User avatar
dandymcgee
ES Beta Backer
ES Beta Backer
 
Posts: 4911
Joined: Tue Apr 29, 2008 4:24 pm
Location: New Hampshire

Re: "Triangle" - Ludum Dare Project Flash Rewrite

Postby RyanPridgeon on Mon Apr 14, 2014 3:11 pm

dandymcgee wrote:
ph0sph0ruz wrote:That first video looks like you are playing far away, an optical illusion with the lighting. :D

Haha, you're right. The shadows make the black squares look like really tall pillars. It's actually kind of awesome.


Haha, I noticed that before, too. Some people I've sent the game to actually thought it was intended to be like tall 3d walls. I guess what the shadow is essentially doing is a 1 point perspective drawing, after all :mrgreen:

Image

Surprising how long it takes to do some things. Spent over 2 hours implementing this control settings menu.
Ryan Pridgeon
C, C++, C#, Java, ActionScript 3, HaXe, PHP, VB.Net, Pascal
Music | Blog
User avatar
RyanPridgeon
Chaos Rift Maniac
Chaos Rift Maniac
 
Posts: 451
Joined: Sun Sep 21, 2008 2:34 pm
Location: UK

Re: "Triangle" - Ludum Dare Project Flash Rewrite

Postby ph0sph0ruz on Tue Apr 15, 2014 8:08 pm

RyanPridgeon wrote:Haha, I noticed that before, too. Some people I've sent the game to actually thought it was intended to be like tall 3d walls. I guess what the shadow is essentially doing is a 1 point perspective drawing, after all :mrgreen:

Image

Surprising how long it takes to do some things. Spent over 2 hours implementing this control settings menu.


Yeah coding issues can sometimes be a black hole, just getting started sucks even more because it's not very sexy looking at just code. Everyone just wants to see the graphics and gameplay. It's not all fun and games but when it works out then the effort is rewarding.
User avatar
ph0sph0ruz
Chaos Rift Newbie
Chaos Rift Newbie
 
Posts: 39
Joined: Sat Mar 22, 2014 4:52 am

Re: "Triangle" - Ludum Dare Project Flash Rewrite

Postby RyanPridgeon on Wed Apr 16, 2014 5:05 pm

ph0sph0ruz wrote:Yeah coding issues can sometimes be a black hole, just getting started sucks even more because it's not very sexy looking at just code. Everyone just wants to see the graphics and gameplay. It's not all fun and games but when it works out then the effort is rewarding.


Very true, a lot of the time when showing this game I can't really display what I've been working on because a lot of it is in the engine / back end.

However, here's something I can show. Working on a little minimap kind of thing that uncovers parts of the map you've explored. Still gotta work on it quite a bit to make it look right.

Click here to see the hidden message (It might contain spoilers)
Image

Image


Edit: Minimap update!

Image
Last edited by RyanPridgeon on Wed Apr 16, 2014 8:20 pm, edited 1 time in total.
Ryan Pridgeon
C, C++, C#, Java, ActionScript 3, HaXe, PHP, VB.Net, Pascal
Music | Blog
User avatar
RyanPridgeon
Chaos Rift Maniac
Chaos Rift Maniac
 
Posts: 451
Joined: Sun Sep 21, 2008 2:34 pm
Location: UK

Re: "Triangle" - Ludum Dare Project Flash Rewrite

Postby dandymcgee on Wed Apr 16, 2014 8:12 pm

Amazing how fast this is progressing, looking awesome Ryan.

RyanPridgeon wrote:Very true, a lot of the time when showing this game I can't really display what I've been working on because a lot of it is in the engine / back end.

Keep in mind, this is a programming forum. Just because we like pictures doesn't mean we don't like code too. If you ever come up with a new way to solve a problem in code, and you're dying to share it with someone, feel free to post it here so we can all revel in your greatness. 8-)
Falco Girgis wrote:It is imperative that I can broadcast my narcissistic commit strings to the Twitter! Tweet Tweet, bitches! :twisted:
User avatar
dandymcgee
ES Beta Backer
ES Beta Backer
 
Posts: 4911
Joined: Tue Apr 29, 2008 4:24 pm
Location: New Hampshire

Re: "Triangle" - Ludum Dare Project Flash Rewrite

Postby YourNerdyJoe on Thu Apr 17, 2014 10:05 am

This looks like one of the few flash games I would actually be willing to pay for if it came to that.
See that?.....
Exactly
https://yournerdyjoe.github.io/
User avatar
YourNerdyJoe
Chaos Rift Cool Newbie
Chaos Rift Cool Newbie
 
Posts: 85
Joined: Sun Oct 02, 2011 4:28 pm

Re: "Triangle" - Ludum Dare Project Flash Rewrite

Postby RyanPridgeon on Fri Apr 18, 2014 5:08 pm

dandymcgee wrote:Amazing how fast this is progressing, looking awesome Ryan.

RyanPridgeon wrote:Very true, a lot of the time when showing this game I can't really display what I've been working on because a lot of it is in the engine / back end.

Keep in mind, this is a programming forum. Just because we like pictures doesn't mean we don't like code too. If you ever come up with a new way to solve a problem in code, and you're dying to share it with someone, feel free to post it here so we can all revel in your greatness. 8-)


Good point, and I doubt anyone will be revelling in greatness, but I've just updated the minimap to only draw walls that you can see, on the side that you see them. This will be cool since anything not explored will be completely hidden in the map with no bleed into the next room.

I basically did it by first iterating through the grid of collidable tiles in the map in a window around the player's position, and checking if they are in sight of the player by checking n points between that tile and the player's position and checking if there's another wall in the way. If a collidable tile is in sight, it's flagged as "uncovered" in the minimap.

Code: Select all
// calculate N points to check along line of sight
var iterations:int = Math.sqrt(Math.pow(c - playerC, 2) + Math.pow(r - playerR, 2)) * 1.5;

// the current iteration's point position, start at the current checked tile
var ix:Number = c;
var iy:Number = r;

// start at the right or bottom of the tile if the player is on that side
if (playerC > c) ix += 1;
if (playerR > r) iy += 1;

// Calculate the step vector to iterate with
var stepX:Number = (pos.x / 32 - ix) / iterations;
var stepY:Number = (pos.y / 32 - iy) / iterations;

// if set to true, there was a collision
var collide:Boolean = false;

// Start away from the wall
ix += stepX;
iy += stepY;

// While haven't reached the player tile yet
while (!(Math.floor(ix) == playerC && Math.floor(iy) == playerR))
{
   // If this isn't the start tile, and there's a wall in the way
   if (!(Math.floor(ix) == c && Math.floor(iy) == r) && _map.getCol(ix, iy) == 1)
   {
      // Collision in line of sight
      collide = true;
      break;
   }
   
   // Move the current point to the next point along the line of sight
   ix += stepX;
   iy += stepY;
}
if (collide == false)
{
   // If no collisions, this tile has been uncovered
   setUncovered(c, r);
}



Then I iterate over them again, and for each uncovered tile, it draws the appropriate walls coming out of it onto the graphic, in a + shape. So if theres an uncovered tile with another uncovered tile above and another uncovered tile to the right, it draws a └ onto the tile's position in the map, and then flags the "UP" and "RIGHT" components as being drawn. This is cool because it means I can draw nice thin lines for the walls instead of big tile blocks, and if there's a wall stemming out on the other side of a wall from the player, it doesn't draw that line until you reach the other side.

Code: Select all
for (c = topleftC; c < topleftC + WINDOW_SIZE; c++)
{
   for (r = topleftR; r < topleftR + WINDOW_SIZE; r++)
   {
      if (isUncovered(c, r))
      {
         // left
         if ((getDrawn(c, r) & 1) == 0 && isUncovered(c - 1, r))
         {
            addDrawn(c, r, 1);
            _lines.graphics.moveTo(c * UNIT_SIZE, r * UNIT_SIZE);
            _lines.graphics.lineTo(c * UNIT_SIZE - HALF_UNIT_SIZE, r * UNIT_SIZE);
         }
         // right
         if ((getDrawn(c, r) & 2) == 0 && isUncovered(c + 1, r))
         {
            addDrawn(c, r, 2);
            _lines.graphics.moveTo(c * UNIT_SIZE, r * UNIT_SIZE);
            _lines.graphics.lineTo(c * UNIT_SIZE + HALF_UNIT_SIZE, r * UNIT_SIZE);
         }
         // up
         if ((getDrawn(c, r) & 4) == 0 && isUncovered(c, r - 1))
         {
            addDrawn(c, r, 4);
            _lines.graphics.moveTo(c * UNIT_SIZE, r * UNIT_SIZE);
            _lines.graphics.lineTo(c * UNIT_SIZE, r * UNIT_SIZE - HALF_UNIT_SIZE);
         }
         // down
         if ((getDrawn(c, r) & 8) == 0 && isUncovered(c, r + 1))
         {
            addDrawn(c, r, 8);
            _lines.graphics.moveTo(c * UNIT_SIZE, r * UNIT_SIZE);
            _lines.graphics.lineTo(c * UNIT_SIZE, r * UNIT_SIZE + HALF_UNIT_SIZE);
         }
      }
   }
}


Dunno if that's the best way to do it, but it runs lightning fast and seems to work perfectly :) If anyone can suggest any improvements, please do!

Image

YourNerdyJoe wrote:This looks like one of the few flash games I would actually be willing to pay for if it came to that.


Wow, thanks! That means a lot. Luckily for your wallet it'll be released as free to play :)
Ryan Pridgeon
C, C++, C#, Java, ActionScript 3, HaXe, PHP, VB.Net, Pascal
Music | Blog
User avatar
RyanPridgeon
Chaos Rift Maniac
Chaos Rift Maniac
 
Posts: 451
Joined: Sun Sep 21, 2008 2:34 pm
Location: UK

PreviousNext

Return to Game Development

Who is online

Users browsing this forum: No registered users and 1 guest