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 Discussion / The DB Classic Programming Challenge Thread

Author
Message
Libervurto
19
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 24th Jul 2007 19:55 Edited at: 24th Jul 2007 19:59
Can you see this post? cos I can't see any.
It's fine now. Some kinda bug.

I am king of the noobs!
Insert Name Here
18
Years of Service
User Offline
Joined: 20th Mar 2007
Location: Worcester, England
Posted: 24th Jul 2007 20:20
800 posts may have something to do with it. And on here it says 801 posts and in the thread list it says 802.
God this forum is buggy...

I never tell the truth.
That ain't a paradox.
I always tell lies is though.
Richard Davey
Retired Moderator
23
Years of Service
User Offline
Joined: 30th Apr 2002
Location: On the Jupiter Probe
Posted: 24th Jul 2007 20:39
800 posts has nothing to do with it. The Word Association thread has over 10,000 and paging still works.

Never trust a computer you can't throw out of a window
Insert Name Here
18
Years of Service
User Offline
Joined: 20th Mar 2007
Location: Worcester, England
Posted: 24th Jul 2007 21:42
Oh... Proven wrong again.

I never tell the truth.
That ain't a paradox.
I always tell lies is though.
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 25th Jul 2007 03:38
Quote: "What actually IS a viewport?"


In simple terms...

It's the 2D section of the screen that displays the 3D. Each of the dots that make up the corners of a cube have an X,Y,Z co-ord in space. The co-ord of each one is passed to a rotational matrix for the required axis.

The result is then passed to a scaling matrix if required and finally to a transformational matrix which turns the 3D co-ord into a 2D co-ord to display in the viewport - based on the camera position.

Quote: "SCREEN is in the setup procedure so it can't be that. Is it the screen refresh rate?"


No, in GFA Basic, SCREEN is the same as Set Display Mode in DB.

Back then, you only had CGA and VGA screen modes - not the thousands of modes you have now.

As such, the display modes were given numbers - Like Screen 18, which if I remember correctly was 640x480 with 16 colours - the best you could get at the time!

Quote: "Can this be translated into DB"


Yes - the hardest part would be replicating the MAT commands which in GFA gave you a number of matrix options (mathematical rather than terrain type that is)...

When I have a few minutes spare I'll have a look at converting it to DB for you...

TDK_Man

TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 25th Jul 2007 03:42
The actual total number of posts I don't think is important - it seems to be that occasionally if you make the first post that would appear on a new page of a long thread, it doesn't appear until someone else makes a post.

Not sure why, but it's happened to me a few times.

I just wait for someone to make another post and mine magically re-appears!

No major panic when you know what will happen...

TDK_Man

Insert Name Here
18
Years of Service
User Offline
Joined: 20th Mar 2007
Location: Worcester, England
Posted: 25th Jul 2007 11:15
Woah, TDK. Look at the attatched image.
Is this your second home?

I never tell the truth.
That ain't a paradox.
I always tell lies is though.
Pixelator
18
Years of Service
User Offline
Joined: 8th Jul 2007
Location: here
Posted: 25th Jul 2007 17:23
im back. i was gone so long because i am at my grandparents house because my grandma is very sick

The problem with the gaming community is people think that the resolution of a game defines how good it is. I am not afraid to make a game where the main character is 50x50.
Insert Name Here
18
Years of Service
User Offline
Joined: 20th Mar 2007
Location: Worcester, England
Posted: 25th Jul 2007 21:01
You've missed 49 posts while yo've been away.
I hadn't noticed you were gone.

I never tell the truth.
That ain't a paradox.
I always tell lies is though.
Libervurto
19
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 26th Jul 2007 11:34 Edited at: 26th Jul 2007 11:35
@TDK
I tried posting again and the thread came back! Magic
Wasn't expecting you to translate it but if you did that'd be a great help
is MAT like DIM then?

I am king of the noobs!
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 26th Jul 2007 16:36
No, MAT in GFA is a collection of Matrix commands for maths calculations - nothing to do with the matrix found in DB.

TDK_Man

BMacZero
19
Years of Service
User Offline
Joined: 30th Dec 2005
Location: E:/ NA / USA
Posted: 26th Jul 2007 17:13
Is there any way to watch a thread without actually replying? lol


"Of course you should fight fire with fire. You should fight everything with fire!" —Jaya Ballard, task mage
Insert Name Here
18
Years of Service
User Offline
Joined: 20th Mar 2007
Location: Worcester, England
Posted: 26th Jul 2007 18:41
That was completely unrelated... but I don't know.

I never tell the truth.
That ain't a paradox.
I always tell lies is though.
BMacZero
19
Years of Service
User Offline
Joined: 30th Dec 2005
Location: E:/ NA / USA
Posted: 26th Jul 2007 19:10 Edited at: 26th Jul 2007 19:10
It wasn't unrelated, I just posted that so I could watch the thread! I'm interested in how people do this, as I'm looking for something that allows me to click on and select 3D objects with the mouse for one of my games.


"Of course you should fight fire with fire. You should fight everything with fire!" —Jaya Ballard, task mage
Insert Name Here
18
Years of Service
User Offline
Joined: 20th Mar 2007
Location: Worcester, England
Posted: 26th Jul 2007 20:01
Use these:

etc

I never tell the truth.
That ain't a paradox.
I always tell lies is though.
BMacZero
19
Years of Service
User Offline
Joined: 30th Dec 2005
Location: E:/ NA / USA
Posted: 26th Jul 2007 20:43
Oh, I completely forgot about those commands. However, there is still a problem because that requires you to click on the exact point the object is on, and it would be much better if you could select the object even if you clicked on one of the outer parts.


"Of course you should fight fire with fire. You should fight everything with fire!" —Jaya Ballard, task mage
NinJA999
19
Years of Service
User Offline
Joined: 11th Nov 2005
Location: NH
Posted: 26th Jul 2007 21:05
If you have darkbasic pro, you can use pick object(mousex(),mousey(),startobjectnum,endobjectnum) --there's even a whole example in the help files. Of course, they don't have that in DBC, that's why we have this contest.

BMacZero
19
Years of Service
User Offline
Joined: 30th Dec 2005
Location: E:/ NA / USA
Posted: 26th Jul 2007 21:20
Oh. Thanks for all the help, I'll go away now


"Of course you should fight fire with fire. You should fight everything with fire!" —Jaya Ballard, task mage
Insert Name Here
18
Years of Service
User Offline
Joined: 20th Mar 2007
Location: Worcester, England
Posted: 26th Jul 2007 21:29
Quote: "Oh, I completely forgot about those commands. However, there is still a problem because that requires you to click on the exact point the object is on, and it would be much better if you could select the object even if you clicked on one of the outer parts.

"

There is a way around that.

I never tell the truth.
That ain't a paradox.
I always tell lies is though.
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 27th Jul 2007 03:47
Just to unnerve you all, I thought I'd tell you I've re-written my AOE troop selection program from scratch.

It looks cool... but, it doesn't work properly.

Time yet though...

TDK_Man

Latch
19
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 27th Jul 2007 10:17
I think we should have a different challenge. I think this one is difficult enough not to generate many entries (as there aren't any so far). I like the challenge, but I think it may be a bit hard for less experienced DBC programmers.

Enjoy your day.
Comrade Robski
19
Years of Service
User Offline
Joined: 12th Sep 2005
Location:
Posted: 27th Jul 2007 11:49 Edited at: 27th Jul 2007 11:53
@Latch, comments taken on board - I think I'll wait a little longer before giving up on the challenge, however - Some people have expressed interest - Insert Name Here kinda oliquely suggested with his "There is a way around that." post that he may be entering. And of course TDK is gonna enter!

Remember you don't have to be able to select multi units in 3D to enter. I tried to set the challenge net as wide as possible - write a program to select a 2D sprite with the mouse. I think most beginners could definately have a go at that. Or just stick with single object selection in 3D.

As an aside, I was thinking of a small rule change to encourage more newcomers to enter: Each challenge has two categories and two winners - Rookie and Veteran. If you have ever won a previous DBC challenge, you are entered for the Veteran category, otherwise you go in the Rookie category. All the rules and specifications are the same for both categories. The winner of the Rookie challenge sets the next challenge. If no Rookies enter, then the winner of the Vet's challenge sets the next one. Thus you still get compertition between the more experienced programmers, and the newcomers have something to play for. What do you think? If you guys agree, we could even implement this for this challenge.

EDIT: Slight alteration - because it will be 'easier' to win the Rookie challenge than the old single category challenge, a Rookie must win n rookie challenges (n = 2 or 3?) to be promoted to the Veteran's challenge.
Insert Name Here
18
Years of Service
User Offline
Joined: 20th Mar 2007
Location: Worcester, England
Posted: 27th Jul 2007 12:04
Quote: "I think we should have a different challenge. I think this one is difficult enough not to generate many entries (as there aren't any so far). I like the challenge, but I think it may be a bit hard for less experienced DBC programmers.
"

Well according to the rules, you can't change the challenge if someone's started or objects. I've started, I'm objecting!

I never tell the truth.
That ain't a paradox.
I always tell lies is though.
Comrade Robski
19
Years of Service
User Offline
Joined: 12th Sep 2005
Location:
Posted: 27th Jul 2007 12:08
ok I guess that settles it then
Libervurto
19
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 27th Jul 2007 13:53 Edited at: 27th Jul 2007 13:54
@CR
I like the Rookie/Veteran Idea! Sounds great.
The simplest way of doing it is to make them like divisions.
To stand a chance of winning the whole challenge you have to have won as a rookie first, but equally once you have won you enter the veteran "division" and can no longer win as a rookie.

If you think it'd be better for rookies to be able to win the whole thing straight off that'd be cool too. Personally I think you should have to win the rookie "division" first as a sort of initiation.

I am king of the noobs!
Insert Name Here
18
Years of Service
User Offline
Joined: 20th Mar 2007
Location: Worcester, England
Posted: 27th Jul 2007 14:46 Edited at: 27th Jul 2007 18:01
Well, now you REALLY can't change the challenge, cause I've entered!

It's set in the appolo forums. I wanted to get TDK in there somewhere but I couldn't.

I never tell the truth.
That ain't a paradox.
I always tell lies is though.
Libervurto
19
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 27th Jul 2007 15:10 Edited at: 27th Jul 2007 15:13
You missed a comma in your win gosub
Quote: "center text 320 240,"Lee will be ever grateful.""


The objects looked cool, the static animation keeps the player's interest ; I especially like the rotating guns.
The selection didn't seem that accurate and I'd like it if you could click on the menu options instead of switching to the keyboard, this became quite awkward.

Good start though

I couldn't defeat FPS Creator

[edit]
I don't know how difficult it would be to make, but it'd be cool if you could make the DB pyramid!

I am king of the noobs!
Libervurto
19
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 27th Jul 2007 15:49 Edited at: 27th Jul 2007 15:57
here is a "teaser" of mine.
I'm not so good with 3D and very out of practice, so this one will be a big challenge for me



What I want to do is somehow work out the maths to get the 3D object selection exactly right, and draw a 2D 3D image of the object on the screen to check it (will be removed in final version)
Is is possible to get it exact? what parameters do I need to do this?

I am king of the noobs!
NinJA999
19
Years of Service
User Offline
Joined: 11th Nov 2005
Location: NH
Posted: 27th Jul 2007 17:09
The rookie/veteran idea is a good one, I just think that the rules might be changed slightly as so:

either only one win promotes you to veteran
or
a runner-up counts as a win going towards promoting you
or
instead of rookie/veteran there is intermediate/advanced and you can (if you really want) enter either one, if you like the challenge.

just my two cents.

Libervurto
19
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 27th Jul 2007 17:54 Edited at: 27th Jul 2007 18:05
The Item Chasing challenge needs updating
[href]zimnox.com/dbcc2/?page=view&challenge=Item%20Chasing%20Game[/href]

About the rookie/veteran idea:
firstly, I think these are the best names as it applies to whether you are a rookie or veteran of the DB challenges.
This is the best way I can think of doing it:
Include all entries in the same competition, declare an overall champion (best entry) and a rookie champion (the best entry of all entrants that have never won, or second best if a rookie is the overall champion), the overall champion and rookie champion would be counted as veterans in further challenges, and so could not win the rookie title.
In other words, everyone can compete but you can only win the rookie title once (or never if you win the whole thing first!)

I am king of the noobs!
Libervurto
19
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 27th Jul 2007 18:07
I've put my Rookie status as my "playing"

I am king of the noobs!
Libervurto
19
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 27th Jul 2007 18:10
Huh it cleared my profile?
Libervurto
19
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 27th Jul 2007 18:15
OK, Don't anything in the "playing" box or it will delete your entire profile. I think you could change your forum name this way

I am King of the noobs!
Sinani201
18
Years of Service
User Offline
Joined: 16th Apr 2007
Location: Aperture Science Enrichment Center
Posted: 28th Jul 2007 05:42 Edited at: 28th Jul 2007 05:51
@INH
I like the game, except when I choose any of the options, the screen turns white and my computer messes up.

Did someone say 3D scanning on my desk, or was that just an AdBot?
What happens when when you mix coke, pop rocks, vinegar, and baking soda?
Insert Name Here
18
Years of Service
User Offline
Joined: 20th Mar 2007
Location: Worcester, England
Posted: 28th Jul 2007 19:54
Uhm.. I don't know why that would be... (Collapses) It worked fine for me and OBese87, so I don't know what caused it to fail...
@OBese87- Cool box, but my pizza was cold.

I never tell the truth.
That ain't a paradox.
I always tell lies is though.
Latch
19
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 28th Jul 2007 20:14
@Insert Name Here

The screen looks nice but:

If I select anything from the submenus, the screen flashes I get "...performed illegal operation..." error, then the program crashes and dark basic closes.

I noticed that in your code you have a label called loop. And you have gosubs to loop. You should avoid using keywords as labels.

Enjoy your day.
Libervurto
19
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 28th Jul 2007 20:52 Edited at: 28th Jul 2007 20:55
@INH
You should make everything into gosubs, like this. I don't like that your menu gosub has no return and straight after is a function (the program will crash if it hits a function)
I always put an END after the main loop and then my functions, then gosubs, that way you're safe

the main loop itself shouldn't be a gosubs, try and change it.
Sorry to be picky but it'll look (and probably) work a lot better
with a bit of re-writing.

I am King of the noobs!
Insert Name Here
18
Years of Service
User Offline
Joined: 20th Mar 2007
Location: Worcester, England
Posted: 28th Jul 2007 22:42
I'll have a look at it in a day or so. This was only quick anyway, I was't expecting it to be good, I just wanted to learn some more.

I never tell the truth.
That ain't a paradox.
I always tell lies is though.
Libervurto
19
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 29th Jul 2007 00:01
@INH
You should try and get into the habit of just writing gosub names in your main loop before you start, then it's much easier to program and keep track of
I've started doing this and it really helps.

I am King of the noobs!
Pixelator
18
Years of Service
User Offline
Joined: 8th Jul 2007
Location: here
Posted: 29th Jul 2007 01:59
back again. when is the deadline???

The problem with the gaming community is people think that the resolution of a game defines how good it is. I am not afraid to make a game where the main character is 50x50.
Insert Name Here
18
Years of Service
User Offline
Joined: 20th Mar 2007
Location: Worcester, England
Posted: 29th Jul 2007 12:30 Edited at: 29th Jul 2007 12:38
Go back a page, scroll down.
EDIT: Two pages, now.
EDIT2: I looked at the code a did the gosubs as yo guys said, but it cause the error to happen to me too.

I never tell the truth.
That ain't a paradox.
I always tell lies is though.
Libervurto
19
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 29th Jul 2007 15:15
@INH
Post your code, maybe I can help.

I am King of the noobs!
roddman
18
Years of Service
User Offline
Joined: 24th Jul 2007
Location: Over There
Posted: 29th Jul 2007 19:48
This is my first stab at a challenge, I liked doing this one. So getting to the point, my entry is "Mine Avoidance" and is farily straight foreward. It is an RTS style game, select blue team members and move them around to avoid the mine blasts.

Click and drag with the left mouse button to select team members.
Click the right mouse button to command them to move.
(They can only move to the crosshairs, I wanted to move them to where the player clicked but couldn't get the math right)
The Blast Radius is 100 so look out.

Choose difficulty of 1-10
Passwords
Press CTRL and enter "CORYRULES" for godmode
Press CTRL and enter "INSANE" for insanemode
Mines explode 2x faster
Also Blast Radius is doubled



Hope you enjoy

Cory
Insert Name Here
18
Years of Service
User Offline
Joined: 20th Mar 2007
Location: Worcester, England
Posted: 29th Jul 2007 21:37 Edited at: 29th Jul 2007 21:50
I lost the code when it shut, give me a second...
EDIT: Here y'are.


I never tell the truth.
That ain't a paradox.
I always tell lies is though.
Libervurto
19
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 29th Jul 2007 22:04 Edited at: 29th Jul 2007 22:24


It's not really great to have several do loops and jumping between them.


The rest of the code is pretty good, just put the code before the main loop into gosubs and make it so you don't need the "loop:" label. All gosubs should return to the loop anyway.
Can't test it as I dont have DB here but hope this helps

[EDIT]
Ok some of the gosubs don't have returns, and I see the problem you are having, the menu goes to the CMC label so then you can no longer return to the loop!
But really you can. Remember that gosubs are like branches or paths, as long as you have a clear route back you can branch off as many times as you like . Though I'm sure TDK wouldn't recommed this lol.
I've also added SELECT and CASE statements. When you are checking many values for one variable use the these statements.



I am King of the noobs!
Insert Name Here
18
Years of Service
User Offline
Joined: 20th Mar 2007
Location: Worcester, England
Posted: 30th Jul 2007 11:23
Ahhh, I's totally forgotten about repeat. Thanks for that.

I never tell the truth.
That ain't a paradox.
I always tell lies is though.
Comrade Robski
19
Years of Service
User Offline
Joined: 12th Sep 2005
Location:
Posted: 30th Jul 2007 12:12
roddman - thanks for your entry, I'll test it out as soon as I can and report back.

INH: I liked you game, I too had some problems with DB crashing, but sometimes it randomly worked. I won on my second or third attempt. I especially liked the textures. Good work.

Obese: Very nice pizza box texture - I'm looking forwards to the complete game!
Insert Name Here
18
Years of Service
User Offline
Joined: 20th Mar 2007
Location: Worcester, England
Posted: 30th Jul 2007 13:01
Roddman: You post just appeared above some of ours- Howd'you do dat?
Nice game, very good maths at work there, but if i pressed control the game just froze.

I never tell the truth.
That ain't a paradox.
I always tell lies is though.
Comrade Robski
19
Years of Service
User Offline
Joined: 12th Sep 2005
Location:
Posted: 30th Jul 2007 14:26
I guess since he just registered he is still noobslapped
roddman
18
Years of Service
User Offline
Joined: 24th Jul 2007
Location: Over There
Posted: 30th Jul 2007 17:36
Yeah ive actually had DB for over a year now but just now registered on the forum.

@ Insert Name Here
It is a glitch the game doesn't actually freeze you can still type in the codes the text blinks on then off even though I don't use sync

you can just add GodMode=1 or InsaneMode=1 to the top and get the same thing. Thanks for the feedback

Cory

Login to post a reply

Server time is: 2025-08-08 20:41:43
Your offset time is: 2025-08-08 20:41:43