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 Discussion / The DB Classic Programming Challenge Thread

Author
Message
t10dimensional
17
Years of Service
User Offline
Joined: 22nd Mar 2009
Location: Code Cave, USA
Posted: 27th May 2009 01:49 Edited at: 27th May 2009 04:24
what is wrong with my code. when i click the ball is soposed to be
at the mousex() and mousey() position.



If at first you don't succeed-Pause-Go to last checkpoint
NanoGamez guy
19
Years of Service
User Offline
Joined: 13th Jan 2007
Location: Closer than you think...
Posted: 27th May 2009 13:44
Thanks That1Smart Guy and Caleb!

@Caleb:
What that is is the stick goes in the direction that it points, but if it has got a lot of power then it goes so fast that it goes above the screen. Because the camera is following it, and it seems to stay roughly in the same x position relative to the camera, it just looks like it's going straight up. Thanks for the comment, I'll see what I can do about it.

@razerx:
Three things. First, you need to switch autocam off so that the angle of the camera stays at 0,0,0. Secondly, you need to position that camera at 320,240,-400 (or -500 if you've got a display mode of 800x600). Then position the ball like this:

position object 1,mx,480-my,0

Hope that helps.


"I trust you have prepared new insults for today" - Spock, Star Trek
That1Smart Guy
17
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 28th May 2009 23:55
I am going to 3d in a desperate attempt to beat nano, but im encountering a strange problem

is there some kind of priority system on keystate() like there is on inkey$()?

run this and press right shift to view the cannon from the side, then as you are viewing from this alternate angle, press an arrow key to rotate the camera as normal, but notice that it resets the camera to behind the cannon, why?!?!?!



There are only 10 kinds of people in the world, those who understand binary and those who dont
Phaelax
DBPro Master
23
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 29th May 2009 23:26
Made a few small updates to the http://dbchallenge.com website. Now when you view a user's list of code entries it'll display the total entry count and how many wins he has, so you don't have to go counting by hand. Nano and Latch are still tied for first with 8 wins each. By Latch has by far the most code submissions, 33 so far. Obese follows behind with 23. And a worthy mention to Comrade Robski, who has won 4 out of the 5 challenges he's entered.

I've also added my space invaders game to the website, source code and executable. It's written in DBP and works with the latest version, no external media was used in the graphics or sound.(dbp challenge entry)

Further updates on the back-end of things should help me manage the site a lot more easily.

[url="http://dbcc.zimnox.com"][/url]
That1Smart Guy
17
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 30th May 2009 00:10
cool, could some1 help me with my above question?

There are only 10 kinds of people in the world, those who understand binary and those who dont
Latch
19
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 30th May 2009 09:55 Edited at: 30th May 2009 10:05
Nice work Phaelax. That's a lot of time to volunteer.

@SmartGuy
Quote: "is there some kind of priority system on keystate() "

Not with keystate() but with scancode().

Quote: "run this and press right shift to view the cannon from the side, then as you are viewing from this alternate angle, press an arrow key to rotate the camera as normal, but notice that it resets the camera to behind the cannon, why?!?!?!"

I don't see that. It stays trained on the 90+object angle side. The camera of course rotates as the object rotates.

Enjoy your day.
NanoGamez guy
19
Years of Service
User Offline
Joined: 13th Jan 2007
Location: Closer than you think...
Posted: 30th May 2009 16:18 Edited at: 30th May 2009 16:21
@Phaelax
Site's looking great as usual, but I noticed that every time I click a link it opens in a new window, which can get a bit annoying. I'm using Chrome by the way.

@Smart Guy
Quote: "run this and press right shift to view the cannon from the side, then as you are viewing from this alternate angle, press an arrow key to rotate the camera as normal, but notice that it resets the camera to behind the cannon, why?!?!?!"

I don't notice that either, could it be something to do with your keyboard or computer?


"I trust you have prepared new insults for today" - Spock, Star Trek
Phaelax
DBPro Master
23
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 31st May 2009 00:01
Nano, not sure what could be causing the problem, maybe a setting in Chrome? I have chrome on my desktop and don't have that issue, the only link that should open a new window is viewing the code. Anyone else having this problem?

[url="http://dbcc.zimnox.com"][/url]
Libervurto
19
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 31st May 2009 01:17
What date does this challenge end?

@Phaelax
I don't get the window opening but your winner icons aren't displaying for me, I am on a PS3 though so maybe they are a format it doesnt understand. Most images do work on here though.

There is an eight letter word. You can insert a letter into it or remove a letter from it without changing its meaning. Answer
That1Smart Guy
17
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 31st May 2009 06:48
ends june 9th

There are only 10 kinds of people in the world, those who understand binary and those who dont
Phaelax
DBPro Master
23
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 31st May 2009 23:17
winner icons are animated gifs. Though I don't know why someone would use a PS3 to surf the net.

[url="http://dbcc.zimnox.com"][/url]
pictionaryjr
17
Years of Service
User Offline
Joined: 12th Mar 2009
Location:
Posted: 1st Jun 2009 04:00
My entry

That1Smart Guy
17
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 1st Jun 2009 05:15
ok, maybe its just this badass gaming computer im playin on but it seems to go by too fast to be enjoyed, interesting tho

There are only 10 kinds of people in the world, those who understand binary and those who dont
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 1st Jun 2009 12:21
That's cool!

I got to 20485... Is that in meters or kilometers?

TheComet


Make the path of your enemies easier with Waypoint Pro!
That1Smart Guy
17
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 1st Jun 2009 19:05
neither, its in pixels (sorry if that was supposed to be a joke and i didnt see it)

There are only 10 kinds of people in the world, those who understand binary and those who dont
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 1st Jun 2009 21:44
Yeah, it was a joke... It's cool anyway!

TheComet


Make the path of your enemies easier with Waypoint Pro!
t10dimensional
17
Years of Service
User Offline
Joined: 22nd Mar 2009
Location: Code Cave, USA
Posted: 1st Jun 2009 22:39 Edited at: 1st Jun 2009 23:09
that was like my demo and smartguys game mixed.

pretty cool tho I got over a 100000 on easy.

also it works better on 30 sync rate

If at first you don't succeed-Pause-Go to last checkpoint
Libervurto
19
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 2nd Jun 2009 02:29
Quote: "winner icons are animated gifs. Though I don't know why someone would use a PS3 to surf the net."

because their PC is a rusty pile of junk
Nearly have enough for a new one though!

There is an eight letter word. You can insert a letter into it or remove a letter from it without changing its meaning. Answer
Libervurto
19
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 2nd Jun 2009 02:35
@Nano
how did you learn to do fractals and perlin noise? I've looked on the net but I can't find anything helpful.
Or is it just really advanced maths that I don't understand?

There is an eight letter word. You can insert a letter into it or remove a letter from it without changing its meaning. Answer
That1Smart Guy
17
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 2nd Jun 2009 04:02
mind teaching us nano?

There are only 10 kinds of people in the world, those who understand binary and those who dont
Libervurto
19
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 2nd Jun 2009 06:04
After quite a while of searching I found a good explanation; just working through it now.
http://www.cygnus-software.com/theory/theory.htm

As a side note: I found this interesting bit of code...
Original in C

My translation to DB


What interested me is the if r^2 + i^2 <= 4.0; it's an OR gate: if either variable is greater than 2.0 the condition is true. If we removed the squares it would be an AND gate: both variables would have to be greater than 2.0.

I'm sure this can be implemented in things like zone checking (eg seeing if the mouse is within a rectangle) to condense the code to one line; if it is would it be faster than checking the upper and lower boundaries individually?
That is the question

There is an eight letter word. You can insert a letter into it or remove a letter from it without changing its meaning. Answer
NanoGamez guy
19
Years of Service
User Offline
Joined: 13th Jan 2007
Location: Closer than you think...
Posted: 2nd Jun 2009 19:58
@pictionaryjr
I love this game! It's surprisingly satisfying throwing the ball and watching it speed forward, although I think you should make the distance more simple, perhaps maybe kilopixels!

@Obese + That1Smart Guy
I used an L-system fractal for the trees. Basically, you generate a code for creating the fractal by starting off with an axiom and applying certain rules to it every iteration. The code it just a string of symbols, for example "F[+F[+X][F-X]][F-F[+X][F-X]]" (but usually much longer), where each symbol gives a command. The general commands are:

F Move forward one unit
f Move forward one units without drawing
+ Turn left by turning angle
- Turn right by turning angle
| turn 180 degrees
[ Save the current state to a stack
] Pop the state from the stack and set the drawer to it

I also used "X" and "Y", which depending of the fractal, can either mean draw forward or are there only to control the evolution of the fractal. The turning angle is different for each fractal, for example 15°.

You start with an axiom, say "X". For each iteration you apply a set of rules. For example ' "X" into "F[+X][F-X]" '. That means that in each iteration, every "X" in the code is replaced with "F[+X][F-X]". So:

After 1 iteration: F[+X][F-X]
After 2 iteration: F[+F[+X][F-X]][F-F[+X][F-X]]
After 3 iteration: F[+F[+F[+X][F-X]][F-F[+X][F-X]]][F-F[+F[+X][F-X]][F-F[+X][F-X]]]
etc...

You can have more than one rule as well. You repeat this for as many iterations as necessary, but you have to remember that the length of the code grows exponentially, so after 12 iterations there are 36856 symbols! (which is relatively small compared to some other fractals!)

Then all that is left to do is to draw it:


You can find more L-system fractals here. There are also many more types of fractal, such as orbital fractals and IFS fractals.

As for the perlin noise, this is a good webpage:
http://freespace.virgin.net/hugo.elias/models/m_perlin.htm


"I trust you have prepared new insults for today" - Spock, Star Trek
That1Smart Guy
17
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 2nd Jun 2009 22:41
.........wow

i didnt understand 1/4 of that, o well, nothing ventured, nothing gained

There are only 10 kinds of people in the world, those who understand binary and those who dont
Irojo
18
Years of Service
User Offline
Joined: 21st May 2008
Location: Eating toast.
Posted: 3rd Jun 2009 06:17
Okay, I've been working on this for literally upwards of three hours, tried remaking it, to no avail, and so I ask for help.

It's got no rems, the original had no rems (Horrible mistake...) and so I really have no idea what the heck my own (6+ months old) coding does. All I tried to do was make everything into arrays.

Oddly, I think I copied it right, but because of the simplicity of this program, the ninja moves faster than in the original program. Because the program runs faster, the ninja moves faster. This could very well be the issue. If you think so, please say so.

A possible issue is that the arrays controlling x# and y# somehow, somewhere, are essentially corrupted, and are simplifying the variable changes to x, y changes, not x#, y# changes. From some testing, this does not appear to be true.

Thanks for your time guys. I have my lesson learned about remming.... :S



The code below the loop is the original code. You should be able to figure it out. The only problem is the jumping. Press spacebar to jump.


Time is money. I just ripped you off.
That1Smart Guy
17
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 4th Jun 2009 07:11
hey nano could you post the code you used to make that yellow tree above?

and btw what is an axiom?

There are only 10 kinds of people in the world, those who understand binary and those who dont
NanoGamez guy
19
Years of Service
User Offline
Joined: 13th Jan 2007
Location: Closer than you think...
Posted: 4th Jun 2009 20:05
@Irojo
Coming on good, although I noticed that if you press the right of left keys mid-jump it causes a double jump (or is that meant to happen?).

@Smart Guy
An axiom is just the string that you start off, before you apply the rules to it each iteration. In the tree it's just "X", but it can be anything, like "F-G-G" in a Sierpinski triangle.

I will post the code, but just a few notes:
- I use numbers instead of strings in arrays, so "F" is '1', "f" is '2', and so on. This is just to speed things up (although it would be faster to use and array of strings with 255 characters in each, but I decided that it would be easier not to). I've got an array full of the conversions so that I can 'translate' the numbers into symbols.
- When I generate the code I use 2 arrays and switch between them and them copy the code into a final array. This is the easiest and (I think) the fastest way to do it.
- I use
because otherwise my screen goes into a fit of seizure inducing flashing frenzy!

OK, so here's the (fully remmed) code:



Enjoy!


"I trust you have prepared new insults for today" - Spock, Star Trek
Phaelax
DBPro Master
23
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 4th Jun 2009 20:21
Added a new page (found at top of the Tutorials page), a list of equations and algorithms.
http://dbchallenge.com/?page=eq

Some have slight explanations, but it's more intended to be used as a reference rather than learning material. There's some pictures that go along with a few of the descriptions which I forgot to upload.

[url="http://dbcc.zimnox.com"][/url]
That1Smart Guy
17
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 10th Jun 2009 05:35
alright today was/is the last day for the challenge, unless anyone has any entries/updates to post then let the votes be cast (although I think I know who won the challenge)

There are only 10 kinds of people in the world, those who understand binary and those who dont
pictionaryjr
17
Years of Service
User Offline
Joined: 12th Mar 2009
Location:
Posted: 10th Jun 2009 06:14 Edited at: 10th Jun 2009 06:14
Can we vote for ouselves

If not, I vote Nano
That1Smart Guy
17
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 10th Jun 2009 06:33
if you truly believe you had the best game then go ahead, but overall vote for the game you believe was best

my vote goes to nano

There are only 10 kinds of people in the world, those who understand binary and those who dont
That1Smart Guy
17
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 10th Jun 2009 06:44 Edited at: 10th Jun 2009 17:51
ok i think this is everyone who entered, sorry if I leave your name off, it wasnt intentional if i did:

Nano
That1SmartGuy
Caleb
Irojo
pictionaryjr
razerx
bn2

is that everyone?

also phaelax ur site doesnt include this challenge, or are you intentionally waiting until a challenge ends to add it?

There are only 10 kinds of people in the world, those who understand binary and those who dont
BN2 Productions
22
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 10th Jun 2009 07:44
you forgot me lol.

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
That1Smart Guy
17
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 10th Jun 2009 17:50
o sorry, its fixed

There are only 10 kinds of people in the world, those who understand binary and those who dont
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 10th Jun 2009 18:19
It's pretty tough to vote... SmartGuy did a nice job with the bounce thingies, I liked pictionaryjr's throw technique, and Nano made an awesome background. And the others did a very nice job too

For the gameplay, I vote pictionaryjr
For graphics, I vote Nano.

I am not like most of the people, so I go more for the gameplay in games, not for graphics, although, I am very impressed with the graphics, Nano, don't get me wrong.

So, I vote pictionaryjr.

TheComet


Make the path of your enemies easier with Waypoint Pro!
NanoGamez guy
19
Years of Service
User Offline
Joined: 13th Jan 2007
Location: Closer than you think...
Posted: 10th Jun 2009 22:01 Edited at: 10th Jun 2009 22:03
My vote goes to pictionaryjr,
By the way, I got 1.00305e+006 (1,003,050) on medium, which it didn't like and so the ball stopped immediately. But that was a mammoth throw and probably the fault of Darkbaic.

@Commet
Thanks, I totally agree, I much prefer good games with simple graphics, like N.


"I trust you have prepared new insults for today" - Spock, Star Trek
pictionaryjr
17
Years of Service
User Offline
Joined: 12th Mar 2009
Location:
Posted: 11th Jun 2009 06:02 Edited at: 11th Jun 2009 06:04
Hey I got a question, I don't know if its my version or what, but when i play nano's game the words come up really BIG. I think its my version of DBC though because instead of my version saying 1.2, it says 1.14. Can't figure it out.

EDIT
I installed the update thing like it tells you to in the read me, just to let you know its not that
Caleb1994
17
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 11th Jun 2009 06:13
Try putting a ,1 after all calls the the "text" commands.

New Site! Check it out \/
That1Smart Guy
17
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 11th Jun 2009 06:25
right now it 2-2 pictionary and nano, any tie breakers?

There are only 10 kinds of people in the world, those who understand binary and those who dont
Caleb1994
17
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 11th Jun 2009 06:54
I go Pictionary, Sory Nano lol

New Site! Check it out \/
That1Smart Guy
17
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 11th Jun 2009 07:14
its 3-2 pictionary's is the lead with nano following

ill give 1 more day since not everyone has voted, at 11:00 pm tommorow the vote shall be taken

there are 7 entrants so a tie is impossible unless someone doesnt vote, in which case we will accept votes from the general public

There are only 10 kinds of people in the world, those who understand binary and those who dont
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 11th Jun 2009 16:04
Quote: "Thanks, I totally agree, I much prefer good games with simple graphics, like N."


*Sigh* -- Yes, the N was a GREAT machine...

Cmon, guys! Vote!

TheComet


Make the path of your enemies easier with Waypoint Pro!
Phaelax
DBPro Master
23
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 11th Jun 2009 19:32
I can't vote, no way to test the games on Mac.

Smart Guy, I didn't get a chance to add the challenge yet, I'll get it this week though after a winner is chosen.

[url="http://dbcc.zimnox.com"][/url]
That1Smart Guy
17
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 11th Jun 2009 19:45
and no offense phaelax but u actually cant vote, right now only entrants can vote and i dont recall you entering

There are only 10 kinds of people in the world, those who understand binary and those who dont
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 11th Jun 2009 20:48
Quote: "right now only entrants can vote and i dont recall you entering"


Oh, so I can't vote... So it's 2 to 2. What if there are only 2 entrants?

TheComet


Make the path of your enemies easier with Waypoint Pro!
That1Smart Guy
17
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 11th Jun 2009 20:54
there's 7 entrants, and i didnt realize u didnt enter, ill use urs as a tie breaker should one occur comet

There are only 10 kinds of people in the world, those who understand binary and those who dont
BN2 Productions
22
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 11th Jun 2009 20:57
I will give comet my vote, since i never got around to trying out any of the other challenges and idk if I will get the chance (it is move out day for me).

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
That1Smart Guy
17
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 11th Jun 2009 21:11
ok so its back to 3-2, pictionary-nano

There are only 10 kinds of people in the world, those who understand binary and those who dont
Caleb1994
17
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 11th Jun 2009 21:39
AHHH sorry never uploaded mine, so i didn't eenter either... sorry.

New Site! Check it out \/
That1Smart Guy
17
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 11th Jun 2009 21:52
ok caleb, ill use you like i was planning on using comet, if there is a tie u'll be the tiebreaker

There are only 10 kinds of people in the world, those who understand binary and those who dont
pictionaryjr
17
Years of Service
User Offline
Joined: 12th Mar 2009
Location:
Posted: 11th Jun 2009 23:18
haha so confusing

Login to post a reply

Server time is: 2026-06-07 00:04:28
Your offset time is: 2026-06-07 00:04:28