Be a Supporter!

The Flash 'Reg' Lounge

  • 1,585,825 Views
  • 64,295 Replies
New Topic Respond to this Topic
MSGhero
MSGhero
  • Member since: Dec. 15, 2010
  • Offline.
Forum Stats
Supporter
Level 16
Game Developer
Response to The Flash 'Reg' Lounge Oct. 14th, 2011 @ 12:05 PM Reply

What makes N2D2 better than Starling? I checked out Star but then got a crapton of schoolwork, so I haven't looked into N2 yet or even experimented with Star.

Fall break hooray!!!

PSvils
PSvils
  • Member since: Feb. 3, 2010
  • Offline.
Forum Stats
Member
Level 01
Game Developer
Response to The Flash 'Reg' Lounge Oct. 14th, 2011 @ 12:05 PM Reply

At 10/14/11 11:51 AM, TomFulp wrote:
At 10/14/11 11:44 AM, PrettyMuchBryce wrote: What is everybody working on? I am working on an easy pathfinding API. I am tired of using other peoples code for such a common problem. I am also playing with ND2D, which I find better than starling so far.
I started learning Flixel this week with the hope that it will adapt well to hardware acceleration. I started looking at ND2D as well, are there any good tutorials for people who really need a hand-holding through getting started?

I don't think that ND2D has any tutorials so far, it's really really young. But yeah, I want to start using ND2D soon as well, though I've been checking out AGAL tutorials and cooking up my own engine from scratch is also in mind, especially since there are a few sfx I want to get in dere...

As to what I'm working on, one more job for my client I need to kill off, and then I'll be free to keep going on my zombie/horror/adventure game. I'm starting it over again, this time with NAPE, and hopefully using Molehill for the rendering plus effects, which play a large part in the atmosphere. (Mainly for 2D lighting, though my current version runs pretty well, with 15 fps on 600x600 screen on my netbook...that's saying a lot :D)

P.

PrettyMuchBryce
PrettyMuchBryce
  • Member since: Mar. 17, 2001
  • Offline.
Forum Stats
Member
Level 06
Blank Slate
Response to The Flash 'Reg' Lounge Oct. 14th, 2011 @ 12:26 PM Reply

At 10/14/11 11:51 AM, TomFulp wrote:
At 10/14/11 11:44 AM, PrettyMuchBryce wrote: What is everybody working on? I am working on an easy pathfinding API. I am tired of using other peoples code for such a common problem. I am also playing with ND2D, which I find better than starling so far.
I started learning Flixel this week with the hope that it will adapt well to hardware acceleration. I started looking at ND2D as well, are there any good tutorials for people who really need a hand-holding through getting started?

I'm not sure if there is yet since it's so new. It's pretty similar to Starling in the way you start it up. Maybe I could write a basic "Getting Started" tutorial over the weekend.

I'm not sure if Flixel will transition well to hardware acceleration since its still being rendered with software (BitmapData.copyPixels). I am sure there will be new engines that take advantage of the GPU stuff sooner or later though. Starling and ND2D are not really like Flixel. Flixel is unique because it geared 100% for making games. So it includes graphics, sound, physics, state machine, etc. Starling and ND2D are just for graphics, so you have to write the rest of the game logic yourself. Learn Flixel anyways though! The concepts will carry over.

As far as the difference between Starling and ND2D. I have no statistics to back this up, but I find that ND2D is just faster. It has a nice support for animating your sprite sheets similary to the way Flixel does it. Starling has no documentation other than a massive messy PDF file. I worry that Starling is trying so hard to imitate the traditional display list that it is making concessions with performance. One downside to ND2D however, it has bad support for smoothing. For example, if you're looking to make a pixelly game, you might want to go with Starling for now. If you resize a texture in ND2D then it will automatically smooth it and there is no way to turn this off. The work around I found is to resize your sprites with bitmapData.draw before you make it into a Texture2D in ND2D. Lars says that he is working on fixing this, though. In Starling there are a number of resize modes you can choose from which is pretty nice. ND2D also has a brutally awesome virtual camera. Honestly though it probably doesn't matter too much which one you use. They will probably both change a lot over the coming months.


BBS Signature
citricsquid
citricsquid
  • Member since: Jun. 25, 2005
  • Offline.
Forum Stats
Member
Level 23
Blank Slate
Response to The Flash 'Reg' Lounge Oct. 14th, 2011 @ 05:20 PM Reply

even if you hate dubstep (fuck you) this animation is sweet:

http://www.youtube.com/watch?v=DbCYsEMg0 9o

Starogre
Starogre
  • Member since: May. 8, 2004
  • Offline.
Forum Stats
Member
Level 18
Artist
Response to The Flash 'Reg' Lounge Oct. 14th, 2011 @ 05:40 PM Reply

At 10/14/11 05:20 PM, citricsquid wrote: even if you hate dubstep (fuck you) this animation is sweet:

http://www.youtube.com/watch?v=DbCYsEMg0 9o

whoahwhwh wtf they are doing flash animations for their sponsored songs now sweet! i've had a couple ideas for a few different tracks in my head. can't wait to see more


the events are merely fictional, written, directed, and acted out by all who create them

BBS Signature
Sandremss128
Sandremss128
  • Member since: Aug. 22, 2009
  • Offline.
Forum Stats
Supporter
Level 11
Programmer
Response to The Flash 'Reg' Lounge Oct. 14th, 2011 @ 05:42 PM Reply

At 10/14/11 05:20 PM, citricsquid wrote: even if you hate dubstep (fuck you) this animation is sweet:

http://www.youtube.com/watch?v=DbCYsEMg0 9o

this one is sweet as well:
http://www.youtube.com/watch?v=2cXDgFwE1 3g&feature=player_embedded

Sam
Sam
  • Member since: Oct. 1, 2005
  • Online!
Forum Stats
Moderator
Level 19
Programmer
Response to The Flash 'Reg' Lounge Oct. 14th, 2011 @ 05:53 PM Reply

At 10/14/11 05:20 PM, citricsquid wrote: even if you hate dubstep (fuck you) this animation is sweet:

http://www.youtube.com/watch?v=DbCYsEMg0 9o

There was a cat playing bongos...

Starogre
Starogre
  • Member since: May. 8, 2004
  • Offline.
Forum Stats
Member
Level 18
Artist
Response to The Flash 'Reg' Lounge Oct. 14th, 2011 @ 07:59 PM Reply

At 10/14/11 05:42 PM, Sandremss128 wrote:
At 10/14/11 05:20 PM, citricsquid wrote: even if you hate dubstep (fuck you) this animation is sweet:

http://www.youtube.com/watch?v=DbCYsEMg0 9o
this one is sweet as well:
http://www.youtube.com/watch?v=2cXDgFwE1 3g&feature=player_embedded

that's.....not an animation


the events are merely fictional, written, directed, and acted out by all who create them

BBS Signature
chipotleaway
chipotleaway
  • Member since: Jan. 30, 2010
  • Offline.
Forum Stats
Member
Level 14
Musician
Response to The Flash 'Reg' Lounge Oct. 14th, 2011 @ 10:00 PM Reply

I want to learn flash. How do I learn?


I am a vagina cleaner. My Steam
In world god make every thing. Therefore God can't deid. -calvinmark

BBS Signature
PSvils
PSvils
  • Member since: Feb. 3, 2010
  • Offline.
Forum Stats
Member
Level 01
Game Developer
Response to The Flash 'Reg' Lounge Oct. 15th, 2011 @ 05:00 AM Reply

At 10/14/11 10:00 PM, chipotleaway wrote: I want to learn flash. How do I learn?

http://milchreis.newgrounds.com/news/pos t/576285

PrettyMuchBryce
PrettyMuchBryce
  • Member since: Mar. 17, 2001
  • Offline.
Forum Stats
Member
Level 06
Blank Slate
Response to The Flash 'Reg' Lounge Oct. 15th, 2011 @ 09:52 PM Reply

I finished this: https://github.com/prettymuchbryce/EasyS tarAS3

Any suggestions or questions are welcome :)


BBS Signature
MSGhero
MSGhero
  • Member since: Dec. 15, 2010
  • Offline.
Forum Stats
Supporter
Level 16
Game Developer
Response to The Flash 'Reg' Lounge Oct. 16th, 2011 @ 12:07 AM Reply

At 10/15/11 09:52 PM, PrettyMuchBryce wrote: I finished this: https://github.com/prettymuchbryce/EasyS tarAS3

Any suggestions or questions are welcome :)

*Wow, dyslexia on ND2D...*

Since you're using a grid, you don't REALLY need the whole node thing. I wrote a grid-based A* and converted it to draggable node-based later on. Your code is similar to my draggable node one. Since each tile is a tile's width from the next in either direction, it would be better to avoid Point() and try a more grid-based approach like (I haven't seen the grid code in a while, might not be 100% correct)

//it would also be better to switch the vector to booleans, I feel; here true = no obstacle
for(i=-1;i<2;i++){
   for(j=-1;j<2;j++){
      if(i==0&&j==0) continue;  //avoids checking self
      if(i!==0||j!==0) continue;  //this line restricts it to 4 directions, omit for diags
      try(gridVec[currentI+i][currentJ+j]){ //code that adds it to the potential node checking thing}
         catch(e:Error){}
      /*and so on...I guess currentI and J could be like int(currentTile.x/tileWidth) or something*/
    }
}

And if you do allow diagonals, you would have to change your heuristic to x^2+y^2 rather than x+y

PrettyMuchBryce
PrettyMuchBryce
  • Member since: Mar. 17, 2001
  • Offline.
Forum Stats
Member
Level 06
Blank Slate
Response to The Flash 'Reg' Lounge Oct. 16th, 2011 @ 03:12 PM Reply

The grid just stores the collision data. 0 means you can walk on it and 1 means you cant. As far as the Node class, I think it's the best approach since I need to store values associates with each node (G, H, and coordinate), right? :)


BBS Signature
MSGhero
MSGhero
  • Member since: Dec. 15, 2010
  • Offline.
Forum Stats
Supporter
Level 16
Game Developer
Response to The Flash 'Reg' Lounge Oct. 16th, 2011 @ 04:29 PM Reply

At 10/16/11 03:12 PM, PrettyMuchBryce wrote: The grid just stores the collision data. 0 means you can walk on it and 1 means you cant. As far as the Node class, I think it's the best approach since I need to store values associates with each node (G, H, and coordinate), right? :)

If it's only gonna have 0 and 1 as a value, might as well switch to booleans to speed it up a bit. The generic node class is fine (I use that), I meant using Point() in the algorithm when it can be shortened and optimized by using its .x and .y to find its location within the Vector (vec[i][j]). I'm not fond of Point(), and you will get better performance avoiding it. My grid one clocked the algorithm alone at 5-8ms on a 20x20 grid with a normal path, 25 with a complex one, and 53 for no solution.
I'm kinda happy your code looks just like mine...I guess we're both doing something right :)

PrettyMuchBryce
PrettyMuchBryce
  • Member since: Mar. 17, 2001
  • Offline.
Forum Stats
Member
Level 06
Blank Slate
Response to The Flash 'Reg' Lounge Oct. 16th, 2011 @ 05:55 PM Reply

At 10/16/11 04:29 PM, MSGhero wrote: I'm not fond of Point(), and you will get better performance avoiding it.

Okay you are right about that. I changed it. Thanks.


BBS Signature
PrettyMuchBryce
PrettyMuchBryce
  • Member since: Mar. 17, 2001
  • Offline.
Forum Stats
Member
Level 06
Blank Slate
Response to The Flash 'Reg' Lounge Oct. 19th, 2011 @ 03:00 PM Reply

Speaking of Flixel I stumbled across this cool article today about getting started with Flixel Development: http://www.photonstorm.com/archives/2247 /flash-game-dev-tip-12-building-a-retro-
platform-game-in-flixel-part-1

Anyone have experience with Flixel? What did you think? I'd be interested to know. I have used it and I learned a lot from it. If you're interested in fast development and don't care too much about fine-tuning stuff then I think Flixel is a good solution. If you spend enough time with it to go deep into the flixel classes you will learn a lot about how flash works and how to make a flash game perform well.


BBS Signature
MSGhero
MSGhero
  • Member since: Dec. 15, 2010
  • Offline.
Forum Stats
Supporter
Level 16
Game Developer
Response to The Flash 'Reg' Lounge Oct. 19th, 2011 @ 10:14 PM Reply

And here's my A* prototype that I've been working on (with a little help by PSvils). Running my A* algorithm through an irregular city each frame at a cool 30 fps. It's also my first project that I'm using external classes and a timer-based enterframe :). The blue dot isn't moving on a set path or anything, so it might overlap the obstacles at some point.

2 things: why does the mem usage go up dramatically and ms per frame freak out testing in browser than in Flash Pro? And if the blue dot could move along paths and stuff, how could I tell the other nodes that it's visible for them (quadtree, etc)? It can't be visible all the time, cuz then it would just draw a straight line through obstacles.

fixplz
fixplz
  • Member since: Jul. 29, 2011
  • Offline.
Forum Stats
Member
Level 01
Blank Slate
Response to The Flash 'Reg' Lounge Oct. 20th, 2011 @ 02:27 AM Reply

The memory shows the total memory used by Flash in the browser.

There are much simpler ways to do pathfinding in that sort of setting. I've talked about it many times. I might put up simple a demo on Github.

What is your other question?

Sandremss128
Sandremss128
  • Member since: Aug. 22, 2009
  • Offline.
Forum Stats
Supporter
Level 11
Programmer
Response to The Flash 'Reg' Lounge Oct. 20th, 2011 @ 04:59 AM Reply

At 10/19/11 10:14 PM, MSGhero wrote: And here's my A* prototype that I've been working on

I got a question. At some point you have the line go from the main node to eventually node A. From this node A it goes to the moving circle. But in some positions, the path still goes to node A but in a different way. Why is this since these nodes dont change position and the shortest path should be fixed for them.

The Flash 'Reg' Lounge

MSGhero
MSGhero
  • Member since: Dec. 15, 2010
  • Offline.
Forum Stats
Supporter
Level 16
Game Developer
Response to The Flash 'Reg' Lounge Oct. 20th, 2011 @ 11:06 AM Reply

At 10/20/11 04:59 AM, Sandremss128 wrote: I got a question.

Thanks, the x and y positions were ints in my grid-based version, and I forgot to switch them over to num. Works fine now, I guess it was rounding or something weird.

My other question was there, you might have missed it. About walking down a path and quadtree visible nodes and stuff. How else do you suggest pathfinding? To be honest, it will only need to be run maybe once every few frames to few seconds, depending on the eventual map size; so it's not THAT big of a deal. Check where it can go, check how far it's been and will have been, see if that's smaller than another's.
If you're talking about the red dots or the lines, those are just visuals for me; it stores the dots' positions at the start; they aren't referenced or anything later.

Sandremss128
Sandremss128
  • Member since: Aug. 22, 2009
  • Offline.
Forum Stats
Supporter
Level 11
Programmer
Response to The Flash 'Reg' Lounge Oct. 20th, 2011 @ 11:22 AM Reply

If the positions of the nodes (dots) dont change you might even consider making a table for it upon initialization. That means the CPU is a little more busy loading your level / game but when you play it it executes faster. And I dont quite get your question, you just do the A* (A star) algorithm and then you've got your fastest route? (btw A* is invented by Dijkstra, a Dutch person :D)

fixplz
fixplz
  • Member since: Jul. 29, 2011
  • Offline.
Forum Stats
Member
Level 01
Blank Slate
Response to The Flash 'Reg' Lounge Oct. 20th, 2011 @ 11:29 AM Reply

I mean rephrase it. Visible from them?

http://www.newgrounds.com/dump/item/05ca 72840c163be12766c70fc92c3263

fixplz
fixplz
  • Member since: Jul. 29, 2011
  • Offline.
Forum Stats
Member
Level 01
Blank Slate
Response to The Flash 'Reg' Lounge Oct. 20th, 2011 @ 11:33 AM Reply

A* is not the same as Dijkstra's algorithm. A* extends the latter with cost heuristics, which allows depth-first searching.

The more you know.

Sandremss128
Sandremss128
  • Member since: Aug. 22, 2009
  • Offline.
Forum Stats
Supporter
Level 11
Programmer
Response to The Flash 'Reg' Lounge Oct. 20th, 2011 @ 11:50 AM Reply

I know but what I mean is that the foundation of pathfinding comes from this guy.

fixplz
fixplz
  • Member since: Jul. 29, 2011
  • Offline.
Forum Stats
Member
Level 01
Blank Slate
Response to The Flash 'Reg' Lounge Oct. 20th, 2011 @ 12:34 PM Reply

Um, he established all of computer science. If you want to feel proud about something.
But he defined a special case of a toy algorithm too.

Toast
Toast
  • Member since: Apr. 2, 2005
  • Offline.
Forum Stats
Member
Level 09
Blank Slate
Response to The Flash 'Reg' Lounge Oct. 20th, 2011 @ 12:56 PM Reply

really fun discussion to read, thanks for making the reg lounge an interesting place for these last couple of days

i've been away from computer science way too long, forgot how fun it is


BBS Signature
PSvils
PSvils
  • Member since: Feb. 3, 2010
  • Offline.
Forum Stats
Member
Level 01
Game Developer
Response to The Flash 'Reg' Lounge Oct. 20th, 2011 @ 01:30 PM Reply

At 10/20/11 04:59 AM, Sandremss128 wrote: But in some positions, the path still goes to node A but in a different way. Why is this since these nodes dont change position and the shortest path should be fixed for them.

This is because the algorithm takes into account the total distance from the node of origin. Because of this, if two nodes are very close to each other, it will usually go through these 2 nodes, even though a node that might initially be further away results in a shorter path...

I can draw this up, since it's probable you didn't understand what I said :D (What can I say after just getting home from school/friend's birthday)

P.

MSGhero
MSGhero
  • Member since: Dec. 15, 2010
  • Offline.
Forum Stats
Supporter
Level 16
Game Developer
Response to The Flash 'Reg' Lounge Oct. 20th, 2011 @ 02:27 PM Reply

Yay, I started an argument on a forum!

NG.cred++

@P: It was funkily going a longer alternate route to the same node because of int or whatever. Through the node to the right then to the middle one is shorter than to the left then middle, but it would show the left path as shorter occasionally. It's fixed now.

@fix: I looked into collab diff, but (maybe) I'll add something like a personality to the chasers. Like an old lady mishears your location and wanders off in a different direction instead of heading toward you. Or people hear a rumor of where you're at and head there, while you run somewhere else.
And as far as visible: I have it set so that one node can only check the nodes that it can "see." Like the green one can only "see" the one to its left and right and, therefore, only checks those two.

@Sand: Read the last two lines of ^^^. I can't have every node be able to "see" the blue dot all the time.

PSvils
PSvils
  • Member since: Feb. 3, 2010
  • Offline.
Forum Stats
Member
Level 01
Game Developer
Response to The Flash 'Reg' Lounge Oct. 20th, 2011 @ 03:48 PM Reply

At 10/20/11 02:27 PM, MSGhero wrote: Yay, I started an argument on a forum!

Not argument, discussion ;)

MSGhero
MSGhero
  • Member since: Dec. 15, 2010
  • Offline.
Forum Stats
Supporter
Level 16
Game Developer
Response to The Flash 'Reg' Lounge Oct. 20th, 2011 @ 05:57 PM Reply

At 10/20/11 03:48 PM, PSvils wrote: Not argument, discussion ;)

I feel like some people were discussing, and others were arguing.

Has anyone found an ND2D tutorial yet? Since I SUCK at perspective drawing, my poor A* will have to wait until I figure out 2.5D perspective. I'm thinking 2D platformer so I can learn NAPE.