Wednesday, 16 May 2012

So, I haven't blogged for the last few months...

I have, however:

Rewritten most of the game code, improving nearly every bit in some way. It now loads faster, handles materials sensibly, is more flexible in general, handles physics meshes, and has consistent units and standards. Still needs light, improvements to the character controller, AI, load manager, region format, and sound spatialisation.

Almost finished the moped:
It just needs a couple of changes to the loom/code/variator to increase the top speed, a bigger battery set with 12v module, speedo calibration and bodywork replacement.

Printed ABS and PLA (to some standard, anyway - I need to improve X tension, reduce wobble, heat the bed better and improve extruder calibration, but I've had some strong, if ugly and dimensionally-dubious prints. It doesn't really cope with circles yet, but that can all be tuned.


Seen some cool stuff:



I've just entered exam season once again, so this post will likely be a one-off until the summer.

Charlie.

Monday, 16 January 2012

Physics

There are 1002 balls in that picture. Feel free to count, I checked.
Revision was *so* interesting that I took some time out to make that. Still not handling rotation, input or meshes yet (hence spheres, only bouncing vertically).

Next week's post will probably be non-existent, given that I will have 4 exams in as many days.

Charlie

Monday, 9 January 2012

One Year

It's been about a year now since I started blogging every week - I'm not sure yet, but it might be a good time to take a break, at least until exams are over.

In this time, I've:

  • Applied to University
  • All but finished a 3D printer
  • Learned about, written the sframework and renderer for a game engine
  • Taken my AS-level exams and the DT A2 exam
  • Torn down and bought the parts for an electric moped
  • Helped shoot much of Yaseen's film
  • Obtained the electronics and most of the physical parts for the quadrotor

So it's been pretty productive. Maybe this year I'll actually finish some more of these projects though!
Charlie

Monday, 2 January 2012

Skeletons loaded!

So, I worked on skeletal animation and audio with varying degrees of success. Below is my second attempt (the intended model is shown somewhere below - it's a Hellknight from Doom):

Not as beefy as the designers intended...?

Which, whilst bad, isn't as awful as my first attempt:

Aforementioned first attempt. Don't laugh...

Whilst it was looking almost humanoid, clearly something wasn't quite right. Since an unfortunate number of points were getting crushed towards the centre, and the head was the worst-affected, I thought it might be due to my rotation code. After disabling that and changing the direction in which the model is "wound" (clockwise vs anti-clockwise winding of points on the faces), I had the following:

Ugly but better...

Finally realising a couple of pathetically silly mistakes (the transformed points being in the order w,x,y,z but instead using w, x,y and throwing away the z component, explaining the x-crushing, and doing the multiplications in reverse order), I was able to get the following:

Success...
The edges of each skeleton are fuzzed because, like nearly everything, my anti-aliasing is now in a buggy, ghostly half-finished state (which is good - bug-hunting is much more fun and satisfying than writing from scratch, and jaggies are worse than the ghosting). The balls in the scenes (around the feet) are some more testing code I couldn't be bothered to switch off - they're sound emitters, moving around the scene emitting sound, as you might expect a sound emitter to do. I'm not going to spend any more time on skeletons until time management is done better, so that it'll know what frame and sub-frame of animation to play.

I've also changed how lighting attenuation functions - now, an artist can define how lights fall off with distance. The next thing on the list is physics - I've had some basic motion working in the engine but it's still very, very broken at the moment.

Progress list: 

Still not started ,or architected terribly and completely broken
  • Physics/game logic/scene management/trees
  • Shadowing
  • Skybox and Water shaders.
  • HUD
  • Environment mapping
Partially broken or significant work needed:
  • Audio, particularly spatial and streaming
  • Speed of lighting, especially stencilling ops - avoid them using FragCoord, minimise calculations wherever possible.
  • Skeleton interpolation
  • Intersection
  • Resource/update/download/network management
To improve:
  • Antialiasing
  • Time manager
  • Light equation/materials/BDRF used 
  • Input and key binding (ties in with game logic)
To touch up:
  • Model Format/Optimisation
Of those, gameplay, physics, skeleton and sound are all that still need work before the game is playable for development purposes. If people are willing to play audio-less with a ball for a character, it's almost playable right now - as soon as I sort the physics problems I've been having, I'll have a controllable ball interacting with the world.

Charlie

Monday, 26 December 2011

Not Skeletal Animation

The set of points from last week were the raw data of the "skeleton" of a Hellknight from Doom 3 - I'd intended to have skeletal animation at least somewhat working by today. No such luck, though I did fix the final issues of native library loading - it can now manage its own native code entirely, after adapting to some updates to JOGL, with a patch to skip over the part that my code already handles.

On the 3D printer, I added the Y-endstops (both home and end), and calibrated and tidied the wiring almost completely. All that remains before actually printing parts now is the X-axis belt and endstop setup (and using a spirit level to re-level the machine). A heated bed might be necessary to get the best-quality prints, though I'll see how it performs without first.

The motor for my moped arrived, too...
Finally, if you haven't already got it, there's possibly still time to pick up a copy of the Humble Indie Bundle (4) - pay what you want for some pretty awesome games (probably most notably, Super Meat Boy and Shank, both of which are gore-intense but brilliant games).

Charlie

Monday, 19 December 2011

Big steps

So, I've made some pretty big leaps forward in the game programming: 

First half of edge detection
For the anti-aliasing, I decided to use a method pretty much exactly as used in STALKER - so far, it's only detecting edges via the surface normals, but soon it'll also use the depth buffer, to ensure that all the edges are "caught" (look at the pot on the left - its edge hasn't been detected because the change in surface direction between the two surfaces isn't great enough. Once all the edges have been detected, it's a simple and quick step to blur them and so cheaply "fix" aliasing.

This step is a post-processing step, as is SSAO. I've also started to implement SSAO, though it needs configuring for the scene, and the blurring step is still not yet complete - it has to take into account depth, or the shadows will "bleed" onto bits they shouldn't. The final steps are exposure and colour correction - colour correction I've already done, but in lower-quality versions, and exposure is still in the works (fixed exposure only works at the moment).

I also wrote most of the intersection tests, which are going to form a fairly important part of the physics system, level layout and rendering optimisations. The overall plan is that every object in the world will be given a "bounding box", and quickly checked against the feature in question (for example, for checking if an object is visible, it's checked against the viewing frustrum, or for physics, a ray representing the motion of an object can be checked against anything it's likely to collide with). This can be optimised by including all objects in a "tree" of bounding boxes, where each bounding box node completely contains all of its children, so if the parent is outside the area in question,all of its children can be quickly eliminated.

The framework for a download and resource manager have been started - allowing files to be queued and made to download or update, and for resources no longer visible to be unloaded completely to save graphics memory.

I also tidied up the controller code somewhat for Windows - it can now get the proper analog values, and detect the type of controller and battery level (and interestingly, also the type of battery in the controller) of Xbox controllers. Almost completely pointless but cool nonetheless.

Finally, a teaser, most likely for next time:
No clues as to what this is for yet, but it should be interesting...

14500+ lines of code now, 333 TODOs listed.
Charlie

Monday, 12 December 2011

XInput

 So, I spent far too long working on getting the Xbox controller working - instead of using their standard input libraries, Microsoft in their infinite wisdom chose to make a separate API for the sole purpose of interfacing with their controllers. As a result, I ended up downloading a C++ IDE, and using Java's native code to work with those APIs. On the plus side, it means that the vibrate and separate polling of the triggers can be done (using the previous method, only Trigger (R-L) can be read not R and L separately) , but under Windows only.

Other than that, I tidied up the native code loading further - it now "cleanly" loads nearly all of the dlls or modules needed to run independent of platform and architecture (I still have to fix nativewindow though). Lights are now configurable in the engine rather than hard-coded into the shader (simple change but an important step), and I've started to write the basic game code/world itself.

Stuff I still need to do:

  • Intersection tests/resolver for physics, area scripting for levels
  • Scene optimisation
  • Decent gameplay code
  • Improve the importer (bring lighting, more material properties in)
  • Finish lighting optimisation - actually do the stencilling - additionally, light clip volumes
  • Antialiasing
  • Shadowing
  • Audio


Charlie