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
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 12th Sep 2005 12:23 Edited at: 12th Sep 2005 12:25
I won't be in this challenge, it doesn't really excite me. I'll use the time to work on my editor instead.


Deadly Night Assassins
CPU
21
Years of Service
User Offline
Joined: 4th Jul 2003
Location: Carlsbad, CA
Posted: 14th Sep 2005 16:55
One week down, one more to go...

[center]K-OS Battlefields
IS
///---///---///---UNDER CONSTRUCTION---\\\---\\\---\\\
[center]
CPU
21
Years of Service
User Offline
Joined: 4th Jul 2003
Location: Carlsbad, CA
Posted: 17th Sep 2005 01:55
seems that I musta picked a fairly dull topic, haven't had anyone post in about 4 days or so...

Well I hope those who have already posted are still workin on them, I'm still crossin my fingers for a good entry...

CPU

[center]K-OS Battlefields
IS
///---///---///---UNDER CONSTRUCTION---\\\---\\\---\\\
[center]
Coding Fodder
21
Years of Service
User Offline
Joined: 25th Sep 2003
Location: Somewhere in my cerebralcortex
Posted: 17th Sep 2005 04:01
I still plan on posting something. But I am try to whip up something elegant for the community rpg. So I will probably get to it last minute

Something really catchy that makes people stop and think about the meaning of life and say to themselves "My but thats clever"
Neofish
20
Years of Service
User Offline
Joined: 7th Apr 2004
Location: A swimming pool of coke
Posted: 17th Sep 2005 14:39 Edited at: 17th Sep 2005 14:40
can anyone remember the location of that suvat tutorial i wrote?

(I ask in here because it was mentioned in here at some point)

Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 17th Sep 2005 15:06
suvat - are you talking about the math formulae for movement with constant acceleration? If so - I was taught to call them UVATS hehe

My Website:
Neofish
20
Years of Service
User Offline
Joined: 7th Apr 2004
Location: A swimming pool of coke
Posted: 17th Sep 2005 15:22
yes, i wrote a tutorial for some guy, it had pictures!

CPU
21
Years of Service
User Offline
Joined: 4th Jul 2003
Location: Carlsbad, CA
Posted: 20th Sep 2005 20:10
one day left... and only three entries... I'm kind of sad...

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: 20th Sep 2005 21:01
It is quite a hard challenge

My Website:
Ric
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 20th Sep 2005 22:09
Quote: "one day left... and only three entries"


That's more people than entered my pacman challenge! Peripheral vision was kind of a tricky one - not just to program, but to understand the concept in the first place. Your peripheral vision isn't exactly something you're really aware of - we tend to think of our vision as framed like a widescreen tv or a picture in a frame. Never saw a painting of a landscape with peripheral vision.

<edit> okay - I had to google it didn't I, and appararently some guy called Monet was doing the blurring at the edges thing in some style they called impressionism.

CPU
21
Years of Service
User Offline
Joined: 4th Jul 2003
Location: Carlsbad, CA
Posted: 21st Sep 2005 01:53
well, sometimes in photography they have such things as "Panorama" views, which is a 360degree view...

Well if no one else enters/improves there work, I've already got who wins... But I did think some of them showed promise, and some interesting ideas came out that I didn't think of... Anyways... its open for about another 18 hours or so...

CPU

[center]K-OS Battlefields
IS
///---///---///---UNDER CONSTRUCTION---\\\---\\\---\\\
[center]
RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 21st Sep 2005 02:01
Darn that google.

My excuse: I've been a little busy with the Open MMORPG work. I also have to go along with Ric; this was a tough one. That's okay, as we had a few easy ones too. I think the recent RPG entry, for which I even did a tutorial along the way, only had 3 or 4 entries. So 3 entries is nothing to sneeze at.


Open MMORPG: It's your game!
CPU
21
Years of Service
User Offline
Joined: 4th Jul 2003
Location: Carlsbad, CA
Posted: 21st Sep 2005 23:02 Edited at: 21st Sep 2005 23:31
Well, tis final:

Third:


Second:


First:


Well Congrads to the winner! Good luck to all on the next competition...

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: 21st Sep 2005 23:25
I got 3rd?! I dont recall entering!!!

My Website:
CPU
21
Years of Service
User Offline
Joined: 4th Jul 2003
Location: Carlsbad, CA
Posted: 21st Sep 2005 23:30
Idiot - *slaps self in head* - sorry supposed to say Coding Fodder... I'll edit the post...

Thanks for mentioning it...

CPU

[center]K-OS Battlefields
IS
///---///---///---UNDER CONSTRUCTION---\\\---\\\---\\\
[center]
Tinkergirl
21
Years of Service
User Offline
Joined: 1st Jul 2003
Location: United Kingdom
Posted: 21st Sep 2005 23:48
Well done, people I'm afraid that one left me a little confused/overwhelmed, but maybe I can catch the next one
Ric
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 22nd Sep 2005 01:28
Woohoo! Thanks CPU - it's about time I got one up on Rii! Right then, I'll get thinking of a new challenge and let you all know tomorrow. I'll be aiming for something that will hopefully attract the greatest amount of people, newcommers included, but incase I don't have much inspiration before the day is out, suggestions are welcomed.

RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 22nd Sep 2005 02:51
Congratulations Ric!

Ric's Challenge: Come up with a challenge.

How about something 2-dimensional for a change? We had one a while back, but 2D challenges don't come up that often. Maybe something like a "paint" program? Could include lots of functionality for the more experienced coders, and "just the basics" for the newcomers?


Open MMORPG: It's your game!
CPU
21
Years of Service
User Offline
Joined: 4th Jul 2003
Location: Carlsbad, CA
Posted: 22nd Sep 2005 05:35
Hmm... How bout a screen wipe competition... Kinda like the mini compo going on except this one would focus on medialess screen wipes/fades, it would allow some people the oportunity to put in practice some of the stuff the tutorial is going to be covering, and allow them to be unique and creative by being medialess...

A paint program would also suffice nicely, but I definatly agree something 2D should be on the menu...

Just a lil suggestion[s],

CPU

[center]K-OS Battlefields
IS
///---///---///---UNDER CONSTRUCTION---\\\---\\\---\\\
[center]
Tinkergirl
21
Years of Service
User Offline
Joined: 1st Jul 2003
Location: United Kingdom
Posted: 22nd Sep 2005 06:28
Found a lovely page for giving ideas, not just for this challenge, but in general...
http://www.humus.ca/index.php?page=3D&ID=43
and
http://www.humus.ca/index.php?page=3D&ID=32
are my two favourites.

(and while maybe not for this, but RiiDii - you might want to look at http://www.humus.ca/index.php?page=3D&ID=23, it's cool.)

Generally, www.humus.ca is a page just bursting with ideas for mini-tasks.
RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 22nd Sep 2005 09:00
Ooo... I like. That's actually along the lines of what I tried for the matrix test (incomplete on the global scale), and is, in concept, what we want to use for the new terrain. I just didn't know it had a name. But that scene is really neat. Hope we can get that good.

I also like the glowy effect. That would be something neat to give a try (although it may be a bit advanced).


Open MMORPG: It's your game!
Ric
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 22nd Sep 2005 20:35 Edited at: 22nd Sep 2005 21:03
Thanks for the inspiration people - most useful. The challenge is:

___________________________________________________________________

**** Make an medialess infinite 3d terrain ****

(should be useful for you community rpg people!)

Deadline: 2 weeks (Thursday 6th October 2005)

Judging will be based on these criterea:

- is the terrain infinite? (as the title of the challenge hints at!)

- seamlessness (ie. if you are using a tile based method, can you see the seams between each tile? Hopefully not!))

- non-repetativeness (ie. will you always see new terrain, or will you just be repeating sections over and over?)

- realism (ie. do they look anything like hills/mountains/sand dunes etc.)

-additional features (however you choose to interprate that!)

You can use matrices, mesh manipulation, advanced terrain (so long as you can figure out how to produce the necessary media, save it, load it up and use it all within the same piece of code), or whatever other method you can think of.

And as a final suggestion, if anyone comes up with something good, we could then perhaps use it in future challenges - like a basic flight sim challenge, for example.

Good luck!

Ric
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 22nd Sep 2005 20:47 Edited at: 22nd Sep 2005 20:49
I'll set the ball rolling with a couple of rambling thoughts on making an infinite terrain, which might give some kind of starting point for any newcomers who need one.

Idea 1: Use a matrix, use the set matrix height to set the heights at the edges, then use the scroll matrix commands to give the appearance of movement.

Idea 2: Again using matrices, but a grid of 9 of them, 3 by 3. You start in the middle one, but as you move forwards on to the foremost matrix, the rearmost (is that a word?) matrix behind you gets deleted and placed at the front. The opposite would happen if you moved backwards, and the same principle would be applied for left and right. Making this sort of landscape seamless would be a challenge though, I think.

Idea 3: Create a perlin noise generator to make some height maps, save them and then load into advanced terrain, then use the tile based approach in idea 2.

Any other ideas/comments?

Teh Go0rfmeister
21
Years of Service
User Offline
Joined: 17th Aug 2003
Location:
Posted: 22nd Sep 2005 21:48
wow, cheers, you gave me an idea for my terrain editor ^_^

Tinkergirl
21
Years of Service
User Offline
Joined: 1st Jul 2003
Location: United Kingdom
Posted: 22nd Sep 2005 23:59
If I can manage this, I hope to use a diamond/square fractally generated landscape. Lets see if I can manage
Ric
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 23rd Sep 2005 00:03
That sounds promising. But how are you planning on making it infinite? Tiles?

Tinkergirl
21
Years of Service
User Offline
Joined: 1st Jul 2003
Location: United Kingdom
Posted: 23rd Sep 2005 00:38
Yup, with the edges locked to ensure they're the same height and don't leave nasty joins. Hopefully. If it works

Only problem is - I dont want to abandon my cow code. So if I have enough time, it'll be a landscape with cows. Got to finish the cows first or I'll never finish them!

Here's an excellent guide to the method, better to share than to hide. And that means that even if I can't manage it - someone maybe can
http://www.gameprogrammer.com/fractal.html
Ric
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 23rd Sep 2005 16:59
Useful link there TG - very interesting. Might have a go at that.

spooky
22
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 24th Sep 2005 00:00
I'm up for this challenge! I have just spent last couple hours perfecting that diamond-square algorithm and it produces pretty nice seamless terrains. I have now got it making a matrix with grass, snow and water level. Normals are looking nice aswell. Just got to revisit my alienware compo game which used Ric's idea 1 of shifting matrix and updating the edges. For example in that game, game map was 300 * 300 units which populated a matrix 79 * 79 units. As player crossed a tile bounday, simply shift matrix and then move matrix 1 by 1 tile, then update edge tile, texture and normal from correct row or column from array.

Hopefully I'll post up my code in the next few days.

Boo!
Ric
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 24th Sep 2005 00:53 Edited at: 24th Sep 2005 00:54
Good to have you on board Spooky.

@ All: You're all in trouble now, as I know how good Spooky is with fractals.

RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 24th Sep 2005 03:04 Edited at: 24th Sep 2005 03:04
Spooky helped out with a workaround for bug I found on scrolling matricies, so if I have to go to Spooky for help... I might just be in trouble. Especially since I am new to fractals too.

Just go easy on us Spooky


Open MMORPG: It's your game!
Segan
19
Years of Service
User Offline
Joined: 28th Aug 2005
Location: Canada
Posted: 24th Sep 2005 05:25
Hiya everybody!

You said you wanted newcomers, so here I am!

I have been programming for a year now (anyone hear of LTPB? )but just got my hands on a copy of Darkbasic a month (or two) ago. So I've been around programming long enough to get my feet wet, but I'm a complete newbie when it comes to 3d programming (so be nice!)

Anyways, I threw a little bit of code together (mostly for my own practice) for this competition, and decided to post it:



I used a slightly modified version of Ric's second idea, but where you are always walking on the same matrix (they just keep swapping positions and heights). The heights are generated using a formula that should simulate random numbers, except that they are the same each time. (If you want a different terrain, change some constants at the top of the program). (*Note: The formula I used is not at all ideal: If anyone knows of a better one, I'd love to hear it!)

Oh, and don't expect any great show of artistic skill. I will try to make it nicer to look at before the end of the competition.
Teh Go0rfmeister
21
Years of Service
User Offline
Joined: 17th Aug 2003
Location:
Posted: 25th Sep 2005 00:44
well, certainly tougher than i expected, but maybe thatsd because i planned so much. nice surprise that what i suspected to be hard has actually turned out to be easy though. you wait. 6th october, my entry gonna pwn ^_^

Ric
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 25th Sep 2005 02:32 Edited at: 25th Sep 2005 12:18
Hi Segan - welcome to the challenge, and hey - that's a pretty darn good start there! Definitely infinite with no obvious seams. Hope to see you continue work on this. By the way, you've already won the 'extreme indentation challenge'!!

@Go0rfmeister: feel free to post a work in progress!

Darkbasic MADPSP
19
Years of Service
User Offline
Joined: 15th Jun 2005
Location: Uk
Posted: 25th Sep 2005 11:35
heres my attempt


attached media below

Gtas back and bigger and better than before

Attachments

Login to view attachments
Darkbasic MADPSP
19
Years of Service
User Offline
Joined: 15th Jun 2005
Location: Uk
Posted: 25th Sep 2005 11:35 Edited at: 25th Sep 2005 11:36
only small but is good and the camera feels like it's moving real slow

Gtas back and bigger and better than before
Ric
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 25th Sep 2005 12:02
@ DBMad: You've made yourself a random landscape there - but you've got some way to go still before you can call it a medialess infinite terrain. For a start, you're not allowed to use medea in any of these challenges, so you need to create the grass texture within the code. (If we were allowing media, you could just load in a complete landscape from geoscape - kind of defeating the object of a 'coding' challenge!). For example, you could make your grass image like this:



Secondly, your matrix is very big, but it's not infinite. You must be able to move in any one direction and never reach the end of the matrix. See my post above for ideas on how to do that.

Once you've put those two things right, you could then start thinking about how to make the shape of the hills more realistic. Keep working on this DBMad - it's a great learing exercise, and what you end up with would be really usefull for games like flight sims, where you need truly massive landscapes!

Darkbasic MADPSP
19
Years of Service
User Offline
Joined: 15th Jun 2005
Location: Uk
Posted: 25th Sep 2005 12:13
thanks ric i've never worked out how to do infinete terrain it would be good it's just i saw

Quote: "media, save it, load it up and use it all within the same piece of code), or whatever other method you can think of.
"

Could you please provide an example infinete matrix that i could edit and put here

Gtas back and bigger and better than before
Ric
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 25th Sep 2005 12:22
With any luck, you'll see numerous examples of infinite terrains appearing in this thread over the next couple of weeks - look at Segan's code above for a start. That's the whole point of these challenges, you learn from other peoples code. And when you produce something good, other people learn from your's too!

Darkbasic MADPSP
19
Years of Service
User Offline
Joined: 15th Jun 2005
Location: Uk
Posted: 25th Sep 2005 12:26 Edited at: 25th Sep 2005 12:28
thanks ric i'll have a look i've just came up with an idea what if i put the matrix in a loop?

Gtas back and bigger and better than before
Ric
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 25th Sep 2005 19:54
Using the 'shift matrix' commands makes the matrix 'loop'; try using those to shift the matrix around while keeping the camera in the same place, rather than moving the camera and keeping the matrix in the same place.

Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 27th Sep 2005 04:53 Edited at: 27th Sep 2005 05:43
Are we allowed to use include files? I dont have to, but it keeps my code neat and clean, plus I have already have a library with a slew of memblock terrain functions.

nevermind, i quit. I just lost an hour of code typing and im too pissed off to continue


Deadly Night Assassins
Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 27th Sep 2005 08:23
thats the problem I found with using includes - the IDE has a tendancy to lose or mix stuff up... unlucky dude.

My Website:
Ric
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 27th Sep 2005 23:06
The answer would probably have been no anyway - it's just too much hard work for lazy people like me to have to copy numerous sections of code and arrange them in the right folder before you can get the program to run. I just want to copy, paste and execute - anything else and I just can't be ar**d.

Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 28th Sep 2005 10:49
That is the whole point of these challenges - you HAVE to be able to copy and paste code from codebox to IDE

I REALLY wanna find time for this one as I'm pretty nifty with terrains - but unfortunately I have SO much going on in my life at the moment... :-(

My Website:
Ric
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 28th Sep 2005 17:09 Edited at: 28th Sep 2005 17:10
Hmmm - 'life stuff' sounds boring. Girlfriends, work, family - please! A proper geek knows that coding an infinite terrain is far more gratifying!

Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 28th Sep 2005 18:04
I hear that!!!! hehehe

My Website:
Segan
19
Years of Service
User Offline
Joined: 28th Aug 2005
Location: Canada
Posted: 29th Sep 2005 02:36
Well, since this competition has received so many entries..


On to my second version!



Now this may look similar to you on first run through, but has actually changed a bunch. Features:

-All of the "globals" in the top section (in the first "paragraph")are now 100% changeable to customize program as you wish! This allows for a much bigger range of possible terrains.

-"Smooth" feature (play around with the "Smoothness" and "Smoothby" globals to see how this works!

-Much neater code (still need to comment though)

-"Hills!" Not going exactly as planned, but allow for parts of terrain not to be affected by the "smooth" command.


Still to be done:

-I am still working hard on inproving my random number generator (might experiment with trig functions soon)

-Esthetics (later)

Oh, and I posted this now, because I probably won't be able to do substantial work for a couple of days, so I thought I should submit this for feedback!



And here are some examples of terrains you can build!



-(In the example) A "sand-dunes" type of landscape



-A Very jagged mountainy landscape.



-A rolling hills landscape which includes a few mountains.
Segan
19
Years of Service
User Offline
Joined: 28th Aug 2005
Location: Canada
Posted: 29th Sep 2005 06:40
Well, since this competition has received so many entries..


On to my second version!



Now this may look similar to you on first run through, but has actually changed a bunch. Features:

-All of the \"globals\" in the top section (in the first \"paragraph\")are now 100% changeable to customize program as you wish! This allows for a much bigger range of possible terrains.

-\"Smooth\" feature (play around with the \"Smoothness\" and \"Smoothby\" globals to see how this works!

-Much neater code (still need to comment though)

-\"Hills!\" Not going exactly as planned, but allow for parts of terrain not to be affected by the \"smooth\" command.


Still to be done:

-I am still working hard on inproving my random number generator (might experiment with trig functions soon)

-Esthetics (later)

Oh, and I posted this now, because I probably won\'t be able to do substantial work for a couple of days, so I thought I should submit this for feedback!



And here are some examples of terrains you can build!



-(In the example) A \"sand-dunes\" type of landscape



-A Very jagged mountainy landscape.



-A rolling hills landscape which includes a few mountains.

Edit: Whoops! Found a typo bug but fixed it. All should work fine now!
RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 29th Sep 2005 11:07
Here's my wip as it stands so far. The theory works fine as the heightmap actually does "scroll" properly (as best I can tell), but for some reason the terrain changes after each "zone". The heightmap is displayed off to the left of the screen with a red dot indicating the player's position. If you watch this carefully, you can see the terrain scroll appropriately with the player, which is why the changing terrain has got me stumped. I'm probably not lining up my levels of detail properly or something along those lines.

"Zones" are my second problem, but only cause a slight delay on my pc.




Open MMORPG: It's your game!

Login to post a reply

Server time is: 2024-11-23 15:07:15
Your offset time is: 2024-11-23 15:07:15