Here are three blog posts I wrote on the University of Edinburgh Insect Robotics Group blog that describe in detail how I made RoboAnt.
Android & Arduino Unite
It was a day like any other when my Honours Project supervisor told me he has a surprise for me. Continue reading
Hunt
My game now has a testing community on G+ – https://plus.google.com/u/0/communities/115908782160411367455
Join it to download the latest version. It’s still in early alpha but already playable. I want to see that my graphics engine runs fine on various devices. So please join in to see how Hunt evolve.
TheHunt mutates!
Those who follow my github (I know there aren’t many of you ;-)) already know about the exciting changes in TheHunt the past few weeks. For everyone else – listen up!
Firstly, zooming in and out! Works well and intuitive (made me realize the default world size is not so big…)
Secondly, the palette I promised a while ago is finally here. While it doesn’t impress with looks, the functionality is so so useful! Let me tell you – every time you touch the screen the palette appears instantaneously, allowing the quick change of tools. What if you want to use your tool instead? All is good, just drag outside the boundaries of the palette and it disappears, letting you either finish a net or cut something.
And last but not least, the Prey started to evolve! The evolution system I came up with is:
- Prey body is divided into body parts – currently Head, Body and Tail. They are pretty much independent and only need to know the points where they bind with their surrounding body parts
- This gives them freedom to evolve independently as well. Head, for example, starts off without eyes or ears (or whatever fish have that lets them hear) and has two mutations – eyes (eyes appear on the graphic and allow it to see Algae in the front) and hearing (head gets bigger, prey runs away from ploks!)
- Currently all mutations happen at random and have a chance to happen on death and on GM food eaten
I’m excited that TheHunt begins to look much more like a game now! I’m going to be back soon with more mutations ^_^
TheHunt – making progress!
The past month has been really exciting for me – please excuse my absence, but in my defense, I found an internship for the summer! Has to do with Android and security – two of the things that excite me, so I’m happy ^_^
Now on the topic – TheHunt got three cool improvements:
- A Knife tool! Still haven’t made the cool contextual menu, but a long click now switches between Net and Knife. What does Knife do? Let me show you:
- Prey now actually chases after user-generated food with priority – this makes the idea of feeding the fish to lure it out of algae and catch it much more feasible!
- The Net tool now interacts with the environment better and catches algae and food in it’s range. This changes the way score is calculated a bit – 10 points for a Prey, -1 points * size for Algae and -1 point for Food caught (tentative)
Finally, a playable TheHunt! But this is only the beginning. Coming soon:
- Prey has 3 states, the way it currently is and 2 upgrades. The states change the Prey’s appearance and intelligence, and the Prey upgrades state when it eats a food from the player (explanation is, the food is GMO) and returns to normal state once caught. This way, the more you feed the fish without catching it, the more difficult it gets to catch it. Yay!
- Zoom in/out controls, finally
- Some animations to make it look fancier – algae shiver, GMO food shines
Once this is done, TheHunt will be much closer to release! As always, please let me know if you have cool ideas or don’t like mine – now is the best time to change stuff!
TheHunt – The Future
Recently I was struck by a few nice ideas about TheHunt and I’m in a hurry to write them down. Here we go:
- Knife tool. Been thinking for a while how to deal with fish hiding in a huge algae and now I think I figured it out – using the knife to cut the big into small ones. Should be easy to implement, I give it half a week.
- Contextual menu on long-click. Long press somewhere, you get a nice pop-up menu where you can change tools, maybe request info about the object picked and other undecided stuff. Navigate in it without releasing the press. Can be tricky, I give it a week.
- Simplified interface. Just one number in the top middle, showing score. Long press for a menu, maybe pop-ups with more information if needed. After contextual menu is implemented, only pop-ups will be missing.
- Nicer font. I will experiment, but I’m thinking of something that looks hand-drawn. Easy to implement, but may require some time to find a proper font. I give it a day.
A quick concept to show the simplified interface and the contextual menu (didn’t include the knife and the nicer font)
In a week or two I hope to have made a visible progress towards a more playable TheHunt!
Rendering Text in OpenGL 2.0 ES on Android
Hello all,
I have just finished porting fractious’s Rendering Text in OpenGL on Android to OpenGL ES 2.0 (this is the mobile version of OpenGL 3.0 and the main difference with the older versions OpenGL is having acces to the shaders, which allow us to run code on the GPU).
I had to do this because my project TheHunt uses, you guessed it, the newer version. Reason is that it would allow me to do some nifty shader tricks… some day 🙂
So here is my code – https://github.com/d3kod/Texample2. Feel free to use it for whatever you want as it is licensed under the CC0 1.0 public domain license.
Some implementation details:
- I firstly started by simply converting the OpenGL ES 1 commands to the newer version. The Model, View and Projection matrices were passed using a uniform variable to the shaders, i.e. all the letters used the same matrices. This was good enough to produce horizontal text
- In TheHunt I use text to label events (fishbone flops, net snatches), and I need this text to be tilted (it would be somewhat boring otherwise). For this I needed to be able to assign individual model matrices to each word. A bit tricky, but using Sprite Batching in OpenGL ES 2.0 | Anton Holmquist as inspiration I managed to do it. In short, instead of an uniform Model-View-Projection matrix, the vertex shader has an uniform array of matrices. I fill this array with an individual matrix for each letter and also pass a matrix index attribute for each vertex (the exact same method suggested by Anton Holmquist.) The result is that each GLText::draw call can tilt the string drawn with a certain angle (it can now receive an angle argument, in degrees).
- The last catch was drawing color text – at first, all text was coming out black for me. The reason turns out to be that the texture is defined as grayscale, so in the fragment shader we need to multiply the color we want for the text (passed as uniform u_Color) with the grayscale value (called W in OpenGL) of the texture (not with the whole texture color, because it is something like [0, 0, 0, grayscale] which was resulting in the all black text):
gl_FragColor = texture2D(u_Texture, v_TexCoordinate).w * u_Color
— from BatchTextProgram.java
That’s all I can think of, and the result is efficient text drawing in OpenGL ES 2.0, and more importantly in TheHunt, where you can expect a nice GUI to appear soon!
On human nature and technology
Hey!
Today, I looked at my flatmate – crouched over his laptop, phased out into the digital dimension and busy with work. “I probably look exactly like him” – my first thought was. Suddenly, I remembered something I read on the topic of embodiment:
“The environment is part of the cognitive system. The information flow between mind and world is so dense and continuous that, for scientists studying the nature of cognitive activity, the mind alone is not a meaningful unit of analysis.” This statement means that the production of cognitive activity does not come from the mind alone, but rather is a mixture of the mind and the environmental situation that we are in. These interactions become part of our cognitive systems. Our thinking, decision-making, and future are all impacted by our environmental situations.
Basically, what I get from this wiki article is that humans see the world as an extension of themselves and utilize their surroundings to fulfill their intentions (offloading tasks, for example, as in writing down notes instead of memorizing).
Now, what does it have to do with my flatmate? Well, I think this explains why people are so immersed into computers that they spend hours a day in an unnatural pose. See, the computer is a powerful tool – it can do many of the things we find difficult (memorizing, maths, wireless communication across the globe) with ease. This is why, when presented the opportunity, we gladly accept it into our cognitive mind as a part of us, loose ourselves into it, feel no hunger, no pain. The benefits are big – we get super powers, basically (WIFI is damn close to telepathy, don’t you think?).
So all is fine, nothing wrong with us… but wait! Back pains, eyesight problems, general health issues – all result from this “pairing”, us and the computer. And that’s a problem. If we agree that everything we do is well within our nature, then the computer must be to blame. And indeed, I claim that the health issues we face are due to how inconvenient computers are… have been so far, at least. This is changing!
Google glass is just one example of how technology is becoming more intuitive and unobtrusive. We need to wait till next year, when it comes out, to see if it will live up to the hype, but it is certainly a step in the right direction for me.
Now, I blabbered for enough. What do you think?
A quick update
Hello world,
Today was a day of bug fixing. I’m keeping myself busy with two projects right now:
- TheHunt – Just made batch drawing of text work, so expect an update soon!
- Ruby on Rails project – a friend and I are trying to put a website together. Rails is great. Taking an XLSX file and reading it into the database – done!
That’s more than enough to sleep soundly. Good night! ^^
TheHunt – Interactive graphical platform for AI experiments
Hello!
Firstly, I apologize for the rather big break – I will try to be more regular from now on…
But finally I feel like I have something noteworthy to say, and show:
TheHunt
http://d3kod.github.com/TheHunt—Interactive-graphical-platform-for-AI-Experiments/
On the website above you can:
- Download the current best version
- View the full source code
- Contribute! bug report, bug fix, adding a feature… or just a friendly comment on it, all are priceless =]
Short story:
- Android game and live wallpaper simulating an artificial environment with algae and a fish (currently more like a fish bone, really)
- Fish tries to eat as much as it can, munching on algae and food you’ve placed
- You can catch the fish by surrounding it with a net
- Open sourced, idea is to end up with other agents using the environment, maybe even interacting with each other (a crab? a seal?…)
- Will be in the Play Store, eventually, when it matures enough
I will be using this blog to post regular updates on it, as well some behind the scenes information about how things work… also to answer to feedback you guys might have!
That’s it for now, I’ll be back soon to tell a bit more about some incoming features and maybe set some milestones!
More screenshots:










