Tuesday, May 30, 2006

Well, Im getting there now.

UT2004 sends x, y's and z's to another computer via UDP on port 9000.
Processing recieves the packet communication and converts them into lovely useful floats, whilst ignoring any packets that arent relevant (there are quite a few!).

Heres the processing code that accepts communication and converts to floats.
I used the Carnivore library in the end.


// Uses Carnivore
// Note: requires Carnivore Library for Processing v1.3 (http://rhizome.org/carnivore) (needs winpcap)


import rsg.carnivore.*;
int count3 = 0;
float tempx;
float tempy;
float tempz;
String packettext;
String look = "nextthree";

void setup(){
size(625, 625);
background(255);
Carnivore c = new Carnivore(this);
}

void draw(){

}


void packetEvent(CarniPacket packet){ // Called each time a new packet arrives

packettext = packet.ascii;
int stringlength = packettext.length();

if (stringlength < 19){

String list[] = split(packettext);
//println(list[0]);

if(list[0].equals(look) == true) { //wait for the first signal...
println("here");
count3 = 1;
}else{
if (count3 == 1){
tempx = float(list[0]);
count3 = 2;
println("x = " + tempx);
}else{
if (count3 == 2){
tempy = float(list[0]);
count3 = 3;
println("y = " + tempy);
}else{
if (count3 == 3){
tempz = float(list[0]);
count3 = 0;
println("z = " + tempz);
}
}
}
} //end if else madness

}//end if string length

}//end packetevent

Monday, May 22, 2006

much has happened since my last posts.

Firstly I have fully decided on what Im going to do for FACT.
UT will be played by the bots as usual, their positions will be logged and sent to a "dance floor" a real life one. 6 by 6 (cuz I cant afford more).

This is the processing pic of essentially the top down view of the dancefloor.



So yeah, people will be able to walk over the floor and where they walk the bots beneath them will die.
Its kinda like a really advanced version of whack attack (or similar games)



To make the cull in Unreal I had to write a new mutator that would accept 36 different (6 by 6) keypresses and drop a kill volume on top of anyones head in the correct vacinity.





okay, so I know I havent explained this well. But it will all make sense soon...

Here is a link to the processing code (its overly complex at the mo because Im going to need to do some madness to it a little later on... the live reading of the game)

Here is a link to me asking for help on the Unreal script forums... (Ill include the actual finished mutator and stuff in good time)

Tuesday, May 16, 2006

A few things I have learnt today about Unreals AI and bots.

They sound obvious but are very important to me:
"In general, a bot will choose the shortest route to his destination, except for sometimes choosing to go through an alternate path in CTF, or avoiding paths were many bots have died."

It was as I suspected. However what if the bot has no destination, will it then choose the shortest path to nowhere?

I did a quick experiment today and discovered 2 important things. Heres a little pic of the map my poor guinea pig ran through. (there was no escaping death... at the end of each path it would die and respawn again in the middle)



With no obvious destination the bot will choose a random direction to run in regardless of path length.

After roughly 65 deaths the bot "wises up" and "hesitates" about which way to go, it will wait where it spawned for a time then it will fall into a repeating pattern, according to the last 3 deaths that occured before the wait.
r=right
l=left
u=up

eg. u,u,l,r,u,r,r,u,r,l,Wait,u,r,l,Wait,u,r,l,Wait,u,r,l,Wait ... etc.

So, why do I care? I dont know yet, but I have a feeling this is going to be important.

Im going to have to write all this down or I will forget all of it.

I was working today on a way for UT to accept input from processing.
I completely failed when I was thinking about it like that, but obviously the keyboard will send information to whoevers listening (both processing and unreal).

So what I had to do was to make UT understand that a certain key had been pressed and do something about it.
This was difficult, I found numerous things online to help, me but it took forever for me to get it all together.

So for the benefit of anyone whos interested.
Here is a link to the files, drop them in your UT2004 system folder and you will be able to access the mutator from within the game its called "interaction creator"

When the mutator is running it will tell you via the text chat area which key youve just pressed and released.

It was made by following these very clever (but hard to follow for a beginner) semi-tutorial thingys.
So thank you someone called Will for helping me inadvertantly.

I am now working on making UT act upon certain key presses and make things move.

Monday, May 15, 2006

A pleasent wee bit o code. To change the grid size easily.


int gridsize=15; ///////////////////change this number to change the grid size

float stage= 625.0;
float gridadd=stage/gridsize;
float currenty = 0.0;
float currentx =0.0;

size(int(stage),int(stage));
background(255);
stroke(0);

for(int i=0;i<=gridsize;i++){
currentx=currentx+gridadd;
line(0,currentx,stage,currentx);
}

for(int i=0;i<=gridsize;i++){
currenty=currenty+gridadd;
line(currenty,0,currenty,stage);
}


flickr pic has a pic of how the grid was used... its going to make a physical thing move... arduino is now ordered

Wednesday, May 03, 2006

scuse the absence Ive been busy.

Im currently writing a paper for the people at Ylem.
About my project (but secretly about "art games" and what I think about the whole thing).
Im also working on some physical computing stuff with processing (for those crazy FACT people)... which should be on here at some point.

I also have to properly think about this whole mphil/phd thing... as in Im doing one and I need supervisors.
so if any of you happen to be in the field of AI, games, art, or copyright law then feel free to contact me and be my supervisor (or even just advisor!). There might be a free trip to Huddersfield in it for you.

What else am I up to... thats about it. oh yeah, got to go to the tip and finally be rid of my old desk.