Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

 
Advanced search

1315227 Posts in 58963 Topics- by 50082 Members - Latest Member: EthanWilliam

September 25, 2017, 03:42:29 am

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsCommunityDevLogsTriangle - Flash Adventure Game
Pages: [1]
Print
Author Topic: Triangle - Flash Adventure Game  (Read 2007 times)
RyanPridgeon
Level 0
**



View Profile WWW Email
« on: March 13, 2014, 07:22:57 am »

================Latest Footage March 21 2014==================================



=========================================
Original Post March 13 2014:

This is a little Flash / Actionscript 3 project I've been working on the last few days that I thought I'd make a dev log for.

It's basically a top down adventure sort of game made with AS3 in Flash. I'm using nape for the physics (awesome 2d physics engine), and doing it all myself.

Here's a small preview of the game so far. I'm trying to implement a sort of "field of view" shadow where you can't see around walls that are blocking your view, by drawing a big black shadow over parts the player can't see.

In this GIF I just basically cast rays out around the player and use those to draw the shadow, but it's not ideal.



It's too jittery and crappy, and slow, using this ray cast method. So now I'm working on the new algorithm for drawing the field of view. My approach is using a method where I auto generate a list of the "connections"/"corners" between the walls in the map, and use those corners to draw the fog/shadow.

So far I've got it generating the corners correctly and putting them in order of orientation from the player, so I can start to draw the shadow out of them. Each corner knows whether it's connected upward, downward, left or right, and calculates its orientation from the player, which should be enough information for me to loop round them in a clockwise motion and draw a big black shape for the shadow.

Here's a quick preview where I'm just drawing the shape between EVERY corner in order of orientation. It's a start.



 Smiley

Edit:

Starting to get somewhere with this. Still a lot of bugs in it in certain cases!

« Last Edit: March 20, 2014, 06:02:19 pm by RyanPridgeon » Logged

Triangle - My solo project, a top down adventure!<br /><br />Reinventing the wheel is fun, dammit.
RyanPridgeon
Level 0
**



View Profile WWW Email
« Reply #1 on: March 13, 2014, 01:12:10 pm »

I finally got the shadow / field of view rendering correctly!



Basically I generate a list of wall edges when the map is loaded, and the shadows of each edge are drawn onto a black shape every frame.
Logged

Triangle - My solo project, a top down adventure!<br /><br />Reinventing the wheel is fun, dammit.
RyanPridgeon
Level 0
**



View Profile WWW Email
« Reply #2 on: March 13, 2014, 04:35:54 pm »

Got the field of view working beautifully now and some basic camera movement around a large map. Progress!

Logged

Triangle - My solo project, a top down adventure!<br /><br />Reinventing the wheel is fun, dammit.
SolarLune
Level 10
*****


Hmm.


View Profile WWW Email
« Reply #3 on: March 13, 2014, 08:23:21 pm »

Hey, this looks pretty cool. I like the "shadow projection" effect you've got going. How's the controls? Arrow keys to move and face a direction, and another button to shoot?
Logged

mirrorfish
Level 1
*


?!?! ... It's just a box.


View Profile WWW Email
« Reply #4 on: March 13, 2014, 08:37:48 pm »

hey I actually think how weird the shadows look and move is a feature not a bug. Just saying.
Logged

RyanPridgeon
Level 0
**



View Profile WWW Email
« Reply #5 on: March 14, 2014, 06:04:14 am »

hey I actually think how weird the shadows look and move is a feature not a bug. Just saying.

Oh well, I made a new method now which I prefer. Check the latest GIF!

Hey, this looks pretty cool. I like the "shadow projection" effect you've got going. How's the controls? Arrow keys to move and face a direction, and another button to shoot?

The controls are nice and old skool, directional movement and a fire button. Default is WASD or arrow keys with shift or space to fire, but it'll be reconfigurable. Thanks  Grin

« Last Edit: March 14, 2014, 10:17:04 am by RyanPridgeon » Logged

Triangle - My solo project, a top down adventure!<br /><br />Reinventing the wheel is fun, dammit.
RyanPridgeon
Level 0
**



View Profile WWW Email
« Reply #6 on: March 16, 2014, 10:57:58 am »

I started working on the menus and had to write a ton of back end to set this up with a nice clean design. I also rewrote / added to the way I'm storing and reading the level/game state, to keep the state of the game world persistant as the player moves back and forth between different maps (as this will eventually be an adventure game).

I tried to replicate the DOOM transition effect as well, it's not perfect yet.



Next up is a level editor so I can actually start making some impressive levels, and adding entities more easily.

I'm reading the levels from XML, simply because Flash has built in methods for dealing with it, and it'll help me out by being nice and readable.

The entities you see there currently were just added through my sketchy method of printing the XML representation of an enemy at the player's current position into the debug output when I hit a certain key, and then adding those prints into the XML file myself. It worked nicely, but I think it's time to step it up. Now that I've got nice systems in place for managing the different screens and top level design of the game, it should be smooth sailing.

I also added some frameskipping code, so that if the graphics updating starts to lag, the game simulation should carry on at the correct pace. As well as a bunch of back end optimisations to try and make it run smoother.

 Smiley
Logged

Triangle - My solo project, a top down adventure!<br /><br />Reinventing the wheel is fun, dammit.
RyanPridgeon
Level 0
**



View Profile WWW Email
« Reply #7 on: March 19, 2014, 02:09:40 pm »

So I think I'm getting somewhere with the level editor for the game now. I realised that I'd need to put something pretty good together to be able to easily add complex levels to the game so thought I might as well make it a feature of the game.



Starting a level and placing some tiles



Adding some objects and testing the level

The editor allows you to edit the tiles on both of the tile layers, as well as add objects. For each object, you can edit it in XML form. The actual states of the levels and level objects in the game is represented in class structures, but I've also added functionality for converting between XML and ByteArray as well. XML to allow readability (and stuff like being able to edit the objects in the editor using it)and ByteArray will come in handy for saving persistent data, or Base64 encoding it for people to send/load their own levels (this is what the save and load buttons do).

On a less exciting note I made myself a decent sound management engine, which should allow me to play shit tons of sounds without it cutting out important looping sounds, or say, background music in Flash's mixer.

I've also had to put a lot of work into the menu system to allow all of this to function smoothly. It's always surprising how long this stuff takes to me. Hopefully I can get back to the actual gameplay and content soon, and make it more exciting!
Logged

Triangle - My solo project, a top down adventure!<br /><br />Reinventing the wheel is fun, dammit.
oodavid
Level 8
***


Discombobulate!


View Profile WWW Email
« Reply #8 on: March 19, 2014, 03:10:24 pm »

Instantly makes me think of the excellent short story "Flatland: A Romance of many Dimensions", written by a physicist to explain how a hyper dimensional universe might look, he does so by telling a 2d story and moving into 3d, it's impressive how effective it is.

On a gaming viewpoint, this looks excellent! I'll be a playtester.
Logged


Button up! - Out on Android and iOS

latest release: 13th March 2015
RyanPridgeon
Level 0
**



View Profile WWW Email
« Reply #9 on: March 20, 2014, 05:54:22 pm »

Instantly makes me think of the excellent short story "Flatland: A Romance of many Dimensions", written by a physicist to explain how a hyper dimensional universe might look, he does so by telling a 2d story and moving into 3d, it's impressive how effective it is.

On a gaming viewpoint, this looks excellent! I'll be a playtester.

Thanks! I've not read the book. I guess the geometric 2d look does it? Tongue

I've put together a video to show off the level editor a bit;

Logged

Triangle - My solo project, a top down adventure!<br /><br />Reinventing the wheel is fun, dammit.
Buddy_DoQ
Level 0
**



View Profile WWW
« Reply #10 on: March 20, 2014, 08:53:56 pm »

Hey, I remember this from r/gamedev last Saturday! I'm a sucker for anything that has a built-in level editor, so...

following intensifies. Epileptic
Logged

oodavid
Level 8
***


Discombobulate!


View Profile WWW Email
« Reply #11 on: March 22, 2014, 05:37:10 am »

snip

Thanks! I've not read the book. I guess the geometric 2d look does it? Tongue

It's much more than that:

1 - The narrator of the story is simply "a square".
2 - A major theme of the story is vision, the way you have darkness projecting out is an apt way to describe it.
3 - There is a hierarchy of people in the world, circles being "perfect", other regular shapes (triangles, squares etc.) are lower classes and irregular polygons are considered abhorrent.

If you've not yet found a story for your game, this wouldn't be a bad starting point, the book has a massive cult status.

Should you decide to watch an adaptation, pick the rather good short film and definitely not the feature length one
Logged


Button up! - Out on Android and iOS

latest release: 13th March 2015
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic