A couple of weeks ago I created a basic rope physics system anticipating my group would be working on our Diamond Theif idea. However I arrived late to find that we were working on the Glider game. This week, while most of the team worked on Sprouter, a few members broke off to work on the Diamond Theif game, making use of my rope system to power the core mechanic.
The rope was made by using Character Joints in unity to connect segments composed of capsules. The first capsule is made a kinematic to anchor the rope. Following rope sections are hooked up to the section proceeding it using the character joint.
Note: You’ll need the unity web player.
Use the A and D keys to avoid the traps as you are lowered down to the diamond. Try and collect coins on your way down.
I spent this week working on a game called Sprouter. The idea is that you guide a seed from sprouting into a full-grown tree, controlling the growth of branches and roots and interacting with the surrounding environment.
One of the artists developed the following presentation introducing the game:
The prototype ended up quite different from the gameplay in the presentation. The problem was we (the programmers) could not work out to program the tree growth mechanic in unity in the 2 days available to us. In the end we created a system where you pressed a button on the seed or existing branch/root to create a new branch/root, you could then adjust its rotation as desired. Suffice to say this was a little forced and did not really capture the relaxed gameplay style we were after.
We discussed the idea of having a game menu based on the seeds in an existing tree. You would start a new game by clicking on one of the seeds, at which point it would fall off starting a mini game where you had to land the seed in the best possible spot for future growth. the prototype includes a short scene demoing this idea.
In the first scene you can use the W and S keys to control the height of the seed. It doesn’t really matter what you do here, as soon as the seed hits the ground you’ll begin the game proper.
In the second scene you’ll need to grow roots to get water and minerials and branches to convert water to energy. Make sure you start by building at least one branch and one root.
To build a branch or root click and hold one of the tan buttons on the seed. While still holding use the Q and W keys to rotate the branch/root to the desired angle.
If you get stuck you can use the IOP keys to cheat.
The second prototype we developed was based on a skydiver in a wing suite, like this:
Pretty self explanatory really.
We had some trouble developing a functional movement system for this prototype. We tired applying a constant force and directly translating the player based on user input, however this didn’t feel right and allowed the player to go anywhere. the final system in the prototype is a monstrosity involving hooking the player up to two invisible games objects moving ‘on rails’ using springs (horrible!). The result was slow and sluggish, It didn’t feel like you were skydiving at all.
Flick Hazard was an idea devised by one of my group members while stewing over some of our game ideas from the first week of this Prototyping assignment. The basic premise is that you are a baby in a runaway pram going wildly down the street. The player has no control over the pram, instead they flick potential Hazards (cars, trucks, etc.) out of the way.
The game would targeted at mobile platforms (phone/tablet) using touch for the flicks.
I’ve always know that Lambdas existed and had some idea as to what they were (inline functions right?); but I never really bothered to learn how to use them (and the few times I came across them i had no idea what I was looking at). It wasn’t until recently, while reading about the new c++11 features, that I finally came to understand what they are and how to use them. With my more recent discovery that (unlike most new c++11 features) they can be used in Visual Studio 2010 I thought I’d share my new insight.
Because it took me a while to get my head around them I’ve tried to make this explanation as simple as possible so a relative newcomer to c++ can understand them. However I will point out that if you don’t know what function pointers are and how to use them your going to struggle with the lambdas.
Update: Full source code for Visual Studio 2013 can be found here.
GLFW3, the successor to the popular GLFW2 cross-platform window management framework is nearing release. Update: GLFW3 was release some time ago now. Among it’s new features is support for multiple windows (each with a separate OpenGL context). Seeing this i decided to give it a go.
The Goal is to draw the same scene to two different windows, giving each window a separate camera so they can see the scene from different angles. for the demo we’ll use a simple rotating quad as the “scene”.
Using multiple windows involves solving several challenges, including:
Tracking which OpenGL Context is active.
Sharing Data between the different OpenGl Contexts (and therefor Window).
Being able to re-size each window individually and have the correct OpenGL Context update.
I’ve been curious for a while now about the performance of the MS for each C++ extension compared to the traditional for loop. So a couple of weeks ago I dug up and old performance testing framework I’d put together and found out for myself.
The Framework works by running a specified piece of code (using a function pointer) a specified number of times. It uses Microsoft’s Query Performance Counter (QPC) to time the code each run and reports the average time as well as some other stats. I used it to run a number of different For and For each loops on the same data/container to see which one performs best. A reset function can be specified and used to reset data between each test run. The Full framework used can be found Here. Continue reading For vs For Each→
To get things started I thought I’d post some information I promised a friend on easy multi-threading techniques in C#/.Net.
First trick is to use the Parrallel Class. This is a new addition in .Net 4.0 that provides version of for and foreach that will automatically split up the loop to run across multiple threads, depending on how many cores the System CPU has and how much load each core is under (this can be controlled too, if need be).
The other is Background Workers. Background workers are best used for slow jobs that might cause the UI to lock up (such as long file IO operations). A Background worker runs whatever task you give it on a separate thread, preventing the UI from locking up and allowing the user to do other thing while they wait for it to complete. The background worker provides a series of events for monitoring its progress.
Hope you find these useful in your future .Net projects.