• What are you working on? v15
    5,001 replies, posted
[QUOTE=limitofinf;27779328]Hey, You're all missing the point. A* is for [i]finding the shortest path[/i] from A to B. It has nothing to do with [i]generating[/i] maps. If you need to see [i]if there is a path[/i] between A and B, then all you need is a floodfill, which will be [i]much[/i] faster than using A*. [b]Edit:[/b] Went a little overboard with the italics :v:[/QUOTE] Hum the A* search algorithm is [b]mainly[/b] used for path-finding, but I'm sure it can be somehow used for map generation, like a river per instance.
[QUOTE=limitofinf;27779328]Hey, You're all missing the point. A* is for [i]finding the shortest path[/i] from A to B. It has nothing to do with [i]generating[/i] maps. If you need to see [i]if there is a path[/i] between A and B, then all you need is a floodfill, which will be [i]much[/i] faster than using A*. [b]Edit:[/b] Went a little overboard with the italics :v:[/QUOTE] Huh. Every tutorial I've seen on roguelike dungeon generation insists A* is the best method, but I don't really know all that much about it, to be honest. Edit: Hey. Edit2: Accidentally rated HiredK heart... Whatever. :v:
snip
[QUOTE=Loli;27778924]Awesome, Sauce?[/QUOTE] g = GM/r^2 Pretty much all you need.
How can I make this faster? It is bottlenecking the whole map generation algorithm :( [php]public static List<PGNode> Pathfind(PGMap mMap, PGNode mStart, PGNode mEnd) { mMap.ClearNodes(); mMap.GetTile(mStart.X, mStart.Y).Value = 0; mMap.GetTile(mEnd.X, mEnd.Y).Value = 0; List<PGNode> openNodes = new List<PGNode>(); List<PGNode> closedNodes = new List<PGNode>(); List<PGNode> solutionNodes = new List<PGNode>(); mStart.G = 0; mStart.H = GetManhattanHeuristic(mStart, mEnd); solutionNodes.Add(mStart); solutionNodes.Add(mEnd); openNodes.Add(mStart); // 1) Add the starting square (or node) to the open list. while (openNodes.Count > 0) // 2) Repeat the following: { //openNodes.Sort((p1, p2) => p1.F.CompareTo(p2.F)); PGNode current = openNodes[0]; // a) We refer to this as the current square.) if (current == mEnd) { while (current != null) { solutionNodes.Add(current); current = current.Parent; } return solutionNodes; } openNodes.Remove(current); closedNodes.Add(current); // b) Switch it to the closed list. for (int i = 0; i < current.GetNeighborNodes().Count; i++) { PGNode neighbor = current.GetNeighborNodes()[i]; double cost = current.G + 10; bool isCostBetter = false; if (closedNodes.Contains(neighbor) || neighbor.Passable == false) continue; // If it is not walkable or if it is on the closed list, ignore it. if (openNodes.Contains(neighbor) == false) { openNodes.Add(neighbor); // If it isn&#8217;t on the open list, add it to the open list. isCostBetter = true; } else if (cost < neighbor.G) { isCostBetter = true; } if (isCostBetter) { neighbor.Parent = current; // Make the current square the parent of this square. neighbor.G = cost; neighbor.H = GetManhattanHeuristic(current, neighbor); } } } return null; }[/php]
[QUOTE=DrLuke;27777768][img_thumb]http://gyazo.com/431c6b07c2361995ce38557d258f170d.png[/img_thumb] uuuhhhh[/QUOTE] [img]http://www.xamuel.com/images/piequals4.png[/img] Thats the reason i made it Math.Pi = 4;
[QUOTE=BlkDucky;27779588]Huh. Every tutorial I've seen on roguelike dungeon generation insists A* is the best method, but I don't really know all that much about it, to be honest. Edit: Hey. Edit2: Accidentally rated HiredK heart... Whatever. :v:[/QUOTE] He's suggesting to generate the map literally randomly, then use a flood-fill algorithm to check if there IS a path, rather than building the map around a DEFINITE path. His way could fail countless times and thus be incredibly slow, but it could also be very fast. It's random.
[media]http://www.youtube.com/watch?v=rrHNmPqXAkc[/media] Figured I'd have a go. Sorry about my terrible camera...
[QUOTE=bromvlieg;27780054][img_thumb]http://www.xamuel.com/images/piequals4.png[/img_thumb] Thats the reason i made it Math.Pi = 4;[/QUOTE] Except that isn't pi, that's its circumference
[QUOTE=Kondor58;27780179]Except that isn't pi, that's its circumference[/QUOTE] Circumference = pi * diameter If the circumference is 4, and the diameter is 1 then pi must be 4. derp
Not really an update but my engine's material now use a specular map for a more realist light reflection. [media]http://www.youtube.com/watch?v=EGapSsEag1M[/media]
[QUOTE=TheBoff;27773423]It might be worth benchmarking against [url]http://www.cplusplus.com/reference/algorithm/sort/[/url] then, as well.[/QUOTE] I'm trying to stay away from using vectors, they feel bloated for the simple things i need them to do. The quicksort looks nice, i'll try it. thanks jallen.
[QUOTE=bromvlieg;27780054][img_thumb]http://www.xamuel.com/images/piequals4.png[/img_thumb] Thats the reason i made it Math.Pi = 4;[/QUOTE] [img]http://imgur.com/skMne.png[/img]
d = 1 C = pi*d 4 = pi*1 4/1 = pi Fucks sake, like 3 posts explaining shit before me. I should really refresh before I post.
Hey, [QUOTE=HiredK;27779569]Hum the A* search algorithm is [b]mainly[/b] used for path-finding, but I'm sure it can be somehow used for map generation, like a river per instance.[/QUOTE] Okay, you got me. You could use A* to find a path for a river. Then again, this river would be flowing on an already existing map, which had nothing to do with A*. [QUOTE=BlkDucky;27779588]Huh. Every tutorial I've seen on roguelike dungeon generation insists A* is the best method, but I don't really know all that much about it, to be honest.[/QUOTE] The best method [i]for what[/i]? It's the best method for node-based pathfinding (nothing to do with dungeon generation). [editline]31st January 2011[/editline] Hey, Thanks to recursion, my CAS can now use U-substitution multiple times: [img]http://anyhub.net/file/1FBp-long_usub.png[/img] Plus, I can't get Wolfram|Alpha to solve the same problem; it always times out. I'm sure Mathematica is capable of it, of course.
[QUOTE=limitofinf;27780897][b]Hey,[/b] Okay, you got me. You could use A* to find a path for a river. Then again, this river would be flowing on an already existing map, which had nothing to do with A*. The best method [i]for what[/i]? It's the best method for node-based pathfinding (nothing to do with dungeon generation). [editline]31st January 2011[/editline] [b]Hey,[/b] [/QUOTE] No, just no. One is more than enough
[img]http://dl.dropbox.com/u/3715122/MoreBooleans.PNG[/img] More Boolean algebra excitement. Works for almost every expression I can throw at it :)
[QUOTE=bromvlieg;27780054][img_thumb]http://www.xamuel.com/images/piequals4.png[/img_thumb] Thats the reason i made it Math.Pi = 4;[/QUOTE] Except that just because you approximate the area of the circle, does not mean you also approximate the surface area, ie a rubber ball and a fuzzy ball may take up the same volume of space, but that in no way implies that they have the same amount of the surface area. The very fact that while you (claim to) reduce the shape, or get a closer approximation, the surface area does not reduce, quite blatantly shows that you are performing an illegal operation. This is exactly like taking a piece of paper and smashing into a circle; how on earth does that prove anything about a circle's surface area?
[QUOTE=RyanDv3;27781046]Except that just because you approximate the area of the circle, does not mean you also approximate the surface area, ie a rubber ball and a fuzzy ball may take up the same volume of space, but that in no way implies that they have the same amount of the surface area. The very fact that while you (claim to) reduce the shape, or get a closer approximation, and yet the surface area does not reduce, quite blatantly shows that you are performing an illegal operation. This is exactly like taking a piece of paper and smashing into a circle; how on earth does that prove anything about the circle's surface area?[/QUOTE] I'm fairly sure he was joking and not trying to prove an alternate value of pi...
[QUOTE=Naelstrom;27780299]I'm trying to stay away from using vectors, they feel bloated for the simple things i need them to do. The quicksort looks nice, i'll try it. thanks jallen.[/QUOTE] [url]http://www.parashift.com/c++-faq-lite/containers.html#faq-34.1[/url]
[QUOTE=RyanDv3;27781046]Except that just because you approximate the area of the circle, does not mean you also approximate the surface area, ie a rubber ball and a fuzzy ball may take up the same volume of space, but that in no way implies that they have the same amount of the surface area. The very fact that while you (claim to) reduce the shape, or get a closer approximation, the surface area does not reduce, quite blatantly shows that you are performing an illegal operation. This is exactly like taking a piece of paper and smashing into a circle; how on earth does that prove anything about a circle's surface area?[/QUOTE] They're called troll physics for a reason.
[QUOTE=Jallen;27781078]I'm fairly sure he was joking and not trying to prove an alternate value of pi...[/QUOTE] [img]http://i.cubeupload.com/POpPd0.png[/img]
[QUOTE=RyanDv3;27781447][img_thumb]http://i.cubeupload.com/POpPd0.png[/img_thumb][/QUOTE] Your intelligence is two values simultaneously?
[QUOTE=HiredK;27780294]Not really an update but my engine's material now use a specular map for a more realist light reflection. [media]http://www.youtube.com/watch?v=EGapSsEag1M[/media][/QUOTE] Holy fuck that looks amazing! Looks as good as unreal at that point imo :v:
Second real program made in C++. Started learning C++ on friday. I only watched like 15, 2 minutes tutorials. [img]http://img31.imageshack.us/img31/9751/screen1nn.png[/img] [img]http://img141.imageshack.us/img141/5971/screen2y.png[/img] [img]http://img600.imageshack.us/img600/9692/screen3n.png[/img] Kind of made for the Never Ending Dungeon thread in Fast Threads but really for any game like that. I have made slight improvements but it's not worth uploading new pictures for. Just stuff on new lines and it looks cleaner.
[QUOTE=Jallen;27781481]Your intelligence is two values simultaneously?[/QUOTE] It's either one or the other, it will collapse into one state as soon as the poster of joke in question either figures out my intelligence graph, or fails at doing so. /battle of the wits
[QUOTE=RyanDv3;27781526]It's either one or the other, it will collapse into one state as soon as the poster of joke in question either figures out my intelligence graph, or fails at doing so. /battle of the wits[/QUOTE] :psyboom:
[QUOTE=RyanDv3;27781526]It's either one or the other, it will collapse into one state as soon as the poster of joke in question either figures out my intelligence graph, or fails at doing so. /battle of the wits[/QUOTE] schrodinger's cat
More like schrodinger's smartness. In other news, I've got Box2D.XNA working in a side scroller I'm working on!
I was bored during US History, my teacher was going off on another tangent. So, as usual, I minimized my notes and fired up eclipse, this time working on the actual layout of a main menu I've been making for my game. [IMG]http://i.imgur.com/b5KTt.png[/IMG]
Sorry, you need to Log In to post a reply to this thread.