Jump to content
  • Advertisement
Sign in to follow this  
itz_faraz

Unity Please test my terrain engine

This topic is 4460 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I’ve successfully implemented quadtree approach to my terrain engine. I’ve uploaded my engine and request you guys to test it if you like its speed and accuracy and let me know about any weakness in it. There are already certain weaknesses in my code which I would like to mention here: For example my terrain is of 20x20 tiles, my code will create 21 quads i.e. it will divide the terrain into 21 pieces; each piece shall be minimum of 5x5 tiles. The 21 tiles are created as follows: The first (1) quad is holds the whole terrain. The terrain is divided into 4 equal sub-quads (i.e. of 10x10 tiles each) (quad number 2, 3, 4, 5). Then each sub-quad is further divided into 4 equal quads. This process is carried out until comes a quad which holds only 5x5 tiles. This quadtree code has substantially increased my engine’s performance, but there’s a catch... all these quads have to be pre-calculated for the first time, which takes quite a lot of time in loading a 250x250 tile map (I plan to make my game based on 250x250 tile maps). What would be the solution to this problem? I have created a MapSelect.exe file which will allow you to set the minimum number of tiles for a quad and you can also use different types of maps to see which, in your opinion, gives the best results. Please download and test my terrain engine from here: Click Here NOTE: These executables were built on Visual Basic 6 SP6 therefore you must have VB6’s runtime files installed on your system. These files are normally shipped with Windows XP but not with Windows 98SE. Thank you Faraz Azhar

Share this post


Link to post
Share on other sites
Advertisement
Ran fine for me [smile]

It sat around 75fps (if that helps you)
My pc specs are:
WinXP sp2
AMD Sempron 2800+
Geforce 6600gt
512mb ram

Log was as follows:
#===========================================#
#==================STARTUP==================#
City Builder Log file, opened: 17/03/2006 15:39:49
Creating DirectX Devices...
Adapter: NVIDIA GeForce 6600 GT
Acceleration: Hardware Acceleration (HAL)
Mode: 1600x1200 [32 BIT]
Mode Format: 22
Texture Filtering: Anisotropic
Processing: Hardware Vertex Processing
Antialiasing: 4 multisampling
Depth Buffer: 24 bit Depth buffer selected
Backbuffers: 2
Device created successfully!
Setting-up Terrain...
-> Loading Textures...
-> Loading Map...
-> Building Quadtrees...
Restoring Device Objects...
Restoring Device Objects... done!
->All loading complete.
Shutting down app...
#=================SHUTDOWN==================#

It is pretty cool, reminded me of Captain Skyhawk on the nes [grin]
Quote:
This quadtree code has substantially increased my engine’s performance, but there’s a catch... all these quads have to be pre-calculated for the first time, which takes quite a lot of time in loading a 250x250 tile map (I plan to make my game based on 250x250 tile maps). What would be the solution to this problem?

Dump the quadtree into a file (binary/ascii) and load that at startup instead of computing the quadtree everytime you run it [smile]

Regards,
ViLiO

Edit: Whacked the detail right up [grin]

[Edited by - ViLiO on March 17, 2006 9:19:56 AM]

Share this post


Link to post
Share on other sites
I was quite curious to see the source, but the zip file only had binaries :(

anyway, looks great. ran 75fps on my p4 3.2 1gb ram.

here is a copy of the log:
#===========================================#
#==================STARTUP==================#
City Builder Log file, opened: 17/03/2006 9:53:16 AM
Creating DirectX Devices...
Adapter: NVIDIA GeForce PCX 5300
Acceleration: Hardware Acceleration (HAL)
Mode: 1792x1344 [32 BIT]
Mode Format: 22
Texture Filtering: Bilinear
Processing: Hardware Vertex Processing
Depth Buffer: 24 bit Depth buffer selected
Backbuffers: 1
Device created successfully!
Setting-up Terrain...
-> Loading Textures...
-> Loading Map...
-> Building Quadtrees...
Restoring Device Objects...
Restoring Device Objects... done!
->All loading complete.
Shutting down app...
#=================SHUTDOWN==================#

Share this post


Link to post
Share on other sites
Ran well, steady 50 fps on my p4 2.8 with 512 ram

#==================STARTUP==================#
City Builder Log file, opened: 2006-03-16 23:59:56
Creating DirectX Devices...
Adapter: NVIDIA GeForce4 Ti 4200 with AGP8X
Acceleration: Hardware Acceleration (HAL)
Mode: 1280x1024 [32 BIT]
Mode Format: 22
Texture Filtering: Anisotropic
Processing: Hardware Vertex Processing
Antialiasing: 4 multisampling
Depth Buffer: 24 bit Depth buffer selected
Backbuffers: 2
Device created successfully!
Setting-up Terrain...
-> Loading Textures...
-> Loading Map...
-> Building Quadtrees...
Restoring Device Objects...
Restoring Device Objects... done!
->All loading complete.
Shutting down app...
#=================SHUTDOWN==================#

Share this post


Link to post
Share on other sites
Ok, ran fine on my Dell laptop, but when I ran it on my wide screen laptop everything went sideways and I couldn't do anything with it (the mouse also went sideways and it was confusing to try and control). Basically immagine the screen rotated 90 degrees clockwise.

Share this post


Link to post
Share on other sites
Completely fine my end, flat 85fps.
Loved the loading screen, looks very polished !

#==================STARTUP==================#
City Builder Log file, opened: 18/03/2006 2:29:47 AM
Creating DirectX Devices...
Adapter: RADEON 9600XT SERIES
Acceleration: Hardware Acceleration (HAL)
Mode: 1024x768 [32 BIT]
Mode Format: 22
Texture Filtering: Bilinear
Processing: Hardware Vertex Processing
Antialiasing: 2 multisampling
Depth Buffer: 24 bit Depth buffer selected
Backbuffers: 1
Device created successfully!
Setting-up Terrain...
-> Loading Textures...
-> Loading Map...
-> Building Quadtrees...
Restoring Device Objects...
Restoring Device Objects... done!
->All loading complete.
Shutting down app...
#=================SHUTDOWN==================#

Share this post


Link to post
Share on other sites
Quote:
Original post by jdarling
Ok, ran fine on my Dell laptop, but when I ran it on my wide screen laptop everything went sideways and I couldn't do anything with it (the mouse also went sideways and it was confusing to try and control). Basically immagine the screen rotated 90 degrees clockwise.


eh? I wonder why it did that.. ! Anyways thank you very much all of you! There is a little problem that Im having that I forgot to mention it here.

Mouse-tile selection code is incorporated but you may not see any selected tile when you hover over the terrain. Thats because im having some alpha-blending problems. Try pressing 'A' key when moving the mouse over the terrain When A key is pressed I disable alphablending before drawing the selection tile. The problem is that the selection tile isnt appearing nicely on top of other tiles. Do what other alpha blending options I need to set to draw it right?

Also please guide me how to create quadtrees faster. Have you guys tested different map sizes with different minimum tiles in quad. Try to play with it and please let me know what minimum level brings best frame rate performance.

[Edited by - itz_faraz on March 17, 2006 2:38:55 PM]

Share this post


Link to post
Share on other sites
60 fps for me on my AMD FX-57 w/ 7800 gt nvidia.
Am I the only one who tried using the arrow keys to scroll around and got a little pause every couple seconds?
#===========================================#
#==================STARTUP==================#
City Builder Log file, opened: 3/19/2006 2:31:59 AM
Creating DirectX Devices...
Adapter: (Unknown)
Acceleration: Hardware Acceleration (HAL)
Mode: 640x480 [16 BIT]
Mode Format: 23
Texture Filtering: Bilinear
Processing: Hardware Vertex Processing
Depth Buffer: 24 bit Depth buffer selected
Backbuffers: 1
Device created successfully!
Setting-up Terrain...
-> Loading Textures...
-> Loading Map...
-> Building Quadtrees...
Restoring Device Objects...
Restoring Device Objects... done!
->All loading complete.
Shutting down app...
#=================SHUTDOWN==================#

Share this post


Link to post
Share on other sites
Quote:
Original post by valles
60 fps for me on my AMD FX-57 w/ 7800 gt nvidia.
Am I the only one who tried using the arrow keys to scroll around and got a little pause every couple seconds?


Hmm.. why dont you play around with settings in MapSelect.exe. See if the 'minimum number of quads' can fix your problem. If it does, or at least brings better performance, please let me know what settings you used.

Share this post


Link to post
Share on other sites
I tested this on an lower end system
P4 1.66
Windows XP SP2

I got a slow 15 fps :(

#===========================================#
#==================STARTUP==================#
City Builder Log file, opened: 20/03/2006 8:19:10 PM
Creating DirectX Devices...
Adapter: NVIDIA GeForce2 MX/MX 400
Acceleration: Hardware Acceleration (HAL)
Mode: 1280x1024 [32 BIT]
Mode Format: 22
Texture Filtering: Bilinear
Processing: Hardware Vertex Processing
Depth Buffer: 24 bit Depth buffer selected
Backbuffers: 1
Device created successfully!
Setting-up Terrain...
-> Loading Textures...
-> Loading Map...
-> Building Quadtrees...
Restoring Device Objects...
Restoring Device Objects... done!
->All loading complete.
Shutting down app...
#=================SHUTDOWN==================#

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!