Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / - DBPro Coding Challenges -

Author
Message
Kira Vakaan
15
Years of Service
User Offline
Joined: 1st Dec 2008
Location: MI, United States
Posted: 11th Sep 2009 01:54 Edited at: 11th Sep 2009 01:54
@Diggsey: Wow, very nice! Did you really stretch a sphere into a fish?

It makes me think I need to up the graphics quality of my entry. I'm gonna be left in the dust!
BMacZero
18
Years of Service
User Offline
Joined: 30th Dec 2005
Location: E:/ NA / USA
Posted: 11th Sep 2009 02:25
Quote: "I'll keep tinkering with it, if that's O.K. of course."

Sure! I'm going to have to keep working on it, too. What I'm trying to accomplish with the predators is to have the "boids" stay clear of them completely for a pretty wide radius. I agree with Kira that it might be difficult to switch to vectors - besides, it's much more interesting to see the same kind of thing done several different ways. I guess I'll just have to try something a bit more complicated than having them go the opposite direction.

@Diggsey: . That's probably better than I could do with media .



Valle
18
Years of Service
User Offline
Joined: 10th Mar 2006
Location: in your girlfriends bed
Posted: 11th Sep 2009 13:21
you're awesome guys!! Keep it up!


Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 12th Sep 2009 01:04
Here's an update to my entry:
The fish now group together (although there always seem to be a few stragglers, but it just makes it more realistic)

I added some predator fish, but they don't affect the other fish yet.



BillR
21
Years of Service
User Offline
Joined: 19th Mar 2003
Location: United States
Posted: 12th Sep 2009 11:45
@Diggsey - Unbelievable how realistically your fish swim!

All entries are really looking great!
Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 16th Sep 2009 00:36
Another update to my entry. This time fish try to escape from the predators.

I also added in some slime clouds and a backdrop.



BMacZero
18
Years of Service
User Offline
Joined: 30th Dec 2005
Location: E:/ NA / USA
Posted: 16th Sep 2009 02:40
Well, it looks really cool. Kind of hard to tell what's going on sometimes, though, because of the camera.



Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 16th Sep 2009 17:41
Quote: "Kind of hard to tell what's going on sometimes, though, because of the camera"


What do you mean?

Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 16th Sep 2009 20:32
I had to move the camera back and remove the fog so that you can see the action better, rather than having a free moving camera stuck in the center.

I added some textures and a backdrop and made quite a nice screen saver! (attached)

Your signature has been erased by a mod because we're sadistic losers with nothing better to do. (joke)

Attachments

Login to view attachments
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 16th Sep 2009 20:33 Edited at: 16th Sep 2009 20:33
And a screenshot.


Your signature has been erased by a mod because we're sadistic losers with nothing better to do. (joke)

Attachments

Login to view attachments
Kira Vakaan
15
Years of Service
User Offline
Joined: 1st Dec 2008
Location: MI, United States
Posted: 17th Sep 2009 05:23
Alright, the deadline draws near.

Here's my final entry:



Hold H to display control help, and mess around with the Count variables like BoidCount, EnemyCount, and ObstacleCount, especially if your computer starts to complain with the current settings.
BMacZero
18
Years of Service
User Offline
Joined: 30th Dec 2005
Location: E:/ NA / USA
Posted: 17th Sep 2009 06:28
I love Diggsey's animated fish, but yours just seems to have very nice flow to it. Good job! Both knocked the socks off mine .



Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 17th Sep 2009 22:29
Quote: "DEADLINE: 16.9 // 23.59.59"


Quote: "
Posted: 17th Sep 2009 03:23

Alright, the deadline draws near.
"


It seems Valle did not specify a time-zone to use

Kira Vakaan
15
Years of Service
User Offline
Joined: 1st Dec 2008
Location: MI, United States
Posted: 17th Sep 2009 22:39
Quote: "
Posted: 16th Sep 2009 22:23
Alright, the deadline draws near.
"


Haha, it appears not.
Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 17th Sep 2009 22:53
I bet he's forgot all about the compo by now

Valle
18
Years of Service
User Offline
Joined: 10th Mar 2006
Location: in your girlfriends bed
Posted: 18th Sep 2009 02:15
sorry guys for the delay, i visited a friend the last few days.
It was a really tough decision because all the entries are masterpieces! I think a lot can be learned from these codes and I'll look through each one of them

To make it short:
The Winner is Diggsey!
His entry just looks gorgeous and the behaviour of the fish feels very real + all that without any extern media. respect. waiting for a new challenge


Kira Vakaan
15
Years of Service
User Offline
Joined: 1st Dec 2008
Location: MI, United States
Posted: 18th Sep 2009 02:28
Hats off to the fish. Good job.
Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 18th Sep 2009 19:41 Edited at: 18th Sep 2009 22:56
Thanks, Valle!

The challenge I am setting will be a bit different from any other challenge so far. It may turn out rubbish, or it may turn out to be very good, I just don't know.

The challenge:
You must create a program which can out-guess the other entrants' programs.

Your program must consist of two functions which together allow your entry to play games of rock, paper, scissors with other entries.

To judge the competition, every entry will play every other entry once. Each round, the program will have the option of playing rock, paper or scissors. The normal game rules apply, and at the end of 100 rounds, the scores are compared. A program must beat the other by at least 10 rounds to win.

Points:
Win - 3 points
Draw - 1 point
Loss - 0 points

After every entry has played every other entry, the entry with the most points wins. In case of a draw, it will go to sudden death between the programs.

If the sudden death cannot knock out all but one of the programs, this competition will officially be a draw between the entries, but they must decide amongst themselves who will set the next challenge.

The scoring system ensures that programs which choose purely random choices will never win.

Here is the framework which I made for this challenge:


You should fill 'Player1_Guess()' and 'Player1_Result()' with your code.
'Player1_Guess()' should return 0, 1 or 2 representing rock, paper scissors, respectively.
'Player1_Result()' is called after each round, notifying your program of its own choice, and the other player's choice.

This allows two programs to play against each other.

Extra rules:
- You MUST prefix every global variable or function (except the two functions you should fill in the framework) with your initials to prevent conflicts.

- You MUST NOT use any global variables or functions used by the framework, or in other entries.

- You MAY use the function 'Choice_Winner' which returns the winner of a round in which choices 'a' and 'b' were made. (or 0 for a draw)

- Any entry which causes a compile error, or a crash, will be disqualified. (Although if possible, I will warn that person before the competition ends)

- You should clearly comment where your code is, and keep it separate from the framework code.

Deadline

You have one week to complete your entry. The deadline is 25/09/09 at 23:59:59, GMT.

Kira Vakaan
15
Years of Service
User Offline
Joined: 1st Dec 2008
Location: MI, United States
Posted: 18th Sep 2009 21:56
Hm, I don't know how I feel about this challenge. The "strategy" behind Rock, Paper, Scissors is largely based off of knowing your opponent and I think it's a little unfair to wait for someone to post their entry and then go write your own specifically designed to beat it. That said, the only "practice" we can give our programs is up against a random generator, which follows absolutely no pattern at all.

Oh, and in your function Choice_Winner(), I think the line:

needs to be changed to:

Otherwise, you get Paper beating Scissors and Scissors beating Rock and so on.
acelepage
20
Years of Service
User Offline
Joined: 2nd Jun 2004
Location: Plattsville
Posted: 18th Sep 2009 22:18
I share the concern with Kira Vakaan on observing opponent's code to determine how to beat it.
Although, the idea of competing code is very interesting. I would like to see this work somehow. The code would have to be submitted through a private method, such as email, and then it could all be posted at the deadline by the challenge setter, so everyone could still benefit from sharing code.
This is just a thought.

( 2b || !2b ), that is the question. The answer: true
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 18th Sep 2009 22:34
Why don't you just not post your submission until the deadline? that would do the same thing. For discussions - or "Look at me" posts - just post screenies

The posted code for the entries everyone benefits from, and this way contestents don't rip code from each other for a specific challenge under way.

--Jason

Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 18th Sep 2009 23:01
@Kira Vakaan
You are right. Fixed.

Quote: "I don't know how I feel about this challenge."

Well, we can see how this one goes as an experiment

Quote: "The code would have to be submitted through a private method, such as email."


You can revise your code as many times as you think is necessary. No single solution will beat every other solution, and so the best you can do is try and make one that is mostly good. This doesn't require any knowledge of an individual entry's code. The question with code stealing is the same for all challenges, and it is obvious if someone has blatantly ripped off another's code, and they will be disqualified if I feel it is unfair.

Kira Vakaan
15
Years of Service
User Offline
Joined: 1st Dec 2008
Location: MI, United States
Posted: 18th Sep 2009 23:22
Well, my concern wasn't so much that I fear people will use others' code against them, it's more that any code we write that tries to discern a pattern in an opponent's moves can ultimately be defeated by a random generator. And the best way to combat a random generator, is with another random generator. The reason Rock, Paper, Scissors actually works to some degree in real life is that people aren't exactly random and you can usually "get to know" your opponent.

I do like the idea of competition, but I just don't think it works very well with Rock, Paper, Scissors.
Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 18th Sep 2009 23:44 Edited at: 18th Sep 2009 23:45
@Kira Vakaan
As I said, random generators will always lose to non-random generators.

When random generators play another entry, they will always draw (since you have to win by 10 clear rounds) and so they will only ever get 1 point per game. That means that even a moderately good program, which wins half the time and loses the other half, will still beat it (it will get an average of 1.5 points per game).

The only way to win is by predicting the other player. As long as there are at least two non-random entries, the random entries cannot win.

BMacZero
18
Years of Service
User Offline
Joined: 30th Dec 2005
Location: E:/ NA / USA
Posted: 19th Sep 2009 02:30
I had this same idea a few challenges back, except with two programs playing Battleship against each other (decided to make the challenge Inverse Kinematics instead). I thinks it's a good idea to try this and see how it goes - if it doesn't go well, maybe we could try a game less prone to chance like battleship (I even still have the framework for it!).

I do think you should increase the number of rounds, though. Perhaps 1000 with a margin of 100 to win, just to make it more accurate?

Quote: "The reason Rock, Paper, Scissors actually works to some degree in real life is that people aren't exactly random and you can usually "get to know" your opponent."

But see, the same applies here. As random number generators are discouraged, the other person's program will have to exhibit some kind of pattern.



Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 19th Sep 2009 02:51
Quote: "Perhaps 1000 with a margin of 100 to win, just to make it more accurate?"


I've tried running the program with random numbers, and there are always much less than ten rounds difference, so I think 100 rounds is enough.

Aurum Knight
16
Years of Service
User Offline
Joined: 15th Jul 2008
Location: the suburbs of nowhere
Posted: 19th Sep 2009 19:48
Here's an entry. Not that great, but it works for now

I'm just gonna post the guessing section.

Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 19th Sep 2009 21:17
Thanks for the entry, it compiles and runs fine for me

We'll have to wait for some more entries to see how well it does

Valle
18
Years of Service
User Offline
Joined: 10th Mar 2006
Location: in your girlfriends bed
Posted: 19th Sep 2009 23:02 Edited at: 19th Sep 2009 23:19
hm, this is interesting, here is my first and probably not final entry, only the guessing section:



It beats Aurum Knights Entry most of the time , so I'm very interested about other entries

Edit// fixed bug


Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 20th Sep 2009 01:11
Nice entry!

I ran it a few times, and it managed to win 60 to 8 on one run!

Just a note:
You MAY use global arrays. I will move them to the top to make sure they are dimmed properly.

Neuro Fuzzy
17
Years of Service
User Offline
Joined: 11th Jun 2007
Location:
Posted: 20th Sep 2009 01:54
Valle, your code and my code are a match for eachother...

I pitted my program against yours, and after 100 rounds it was almost always a draw. i turned that up a notch to 10,000 rounds, and the programs tied about a fourth of the time (which is still kinda amazing).

Right now, they're in a million round fight to the death, i'll post the results when it's finished
Neuro Fuzzy
17
Years of Service
User Offline
Joined: 11th Jun 2007
Location:
Posted: 20th Sep 2009 02:03
I lost... the score was 333,068 to 334,203
Aurum Knight
16
Years of Service
User Offline
Joined: 15th Jul 2008
Location: the suburbs of nowhere
Posted: 20th Sep 2009 02:16 Edited at: 20th Sep 2009 02:19
Neuro, you should post yours so I can try it

Here's my entry. I didn't have any entries to work with the first time. This one is much better

Neuro Fuzzy
17
Years of Service
User Offline
Joined: 11th Jun 2007
Location:
Posted: 20th Sep 2009 02:30



It seems like all that my code can do is draw!

my program's based off of averages. Basically, the more another program chooses one move, the more my program will have more of a chance to play the move that beats that move.
Aurum Knight
16
Years of Service
User Offline
Joined: 15th Jul 2008
Location: the suburbs of nowhere
Posted: 20th Sep 2009 02:42
Quote: "It seems like all that my code can do is draw!"

Lol, it was better than my first entry

I'm trying it with 10000 rounds like you did with Valle's, we'll see whos wins
Aurum Knight
16
Years of Service
User Offline
Joined: 15th Jul 2008
Location: the suburbs of nowhere
Posted: 20th Sep 2009 03:09
Hmm, our entries seem to match pretty well... They beat each other about the same amount of times with 10,000. Mine is only tiny tiny bit better. I tried it with 10 million rounds, and the difference in score ranges from about 1000 to less than 20. The closest one was 3,333,145 to 3,333,123.

It's probably do to the fact that our entries work in similar ways
Neuro Fuzzy
17
Years of Service
User Offline
Joined: 11th Jun 2007
Location:
Posted: 20th Sep 2009 03:13
Quote: "Mine is only tiny tiny bit better."
Pfft!

yeah... i have a feeling that there's gonna be a lot of ties...
BMacZero
18
Years of Service
User Offline
Joined: 30th Dec 2005
Location: E:/ NA / USA
Posted: 20th Sep 2009 22:05 Edited at: 20th Sep 2009 22:06
Haha, when I ran mine the first time against Aurum Knight's it lost 8 to 57 or something miserable like that . It now ties consistently with Aurum Knight's and Neuro Fuzzy's (though theirs usually have higher scores), but Valle's can beat it right now.





Neuro Fuzzy
17
Years of Service
User Offline
Joined: 11th Jun 2007
Location:
Posted: 20th Sep 2009 22:18
Since our programs work on averages... how about a program that tries to go against whatever it's current average is..?
BMacZero
18
Years of Service
User Offline
Joined: 30th Dec 2005
Location: E:/ NA / USA
Posted: 20th Sep 2009 22:42
Quote: "Since our programs work on averages... how about a program that tries to go against whatever it's current average is..? "

Sorry, can you explain that a bit more ?



Neuro Fuzzy
17
Years of Service
User Offline
Joined: 11th Jun 2007
Location:
Posted: 20th Sep 2009 22:46
well... my program has more of a chance to choose the move that beats the move that the enemy chooses the most... so if the enemy knows what he chooses the most, then he can choose the move that beats the move that my program would likely choose...
Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 21st Sep 2009 00:11
What about doing some sort of pattern matching?

You could store the previous rounds, and try to find patterns in the other player's moves, and from that you could work out their next move

fearred
15
Years of Service
User Offline
Joined: 18th Sep 2009
Location:
Posted: 21st Sep 2009 03:45
You guys wanted an anti-average program I give you an anti-average program.
This is my WIP:


Just to show you how awesome it is I went head to head with a few people:
Note these tests were done out of 1000

BMacZero - 215
Me - 344

Neuro Fuzzy - 323
Me - 356

Aurum Knight - 333
Me - 334

For some reason Valle's code absolutely pwns mine 468-50 but I'll work on that.
Valle
18
Years of Service
User Offline
Joined: 10th Mar 2006
Location: in your girlfriends bed
Posted: 21st Sep 2009 13:43


This Code lets my new entry play 100 matches à 100 rounds against Player2. It works with patterns, thanks for the idea diggsey . Here are the battle-results against the other entries:

BMACZERO:
38 : 3

fearred:
100 : 0

neuro fuzzy:
10 : 10

Aurum Knight:
100 : 0

Aurum Knight v0.1:
56 : 15

my first entry:
12 : 12

Have fun guys !

and here is only the guessing section:




BMacZero
18
Years of Service
User Offline
Joined: 30th Dec 2005
Location: E:/ NA / USA
Posted: 21st Sep 2009 17:01
Dang, Valle's is getting good!



Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 21st Sep 2009 19:15
Looks like the competition is getting interesting

Neuro Fuzzy
17
Years of Service
User Offline
Joined: 11th Jun 2007
Location:
Posted: 22nd Sep 2009 02:05
Hmmm... I guess the best way for a program to beat other programs now is to try out several methods of anticipating what move the enemy will make next, and then mainly using that method.

and lmao, my program tied... pfft, that's all meh program can do!
Aurum Knight
16
Years of Service
User Offline
Joined: 15th Jul 2008
Location: the suburbs of nowhere
Posted: 22nd Sep 2009 05:11
Here's my latest entry. Don't have time to brag about it right now There may be unused variables and stuff in there... I'll optimize later...

Put as Player 2 for your convienience. It still draws with Neuro's...

BMacZero
18
Years of Service
User Offline
Joined: 30th Dec 2005
Location: E:/ NA / USA
Posted: 23rd Sep 2009 03:36 Edited at: 23rd Sep 2009 03:39
Damn, Aurum...your program runs some serious circles around mine



Very nice . Now I need to figure out why the heck mine devolved into cycles of scissors-paper-rock



Attachments

Login to view attachments
Aurum Knight
16
Years of Service
User Offline
Joined: 15th Jul 2008
Location: the suburbs of nowhere
Posted: 23rd Sep 2009 04:13
Haha, how did you get yours to lose like that? It tied almost every time I tried it against yours

Login to post a reply

Server time is: 2024-11-24 12:09:18
Your offset time is: 2024-11-24 12:09:18