Sunday, 21 November 2010

Updated SgMotion for Sunburn 2.0.6

SgMotion v1.2 for Sunburn 2.0.6 is now available on Codeplex!

Mostly changes to the Sample and removed some older unused classes that were causing trouble with the new XNA 4.0

The PlayerMarine.fbx class seems to loose his Animation clips in XNA 4.0 for an unknown reason. I have tested this issue with some of my own animated models, and they still work fine (using KW-Xport)

If you run into similar issues with your own models, I added a small *.xml file that demonstrates a quick way to split the model into custom animation clips (Note, default clip name in .fbx model is "Take 001")


Tuesday, 2 November 2010

Project Sunburn: AI-Subsystem (First Dronetype & AI-Manager)

We completed our first playable prototype yesterday, and it includes AI! This was the first time I worked on game AI, previous games like Needle Juice and Over Night did not include any form of AI. Luckily our enemies are robotic, not human. It's a lot easier to create a believable drone that in-fact should act as if it's programmed compared to a humanoid character running around trying to act as a sentient being. So far the main drone class, the Spider-Drone, has been implemented and is strolling around in our game. Other drone types (including flying drones) will be added later in phase 2. (started yesterday) Below I wrote a very short summary of certain AI aspects that I included so far.

A lot of the info a drone requires is processed in a global manager class. This makes it easier to spread the workload across multiple frames, avoiding frame drops. One example is the Link Availability, testing the links against active drones in the level, blocking a certain link if a drone is not moving (shooting or idle), and therefore blocking that path. This avoids unnecessary navigation errors when drones try to reach the player.

Red lines indicate the path is blocked...

Another task that is handled by the AI-Manager is tagging waypoints as cover. As certain drone variations will hide behind cover to deploy their weaponry. These kind of non critical components are updated on low frequencies to safe CPU-cycles. In addition, only waypoints near the player can be tagged as potential cover.

The Yellow waypoints are tagged as "Cover"

All drones have some kind of weaponry to use against the player. Our first drone has a light machine gun, firing short bursts of bullets. Their weapons work very similar to the player weapons, so it was easy to setup. The turret tries to maintain a solid aim at the player (limited by its rotation speed) and fires bullet salvo's while trying while trying to get closer. In addition, the lens in front, can be destroyed by a single well-aimed shot. This basically counts as a headshot and immediately disables the drone.

These are some of the highlights currently implemented as part of the AI-Subsystem. In the upcoming phase I will spend more time optimizing the current manager, add air-drones, improve path-finding and improving overall behavior of the drones.

Wednesday, 13 October 2010

Post-Process: Motion-Blur Effect

A simple Motion-Blur post-process based on the GPU Gems 3 article.

Editor Update: Clone-tool with ClonePreviewer

You can simply drag your clone to the desired location while using the scroll-wheel to determine the amount of clones you like. The process is finalized by pressing the Enter key.

The preview models share the same instance of the source model, rendered with an offset for each clone. The translation is snapped to the current grid size, alternatively you can use precision-mode (Shift) to fine-tune your clone-offset. Works with any type of placeable entities, however entities without a model (particles etc.) use simple boundingboxes/icons to show their destination. This may change in the future, where even particles may be fully rendered while previewing.

Tuesday, 12 October 2010

Creating Line-based Animations with the SketchTool

A Proof of Concept to animate objects, particles and lights using the Sketch tool.

The position and normal (of the colliding triangle) and stored and converted to an animation file (shared with the already built-in Animation Editor). These can be plugged into any script to easily animate objects, lights or particles in the environment.

Sunday, 10 October 2010

Effortless Waypoint & Path creation using 3D-Sketching

About 3 weeks ago, I demonstrated the Sketching in 3D Tool. Today I went a little further and expanded it to be able to create waypoints and paths for our upcoming levels without effort. Manually placing waypoints can be a tedious task, especially if your level is continuously changing in its early stages. With this new Tool we'll be able to create full AI paths in seconds, with easy tweaking after the initial waypoints are setup.


Currently there are two types of lines. WaypointLines and AvoidanceLines, the latter is used to state certain parts should simply be avoided by the AI or to break paths that are too close to geometry or ledges.

Monday, 27 September 2010

Triangle-precision ray collision

Bullet collision was previously calculated using the triangle mesh capabilities of BEPU. This wasn't going to work efficiently with all the separate meshes that are going to be used in our levels. With the basics of triangle-picking already implemented in the editor tools it didn't take a lot of time to get a basic prototype up and running. In the image below you can see the new filtering algorithm.

each "group" (1 big sphere, 8 small ones) contain 41k polygons. (click image to read the text)

In a regular scene with a higher amount of objects with lower polygons per mesh that are spread across the scene, the optimization methods will become more efficient. This will be tested once the prototype level is complete.
The main focus of the new filtering system is excluding hidden models before they enter into the per-triangle collision check. This system is added on top of the bounding-sphere filter that was already present in the editor tool.


Overkill? 150 million triangles both rendered and tested against the bullet ray. This clearly wasn't going to run smoothly (roughly 0.1 fps)

Video:
(use 720p and fullscreen to read the filtering info in the topleft corner)