Be a Supporter!

The Flash 'Reg' Lounge

  • 1,606,518 Views
  • 64,408 Replies
New Topic Respond to this Topic
Rustygames
Rustygames
  • Member since: May. 7, 2005
  • Offline.
Forum Stats
Member
Level 19
Programmer
Response to The Flash 'Reg' Lounge 2013-03-03 16:58:23 Reply

At 3/3/13 04:36 PM, Glaiel-Gamer wrote:
At 3/3/13 07:16 AM, Rustygames wrote: I will illustrate all of this in a crudely drawn diagram drawn in MSPaint :)

http://www.newgrounds.com/dump/item/fe9ee81a2b058e73af16d812 a7aa8a89
I don't exactly see the problem here, try not thinking of the pathfinding visually like that and just think of it as a bunch of nodes connected together. If you need a heuristic just like, x distance + y distance + level distance*10. Play around with it, if its very unlikely that a path goes between levels then just consider transferring levels as a lot more expensive.

It's one tactic, but that will encourage the path to get off the level as soon as possible which, as in the example with some "blocked" second level paths (where a set of stairs leads to a part of the right level which cannot reach the goal) could slow things down a lot. Depending on the size of the map and the level design this could be fine of course.


- Matt, Rustyarcade.com

Glaiel-Gamer
Glaiel-Gamer
  • Member since: Dec. 28, 2004
  • Offline.
Forum Stats
Member
Level 28
Game Developer
Response to The Flash 'Reg' Lounge 2013-03-03 18:03:03 Reply

At 3/3/13 04:58 PM, Rustygames wrote: It's one tactic, but that will encourage the path to get off the level as soon as possible which, as in the example with some "blocked" second level paths (where a set of stairs leads to a part of the right level which cannot reach the goal) could slow things down a lot. Depending on the size of the map and the level design this could be fine of course.

I really don't think you'll run into any speed issues with this unless your map is like, 100 levels of 1000x1000. Is your goal static or does it move around a lot / does the map change a lot?

Also, increasing the cost of moving up stairs means it will check the stairs later, not earlier

Rustygames
Rustygames
  • Member since: May. 7, 2005
  • Offline.
Forum Stats
Member
Level 19
Programmer
Response to The Flash 'Reg' Lounge 2013-03-03 18:39:47 Reply

At 3/3/13 06:03 PM, Glaiel-Gamer wrote:
At 3/3/13 04:58 PM, Rustygames wrote: It's one tactic, but that will encourage the path to get off the level as soon as possible which, as in the example with some "blocked" second level paths (where a set of stairs leads to a part of the right level which cannot reach the goal) could slow things down a lot. Depending on the size of the map and the level design this could be fine of course.
I really don't think you'll run into any speed issues with this unless your map is like, 100 levels of 1000x1000. Is your goal static or does it move around a lot / does the map change a lot?

Also, increasing the cost of moving up stairs means it will check the stairs later, not earlier

You said have a high cost for being on a different level. That would mean it goes up stairs earlier.

I don't know if you've used grid based path finding much in the past, but if you're using it every time the player clicks, and you're on say, a 25x25 grid (x2 levels), with minimum walls, the calculation times start to add up. Of course it will always find the path, I'm just pondering the quickest way to do that. Maybe I'm worrying too much


- Matt, Rustyarcade.com

Glaiel-Gamer
Glaiel-Gamer
  • Member since: Dec. 28, 2004
  • Offline.
Forum Stats
Member
Level 28
Game Developer
Response to The Flash 'Reg' Lounge 2013-03-03 19:51:05 Reply

At 3/3/13 06:39 PM, Rustygames wrote: You said have a high cost for being on a different level. That would mean it goes up stairs earlier.

That would be high priority, high cost is the opposite.

Glaiel-Gamer
Glaiel-Gamer
  • Member since: Dec. 28, 2004
  • Offline.
Forum Stats
Member
Level 28
Game Developer
Response to The Flash 'Reg' Lounge 2013-03-03 20:01:57 Reply

also if 25x25x2 is causing noticeable slowdown for you, you might want to go take a look at hour you're using your data structures, since I can usually brute-force a tilemap that small without much performance cost at all.

GeoKureli
GeoKureli
  • Member since: Apr. 1, 2003
  • Offline.
Forum Stats
Supporter
Level 19
Game Developer
Response to The Flash 'Reg' Lounge 2013-03-04 07:36:21 Reply

If everybody's posting their projects, I'll go ahead. I'm making a rhythm baseball game. I don't have any screen shots yet as I have only been working on it for 2 days. so here's the character sprites.

I actually think I can get a playable demo today.

the animations respectively are: run[1-8] duck[9,10] slide[11,12] jump[13] swing[14-18].

The Flash 'Reg' Lounge

flashMan
flashMan
  • Member since: Aug. 24, 2009
  • Offline.
Forum Stats
Member
Level 03
Blank Slate
Response to The Flash 'Reg' Lounge 2013-03-04 11:44:07 Reply

omg you work for newgrounds

Luis
Luis
  • Member since: Apr. 23, 2000
  • Offline.
Forum Stats
Member
Level 02
Melancholy
Response to The Flash 'Reg' Lounge 2013-03-04 11:48:11 Reply

At 3/4/13 11:39 AM, Luis wrote:
At 3/4/13 07:36 AM, ImpotentBoy2 wrote:
i like the color scheme and facial expressions. NEAT.

Havent been doing much Flash stuff lately. I've been wrapping my head around streamlining a mobile version of this website. here's an unrevealing landing page.

*edited Heres an actual Flash game I AM working on. It was supposed to be done a month ago! weee.

The Flash 'Reg' Lounge


None

GeoKureli
GeoKureli
  • Member since: Apr. 1, 2003
  • Offline.
Forum Stats
Supporter
Level 19
Game Developer
Response to The Flash 'Reg' Lounge 2013-03-04 12:31:41 Reply

At 3/4/13 11:48 AM, Luis wrote:
i like the color scheme and facial expressions. NEAT.

I didn't draw these, but yeah my artist draws amazing mouths.

*edited Heres an actual Flash game I AM working on. It was supposed to be done a month ago! weee.

talk about nice color schemes. looks interesting.

Luis
Luis
  • Member since: Apr. 23, 2000
  • Offline.
Forum Stats
Member
Level 02
Melancholy
Response to The Flash 'Reg' Lounge 2013-03-04 12:34:25 Reply

At 3/4/13 12:31 PM, ImpotentBoy2 wrote:
At 3/4/13 11:48 AM, Luis wrote:
i like the color scheme and facial expressions. NEAT.
I didn't draw these, but yeah my artist draws amazing mouths.

*edited Heres an actual Flash game I AM working on. It was supposed to be done a month ago! weee.
talk about nice color schemes. looks interesting.

who's your artist anyway. im nosy.


None

Rustygames
Rustygames
  • Member since: May. 7, 2005
  • Offline.
Forum Stats
Member
Level 19
Programmer
Response to The Flash 'Reg' Lounge 2013-03-04 12:54:45 Reply

At 3/4/13 11:48 AM, Luis wrote: *edited Heres an actual Flash game I AM working on. It was supposed to be done a month ago! weee.

That looks sick!


- Matt, Rustyarcade.com

Innermike
Innermike
  • Member since: Sep. 11, 2009
  • Offline.
Forum Stats
Member
Level 14
Audiophile
Response to The Flash 'Reg' Lounge 2013-03-04 15:02:57 Reply

Rusty's game looks pretty interesting in particular but really, everybody seems to be being productive and making cool things.

Jealousy.

Concerned Joe (not mine but still cool)

BBS Signature
GeoKureli
GeoKureli
  • Member since: Apr. 1, 2003
  • Offline.
Forum Stats
Supporter
Level 19
Game Developer
Response to The Flash 'Reg' Lounge 2013-03-04 15:57:02 Reply

At 3/4/13 12:34 PM, Luis wrote:
At 3/4/13 12:31 PM, ImpotentBoy2 wrote:
At 3/4/13 11:48 AM, Luis wrote:
i like the color scheme and facial expressions. NEAT.
I didn't draw these, but yeah my artist draws amazing mouths.

*edited Heres an actual Flash game I AM working on. It was supposed to be done a month ago! weee.
talk about nice color schemes. looks interesting.
who's your artist anyway. im nosy.

His name is Ian. Sorry, I don't generally give out friend's full names on the internet and junk unless I want them raped. Me and him worked as lead game developers at our last job
http://www.pilotside.us/2012/06/04/fp000/

GeoKureli
GeoKureli
  • Member since: Apr. 1, 2003
  • Offline.
Forum Stats
Supporter
Level 19
Game Developer
Response to The Flash 'Reg' Lounge 2013-03-04 16:05:39 Reply

At 3/4/13 03:57 PM, ImpotentBoy2 wrote: His name is Ian. Sorry, I don't generally give out friend's full names on the internet and junk unless I want them raped.

bleh, his full name is on the website, so i guess he's not super personal, Ian Merch

Wolfos
Wolfos
  • Member since: Jan. 19, 2008
  • Offline.
Forum Stats
Member
Level 25
Game Developer
Response to The Flash 'Reg' Lounge 2013-03-05 09:06:07 Reply

Anyone who'd like an RPG engine?
http://wolfos.org/resources/RPGWeb.swf

I'm working on a game and I'll open source the engine.

Wolfos
Wolfos
  • Member since: Jan. 19, 2008
  • Offline.
Forum Stats
Member
Level 25
Game Developer
Response to The Flash 'Reg' Lounge 2013-03-05 09:08:47 Reply

At 3/5/13 09:06 AM, Wolfos wrote: Anyone who'd like an RPG engine?
http://wolfos.org/resources/RPGWeb.swf

I'm working on a game and I'll open source the engine.

Tilesheet will be bigger of course and I'll be putting some scrollbars in there. The performance is pretty good even in extremely large levels.

Rustygames
Rustygames
  • Member since: May. 7, 2005
  • Offline.
Forum Stats
Member
Level 19
Programmer
Response to The Flash 'Reg' Lounge 2013-03-05 12:29:53 Reply

Hey guys, just grabbed the source for that A* thing I was talking about and added in stairs.

Here is the version without searching for stairs first:
http://www.newgrounds.com/dump/item/4c2cd0743cc06d64adf10e0c 291786ac

My problem is clearly illustrated in that. No heuristic's which just take into account level and not where the stairs to that level are will help.

Here it is with stairs being found first if it detects the goal is on another level
http://www.newgrounds.com/dump/item/bfdf3c16b1f950571d447fca c7b985db

As you can see the paths are far more efficient (and it's faster to process too).

Anyway just an FYI as I promised I'd let you know how I got on :)


- Matt, Rustyarcade.com

Rustygames
Rustygames
  • Member since: May. 7, 2005
  • Offline.
Forum Stats
Member
Level 19
Programmer
Response to The Flash 'Reg' Lounge 2013-03-05 12:33:28 Reply

At 3/5/13 09:06 AM, Wolfos wrote: Anyone who'd like an RPG engine?
http://wolfos.org/resources/RPGWeb.swf

I'm working on a game and I'll open source the engine.

That's really cool. I was actually working on an isometric engine like this the other day. It's an air app so I could make use of file access and save/load maps.

The Flash 'Reg' Lounge


- Matt, Rustyarcade.com

GeoKureli
GeoKureli
  • Member since: Apr. 1, 2003
  • Offline.
Forum Stats
Supporter
Level 19
Game Developer
Response to The Flash 'Reg' Lounge 2013-03-05 13:08:50 Reply

At 3/5/13 12:29 PM, Rustygames wrote: Hey guys, just grabbed the source for that A* thing I was talking about and added in stairs.

Here is the version without searching for stairs first:
http://www.newgrounds.com/dump/item/4c2cd0743cc06d64adf10e0c 291786ac

My problem is clearly illustrated in that. No heuristic's which just take into account level and not where the stairs to that level are will help.

Here it is with stairs being found first if it detects the goal is on another level
http://www.newgrounds.com/dump/item/bfdf3c16b1f950571d447fca c7b985db

As you can see the paths are far more efficient (and it's faster to process too).

Anyway just an FYI as I promised I'd let you know how I got on :)

That's super impressive. and seems highly efficient considering the low number of tiles checked. I'm a little confused by the random snake patterns that pop up. [below] I choose 2 tiles that are perfectly diagonal to each other expecting a neat staircase from a to b, and I got this wiggly snake pattern. It doesn't matter too much cuz the resulting path is just as efficient, but I counted and my expected neat staircase would have had a smaller total tiles checked(assuming that the white outer tiles are paths not taken). I'm not complaining, I'm just curious as to how you decide which direction to check, are you choosing a random direction first or does it favor the actual direction of your target?

The Flash 'Reg' Lounge

MSGhero
MSGhero
  • Member since: Dec. 15, 2010
  • Offline.
Forum Stats
Member
Level 16
Game Developer
Response to The Flash 'Reg' Lounge 2013-03-05 13:13:38 Reply

At 3/5/13 01:08 PM, ImpotentBoy2 wrote: I'm just curious as to how you decide which direction to check, are you choosing a random direction first or does it favor the actual direction of your target?

You can add turning to the heuristic to get straight lines if they don't already come out that way. Or add not turning to it to always get a staircase :P

Rustygames
Rustygames
  • Member since: May. 7, 2005
  • Offline.
Forum Stats
Member
Level 19
Programmer
Response to The Flash 'Reg' Lounge 2013-03-05 13:27:28 Reply

At 3/5/13 01:08 PM, ImpotentBoy2 wrote:
At 3/5/13 12:29 PM, Rustygames wrote: Hey guys, just grabbed the source for that A* thing I was talking about and added in stairs.

Here is the version without searching for stairs first:
http://www.newgrounds.com/dump/item/4c2cd0743cc06d64adf10e0c 291786ac

My problem is clearly illustrated in that. No heuristic's which just take into account level and not where the stairs to that level are will help.

Here it is with stairs being found first if it detects the goal is on another level
http://www.newgrounds.com/dump/item/bfdf3c16b1f950571d447fca c7b985db

As you can see the paths are far more efficient (and it's faster to process too).

Anyway just an FYI as I promised I'd let you know how I got on :)
That's super impressive. and seems highly efficient considering the low number of tiles checked. I'm a little confused by the random snake patterns that pop up. [below] I choose 2 tiles that are perfectly diagonal to each other expecting a neat staircase from a to b, and I got this wiggly snake pattern. It doesn't matter too much cuz the resulting path is just as efficient, but I counted and my expected neat staircase would have had a smaller total tiles checked(assuming that the white outer tiles are paths not taken). I'm not complaining, I'm just curious as to how you decide which direction to check, are you choosing a random direction first or does it favor the actual direction of your target?

It's a good question. The algorithm will actually find many paths which reach the same goal, but only bothers returning it if it's shorter. Having a neat stair case is actually the exact same amount of moves. I think it just happens that it's found that one first (and therefore subsequent successes were ignored as they were no better) because the neighbors are in a list from left to right. So first it will check above, then left, then right and then finally below the last tile. That's why it takes a couple of steps to the right first and the rest of the weirdness is making up for that initial decision (while moving it as close to the goal as possible).

I agree it isn't as aesthetically pleasing, but it is equally as efficient as a neat staircase :)


- Matt, Rustyarcade.com

Rustygames
Rustygames
  • Member since: May. 7, 2005
  • Offline.
Forum Stats
Member
Level 19
Programmer
Response to The Flash 'Reg' Lounge 2013-03-05 13:35:12 Reply

At 3/5/13 01:13 PM, MSGhero wrote:
At 3/5/13 01:08 PM, ImpotentBoy2 wrote: I'm just curious as to how you decide which direction to check, are you choosing a random direction first or does it favor the actual direction of your target?
You can add turning to the heuristic to get straight lines if they don't already come out that way. Or add not turning to it to always get a staircase :P

Yup this is the solution. Could also just generally prefer searches for a tile in the same direction without messing with the heuristic, could work, I'll have to see (in all my wisdom I left the source at work again XD)

I think I'd go for turning being more expensive personally because if my little character running around started doing a crazy stair case walk (assuming he can't walk diagonally as this engine does) I'd feel a little queasy :P


- Matt, Rustyarcade.com

GeoKureli
GeoKureli
  • Member since: Apr. 1, 2003
  • Offline.
Forum Stats
Supporter
Level 19
Game Developer
Response to The Flash 'Reg' Lounge 2013-03-05 13:44:45 Reply

At 3/5/13 01:27 PM, Rustygames wrote: So first it will check above, then left, then right and then finally below the last tile. That's why it takes a couple of steps to the right first and the rest of the weirdness is making up for that initial decision (while moving it as close to the goal as possible).

that's where I'm confused. if it was up,left,right,down respectively I'm surprised the path I got wasn't r,r,r,r,r,r,r,d,d,d,d,d.

I agree it isn't as aesthetically pleasing

quite the opposite, I find it organic.

egg82
egg82
  • Member since: Jun. 24, 2006
  • Offline.
Forum Stats
Supporter
Level 05
Game Developer
Response to The Flash 'Reg' Lounge 2013-03-05 13:48:51 Reply

seems legit


Programming stuffs (tutorials and extras) PM me (instead of MintPaw) if you're confuzzled. thank Skaren for the sig :P

BBS Signature
Rustygames
Rustygames
  • Member since: May. 7, 2005
  • Offline.
Forum Stats
Member
Level 19
Programmer
Response to The Flash 'Reg' Lounge 2013-03-05 13:56:14 Reply

At 3/5/13 01:44 PM, ImpotentBoy2 wrote:
At 3/5/13 01:27 PM, Rustygames wrote: So first it will check above, then left, then right and then finally below the last tile. That's why it takes a couple of steps to the right first and the rest of the weirdness is making up for that initial decision (while moving it as close to the goal as possible).
that's where I'm confused. if it was up,left,right,down respectively I'm surprised the path I got wasn't r,r,r,r,r,r,r,d,d,d,d,d.

r,r,r,r,r,r,d,d,d,d,d,d wouldn't be as optimal in terms of the heuristic because the heuristic is a straight line. It will try and go as straight as possible, but it favors certain directions where it makes no difference (in this case up, then left, then right then down).

I agree it isn't as aesthetically pleasing
quite the opposite, I find it organic.

You might be right, I will add a little man to follow the path and try the 2 methods and we'll see which one is nicest.


- Matt, Rustyarcade.com

GeoKureli
GeoKureli
  • Member since: Apr. 1, 2003
  • Offline.
Forum Stats
Supporter
Level 19
Game Developer
Response to The Flash 'Reg' Lounge 2013-03-05 14:16:18 Reply

At 3/5/13 01:56 PM, Rustygames wrote: You might be right, I will add a little man to follow the path and try the 2 methods and we'll see which one is nicest.

If the man only goes 4 directions, yeah, it would be awkward.

Rustygames
Rustygames
  • Member since: May. 7, 2005
  • Offline.
Forum Stats
Member
Level 19
Programmer
Response to The Flash 'Reg' Lounge 2013-03-05 14:21:58 Reply

At 3/5/13 02:16 PM, ImpotentBoy2 wrote:
At 3/5/13 01:56 PM, Rustygames wrote: You might be right, I will add a little man to follow the path and try the 2 methods and we'll see which one is nicest.
If the man only goes 4 directions, yeah, it would be awkward.

Yeah no diagonals at the moment. I suppose I should add them, it won't be hard. I just want to remove diagonals which must go through a wall otherwise it could look a little weird


- Matt, Rustyarcade.com

Wolfos
Wolfos
  • Member since: Jan. 19, 2008
  • Offline.
Forum Stats
Member
Level 25
Game Developer
Response to The Flash 'Reg' Lounge 2013-03-05 14:36:02 Reply

At 3/5/13 12:33 PM, Rustygames wrote:
At 3/5/13 09:06 AM, Wolfos wrote: Anyone who'd like an RPG engine?
http://wolfos.org/resources/RPGWeb.swf

I'm working on a game and I'll open source the engine.
That's really cool. I was actually working on an isometric engine like this the other day. It's an air app so I could make use of file access and save/load maps.

File save isn't in there yet but I've got file loading. Basically I'm using embed right now but I think I'll use loadurl instead (at least for the editor).
https://github.com/Wolfos/WolfEngine-Flash

PSvils
PSvils
  • Member since: Feb. 3, 2010
  • Offline.
Forum Stats
Member
Level 01
Game Developer
Response to The Flash 'Reg' Lounge 2013-03-05 15:46:50 Reply

At 3/5/13 12:29 PM, Rustygames wrote: Hey guys, just grabbed the source for that A* thing I was talking about and added in stairs.

Here is the version without searching for stairs first:
http://www.newgrounds.com/dump/item/4c2cd0743cc06d64adf10e0c 291786ac

You have the heuristic estimate in this first one horribly wrong! It seems like you are treating the goal's x/y as if it's on the same level...

Like I said, the heuristic estimate is the shortest combined distance of start>stair + stair>goal. And then let A* do the rest. Not sure what you're doing right now in the second version though...seems like you're jumping through an unnecessary loop.

P.

GeoKureli
GeoKureli
  • Member since: Apr. 1, 2003
  • Offline.
Forum Stats
Supporter
Level 19
Game Developer
Response to The Flash 'Reg' Lounge 2013-03-05 16:30:51 Reply

I could use some help on my rhythm game. It would be nice to know if I'm going in the right direction. basically I'm tracking getTimer() every frame, and I representing time in units of beats where

static public var beat:Number;
static public function update():void {
	var t:int = getTimer();
	if (int(t / 60000 * beatsPerMinute) - int(beat) >= 1)
		dispatchEvent(new BeatEvent(BeatEvent.ON_BEAT));
	beat = t / 60000 * beatsPerMinute;
}

Then all of my objects are positioned based on there speed, which is in pixels per beat. so the update will look like:

x = spawn.x + speed.x*(BeatKeeper.beat-spawnBeat);

all of the objects will move linearly.

So, if I have a backing track in a level, will my objects eventually go out of sync with it?