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
The ARRAYinator
19
Years of Service
User Offline
Joined: 13th Aug 2005
Location:
Posted: 26th Nov 2005 22:22 Edited at: 27th Nov 2005 00:29
here is my code so far need to work out a few bugs though.
the controls are relitively easy and are:

hold in "m" key and left click to move objecs around in the main mode.and move the camera with the arrow keys and pitch it up withthe control key and down with the shiftkey.


use the tools drop down menu to find rotation and scaling tools.these modes have to be exited after you are finished to use other modes.to exit just go to tools exit mode.

in the rotate mode just right click on the object you want to select(same for all other modes except scale) and left click and move the mouse in the various directions.

in the scale mode right click and left click on the object to select it and left click to scale on x and y and right click to scale on z.

the rest should be pretty intuitive and can all be acessed through the dropdown menus.

bugs and glitches:the menu sprites might sometimes seem to be behind the screens.when you open up a file it will show object data but not the object might not appear don't know why if anyone knows please tell me.

that should be it.I will post improvements as they are made.

Coding Fodder
21
Years of Service
User Offline
Joined: 25th Sep 2003
Location: Somewhere in my cerebralcortex
Posted: 26th Nov 2005 22:25
you have your code commands backwards please fix.

Thanks,

'Fodder

Something really catchy that makes people stop and think about the meaning of life and say to themselves "My but thats clever"
CPU
21
Years of Service
User Offline
Joined: 4th Jul 2003
Location: Carlsbad, CA
Posted: 26th Nov 2005 23:52
Yep you need to have your code formatted like so:

[[/i]code]

`start of code

`all the cool codz go here

`end of code

[[i]
/code]

the / indicator means to close the [[i][/i]code] tag so that your code will appear in a code box, so now that you know what to fix, please edit your original post so that we don't have to wade through all your code to see peoples comments...

Oh, and if you want to stop that nasty flickering you need to put sync on at the very begining of your code before even sync rate 0

CPU

[center]K-OS Battlefields
IS
///---///---///---UNDER CONSTRUCTION---\\\---\\\---\\\
[center]
The ARRAYinator
19
Years of Service
User Offline
Joined: 13th Aug 2005
Location:
Posted: 26th Nov 2005 23:58 Edited at: 27th Nov 2005 22:13
sorry here is the post again I attached the source this time.

here is my code so far need to work out a few bugs though.
the controls are relitively easy and are:

hold in "m" key and left click to move objecs around in the main mode.and move the camera with the arrow keys and pitch it up withthe control key and down with the shiftkey.


use the tools drop down menu to find rotation and scaling tools.these modes have to be exited after you are finished to use
other modes.to exit just go to tools exit mode.

in the rotate mode just right click on the object you want to select(same for all other modes except scale) and left click and move the mouse in the various directions.

in the scale mode right click and left click on the object to select it and left click to scale on x and y and right click to scale on z.

the rest should be pretty intuitive and can all be acessed through the dropdown menus.

bugs and glitches:the menu sprites might sometimes seem to be behind the screens.when you open up a file it will show object data but not the object might not appear don't know why if anyone knows please tell me.

that should be it.I will post improvements as they are made.

The ARRAYinator
19
Years of Service
User Offline
Joined: 13th Aug 2005
Location:
Posted: 27th Nov 2005 21:57 Edited at: 27th Nov 2005 22:44
was the server down?

anyway here is my updated code.

TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 27th Nov 2005 22:05 Edited at: 27th Nov 2005 23:33
And mine (final entry version 0.1c)!

http://www.computechtenerife.com/modeller.zip

If you have tried this program before, please DELETE the Textured folder as some new ones will be added - but won't if the Textures folder already exists!

Also, the included Castle.Tog file needs to be placed in the Objects folder.

A short instructions txt file is also in the zip.

TDK_Man

PS: RiiDii, did you get any of my e-mail replies?

Ric
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 27th Nov 2005 22:07 Edited at: 27th Nov 2005 22:08
Yep - server was down for quite a while. Anyway, I added a fade out effect for the shadows as shown.



Final update for this challenge:



Attachments

Login to view attachments
Darkbasic MADPSP
19
Years of Service
User Offline
Joined: 15th Jun 2005
Location: Uk
Posted: 27th Nov 2005 22:14
Nice ric looks real good

Dbmad C++ programmer
The ARRAYinator
19
Years of Service
User Offline
Joined: 13th Aug 2005
Location:
Posted: 27th Nov 2005 22:23
Here is an instructions file for mine.

Attachments

Login to view attachments
CPU
21
Years of Service
User Offline
Joined: 4th Jul 2003
Location: Carlsbad, CA
Posted: 28th Nov 2005 00:30
I suppose Judging time is upon us... as soon as I collect and er begin the long and laborious process of decideing which one of you gets the everlastingly amazing prize... of picking the next chalange

CPU

[center]K-OS Battlefields
IS
///---///---///---UNDER CONSTRUCTION---\\\---\\\---\\\
[center]
Tinkergirl
21
Years of Service
User Offline
Joined: 1st Jul 2003
Location: United Kingdom
Posted: 28th Nov 2005 00:43
I don't envy you, CPU - it's been one mammoth of a challenge this fortnight! Absolutely stunning entries.

I only hope I can quickly forget how awesome (in the old sense of the word) these were, so I can enter the next one with some hope of doing well

No matter who wins this one - you've all done amazing.
CPU
21
Years of Service
User Offline
Joined: 4th Jul 2003
Location: Carlsbad, CA
Posted: 28th Nov 2005 01:16
Oi - stunning entries, though I think TDK could of squished a few more bugs in his program if he'd tried

Anyways, Da winners:









Anyways Enjoy! And be sure to read all the entries

CPU

[center]K-OS Battlefields
IS
///---///---///---UNDER CONSTRUCTION---\\\---\\\---\\\
[center]
Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 28th Nov 2005 01:23
Interesting order they came in

TDK - Well done!

Ric
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 28th Nov 2005 01:39
Thanks for a great challenge CPU, and congrats to TDK who produced an outstanding piece of work - don't let it rest there, though - you have the essence of a full world editing product there. As for me - this challenge has got me really interested in light mapping. Although I didn't get mapping of shadows onto objects working for this challenge, I have been playing around with some ideas, and I may continue with it in my own time.

So - whats the new challenge, TDK?

TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 28th Nov 2005 03:02 Edited at: 28th Nov 2005 03:42
Thanks for that.

I honestly didn't expect to win this one because I uploaded a very buggy final version - and only spotted it when it was too late. So, I expected this to work against me - even though the bits not working were not present in the previous version.

Actually, I had started work on grouping objects with the Ctrl key and it worked fine - until I tried to move them. So as it was almost deadline time I scrapped the idea and decided to go back to my 'before I start messing about with something new' backup... only to find I didn't damn well have one!!

So, in the few hours the forum was down, I was frantically 'reverse-engineering' the previous two days work. Unfortunately, the engineering was sub-standard and more than a few bugs were left in.

I think I've got the program back to how it was before I screwed up and I'm considering developing it into a world editor in the coming months.

[Edit] Just did a quick check and I think this is the pretty much bug-free version of V0.1c (if anyone hasn't downloaded it yet and/or wants it):

http://www.computechtenerife.com/modeller.zip

Anyway, enough waffle. The next challenge...

As I said, I hadn't considered winning so I don't have any ideas at the moment. I will sleep on it and return tomorrow with something.

Too early for a Christmas theme or not?

TDK_Man

RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 28th Nov 2005 04:03
Congratulations TDK!! Great Challenge CPU! And a close call, I am sure, Ric - the shadows were top! Waiting for the next challenge.


Open MMORPG: It's your game!
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 28th Nov 2005 07:01 Edited at: 28th Nov 2005 07:02
dang, didn't even make the cut. Even got beat by riidii, who didn't even make a program! (unless I just over looked it somewhere) Oh well, I'm just glad I at least got something done for a challenge for once.

Here's my opinions.

TDK:
When I tried to open a file, even though the castle.tog was listed, when trying to open it crashed with a file does not exist error. Also, I didn't like waiting for textures that I might not use to be created. (but nice textures)

Ric:
When first clicking an object to reposition it, its position jumps instead of accounting for the offset of the object's origin from the mouse position. not a big deal, but it can get annoying. shadows were a nice touch.


Overall, I think we had a great turnout on this challenge.

I had an idea about a possible challenge, procedural textures. Like Bryce, Terragen, studio max, etc....

I'd say wait another week for a christmas challenge, but then give 2 weeks cause many ppl will probably be quite busy.


Deadly Night Assassins
Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 28th Nov 2005 10:14
or a 3 week christmas one?

A suggestion - a christmas screensaver..

I always use this one:
http://www.vrman3d.com/vrman3ddownloads.htm

as its a really nice 3D one. Basically, you fly about a basic xmas tree and other flashing lights and stuff. Its great! but a little dated (it has MMX as an option for the more advance machines and even supports software 3d rendering *shudders*.. Gives you an idea of age ).

Just an idea - but a challenge xmas screensaver would be challenging, interesting to others and would also produce something we can all use

I made a screensaver ages ago which has code in it to allow it to fully integrate with windows.

TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 28th Nov 2005 13:46 Edited at: 28th Nov 2005 13:51
Quote: "When I tried to open a file, even though the castle.tog was listed, when trying to open it crashed with a file does not exist error."


Can I confirm that you have put the TOG file into the Objects folder? You should also have 9 textures in the Textures folder and that they can all be opened (File Not Found might be related to a missing or corrupted texture).

The last uploaded version also has a tenth texture called Stone.jpg, but I'm sure it's not used in Castle.Tog - so that shouldn't be the problem. (I've added it below so if anyone wants it you can save it to the Textures folder as Stone.jpg - rather than re-generate them all again)...



Quote: "Also, I didn't like waiting for textures that I might not use to be created. (but nice textures)"


Yes - fair point. It does take a while, though it only generates the first time you run it - it never happens again.

Part of the challenge was to create textures for the castle object and if you remove the couple of textures not used for Castle.Tog, it's only a few seconds quicker starting. But yes, it annoys me too!

As for the challenge, I agree that a Christmas Screensaver would be a nice challenge and if done now, at the end of the two weeks, there's still a couple of weeks of the Christmas Season left in which to use it!

The only reservation I have is that the program cannot use external media other than that created on the fly so it's going to be very difficult from that point of view.

However, the best alternative challenge I could come up with was writing a program which would play the tune 'We Wish You A Merry Christmas' and showed the words - highlighted in Karaoke fashion so you could sing along to it.

So, unless anyone thinks that the screensaver challenge is too difficult media-wise, we'll go with that one.

Challenge Ends: Monday 12th December at 9pm GMT

TDK_Man

CPU
21
Years of Service
User Offline
Joined: 4th Jul 2003
Location: Carlsbad, CA
Posted: 28th Nov 2005 14:34
Off we go...

@Phaelax - I know - but all I saw were pretty screenshots but nothing to run and Rii's was pretty far back (pg 52-54?) and was a construction program built in space where you flew a little lifter carrying boxes which you could put next to other boxes and such...

@TDK - I know what you mean... It was actualy really close, but, the interface and that it was (fortunatly) still possible to do stuff to objects, just had to be done in a different view however, got you the win, and a christmass screensaver seems like an interesting chalange... Time to dig up my old tree making code...

CPU

[center]K-OS Battlefields
IS
///---///---///---UNDER CONSTRUCTION---\\\---\\\---\\\
[center]
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 28th Nov 2005 17:58
Nick

I had a look at that one and it just runs far too fast on my machine - everything looks like it's in fast forward mode, even with all the settings maxed out.

Here's a link to the Christmas screensaver I'm using:

http://www.3planesoft.com/pages/christmas.html

Quite impressive I think...

TDK_Man

Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 28th Nov 2005 18:30
Thats interesting - it was fine on ours. Have you overriden V-Sync in your graphics card settings? I think its designed to run at no more than 60fps (or 75 or whatever). If you've overriden VSync then it will gos stupidly fast on anything more than a recent mobile phone...

Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 28th Nov 2005 19:23
Quote: "Can I confirm that you have put the TOG file into the Objects folder"


It wasn't, but it shouldn't matter. the file showed up in the file loader, so obviously it exists.


screensaver eh? hmmm


Deadly Night Assassins
RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 28th Nov 2005 19:32
I vote screen saver.


Open MMORPG: It's your game!
Ric
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 28th Nov 2005 22:57
Yeah - sounds like a good idea.

TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 29th Nov 2005 13:28
Quote: "It wasn't, but it shouldn't matter"


That's why I clearly stated that the Tog file should be in the Objects folder. (The program should automatically open in that directory when you choose Load File to make life easier for users).

You must have come out of the Objects folder to get to the Tog file, so you can't complain too much if something doesn't work when you didn't follow instructions!

But no harm done - it least it works OK now I assume?

TDK_Man

Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 29th Nov 2005 18:35
Nice challenge, I'm going to have another go at these challenges, to be honest (without being arrogant) I never expected me to be a runner up both times I treyed a challenge, so I think I shall try this one oput and see where I get - Good work on winning that one TDK

Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 30th Nov 2005 00:51
Zotoaster - none of us expect to lose when we enter, otherwise we wouldn't really make an entry to win. We'd either not bother or we'd make more of an educational entry (which often holds more weight as these challenges are more about educating than winning )

Ric
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 30th Nov 2005 02:03
Did he mean he was disappointed he only came second? I thought he meant he was surprised he came so high up. Anyway - what ideas have people got for this screensaver challenge? All I can think of doing is some kind of snow particle demo.

TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 30th Nov 2005 04:23 Edited at: 30th Nov 2005 12:59
I'm obviously not entering this, but I've had a quick bash at a Christmas tree!



Could do with a bit of snow really...

And, as a noob with DBPro (only really started using it properly for the clock challenge) I'll ask a question:

In DBP how on earth do you get objects the colour you specify? Every time I create an object and use Color Object, the object comes out grey, but only with a bit of the colour you set.

It was doing it in the 3D Modeller and I couldn't figure it out.

DBP is different to DBC in this respect and I tried every combination of the Set Object command parameters with no success.

TDK_Man

RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 30th Nov 2005 06:32
Generally, a texture will color an object much better than color object will. So, to color an object red, make a red texture and apply it to the object. Alternatively, you can also use Set Object Emissive to the color you want (you may have to play with it a bit to get a feel for how it works). Some additional advice; make sure fog isn't effecting the object, as well as ambient light or any other light source. Specular and Diffuse both also help control the final color of objects.


Open MMORPG: It's your game!
Ric
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 30th Nov 2005 10:26
Nice tree TDK! Very ..... err ....... christmassy!

Tinkergirl
21
Years of Service
User Offline
Joined: 1st Jul 2003
Location: United Kingdom
Posted: 30th Nov 2005 13:16
Wow, nice tree

I'm hoping to enter this one - plans for the insides of a snow-globe, with shaking, I hope.

As for the grey effect, TDK, RiiDii's right - ambient light is one of the main offenders - set it to about 2 or so, and your colours should show up much better.

Also, I don't know if this is common knowledge, but if you treat DB units as meters, then the lighting is a lot kinder to you and almost works the way you'd imagine it to It's when you start doing crazy tiny or huge things that DB's lighting REALLY goes weird (as opposed to just generally quirky )
Ric
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 1st Dec 2005 20:56 Edited at: 1st Dec 2005 20:57
Nothing much yet, but just a little progress report ..... I've done some work combining my terrain generation code from Blue Island with the lightmapping code I wrote for the modelling challenge. The result is a terrain with shadows - and I tried to make it look snowy so it's at least a start for the Christmas challenge. The next things I'll propably work on are some particle snowflakes, and the lens flare effect.



Attachments

Login to view attachments
Peter H
20
Years of Service
User Offline
Joined: 20th Feb 2004
Location: Witness Protection Program
Posted: 1st Dec 2005 21:21 Edited at: 1st Dec 2005 21:22
@Ric- i think it would be cool if the terrain cast shadows on itself... in that picture it looks like only the objects (the boxes) cast shadows...

"We make the worst games in the universe..."
Ric
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 1st Dec 2005 21:30
You're right - that would be cool. I think I have a general idea how to go about it, so I'll give it a go .... I love a challenge!

Ric
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 2nd Dec 2005 00:36 Edited at: 6th Dec 2005 17:35
Well blow me, it actually worked! We now have a terrain which is lightmapped according to the terrain itself as well as objects on it. Credit to Lost in Thought for his matrix to mesh function, which allowed me effectively to perform intersect object calculations on a matrix, to get the terrain casting shadows on itself. Will post the code later on, but here's a screeny for now:



Attachments

Login to view attachments
Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 2nd Dec 2005 00:48
That is awesome!!! Is that terrain a mesh or a matrix?

Ric
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 2nd Dec 2005 01:50
Thanks Nick. Good question - I've tried both.

In the pictures above it is 100% matrix - an unsmoothed mesh is briefly created then deleted to help with the shadow rendering process.

However - it's also possible to keep the mesh and delete the matrix. The look and performance is very similar whichever you choose - although using a mesh takes a lot longer because if you want it to look as smooth as the matrix version, you need to apply object smoothing - which takes a long time when there are many polygons. On the other hand, having it as a mesh gives access to more lighting and shading commands. I think, in the end, I will keep it as a matrix for this challenge because it is created quicker - but if I were to incorporate this into an application for making lightmapped terrains, I'd sacrifice the speed for versatility and go for the mesh.

RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 2nd Dec 2005 06:30
Congratulations CPU! For those that don't know, CPU won a prize in the Newsletter for his StarWars Trenchrunner code.

Looks nice Ric! I am still amazed at your shadows.


Open MMORPG: It's your game!
Peter H
20
Years of Service
User Offline
Joined: 20th Feb 2004
Location: Witness Protection Program
Posted: 2nd Dec 2005 19:30
hehe, yeah, it looks pretty snazzy!

"We make the worst games in the universe..."
CPU
21
Years of Service
User Offline
Joined: 4th Jul 2003
Location: Carlsbad, CA
Posted: 2nd Dec 2005 23:11
Very nice job ric, and thanks for the mention rii

Don't know if I'll be entering this one, I here the cry of stacks of homework left to do...

CPU

[center]K-OS Battlefields
IS
///---///---///---UNDER CONSTRUCTION---\\\---\\\---\\\
[center]
Tinkergirl
21
Years of Service
User Offline
Joined: 1st Jul 2003
Location: United Kingdom
Posted: 4th Dec 2005 15:52
Right, ok, so it's a mess - it's definitely a work in progress and there's a tonne load of stuff to fix and do (particles for example, the globe, the rest of the hut etc etc) but you may find one aspect of it interesting...



You'll see.

(Oh - and well done CPU! You deserved something for that Trench Run - it was ace )
Ric
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 4th Dec 2005 19:49
Quote: "but you may find one aspect of it interesting"


I suspect that thing is something I can't see on my computer .... perhaps you could keep your progress updated with screenshots for us owners of archaic graphics cards?

Tinkergirl
21
Years of Service
User Offline
Joined: 1st Jul 2003
Location: United Kingdom
Posted: 4th Dec 2005 21:07
Darn Oh well - as you guessed/saw it's supposed to have a snow shader in it. Not a terribly impressive one I'm afraid, just a specular map. It's just supposed to make my snow glint brightly depending on the camera angle.

*shrugs* I'd worried that (as it's PS2.0) there might be a few people who wouldn't see it. Can I ask, Ric - does it just come out black, or what happens on your machine?

(Darn darn darn...)
Ric
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 4th Dec 2005 22:09
I just see an untexured, white plane. However, it's quite possible that I'm in the minority, as my machine is pretty ancient - we're talking GF2 graphics here.

Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 4th Dec 2005 23:49
I see no snow (not even untextured plains), but I do see a wooden house and a nodding snowman (a really nice snowman at that, especially considering its made from primitives ). I have a 256Mb 7800GTX and a 4400+ Athlon X2 with 1Gb DDR RAM, so I'd hope it could take whatever you throw at it!

Segan
19
Years of Service
User Offline
Joined: 28th Aug 2005
Location: Canada
Posted: 5th Dec 2005 00:17 Edited at: 5th Dec 2005 00:18
@Tinkergirl: I think I see what you were going at for this version. I see NO falling snow, but the ground has an interesting texture. As for the "glinting," I see a whole bunch of lighter dots appear on the ground when I'm at a certain part of the map (if anyone else wants to reproduce it, just circle the house a few times while watching the ground.)

I really like the effect, but I think it could work a little better if its appearance only happened at certain parts of the map... (specifically behind the house)
Tinkergirl
21
Years of Service
User Offline
Joined: 1st Jul 2003
Location: United Kingdom
Posted: 5th Dec 2005 11:09
*sighs* Yes, Segan - that's kind of what I'd been going for. There isn't any falling snow in this version - it's just that light-dot thing you mentioned.

Obviously, I'm going to have to work a lot on that. Not sure why it wouldn't be working on your beast-machine, Nicholas. Glad you liked the snowman at least
Peter H
20
Years of Service
User Offline
Joined: 20th Feb 2004
Location: Witness Protection Program
Posted: 5th Dec 2005 18:01
yeah, i'm pretty sure that when a shader isn't supported that you try to use, the object just goes black

"We make the worst games in the universe..."

Login to post a reply

Server time is: 2024-11-24 02:02:21
Your offset time is: 2024-11-24 02:02:21