Flocking…sigh

This is one of those tasks that I really had to push myself to get done. I just wasn’t enjoying it much, and there were a few reasons for that. We will look at those throughout this blog.

The task was to take a flocking simulation supplied by Steve (one of our lecturers) and then optimise it, add features, make is usable by a designer and then display data. It was a task that spanned a couple of weeks.

The first stage of the project: Optimising. This is one of my least favourite things to do when it comes to programming. It’s even harder when it’s not your own code. The first thing I noticed when I opened this project was how confusing everything looked. The code seemed so much more advanced compared to mine. Fancy C++11 stuff, Macros etc. It was difficult to read, difficult to comprehend and difficult to work out how and where everything communicated. Most of the time I spent on this step was trying to work out what the actual hell was going on. I did some small optimisations such as adding multithreading to the update, cached some variables and tried a quad tree.

Once that stage was over, we got to do something a little more interesting to me. We had to make the simulation’s variable tweakable in some way so designers could use it and tweak variables until they get the desired effect. Origionally my plan was to make a GUI for the user’s to use, and I even did a mockup:

FlockingSimGUI

 

However, in the end I couldn’t get TGUI working due to having outdated versions of SFML from the framework and them not supplying older versions of TGUI. So I swapped to a spreadsheet. The spreadsheet had all the variable to be tweaked, I added rules to it so invalid data couldn’t be entered, and then added a Save button which saves it out to CSV to be read straight into the flocking sim. Then I wrote a CSV parser for it in the flocking sim and then that step was done. I am a little dissapointed I couldn’t get that GUI going, but I already wasted too much time on it so I had to make the decision to just go with a spreadsheet. At least my next step worked out how I wanted it to.

To display the data, I wanted to trying one of those graphing programs. I have heard of R before, but then I got told about processing. I wrote a whole blog on this process further down, so I won’t go into too much detail here. This was my favourite step as I got to test out two new languages and do something that I have never done before.

Overall, I am glad that the project is over and I put a lot of effort in, but I am a little unsatisfied with the task as a whole. I found it hard to get motivated to do the optimising as I really don’t enjoy it, but the rest of the project was ok. I’m glad I did it in the end though as I got to look at using R and Processing, which I really enjoyed.

You will not be able to build this project as it uses a framework supplied by Greg (Another Lecturer) and is not publically available.

https://github.com/Silcoish/studio3flocking

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s