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
Mobiius
Valued Member
22
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 29th Sep 2009 15:03
Quote: "I think I've got"

you think?
Lol

Your signature has been erased by a mod because we're sadistic losers with nothing better to do. (joke)
fearred
15
Years of Service
User Offline
Joined: 18th Sep 2009
Location:
Posted: 30th Sep 2009 03:05
wait i checked my spec at system bios and its a quad core 2.33ghz with 4gb ram but since I'm running XP 32 bit it only uses 3gb.
Kira Vakaan
16
Years of Service
User Offline
Joined: 1st Dec 2008
Location: MI, United States
Posted: 30th Sep 2009 05:17 Edited at: 30th Sep 2009 05:54
Hey, thanks a lot guys. I've added various other parts to the collision routine now, and I'm pretty positive I'll need an octree. This'll be an... adventure.

Edit: Recursive sliding collision is now functional! See attachment.
Ric
21
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 30th Sep 2009 09:32
I'm still lurking. Good to see the challenges still moving onwards and producing those good old 'shall we allow this .dll?' conversations just as they always did!

For what it's worth, I would suggest that if people ever wanted a one-off challenge which broke the original rules, there is no reason why you shouldn't do that - just do it in a separate thread to keep everyone (past, present and future) happy.

Virtual Nomad
Moderator
19
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 30th Sep 2009 19:33
Quote: "do it in a separate thread"

i was gonna suggest the same but i didn't want my last post to be too long-winded. frankly, i'd love to see a whole Sparky's Collision Challenge thread. i think it would help a lot of people learn how to use it correctly. i just didn't want to see this thread morph into that.


Coding Fodder
21
Years of Service
User Offline
Joined: 25th Sep 2003
Location: Somewhere in my cerebralcortex
Posted: 1st Oct 2009 17:37
As a Challenge coder from yester-year I seem to remember plenty of collision code already existing in past entries. The idea has always been to build on each others ideas. If it is a problem I suggest a useful copy and paste collision system as a future challenge. Cheers. One of these years I will find out where I put my copy of dbPro and return.

Something really catchy that makes people stop and think about the meaning of life and say to themselves "My but thats clever"
Kira Vakaan
16
Years of Service
User Offline
Joined: 1st Dec 2008
Location: MI, United States
Posted: 2nd Oct 2009 02:43
Hm, I looked through the first 60 pages of this thread and didn't really find a whole lot of sliding collision stuff that would help me, but my issue right now is octree implementation to split up the objects and check only a few triangles at a time. Do you recall anything like that? At any rate, by the end of this, I at least hope to have a useful copy and paste collision system to use for the future.

Also, I'm going to be gone for the weekend, so I suppose I'll get back to this thing Monday.
BMacZero
19
Years of Service
User Offline
Joined: 30th Dec 2005
Location: E:/ NA / USA
Posted: 2nd Oct 2009 03:19
Quote: " I looked through the first 60 pages of this thread"



The main think I'm going to have to work out is how to find out which face of an object (indexdata) an object is colliding with so I can bounce it properly...maybe I need to do some looking through this thread.



Kira Vakaan
16
Years of Service
User Offline
Joined: 1st Dec 2008
Location: MI, United States
Posted: 2nd Oct 2009 03:30
It didn't take that long. Just did a search for the term "collision" on each page and looked a little closer whenever it came up.

Right now, I'm using memblocks to store all of the mesh data and just grabbing the triangles I need out of there. For some reason I remember this was faster than using lock vertexdata for limb/unlock vertexdata or whatever, repeatedly. I could be wrong though.

And as for determining which face is colliding, I suppose brute force is usually viable... but that's why I'm trying to get an octree working.
fearred
15
Years of Service
User Offline
Joined: 18th Sep 2009
Location:
Posted: 5th Oct 2009 10:59
its quiet around here........ People busy coding?
BMacZero
19
Years of Service
User Offline
Joined: 30th Dec 2005
Location: E:/ NA / USA
Posted: 5th Oct 2009 17:07
Urk! Getting distracted by other projects, more like...

I'm still hung up on how to find out what face an object hits...I need to do some searching.



thenerd
16
Years of Service
User Offline
Joined: 9th Mar 2009
Location: Boston, USA
Posted: 6th Oct 2009 01:05
I am going to try this one...


forever loading...
Aurum Knight
17
Years of Service
User Offline
Joined: 15th Jul 2008
Location: the suburbs of nowhere
Posted: 8th Oct 2009 03:41
Deadline is in just a few days. It'd be nice to see some entries, but apparently everyone is caught up on collision
Kira Vakaan
16
Years of Service
User Offline
Joined: 1st Dec 2008
Location: MI, United States
Posted: 8th Oct 2009 03:50 Edited at: 8th Oct 2009 03:53
Yes indeed. This octree is currently whooping me.

@BMacZero:

Well I'd advise against polygon on polygon collision. Instead, sphere on polygon collision is much simpler. As you know, an object is broken up into triangles, so really, whenever the sphere is intersecting a triangle, there is a collision. You could just brute force it, by checking every triangle in the object, or you could join me and suffer through some sort of space partitioning structure like an octree to check only the close-by triangles. A while ago, I stumbled across a well written post by Sven B on detecting collision between a ray and a triangle. While it's not sphere on triangle collision, it's certainly a good start.

http://forum.thegamecreators.com/?m=forum_view&t=157680&b=1&msg=1851745#m1851745

Hope this helps.

Edit: I wonder if the time is right to discuss an extension of a few days.
fearred
15
Years of Service
User Offline
Joined: 18th Sep 2009
Location:
Posted: 8th Oct 2009 11:49
I feel honoured to be the first one entering
I did this in like half an hour so it's not very good.......
BMacZero
19
Years of Service
User Offline
Joined: 30th Dec 2005
Location: E:/ NA / USA
Posted: 8th Oct 2009 17:21
@Kira - I think that's exactly what I need! Yay

thenerd
16
Years of Service
User Offline
Joined: 9th Mar 2009
Location: Boston, USA
Posted: 9th Oct 2009 00:04
i am almost done mine...


forever loading...
thenerd
16
Years of Service
User Offline
Joined: 9th Mar 2009
Location: Boston, USA
Posted: 9th Oct 2009 00:54 Edited at: 9th Oct 2009 00:55
having some trouble with enemy spawning...



forever loading...
thenerd
16
Years of Service
User Offline
Joined: 9th Mar 2009
Location: Boston, USA
Posted: 9th Oct 2009 21:25
could we possibly extend the deadline?


forever loading...
Kira Vakaan
16
Years of Service
User Offline
Joined: 1st Dec 2008
Location: MI, United States
Posted: 9th Oct 2009 23:33
Quote: "could we possibly extend the deadline?"


I think we should too. I know I could certainly benefit from a couple extra days, and it looks like other people could too.

@BMacZero: I'm glad. Hope it's going well. Hilarious sig, by the way. What a great series.
Aurum Knight
17
Years of Service
User Offline
Joined: 15th Jul 2008
Location: the suburbs of nowhere
Posted: 9th Oct 2009 23:39
@fearred: Pretty good for a start Give it some more work and it'll turn out great. I recommend adding either levels or enemy tank spawning.

@thenerd: Yea, I was thinking about doing that. As long as we have people still working on this, I think extending it one week should be fine. Good looking entry by the way. Can't wait to try it

The new deadline is on on 10/17/2009 at 23:59:59 GMT
Rich Dersheimer
AGK Developer
16
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 13th Oct 2009 18:35 Edited at: 14th Oct 2009 04:49
I know I'm late to the party, but I need a break from working on my dungeon. It's creepy down there.

So, a tank game, must be addicting. No media that I don't make myself with code.

I started early this morning, and I'll post a screenshot later today.

Woot!

Rich

EDIT: and here it is...



Kira Vakaan
16
Years of Service
User Offline
Joined: 1st Dec 2008
Location: MI, United States
Posted: 14th Oct 2009 11:03
@Rich:
Nice medialess tank.

I've finally, *finally* finished implementing my octree, and now I think everything is moving smoothly. I hope this code can help future challenge coders.

I tried to model my system off of Sparky's, in that the commonly used commands out of Sparky's DLL have available equivalents (ha, yeah right). Currently the system supports ray casting, sphere casting, and sphere sliding.

And 1907 lines later, you have a sliding collision demo.

Hm, I've tried multiple times now to paste the code in between code tags and post it, but this red text keeps appearing: "Unknown System Error while posting reply. Sorry but I have to abort now. Please try again later." Sorry for the inconvenience, but I've attached only the source file.

My system finally works! I'm excited.

I tried to document the code fairly well, but if anyone has any questions, please ask.
Rich Dersheimer
AGK Developer
16
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 14th Oct 2009 17:00
Quote: "@Rich:
Nice medialess tank."


Thanks, Kira! I'm still working on it though. It was interesting to draw the treads... no filled circle command, and ONLY a filled box command. But I'm going to put some wheels on the thing instead.

I don't even know what an octree is, but Grats on getting it finished! I look forward to learning from your code.

Now... what's up with cylinders? Do they not have an end cap? Even with culling off? Is there an easy way to add an end cap to them?

Pondering,
Rich

BMacZero
19
Years of Service
User Offline
Joined: 30th Dec 2005
Location: E:/ NA / USA
Posted: 14th Oct 2009 17:07
@Kira

Sweet! Looks very nice, if way over my head .

Codesurge is telling me Clamp is a reserved word, though. You might want to replace it with Clamp2 or something.

Mobiius
Valued Member
22
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 14th Oct 2009 19:00
Quote: "Now... what's up with cylinders? Do they not have an end cap? Even with culling off? Is there an easy way to add an end cap to them?"

In DBPro, they are hollow cylinders. You'd have to stick a plain at each end textured with a filled circle.

Your signature has been erased by a mod because we're sadistic losers with nothing better to do. (joke)
Rich Dersheimer
AGK Developer
16
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 14th Oct 2009 21:09
Quote: "In DBPro, they are hollow cylinders. You'd have to stick a plain at each end textured with a filled circle."


Okay. I guess I could make an end cap out of a cone scaled down to a disc. Hmm, if the cone has a bottom, I could just jam the pointy end into the cylinder, and call it capped!

Kira Vakaan
16
Years of Service
User Offline
Joined: 1st Dec 2008
Location: MI, United States
Posted: 14th Oct 2009 22:30
@Rich:

Nope, no bottoms on cones either. Hm, I guess scaling a cone could work, or you could create a memblock out of the mesh and manually add a pie-wheelish shape to the end of it using your fabulous trig skills. At least that way it would be part of the same limb.

@BMacZero:

Thanks!
Bah, I'm sure it's not. Though 1907 lines probably is a little daunting at first.
Hm, it says Clamp is reserved? I'm also using CodeSurge with no issues... Maybe you have a plugin that has a Clamp function in it? I have no idea if it's in IanM's utilities, but I don't have them installed, so if you do, that might be it. At any rate, I'll rename it for people. Thanks for pointing that out!
sinisterstuf
18
Years of Service
User Offline
Joined: 28th Mar 2007
Location: Namibia, Southern Africa
Posted: 14th Oct 2009 22:47
I miss doing these challenges my darkBASIC needs to rergister cos i updated it but i don't have my CD anymore cos i haven't needed it for years... *sigh* nostalgia

looking good guys

LLANFAIRPWLLGWYNGYLLGOGERYCHWYRNDROBWLLLLANTYSILIOGOGOGOCH
thenerd
16
Years of Service
User Offline
Joined: 9th Mar 2009
Location: Boston, USA
Posted: 15th Oct 2009 00:13 Edited at: 15th Oct 2009 00:14
for the cap, you could make a cone, xrotate it 90 degrees, scale it 100,1,100. then position it at the same position as the barrel, rotate it the barrel's angle, and call move object (amount) every loop, where amount would be how long the barrel is.


forever loading...
BMacZero
19
Years of Service
User Offline
Joined: 30th Dec 2005
Location: E:/ NA / USA
Posted: 15th Oct 2009 02:08
Quote: "Though 1907 lines probably is a little daunting at first."

Yeah, that's probably it .

Quote: "for the cap, you could make a cone, xrotate it 90 degrees, scale it 100,1,100. then position it at the same position as the barrel, rotate it the barrel's angle, and call move object (amount) every loop, where amount would be how long the barrel is."

Or just add it as a limb.

thenerd
16
Years of Service
User Offline
Joined: 9th Mar 2009
Location: Boston, USA
Posted: 15th Oct 2009 02:11
or that.


forever loading...
Skyrift
17
Years of Service
User Offline
Joined: 8th Mar 2008
Location:
Posted: 15th Oct 2009 03:14
Just dug this up, it's a bit long winded, but it works.

Kira Vakaan
16
Years of Service
User Offline
Joined: 1st Dec 2008
Location: MI, United States
Posted: 15th Oct 2009 10:30
Here's my take on the medialess tank:

Skyrift
17
Years of Service
User Offline
Joined: 8th Mar 2008
Location:
Posted: 15th Oct 2009 17:41 Edited at: 15th Oct 2009 17:45
Not sure how much more time I'm gonna get, so here's what I've done so far. I'd be interested to know if anyone has a better way to dynamically change the texture, as this method gets really laggy really quick.

Rich Dersheimer
AGK Developer
16
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 15th Oct 2009 21:08
Quote: "Here's my take on the medialess tank:"


Nice detail! And I love how the body and turret are not just cubes. Looking good!

Rich

thenerd
16
Years of Service
User Offline
Joined: 9th Mar 2009
Location: Boston, USA
Posted: 15th Oct 2009 22:44
@Skyrift:
looks great!
I love the effects...


forever loading...
Rich Dersheimer
AGK Developer
16
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 16th Oct 2009 00:04 Edited at: 16th Oct 2009 01:55
Skyrift,

Wow, lots of good code examples! I'm going to spend some time with it after I get off work tonight.

One thing... for making filled circles, I've just been looping from 0 to whatever radius, and doing it again with a y offset.

Like this (pseudo code):



It seems to work well, but I haven't checked it on really big circles.

Rich

EDIT
Well, darn it, that code won't run, Skyrift. It starts, and draws the ground and tank. I can fire one shot, or turn a little bit, but then it crashes. Great effect on the gun firing though!

Oh, and I drew some big circles with the loop and offset. No pixels left behind, works great.

thenerd
16
Years of Service
User Offline
Joined: 9th Mar 2009
Location: Boston, USA
Posted: 16th Oct 2009 02:48
just wanted to say, I'm on post moderation , and I am still not done, so if my post is a few hours past the deadline, can I still enter? (I am also in the US, so the deadline is in the middle of the night.)


forever loading...
Kira Vakaan
16
Years of Service
User Offline
Joined: 1st Dec 2008
Location: MI, United States
Posted: 16th Oct 2009 03:27
@thenerd:

Actually, if you're in the US, the deadline is anywhere from 4pm-8pm. I'm in Michigan, and the deadline is 7pm.
Skyrift
17
Years of Service
User Offline
Joined: 8th Mar 2008
Location:
Posted: 16th Oct 2009 03:39
i think the bottleneck is in the way i'm using get image to pull an image from bitmap 1, and then updating the texture with that, rather than the drawing.
Rich Dersheimer
AGK Developer
16
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 16th Oct 2009 16:40 Edited at: 16th Oct 2009 18:11
Finally got the tank finished. I scrapped the treads and wheels and went with a hovertank design. Here's some screens...





I've got the movement and collision code done, still have to create the enemies, the playing field, and the title screen. And I'm working all day tomorrow, so it's going to be close...

Rich

EDIT:BMac, it turns out it's the spaces in the filename. Thanks for the response, all thumbnails and image links are good now.

BMacZero
19
Years of Service
User Offline
Joined: 30th Dec 2005
Location: E:/ NA / USA
Posted: 16th Oct 2009 17:00
Well, my bullet bouncing code still needs work, but I've had almost no time the past few days to work on it, so here it is:

WASD/Arrows to move, click to shoot, right-click to mine.



I'm using some nice bounce code by Phaelax, but I'm like halfway through getting it to work with all 4 directions, so meh.

BMacZero
19
Years of Service
User Offline
Joined: 30th Dec 2005
Location: E:/ NA / USA
Posted: 16th Oct 2009 17:01 Edited at: 16th Oct 2009 17:02
@Rich - Image code is:



Looks nice, BTW, the texture especially.

thenerd
16
Years of Service
User Offline
Joined: 9th Mar 2009
Location: Boston, USA
Posted: 16th Oct 2009 22:49
Well, here's my entry.
a few things:
-it looks best in 640x480x32 fullscreen exclusive.
-I am focusing more on gameplay rather then graphics, and the graphics are horrible.
-the controls are in-game.
-try to play through the whole game, there is a little goody at the end.
-it might be a little buggy




forever loading...
Kira Vakaan
16
Years of Service
User Offline
Joined: 1st Dec 2008
Location: MI, United States
Posted: 17th Oct 2009 01:46
WIPs are looking very promising! Good job.

@BMacZero:
One thing I noticed about yours was that whenever I tried moving left, the tank would move left, but then would start spinning clockwise when I let go of the button... does that happen for you?
Kira Vakaan
16
Years of Service
User Offline
Joined: 1st Dec 2008
Location: MI, United States
Posted: 17th Oct 2009 15:22
I'm not done yet, but I thought I'd post a WIP. So far, you can move and shoot and that's about it. Most of the options in the game setup menu don't work yet, but they'll be easy to add in. I've got a lot of work to do in the next couple of hours.

BUT, the main reason for posting this WIP so close to the deadline is because I thought you guys might like to play around with the tennis ball-like things you shoot at the moment. I made them yellow so I could study the way they move. At any rate, I'm really happy with the realistic bounces off of obstacles I'm getting. It's kinda fun to play around with for some reason.
I was going to have the bullets disappear after one bounce like in the original tank game, but I don't know how I feel now. I really like those bounces.

Again, the code is way too long to post in code tags, so I've attached the source file.

Controls:
WASD - Turn/Move
Mouse - Aim
Left Mouse Button - Shoot (hold for a more powerful shot)
Rich Dersheimer
AGK Developer
16
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 17th Oct 2009 17:28
Quote: "...so close to the deadline "


So, exactly when is the deadline? If the deadline is midnight tonight, the 17th of October, and I'm in USA Central (zone minus six I believe) does that make the deadline 6 pm tonight for my time zone?

I only ask because I can post my entry today during my lunch break if needed, but I get off work tonight at 5:30 pm. I'd hate to miss the deadline.

Rich

Kira Vakaan
16
Years of Service
User Offline
Joined: 1st Dec 2008
Location: MI, United States
Posted: 17th Oct 2009 17:36
Quote: "6 pm tonight"


That sounds right. I'm in MI, and I believe the deadline's 7pm for me. Last minute scrambling.
thenerd
16
Years of Service
User Offline
Joined: 9th Mar 2009
Location: Boston, USA
Posted: 17th Oct 2009 20:14
oh, by the way my other post was the final entry.


forever loading...

Login to post a reply

Server time is: 2025-08-08 19:07:39
Your offset time is: 2025-08-08 19:07:39