Author Topic: How to improve math skills?  (Read 42159 times)

Krice

  • (Banned)
  • Rogueliker
  • ***
  • Posts: 2316
  • Karma: +0/-2
    • View Profile
    • Email
How to improve math skills?
« on: February 11, 2015, 02:42:48 PM »
Math is important in some aspects of game programming and I've always found myself less good in math. Is there a good book or books about math I could read over and over again in vague hope that I could improve my math skill, possibly even reach the next skill level.

Quendus

  • Rogueliker
  • ***
  • Posts: 447
  • Karma: +0/-0
  • $@ \in \{1,W\} \times \{1,H\}$
    • View Profile
    • Klein Roguelikes
Re: How to improve math skills?
« Reply #1 on: February 11, 2015, 04:48:47 PM »
What kind of maths do you mean? There are many different fields which are more or less relevant to different genres and different aspects of game development.

For traditional roguelikes, I guess the most relevant fields would be probability/statistics, basic set theory, basic graph theory, and computational complexity? I don't know what books I would recommend as introductions to those fields, though.

mushroom patch

  • Rogueliker
  • ***
  • Posts: 554
  • Karma: +0/-0
    • View Profile
Re: How to improve math skills?
« Reply #2 on: February 11, 2015, 05:30:22 PM »
I'd say probability theory and combinatorics, graph theory, algorithms, and computational geometry are most relevant to roguelikes. Although it's not exactly a book about algorithms, SICP is worth reading. Graph theory is sort of a deceptive phrase because it's not like there's a single canonical body of knowledge to look at -- it's extremely diverse and any introductory text primarily reflects the interests of the author rather than what are really the most important things to know for any particular purpose. You at least want to have the basic vocabulary -- graphs, trees, paths, cycles, planarity, multiple connectedness etc. Certain algorithms in graph theory are worth knowing about, e.g. min/max spanning trees, Dijkstra, A-star. Some probabilistic graph theory can provide useful intuition relevant to map generation.

I don't know any good introductory books on probability or combinatorics that are aimed at a general audience. You could probably just go to a used book store near a university campus and pick up something that's used for an introductory course in probability. You can probably find something relatively old and cheap that will serve your purposes.

Krice

  • (Banned)
  • Rogueliker
  • ***
  • Posts: 2316
  • Karma: +0/-2
    • View Profile
    • Email
Re: How to improve math skills?
« Reply #3 on: February 12, 2015, 04:43:14 PM »
You could probably just go to a used book store near a university campus and pick up something that's used for an introductory course in probability.

You know I live in a middle of nowhere, right? Well, I guess I just browse some interesting looking books and order them. I like books anyway and have a growing library of them.

jlund3

  • Newcomer
  • Posts: 33
  • Karma: +0/-0
    • View Profile
Re: How to improve math skills?
« Reply #4 on: February 12, 2015, 05:15:59 PM »
You know I live in a middle of nowhere, right?

If there is no good library near you, there are quite a few good books and other useful resources online as well. For example, Algorithms by Dasgupta et al is provided by the authors as free pdf (http://beust.com/algorithms.pdf). This book is used in various CS courses as the first exposure to complexity analysis, and basic algorithms like sorting and graph stuff. If you have an interest more specific than just "maths", I suspect better recommendations could be made.

Krice

  • (Banned)
  • Rogueliker
  • ***
  • Posts: 2316
  • Karma: +0/-2
    • View Profile
    • Email
Re: How to improve math skills?
« Reply #5 on: February 12, 2015, 06:43:24 PM »
How can I know what I want if I don't know anything about math.

jlund3

  • Newcomer
  • Posts: 33
  • Karma: +0/-0
    • View Profile
Re: How to improve math skills?
« Reply #6 on: February 12, 2015, 07:22:55 PM »
How can I know what I want if I don't know anything about math.

If you really are Jon Snow when it comes to math, then I suggest that you start with Principia Mathematica. It attempts to describe all the basics of mathematics, and should serve as a foundation for all the other useful maths you might need for your roguelike endeavors. Volume I can be found at the internet archive here: https://archive.org/details/PrincipiaMathematicaVolumeI

mushroom patch

  • Rogueliker
  • ***
  • Posts: 554
  • Karma: +0/-0
    • View Profile
Re: How to improve math skills?
« Reply #7 on: February 12, 2015, 08:04:29 PM »
lol

Omnivore

  • Rogueliker
  • ***
  • Posts: 154
  • Karma: +0/-0
    • View Profile
Re: How to improve math skills?
« Reply #8 on: February 12, 2015, 11:21:05 PM »
Try http://www.zweigmedia.com/tuts/index.html?lang=en, online tutorials, looks decent.  Also look for discrete mathematics (aka one definition of Finite mathematics).

Krice

  • (Banned)
  • Rogueliker
  • ***
  • Posts: 2316
  • Karma: +0/-2
    • View Profile
    • Email
Re: How to improve math skills?
« Reply #9 on: February 13, 2015, 02:54:20 PM »
It would be great to read about math in form of explanations: why something is used in math and how it's used to solve something. I think that online tutorial is an example of reverse situation which assumes you understand and read "math".

mushroom patch

  • Rogueliker
  • ***
  • Posts: 554
  • Karma: +0/-0
    • View Profile
Re: How to improve math skills?
« Reply #10 on: February 13, 2015, 05:03:28 PM »
It's hard to tell what you're asking. I mean if you're really talking basic math, you could, maybe even should, try taking a night course somewhere. If you want to learn stuff that's actually specific to programming roguelikes and helps one with the sorts of ideas people throw around in some places (unfortunately not often enough here) in connection with game design and algorithms, then I don't think you're going to find a lot of books that follow the format you suggest. At a certain stage, you have to be able to assume the reader is competent and imaginative enough to be able to make do with a terse and technical discussion to get anywhere.

I've seen books aimed at arts/design students that survey topics in probability, combinatorics, and so-called "finite mathematics," but I can't think of a reference off the top of my head. At least one that I recall covers things like minimal spanning tree algorithms. This might be close to what you want, but there might be a lot of bullshit to wade through to pick out the stuff that you're after.

Krice

  • (Banned)
  • Rogueliker
  • ***
  • Posts: 2316
  • Karma: +0/-2
    • View Profile
    • Email
Re: How to improve math skills?
« Reply #11 on: February 13, 2015, 05:34:19 PM »
I'm thinking about the stuff I need in Brick Atelier, like that improved ellipse routine which is symmetric and don't look like ass in small sizes. I have some kind of ideas how to do that, but there are other image manipulation stuff I want to know better like anti-aliasing and rotation in context of pixel editor which gives better results when rotation etc. is non-destructive as possible (not aliasing/smudging the result too much).

I guess also fov/lighting routines in roguelikes and better random number generation.

mushroom patch

  • Rogueliker
  • ***
  • Posts: 554
  • Karma: +0/-0
    • View Profile
Re: How to improve math skills?
« Reply #12 on: February 13, 2015, 06:55:05 PM »
Okay. These are more engineering oriented subjects. You could check out an introductory book on image processing and computer graphics that covers topics like interpolation and antialiasing. This material might also provide some insight into FOV algorithms, but "your milage may vary," as they say.

Random number generation is not something you're going to want to get into, I think. It's a well-developed, fairly technical subject where a hobbyist is not going to improve on the state of the art, even as it existed twenty years ago (or even be likely to understand what an improvement would look like and why anyone would care). It's also a subject where widely available software (e.g. stuff in standard libraries for essentially any programming language/OS environment) is perfectly good and probably even overkill for the purpose of any kind of game programming. If you're not writing software that's supposed to encrypt diplomatic communications or something of comparable sensitivity, you don't need to worry about the details of random number generation.

If you're really after more basic mechanics, e.g. answers to questions like "what's the deal with seeds and why does brogue use them?" That kind of question can be answered by skimming some wikipedia articles. I would recommend against spending a significant amount of time learning much beyond the broad outlines of how pseudorandom number generation works, though.
« Last Edit: February 13, 2015, 07:01:25 PM by mushroom patch »

Krice

  • (Banned)
  • Rogueliker
  • ***
  • Posts: 2316
  • Karma: +0/-2
    • View Profile
    • Email
Re: How to improve math skills?
« Reply #13 on: February 16, 2015, 11:42:56 AM »
The problem in ellipse (also in fov) routines is the aliasing from "perfect" mathematic equation to pixelated extremely small size. I've reached far using trigonometric functions for outer edge and mathematical ellipse equation for inner (fill), but the edges have "double" pixels, you know. That's why bresenham routine was invented for line and also ellipse, but sadly the routine I copied from internet has a bug. If the x or y (don't remember which one) radius is 1 (one line width) then it draws one pixel, even if the other radius is more (should draw a line). I can't fix that in a thousand years, because I don't know how the bresenham routine works. I bet the bug is in all similar routines, because that bresenham implementation has just been copied all over the place as is usual in internet.

TheCreator

  • Rogueliker
  • ***
  • Posts: 370
  • Karma: +0/-0
    • View Profile
    • Fame
    • Email
Re: How to improve math skills?
« Reply #14 on: February 16, 2015, 12:45:27 PM »
Wouldn't it be easier to find a good implementation of the algorithm?
Fame (Untitled) - my game. Everything is a roguelike.