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: 2nd Nov 2005 06:42
For those of us who haven't seen the movie, care to explain the challenge a little more?


Deadly Night Assassins
Peter H
20
Years of Service
User Offline
Joined: 20th Feb 2004
Location: Witness Protection Program
Posted: 2nd Nov 2005 21:05
@CPU- NNooooo.. LOL i was waiting for that!

"We make the worst games in the universe."

Segan
19
Years of Service
User Offline
Joined: 28th Aug 2005
Location: Canada
Posted: 3rd Nov 2005 00:44
@Phaelax
Seeing the movie or playing one of the games is pretty essential for this, but if you can't do either, here is some info that might help you:

General Death Star History (if you enjoy reading): http://www.starwars.com/databank/location/deathstar/
http://en.wikipedia.org/wiki/Death_Star

Oh, and off the top of my head, there isn't any good depictions of Star Wars that are free (as a game or a movie) other than Star Wars Gangsta Rap (which may give worthwhile scenes to you, and may not)
Neofish
20
Years of Service
User Offline
Joined: 7th Apr 2004
Location: A swimming pool of coke
Posted: 3rd Nov 2005 01:50
CPU how the hell did you get to show up with no box?!

Phaelax rent it, it's worth it.

CPU
21
Years of Service
User Offline
Joined: 4th Jul 2003
Location: Carlsbad, CA
Posted: 3rd Nov 2005 04:48
This:

[[/i]code[i]]

Was typed in like this:

[[[/b]i[b]][[/b]/i[b]]code[[/b]i[b]][[/b]/i[b]]]

which looked like:

[[[[/u]b[u]][[/u]/b[u]]i[[/u]b[u]][[/u]/b[u]]][[[/u]b[u]][[/u]/b[u]]/i[[/u]b[u]][[/u]/b[u]]]code[[[/u]b[u]][[/u]/b[u]]i[[/u]b[u]][[/u]/b[u]]][[[/u]b[u]][[/u]/b[u]]/i[[/u]b[u]][[/u]/b[u]]]]

which was typed in as:



And well I could go on and on...

CPU

[center]K-OS Battlefields
IS
///---///---///---UNDER CONSTRUCTION---\\\---\\\---\\\
[center]
IBOL
Retired Moderator
20
Years of Service
User Offline
Joined: 30th Mar 2004
Location: @IBOL17
Posted: 3rd Nov 2005 07:57 Edited at: 3rd Nov 2005 07:58
i can't believe the lack of indignance at phaelax's post.

restated:
how can no one question or poke fun at him?
you all take him seriously that he's not seen STAR WARS

restated:
How Can You Not Have Seen Star Wars?

bob

RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 3rd Nov 2005 08:10
By the way Phaelax, "DNA" is already used by the National Dyslexics Association. May want to consider changing that to avoid confusion.


Open MMORPG: It's your game!
RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 3rd Nov 2005 09:28
And here's my starting entry. Use the mouse to control the camera (later I hope to add a ship, x-wing or tie fighter).

The trench is basically an "Infinate Terrain" (though I've limited it to 5000). Wish I had figured it out earlier.




Open MMORPG: It's your game!
Ric
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 3rd Nov 2005 10:45
Quote: "DNA is already used by the National Dyslexics Association"


Lol! Nice one. Btw, did you hear about the dyslexic agnostic insomniac? He stayed up all night wondering if there was a Dog.

Cant run your code at work - only have 5.7 on my laptop .... I'll have to wait until I get home!

CPU
21
Years of Service
User Offline
Joined: 4th Jul 2003
Location: Carlsbad, CA
Posted: 3rd Nov 2005 17:37
same here, oddly it just gives me a bunch of runtime errors... and I've got 5.9b3...

[center]K-OS Battlefields
IS
///---///---///---UNDER CONSTRUCTION---\\\---\\\---\\\
[center]
RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 3rd Nov 2005 18:35
It was written using 5.8.


Open MMORPG: It's your game!
CPU
21
Years of Service
User Offline
Joined: 4th Jul 2003
Location: Carlsbad, CA
Posted: 3rd Nov 2005 21:22
Do I feel a possible bug report coming on?

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: 3rd Nov 2005 23:41
I get a black screen with 4 numbers, the last changes very quickly and another changes with the mouse movement... Apart from that I see nothing. Do I need any addons? I'm running the latest version (5.9b3)

Kaiyodo
19
Years of Service
User Offline
Joined: 24th Aug 2005
Location: UK
Posted: 4th Nov 2005 00:01
Nice one RiiDii, that looks pretty impressive.

It runs fine on my 5.8 version, I guess they changed something in 5.9b3 to break it. You are doing fairly funky stuff with the terrain though

Kaiyodo.
Ric
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 4th Nov 2005 00:08
Using 5.8 here too - works fine. Looks very .... er .... starwarsish. With a name like RiiDii, though, I'd expect you to know what a Deathstar looks like!

Segan
19
Years of Service
User Offline
Joined: 28th Aug 2005
Location: Canada
Posted: 4th Nov 2005 01:45 Edited at: 4th Nov 2005 01:46
I don't get it... I'm running 5.8, and the first time I ran RiiDii's code, I came up with Nicolas's error (you know, black screen with 4 numbers). I ran it again after playing with display settings (changed from windowed to windowed fullscreen) and it worked fine. However, that is not the definitive answer because I ran it again in windowed fullscreen later on, and got the black sceen again... I just don't get it...



Oh, but it IS a pretty good entry though, besides all these technical issues...
RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 4th Nov 2005 07:55
Sorry folks. TGC has been blocked by my work, so I have to wait until I get home for all the replies. If you get the blank screen, for now, just stop it and run it again. I don't know what the problem is, mainly because it's not consistent. It's nothing to do with the code as far as I can tell, but maybe something to do with messing around with a terrain model in that manner.

Oh, the 4 numbers are: FPS, X, Y, & Z coordinates for debugging purposes.


Open MMORPG: It's your game!
RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 4th Nov 2005 09:41 Edited at: 4th Nov 2005 09:42
Okay. Here's an update.

The issue with the blank screen actually seems to be a camera bug (I was surprised!). A very odd one. If you will notice, when you run the code and there is a blank screen, the X coordinate of the camera is some insanely large number. So I figured it was a quick fix (and probably a bug report as well), and I added these lines to the Limit_Camera() function.

z=cz#
if cx#>100 or cy#<10.0 then cx#=0.0
Position Camera cx#,cy#,cz#


It seems to work fine now. But please let me know if there is still a problem. Thanks.

Some new features:
Obsticals to fly into (okay, "through" for now).
Moving light source (I really want to play with this more!)
Hopefully fixed the blank screen bug.




Open MMORPG: It's your game!
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 4th Nov 2005 15:01
@RiiDii

Had a quick look at this since I kept getting the blank screen (and the big number) about 50% of the time. Looked at your code and I wonder if there is a byte to float conversion problem in the following line:

Position Camera Trench(65)-32,0,65

I changed it to

Position Camera Trench(65)-32.0,0,65

and I haven't seen the blank screen since. I assume this forces the type conversion since 32.0 is interpreted as a float.

I don't know what the DBPro type conversion rules are or how they are implemented but the problem could either be a type conversion error in the Position camera command itself - or, worse, in the implementation of this particular type conversion (which could affect all DBPro programmes requiring this particular conversion).

Hope this helps.
Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 4th Nov 2005 15:27
Anyone that has the blank screen:

Set the fog distance in one of the first lines to a higher value. Or turn fog off.

Cheers

Sven

Immunity and Annihalation makes Immunihalation...
Ric
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 4th Nov 2005 16:19
In 5.7, the fog command produces an error - there is no 'near distance' for fog. I'm guessing this was introduced in 5.8/5.9?

Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 4th Nov 2005 16:45 Edited at: 4th Nov 2005 16:51
Well Riidii.. Its BETTER this time. The terrain kinda flickers in and out sometimes, but mostly I get what you see in the screemshot attached...


Attachments

Login to view attachments
RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 5th Nov 2005 09:53 Edited at: 5th Nov 2005 10:11
Thanks for the suggestion Green Gandalf. I'll add that fix and see if it helps. Edit: that's actually pretty odd. The array Terrain() is a byte, not a float.

@Nic: Your situation is a little different. You're in the correct place, but no terrain model. I had a similar issue when the terrain was scaled. But this terrain is the base size and I reduced everything else. Which, of course, seemed to solve the problem. Hmmm.


Open MMORPG: It's your game!
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 5th Nov 2005 12:11
@RiiDii

Did you mean the array Trench()? That is certainly declared as byte. The conversion to float arises because the "position camera" command expects to receive floats as its parameters so a type conversion has to be done somewhere.

Your original code had byte minus an integer as the x position so its anyone's guess what final conversion route the compiler uses! I'm not sure how sensitive DBPro is to these sorts of problems but I know some programming languages are very prone (e.g. FORTRAN).

I guess the compiler should arrange for any necessary conversions to be done automatically - but in case the compiler writers left a few out then the only safe thing to do is to force the conversions somewhere, e.g. by including a float (in the right place of course)in any calculation that should result in a float. Most of the time we don't need to worry about such things ...
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 5th Nov 2005 16:03 Edited at: 5th Nov 2005 16:06
Quote: "Phaelax rent it, it's worth it."

which one? there's like 6


Quote: "you all take him seriously that he's not seen STAR WARS"


they should, i haven't seen a single one. it is possible to be a computer nerd without twirling around a light sabre. (seen parts of the old ones) I saw part of attack of the clones, and it was just horrible


Quote: "
"


any particular reason you're saving the file? cause technically, its external media now. DISQUALIFIED!


Deadly Night Assassins
Tinkergirl
21
Years of Service
User Offline
Joined: 1st Jul 2003
Location: United Kingdom
Posted: 5th Nov 2005 16:25
It's the finale of Star Wars A New Hope, Episode 4 (the first one made). Personally, I thought Eppies I, II, and III were sucky, but I do recommend Eppies IV, V and VI for some space adventure.

What it'll be like watching them, after almost every geek on the planet has been hyping them, I can't say. Just watch for fun
RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 5th Nov 2005 17:32
Quote: "any particular reason you're saving the file?"

Yes there is is. The AT commands require a file name be included.
Set Terrain Heightmap 1,"base 64x64.bmp"
While there may be some way to work around this problem, I don't currently have the skills/knowledge to duplicate the AT commands.

Quote: "cause technically, its external media now. DISQUALIFIED!"

"Technically", I haven't included any media with my code. The code creates it. And "technically", every entry (except text-only entries) to this challenge make their own media. Seriously, the purpose of the rule was to encourage creativity by coding the media (and because Ric is lazy ) instead of simply pulling a model from somewhere or copying someone's picture.

And watching the first 3 movies (episodes 4-6) are definately a must for any computer nerd (lightsaber waving not required).


Open MMORPG: It's your game!
Tinkergirl
21
Years of Service
User Offline
Joined: 1st Jul 2003
Location: United Kingdom
Posted: 6th Nov 2005 14:38 Edited at: 6th Nov 2005 14:43
Ok, I think I'm ready for a WIP. Got the canyon up and working, scrolling past fairly smoothly, and I've got very basic movement and a representation of the X-Wing cockpit.

Now all I need is some gameplay



[Edit] And looking like a good entry, RiiDii - good no-media texture too
Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 6th Nov 2005 16:01
nice! Suggestion - could the fighter be a little more manouverable? I'm getting the "turns like a brick" vibe from it Good start though!

Freddy 007
19
Years of Service
User Offline
Joined: 30th Nov 2004
Location: Denmark
Posted: 6th Nov 2005 19:15 Edited at: 13th Nov 2005 01:04
Wee! Make it go faster!

Nice entries


I can't be fired... Slaves are SOLD!
Tinkergirl
21
Years of Service
User Offline
Joined: 1st Jul 2003
Location: United Kingdom
Posted: 7th Nov 2005 00:04
Hoping to speed up the fighter, and have the camera tilt when you go left and right. Just random numbers in there just now

It'll be tricky to really get a feeling of speed without making it unplayable. But thanks!
Segan
19
Years of Service
User Offline
Joined: 28th Aug 2005
Location: Canada
Posted: 7th Nov 2005 00:32 Edited at: 7th Nov 2005 00:33
Well, I wanted to get a little further along before I showed off my first WIP, but seeing that everyone else is... why the heck not.

This one is a lot different from all of your stuff, seeing that it is 2D! No collision, enemies, winning, lasers or cool X-Wing picture yet, but I hope I have the time to get all of that in!



Oh yeah... I have not disabled you from doing some weird stuff with movement (such as flying off-screen or backwards), so don't complain to me about that.
Ric
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 7th Nov 2005 20:45
Tha's not bad Segan - a bit like a game I had for my Acorn Electron. Can't remember what it was called, though.

Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 7th Nov 2005 22:52
Looks like a pretty good start! May I make a suggestion.. Could you use timer based movement? It means it will work on anyone's PC that can tell the time

Segan
19
Years of Service
User Offline
Joined: 28th Aug 2005
Location: Canada
Posted: 8th Nov 2005 00:49
@Nic

Do you mean create a variable that is bigger the faster your program is going, and then move everything by a constant times that variable??? If so... I'll look into that...
Ric
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 8th Nov 2005 01:47
Here's mine so far. Not sure it looks very starwarsish, but hey ho. Left mouse button to accelerate - score points for flying past the barriers, and reach the checkpoints to get extra time.



Segan
19
Years of Service
User Offline
Joined: 28th Aug 2005
Location: Canada
Posted: 8th Nov 2005 05:06
@Ric: Yet again... Another great entry. I almost got addicted to it, other than one small problem: the camera. I just find it kind of annoying trying to control a spaceship when it is in one of the far corners of the screen. But all in all, Great stuff!
Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 8th Nov 2005 10:29
Well thats an interesting error!!!! Lol..

@Segan - take a look at my entry and you can see that right at the begining of the do/loop there are 2 lines (and 2 before the loop) for timer based movement. It produces a weighted average on the time it takes 1 frame to comlete. If you were doing 100fps on avergage, the frame time will be about 10ms. You can then use this to move in a timer based fashion. The easiest way is to imaging how far you want an object to move in 1 second, for example 5 world units. You'd then do:
move object 1, 5.0 * frameTime# * 0.001

The 0.001 is because frameTime# is in milliseconds not seconds. Alternatively, if you adjust all your speeds so they are in unit's per millisecond, you wont need the 0.001. Problem there is its often easier to imagine speed if its "per second". You can also use it for rotation:
yrotate object 1, frameTime# * 0.360

That would rotate it in the y axis at 360 degree's per second (thats a shorten version of 360.0 * frameTime# * 0.001).

Its a REALLY usefull way of doing things! It makes your game a consistent speed on every PC. When I played your game - it was impossible to control it as my PC was running it very fast (it being a 4400+ X2 and 7800GTX 256Mb).

If you need anymore advice with this - post back here. I'll try to help you out. (You might guess, I'm on a campaign for timer-based-momvement as it take about 0.5 seconds more time to program than normal In fact.. I find it quicker to do now. If I dont do it, I have to manuall keep running the program to tweak it to the right speed! )

Ric
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 8th Nov 2005 12:45
Update:

camera now moves with the ship so you can see where you're flying.

Switched control to keyboard - I noticed that it was behaving differently on different machines with different mice - guess the windows settings for mouse sensitivity affects dbp too.

Now use arrow keys to move, and shift to accelerate.



Neofish
20
Years of Service
User Offline
Joined: 7th Apr 2004
Location: A swimming pool of coke
Posted: 8th Nov 2005 13:18
Ric it said game over when I was clear of everything.. :\

RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 8th Nov 2005 17:01 Edited at: 8th Nov 2005 17:03
Quote: "OH. MY. GOD. I tried to run riidiis code..."

OW!!

Hrmmm. Okay... I found a nifty little command that seems to make other little AT errors go away nicely. So - hopefully it will work for this. Oh, it's called "Update Terrain". I don't remember if I made too many other changes, like; press the left mouse button to go faster.



Edit: PS. Ric, that looks strangely familiar... hmmm... I can't quite place it... hmmm... must have been a long time ago...


Open MMORPG: It's your game!
Neofish
20
Years of Service
User Offline
Joined: 7th Apr 2004
Location: A swimming pool of coke
Posted: 8th Nov 2005 18:44
Still doesn't work -_-

Ric
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 8th Nov 2005 22:26
@Neo: but did you get to the checkpoint? It should only say game over if you run out of time. Go through the checkpoints to gain extra time.

@Rii: Well, yes - it's based on code I wrote some time ago, but I think evolution is a better option than reinventing the wheel!

Segan
19
Years of Service
User Offline
Joined: 28th Aug 2005
Location: Canada
Posted: 9th Nov 2005 01:04
@Nick

Thanks for clearing that up. So far, I have just been using sync rate for my timing. Laziness I guess
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 9th Nov 2005 11:38
I'm just gonna wait until this one is done. So now I've missed like 5 in a row.


Deadly Night Assassins
Tinkergirl
21
Years of Service
User Offline
Joined: 1st Jul 2003
Location: United Kingdom
Posted: 9th Nov 2005 12:36
Aw. That's a shame Phaelax. :/ Maybe you can start making suggestions for the next challenge - ones you'd be interested in. I'm sure whoever wins (maybe not this challenge but in future) could do with extra challenge suggestions.
Tinkergirl
21
Years of Service
User Offline
Joined: 1st Jul 2003
Location: United Kingdom
Posted: 9th Nov 2005 15:07
Some small progress, but I'm sure I'll manage a lot more in the next few days

Added-
Lasers
A Deathstar
Nice angling code
A lot more speed
Basic collision (It says "Ouch" a lot)

Kaiyodo
19
Years of Service
User Offline
Joined: 24th Aug 2005
Location: UK
Posted: 9th Nov 2005 22:09
Wow Ric, your game is hard! I blame the controls being upside down of course, couldn't be anything to do with my lack of gaming skill

One day I'll get to a checkpoint.

Kaiyodo
Ric
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 9th Nov 2005 23:12
@TG: That's looking really good - I love the 'ouch ouch ouch' as you fly through the buildings!!

@Kaiyodo: true - I need to make it a bit easier, at least to begin with. Will take a look at it now.

CPU
21
Years of Service
User Offline
Joined: 4th Jul 2003
Location: Carlsbad, CA
Posted: 10th Nov 2005 00:00
Four days left and counting...

I'm definatly going to have an entry, I just havn't posted any WIP's yet, but if you want a teaser... Well just take a look at my last two entries

CPU

[center]K-OS Battlefields
IS
///---///---///---UNDER CONSTRUCTION---\\\---\\\---\\\
[center]

Login to post a reply

Server time is: 2024-11-23 21:07:45
Your offset time is: 2024-11-23 21:07:45