I’m busy….

Right now I’m pretty busy writing a report about our specialization projects, that i will hand in on friday.

I have been working on the AI for the sentry gun, including some basic prediction of movement, but I still have a few hours ahead of me working on filtering motion rectangles, creating new targets and applying new motion to existing targets.

I just posted a picture of the disassembled airsoft rifle that is going to be mounted on the sentry. I hope i will be able to get it mounted before the 25th, where we will be presenting our projects for our teachers.

I most likely will not be able to finish the project before handing in the report, but i should be able to finish it before the presentations.

0 notes

This is a aluminum gearbox, with a bunch of gears, some wires, a relay, a motor, and a laser sight.
The spring, which is the part deciding the muzzle velocity of the gun, is a tad too strong. Currently it creates a lot of vibrations, but that should decrease by hopefully a reasonable amount when I open it up and swap it with another.

This is a aluminum gearbox, with a bunch of gears, some wires, a relay, a motor, and a laser sight.

The spring, which is the part deciding the muzzle velocity of the gun, is a tad too strong. Currently it creates a lot of vibrations, but that should decrease by hopefully a reasonable amount when I open it up and swap it with another.

0 notes

This is what the XNA game i’m working on looks like.It’s a single player top down tanks game.
Currently I am working on making the tank move correctly.The way it should move is that it’s given a direction, from the arrow keys, then it should rotate to that direction before starting to move.
The difficult thing about that is that it shouldn’t have a front or a back, like if i press up, it will move upwards, and if i press down, it will move down, but if i press left, it will rotate 90 degree and then move left.
I have been trying to make this game a few times before, but this tank rotation thingy is always the thing messing with my head, I am really counting on figuring it out this time though :)
One of the other things i’m trying to figure out, is how to mix 2D and 3D.The dots between the two tanks on the image is the tracks from the green tank. Beside not being rotated correctly, they are on top of everything else.Currently i’m thinking about placing a quad / plane in the 3D world, and then draw the texture on that instead. A quad / plane is a rectangle with no dimensions, as i only need one side, the one on which to draw the texture.
If there is one thing i find annoying and confusing in XNA / game development, it’s the different units and ways of expressing angles etc. Spent a good deal of time yeaterday trying to work out the tank rotation, only to find out in the end that the angle which i was using was not 0-360, instead it was -180 to 180 - much like radians. At that point i had deleted all the code since it wasn’t working…. But maybe it was?
Damn angles.
Next is collision detection, bullets, better lighting, explosions etc.

This is what the XNA game i’m working on looks like.
It’s a single player top down tanks game.

Currently I am working on making the tank move correctly.
The way it should move is that it’s given a direction, from the arrow keys, then it should rotate to that direction before starting to move.

The difficult thing about that is that it shouldn’t have a front or a back, like if i press up, it will move upwards, and if i press down, it will move down, but if i press left, it will rotate 90 degree and then move left.

I have been trying to make this game a few times before, but this tank rotation thingy is always the thing messing with my head, I am really counting on figuring it out this time though :)

One of the other things i’m trying to figure out, is how to mix 2D and 3D.
The dots between the two tanks on the image is the tracks from the green tank. Beside not being rotated correctly, they are on top of everything else.
Currently i’m thinking about placing a quad / plane in the 3D world, and then draw the texture on that instead. A quad / plane is a rectangle with no dimensions, as i only need one side, the one on which to draw the texture.

If there is one thing i find annoying and confusing in XNA / game development, it’s the different units and ways of expressing angles etc. Spent a good deal of time yeaterday trying to work out the tank rotation, only to find out in the end that the angle which i was using was not 0-360, instead it was -180 to 180 - much like radians. At that point i had deleted all the code since it wasn’t working…. But maybe it was?

Damn angles.

Next is collision detection, bullets, better lighting, explosions etc.

0 notes

This is how my mandatory android application ended up looking.

It is implemented using an AsyncTask that handles retrieveing the xml weather data from the unofficial google weather api, and displaying the updated information in the UI.
A nice progressbar is shown when the app is updating.

The code was pretty straight forward, i really like android dev, except the whole “java-deal” ;) I spent quite a bit of time working on the xml layout, it just wouldn’t seem to do as i wanted it to. In the end i discovered that most of the xml i wrote was correct, the issue was that it didn’t want to display it correct. That is untill i set the properties using code instead of xml.

Then it worked as a charm :)

0 notes

Quick summary of android, xna and sentry gun stuff

Android
We currently have a small project going, a weather app fetching xml data on some webservice.

I decided to use a SAX parser, since it’s pretty damn quick and simple at the same time. Basicly you write a class that’s custom made for some specific XML scheme.

I made a model class that contains fields for all the info i get back from the webservice.
And then i used that model class to store the info that i got from the xml response.

Next up is some more playing around with Intents, activites and the styling.

XNA
I decided to scrap the 2D stuff, and go with something 3D instead.
I am creating a “Wii Tanks” clone, which is a top down tank game.

I want to replicate the feeling and the graphics of the game, so i spent quite a bit of time figuring out how to do that, and our teacher came up with the solution, which was using ortographic projection, together with rotating the camera around 30 degree. That nailed it pretty good.

After getting annoyed at all the 2D game engine classes i created a long time ago, I created a new XNA project and moved only the most important stuff. Hell, i made the other crap before, so I can do it again.

I really hope i will make it far enough to start working on the AI in the enemy tanks, the wii game has some pretty damn cool enemies. Which i by the way will never be able to replicate fully or even just a little. But I’m looking forward to trying :)

Sentry
I had a quick meeting with my supervisor yesterday, and it turns out that he knows a ton about cameras, which is pretty cool, since my project relies pretty heavily on a good framerate etc. After speaking to him i got quite a few new ideas. 

I spent the last few days working on the architecture of my application. My delete button was red-hot, I have a bad case of “premature optimization”, which is exactly what it sounds like. I keep thinking that “this should take this and that into consideration, and what if.. bla bla.”. Sometimes i know when to stop, but other times i just keep going, until it’s too big and complicated for me to keep it in my head.

Thank god god made the delete button!

Currently I’m working on a small polling thread that updates info about the servo positions and targets in my application.

And after that i will start looking into the main “brain” of the sentry.
I’m looking to make it as intelligent as possible, but currently my mind is in “simple” mode, which means i can (hopefully) get shit done :)

Oh, and I’m really glad that i signed up for the Android sessions, instead of creating my own list of resources and studying at home. Once or twice *cough* I have had trouble getting motivated when at home.

Notes

Game development: xna and unity introduction

We got a quick introduction to XNS and Unity. In both engines/frameworks we created a simple 3D scene.

After the introductions was over, we sat down in groups and started playing around with xna and unity.

We decided to try and make a basic platform game with pixel based colission detection.

After a few hours we got a small very simple prototype done :)

Notes

Game Development Recap

We have spent some time figuring out what sort of game we want to develop, while doing so we used a few different techniques to help us sort of decipher what makes a good game.

That was done by each student listing three games they really like playing, and then trying to figure out why they play those games.
Developing the actual game is hard, but developing the game concept, the reason for people to play the game is REALLY hard.

Half through the day we had a note with three game ideas, and now we had to add some details to the game, like why, how, where and by who. Which i had a really hard time doing, because two of my ideas was missing the basic game concept, i still havent decided which one i want to keep working on, but i will probably end up working on two of the ideas.

The ideas i ended up with is

  • Tanks
  • “Build something”
  • Obstacle course (platformer)

I will probably ditch the obstacle course one, and then try to see if i can work up a concept for the “build something” idea.
I will use XNA for development, but currently i haven’t really figured out if i want to do a desktop game for windows, or a mobile game for WP7.

The programming is pretty much the same, so i should be able to change my mind a few times before deciding final.

0 notes

Specialization Courses

I changed my mind. Instead of only attending the game development course, i also joined the android course, so i don’t have to spend too much time at home, which tends to kill all my motivation.

I also just really wanted to learn some more about android development. I mean, it would be dumb not to take the oppertunity to learn it. Just look at the current android marketshare, it’s HUGE!

Which means that i’m currently attending two courses, game and android development.

This blog will from now on also function as a diary of what i have been doing and what i have been learning in those courses :)

Notes

Motion capture performance and vibrations in rig

Motion capture

I tested the algorithms with the PS3 Eye camera, but unfortunately the algorithms are pretty slow, and it is still missing a lot of calculations, though i think i may try to do implement that using some kind of threading, perhaps producer consumer.

I don’t remember the data, but at first with some very basic calculations it was pretty good, like 10 ms per frame, but as soon as i plugged one of the AForge background motion detectors on it, the processing time per frame rose to what should be around 34 frames per second,which is still good, but i was hoping for a bit more.

I plan on spending some time on making another background detector, a more lightweight simplier one. But the one used right now got some really awesome code, so i guess my only option is to simplify and remove features..

I plan on trying out a more powerful laptop or even a ordinary tower, and i’m pretty excited to see how much it will improve.

Vibrations / Rig

A thing that has been on my mind for a while is vibrations…
The rifle that’s going to be mounted on top of the rig will produce some vibrations, the rig should handle it fine, but the camera and the algorithm will probably not be as forgiving. Motion is implemented as pixels in the image, changing color, so if the camera is shaking, either when firering the “dispenser” or by operating the servos, it will detect the whole frame as motion.

I should be able to (partially) solve that problem by somehow reducing the vibrations transferred from the rifle, by removeing weight and mounting using some vibration absorbing material. And in the algorithm i could make it “take a break” if every pixel changes.
But at the same time i don’t want to paralyze it when ever vibrations happen.

The last thing i can think of is mounting the camera on a seperate rig or something, But that makes calibrating the sentry a pain.

Algorithm wise, i may try to fiddle a bit with C++ since it seems QUITE a lot faster :)

I will be attending the Android course too, considering the current android market share :)
I have some trouble motivating myself sometimes, so i fear that i may just get right about nothing done if i spend too much time at home.

Oh yeah, i almost forgot.
The servo controller has a nice feature called acceleration, that should greately increase the lifespan of the plastic gears and servos. While also decreasing the vibrations and shaking when operating the servos.

Currently i have a kinda old 6 volt battery connected, but the servos i use can take as much as 7.2 volt, and i’m pretty sure that without the accelleration feature, the servos would smash the plastic gears in the first second of testing it :)

After all, combining the forces of those two bad boys would almost be enough to carry me.. (75 kg)

The 50-60 spelling mistakes are inserted on purpose, i dare you to find them (and tell me where they are)

0 notes

The django book 2.0 on my kindle :) (Taken with picplz.)

The django book 2.0 on my kindle :) (Taken with picplz.)

0 notes