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
RedFlames
18
Years of Service
User Offline
Joined: 25th Aug 2007
Location: Germania
Posted: 25th Oct 2007 17:45
lol it was a challenge itself to translate those example toys to german, but finally i got what you want us to do
And i like this challenge because i hope its less math

flashing snall
20
Years of Service
User Offline
Joined: 8th Oct 2005
Location: Boston
Posted: 26th Oct 2007 01:54
hmm. does it have to be toy? what about a machine? that does nothing.


"these shoes are 300 hundred dollars"-Shoes by Kelly http://smallgroupproductions.com/
Doc Evil
18
Years of Service
User Offline
Joined: 11th Oct 2007
Location: Unfortunately - UK, Planet Earth
Posted: 26th Oct 2007 11:41
@ flashing snall

Yes it can be a machine, or anything that has no real use. I just want to see the power and ease of Dark Basic's 3d commands.

There is nothing wrong with me, I was just born on the wrong planet!
Doc Evil
18
Years of Service
User Offline
Joined: 11th Oct 2007
Location: Unfortunately - UK, Planet Earth
Posted: 27th Oct 2007 22:32
Quote: "My challenge is an Executive Toy Simulation in 3D"


Just some examples of the type of thing I'm looking for:



I'll be judging source code submissions only and just like the saying, "You can't judge a book by its cover.", I'll be marking on well structured and documented (plenty of rem's ) code.

Just so you know I'll be working hard on coding, and not sunbathing
on my remote dormant volcano for the next 3 weeks, I've come up with a NEW way to solve a maze and will be busy turning it into Dark Basic instructions for my all singing dancing take over the world MazeMaster V2.0 program.

There is nothing wrong with me, I was just born on the wrong planet!
Image All
20
Years of Service
User Offline
Joined: 30th Dec 2005
Location: Home
Posted: 28th Oct 2007 17:16


calcyman
18
Years of Service
User Offline
Joined: 31st Aug 2007
Location: The Uncertainty Principle
Posted: 28th Oct 2007 21:22 Edited at: 28th Oct 2007 21:32
My pin pression toy: (very memory-intensive)



Here's a screenshot:



Your signature has been erased by a hyper-intelligent pan-dimensional being (a mod)
Doc Evil
18
Years of Service
User Offline
Joined: 11th Oct 2007
Location: Unfortunately - UK, Planet Earth
Posted: 28th Oct 2007 23:42
@ calyman

Wow! I'm amazed by how such a little amount of code, can create such a 3d visual effect.

Very nice look and feel to it, although could it be possible to create more realistic looking pins. The ones on my Pin Pression toy look just like nails, they have a head and are cylinder shape.

The shadows created as you rotate the sculpture are very nice, but are not how I would expect them to behave if I were rotating the sculpture on a turn table. Is it because rather than rotating the sculpture, the viewer is moving round the object?

Well documented, and looks like an efficient piece of coding. Very relaxing movement of the pins forming waves. Is it possible for the colours of the pins to slowly change as if the light source was changing?

There is nothing wrong with me, I was just born on the wrong planet!
Image All
20
Years of Service
User Offline
Joined: 30th Dec 2005
Location: Home
Posted: 29th Oct 2007 04:29 Edited at: 29th Oct 2007 04:43




Tar dar!

BMacZero
20
Years of Service
User Offline
Joined: 30th Dec 2005
Location: E:/ NA / USA
Posted: 29th Oct 2007 05:49 Edited at: 29th Oct 2007 05:52
Hi guys,

I'm working on a Newton's Cradle (my first entry here, I think). However I'm having some problems with getting the ball to swing along its arc (right now I'm just trying to confine the ball to that arc)

Here's the code:


The way I'm trying to make it work by allowing the user to set the ball's X position by dragging it, and then using the Distance Formula [d=SQRT((Y2-Y1)^2+(X2-X1)^2)] to determine where the ball's Y position should be to keep it the same distance from the pivot. (I'll get to the momentum part later).
I'm using a brute force method to solve for Y, I just test each possible Y position and see which one gets the closest.

However, as you can see if you run the code, all the balls do is twitch around a bit when you click on them. Does anyone who's good at algebra see any obvious problems here?

Edit: And I now notice that Doc Evil wanted them in 3D. Oh well, that's fairly easy to fix I suppose, and it doesn't change the equation.

Thanks,


"Fire is always at the top of the food chain, and it has a big appetite."
calcyman
18
Years of Service
User Offline
Joined: 31st Aug 2007
Location: The Uncertainty Principle
Posted: 29th Oct 2007 18:28
@bmaczero - Good work, it would be better if you used a formula rather than trial-and-error to find it's y position.

perhaps:

y = sqrt((r^2)-(x^2)). (x and y are the offsets relative to the centre, r is the radius)

But if you look at a circle, you will notice there are 2 values of y for each x value. You will have to determine whether the ball is above or below the center.

That eliminates the trial-and-error, possibly solving your problem.

@Image All - Whoa! your pin pression program works better than mine, and (presumably) uses collision data or the INTERSECT OBJECT() expression.

@Doc Evil:

Is this better:



Your signature has been erased by a hyper-intelligent pan-dimensional being (a mod)
acelepage
22
Years of Service
User Offline
Joined: 2nd Jun 2004
Location: Plattsville
Posted: 29th Oct 2007 18:46
Just thought I would offer a screen shot of my progress, to show that I have one in the works. Currently working on the collision and friction stuff.


( 2b || !2b ), that is the question. The answer: true
Ric
22
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 29th Oct 2007 20:05
Wow! How cool does that look?!

BillR
23
Years of Service
User Offline
Joined: 19th Mar 2003
Location: United States
Posted: 29th Oct 2007 23:38
@calcyman - Nice! but a slow 9 fps on my older computer

so I added a few lines...
set display mode 1024,768,32
sync on
sync rate 0

make object sphere 65001,12,8,8

print screen fps()
sync
got it up to 20 fps, then changed res to 1024,768,32, ended up with 18fps

hope this helps
BMacZero
20
Years of Service
User Offline
Joined: 30th Dec 2005
Location: E:/ NA / USA
Posted: 30th Oct 2007 00:50
@calcyman
Yeah, I did notice the fact that there might be two right answers, but that still didn't explain the circle's behavior. That equation looks good, I'll try that later, but unfortunately I have a truckload of homework tonight, so it might have to wait.

Thanks,


"Fire is always at the top of the food chain, and it has a big appetite."
Doc Evil
18
Years of Service
User Offline
Joined: 11th Oct 2007
Location: Unfortunately - UK, Planet Earth
Posted: 30th Oct 2007 20:59
@ everyone

I can see I'm going to have my work cut out trying to decide on a
winner for this competition. Keep up the good work, and remember
I'll be looking for "nice" code as well as the running of the
program.

@ calyman

Like the new look of the pins.

There is nothing wrong with me, I was just born on the wrong planet!
jason p sage
19
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 1st Nov 2007 18:27
Quote: "
eg. 'pitch object down 1,1'

is exactly the same as

'zrotate object 1,object angle z(1)+1'
"


Wrong. Its not the same. It's a bit more complex internally than this - and it does it pretty fast as far as I can tell.

calcyman
18
Years of Service
User Offline
Joined: 31st Aug 2007
Location: The Uncertainty Principle
Posted: 1st Nov 2007 18:57
@Jason p sage:

Agreed - The ZRotates are global, and about the X,Y,Z axes. The Pitch commands are local, and are about the forwards-backwards, left-right, and up-down axes relative to the object's direction.

Different commands are applicable in different situations, to avoid gimbal-lock issues.

Mostly, they are interchangeable though.

Your signature has been erased by a hyper-intelligent pan-dimensional being (a mod)
acelepage
22
Years of Service
User Offline
Joined: 2nd Jun 2004
Location: Plattsville
Posted: 7th Nov 2007 15:06
Here's my entry. I worked on it during lunch breaks. Glad to have 3 weeks as I would not have been able to complete it in 2.



( 2b || !2b ), that is the question. The answer: true
Ric
22
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 7th Nov 2007 17:06
That's brilliant. One of these days - when I retire maybe and have loads of time, I might compile a top ten best ever challenge entries list - and I'm pretty sure this one would be in it. I like the little touches like the way the arm bounces when it returns to its starting position. Inspiring!

Doc Evil
18
Years of Service
User Offline
Joined: 11th Oct 2007
Location: Unfortunately - UK, Planet Earth
Posted: 7th Nov 2007 17:33
@acelepage:

Fantastic!!!

The balls roll, bounce and appear to move in a realistic fashion. It is also very compelling to watch,even though you don't have any control over the machine. You would be wise to spend the next week coming up with an idea for the next competition, but it's not over until the evil doctor sings

@everyone:

I hope that brilliant entry has not discouraged other life forms from entering, as there is still over a week to polish off your masterpieces.

There is nothing wrong with me, I was just born on the wrong planet!
acelepage
22
Years of Service
User Offline
Joined: 2nd Jun 2004
Location: Plattsville
Posted: 7th Nov 2007 17:43 Edited at: 7th Nov 2007 17:51
For some reason I thought that 3 weeks was up. I didn't realize that there is still another week to go.
That is good, lots of time for more entries to arrive.

I guess I am now free to help out with anyone else's code. I learned a lot about limbs, linking and gluing on this one.

( 2b || !2b ), that is the question. The answer: true
RedFlames
18
Years of Service
User Offline
Joined: 25th Aug 2007
Location: Germania
Posted: 7th Nov 2007 21:01
I had my code nearly done since a week, now i finished and commented it (nearly every line lol )

And it is....


Here's the code, a Screenshot attached.


But it cant beat acelpage's cool machine

Ric
22
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 7th Nov 2007 22:05
Hey - I always wanted one of those! Cool!

Spopovich
20
Years of Service
User Offline
Joined: 12th Jul 2006
Location:
Posted: 8th Nov 2007 04:03
A small entry i just whipped up. Acelepage, thats pretty awesome.



I'll probably document my code a little more tomorrow but I'm really tired now.

68% of rupublicans don't beleive in evolution but, only 5% of monkeys believe in republicans. ~Stephen Colbert 2007
Ric
22
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 17th Nov 2007 17:34
That's pretty cool. Not quite sure why you have created a second camera (camera zero is the default camera which is available automatically - so 'make camera 1' actually creates a second camera).

The deadline for this challenge, just incase anyone couldn't find it, is tomorrow (Sunday 18th). I may just get an hour tomorrow morning to whip up a quick last minute entry too.

Ric
22
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 18th Nov 2007 19:14 Edited at: 18th Nov 2007 19:15
Here's my last minute entry - Newton's Cradle.





calcyman
18
Years of Service
User Offline
Joined: 31st Aug 2007
Location: The Uncertainty Principle
Posted: 18th Nov 2007 20:57
@Ric:

Very cool!!!! - The reflections cannot be seen until you turn the ambient light up to about 70 though. It would look even better if you made the balls slow down as time progresses, which can be done in 3 lines of code.

@Everyone - I have enhanced my program slightly:



(It now changes colour, using a function I wrote earlier, but didn't publish until now)

Your signature has been erased by a hyper-intelligent pan-dimensional being (a mod)
acelepage
22
Years of Service
User Offline
Joined: 2nd Jun 2004
Location: Plattsville
Posted: 18th Nov 2007 23:05
@Ric
Very slick. It has a real nice executive look to it.
And your code is very neat and tidy.

( 2b || !2b ), that is the question. The answer: true
Ric
22
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 19th Nov 2007 00:49
Thanks!

@Calcyman - I coded it in quite a dark room, so I guess the reflections appeared a bit brighter to me. To get them to appear brighter, it's best to reduce the opacity of the ground at the end of the make_ground() function: set alpha mapping on ground,90

BMacZero
20
Years of Service
User Offline
Joined: 30th Dec 2005
Location: E:/ NA / USA
Posted: 19th Nov 2007 03:45
@Ric
That's pretty spiffy! I like the reflections.

Here's mine (converted to 3D), unfortunately it doesn't move so I'm not submitting it as an entry. I was going to use limbs for easy rotating, but I was having a lot of trouble with the "Offset Limb" command, and other projects occupied my attention.
I hope I can get into the next project.




"Fire is always at the top of the food chain, and it has a big appetite."
Hobgoblin Lord
20
Years of Service
User Offline
Joined: 29th Oct 2005
Location: Fall River, MA USA
Posted: 19th Nov 2007 06:35
@Ric: looks great, the relections seem to be quite clear on my machine. WOuld be even better if you could choose multiple balls to clack, I especially love when you can take the 2 end balls and drop them both so they both hit and retreat at the same time.

Duffer
23
Years of Service
User Offline
Joined: 9th Feb 2003
Location: chair
Posted: 19th Nov 2007 09:26
@ H..Lord,

Sorry to be off topic. Your WIP on the RPG engine has locked - how's it going?

a long time dabbler with DBC and DBPro with no actual talent but lots of enthusiasm...
Hobgoblin Lord
20
Years of Service
User Offline
Joined: 29th Oct 2005
Location: Fall River, MA USA
Posted: 19th Nov 2007 11:23
I have no time to work on it as of the last 6 or so months, work has taken up all my time and still taking classes, all I have been doing is story work. eventually I will get back to it.

Doc Evil
18
Years of Service
User Offline
Joined: 11th Oct 2007
Location: Unfortunately - UK, Planet Earth
Posted: 19th Nov 2007 19:46 Edited at: 21st Nov 2007 23:42
Doc evil is singing, which means the deadline for my challenge has expired.

There is nothing wrong with me, I was just born on the wrong planet!
Doc Evil
18
Years of Service
User Offline
Joined: 11th Oct 2007
Location: Unfortunately - UK, Planet Earth
Posted: 19th Nov 2007 19:55 Edited at: 21st Nov 2007 23:43
I'm busy on a new plan to take over the world, but will put it on hold
while I judge the following entries.

Ric - Newton's Cradle
Spopovich - knickknack
calcyman - Pin Pression Adaptation
RedFlames - Lava Lamp
acelepage - Balls Machine
Image All - Pin Pression Simulation

All were very good and was just what I was looking for. The winner was quite
easy to pick, but I had real trouble selecting a runner-up. Nice to see plenty
of documentation in all of the programs.

Runner-up:



The overall grand supremo winner of the "Executive Toy" challenge is:



There is nothing wrong with me, I was just born on the wrong planet!
Spopovich
20
Years of Service
User Offline
Joined: 12th Jul 2006
Location:
Posted: 19th Nov 2007 21:44
@Ric
I love it, its so shiny. As for why do I make another camera, I don't really know but I've gotten into a habit so why stop now

68% of rupublicans don't beleive in evolution but, only 5% of monkeys believe in republicans. ~Stephen Colbert 2007
acelepage
22
Years of Service
User Offline
Joined: 2nd Jun 2004
Location: Plattsville
Posted: 19th Nov 2007 22:13
Well, that was a fun challenge.

For the next challenge, I would like to see some morphing or transforming. This can be 2D or 3D. Basically, start with an object, it can be a simple primitive (like a cube, or sphere), and morph it into another object. Could be like a transformer, or the liquid metal terminator, or a box that keeps unfolding into something.

Points will be awarded for smooth animation, and original ideas.

Challenge start date: Nov. 19
Challenge end date: Dec. 2

( 2b || !2b ), that is the question. The answer: true
Spopovich
20
Years of Service
User Offline
Joined: 12th Jul 2006
Location:
Posted: 20th Nov 2007 01:46
Wow thats strange when I posted before I didn't see Doc Evil's post.... whatever. Congrats Acelepage, I'll see what kinda cool transformation I can come up with.

68% of rupublicans don't beleive in evolution but, only 5% of monkeys believe in republicans. ~Stephen Colbert 2007
acelepage
22
Years of Service
User Offline
Joined: 2nd Jun 2004
Location: Plattsville
Posted: 20th Nov 2007 02:41 Edited at: 20th Nov 2007 02:42
Thanks Spopovich,
I got an email alert to Doc Evil's post, but it didn't post here until a few hours later. I saw your post go in first, then Doc Evil's showed up. I think there was a server incident (that is a good generic term for those funny things that happen to computers).

I remember downloading a program that claimed to be a morph program. I loaded 2 pictures into it, and all it did was fade from one to the other. That really bugged me because that is not a morph. I've never found the correct forum to complain about it until now. I feel much better.

( 2b || !2b ), that is the question. The answer: true
RedFlames
18
Years of Service
User Offline
Joined: 25th Aug 2007
Location: Germania
Posted: 20th Nov 2007 13:53 Edited at: 20th Nov 2007 13:55
hey i dont see DocEvils post, so i was kinda confused that you set another challenge without being winner XD
but maybe after posting this ill see the post. nice challenge anyway, sounds really interesting

edit: yes, there it is... twice! lol

Ric
22
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 21st Nov 2007 01:58
Congrats Acelepage - well deserved win. A morphing challenge should be very interesting. I expect it might be quite a tricky one, too!

Sven B
21
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 21st Nov 2007 13:23
Hello again everyone!
I guess no one remembers me anyway...

Well, I thought I'd input the first code:



A simple ball morphing with Newtons gravity equation.
Press rightmousebutton to move the camera, but it could get a little tricky changing the cursor afterwards.
Also, it does some weird things when you come too close... ah well.

It's the programmer's life:
Have a problem, solve the problem, and have a new problem to solve.
RedFlames
18
Years of Service
User Offline
Joined: 25th Aug 2007
Location: Germania
Posted: 21st Nov 2007 18:28
@Sven B: Wow thats really cool especially because its 3d and very short code

I had a cool idea: morphing a box to a sphere using DATAs for the frames but i dont really like how it turned out...

Anyway here's the code:


FSMax
18
Years of Service
User Offline
Joined: 22nd Nov 2007
Location:
Posted: 22nd Nov 2007 10:59
Can DBpro to hold up the 3DS MAx Biped or Bones for to animate characters in real time? How animate this character after import in DBpro? How make the motion sequences?

Thanks friends programmers

FSMAX
Sven B
21
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 22nd Nov 2007 16:43
FSMax, you should try the 3D board.

I've got another one. My original idea was kinda RedFlames' code, but in 3D...


press up down for morphing, left right to rotate around the object.

It only works partly though. Because it's a sphere, you don't get sharp edges on the cube :-(
Ah well... (again)

It's the programmer's life:
Have a problem, solve the problem, and have a new problem to solve.
da power pwnerer
19
Years of Service
User Offline
Joined: 28th Jul 2006
Location: Pittsburgh, PA
Posted: 22nd Nov 2007 16:53
Hmmmm.... Your code compiles, but once I run it, it crashes. No errors or anything. Strange....



-Dan


http://Freewebs.com/noobisoft
Come to Noobisoft's website today!
RedFlames
18
Years of Service
User Offline
Joined: 25th Aug 2007
Location: Germania
Posted: 22nd Nov 2007 17:20
I get the same result, and if I comment parts of the code out it runs sometimes, sometimes not...
really strange, i think you have to upload a compiled version for us...

BMacZero
20
Years of Service
User Offline
Joined: 30th Dec 2005
Location: E:/ NA / USA
Posted: 22nd Nov 2007 18:04
I'm actually having trouble with all the programs that use "lock vertexdata." It's not recognizing that as a command. Is that from a DLL or something?


"Fire is always at the top of the food chain, and it has a big appetite."
da power pwnerer
19
Years of Service
User Offline
Joined: 28th Jul 2006
Location: Pittsburgh, PA
Posted: 22nd Nov 2007 18:10
Do you have the latest version of DBP?



-Dan


http://Freewebs.com/noobisoft
Come to Noobisoft's website today!
BMacZero
20
Years of Service
User Offline
Joined: 30th Dec 2005
Location: E:/ NA / USA
Posted: 22nd Nov 2007 19:09
It says I have v 1.055, but that can't be right, aren't they up to like 6 now?


"Fire is always at the top of the food chain, and it has a big appetite."

Login to post a reply

Server time is: 2026-07-18 02:16:49
Your offset time is: 2026-07-18 02:16:49