Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


Álvaro

Member Since 07 Mar 2002
Offline Last Active Today, 08:26 AM

#5220654 Same point in another coordinate system

Posted by Álvaro on 01 April 2015 - 04:42 AM

Just to set the record straight, mathematicians use language very close to the OP. We don't use the term "space" the way it's used in computer graphics.

There are several things mathematicians call a "space". The ones that would be useful for computer graphics are: affine space, Euclidean space and projective space. But these are objects that don't come with a coordinate system attached.


#5220638 Design a game that is good for a neural network

Posted by Álvaro on 01 April 2015 - 03:14 AM

Neural networks are good at solving the same things our brains are good at solving:

 
Are they? All the NNs I've seen are pretty awful at problems humans are good at!


Although the statement you are responding to is overselling them, neural networks have improved a lot in the last 8 years. There are now neural networks that are about as good as humans at many image-recognition tasks: Classifying images, recognizing hand-written digits, recognizing street signs, reading house numbers...

In the subject of games, there are now neural networks that are extremely good at predicting the next move in go and playing Atari 2600 games.

I have recently used a neural network as an evaluation function for Spanish checkers. When used within a simple alpha-beta searcher, the resulting program is probably better than any human (in limited testing, it seems to play better than a friend of mine who is a top player).


#5220574 Anyone got any ideas where 4k a sec is coming from?

Posted by Álvaro on 31 March 2015 - 03:58 PM

Do you delete that pointer?




#5219718 A* scanning extra nodes?

Posted by Álvaro on 27 March 2015 - 03:42 PM

Go step by step and check what node you think should be explored next, and which one is actually explored next. Pay attention to the values of cost and the heuristic. Debugging is a very useful skill and you shouldn't pass this opportunity to learn it.




#5219647 A* scanning extra nodes?

Posted by Álvaro on 27 March 2015 - 10:16 AM

I believe the people that bring up floating-point inaccuracies are mistaken. Assuming the nodes have integer coordinates, the particular heuristic function he is using doesn't introduce any rounding errors.




#5219450 Global Consts

Posted by Álvaro on 26 March 2015 - 03:11 PM

The number of vertices per quad? That constant has a standard name, which is `4'. :)




#5219357 A* scanning extra nodes?

Posted by Álvaro on 26 March 2015 - 10:44 AM

I don't think your diagram looks particularly problematic. It might just have been bad luck that you try to go right first, and in this particular instance that's not a good strategy.

 

You are the king of copying and pasting code. :) You should write a loop instead of four blocks of nearly identical code. For instance, you can write a function that returns a list of neighbors and then loop over them. I implemented A* as part of an engine to play Quoridor, and the implementation is 30 lines of code.




#5218890 Tips for reading mathematic formulae?

Posted by Álvaro on 24 March 2015 - 02:25 PM

I have a funny story about encountering Math language. When I was a teenager I read a book about Set Theory in French (which I never studied, but reading technical texts in another language is not that hard). It introduced the axioms of Set Theory and at some point one of them read something like this (paraphrasing from memory, several decades later):

Axiom: Given two sets (*) there is a set that has them as its only elements.

(*) Note: Although we haven't defined the natural numbers yet, "two sets" here should be interpreted as meaning "a set and another set".


smile.png


#5218767 c++ count lines in txt file and then read these lines without reopening a file

Posted by Álvaro on 24 March 2015 - 08:54 AM

If this is your own format, you can start the file with a header that indicates how many things are in the file.


#5218665 Tips for reading mathematic formulae?

Posted by Álvaro on 23 March 2015 - 07:41 PM

I don't know if the formal definition is important to you, but it's the usual language in mathematics. I was just trying to explain what the notation Rn actually means.

 

x, y and z are not from different sets: They are all from R.




#5218660 Tips for reading mathematic formulae?

Posted by Álvaro on 23 March 2015 - 07:10 PM


And I learned about the set of Real Numbers, and I think the exponent refers to the dimensions. 

 

If you have a set X and a set Y, the set of pairs (x, y) formed by an element x from X and an element y from Y is called the Cartesian product of X and Y, and is usually written X x Y (the "x" here is not a letter, just a cross). The Cartesian product of X with itself can be written as X x X, but it is also common to write it as X2. If you consider the set of triplets of elements from X, that is notated as either  X x X x X or X3.

 

So R3 means the set of triplets (x, y, z) where x, y and z are real numbers. So yes, "3" is the dimension, but you can understand what R3 is before you know what "dimension" means.

 

[EDIT: The boldface R and the R with an extra bar represent the same thing. Sorry if that introduced any confusion (http://en.wikipedia.org/wiki/Blackboard_bold).]




#5218653 Tips for reading mathematic formulae?

Posted by Álvaro on 23 March 2015 - 06:06 PM

"That R looking thing with the extra line" is the symbol for the set of real numbers. Most formula-heavy books have a couple of pages at the beginning describing the notation they use. Does your book have that?




#5218568 c++ count lines in txt file and then read these lines without reopening a file

Posted by Álvaro on 23 March 2015 - 01:48 PM

You can also use a std::deque, which also provides a push_back method, gives you O(1) access to elements (although probably slower than std::vector's), and doesn't reallocate.

Of course it's not the best solution in all cases, but it should be considered.


#5217313 C++ do while error

Posted by Álvaro on 18 March 2015 - 04:33 AM

What function is that do-while loop supposed to be in? As it stands, it's in the class block for `President', but not in any function.
 

ph34r.png




#5217310 GUI Ideas for a Tower Defense Game

Posted by Álvaro on 18 March 2015 - 04:12 AM

One detail that most tower-defense games get wrong: Allow the user to use keys to do most things: select a type of tower to build, upgrade the selected tower, sell the selected tower (if this is expected to be a common action), etc.

Other than that, play a few TD games and see what you like or don't like in their interfaces.




PARTNERS