Contest: Animal/Bot Coding (AI)

Online C++ programming contests.

Moderators: Darobat, RecursiveS, Dante Shamest, Bugdude, Wizard, raimo

Is this a good idea or not?

Poll ended at Sun Aug 22, 2004 12:10 pm

Yes
19
100%
No
0
No votes
 
Total votes : 19

testing environment

Postby oliver » Mon Aug 30, 2004 1:31 am

hello people, i'm actually really getting into this thing... anyway, i just made a testing environment that you guys might want to check out, it's somewhat decent... but with horrible looking code... and i don't think it frees up the memory is uses... but oh well, it seems to work okay on my computer.

http://www.geocities.com/olivertigo/Tes ... onment.ZIP

and thanks to corsix for the great idea and engine, this kind of thing really interests me.
oliver
 

Postby Zen » Mon Aug 30, 2004 4:22 am

Nice oliver. I couldn't scroll up/down? Can you get it to draw continuously? (not just every tick?) or do it already do that?

Anyway, I've updated my glut"motor" a little.

Controls:
p - pause
t - run one tick when paused
d - draw corpses
v - draw vision
arrowkeys - navigate
Males are sqare and females are triangles

How to add your own animals:
- Include the header in animal.cpp.h same place as in the org version. (animal.cpp.h is the original file with a few necessary(?) modifications)
- Spawn @ line 609. (specify color)
- Build and run.
- Speed can be set @ line 8 in contest37.cpp

http://www.home.no/ojb/Animal_glut_v1.1.rar

I have to give ryan credit for this. If it hadn't been for contest37 I couldn't/wouldn't have done this. I also use his circle method.
User avatar
Zen
 
Posts: 1088
Joined: Wed Sep 24, 2003 1:41 am
Location: Norway

problem with the tester?

Postby oliver » Mon Aug 30, 2004 7:20 am

Zen wrote: I couldn't scroll up/down? Can you get it to draw continuously? (not just every tick?) or do it already do that?


i'm not sure about the scrolling up/down... maybe i uploaded an early version before i fixed that problem. ah well, i'll upload the newer one tomorrow... in reference to the continuous stuff, i'm not sure what you mean exactly, but if you're talking about it jumping ahead a few frames, just set the SkipCount to 1 (found right at the top of Animal.cpp). if you mean that you have to press the key for each frame, pressing F2 once will start doing it automatically for you, and pressing it again will set it back to manual. anyway, glad you showed some interest in it, i'll have to check out the "motor" of yours... on that topic,

is it a windows application? i'm using VC++6, so i have to make a new project then add the files in and build.. (the .vcproj files don't work on my compiler), and do you know where i can find glut.h and hashtable? i don't think my compiler has those, it was showing some errors.
oliver
 

Postby Zen » Mon Aug 30, 2004 7:34 am

It's glut. So you need glut installed: http://www.xmission.com/~nate/glut.html

>(the .vcproj files don't work on my compiler)
sorry I'm using vs2003

My "motor" is looks pretty much the same as yours, excrpt it has black background.

About the continuous: What I mean is that if a animal to alot in one round (not really any limit you know) you see what he does.
eg. The animal moves 4 steps to the right, then 5 steps up. If you ran the prog very slow, you should be able to see that the animal did move right, then up, not just that it moved right/up.

Not a big thing though. (Mine does not do that, in fact I think it's close to impossible with glut combined with the gamecore)
User avatar
Zen
 
Posts: 1088
Joined: Wed Sep 24, 2003 1:41 am
Location: Norway

continuousness

Postby oliver » Mon Aug 30, 2004 9:54 am

Zen wrote:About the continuous: What I mean is that if a animal to alot in one round (not really any limit you know) you see what he does.
eg. The animal moves 4 steps to the right, then 5 steps up. If you ran the prog very slow, you should be able to see that the animal did move right, then up, not just that it moved right/up.

Not a big thing though. (Mine does not do that, in fact I think it's close to impossible with glut combined with the gamecore)



oh yeah, mine actually, by default, only updates every 5 ticks of all creatures! so it's not even close to that precise, but with the method i mentioned earlier, it can be as precise as one update per 1 tick of all creatures.

but to make it more precise would be tough...
you'd need to have, well i guess, inside the Move() function, you'd have to call some other function telling it every time the function was called... then, use the __int__vars[Loc__X] or wahtever it's called to redraw the creature individually... now that i think about it though, it does maybe solve the problem of doing "too much" in each windows loop, 'cause you can do one guy at a time that way... yeah i might give it a go, i tell you this project is addictive, my sleeping is starting to suffer :D
oliver
 

Postby r4nd0m » Mon Aug 30, 2004 9:59 am

hey zen... know of anywhere where I can dl the hash_map include, as well as the other stl includes needed to compile ur runtime? for some reason, I don't have some of the stl, including hash maps. and when I downloaded them from the net, i got 204 errors while trying to compile your prog..
Life should NOT be a journey to the grave with the intention of arriving safely in an attractive and well preserved body, but rather to skid in sideways, Champagne in one hand -- strawberries in the other screaming WOO HOO!
User avatar
r4nd0m
 
Posts: 1851
Joined: Tue May 11, 2004 7:43 pm
Location: Edmonton, Alberta, Canada

Postby Zen » Tue Aug 31, 2004 5:50 am

Hm, strange. It doesn't really matters if the hashmap is the only thing you misses. It's not needed. Just remove it from STDAFX.h

Sorry about that.
User avatar
Zen
 
Posts: 1088
Joined: Wed Sep 24, 2003 1:41 am
Location: Norway

Postby r4nd0m » Tue Aug 31, 2004 10:22 am

o..
Life should NOT be a journey to the grave with the intention of arriving safely in an attractive and well preserved body, but rather to skid in sideways, Champagne in one hand -- strawberries in the other screaming WOO HOO!
User avatar
r4nd0m
 
Posts: 1851
Joined: Tue May 11, 2004 7:43 pm
Location: Edmonton, Alberta, Canada

Postby Zen » Tue Aug 31, 2004 12:00 pm

r4nd0m wrote:o..

What? did it work? or... :roll:
User avatar
Zen
 
Posts: 1088
Joined: Wed Sep 24, 2003 1:41 am
Location: Norway

testing your creatures

Postby oliver » Tue Aug 31, 2004 12:33 pm

hey people, i improved my tester quite a bit, only now it goes too fast for my computer (it is a 266mHz system)... so after about turn 30 or so, the system resources go to nil and i have to Ctrl Alt Del the program.

if any of you know how to set up a windows program to call a function only once per 10 milliseconds, or something like that, maybe something like wait(5ms) kind of a function that temporarily frees up resources for other programs, i'd be glad to fix this small problem... that is, if you people are interested... :?:

i'm a computer science student, so i figured this type of practice would help me next year (which starts in like a week)... but if you people are getting annoyed at all my posts on your forum, or whatever, i could always get practice somewhere else... the last thing i'd want to do is impose myself...

but anyway, here's the new tester:
http://www.geocities.com/olivertigo/NewTester.ZIP
oliver
 

Postby Zen » Tue Aug 31, 2004 1:08 pm

You could try Sleep(millisec) in wnibase.h (windows.h includes it I think)
ut if you people are getting annoyed at all my posts on your forum, or whatever

I'm not, and I can't see any reason why anyone else should either. :D
User avatar
Zen
 
Posts: 1088
Joined: Wed Sep 24, 2003 1:41 am
Location: Norway

Postby r4nd0m » Tue Aug 31, 2004 1:56 pm

i think my glut installation is screwy - i just get a couple external linker errors now which apply to glut [unresolved externals] so w/e.. i'll just use mine for now ;)
Life should NOT be a journey to the grave with the intention of arriving safely in an attractive and well preserved body, but rather to skid in sideways, Champagne in one hand -- strawberries in the other screaming WOO HOO!
User avatar
r4nd0m
 
Posts: 1851
Joined: Tue May 11, 2004 7:43 pm
Location: Edmonton, Alberta, Canada

Postby Zen » Fri Sep 03, 2004 5:51 pm

Ok, latest release. This opengl/glu stuff is killing my animals :wink: I've been doing ALOT more gl/lgut than my animals.

Anyway: www.home.no/ojb/animal_graph_glut_v1.2.rar

Controls:
p - pause
t - run one tick when paused
d - draw corpses
v - draw vision
arrowkeys - navigate
+/- Zomm in/out
/ - resets zoom
mouse left click - get info from animal (click on animal)
mouse left click drag - counts animal in selection (and sorts after type)
right click/drag - print coordinates

I've added "//INFO - xxxx" where there is some code that might be of interest to edit/see;

Males are sqare and females are triangles (by default)
Dead ones has a black dot in the middle, if meals left a white.

To install glut go here: http://www.xmission.com/~nate/glut.html
User avatar
Zen
 
Posts: 1088
Joined: Wed Sep 24, 2003 1:41 am
Location: Norway

Postby Corsix » Sat Sep 04, 2004 7:53 am

:!: :!: :!: Warning people, the deadline is near! (<1 hour away) :!: :!: :!:
So far I have received only r4nd0m's animals.
Last edited by Corsix on Sat Sep 04, 2004 10:08 am, edited 1 time in total.
Code: Select all
#include <stdio.h>
char*_="XxTIHRCXCxTIHRXRCxTIHXHRCxTIXIHRCxTXTIHRCxXxTIHRCX";
int main(int l){for(l+=7;l!=putchar(010);++l);if(*(++_))main
(*_!=88?(putchar(*_^073)|putchar(33))&1:0xffff2a8b);}
User avatar
Corsix
 
Posts: 1181
Joined: Fri Jul 23, 2004 9:33 am
Location: Berkeley, UK

Postby Zen » Sat Sep 04, 2004 9:35 am

Ok, thats not good! I thought i Had at least 10 hour more. Damn timezones :?
User avatar
Zen
 
Posts: 1088
Joined: Wed Sep 24, 2003 1:41 am
Location: Norway

PreviousNext

Return to Contests

Who is online

Users browsing this forum: No registered users and 1 guest