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
Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 12th Feb 2006 13:31
I think I'll try out this challenge

Ric
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 12th Feb 2006 13:52
Excellent - I hope there are lots of entries for this one - I love playing Asteroids, so I'll have great fun when it comes to judging!

As I can't win this challenge, I might try to be useful - I was thinking of having a go at creating some nice no-media asteroid textures for people to use.

BillR
21
Years of Service
User Offline
Joined: 19th Mar 2003
Location: United States
Posted: 12th Feb 2006 15:30
@Ric - sounds like a great idea, I know I could use some textures.
Philip
21
Years of Service
User Offline
Joined: 15th Jun 2003
Location: United Kingdom
Posted: 12th Feb 2006 15:31
For those people who aren't experienced / knowledgeable on vector based movement (as used in Asteroids), there is a page on this in my Vector Tutorials. You can find them by looking in BatVink's excellent Tutorial City.

Cheer if you like bears! Cheer if you like jam sandwiches!
RiiDii: "I highly recommend Philip's vector tutorials"
P3.2ghz / 1 gig / GeForce FX 5900 128meg / WinXP home
RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 12th Feb 2006 19:18
Phillip's tutorials on vectors taught me almost everything I know about vectors. It is really well done and I highly recommend it.


Open MMORPG: It's your game!
Freddy 007
19
Years of Service
User Offline
Joined: 30th Nov 2004
Location: Denmark
Posted: 12th Feb 2006 21:50 Edited at: 13th Feb 2006 00:03
What's the link? I can't seem to find it anywhere! (EDIT) Somebody hit me! I just realized it was a sticky... (/EDIT)

I might enter this one. It's a long time since I actually made ANYTHING in darkbasic, so I'm a bit rusty. And if there's a chance this can make me learn more about vectors, then I'm in.

Milkman
18
Years of Service
User Offline
Joined: 30th Nov 2005
Location: United States
Posted: 13th Feb 2006 03:19
My entry is coming along nicely, and infact I am almost done!
I would post my entry, but it's so close to completion that it would be a spoiler
I do have one question though, and that is when is the deadline?
thanks!

PS: Thanks for commenting Ric. I have adjusted the speed slightly, because it did seem a little fast.

formerly xMik
Ric
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 13th Feb 2006 03:40
Deadline: Saturday 25th February.

Classic Evil
19
Years of Service
User Offline
Joined: 4th Nov 2005
Location: watching you through your window
Posted: 13th Feb 2006 03:46
Hey Ric the dead line should be the 27th

There are two types of people in this world: people who are extremly cool and are good at everything and people who are me.
Darth Vader
19
Years of Service
User Offline
Joined: 10th May 2005
Location: Adelaide SA, I am the only DB user here!
Posted: 13th Feb 2006 07:42
Heh this is similar to the modern looking asteroids clone 'Comet'!
I might give this a try though I will probably never make it (My programming is not the best (I have'nt programmed in DBP for at least 4 months!))

But I will give it a try!

You Don't know the power of the Dark Side!!
Oh but I do!!
Freddy 007
19
Years of Service
User Offline
Joined: 30th Nov 2004
Location: Denmark
Posted: 13th Feb 2006 11:47
Uh, suddenly I'm doubting I cam make this... Yesterday I didn't manage to set up an "engine" for this, and I', busy the rest of this week. And then on Monday and Tuesday I'm having mid-term exams... I'd like to enter, I haven't been active in these challenges yet, and I'd like to get started with dbpro again... Well, I'll see if I can make it.

And good luck to all contestants!

Ric
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 13th Feb 2006 19:05
Quote: "Hey Ric the dead line should be the 27th"


Why? It's a two week challenge, as is normal, which takes us to the 25th.

Chris Franklin
19
Years of Service
User Offline
Joined: 2nd Aug 2005
Location: UK
Posted: 13th Feb 2006 20:42
I think he want's his cat hands to persuade it on 2 more days

Theme park simulator 15% Currently making object selection
Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 13th Feb 2006 21:18 Edited at: 13th Feb 2006 21:26
Quote: "Wow - I'm surprised, in fact I'm slightly amazed.

I don't expect you to change your vote, but I'm surprised you voted that way in the first place. I do think you lost sight of what the challenge goal was supposed to show, or at least what I thought we were trying to achieve by use ODE. I thought this was a more technical challenge, in fact look at the numbers of entries, that's how hard it was.

I thought the challenge was to use ODE, to simulate a realistic physics environment within each programmers idea. I think my shooting gallery successfully shows ODE in action, with far less problems than Ric's code. You seemed to vote for the 'nicer looking game'.

I know Ric spent a LONG time trying to get the physics to work the right way for his pool table simulation, but was unable to get it to work right. He is easily the one of the best graphics programmers without media here. But maybe his choice of projects didn't work as well for ODE. Can you honestly say pool balls break slugishly like that, or that you can shoot through balls when you are too close to them. I know Ric is frustrated with the balls not behaving the right way, and you should have been too.

I did get busy at work and didn't get to add some nicer textures etc, but that should have mattered less than gameplay, and which simulatiion simply worked better with fewer physics problems.

Which entry showed the best use of ODE, more realistic physics, and which programmer made the best use of ODE. We both spent a lot of time struggling with ODE, but which program solved more problems using ODE?"


BillR,

I am sorry if it looked like that. But the aim was simply like all the others challenges. My opinion may be different than the one that someone else would have, but I have to make choices.

In this challenge, it seems that you're slightly frustrated for not winning. I do have a weakness for good-looking media, which was probably Ric's advantage, though you're gameplay was more creative.

Besides, it's only a game(-challenge).

And please, don't flame me. I'm only human, and believe me, it's hard with 2 entries to decide which one should win. You're either the first, or the last.

It's the programmer's life:
Have a problem, solve the problem, and have a new problem to solve.
Freddy 007
19
Years of Service
User Offline
Joined: 30th Nov 2004
Location: Denmark
Posted: 14th Feb 2006 01:50 Edited at: 14th Feb 2006 02:07
Alright, I've started my game, but I haven't even got the basics yet. The reason I'm posting is that I'm being annoyed by what appears to be a bug. I can't figure out what the bug precisely is caused by, but it seems that this line:



Is causing some trouble. I get a compile error telling me, that declaration name '60' is not valid. Here's the full source:



Does any of you get the error as well? What's the problem, and what's causing it?

EDIT: Well, it works if I change the name of the constant to 'thingy'. It seems that the name 'stars' is bugged.

Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 14th Feb 2006 09:48
dont put the equals symbol, ie, do this:


Ric
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 14th Feb 2006 11:16
..... or just saying 'stars=60' without the #constant command seems to work. Actually, I've never once needed the #constant command - what is it actually for?

Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 14th Feb 2006 13:40
it basically does a find and replace on the code.

if you did:
#constant STARS 60

then anytime you mention the word STARS, the compile replaces it with 60. If you used a variable, the system has to do lookups on the variable and it (in computer terms) would be MUCH slower...

It is a usefull command for things that dont change, ie are static, but you want control over... Like...... ermm... stars! You know you dont want it to change during the game, however you want to be able to easily say "I want 63 stars now" without having to risk breaking your code.

Tinkergirl
21
Years of Service
User Offline
Joined: 1st Jul 2003
Location: United Kingdom
Posted: 14th Feb 2006 14:36
I use it for naming states in a state machine.

If I do at the top of my code...



Then later on in my state machine, I can use them in the switch statements like this...


Just makes it a lot more human readable - I don't care what the numbers are, just that they're different
Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 14th Feb 2006 15:20
My progress:



Chris Franklin
19
Years of Service
User Offline
Joined: 2nd Aug 2005
Location: UK
Posted: 14th Feb 2006 17:22 Edited at: 14th Feb 2006 17:23
Cool how come this is the only sticky not removed

Edit:
Lol image all we posted at the same time


Theme park simulator 35% Currently making object selection
Image All
18
Years of Service
User Offline
Joined: 30th Dec 2005
Location: Home
Posted: 14th Feb 2006 17:22
Cool

FunkyStickmen: Battle of the Races (1%)
RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 14th Feb 2006 17:52
Quote: "Cool how come this is the only sticky not removed"

My guess: It's still active. Been about a year now too.


Open MMORPG: It's your game!
Chris Franklin
19
Years of Service
User Offline
Joined: 2nd Aug 2005
Location: UK
Posted: 14th Feb 2006 17:54
Quote: "My guess: It's still active. Been about a year now too."

Ahh cool most stickys seem to die

Milkman
18
Years of Service
User Offline
Joined: 30th Nov 2005
Location: United States
Posted: 14th Feb 2006 20:40
here's my progress guys, tell me what you think
http://forum.thegamecreators.com/?m=forum_view&t=71711&b=8

the demo is attached on that thread

formerly xMik
Freddy 007
19
Years of Service
User Offline
Joined: 30th Nov 2004
Location: Denmark
Posted: 14th Feb 2006 20:43 Edited at: 14th Feb 2006 21:16
I've finally got the controls ready! I'd like to have a game where you only use the mouse, so you turn the ship by moving the mouse left and right, and you thrust using the right mouse button. Later on, you can shoot using the left mouse button.




UPDATE: I fixed the positioning of the ship, and I've managed to set up a kind of speed restriction. Check it out!

Milkman
18
Years of Service
User Offline
Joined: 30th Nov 2005
Location: United States
Posted: 14th Feb 2006 21:14
for speed restriction what i did was get the length of the velocity vector for the ship, and check if it was greater than the maximum speed. if it was, then i just normalized the velocity vector, and multiplied it by the maximum speed for the ship. here's my code:



hope this helps you out

formerly xMik
Freddy 007
19
Years of Service
User Offline
Joined: 30th Nov 2004
Location: Denmark
Posted: 14th Feb 2006 21:19
Thanks, but I got a kind of speed restriction set up myself, I guess I edited the same time as you posted!

But your solution might be better, I don't know.. What I'm doing is, that I'm setting up a seperate vector to check the movement. First I update the secondary vector, and then check the length. Then I decide whether or not the movement was to much, and if it was, then I don't update the primary movement vector.



Milkman
18
Years of Service
User Offline
Joined: 30th Nov 2005
Location: United States
Posted: 14th Feb 2006 21:40
i tried that at first too, but i ended up with some turning problems
whatever works for you though...

formerly xMik
Freddy 007
19
Years of Service
User Offline
Joined: 30th Nov 2004
Location: Denmark
Posted: 14th Feb 2006 21:47
Turning problems? I can't find any when trying my game. Could you try it out for me?

Milkman
18
Years of Service
User Offline
Joined: 30th Nov 2005
Location: United States
Posted: 14th Feb 2006 22:10 Edited at: 14th Feb 2006 22:10
sorry for not making it more clear what i meant by "turning problems" was that when i applied full velocity to the ship in one direction, then rotated 45 degrees and tried to apply velocity, it wouldn't let me. this is because when adding velocity only 45 degrees different from the current velocity, it would not actually decrease the velocity, so

would return false, and the velocity would not be added to the ship, causing you to keep going the same way. you would actually have to apply velocity that was at least 90 degrees different from the current velocity for it to come below max speed and allow the velocity change.

formerly xMik
Freddy 007
19
Years of Service
User Offline
Joined: 30th Nov 2004
Location: Denmark
Posted: 14th Feb 2006 23:02 Edited at: 14th Feb 2006 23:06
Oh, I don't seem to have that problem! I guess I have my engine set up in a different way. Well, I've managed to implement lasers, and a little effect when you boost, which helps tell the direction of the ship:



I'd like comments if anyone dares!

EDIT : Little bug-fix.

Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 14th Feb 2006 23:24
klu 007 & Zotoaster - nice entries so far!!

Klu - you need a little friction imho. Just make it lose speed...

@xMilk - I cant find your source... Have you put it up yet?

Milkman
18
Years of Service
User Offline
Joined: 30th Nov 2005
Location: United States
Posted: 14th Feb 2006 23:46 Edited at: 14th Feb 2006 23:49
here it is



yes, the first level is boring, but the game starts to pick up speed at level 2...

edit:
@klu 007: in fact you do have that velocity problem pay close attention and you will see what i mean...

formerly xMik
Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 14th Feb 2006 23:58
very nice!!! I got to level 3 and got hit straight away though... spawn frag style!

The ship feels a little slow... more like a box in honey than a triangle in space. Thats all tweaking though, apart from that - excelent start!

Milkman
18
Years of Service
User Offline
Joined: 30th Nov 2005
Location: United States
Posted: 15th Feb 2006 00:04 Edited at: 15th Feb 2006 00:07
maybe i'll up the starting speed then, though your speed does increase the farther you get, as well as your rate of fire
other than tweaking this kind of stuff, all i think i have left to do is add some cool effects...

Quote: "I got to level 3 and got hit straight away though."


darn randomly placed asteroids

formerly xMik
Image All
18
Years of Service
User Offline
Joined: 30th Dec 2005
Location: Home
Posted: 15th Feb 2006 00:32
I got to lvl 4 and started simply fighting for my life

FunkyStickmen: Battle of the Races (1%)
Milkman
18
Years of Service
User Offline
Joined: 30th Nov 2005
Location: United States
Posted: 15th Feb 2006 01:02 Edited at: 15th Feb 2006 01:03
yeah, i'de pay anyone who could get to level 10...

edit:
without editing the code

formerly xMik
Freddy 007
19
Years of Service
User Offline
Joined: 30th Nov 2004
Location: Denmark
Posted: 15th Feb 2006 01:22
Quote: "klu 007 & Zotoaster - nice entries so far!!"


Thanks!

Quote: "Klu - you need a little friction imho. Just make it lose speed..."


Well, I think that can't be too hard to add, but I thought that Asteroids was in outer space, where friction seems a little... improbable... And I thought there was no friction in the original either, but then I've never played it...

Milkman
18
Years of Service
User Offline
Joined: 30th Nov 2005
Location: United States
Posted: 15th Feb 2006 01:27
klu, you're right, there was never friction in the original asteroids, and i haven't added friction to my version either

formerly xMik
Ric
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 15th Feb 2006 01:29
Wow - this challenge is progressing quicker than I expected!

@KLU - try putting an extra ',1' at the end of each of the 'get image' commands - it will make the graphics appear brighter and sharper. Good start though.

@xMilk - Nice work. I'd prefer it if the asteroids fragmented on all levels, though. Initially I didn't think you'd coded that into the game because it was absent from level 1. I know Nick said the ship moves a little slow, but I seem to remember that's how the original was - it made it harder to get out of the way of the asteroids - so I quite like it.

Ric
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 15th Feb 2006 01:37
Ooh - looks like we just survived the 'Sticky Cull'!

Milkman
18
Years of Service
User Offline
Joined: 30th Nov 2005
Location: United States
Posted: 15th Feb 2006 01:43 Edited at: 15th Feb 2006 01:47
@Ric and Nicholas Thompson:
Thanks for the comments

@Ric: That was intentional, as the asteroids split once more every level. notice the code:


Anyways, level 1 will now start out with the asteroids fragmenting into two peices, and move up from there, instead of just 1. Also, your ship acceleration and fire rate will now be based soley on your score, instead of the level you are on.

formerly xMik
Freddy 007
19
Years of Service
User Offline
Joined: 30th Nov 2004
Location: Denmark
Posted: 15th Feb 2006 01:46
@Ric

I've done that now, and it looks a lot better. Thanks!

@xMilk

I don't think I'll add friction either. And by the way, I realised what you were talking about(the 'turn' thingy), and I had a look at your code and decided it worked a lot better. So now I'm using pretty much the same routine as you, I don't hope you mind! Thanks!

Milkman
18
Years of Service
User Offline
Joined: 30th Nov 2005
Location: United States
Posted: 15th Feb 2006 01:50
Quote: "So now I'm using pretty much the same routine as you, I don't hope you mind! Thanks!"

no problem, that's what these challenges are for, to learn from each other.

formerly xMik
Darth Vader
19
Years of Service
User Offline
Joined: 10th May 2005
Location: Adelaide SA, I am the only DB user here!
Posted: 15th Feb 2006 04:12
Can somone have a look at this code

So far every thing is alright except that when I create the walls the objects seem to disappear or the objects go right through the walls when the walls are meant to be stactic objects (I am using ODE)

This is for the asteroids remake (I am doing 3D)
Thanks Guys

You Don't know the power of the Dark Side!!
Oh but I do!!
Milkman
18
Years of Service
User Offline
Joined: 30th Nov 2005
Location: United States
Posted: 15th Feb 2006 04:22 Edited at: 15th Feb 2006 04:24
Quote: "ode create dynamic triangle mesh 1"

trimeshes don't work too well in ode, unfortunately...

formerly xMik
Darth Vader
19
Years of Service
User Offline
Joined: 10th May 2005
Location: Adelaide SA, I am the only DB user here!
Posted: 15th Feb 2006 04:27
But what about the boxes the also jump out of the stactic walls?

You Don't know the power of the Dark Side!!
Oh but I do!!
Darth Vader
19
Years of Service
User Offline
Joined: 10th May 2005
Location: Adelaide SA, I am the only DB user here!
Posted: 15th Feb 2006 04:35
My statics aren't working



You Don't know the power of the Dark Side!!
Oh but I do!!
Milkman
18
Years of Service
User Offline
Joined: 30th Nov 2005
Location: United States
Posted: 15th Feb 2006 04:40
i can't really help you with that, i'm sorry, because i don't use v5.9, only 5.8. you're better off waiting for Ric or BillR to help you out.

formerly xMik

Login to post a reply

Server time is: 2024-11-24 13:46:43
Your offset time is: 2024-11-24 13:46:43