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
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 22nd Feb 2011 01:33
Quote: "Does the dream have an ending? I didn't know how long to watch it for."

Not really. But you can press the C key and move the camera around freely to look around and move.

Enjoy your day.
No Time To Code
15
Years of Service
User Offline
Joined: 22nd Dec 2008
Location:
Posted: 23rd Feb 2011 03:03
That's amazing that you did that with no external media. Nice work!

It is not from the benevolence of the butcher, the brewer, or the baker, that we expect our dinner, but from their regard to their own interest. --Adam Smith
Libervurto
17
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 24th Feb 2011 00:41
@Latch
OOOOOOoooooh
OOOOOOOOooooooooooh
OOOOOOOooooooooooooooh


Great work Latch, I particularly liked the ship and its texturing. That must have taken a while to get right.


Everything worthwhile requires effort.
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 25th Feb 2011 19:48 Edited at: 25th Feb 2011 19:51
Thanks everyone.

Quote: "I particularly liked the ship and its texturing. That must have taken a while to get right."


Actually, texture-wise, the DarkBASIC pyramid took the longest. It was the first thing I was trying with embossing (bump mapping). Originally I made a brick texture which was very hard to seamlessly tile. It took a little manipulation, but I finally got it.



Then I decided to make it look more like the old logo. Once I got it down, I used a wood texture I had made before and added bump mapping for the ship.

For the ship, the placement of the limbs was tricky. My first approach to the ships hull was similar to how I made the fish a few challenges back - using 2 grids a certain z distance apart and then just "pinching" together the verts to form the bottom and sides. In the end, however, I hard coded the vertices instead of placing them procedurally.

Enjoy your day.
29 games
18
Years of Service
User Offline
Joined: 23rd Nov 2005
Location: not entirely sure
Posted: 1st Mar 2011 22:52 Edited at: 1st Mar 2011 22:53
I didn't know that DBC could handle bump mapping. Any chance of posting an example of how you did this?
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 3rd Mar 2011 23:04 Edited at: 3rd Mar 2011 23:11
Quote: "I didn't know that DBC could handle bump mapping. Any chance of posting an example of how you did this?"

Sure. The bump mapping method I'm using isn't real-time normal mapping but rather bump mapping the textures ahead of time.

The following is an example. I use the same algorithm to create the stone like surface of the cube as well as the grate like tiles on the matrix.



Enjoy your day.
29 games
18
Years of Service
User Offline
Joined: 23rd Nov 2005
Location: not entirely sure
Posted: 6th Apr 2011 22:08
That's a really cool effect. I'll be having a play with that later on.
Phaelax
DBPro Master
20
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 12th Apr 2011 01:32 Edited at: 12th Apr 2011 02:20
I'm posting from my phone because latch's demo locked up my pc and I may have to hard reboot. I got too much open that I don't wanna lose. Thx buddy! :/

I let it sit for roughly 45min, no luck. Had to pull the plug, grrr.

The Internet: Where men are men, women are men, and children are federal agents
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 12th Apr 2011 18:43
I hope you didn't lose any hard work. I wonder why it happened...

On my machine, if I run Blender, close it, run any internet/browsers, then run anything from DBC, source or exe, there's about a 70% chance the PC locks up. When running dxdiag, it seems that somewhere in the mix of running those other apps, DirectDraw Acceleration becomes disabled and unable to restart. It has something to do with the ATI drivers and I think switching between opengl and direct x - I'm guessing from the behavior I observed. Not sure if that could be related but if you set up your pc to the same state it was before you run the demo (don't run the demo) then check dxdiag, maybe something similar is going on.

The demo is compiled with DBC 1.20 and there are a couple of buggy things with the lighting for that version of DBC I noticed and there is still a dependence on d3drm.dll which I did not include with the demo.

Enjoy your day.
Phaelax
DBPro Master
20
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 21st Apr 2011 19:33
I got lucky and Chrome managed to open up all my links (which doesn't always work). When I'm looking up stuff I tend to open up tons of pages that may potentially be useful, then I'll go back later when I have more time. Nothing serious though.

The Internet: Where men are men, women are men, and children are federal agents
Libervurto
17
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 29th Apr 2011 23:02 Edited at: 29th Apr 2011 23:04
So... what's the next challenge?

How about this...

Pencil and Paper Games
I discovered a game called Sprouts and thought it would be fun to program in DB. Pick any pencil and paper game you like and turn it into a computer game!

Deadline: Midnight 14th May 2011.

Your memory has been erased by a mod - Your new name is Brian.
Phaelax
DBPro Master
20
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 1st May 2011 07:53
Interesting, I'll give it a shot. Not sure how far I'll get in 2 weeks.

Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 2nd May 2011 22:58
Quote: "Pick any pencil and paper game you like and turn it into a computer game!"


'Any' makes it pretty broad, and the broad challenges seem to fall by the wayside. I'm not sure I understand the Sprouts game or how to approach programming AI for that.

How about setting the challenge to a very simple pencil and paper game or the choice between two? The simpler, the better. The simplest I can think of is an old tank battle game. It works like this:

1. A sheet of paper is folded in half making a crease that divides the battle field into two halves: the top and the bottom.

2. On each side of the paper, each player draws 5 to 10 boxes that represent their tanks.

3. Player 1 draws a dot somewhere on their side of the battle field. This is the launching point of an attack. The paper is folded along the original crease so that the battle field is on the inside. You should be able to see the dot that was drawn through the paper. When you locate it, you color the back of the dot with the pencil forcing an impression of the original dot on the battle field of your opponent.

4. Open the paper and see where the impression ended up. If it is within an enemy box, you have scored a hit and destoyed a tank.

5. Player 2 moves next and play alternates between both players until one player has destroyed all of the tanks of the other.

A computer version wouldn't involve the folding but would be an "eye-balling" of where on your side of the battle field to launch an attack - estimating in your mind where the mirror position of your shot would end up. It's the same as the folded paper game, just without the folding.

The general setup and shooting shouldn't be hard at all. The trick would be coming up with decent AI that can miss once in a while or have levels of accuracy.

Enjoy your day.
Sinani201
16
Years of Service
User Offline
Joined: 16th Apr 2007
Location: Aperture Science Enrichment Center
Posted: 3rd May 2011 09:06 Edited at: 3rd May 2011 09:07
The game you're referencing is called Battleship, and that would be a good idea for the challenge. I've never seen it played on paper but I can definitely see how that would work.

The broadness of the challenge isn't a bad thing. I don't see anything wrong with some variety in the entries.

Look at your sig. Now look at mine. Now look at your sig. Now look at mine. Now look at your sig. Now BACK TO MINE.
29 games
18
Years of Service
User Offline
Joined: 23rd Nov 2005
Location: not entirely sure
Posted: 3rd May 2011 15:10
I think the real challenge is coming up with something do able in the time available.

@Latch
There's nothing that says there has to be a computer player. Just make it a two player game or a single player "target practice" game.

I'll see if I can come with anything but I can't think of anything right now so no promises.
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 4th May 2011 00:54
Quote: "The broadness of the challenge isn't a bad thing. I don't see anything wrong with some variety in the entries."


Quote: "There's nothing that says there has to be a computer player. Just make it a two player game or a single player "target practice" game.
"


Two valid points. No computer player makes things much easier.

Besides Sprouts and tank battle (or battle ship) I can think of only a few pencil and paper games:

tic tac toe
connect the dots
don't be the person to cross out the last line
hang man
jotto
master mind on paper

I think I'll take a stab at tank battle

Enjoy your day.
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 6th May 2011 02:43 Edited at: 6th May 2011 02:59
Here's a beginning for a tank battle game. It just displays both players' tanks on either side of the battle field so far.



Enjoy your day.
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 23rd Jun 2011 19:38
Don't think my tank paper 'n' pencil game is going anywhere.

Doesn't seem like anyone is doing much here.

Here's an idea for a "standard" programming challenge. Not sure if we did it before.

Make a program that converts various units:

* decimal to hex
* hex to decimal
* binary to hex
* hex to binary
* decimal to binary
* binary to decimal

Entrant must come up with the code, you can't simply use the built in HEX$(num) or BIN$(num)

For extra credit do other conversions like
* size units (meters, feet, kilometers miles, etc.)
* temperature
* anything you can think of

The program must allow the user to enter the value of the FROM type and then display the TO result.

How about a week on this one?

Enjoy your day.
Phaelax
DBPro Master
20
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 24th Jun 2011 12:24 Edited at: 24th Jun 2011 12:25
Here's my code for converting 12 different units of measurement.




Libervurto
17
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 25th Jun 2011 20:28 Edited at: 27th Jun 2011 01:24
This looks like one I could do even though I can't run DB.
Whipped up a decimal to binary converter really quickly.


chafari
Valued Member
17
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 2nd Jul 2011 22:47
@29 games

I have to admit that even being with primitive , your model has a perfect animation ... I loved it

Cheers.

I'm not a grumpy grandpa
29 games
18
Years of Service
User Offline
Joined: 23rd Nov 2005
Location: not entirely sure
Posted: 11th Jul 2011 22:59
I've not been following this at all!

I've made the move to DBPro, it runs better on my net book and sparky's collision dll is a lot better, so I've missed all this.

Thanks for the comment chafari, pity they didn't include the key frame commands in DBPro but then it has forced me to learn Blender.

@ Latch, ran your tank game code. Pity you didn't get it finished, it looked really good.
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 7th Sep 2011 21:52 Edited at: 7th Sep 2011 21:55
Quote: "@ Latch, ran your tank game code. Pity you didn't get it finished, it looked really good. "


Thanks! I've decided to finish up the tank code - mainly to get my head into coding again a bit, and also to try and throw this thread a bit of a lifline.

Anyway, it's not as "finished" as it could be. I had ideas for animations, exploding tanks, maybe sound, scores, etc.; but what I'm submitting here is very true to the game I played on paper.

Basically, there are ten tanks on each side of a sheet of paper folded in half. Each player marks a dot on their side of the battle field. They fold the paper end to end and color the back of the sheet where they had placed their dot. This transfers a carbon copy of sorts of the dot onto the enemy's battle field. This duplicate is where you have fired. If it's within the drawing of an enemy tank, then you have hit it.

This version is very open. I've only included the mechanics: the drawing of the tanks, the placement of the dots, the folding of the page, and the transfer of the dots. To play it, simply move the pencil around on the virtual paper. LEFT CLICK on either side of the battle field of where you want to fire. You can guage the middle of the page by locating a faint fold line down the center of the screen - this should help in gauging where to attack. If you fire from the RED side, your dot will be red. If you fire from the blue side, your dot will be blue. Again, this is almost exactly how the game works and looks on paper so you can make the rules for how you want to play and what is considered a legal hit.

The code is meant for use with DBC 1.20 . 1.13 and earlier may have lighting and texturing differences.



Enjoy your day.
29 games
18
Years of Service
User Offline
Joined: 23rd Nov 2005
Location: not entirely sure
Posted: 8th Sep 2011 23:53
That is superb! When I ran it I couldn't believe that the whole thing was created from code.

I quite like that it doesn't have exploding tanks or anything fancy but I think registering hits and keeping score would make it more of a game. But it's still a very impressive effort.
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 14th Sep 2011 06:46
Quote: "That is superb! When I ran it I couldn't believe that the whole thing was created from code."

Thank you!

Quote: "I quite like that it doesn't have exploding tanks or anything fancy but I think registering hits and keeping score would make it more of a game"

Maybe I'll take a stab at marking hits and/or keeping score.

Enjoy your day.
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 11th Dec 2011 18:20
It's been about 3 months... maybe this is the last time I bump this challenge thread to keep it alive.

Enjoy your day.
LBFN
16
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 12th Dec 2011 07:14
Latch:
Ran your tank code above - nicely done!

As to the challenges, I don't know that there are too many DBCers out there that would participate. I dusted off DBC recently and am currently writing a game that is planned to run in DBC or DBP. Anyway, if you can find two or three more people that want to get involved in the challenges again, I would plan to participate myself.


TheComet
16
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 12th Dec 2011 15:58
It's been a while since I've used DBC, 3 years to be precise, but I feel the urge to compete in a challenge! Seeing NaGaCreMo '12 is still 3 weeks away, I don't have that much else to do really. What challenge will this be?

TheComet

TheComet
16
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 12th Dec 2011 23:21
Double post I know, but I have an idea! Since the current participants are advanced, let's do something with mesh deformation. This involves manipulating an object's vertices using memblocks to make the coolest effect possible. Doesn't have to be a big program, it just has to be cool.

TheComet

chafari
Valued Member
17
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 14th Dec 2011 02:52
Quote: " I have an idea! Since the current participants are advanced, let's do something with mesh deformation"


Could it be in Dbpro or you mean in Darbasic Classic ?

Cheers.

I'm not a grumpy grandpa
TheComet
16
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 14th Dec 2011 07:05
DBC. This is the DBC board after all That's going to make it all the more challenging.

TheComet

chafari
Valued Member
17
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 14th Dec 2011 11:23
Quote: "DBC. This is the DBC board after all That's going to make it all the more challenging."


Oops!...I thought I was in Darkbasic Pro board ....anyway I keep DBC somewhere in my old PC

Cheers.

I'm not a grumpy grandpa
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 14th Dec 2011 21:40
@TheComet

Sounds interesting. What did you have in mind?

Enjoy your day.
TheComet
16
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 14th Dec 2011 21:48
Whatever you want, as long as you directly edit vertices at real time. You could for example create a 3D snake game like this. Or you could create trail effects such as here:



What you do is left to your imagination. Rating would be done on how impressive it looks in the end. What do you all think?

TheComet

Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 17th Dec 2011 23:17
If there's interest from others I'm in.

Enjoy your day.
TheComet
16
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 19th Dec 2011 18:00
Where's LBFN? He's usually always willing to participate...

TheComet

LBFN
16
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 19th Dec 2011 19:14 Edited at: 4th Jan 2012 20:06
Hi TheComet, I am still around.

TBH, I have not cared much for using memblocks in the past and have done little with them. I seriously doubt that I would be much competition for you or Latch on this one. However, I will plan to work on something to try and revive this competitive thread.

So many games to code.......so little time.

TheComet
16
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 19th Dec 2011 21:40
Nice to see a good old familiar face

Quote: "TBH, I have not cared much for using memblocks in the past and have done little with them. I seriously doubt that I would be much competition for you or Latch on this one."


Granted, it's easy to mess up your pointers, but don't worry, even the simplest of effects can look impressive without much complication.

Let's see if I we get OBese or Phaelax to join...

TheComet

TheComet
16
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 21st Dec 2011 23:53
It seems not... So let's get this rolling! Let's make this a battle to the death between 3 higher ranked programmers!

Challenge

Your program must utilize mesh deformation at real time in order to create the coolest looking thing possible, and must be a central focus of your program.

To make it easier, here is how the mesh data is structured when converted to a memblock.



And here are some commands you'll need:



Deadline

Friday, 13th January 2011 24:00 CET

I like to make deadlines on unlucky dates

TheComet

BN2 Productions
20
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 27th Dec 2011 06:24
I was intrigued by this and started working on something. Is it just me or is the sphere model really annoying to work with? The vertices go around as expected, but there are an extra 50-100 or so that just go up one side.

Can these be deleted/repositioned in the vertex order to make manipulating them a bit easier?

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 28th Dec 2011 01:09
Quote: "Is it just me or is the sphere model really annoying to work with?"

You may find that working with any object you haven't created yourself may be a bit tricky because the the vertex order and the face indeces of the vertices. Everything may not be sequentially nice and neat.

I gleaned the sphere data out of version 1.12 (same as 1.13) of DB.exe some time ago. When rendered in DB 1.20 it LOOKS the same, but I haven't done any comparisons. At any rate, I'm attaching the X file version of it here. You can look at face data that will tell you which vertices are assigned to which face and you can see the full vertex order.

Open the following attachment in a text editor. Look for a template header labeled

Mesh {
164;

The 164 is the number of vertices and they follow in groups of three floats (x,y,z).

The face data starts after you see

224;

That is the number of faces that make up the sphere. Following that are groups of 4 numbers. The first number is the count of the vertices that make up the face. It should be 3 in this case since each face is a triangle. After the 3; there should be three values each representing a zero based vertex number.

So the first triangle is

3;0,2,1;,

That means there are 3 vertices that make up the triangle. Those vertices are 0 2 and 1.

0 has the coordinates 0.001000;0.501000;0.001000;,
2 has the coordinates -0.072223;0.462940;0.177777;,
1 has the coordinates 0.001000;0.462940;0.192342;,

The order (winding order) is important because it helps define the direction of the normals.

Anyway, you can use this info to help group your vertices when manipulating the sphere data. Hopefully it's the same in 1.20 as 1.12 .

Enjoy your day.

Attachments

Login to view attachments
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 6th Jan 2012 02:16
I've been working on a couple of things: a snake-like deforming mesh, and a couple of "build from triangles" object/mesh stuff.

Anybody else working on anything?

Oh, and based on a different post from TheComet that is related to this challenge, it would seem that DLLs are ok. So, for the snake mesh, I decided to use some functions from the d3drm.dll for fun. It's not really necessary, but I thought I'd include it if anyone wanted to see a way to use it. That dll has a bunch of 3d math functions in it that can be quite useful.

Enjoy your day.
TheComet
16
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 6th Jan 2012 13:08
Sounds like you're making good progress Latch! I was about to ask if it were OK to use DLLs. I'm working on a mesh that deforms to music, and that requires the fmod.dll. If that's not allowed that'll still be fine, I can just modify it to do some other crazy stuff

TheComet

Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 13th Jan 2012 16:57 Edited at: 24th Jan 2012 20:50
Quote: "Let's make this a battle to the death between 3 higher ranked programmers!"

Unfortunately, it isn't nearly as dramatic as this statement suggests as it seems there really aren't any participants in the challenge. I'll submit a low key entry that demonstrates the basics of manipulating vertices in real time for:

1) a matrix
2) an object

As I stated in a post above, I demonstrate the use of a d3drm.dll function call, so that may be of interest to someone. It's for vector rotation. With a little work, you can use the functions to put together your own skeletal animation system if you like. The code I have hints at doing this by grouping vertices and rotating the groups.

Basically, the code creates a snake that moves around a deforming matrix and it's body adjusts to the varying heights in real time.



Enjoy your day.
chafari
Valued Member
17
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 13th Jan 2012 21:03
@Latch
That's nice , good work !!, I never thought we could do do that in Darkbasic Clasic. I use it long time ago, but now I use more Dbpro.

I really would like to do something for those challenges Dbpro or Clasic, but perhaps it is the winter...we're too lazy .

Cheers.

I'm not a grumpy grandpa
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 16th Jan 2012 20:35
@Chafari

Thank you!

There's a lot that can be done in DBC. Things could really be sped up (animations and mesh manipulation) if we could access mesh data directly instead of having to update it and change it through memblock commands. The memblock commands tend to be slow.

Enjoy your day.
Libervurto
17
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 17th Jan 2012 06:54
Hello everyone, I bought a new PC last week so I'm back.
This looks an interesting challenge to come back to as I never learned much about meshes.
Can anyone tell me where to get v1.2 I can't find it at the old link

Join DNG today! We are a game development team open to all. Visit our Headquarters to learn more.
29 games
18
Years of Service
User Offline
Joined: 23rd Nov 2005
Location: not entirely sure
Posted: 19th Jan 2012 23:41
@ Latch, I really like your snake, it's a really cool effect.

I'm currently hip deep in a project at the moment but if I can think of something quick and fun I might enter, no promises though.

@ Obese, try this:

http://www.thegamecreators.com/?m=view_product&id=2030&page=upgrades
chafari
Valued Member
17
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 20th Jan 2012 02:08
@Obese87
Take a look in this link....I have downloaded from there.

http://forum.thegamecreators.com/?m=forum_view&t=116008&b=10

Cheers.

I'm not a grumpy grandpa
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 6th Apr 2012 22:20
Quote: "@ Latch, I really like your snake, it's a really cool effect."


Thanks!

Enjoy your day.

Login to post a reply

Server time is: 2024-03-29 11:48:47
Your offset time is: 2024-03-29 11:48:47