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 / To use Matrix, or to use .X, that is the question!

Author
Message
Rwilson
23
Years of Service
User Offline
Joined: 19th May 2003
Location: United States
Posted: 19th Oct 2003 08:11
I'm working on an Mars Base Simulation type of game (Think SimCity), and I've been looking into how to create the landscape. I know that there are tow ways I could go about this. There's the matrix system, and the .X model landscapes.

I really don't know enough about the two to really make a good decison and a search using "Matrix" didn't turn up anything, so which would be best? Better yet, what are the major differences between the two?

Usermlsra - Causing Havoc with a Smile
Rob K
Retired Moderator
23
Years of Service
User Offline
Joined: 10th Sep 2002
Location: Surrey, United Kingdom
Posted: 19th Oct 2003 14:22
Use X models. Either use Kevil's matrix code (search Code Snippets) or ask IanM if you want X-based matrices.

The in-built ones are slow and very limited.

Rwilson
23
Years of Service
User Offline
Joined: 19th May 2003
Location: United States
Posted: 19th Oct 2003 18:55
All righty! Just downloaded Kevils code and will check it out a bit latter. I'll also be emailing IanM about the "X-based Matrices" in a bit. Best to explore all my options before I begin, yeah?

Usermlsra - Causing Havoc with a Smile
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 19th Oct 2003 19:26
You can find some older code of mine in this (fixed) bug report : http://developer.thegamecreators.com/?m=forum_view&t=14433&b=15

My current way of coding landscape objects has moved on a bit from that, but it should be enough to get you going.

Just fill out the HeightMap array with your terrain heights and call the MakeMyPlane() function to generate the object. You'll also see in the OffsetObject() function how to get the ground height using INTERSECT OBJECT

Enjoy
ReD_eYe
23
Years of Service
User Offline
Joined: 9th Mar 2003
Location: United Kingdom
Posted: 19th Oct 2003 19:31
but the inbuilt matrices are so much easier to make, but thats my opinion.


"Look a bandwagon.... lets jump on it!"
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 19th Oct 2003 20:15
True, but they are far slower and you don't have the same flexibility with visual effects.

Also, once you've generated a terrain using meshes, you can save them as objects so that reloading is quicker
Rwilson
23
Years of Service
User Offline
Joined: 19th May 2003
Location: United States
Posted: 19th Oct 2003 23:55
IanM: I gave the program a test run, and all I saw was a blue screen with 4 orange spheres in a diamond formation. Is this what is supposed to happen?

Usermlsra - Causing Havoc with a Smile
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 20th Oct 2003 00:04
Nope. You should see a multicoloured X-based matrix about 150x150. The spheres were just there to track the ground height.

Make sure that you have latest DirectX, latest video drivers and latest update of DBPro - if it works for me on this machine (strictly a DX8 video card) then you should be able to get it to work for you too
Ian T
23
Years of Service
User Offline
Joined: 12th Sep 2002
Location: Around
Posted: 20th Oct 2003 00:36
That's why I'd really like command unification. Faster, more flexible matrices-- with shading and effects-- lovely.

IanM-- Nice code .

--Mouse: Famous (Avatarless) Fighting Furball

A very nice %it, indeed.
Rwilson
23
Years of Service
User Offline
Joined: 19th May 2003
Location: United States
Posted: 20th Oct 2003 01:42 Edited at: 20th Oct 2003 01:43
Blast it! I jsut upgraded to the latest ATI drivers, I upgraded DBPro just last week, and DirectX about a week before. Just tried your program again, and just a blue screen with 4 spheres. Out of curiousity, this isn't using any of your DLL's is it? I don't have any currently installed at the moment, so that could be the main problem.

Also, out of curiousity, would Cartographer Shop be a good idea? I got it as a part of a bundle pack, thinking I'd need it. In fact, I proboly should have mentioned having that in the beginning, shouldn't I? Opps.

Sorry to keep bothering you.

Usermlsra - Causing Havoc with a Smile
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 20th Oct 2003 02:11
No, the code doesn't use any plugins, although I have a far faster and easier way of doing this with my array plugin.

I really don't know why it doesn't work for you - try reducing the size of the object it is creating and see if that works.

I don't know Cart shop - I have no skill with modelling or graphics (that's why I concentrate on code), so you'll need someone else to advise you on that.

@Mouse, Gee thanks
Rwilson
23
Years of Service
User Offline
Joined: 19th May 2003
Location: United States
Posted: 20th Oct 2003 02:43 Edited at: 20th Oct 2003 02:43
IanM: You were right, it was the size! I played with it for a while, and I found that going over the number 104 in both the MAP_WIDTH and MAP_DEPTH kills it. On another note of interest, if you'll notice the fact that the spheres change color when you pass through the plane. When I use a number over 104, and go past where the plane should be, the sphere's still change color! It's almsot as if the plane exist, but has become see through for some reason. Perhaps a bug? Can't really tell, for your code is, I must admit, a bit over my current expertise. I would, however, be interested in this code you mentioned that uses your array plugin. Faster and Easier is always a good thing!

Everyone Else: Would somebody with Cartography Shop skilz please come forward and give me an answer to my new question? IanM's method or Cartography Shop, That is now the question!

Usermlsra - Causing Havoc with a Smile
Rob K
Retired Moderator
23
Years of Service
User Offline
Joined: 10th Sep 2002
Location: Surrey, United Kingdom
Posted: 20th Oct 2003 05:58
Quote: " True, but they are far slower"


Indeed. I get 40FPS on a 10x10 tile, 100x100 size standard matrix, 120FPS on a 70x70 tile, 5000x5000 size modified version of Kevil's code - Plus you can use bump mapping, multi-texturing and so on.

DrakeX
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location:
Posted: 20th Oct 2003 06:03
and with the multitexturing, do things like have a low-res color texture on one layer, and a detail texture on another -- thus eliminating the need for high-res whole-matrix textures and eliminating ugly seams altogether.

stop looking at me!
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 20th Oct 2003 09:34
@Usermlsra, It sounds like you are hitting an old limit for object sizes that was eliminated with U5.1 - are you sure that you are using the latest update?
Rwilson
23
Years of Service
User Offline
Joined: 19th May 2003
Location: United States
Posted: 20th Oct 2003 18:15 Edited at: 20th Oct 2003 18:16
According to the about in the DBPro IDE, I'm running version 1.051. Just to make sure, I'll download the patch again later and apply it. If that fixes it, than something fluky must have happned before. I'll let you know.

Usermlsra - Causing Havoc with a Smile
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 20th Oct 2003 21:17
If you are using 5.1 then I guess that this *might* be a limitation of your drivers or graphics card ... do you have the same limit for matrix's?
Rwilson
23
Years of Service
User Offline
Joined: 19th May 2003
Location: United States
Posted: 20th Oct 2003 23:15
I'll admit, I've never used the matrix commands much, one of the main reasons being I was unsure if it would be worth my time (apparently, I was right). However, I did make this little snippet of code.



I wasn't sure which parameters needed to be set to 150, so I set them all to 150. It works, but It moves like a snail on caffeine. Slow, but not mind numbing slow. Odd. And since you think it might be hardware, here's my specs.

Pentium Celeron 2 GHZ
256 mb DDR Ram
ATI Radeon 9000 Pro
SOYO P4VDA Motherboard

Usermlsra - Causing Havoc with a Smile
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 20th Oct 2003 23:48
Nope, not hardware - I surrender to my ignorance
Rwilson
23
Years of Service
User Offline
Joined: 19th May 2003
Location: United States
Posted: 21st Oct 2003 01:16
Oh as well. It's not surprising, my PC has this tendency of either over or under performing what it should be doing. At this point in time, I think I'll mess around with Cart Shop and see what I can doo with it. If I do as badly as I think I will, I'll start using your code. Thanks for all the help, everyone!

Usermlsra - Causing Havoc with a Smile

Login to post a reply

Server time is: 2026-07-26 05:22:30
Your offset time is: 2026-07-26 05:22:30