Sunday, August 26, 2012

Intro and Current Projects

Hello! My name is Seige. I'm a young amateur programmer from Ontario, Canada. I primarily code in Java, but have some experience with Python, and Turing as well. I also do some web design with HTML, CSS, and Javascript, though I'm not particularly good at it.

Recently, I've been working on a few projects in Java. The first is a mathematics Library focused at game-relevant maths. Some of the code I've added may not seem directly related, but it requires something, and I felt I'd rather code something to allow that. For example, I have some basic functions for finding the median of a data set. This requires the data set be ordered, or sorted already. Otherwise it needs to do some internal sorting of some form to determine the median. While Java's default sorting algorithm is far superior to any I'll be coding anytime soon, I felt I'd rather at least have support for it. As such, I coded a few sorting algorithms up for different data sets. More on what I've expanded to later though.

The mathematics library was planned to contain four primary sections: 


  • Polynomials
  • Vectors
  • Matrices
  • Noise

The Polynomials section will provide the ability to create, modify, and evaluate polynomials. I have not started this section yet, nor thought too much on it.

The Vectors section will provide support for 2-, 3-, and n- dimensional vectors, and the operations that can be performed on them. This is the section that has received the most work. It's far from complete, but supports most basic vector operations, sans products. I already had a class coded for this, but it's been redone for these equivalents, along with refinement, and expansions of it's feature set. The reasoning behind providing support for 2-, and 3- dimensional vectors specifically is that certain optimizations can be made knowing the dimension number that can't with an n-dimensional one. This might not typically matter, but given how many things can be going on in games, it can matter rather much.

The Matrices section will provide support for n*m matrices, and operations performed on them. I haven't thought too far on this. I attempted to learn some linear algebra a while ago, but wasn't able to afford it enough time and attention. I hope to figure out enough to get some useful work done here, as I know matrices are very useful to game programming.

The Noise section will provide alternatives to the core library's pseudo-random number generation code, as well as expanding it to support generation of smoothed, and Perlin noise. I've done a little work on this section, in that I already had a Java.util.Random subclass alternative.

As far as the distractions well, some custom collections, and some functions basically make it up.

Moving on, yesterday I decided to make a simple 2D game. Something basic, but robust, and enjoyable, to shake off the rust, as it's been a while. I tend to avoid them, as, quite frankly, I hate handling the rendering code. There are other parts I dislike, but that's the main one. I didn't actually get around to making a game, but I did code up a Renderer object to handle that stuff internally. The version I made was pretty basic, but I'm rather happy with it for a first attempt. I managed to get 400-450 FPS when not restricting it, and having a single rectangle randomly moving around the screen. With 1200 rectangles, I was still getting around 40 FPS. I'll have to do better testing to compare with later versions, but for now that's a good idea, I feel. Additionally, the most interesting feature is it supports n-layer rendering, allowing for as many layers as needed for the game.

Note: I list things like FPS, times, etc., not for comparison with others, or on different machines. I use it for comparison between things I've coded on the same machine, under similar running conditions, to give a sense of how they are performing in relation to each other.

Now that I've stated what I've been doing, I can start discussing my work as I do it. Thanks for reading.

No comments:

Post a Comment