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.

Newcomers DBPro Corner / 3D graphics problems

Author
Message
Lucas Tiridath
AGK Developer
16
Years of Service
User Offline
Joined: 28th Sep 2008
Location: Kings Langley, UK
Posted: 23rd May 2009 13:09
Hi,

I am working on computerising the Viking Game known as Hnefatafl. For those of you who don't know, its somewhere between drafts and chess in terms of complexity and the rules. Anyway its meant to be in 3D but I have run into several problems.

One problem is that a draw the board from many individual squares using a loop. However strangely, two of the squares appear completely out of position which confuses me as surely if the loop works for all the others, it should work for placing these two as well...

A second problem is that the piece representing the king (the cylinder which starts in the centre) does not seem to be rendering properly and does not appear to have taken the white texture I have put on it.

Yet another problem is that the pieces, both black and white, are far smaller than I think I have told them to be. I have set them to be 3/4 of the size of a square but instead, they look to be about 1/4.

Finally, the entire board seems to be mispositioned. As it is meant to appear on a table, I have positioned it at the tables position + 1/2 the tables height so it appears on top and then started placing squares from -6 1/2 square widths from the centre of the table (because the boards is 11 squares across and 6 1/2 is half of 11). Therefore I cannot understand why the board seems to be offset.

Any help with any of these problems would be greatly appreciated but first, I have one other problem.

To show you these problems, I have created a version of the game which simply displayes the graphics which are causing problems. The file size is 7.84 MB. The uploader applet claims that you can upload 50MB and in my experiece 7.84 tend to be < 50. However every time I try and upload the file containing the dbp file and the graphics, it says that the file is too large. Could anyone tell me what I am doing wrong so that I can put this demonstration version of the program up for you to see.

Thank you for your help,

Lucas Tiridath
bobbel
15
Years of Service
User Offline
Joined: 5th Jan 2009
Location: In my DBPro case xD
Posted: 23rd May 2009 15:09
you could use mediafire, thats a good filehoster. any other will work too

(\__/)
(O.o )
(> < ) This is Bunny. Copy Bunny into your signature to help him on his way to world domination!
Lucas Tiridath
AGK Developer
16
Years of Service
User Offline
Joined: 28th Sep 2008
Location: Kings Langley, UK
Posted: 23rd May 2009 20:51
Ok I have followed your advice and joined mediafire. Out of interest, does anyone else have the same problem with uploading files that I do?

Anyway you can find all the files here:
http://www.mediafire.com/?sharekey=d4dd788f4aaec32b41446e35a78dc463d1af9911d3a2c75cb8eada0a1ae8665a

If you put them in one folder and run the DBP code, you should see the problem. Thank you very much in advance for your help,

Lucas Tiridath.
bobbel
15
Years of Service
User Offline
Joined: 5th Jan 2009
Location: In my DBPro case xD
Posted: 23rd May 2009 22:39
could you please rar or zip the file or something, cause its simply too much work to download all the files seperately

(\__/)
(O.o )
(> < ) This is Bunny. Copy Bunny into your signature to help him on his way to world domination!
Lucas Tiridath
AGK Developer
16
Years of Service
User Offline
Joined: 28th Sep 2008
Location: Kings Langley, UK
Posted: 24th May 2009 10:13
I have done so and it can be found at http://www.mediafire.com/?sharekey=d4dd788f4aaec32b41446e35a78dc463e04e75f6e8ebb871

Its called forum.zip

Thanks for your help.
bobbel
15
Years of Service
User Offline
Joined: 5th Jan 2009
Location: In my DBPro case xD
Posted: 24th May 2009 10:47
ok, i've downloaded the file, and found a bunch of files in it. i looked at the source, and i can;t make anything from it. i'm not trying to be mean or something, but if you want help, you have to make sure everything is readable and the program is complete, cause i can;t help you with the code that you have putted online

Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 24th May 2009 11:53 Edited at: 24th May 2009 12:15
Interesting program. I never knew that game existed. The problem is in the DrawBoard function. I added code to check if all the spots on the board were being assigned numbers properly:



When you run that numbers 78 and 88 pass through the FOR/NEXT still reading as zero instead of 1 like they should.

So change this:


To this:


Lucas Tiridath
AGK Developer
16
Years of Service
User Offline
Joined: 28th Sep 2008
Location: Kings Langley, UK
Posted: 24th May 2009 13:38 Edited at: 24th May 2009 15:44
Right. bobbel I have tested the code which I put up and have found that if you run the DBA file rather than the DBPro file, an error occures. I don't really understant this but I think I have fixed it and a version which works for both the DBA and DBPro versions of the code is now avaliable at the same link.

tyvm Grog Grueslayer, your replacement code works perfectly. I must have gone crosseyed counting the squares on the board and missed those two out.

I have also fixed the problem of the size of the pieces; they were positioned below the board because I was not using real sizes which took into account the scale.

However the king still renders completely wrong and without a texture and the board is still not positioned correctly on top of the table.

Any help with either of these problems would be greatly appreciated.

Quote: "Interesting program. I never knew that game existed"


Yeah, it is quite unusual. I think I bought it at a long boat museam years ago and when I wanted to make a board game, I thought it might be fun as chess and drafts have been done so many times and chess seems a little too complex any way!

Anyhow, thanks very much for your help.

EDIT: OK, I have worked out why the board is going wrong. Its something to do with me not being able to work out that 11 * 2 is 22 not 20 and that 11 / 2 is 5.5 not 6.5...

Still having trouble with the cylinder though...
bobbel
15
Years of Service
User Offline
Joined: 5th Jan 2009
Location: In my DBPro case xD
Posted: 24th May 2009 17:20
hey, i think i know whats wrong with your King! thats because the Cylinder has no top face! thats why you can look into it, and backfaces are not visible, so.... but if you create a cylinder in your moddeling program, it should create a top face for it. or use create box instead!

Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 25th May 2009 17:01
Quote: "tyvm Grog Grueslayer, your replacement code works perfectly. I must have gone crosseyed counting the squares on the board and missed those two out."


Np.

Quote: "However the king still renders completely wrong and without a texture and the board is still not positioned correctly on top of the table."


Unless you've changed it since your last post the King (object #1) is just like Bobbel said a cylinder. Nowhere in the code do you load "Graphics\King.x".



Quote: "Yeah, it is quite unusual. I think I bought it at a long boat museam years ago and when I wanted to make a board game, I thought it might be fun as chess and drafts have been done so many times and chess seems a little too complex any way!"


I looked it up in Wikipedia and read there's a lot of debate on just how it's played. Are you going to pick one rule set and use that or let the user choose which play style they like? This seems more complicated than chess but that may be because I know for sure how to play chess.

Dream And Death
18
Years of Service
User Offline
Joined: 21st Feb 2006
Location: The circus! Juggling job, kids and DBPro
Posted: 25th May 2009 18:43
Hmmm, I'm looking forward to seeing the result. I've got a board on my bedside table, and the game has a personal resonance with me - the celtic version shares part of my eldest son's name!

Buy, yes, to help - model yourself the pieces rather than rely on DBPro's primitives - you'll be better off in the long run!

"You get what everyone gets, you get a lifetime!" - Death, The Sandman Library

First you Dream, then you ... - Neil Gaiman, 2001
Lucas Tiridath
AGK Developer
16
Years of Service
User Offline
Joined: 28th Sep 2008
Location: Kings Langley, UK
Posted: 25th May 2009 18:48
The problem with the king (who is just a cyliner) seems to be that DBP culls part of it and then does not put it back. When I turn off culling, the king renders fine.

Quote: "I looked it up in Wikipedia and read there's a lot of debate on just how it's played. Are you going to pick one rule set and use that or let the user choose which play style they like? This seems more complicated than chess but that may be because I know for sure how to play chess."


I bought a set with just one set of rules in so I think I will start with those. However once thats up and running, it might be quite a nice excersize to allow users to select a rules set. Nice idea!
The version I'm starting with is most like the Tawlbwrdd varient described on Wiki except without the calling and with the king having to be surrounded by 4, not just 2, foes.

Quote: "Buy, yes, to help - model yourself the pieces rather than rely on DBPro's primitives - you'll be better off in the long run!"


I'm sure your right and I may create pieces in an exteral program but for the moment, these are the easiest because I can easily made them the right size for the squares. Once the program is working, I may put some effort into creating nice pieces though.

Seeing how you have been so helpful so far, I think I may put another glitch to you. This is nothing to do with 3D graphics but is from the same game. The following code seems to be causing an infinite loop but I cannot understand why.



A functioning version of the code is avaliable here. It is the smaller of the two files.

Any help with this would, as always, be greatly appreciated.
Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 26th May 2009 02:22
Quote: "I bought a set with just one set of rules in so I think I will start with those. However once thats up and running, it might be quite a nice excersize to allow users to select a rules set. Nice idea!"


Cool. I can't wait to see it completed.

Quote: "Seeing how you have been so helpful so far, I think I may put another glitch to you. This is nothing to do with 3D graphics but is from the same game. The following code seems to be causing an infinite loop but I cannot understand why."


I didn't see where it does an infinite loop but you can guarantee it won't by just using FOR/NEXT loops instead of REPEAT/UNTILs. If it doesn't leave by the time both x and y FOR/NEXT loops are done i just exits with zero.

Replace FindSquare function with this:


Lucas Tiridath
AGK Developer
16
Years of Service
User Offline
Joined: 28th Sep 2008
Location: Kings Langley, UK
Posted: 26th May 2009 10:03
Thank you once again, your code works wonderfully.

Now to enjoy those few blissful hours before I hit another glitch
bobbel
15
Years of Service
User Offline
Joined: 5th Jan 2009
Location: In my DBPro case xD
Posted: 26th May 2009 16:21
i hope you finish your game, it looks good and i wanna PLAY!

Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 27th May 2009 00:33
Quote: "Thank you once again, your code works wonderfully.

Now to enjoy those few blissful hours before I hit another glitch "


Np.

Login to post a reply

Server time is: 2024-11-24 06:36:11
Your offset time is: 2024-11-24 06:36:11