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
da power pwnerer
19
Years of Service
User Offline
Joined: 28th Jul 2006
Location: Pittsburgh, PA
Posted: 22nd Nov 2007 20:04
Where is everything!? It says that there are 0 messages! Whats going on



-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 20:13
It's a new page...


"Fire is always at the top of the food chain, and it has a big appetite."
Sven B
21
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 22nd Nov 2007 20:57
Well, my code actually uses the same commands as the first program I wrote (except for the vector commands).

I guess the problem is with the sphere creation. I set the Rows and Columns to a higher value to get a more cube-look.



If this one doesn't work, I wouldn't know where the error is...

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: 23rd Nov 2007 01:47
Quote: "It's a new page... "


No, not for me. It said there were 0 messages, and 0 pages. Now they work though



-Dan


http://Freewebs.com/noobisoft
Come to Noobisoft's website today!
FSMax
18
Years of Service
User Offline
Joined: 22nd Nov 2007
Location:
Posted: 23rd Nov 2007 02:40
help! How make a realistic water effect in DBpro?
Thank´s

FSMAX
BMacZero
20
Years of Service
User Offline
Joined: 30th Dec 2005
Location: E:/ NA / USA
Posted: 23rd Nov 2007 03:17
FSMax, this is not the right place for your questions. Also, before you even ask a question anywhere, try a few searches. Go to the bottom and type "water" into the thread subject search box. That should give you lots of information.


"Fire is always at the top of the food chain, and it has a big appetite."
FSMax
18
Years of Service
User Offline
Joined: 22nd Nov 2007
Location:
Posted: 23rd Nov 2007 05:02
ok! Thank´s

FSMAX
Rburke
19
Years of Service
User Offline
Joined: 28th Sep 2006
Location:
Posted: 23rd Nov 2007 08:00
Quote: "If this one doesn't work, I wouldn't know where the error is..."


I got an error regarding undetermined parameters for the lock vertexdata lines

about a quartar of the time someone submits a program, I will have compilation errors. For example, my dbPro compiler couldn't build Accels program from the last challenge. I using dbpro 1.054 . Maybe there's a version mismatch with my dbpro compared to others?
I had this same problem when I tried compiling Visual Basic Projects for HL2 Mods... and the problem was related to having a different compiler version.

I'm going to try to finish this challenge this time. I couldn't crunch in enough time to finish the last challenge of desk toys. I was working on a Rubiks Cube. I'll have to finish that when I get the time and hopefully I'll be able to get this current one finished.
Sven B
21
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 23rd Nov 2007 14:38
I am using DBP 6.6, since I just installed it on my laptop...

And good luck on your project!

It's the programmer's life:
Have a problem, solve the problem, and have a new problem to solve.
BMacZero
20
Years of Service
User Offline
Joined: 30th Dec 2005
Location: E:/ NA / USA
Posted: 23rd Nov 2007 15:41
Quote: "I using dbpro 1.054."


Actually, the latest version called itself 1.066 when I installed it. You need to go update.


"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: 23rd Nov 2007 17:41 Edited at: 23rd Nov 2007 18:02
A very basic morph program in less than 20 lines, no DATA statements, and smooth transition. It starts off as a cross, turns to an astroid (not asteroid), followed by a diamond, circle, rounded square, and then square. It suddenly shrinks to about 4x4 pixels, then appears back to its original size after about 5 seconds.



Your signature has been erased by a hyper-intelligent pan-dimensional being (a mod)
Bongadoo
20
Years of Service
User Offline
Joined: 4th May 2006
Location:
Posted: 25th Nov 2007 20:57 Edited at: 25th Nov 2007 22:42
I'm struggling with how to describe this, it's a sort of creation demo; and no vertexdata commands!



Can you tell I've had a boring weekend The program loops, so you can turn into a screensaver if you want. A lot of the code is written pretty poorly, I originally intended it to be small, but got a bit carried away. I just wanted to get it finished quickly this afternoon so there's some dodgy loops and things in.

Edit: Added Morph.scr to this post, if you dump in windows/system32 you will see it in the screensaver options as Morph. Modified version so it will check for widescreen and end on mouse move.

"I haven't failed. I've just found ten thousand ways that don't work." - Thomas Edison
RedFlames
18
Years of Service
User Offline
Joined: 25th Aug 2007
Location: Germania
Posted: 25th Nov 2007 21:10 Edited at: 25th Nov 2007 21:10
Wow thats really awesome
but somehow the plains flicker at the beginning, until the cube is completed...

Bongadoo
20
Years of Service
User Offline
Joined: 4th May 2006
Location:
Posted: 25th Nov 2007 22:21
Hmm, I noticed that only when I turned anti-aliasing on, so I turned it off again. I don't notice it any onther time. I did fix that problem by changing the y-gap between the planes to 0.06 from 0.001. I've edited the code so hopefully it shouldn't cause that problem now.

"I haven't failed. I've just found ten thousand ways that don't work." - Thomas Edison
Ric
21
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 25th Nov 2007 23:22
That's cool!

RedFlames
18
Years of Service
User Offline
Joined: 25th Aug 2007
Location: Germania
Posted: 26th Nov 2007 16:19 Edited at: 26th Nov 2007 16:50
yes now it works perfect
btw what are those antialias-commands from, it seems like i dont have that Dll...

EDIT:

had a new idea, still dont like it, but its really short:



Bongadoo
20
Years of Service
User Offline
Joined: 4th May 2006
Location:
Posted: 26th Nov 2007 18:05
The antialias commands are in Styx; it also has anisotropy options aswell.

I was thinking about doing an effect similar to the results you have there to create a sun in my program (but didn't get round to adding it). I was going to do it by rapidly altering random vertexdata of a high poly sphere using a sine function to create a kind of chaos effect on the surface.

"I haven't failed. I've just found ten thousand ways that don't work." - Thomas Edison
RedFlames
18
Years of Service
User Offline
Joined: 25th Aug 2007
Location: Germania
Posted: 28th Nov 2007 17:11 Edited at: 28th Nov 2007 17:17
I just looked at Sven B's code again and found out:

in the first version which didnt run for most people he had the command:


but for me just the new version without the ",24,24" ran.
and thats the point: it just runs on every machine (i think) if the Rows/Columns-values are 2^x , e.g. 2^4=32 / 2^5=64...

lets take for example 64:

with this it looks really like a cube and runs still smooth

Hope this helped and my english isnt too bad
RedFlames

Edit:
ok it runs also with 96, but 128 crashes... strange...

New Edit: looks like its random which values work and which not...
working for me: 97,36,...
not working: 24,28,...

Sven B
21
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 29th Nov 2007 18:18
It also crashes at random values here too. But I didn't think it'd be different on each computer ^^

Thx RedFlames

It's the programmer's life:
Have a problem, solve the problem, and have a new problem to solve.
Ric
21
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 30th Nov 2007 13:18
Interesting problem. I tried using 24,28 and it crashed here too .... but I tried making a wireframe sphere with the same numbers in a separate program and it works fine. So the problem is not with the sphere creation - it must be with the vertex commands which attempt to manipulate it.



Visit www.andromedus.com today!
Sven B
21
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 30th Nov 2007 19:20
I ran some tests too, and the program crashes already at this part:


Which basically only stores the vertex positions in an array...

And I don't find anything weird in this part. I did notice that it is able to read the vd (vertex index count), but crashes once it reaches the get vertexdata position commands.

Nothing to do about it then?

It's the programmer's life:
Have a problem, solve the problem, and have a new problem to solve.
Ric
21
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 30th Nov 2007 22:00
I think you should file a bug report. I don't know how often TGC look at the bug reports, but I would think they will need to look at them soon if they don't want to carry the same bugs forward into DBPX10. For now, though, stick to numbers that work.



Visit www.andromedus.com today!
Diggsey
20
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 1st Dec 2007 11:07
@SvenB
You need 'get vertexdata vertex count()' indices and vertices are different Also, 'get vertexdata vertex count()' requires no parameters even though it says it does in the help.

Rburke
19
Years of Service
User Offline
Joined: 28th Sep 2006
Location:
Posted: 1st Dec 2007 15:44
Here's what I have so far. The Object starts out as a typical lemon and then it morphs into something more interesting.



I might add another function to morph back into lemon and possibly another function for movement.
Ric
21
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 2nd Dec 2007 13:35 Edited at: 3rd Dec 2007 00:08
Quick last minute entry from me - a morphing clock:


Needs a fair bit of refinement, but you get the general idea!



Visit www.andromedus.com today!
Sven B
21
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 2nd Dec 2007 18:44
Quote: "@SvenB
You need 'get vertexdata vertex count()' indices and vertices are different Also, 'get vertexdata vertex count()' requires no parameters even though it says it does in the help."


Lol, it works without exceptions now!!
Thanks Diggsey...



It's the programmer's life:
Have a problem, solve the problem, and have a new problem to solve.
Diggsey
20
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 2nd Dec 2007 18:56 Edited at: 2nd Dec 2007 18:57
@Ric
I fixed the wierd problems with using curvevalue on integers for you

Just add this function to your code, and replace all occurances of curvevalue with smoothvalue



Ric
21
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 3rd Dec 2007 00:13
Cheers Diggs, I've added that into my code above - seems to allow the numbers to morph completely now rather than just nearly!



Visit www.andromedus.com today!
acelepage
22
Years of Service
User Offline
Joined: 2nd Jun 2004
Location: Plattsville
Posted: 3rd Dec 2007 03:49
There were many excellent entries for this challenge. I am surprised at the quality of the morphing. It is more than I expected to see, which makes the judging a bit more difficult.


Runner-Up:


Winner:


( 2b || !2b ), that is the question. The answer: true
Bongadoo
20
Years of Service
User Offline
Joined: 4th May 2006
Location:
Posted: 3rd Dec 2007 11:49
Thanks acelpage, I'm glad you enjoyed it. I may come back to the idea in the future with a more expanded version.

Congrats Sven on runner up!

I'm at work atm, so will think up a competition and post tonight.

"I haven't failed. I've just found ten thousand ways that don't work." - Thomas Edison
Sven B
21
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 3rd Dec 2007 16:18
Congrats!!!

Let's see what the next challenge brings... :-P

It's the programmer's life:
Have a problem, solve the problem, and have a new problem to solve.
Bongadoo
20
Years of Service
User Offline
Joined: 4th May 2006
Location:
Posted: 3rd Dec 2007 18:44 Edited at: 4th Dec 2007 15:12
"The fire i' th' flint Shows not till it be struck; our gentle flame Provokes itself and like the current flies Each bound it chafes." - Shakespeare, The Life of Timon of Athens

As so do we, albeit in coding form (see this for a good explanation of the quote, for anyone interested!)

Make fire! 3D fire that is.

Use any techniques at you disposal: sprites, billboarding, animated plains, particles, silk flame effects, anything. It must be able to be witnessed from any angle though, so a rotating camera or camera controls will be needed.

Marks will be awarded for realism and efficiency in equal measure ie.. if two entries look very realistic, but one runs at 500fps and one at 100fps, then 500fps will win! Complexity will also factor; so basically if someone makes a huge towering inferno of brimstone and billowing smoke compared to someone that makes a candle, then if they both look great and run at a high fps the colossal death plume will win.

Hope that all makes sense, good luck! Ends Sunday 16th, 12:00 GMT.

"I haven't failed. I've just found ten thousand ways that don't work." - Thomas Edison
acelepage
22
Years of Service
User Offline
Joined: 2nd Jun 2004
Location: Plattsville
Posted: 3rd Dec 2007 18:49 Edited at: 3rd Dec 2007 18:51
I have cloth and particles pack. I know it cannot be used in a challenge.
My question is, does anyone know if the basic compiler has particle commands? I'm not sure which particle commands I have are part of the pack, and which are not.

( 2b || !2b ), that is the question. The answer: true
Bongadoo
20
Years of Service
User Offline
Joined: 4th May 2006
Location:
Posted: 3rd Dec 2007 18:51 Edited at: 3rd Dec 2007 18:58
Main DB help, contents #18 Particles. Although a custom particle engine would be impressive

"I haven't failed. I've just found ten thousand ways that don't work." - Thomas Edison
acelepage
22
Years of Service
User Offline
Joined: 2nd Jun 2004
Location: Plattsville
Posted: 3rd Dec 2007 18:56
Thanks Bongadoo. I got a bit excited. I should have counting to ten

( 2b || !2b ), that is the question. The answer: true
Ric
21
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 4th Dec 2007 09:25 Edited at: 4th Dec 2007 10:15
Congrats Bongadoo on the last challenge. This one should be interesting.

Just a head's up - as Christmas is approaching, I will be aiming to set a special Christmas challenge (with prizes!), as we did last year, which will involve making use of some provided media. It will be a three week challenge which will follow on from this one - 16th Dec to 7th Jan - the timing has worked out very nicely actually. So the winner of this challenge will be the challenge setter and judge for the one after the Christmas challenge.

More details here.



Visit www.andromedus.com today!
Bongadoo
20
Years of Service
User Offline
Joined: 4th May 2006
Location:
Posted: 4th Dec 2007 15:14
Added complexity into scoring, just in case anyone misses it. Edited original post.

"I haven't failed. I've just found ten thousand ways that don't work." - Thomas Edison
Ric
21
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 9th Dec 2007 01:47 Edited at: 9th Dec 2007 12:51
Ok - lets get this challenge moving ... not exactly complex, but it's a start:







Visit www.andromedus.com today!
Bongadoo
20
Years of Service
User Offline
Joined: 4th May 2006
Location:
Posted: 9th Dec 2007 10:55
I'm having trouble getting it to run. The scene displays correctly with rotating camera, albeit without the flame. I have tried in compiling in CodeSurge and DBPro, not sure what the problem is. I shall try and investigate...

"I haven't failed. I've just found ten thousand ways that don't work." - Thomas Edison
Bongadoo
20
Years of Service
User Offline
Joined: 4th May 2006
Location:
Posted: 9th Dec 2007 11:17
Tracked it down to:

[ghost object on flame,5] in make_flame() function; commenting out it runs fine. [set object transparency flame,2] is put on with alphamapping later so I guess ghost isn't needed?

I was worried because I was messing about with user32.dll/GDI32.dll device context functions last night and thought I might have borked something.

Nice effect, a very healthy 850fps

"I haven't failed. I've just found ten thousand ways that don't work." - Thomas Edison
Ric
21
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 9th Dec 2007 12:37 Edited at: 9th Dec 2007 12:52
Weird - but you are right, taking out the ghost object command makes no difference here so I have removed it from the code above. In fact, I found quite a lot of weirdness with the flame suddenly disappearing when I added certain seemingly unrelated pieces of code to the program. But then I have always found that using layers of planes with transparency requires about 1% calculation and 99% trial and error!

I also added a little more complexity to the oscillation equation to give the flicker a slightly more random feel to it.



Visit www.andromedus.com today!
RedFlames
18
Years of Service
User Offline
Joined: 25th Aug 2007
Location: Germania
Posted: 10th Dec 2007 16:44 Edited at: 10th Dec 2007 16:54
just reconstructed that problem with
ghost object on flame,5
and found out that its not with all numbers:
no number and >5 = no change
0 = bright
2 and 4 = comic

strange problem...

and btw i like it with 0

EDIT:
it just moves on X-Axis, if you look from the side it doesnt move so i added in flicker():

and of course changed
position object flame,x#,height(flame),0
to
position object flame,x#,height(flame),z#

and if it moves to fast change the lines with radius#=... / radius2#=... to:


libertybell CEO
18
Years of Service
User Offline
Joined: 10th Dec 2007
Location:
Posted: 10th Dec 2007 21:52
You will actually need to supply the files you need compiled
RedFlames
18
Years of Service
User Offline
Joined: 25th Aug 2007
Location: Germania
Posted: 11th Dec 2007 14:22
i dont know if i understand you right but this is a challenge without media or plugins so everyone can compile it himself, no need for compiled files

Ric
21
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 12th Dec 2007 10:02
Quote: "it just moves on X-Axis, if you look from the side it doesnt move"


Good point - hadn't spotted that. Fixed below, and also made slight improvement to the flicker effect. Next step is to add a little smoke - should be quite easy if I get time.






Visit www.andromedus.com today!
Rburke
19
Years of Service
User Offline
Joined: 28th Sep 2006
Location:
Posted: 13th Dec 2007 13:14
Ric, I like your flame a lot; so I played around with the colors a bit to get some blue in the flame as a real flame would have around the base:



and I ditched the color light command so it wouldn't mess with the edited colors. The ideal flame I saw earlier:


However, the blue is overpowered... (I was trying play around with it even more to see if I could get only the base to obtain a blueish color)
RedFlames
18
Years of Service
User Offline
Joined: 25th Aug 2007
Location: Germania
Posted: 13th Dec 2007 15:00 Edited at: 13th Dec 2007 15:01
cool effect, i played around with the code ,too and came to this result:


Ric
21
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 14th Dec 2007 22:55 Edited at: 14th Dec 2007 23:09
Another revision! I've made the base of the flame blue as suggested, and made the centre part brighter. I also had a look at a real candle and noticed that it flickers up and down just as much as it does side to side, so I have added that in too. Oh, and I added in some clouds for atmosphere!





Deadline on Sunday - anybody else having a go?



Visit www.andromedus.com today!
Bongadoo
20
Years of Service
User Offline
Joined: 4th May 2006
Location:
Posted: 16th Dec 2007 19:14
Well the competition is over, so Ric wins by default It's a nice effect though!

"I haven't failed. I've just found ten thousand ways that don't work." - Thomas Edison
Ric
21
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 16th Dec 2007 22:20
Cheers, Bonga - a win is never quite as sweet when there's no opposition, but heyho - it was fun, and I'm pleased with the effect I got in the end. I will set the next normal challenge after the Christmas challenge has finished on the 7th January. At least that gives me three weeks to come up with something interesting!



Visit www.andromedus.com today!

Login to post a reply

Server time is: 2026-07-08 04:18:58
Your offset time is: 2026-07-08 04:18:58