Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 122 123 [124] 125 126 ... 796

Author Topic: if self.isCoder(): post() #Programming Thread  (Read 907503 times)

malloc

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #1845 on: March 01, 2012, 02:04:19 am »

A* can actually be optimized by weighting it, and making it greedy. By prioritizing searches closest to the destination, you can actually reduce the number of nodes it checks. This is useful if you are just interested in finding a path, but not necessarily the best path.

The default A* will always find the shortest path to the destination, at the cost of being, on average, more computationally expensive.

But then again, it depends on whether or not you actually need the shortest path. Perfect path finding has that unfortunate side effect in games of being really predictable.
Logged

fergus

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #1846 on: March 01, 2012, 02:55:37 am »

A* can actually be optimized by weighting it, and making it greedy. By prioritizing searches closest to the destination, you can actually reduce the number of nodes it checks. This is useful if you are just interested in finding a path, but not necessarily the best path.
Isn't that what A* is?
Logged
BY THE GODS! THIS QUOTE MADE MY SIG BOX HAVE A SCROLL BAR! HAPPY DAYS INDEED!
BY THE GODS! YOU HAVE TOO MANY SIGS!

malloc

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #1847 on: March 01, 2012, 03:34:14 am »

No, a default implementation of A * will always return the shortest path. If a path can be found.
You can see this on Dreadmullet's GIF, the nodes are expanded uniformly, based on distance to the destination. Since all sub solutions are kept at equal distance, the first found solution will be the shortest. I suppose you can call it greedy, on the basis that it does expand the more likely nodes first.

A weighted algorithm will search most direct path first, which means one can't be sure the first solution is the shortest one.
« Last Edit: March 01, 2012, 03:40:21 am by malloc »
Logged

fergus

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #1848 on: March 01, 2012, 04:24:45 am »

Since all sub solutions are kept at equal distance
I don't think this is actually the case, I think all solutions will have approximately the same (distance traversed+estimated distance remaining), but I get your point.
Logged
BY THE GODS! THIS QUOTE MADE MY SIG BOX HAVE A SCROLL BAR! HAPPY DAYS INDEED!
BY THE GODS! YOU HAVE TOO MANY SIGS!

malloc

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #1849 on: March 01, 2012, 04:39:49 am »

Yeah, I find it a little hard finding the right words sometimes. I never had any talent for that.
Logged

Max White

  • Bay Watcher
  • Still not hollowed!
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #1850 on: March 01, 2012, 04:42:24 am »

Although if, for example, you were making an AI to move through a maze, wouldn't it seem a little more realistic if you used a weighted algorithm, so that the actor attempted to move as the crow flies and made variations from that, rather than knowing what is the shortest path?

MorleyDev

  • Bay Watcher
  • "It is not enough for it to just work."
    • View Profile
    • MorleyDev
Re: if self.isCoder(): post() #Programming Thread
« Reply #1851 on: March 01, 2012, 05:13:16 am »

A*#Weighted

Explains it and the animation there shows where it can look unrealistic ^^
« Last Edit: March 01, 2012, 11:58:43 am by MorleyDev »
Logged

Siquo

  • Bay Watcher
  • Procedurally generated
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #1852 on: March 01, 2012, 11:38:56 am »

Adding plain 3D noise to a terrain yields... unacceptable results :)
Spoiler (click to show/hide)
But at least I've got the basics. Needs some stitching here and there, as well.
Logged

This one thread is mine. MIIIIINE!!! And it will remain a happy, friendly, encouraging place, whether you lot like it or not. 
will rena,eme sique to sique sxds-- siquo if sucessufil
(cant spel siqou a. every speling looks wroing (hate this))

malloc

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #1853 on: March 01, 2012, 12:36:31 pm »

So you're working with voxel data? If you are, good job on the surface generator, are you using marching cubes algorithm or something?
Also, looks cool, even if you might have set the noise frequency a bit high.  :)
Logged

Virex

  • Bay Watcher
  • Subjects interest attracted. Annalyses pending...
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #1854 on: March 01, 2012, 12:44:56 pm »

Adding plain 3D noise to a terrain yields... unacceptable results :)
Spoiler (click to show/hide)
But at least I've got the basics. Needs some stitching here and there, as well.


What are you trying to do that couldn't be solved with 2d-noise height maps?
Logged

Nadaka

  • Bay Watcher
    • View Profile
    • http://www.nadaka.us
Re: if self.isCoder(): post() #Programming Thread
« Reply #1855 on: March 01, 2012, 12:52:14 pm »

Adding plain 3D noise to a terrain yields... unacceptable results :)
Spoiler (click to show/hide)
But at least I've got the basics. Needs some stitching here and there, as well.


What are you trying to do that couldn't be solved with 2d-noise height maps?

Overhangs, arches and caves.
Logged
Take me out to the black, tell them I ain't comin' back...
I don't care cause I'm still free, you can't take the sky from me...

I turned myself into a monster, to fight against the monsters of the world.

Virex

  • Bay Watcher
  • Subjects interest attracted. Annalyses pending...
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #1856 on: March 01, 2012, 01:04:26 pm »

Wouldn't it be easier to generate those via volumetric carving instead of 3D noise?
Logged

malloc

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #1857 on: March 01, 2012, 01:11:34 pm »

Using a combination of different noises you can get very interesting features. It also has the advantage of being very deterministic.

There is a interesting Nvidia article showing off procedural 3d terrain generation by computing and combining noise samples.

Edit:
You can look at it here: http://http.developer.nvidia.com/GPUGems3/gpugems3_ch01.html
« Last Edit: March 01, 2012, 01:15:20 pm by malloc »
Logged

MorleyDev

  • Bay Watcher
  • "It is not enough for it to just work."
    • View Profile
    • MorleyDev
Re: if self.isCoder(): post() #Programming Thread
« Reply #1858 on: March 01, 2012, 02:13:35 pm »

We've had talk for ages of specialised hardware for each part of logic slowly replacing the traditional CPU. As awesome as that would be, I have to wonder if it'll ever happen. We're already seeing something similar simply by how much logic can be put onto a good GPU if you really want to, and specialised physics processing units...

You can get "Random Number Generator" chips but outside of advanced physics true randomness isn't that important...
Logged

Virex

  • Bay Watcher
  • Subjects interest attracted. Annalyses pending...
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #1859 on: March 01, 2012, 02:35:41 pm »

We've had talk for ages of specialised hardware for each part of logic slowly replacing the traditional CPU. As awesome as that would be, I have to wonder if it'll ever happen. We're already seeing something similar simply by how much logic can be put onto a good GPU if you really want to, and specialised physics processing units...

You can get "Random Number Generator" chips but outside of advanced physics true randomness isn't that important...
It depends on the customer really. As there is a shift going on from desktops to mobile systems such as pads and eReaders, price, energy usage and size become as important as raw power. If someone is willing to pay big money for dedicated physics hardware (maybe a company that does a lot of simulations?) then it will probably reach the customer market, but I doubt the customer market itself will be enough to get it.
Logged
Pages: 1 ... 122 123 [124] 125 126 ... 796