Be a Supporter!

The Flash 'Reg' Lounge

  • 1,539,743 Views
  • 64,531 Replies
New Topic Respond to this Topic
Doomsday-One
Doomsday-One
  • Member since: Oct. 28, 2005
  • Offline.
Forum Stats
Member
Level 10
Programmer
Response to The Flash 'Reg' Lounge Jun. 3rd, 2012 @ 06:12 AM Reply

At 6/2/12 10:23 AM, 4urentertainment wrote: Q:Was there any specific reason you chose C++ for SMB? It just seems to me that when creating a 2D game, you can really get everything you'd ever dream of, using other languages (like Lua, or heck, even Flash) but get it all done much faster.

Don't forget as well that Super Meat Boy isn't just a platformer. They had to deal with screen resolutions, online scoreboards, and things that aren't very easy with Flash (there are better examples, I'm sure, but I can't think of them at this moment). Also, if it had been made in Flash, there's no way it would run at an acceptable speed on my laptop.


Doomsday-One, working on stuff better than preloaders. Marginally.

fixplz
fixplz
  • Member since: Jul. 29, 2011
  • Offline.
Forum Stats
Member
Level 01
Blank Slate
Response to The Flash 'Reg' Lounge Jun. 3rd, 2012 @ 04:10 PM Reply

According to the internet,
http://www.reddit.com/r/gaming/comments/sckwj/why_i_dont_rea lly_mind_when_super_meat_boy_crashes/
http://www.reddit.com/r/gaming/comments/nov42/super_meat_boy _level_database_access_left_open_to/?limit=500

C++ and Lua are languages, you can pick what graphical/game environment to attach to them. (Now you can sort of pick which part of Flash graphics output to use with your AS3 too.)

AS3 has enough 'perfomance' for a platformer (SMB has up to like three moving pieces), but you could want a better environment so your game doesn't stutter when you have millions of particles floating.

PrettyMuchBryce
PrettyMuchBryce
  • Member since: Mar. 17, 2001
  • Offline.
Forum Stats
Member
Level 06
Blank Slate
Response to The Flash 'Reg' Lounge Jun. 3rd, 2012 @ 07:49 PM Reply

At 6/3/12 04:10 PM, fixplz wrote: According to the internet,
http://www.reddit.com/r/gaming/comments/sckwj/why_i_dont_rea lly_mind_when_super_meat_boy_crashes/
http://www.reddit.com/r/gaming/comments/nov42/super_meat_boy _level_database_access_left_open_to/?limit=500

C++ and Lua are languages, you can pick what graphical/game environment to attach to them. (Now you can sort of pick which part of Flash graphics output to use with your AS3 too.)

This is pretty inherently false. I wouldn't use reddit as a source for any credible information. Flash runs through a virtual machine, and it's performance limitations are very well known. You could never reach anything like native speed in flash, let's just be honest about that. It's main advantage is it's penetration in the browser. LUA is a scripting language and the context in which it is used does depend on the framework. I know less about LUA, so I won't comment there.

C++ is compiled to machine code. There is so much you get with native development. Outside of performance, there really is just far more control.

I'm not arguing against trying other things. I think if you have the right type of game, and it saves you time, then you should absolutely do it. Just be aware of your limitations. There is good reason why almost every successful game on consoles and smartphones is written in native code.


BBS Signature
fixplz
fixplz
  • Member since: Jul. 29, 2011
  • Offline.
Forum Stats
Member
Level 01
Blank Slate
Response to The Flash 'Reg' Lounge Jun. 4th, 2012 @ 03:07 AM Reply

The first Reddit thread is people discussing technical issues in SMB that haven't been fixed because people should buy new computers instead according to Refenes. The second is a guy making an obvious hack to modify the scoreboard after warning him.

Reddit is the nicest general community on the internet, for context. It has more technically competent people in a casual context than any section on Newgrounds.

The paragraph you quoted is a factual statement. I don't know what you're trying to correct. Read it again; you should understand it.

4urentertainment
4urentertainment
  • Member since: Aug. 1, 2008
  • Offline.
Forum Stats
Moderator
Level 13
Game Developer
Response to The Flash 'Reg' Lounge Jun. 4th, 2012 @ 04:39 AM Reply

At 6/2/12 02:22 PM, PrettyMuchBryce wrote: SMB could not have been ported to the Xbox either if it was written in one of these languages.

Thats what Refenes said when I posted a follow up question insisting on an answer. And that's the only good reason why you might want to use C++. But that's still slightly subjective. I don't know if C++ runs on mobile platforms or not (I'll assume not) so in the case you want to simultaneously develop for PC/Mac/Linux, web *and* mobiles, flash could be useful here.

He's right in a sense. C++ is great. It's low-level. It's performant. It's cross-platform. I think it's safe to say that SMB in it's current form would be impossible to make with flash. The performance would be horrible. I realize theres a flash version, but it's not as fancy as the retail version.

But that's the thing. Sure, C++ will always be faster than flash. But you'll never really see that performance difference unless you're doing something really extreme. I think Super Meat Boy, in its current form, with the right optimization can be done in flash *without* even using Stage3D. But assuming you're using it and then there would be absolutely no problem.

In fact, unless you really know what you're doing, C++ could actually hinder your performance. When I was experimenting with it for a few months I was shocked to first see that my engine lagged when I tried to rotate something when I was rendering with SDL. The solution? Implement a giant 3D engine for rendering, that is openGL.

Okay, that's cool, so I implement openGL. And now I'm getting some really good performance, but I test the limits of the engine and apparently after 2000 moving objects it starts to lag. So what gives? I was apparently using something called "immediate mode" in openGL, and the solution was to implement various different different rendering techniques.

Now of course this was my fault for not actually spending time to learn openGL fully before diving in, but there's no shortage of "my game lags" threads on C++ forums. Other tools just tend to hold your hand more if you want to focus more on the actual game and not just the code.

The reason I decided it wasn't going to be a good idea to make a game in C++ was because it was going to take a *lot* of time and effort, and even when it was completed, I could look back and see that I could have done multitudes the amount of work in Flash.

Don't forget as well that Super Meat Boy isn't just a platformer. They had to deal with screen resolutions, online scoreboards, and things that aren't very easy with Flash

The fact that Flash doesn't give you much control on screen resolutions is another reason why you might not want to use Flash, but pick up Lua or something of that nature and you're good to go.

I'm not arguing against trying other things. I think if you have the right type of game, and it saves you time, then you should absolutely do it. Just be aware of your limitations. There is good reason why almost every successful game on consoles and smartphones is written in native code.

So that exactly sums it all up. As long as whatever you plan on doing will never go beyond those limitations, then using the easier tool will ultimately result in a much better game.

Sandremss128
Sandremss128
  • Member since: Aug. 22, 2009
  • Offline.
Forum Stats
Supporter
Level 11
Programmer
Response to The Flash 'Reg' Lounge Jun. 4th, 2012 @ 07:41 AM Reply

You can also use Haxe, its an emerging language similar to flash but more strict and optimized. Better still it won't hold your hand and bind you to flash format; you can compile to C++, AMV bytecode, js and more.
Even for just flash it has proven to compile more efficient code than actionscript can.
You can make a game and compile it as a flash for the web, after that with the same code you can compile for android.
I see it as the future for there may be a day where flash is dead.


Asteroids || Never trust a gay Canadian?

Sam
Sam
  • Member since: Oct. 1, 2005
  • Offline.
Forum Stats
Moderator
Level 19
Programmer
Response to The Flash 'Reg' Lounge Jun. 4th, 2012 @ 09:29 AM Reply

At 6/4/12 07:41 AM, Sandremss128 wrote: You can make a game and compile it as a flash for the web, after that with the same code you can compile for android.

With NO modifications to the code at all?

Tree-SkyLark-BCE
Tree-SkyLark-BCE
  • Member since: Aug. 6, 2005
  • Offline.
Forum Stats
Member
Level 35
Programmer
Response to The Flash 'Reg' Lounge Jun. 4th, 2012 @ 10:08 AM Reply

At 6/4/12 09:29 AM, Sam wrote:
At 6/4/12 07:41 AM, Sandremss128 wrote: You can make a game and compile it as a flash for the web, after that with the same code you can compile for android.
With NO modifications to the code at all?

Using NME, one can target multiple platforms without modifying the source code.


BBS Signature
Sandremss128
Sandremss128
  • Member since: Aug. 22, 2009
  • Offline.
Forum Stats
Supporter
Level 11
Programmer
Response to The Flash 'Reg' Lounge Jun. 4th, 2012 @ 12:22 PM Reply

At 6/4/12 10:08 AM, Tree-SkyLark-BCE wrote:
At 6/4/12 09:29 AM, Sam wrote:
At 6/4/12 07:41 AM, Sandremss128 wrote: You can make a game and compile it as a flash for the web, after that with the same code you can compile for android.
With NO modifications to the code at all?
Using NME, one can target multiple platforms without modifying the source code.

yeah nme is really good at that. When I said the same code I mean the 99% of the logic code and rendering. Its possible that you have to rewrite the input for mobile for example since mouse input won't work for that, as well as some other little things along the way.
It's really powerful and works really well.


Asteroids || Never trust a gay Canadian?

PSvils
PSvils
  • Member since: Feb. 3, 2010
  • Offline.
Forum Stats
Member
Level 01
Game Developer
Response to The Flash 'Reg' Lounge Jun. 4th, 2012 @ 03:46 PM Reply

Long live NME.

4urentertainment
4urentertainment
  • Member since: Aug. 1, 2008
  • Offline.
Forum Stats
Moderator
Level 13
Game Developer
Response to The Flash 'Reg' Lounge Jun. 4th, 2012 @ 03:46 PM Reply

At 6/4/12 12:22 PM, Sandremss128 wrote:
Using NME, one can target multiple platforms without modifying the source code.
yeah nme is really good at that. When I said the same code I mean the 99% of the logic code and rendering. Its possible that you have to rewrite the input for mobile for example since mouse input won't work for that, as well as some other little things along the way.
It's really powerful and works really well.

Yeah, haXe is brilliant. The only reason I'm not using it right now is that it feels there's not enough support for it out there. Currently the only one who answers questions on the NME forums is the creator himself (or I think he is one of the people who created it, can't be sure). Like I feel there's not enough of a documentation there. There is one but it just lists all the functions and API's, doesn't really tell you what they do or give examples on using them, and because not a lot of people use haXe in the first you'd be hard pressed finding that one guy that wrote a blogpost about that nifty code feature.

Another example is when I made a dummy iPhone app just to see how awesome it would be to compile to iOS with haXe, and it worked. But when I tried using device-specific functions like the iOS's alerts or so there wasn't much on NME saying what to do in that case, and it turns out I had to either find someone who wrote an extension to do that (written in the target device's native language I believe) or write one myself. And since I was using haXe so I can avoid using objective-c that defeated the purpose for me a bit.

So I think haXe is really an easier way to develop cross platform, not a method if you can't otherwise do so. Such that when you come across problems such as this, you can dig into the source code and hack your own solutions.

PSvils
PSvils
  • Member since: Feb. 3, 2010
  • Offline.
Forum Stats
Member
Level 01
Game Developer
Response to The Flash 'Reg' Lounge Jun. 4th, 2012 @ 04:29 PM Reply

At 6/4/12 03:46 PM, 4urentertainment wrote: Yeah, haXe is brilliant. The only reason I'm not using it right now is that it feels there's not enough support for it out there. Like I feel there's not enough of a documentation there.
But when I tried using device-specific functions like the iOS's alerts or so there wasn't much on NME saying what to do in that case, and it turns out I had to either find someone who wrote an extension to do that (written in the target device's native language I believe) or write one myself.

They'll have mobile extensions coming up afaik, for Android and iOS specific stuff.

And if you need support, just get on the #haxe IRC on freenode. Very good place to ask questions.

PrettyMuchBryce
PrettyMuchBryce
  • Member since: Mar. 17, 2001
  • Offline.
Forum Stats
Member
Level 06
Blank Slate
Response to The Flash 'Reg' Lounge Jun. 4th, 2012 @ 09:30 PM Reply

I hear a lot about haxe for a few years now, but why is it I've never seen anyone use it? Are there any real commercial examples of successful haxe games?


BBS Signature
PSvils
PSvils
  • Member since: Feb. 3, 2010
  • Offline.
Forum Stats
Member
Level 01
Game Developer
Response to The Flash 'Reg' Lounge Jun. 5th, 2012 @ 02:57 AM Reply

At 6/4/12 09:30 PM, PrettyMuchBryce wrote: I hear a lot about haxe for a few years now, but why is it I've never seen anyone use it? Are there any real commercial examples of successful haxe games?

Of course! There have been several bigger Flash games made with it, though I can't exactly remember which ones (AFAIK), and for more you can see a showcase:
http://www.haxenme.org/showcase/

'Tis not hard to findeth.

Sam
Sam
  • Member since: Oct. 1, 2005
  • Offline.
Forum Stats
Moderator
Level 19
Programmer
Response to The Flash 'Reg' Lounge Jun. 5th, 2012 @ 09:42 AM Reply

At 6/5/12 02:57 AM, PSvils wrote: Of course! There have been several bigger Flash games made with it, though I can't exactly remember which ones (AFAIK), and for more you can see a showcase:
http://www.haxenme.org/showcase/

'Tis not hard to findeth.

You've spiked my interest.

Gonna have to take a look at this now.

PrettyMuchBryce
PrettyMuchBryce
  • Member since: Mar. 17, 2001
  • Offline.
Forum Stats
Member
Level 06
Blank Slate
Response to The Flash 'Reg' Lounge Jun. 6th, 2012 @ 08:54 PM Reply

I updated the example file on my EasyStarAS3 API.
https://github.com/prettymuchbryce/EasyStarAS3

I have a few features I want to implement next.
- Diagonal movement
- Ability to process multiple paths at once
- Revamping the way I handle avoiding additional tiles

I also want to fix up the tutorial in the markdown. I don't know. I'm very open to ideas on how to make this easier to use. Someone suggested that requiring vector.<vector.<uint>>'s might be confusing to some people. I'm not sure how to avoid that. Knowing how to set up a 2D tilemap might be a prerequisite for using the API.

The Flash 'Reg' Lounge


BBS Signature
MSGhero
MSGhero
  • Member since: Dec. 15, 2010
  • Offline.
Forum Stats
Supporter
Level 16
Game Developer
Response to The Flash 'Reg' Lounge Jun. 6th, 2012 @ 09:11 PM Reply

At 6/6/12 08:54 PM, PrettyMuchBryce wrote: I also want to fix up the tutorial in the markdown. I don't know. I'm very open to ideas on how to make this easier to use. Someone suggested that requiring vector.<vector.<uint>>'s might be confusing to some people. I'm not sure how to avoid that. Knowing how to set up a 2D tilemap might be a prerequisite for using the API.

You could ask for an array and force the user to call a function (or run it during the set method) that loops through the array and gives the values to a new VecVecUint. Type-check each value and throw an error.

4urentertainment
4urentertainment
  • Member since: Aug. 1, 2008
  • Offline.
Forum Stats
Moderator
Level 13
Game Developer
Response to The Flash 'Reg' Lounge Jun. 7th, 2012 @ 08:23 AM Reply

At 6/6/12 08:54 PM, PrettyMuchBryce wrote: I updated the example file on my EasyStarAS3 API.
https://github.com/prettymuchbryce/EasyStarAS3

I was going to make my own A* API eventually, but since you're already making one, here's what I was going to do.

The thing about pathfinding algorithms, and I think the reason I can only name a couple of flash games that have some form of path finding, is that most people tend to be intimidated by the fact that their game would need to be all tile-based or they would have to learn how to use tile maps.

But the thing is, you don't need the game to be tile based to get your algorithms working. Even in a heavily art based game where the levels are drawn by hand, you could just let the programmer specify a movieclip or a bitmap that would have the shape of the ground of that level, and you'd just uniformly place nodes in a grid over all the level and remove the nodes that are touching the ground.

It's simple, it's incredibly intuitive, works for all kinds of games and is super easy to use.

Archawn
Archawn
  • Member since: Sep. 9, 2007
  • Offline.
Forum Stats
Member
Level 27
Game Developer
Response to The Flash 'Reg' Lounge Jun. 9th, 2012 @ 06:00 PM Reply

I'm looking forward to participating in Game Jam 7 in a few weeks, it'll be my first chance in a long to be productive on things that I actually care about, like programming gaemz. I'm excited.

Also, every single one of you needs to take some Coursera computer science classes. I'm in a machine learning class right now and I love it.

I used to think A* was the shit, until I took a neural network to the knee
MSGhero
MSGhero
  • Member since: Dec. 15, 2010
  • Offline.
Forum Stats
Supporter
Level 16
Game Developer
Response to The Flash 'Reg' Lounge Jun. 9th, 2012 @ 07:53 PM Reply

At 6/9/12 06:00 PM, Archawn wrote: Also, every single one of you needs to take some Coursera computer science classes. I'm in a machine learning class right now and I love it.

Same thing with Saylor (I haven't used it yet, but hopefully either gives me an edge in my curric :)) <- how do you end a parenthetical with a smiley?

Archawn
Archawn
  • Member since: Sep. 9, 2007
  • Offline.
Forum Stats
Member
Level 27
Game Developer
Response to The Flash 'Reg' Lounge Jun. 10th, 2012 @ 08:34 AM Reply

At 6/9/12 07:53 PM, MSGhero wrote:
At 6/9/12 06:00 PM, Archawn wrote: Also, every single one of you needs to take some Coursera computer science classes. I'm in a machine learning class right now and I love it.
Same thing with Saylor (I haven't used it yet, but hopefully either gives me an edge in my curric :)) <- how do you end a parenthetical with a smiley?

While we're on the subject of free online classes, mentioning Udacity once again seems appropriate. (And come on, who can't resist Sebastian Thrun? :))

I might try starting a team for their "High School Challenge" to get some of my friends more interested/involved in computer science.

Archawn
Archawn
  • Member since: Sep. 9, 2007
  • Offline.
Forum Stats
Member
Level 27
Game Developer
Response to The Flash 'Reg' Lounge Jun. 10th, 2012 @ 09:00 AM Reply

On a side note, when I rolled over my last post and saw this, for an instant I thought Newgrounds had finally implemented an edit button.

But to my disappointment it was only a misplaced "Edit Signature" button

The Flash 'Reg' Lounge

PSvils
PSvils
  • Member since: Feb. 3, 2010
  • Offline.
Forum Stats
Member
Level 01
Game Developer
Response to The Flash 'Reg' Lounge Jun. 10th, 2012 @ 10:34 AM Reply

At 6/7/12 08:23 AM, 4urentertainment wrote: by the fact that their game would need to be all tile-based or they would have to learn how to use tile maps.

Since when?

GristlyBear
GristlyBear
  • Member since: Jul. 30, 2011
  • Offline.
Forum Stats
Member
Level 24
Animator
Response to The Flash 'Reg' Lounge Jun. 10th, 2012 @ 11:23 AM Reply

Heyoz, I've been kicking around the Flash forums for a while, so I figured I'd say hi!

I'm not all too familiar with AS3 (actually, I've only been learning C++ for about a month, and I'm finally starting to get a hang of AS3... kind of), but maybe I'll pick some stuff up from you guys by... osmosis or something?


BBS Signature
4urentertainment
4urentertainment
  • Member since: Aug. 1, 2008
  • Offline.
Forum Stats
Moderator
Level 13
Game Developer
Response to The Flash 'Reg' Lounge Jun. 10th, 2012 @ 12:06 PM Reply

At 6/10/12 10:34 AM, PSvils wrote:
At 6/7/12 08:23 AM, 4urentertainment wrote: by the fact that their game would need to be all tile-based or they would have to learn how to use tile maps.
Since when?

I've just always noticed the amount of art based games being larger than the amount of tile based games, and most tutorials and beginners start with art based games.

PSvils
PSvils
  • Member since: Feb. 3, 2010
  • Offline.
Forum Stats
Member
Level 01
Game Developer
Response to The Flash 'Reg' Lounge Jun. 10th, 2012 @ 02:09 PM Reply

At 6/10/12 12:06 PM, 4urentertainment wrote: I've just always noticed the amount of art based games being larger than the amount of tile based games, and most tutorials and beginners start with art based games.

But why does pathfinding need tile based maps? (It doesn't...)

MSGhero
MSGhero
  • Member since: Dec. 15, 2010
  • Offline.
Forum Stats
Supporter
Level 16
Game Developer
Response to The Flash 'Reg' Lounge Jun. 10th, 2012 @ 02:55 PM Reply

At 6/10/12 11:23 AM, webufs wrote: Heyoz, I've been kicking around the Flash forums for a while, so I figured I'd say hi!

I'm not all too familiar with AS3 (actually, I've only been learning C++ for about a month, and I'm finally starting to get a hang of AS3... kind of), but maybe I'll pick some stuff up from you guys by... osmosis or something?

Or by me telling you everything...

At 6/10/12 02:09 PM, PSvils wrote: But why does pathfinding need tile based maps? (It doesn't...)

Have any of you used NavMesh? I can't find much info about it, and I'm wondering how the path gets drawn considering there are an infinite number of points to go to and for the heuristic to use...What other pathfinding methods are there besides tile- or polygon-based?

I have a zombie thing that uses a few raytraces to avoid obstacles, though it doesn't learn anything from its environment...but zombies are stupid, so ha.

PrettyMuchBryce
PrettyMuchBryce
  • Member since: Mar. 17, 2001
  • Offline.
Forum Stats
Member
Level 06
Blank Slate
Response to The Flash 'Reg' Lounge Jun. 10th, 2012 @ 03:33 PM Reply

At 6/10/12 11:23 AM, webufs wrote: Heyoz, I've been kicking around the Flash forums for a while, so I figured I'd say hi!

Hey! Welcome.

At 6/7/12 08:23 AM, 4urentertainment wrote: I was going to make my own A* API eventually, but since you're already making one, here's what I was going to do.

I've just always noticed the amount of art based games being larger than the amount of tile based games, and most tutorials and beginners start with art based games.

I agree with you. Most beginners to flash are getting started in CS5 the tool, and working their way up through that. I think you're completely right, however; I think a pathfinding library in that vein would probably be a separate effort, and a separate codebase. I like the idea.

If anyone ever wants to contribute to EasyStar, just check out the code and do a pull request. Diagonal movement is some pretty low hanging fruit of a feature that anyone could tackle. Then you would be a true open source contributor! Wow! I'm pretty sure ladies would instantly flock to you.

p.s. Anyone doing the AustinBreed gamejam ? I want to do it, but I will be on an airplane / on vacation during the jam. I feel lame that something comes up every time I want to do one of these. Maybe I can try for a solo entry -- that way I don't let anybody down if I can't finish.


BBS Signature
PSvils
PSvils
  • Member since: Feb. 3, 2010
  • Offline.
Forum Stats
Member
Level 01
Game Developer
Response to The Flash 'Reg' Lounge Jun. 10th, 2012 @ 03:35 PM Reply

At 6/10/12 02:55 PM, MSGhero wrote: Have any of you used NavMesh? I can't find much info about it, and I'm wondering how the path gets drawn considering there are an infinite number of points to go to and for the heuristic to use...What other pathfinding methods are there besides tile- or polygon-based?

I'll be working on a polygonal pathfinding map representation for my game probably, it would be really interesting to have, since then the AI also has complete info about where he's allowed to go. But there technically isn't an infinite amount of points, navigating a polygonal map is the same as nodes/edges, you just use the points of each polygon, and also possibly its centroid or midpoints. Then you can also smooth the path afterwards and stuff, etc. etc.
The heuristic is simply the distance.

There isn't any other types, and technically tilebased is a simplification of polygonal representations of maps. I guess a 3rd type of representation is an attractor/repeller map, basically gravity and anti-gravity fields that control AIs. Simple life sim for example would have each fire hazard a repeller, and water patches attractors. And of course other same species could be attractors in certain situations etc., good for stuff that doesn't need a lot of accuracy, and just an overall simple behaviour for lots of objects I guess.

I have a zombie thing that uses a few raytraces to avoid obstacles, though it doesn't learn anything from its environment...but zombies are stupid, so ha.

First misconception in game AI, "pathfinding must always be perfect".
Imperfect approximations in pathfinding and slight errors (nothing too serious obviously) give characters personality/character, and can get a more realistic feel sometimes...or most likely players won't even notice it.

MSGhero
MSGhero
  • Member since: Dec. 15, 2010
  • Offline.
Forum Stats
Supporter
Level 16
Game Developer
Response to The Flash 'Reg' Lounge Jun. 10th, 2012 @ 04:40 PM Reply

At 6/10/12 03:35 PM, PSvils wrote: First misconception in game AI, "pathfinding must always be perfect".

No, it MUST be PERFECT.

So for polys, you just go from midpoint to midpoint or vertex to vertex or whatever? In that regard, it seems like you could just lay down waypoints at those locations and then smooth the path. When I read about polys, it said something like "the polygons define the space that the ai can traverse"; but vertex/midpoint/centroids limit where it checks. What if a straight line is the best path, and your triangles are weirdo scalene with their centroids and vertices all over the place?