I'll try to get this back to PROGRAMMING
I'm working on a programming game, where two bots with AI written by the players fight. So far I have them moving, aiming and shooting using a simple language I created like this:
[code]"name" "SimpleBot"
"author" "Robert64"
"version" "0.01"
"chassis" "blue"
"wheel" "grey"
"turret" "white"
"startai"
-------------------------------------------
"lable" "main"
"if" "this_health < 50"
"goto" "flee"
"end if"
"if" "this_ang < enemy_dir"
"turn" "right"
"goto" "main"
"else" "if" "this_ang > enemy_dir"
"turn" "left"
"goto" "main"
"end if" "end if"
"move" "forward"
"if" "enemy_dist < 256"
"goto" "fire"
"end if"
"goto" "main"
"lable" "flee"
"if" "enemy_dist < 256"
"if" "this_ang < enemy_dir"
"turn" "right"
"else" "if" "this_ang > enemy_dir"
"turn" "left"
"end if" "end if"
"move" "backward"
"else"
"if" "this_ang < enemy_dir + 90"
"turn" "right"
"else" "if" "this_ang > enemy_dir - 90"
"turn" "left"
"end if" "end if"
"move" "forward"
"goto" "fire"
"end if"
"lable" "fire"
"if" "this_turretang < enemy_dir + 8"
"turnturret" "right"
"else" "if" "this_turretang > enemy_dir + 8"
"turnturret" "left"
"else"
"shoot"
"end if" "end if"
"if" "this_ammo < 10"
"goto" "flee"
"end if"
"if" "this_health < 50"
"goto" "flee"
"end if"
"if" "enemy_dist > 256"
"goto" "main"
"end if"
"goto" "fire"[/code]
I'm going to add pickups for the bots and other things to make it a bit more interesting tomorrow.
vladh <3 stgn
[QUOTE=gngbng;18086484][img]http://publicaffairs.uth.tmc.edu/hleader/gfx/2004art/aspergerssyndrome.jpg[/img][/QUOTE]
Gary Mckinnon.
[QUOTE=Robert64;18086501]I'll try to get this back to PROGRAMMING
I'm working on a programming game, where two bots with AI written by the players fight. So far I have them moving, aiming and shooting using a simple language I created like this:
[code]"name" "SimpleBot"
"author" "Robert64"
"version" "0.01"
"chassis" "blue"
"wheel" "grey"
"turret" "white"
"startai"
-------------------------------------------
"lable" "main"
"if" "this_health < 50"
"goto" "flee"
"end if"
"if" "this_ang < enemy_dir"
"turn" "right"
"goto" "main"
"else" "if" "this_ang > enemy_dir"
"turn" "left"
"goto" "main"
"end if" "end if"
"move" "forward"
"if" "enemy_dist < 256"
"goto" "fire"
"end if"
"goto" "main"
"lable" "flee"
"if" "enemy_dist < 256"
"if" "this_ang < enemy_dir"
"turn" "right"
"else" "if" "this_ang > enemy_dir"
"turn" "left"
"end if" "end if"
"move" "backward"
"else"
"if" "this_ang < enemy_dir + 90"
"turn" "right"
"else" "if" "this_ang > enemy_dir - 90"
"turn" "left"
"end if" "end if"
"move" "forward"
"goto" "fire"
"end if"
"lable" "fire"
"if" "this_turretang < enemy_dir + 8"
"turnturret" "right"
"else" "if" "this_turretang > enemy_dir + 8"
"turnturret" "left"
"else"
"shoot"
"end if" "end if"
"if" "this_ammo < 10"
"goto" "flee"
"end if"
"if" "this_health < 50"
"goto" "flee"
"end if"
"if" "enemy_dist > 256"
"goto" "main"
"end if"
"goto" "fire"[/code]
I'm going to add pickups for the bots and other things to make it a bit more interesting tomorrow.[/QUOTE]
"that's" "alot" "of" "quotations"
[QUOTE=Robert64;18086501]I'll try to get this back to PROGRAMMING
I'm working on a programming game, where two bots with AI written by the players fight. So far I have them moving, aiming and shooting using a simple language I created like this:
[code]"name" "SimpleBot"
"author" "Robert64"
"version" "0.01"
"chassis" "blue"
"wheel" "grey"
"turret" "white"
"startai"
-------------------------------------------
"lable" "main"
"if" "this_health < 50"
"goto" "flee"
"end if"
"if" "this_ang < enemy_dir"
"turn" "right"
"goto" "main"
"else" "if" "this_ang > enemy_dir"
"turn" "left"
"goto" "main"
"end if" "end if"
"move" "forward"
"if" "enemy_dist < 256"
"goto" "fire"
"end if"
"goto" "main"
"lable" "flee"
"if" "enemy_dist < 256"
"if" "this_ang < enemy_dir"
"turn" "right"
"else" "if" "this_ang > enemy_dir"
"turn" "left"
"end if" "end if"
"move" "backward"
"else"
"if" "this_ang < enemy_dir + 90"
"turn" "right"
"else" "if" "this_ang > enemy_dir - 90"
"turn" "left"
"end if" "end if"
"move" "forward"
"goto" "fire"
"end if"
"lable" "fire"
"if" "this_turretang < enemy_dir + 8"
"turnturret" "right"
"else" "if" "this_turretang > enemy_dir + 8"
"turnturret" "left"
"else"
"shoot"
"end if" "end if"
"if" "this_ammo < 10"
"goto" "flee"
"end if"
"if" "this_health < 50"
"goto" "flee"
"end if"
"if" "enemy_dist > 256"
"goto" "main"
"end if"
"goto" "fire"[/code]
I'm going to add pickups for the bots and other things to make it a bit more interesting tomorrow.[/QUOTE]
"this" "is" "an" "abortion" "and" "you" "should" "be" "ashamed"
[QUOTE=gngbng;18086484][img]http://publicaffairs.uth.tmc.edu/hleader/gfx/2004art/aspergerssyndrome.jpg[/img][/QUOTE]
I laughed really hard
[QUOTE=NOISE IS ART;18086522]"this" "is" "an" "abortion" "and" "you" "should" "be" "ashamed"[/QUOTE]
I'm using "alot of quotes" to make it easier for the interpreter to find commands, and so you can add comments or whatever around it without it messing up the code. Most commands come in pairs:
"command name" "value / arguments"
I can't be bothered to change it now anyway.
[QUOTE=Robert64;18086550]I'm using "alot of quotes" to make it easier for the interpreter.[/QUOTE]
are you serious
[QUOTE=Robert64;18086501]I'll try to get this back to PROGRAMMING
I'm working on a programming game, where two bots with AI written by the players fight. So far I have them moving, aiming and shooting using a simple language I created like this:
[code]"name" "SimpleBot"
"author" "Robert64"
"version" "0.01"
"chassis" "blue"
"wheel" "grey"
"turret" "white"
"startai"
-------------------------------------------
"lable" "main"
"if" "this_health < 50"
"goto" "flee"
"end if"
"if" "this_ang < enemy_dir"
"turn" "right"
"goto" "main"
"else" "if" "this_ang > enemy_dir"
"turn" "left"
"goto" "main"
"end if" "end if"
"move" "forward"
"if" "enemy_dist < 256"
"goto" "fire"
"end if"
"goto" "main"
"lable" "flee"
"if" "enemy_dist < 256"
"if" "this_ang < enemy_dir"
"turn" "right"
"else" "if" "this_ang > enemy_dir"
"turn" "left"
"end if" "end if"
"move" "backward"
"else"
"if" "this_ang < enemy_dir + 90"
"turn" "right"
"else" "if" "this_ang > enemy_dir - 90"
"turn" "left"
"end if" "end if"
"move" "forward"
"goto" "fire"
"end if"
"lable" "fire"
"if" "this_turretang < enemy_dir + 8"
"turnturret" "right"
"else" "if" "this_turretang > enemy_dir + 8"
"turnturret" "left"
"else"
"shoot"
"end if" "end if"
"if" "this_ammo < 10"
"goto" "flee"
"end if"
"if" "this_health < 50"
"goto" "flee"
"end if"
"if" "enemy_dist > 256"
"goto" "main"
"end if"
"goto" "fire"[/code]
I'm going to add pickups for the bots and other things to make it a bit more interesting tomorrow.[/QUOTE]
"what" "the" "fuck"
[QUOTE=gngbng;18086592]are you serious[/QUOTE]
The way I wrote it is by going through every character in the .txt file of instructions, ignoring everything up to a " and then recording everything from there to another ".
I'm sure there are much better ways but this was the first I thought of.
[QUOTE=Robert64;18086501]I'll try to get this back to PROGRAMMING
I'm working on a programming game, where two bots with AI written by the players fight. So far I have them moving, aiming and shooting using a simple language I created like this:
I'm going to add pickups for the bots and other things to make it a bit more interesting tomorrow.[/QUOTE]
reminds me of that ancient game called RobotWar
[QUOTE=Robert64;18086653]The way I wrote it is by going through every character in the .txt file of instructions, ignoring everything up to a " and then recording everything from there to another ".
I'm sure there are much better ways but this was the first I thought of.[/QUOTE]
what about spaces
[media]http://www.youtube.com/watch?v=SeJwPcDD4EI[/media]
Just working on the menu screen for our racing game. You can see my bitmap text library, character affectors (they make the characters bounce) and my post processing system at work. Going to add content to the credits and help screen later, but I am in love with the sliding. And we just hit 11,000 lines of code for the project!
neat menus, what is fraps doing showing its face D:
[QUOTE=r4nk_;18086936][media]http://www.youtube.com/watch?v=SeJwPcDD4EI[/media]
Just working on the menu screen for our racing game. You can see my bitmap text library, character affectors (they make the characters bounce) and my post processing system at work. Going to add content to the credits and help screen later, but I am in love with the sliding. And we just hit 11,000 lines of code for the project![/QUOTE]
How many people are working on this? and why are you working on it? for fun? a class?
[QUOTE=Robert64;18086501]I'll try to get this back to PROGRAMMING
I'm working on a programming game, where two bots with AI written by the players fight. So far I have them moving, aiming and shooting using a simple language I created like this:
[code]"name" "SimpleBot"
"author" "Robert64"
"version" "0.01"
"chassis" "blue"
"wheel" "grey"
"turret" "white"
"startai"
-------------------------------------------
"lable" "main"
"if" "this_health < 50"
"goto" "flee"
"end if"
"if" "this_ang < enemy_dir"
"turn" "right"
"goto" "main"
"else" "if" "this_ang > enemy_dir"
"turn" "left"
"goto" "main"
"end if" "end if"
"move" "forward"
"if" "enemy_dist < 256"
"goto" "fire"
"end if"
"goto" "main"
"lable" "flee"
"if" "enemy_dist < 256"
"if" "this_ang < enemy_dir"
"turn" "right"
"else" "if" "this_ang > enemy_dir"
"turn" "left"
"end if" "end if"
"move" "backward"
"else"
"if" "this_ang < enemy_dir + 90"
"turn" "right"
"else" "if" "this_ang > enemy_dir - 90"
"turn" "left"
"end if" "end if"
"move" "forward"
"goto" "fire"
"end if"
"lable" "fire"
"if" "this_turretang < enemy_dir + 8"
"turnturret" "right"
"else" "if" "this_turretang > enemy_dir + 8"
"turnturret" "left"
"else"
"shoot"
"end if" "end if"
"if" "this_ammo < 10"
"goto" "flee"
"end if"
"if" "this_health < 50"
"goto" "flee"
"end if"
"if" "enemy_dist > 256"
"goto" "main"
"end if"
"goto" "fire"[/code]
I'm going to add pickups for the bots and other things to make it a bit more interesting tomorrow.[/QUOTE]
"holy" "shit" "that" "looks" "like" "ass." "Are" "you" "that" "lazy" "that" "you" "wont" "make" "a" "half" "decent" "interpreter?"
[QUOTE=Guru-guru;18087479]How many people are working on this? and why are you working on it? for fun? a class?[/QUOTE]
3 people (one guy is not contributing shit all thought so, it's really a 2 man job..) and it's for a uni project. Actually one of my team mates is a main contributor for [url=http://www.scirra.com/]construct[/url], small world eh?
Awesome update r4nk_, I'd love to see a game-play video soon :)
"oh" "my" "god" "just" "use" "Lua"
Working on my next update for iso-world. Right now hunting its working-ish but buggy as hell thankfully its funny. Making a women running around axing everything makes you feel special. :P The next update will come out Nov 8th.
[QUOTE=r4nk_;18086936][media]http://www.youtube.com/watch?v=SeJwPcDD4EI[/media]
Just working on the menu screen for our racing game. You can see my bitmap text library, character affectors (they make the characters bounce) and my post processing system at work. Going to add content to the credits and help screen later, but I am in love with the sliding. And we just hit 11,000 lines of code for the project![/QUOTE]
That looks pretty nice. I like that.
[QUOTE=Guru-guru;18090826]Working on my next update for iso-world. Right now hunting its working-ish but buggy as hell thankfully its funny. Making a women running around axing everything makes you feel special. :P The next update will come out Nov 8th.[/QUOTE]
Sounds awesome, as soon as I get my hacking game done I'm going to work on some AI work.
Currently making a guestbook that I'll then implement in my "javaos".
[b]Edit:[/b] Cancelled the guestbook for now, don't really know how to implement it into the design. Instead, I'm going to look for some kind of javascript that I could make a program out of, like tetris or such.
I've become a programming mingebag. Now you are awarded with the ability to draw perfect grainy circles with your cursor.
[code]#include <windows.h>
#include <math.h>
#define PI 3.14159265358979323846
int main()
{
double x, y;
double angle = 0.0;
double radius = 5000.0;
int pos_x = GetSystemMetrics(SM_CXSCREEN) / 2;
int pos_y = GetSystemMetrics(SM_CYSCREEN) / 2;
long long pFreq = 0;
long long pCount_old = 0;
long long pCount_new;
float time = 0;
HDC hdc = GetDC(HWND_DESKTOP);
QueryPerformanceFrequency((LARGE_INTEGER*)&pFreq);
QueryPerformanceCounter((LARGE_INTEGER*)&pCount_old);
while(!GetAsyncKeyState(0x23)) //Press 'end' to exit...
{
QueryPerformanceCounter((LARGE_INTEGER*)&pCount_new);
time = ((float)(pCount_new - pCount_old)) / pFreq;
pCount_old = pCount_new;
angle += (2 * PI) * time;
radius = cos(radius) * 200;
x = cos(angle) * radius;
y = sin(angle) * radius;
SetCursorPos(((int)x + pos_x), ((int)y + pos_y));
SetPixel(hdc, (x + pos_x), (y + pos_y), RGB(255, 0, 0));
}
}[/code]
[QUOTE=farmatyr;18093613]
[code]SetPixel(hdc, (x + pos_x), (y + pos_y), RGB(255, 0, 0));[/code][/QUOTE]
So, I copy pasted this into my trusty Code::Blocks, but I get a compiling error there.
Now I'm a complete retard when it comes to coding, so would someone please enlighten me on what the problem is?
Sorry, you need to Log In to post a reply to this thread.