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
ThinkDigital
20
Years of Service
User Offline
Joined: 18th Aug 2005
Location: A galaxy far, far away...
Posted: 25th Jun 2007 13:59
Oh, on mine, you'll want to play at 1024x768 res if you want to see it how it's supposed to be. (Didn't want to edit, you might think I'd changed my code after the deadline )

And Pricey, that was very fun to play. Nice.

"Variables won't, constants aren't."
Diggsey
20
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 25th Jun 2007 19:18 Edited at: 25th Jun 2007 20:04
OK, the deadline is up, and I'm now judging the entrants

I will edit when I have finished.

edit:
Here are the results!

In order of submission:

Daemon
Good level editor, and I liked the rolling cubes, but it needed a way to win/lose.

ThinkDigital
Very fun game, good collision, and was quite fast paced. Tanks and firing was very good.

Pricey
Excellent idea, I can see why it took a long time. Was quite challenging and very fast paced (Mainly due to not being able to go backwards, and having to turn around!). Collision was good, and a good, if simple, level editor.

The winner is...


The runner up:


Pricey
23
Years of Service
User Offline
Joined: 22nd Feb 2003
Location:
Posted: 25th Jun 2007 20:53
woww! i'm so happy!
thanks diggsey!
i really enjoyed playing everyone's entry btw!

okay, so i get to set one now?

how about a traffic simulation?
i've always wanted to do this, but struggled with it
lets see how you do!

sort of like the way the cars drive around in GTA, just a simple road system, with traffic lights, and cars that obey the simple rules of the road, eg. driving on the correct side of the road, avoiding hitting each other, stopping at lights!

good luck

Diggsey
20
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 25th Jun 2007 21:06
Good idea

What will the deadline be?

Pricey
23
Years of Service
User Offline
Joined: 22nd Feb 2003
Location:
Posted: 25th Jun 2007 21:11
ohh, well i assumed it was 2 weeks for everything!
so 2 weeks, but if you think that's not long enough, i'll change it!

flashing snall
20
Years of Service
User Offline
Joined: 8th Oct 2005
Location: Boston
Posted: 25th Jun 2007 21:52
nooooooo!. how inconvienant. my computer just got fixxed yesterday, no were near enough time to finish. oh well. nice job to the winners. mine came no were near to yours.
time to learn to use ai


"these shoes are 300 hundred dollars"-Shoes by Kelly http://smallgroupproductions.com/
acelepage
22
Years of Service
User Offline
Joined: 2nd Jun 2004
Location: Plattsville
Posted: 25th Jun 2007 22:03
Pricey,
I have often thought about how a driving simulation might be used to figure out why traffic comes to a halt on the 401 with no visible reason. Maybe someone just hit the brakes for no reason.

This sounds pretty open ended. Are you looking for an interactive simulation, or a hands off, or shall we just do whatever?

( 2b || !2b ), that is the question. The answer: true
Pricey
23
Years of Service
User Offline
Joined: 22nd Feb 2003
Location:
Posted: 25th Jun 2007 22:53
do whatever you think will impress me the most, within your coding ability!

ThinkDigital
20
Years of Service
User Offline
Joined: 18th Aug 2005
Location: A galaxy far, far away...
Posted: 25th Jun 2007 23:10 Edited at: 25th Jun 2007 23:14
Sweetness. Sounds like a wide-open, general challenge - my favorite.

Traffic sim should be interesting indeed, though I assume you're talking cars just driving around by themselves, not the player driving around.

"Variables won't, constants aren't."
Pricey
23
Years of Service
User Offline
Joined: 22nd Feb 2003
Location:
Posted: 25th Jun 2007 23:19
whatever you like!

NA170425
User Deleted
Posted: 25th Jun 2007 23:47
Hmm I think I'll enter this, it could help me finally learn pathfinding Ai.

You never really know a person until you look at their google autocomplete entries.
Ric
22
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 27th Jun 2007 15:06
Been away for a while (small matter of getting married) so I missed out on Diggsey's challenge, but there's been some great stuff going on here.

Congratulations Pricey - that is without doubt one of the best entries to a challenge we have had in a long time. There is one heck of a lot in there - AI, sliding collision, bullet collision, animation - and of course, a complete level editor. Very nice job - and anyone that hasn't had a look at it yet really should.

A traffic simulation is an excellent idea for a challenge. This is a proper AI challenge which could be taken in a number of different directions. If it hasn't been done already, I'll make an announcement on the main board.

MadrMan
20
Years of Service
User Offline
Joined: 17th Dec 2005
Location: 0x5AB63C
Posted: 27th Jun 2007 17:08
Yay i'm in on this one.. had a code to make a horrible city lying around so expect some competition! (Even though ill probably get lost in making the traffic work)

Oh and ric, you might not need to do any collision.. just code it wisely
Ric
22
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 27th Jun 2007 17:25
Well - in order for cars to avoid collisions, I'd assume you would need to do some sort of perimeter checking, which is a form of collision checking. I suppose you could simply hard-code the routes of the cars in such a way that they never come into contact - but that wouldn't be nearly as much fun! But yeah, either way, some wise coding will definitely be needed. (Unless you were actually wanting to simulate some nice crashes!) This is certainly going to be one interesting challenge.

qwe
22
Years of Service
User Offline
Joined: 3rd Sep 2003
Location: place
Posted: 30th Jun 2007 04:05
you guys better work hard on this one, qwe returns
ThinkDigital
20
Years of Service
User Offline
Joined: 18th Aug 2005
Location: A galaxy far, far away...
Posted: 30th Jun 2007 04:18
My computer has gone and exploded on me I'll see if I can't get it fixed but obviously this competition is not my biggest problem

Still looking forward to see what you guys come up with, even if I can't test it at the moment

"Variables won't, constants aren't."
Darth Vader
21
Years of Service
User Offline
Joined: 10th May 2005
Location: Adelaide SA, I am the only DB user here!
Posted: 1st Jul 2007 14:01
Completely of the subject of coding, Congradulations Ric on your recent Marraige!


Ric
22
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 1st Jul 2007 15:11
Thanks DV! I'll be posting a few photos on the Geek Culture thread later today or tomorrow. Our photographer went mad and took 918 photos. (But I promise not to post all of them!!)

Darth Vader
21
Years of Service
User Offline
Joined: 10th May 2005
Location: Adelaide SA, I am the only DB user here!
Posted: 1st Jul 2007 15:32
That's alot of photos!
It's good though atleast you'll both have lots of memories.


Phaelax
DBPro Master
23
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 1st Jul 2007 18:01
Quote: "A few thongs you could improve:"

thongs???



traffic simulation, the first thing that comes to mind is frogger!


Pricey
23
Years of Service
User Offline
Joined: 22nd Feb 2003
Location:
Posted: 2nd Jul 2007 00:28
haha! frogger taking place across a huge city with an advanced working traffic system! that would be something spectacular!!

qwe
22
Years of Service
User Offline
Joined: 3rd Sep 2003
Location: place
Posted: 2nd Jul 2007 08:49
here, have fun with a city i made of variable size (in # of blocks). the cars don't obey traffic laws yet, though

Pricey
23
Years of Service
User Offline
Joined: 22nd Feb 2003
Location:
Posted: 2nd Jul 2007 09:55
way heyyy!
that looks amazing!
can't wait for you to get the traffic working!

Ric
22
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 2nd Jul 2007 12:50
Whoa - impressive, qwe!

Spopovich
20
Years of Service
User Offline
Joined: 12th Jul 2006
Location:
Posted: 3rd Jul 2007 05:08
Nice city, qwe, definitely prettier than mine. Anyway still have some stuff to do but the traffic lights change, and the cars just go straight but obey the lights.



It runs at about 15 fps for me. If it drops really low for anyone please let me know.

Do not ask what the forums can do ask what you can do for the forums.
Dbproguy
19
Years of Service
User Offline
Joined: 1st Nov 2006
Location: At my computer desk no-life programming
Posted: 3rd Jul 2007 07:13 Edited at: 3rd Jul 2007 07:14
u said let you know, I got usually around 4, sometimes even 3 or 2, couple times it was 1

I'm such a n00b
[/url]
qwe
22
Years of Service
User Offline
Joined: 3rd Sep 2003
Location: place
Posted: 3rd Jul 2007 12:46 Edited at: 3rd Jul 2007 13:01
i get 25 fps on spo's

what fps do people get on mine (100-150 for me)
Ric
22
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 3rd Jul 2007 14:00
Nice one Spopovich - I'm only getting 7 fps compared to the 30 fps I get for qwe's code - shouldn't worry too much, as my computer is ancient, but it seems to be the traffic lights that are causing the hit - without them I'm back up to 32 fps ..... perhaps cloning/instancing would improve things.

Pricey
23
Years of Service
User Offline
Joined: 22nd Feb 2003
Location:
Posted: 3rd Jul 2007 17:34 Edited at: 3rd Jul 2007 17:37
umm

move camera up 1,10

returns an error for me =S
does that command even exist?

when i sorted that error, it returned an error in your texure making routine, possibly because it defaults to running in 640x480 mode, and you are trying grab a 500x750 area.

a simple "set display mode 1024,768,16"

at the start sorts that out!

other than that very good!

Spopovich
20
Years of Service
User Offline
Joined: 12th Jul 2006
Location:
Posted: 3rd Jul 2007 18:52
Oops that command is in one of Ian M's dll's. I have some work ahead of me today, but its summer, so I have time.

Do not ask what the forums can do ask what you can do for the forums.
Pricey
23
Years of Service
User Offline
Joined: 22nd Feb 2003
Location:
Posted: 3rd Jul 2007 20:41
i'm trying to figure out why that code runs so slow...
30FPS on a 3.0ghz p4 can't be good...

but its cool watching the cars stop and go at the lights!!

Spopovich
20
Years of Service
User Offline
Joined: 12th Jul 2006
Location:
Posted: 3rd Jul 2007 21:31
I think I know why, I had a lot of unnecessary collision checks and my stop lights were each like fifteen objects. So far to speed things up I turned the stop light parts into limbs and now I'm going to fix the massive use of collision checks.

Do not ask what the forums can do ask what you can do for the forums.
Pricey
23
Years of Service
User Offline
Joined: 22nd Feb 2003
Location:
Posted: 3rd Jul 2007 22:06
ahh cool =)
can't wait to see it working faster!
because that means more cars! which means a more interesting simulation!

qwe
22
Years of Service
User Offline
Joined: 3rd Sep 2003
Location: place
Posted: 4th Jul 2007 04:38 Edited at: 4th Jul 2007 04:41
yeah i just commented out the move cam up command, and i also had to switch it to 1024x768

as a side note, if you want to compare FPS, set the gridsize variable to 11 at the beginning so there are the same number of blocks in my program and spo's. set maxcars too

i just bought battlefield 2, so progress has slowed:p
Pricey
23
Years of Service
User Offline
Joined: 22nd Feb 2003
Location:
Posted: 4th Jul 2007 12:42
haha!, interestingly, in your code spopovich, if i change it so it makes say 300 cars... the same amount of cars always seems to appear!

qwe
22
Years of Service
User Offline
Joined: 3rd Sep 2003
Location: place
Posted: 7th Jul 2007 03:57
what day is this challenge over?
Spopovich
20
Years of Service
User Offline
Joined: 12th Jul 2006
Location:
Posted: 7th Jul 2007 05:09
I think it ends the ninth.

Anyway I've been working hard, and I've fixed lots of stuff. It now runs alot faster, you can have many cars. I also added in right turns, but sometimes the cars get messed up and they don't turn ninety degrees and start going through buildings and stuff. They also leave the city and float off into space. So fixing those two things is my goal. Might as well post what I have now though.



I have a lot to do.

68% of rupublicans don't beleive in evolution but, only 5% of monkeys believe in republicans. ~Stephen Colbert 2007
Pricey
23
Years of Service
User Offline
Joined: 22nd Feb 2003
Location:
Posted: 7th Jul 2007 10:57
it worked for about a minute really well!
but then i started to see crashes resulting in huge traffic jams!
which is very realistic!

well done!

Ric
22
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 7th Jul 2007 12:18
Very nice Spopovich - worked nicely until some learner driver stopped in the middle of a junction and caused a pile up, and the guy at the back of the queue got frustrated and decided to drive through a brick wall! Pretty realistic, though!

gadgetfreak 66
19
Years of Service
User Offline
Joined: 26th Sep 2006
Location: Kulin,WA, Australia
Posted: 7th Jul 2007 16:09 Edited at: 7th Jul 2007 16:11
Okay, here's my entry so far:


It's kinda different than the others in that it concentrates on road and traffic, and you can put down the road yourself. I guess the main difference is the others two are lots of 4-way intersections in city blocks, but this should cater for different road designs.

Controls:
Right click - Move Camera
Middle click - Rotate Camera
Scroll wheel - Zoom (I think it might crash if you go out too far.)
Left click - Lay down/destroy road
Enter - Create car at spawn point

Just a few notes, it doesn't like having large roaded areas, with intersections right next to others in a big solid block, as gridlock will set in pretty soon. Another thing, you will see a lot of cars making u-turns in the middle of the road. This is either because they have reached their destination, and have acquired a new one, or the previous path they were taking is no longer available. Also, make sure all road is connected, otherwise the program
will crash sooner or later.

Pricey
23
Years of Service
User Offline
Joined: 22nd Feb 2003
Location:
Posted: 7th Jul 2007 17:12
that is really something very good!!
i love the way you can build the road!
and the traffic is very realstic! a few minor bumps here and there but it all adds to the realism!

excellent!

it would be EVEN BETTER if there were traffic lights / pedestrian crossings!
but even without, it is still excellent!

Spopovich
20
Years of Service
User Offline
Joined: 12th Jul 2006
Location:
Posted: 7th Jul 2007 19:20
Wow thats awesome. It reminds me lot of sim city. Constructing your own road was a great idea.

68% of rupublicans don't beleive in evolution but, only 5% of monkeys believe in republicans. ~Stephen Colbert 2007
gadgetfreak 66
19
Years of Service
User Offline
Joined: 26th Sep 2006
Location: Kulin,WA, Australia
Posted: 8th Jul 2007 04:51
Thanks guys!

@ Pricey:
One of the next things on my to do list is, as you said, traffic lights. I might try and put in some buildings as well, so the destinations aren't just random sections of road. Then again, time is running out....

qwe
22
Years of Service
User Offline
Joined: 3rd Sep 2003
Location: place
Posted: 8th Jul 2007 06:59
traffic works now. suggestions for better looking cars would b appreciated as they look horrible

Ankillito
19
Years of Service
User Offline
Joined: 10th Dec 2006
Location: Litigious California
Posted: 8th Jul 2007 10:04
very cool qwe!

As hypocritically as possible, seeing as I haven't entered anything, may I comment on:


When turning, they don't turn, they just go at 45 degree angles - it works, I guess

The cars back up if they approach a yellow/red light until they are at a safe distance - very odd

Lines on the street at intersections showing where cars should stop at would be more realistic and show how accurate your logic is...

As for cars, try a randomly making trucks, SUZs and such by changing the proporitons of the car...

"There will always be evil, for, without evil, the good shall lose their virtue."
NA170425
User Deleted
Posted: 8th Jul 2007 15:07
Very nice qwe! You might want to fix the cars backing up, if you set the number of cars high enough they never have enough time to even get to the light before it turns red again.

You never really know a person until you look at their google autocomplete entries.
Ric
22
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 8th Jul 2007 22:52
There's some quality coding going on here - just tried out qwe's and Gadgetfreak's entries - both very different, but both excellent. I think Pricey's going to find this one difficult to judge!

Quote: "if you set the number of cars high enough they never have enough time to even get to the light before it turns red again."


Well that sounds pretty realistic for most cities during rush hour - the thing I thought was a bit funny in qwe's entry though, is that I swore I saw two cars got caught in the middle of a junction when the lights turned red, and they both reversed back to where they came from to clear the junction!

The only thing a bit funny with Gadgetfreak's entry is the number of u-turns the cars make ... and occasionally cars pass through each other, but it's still really good - and very sim-city like.

gadgetfreak 66
19
Years of Service
User Offline
Joined: 26th Sep 2006
Location: Kulin,WA, Australia
Posted: 9th Jul 2007 09:37 Edited at: 9th Jul 2007 09:38
Traffic lights are working now, but the cars are still choosing a random bit of road as their destination, so there are still lots of u-turns as they reach it and pick a new one.

Either click the icons in the top left to change tool, or hit tab.



Pricey
23
Years of Service
User Offline
Joined: 22nd Feb 2003
Location:
Posted: 9th Jul 2007 15:22
okay, its 2 weeks today that i set this challenge

i'm not sure what i'm meant to do though

it'd seem to me that people would still be able to post entries unti midnight today, and i'll judge tomorrow?
is this correct!?

acelepage
22
Years of Service
User Offline
Joined: 2nd Jun 2004
Location: Plattsville
Posted: 9th Jul 2007 16:03
Here is my entry.
This is meant to give a complete view of a road map, to observe traffic patterns.
I didn't have time to complete the traffic lights, so there are just stop signs.



( 2b || !2b ), that is the question. The answer: true

Login to post a reply

Server time is: 2026-07-17 14:07:59
Your offset time is: 2026-07-17 14:07:59