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.

Work in Progress / BlitzTerrain

Author
Message
Duffer
21
Years of Service
User Offline
Joined: 9th Feb 2003
Location: chair
Posted: 10th Aug 2009 22:03
@ kaedroho,

check this link:-

http://forum.thegamecreators.com/?m=forum_view&t=155912&b=1&p=0

it would seem that we may also be able to use your environment map images for tree placement with TreeParty - although query whether your environment map is a colourmap?

a long time dabbler with DBC and DBPro with no actual talent but lots of enthusiasm...
kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 11th Aug 2009 00:34
Yes, they are colour.


Just changed the links of BlitzTerrain.

These will always point to the latest versions of BlitzTerrain.

RAR: http://link.blitzwerks.co.uk/index.php?l=BT_LatestRAR

ZIP: http://link.blitzwerks.co.uk/index.php?l=BT_LatestZIP

kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 11th Aug 2009 02:23
Major announcement!

As I've been using DBPro to develop blitzterrain, I have come to a lot of problems as the 2 languages work very differently. This has caused Slight slowdowns in blitzterrain. Also a big problem I have is all data for every terrain is stored in shared arrays, making it difficult to delete.

So I have now taken a major decision to do a full C++ port. This means rewriting every line. This will make speed go higher and also open up the opportunity to add features which I couldn't have added in the DBPro version, like deleting.

I will also be making the code compile for Dark GDK.

BMacZero
18
Years of Service
User Offline
Joined: 30th Dec 2005
Location: E:/ NA / USA
Posted: 11th Aug 2009 02:32
Sounds like a lot of work, but a good idea. Good luck!



Diggsey: I have a spine and memory, but one memorable guy says he hates me. What am I?
kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 11th Aug 2009 02:34
And sorry for late replys, I've been put on moderation.

No idea why though. Moderators are just ignoring every message I send them. They probably think I'm some sort of noob who complains about why hes gone on moderation. But really I have no idea why I have been put on it. It's very frustrating.

kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 11th Aug 2009 02:37
Quote: "Sounds like a lot of work, but a good idea. Good luck!"


Thanks! I'll get cracking tomorrow. C++ takes a while to code things in comparison to DBPro, but you can do more with it and its alot faster. Plus I LOVE coding with it.

kklouzal
15
Years of Service
User Offline
Joined: 15th May 2009
Location: Arizona
Posted: 11th Aug 2009 03:53
<3 kaedroho <3 kaedroho <3 kaedroho <3 kaedroho <3 kaedroho <3 kaedroho <3 kaedroho <3 kaedroho <3 kaedroho <3 kaedroho <3 kaedroho <3 kaedroho <3 kaedroho <3 kaedroho <3 kaedroho <3 kaedroho




can you say whoot gdk??!?!

KISTech
16
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 11th Aug 2009 19:07
It wouldn't be much more of a step to make it available for GDK.Net would it?

kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 11th Aug 2009 19:10
I'm not sure.

It depends what GDK.net wants me to do.

kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 11th Aug 2009 22:46 Edited at: 11th Aug 2009 22:46
Little Report.

All the following commands have been added and tested in DBPro. Ill do GDK tests a little later.



Current line count: 629

That's a lot for 1 day!

kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 12th Aug 2009 01:57 Edited at: 12th Aug 2009 02:43
I'm now working my way through Quad mapping. This will be the internal structure of BlitzTerrain. Once this is done, I can make the system generate terrains!

LODLevel limit is now infinite.

ETC: 2 - 3 months.

kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 12th Aug 2009 02:56
Because the LODLevels are now infinite, I have changed the 'BT SetLODDistances' command to 'BT SetLODDistance'.

Syntax:

BT SetLODDistance TerrainID,LODLevel,Value#

This must be called AFTER 'BT SetTerrainLOD'.

revenant chaos
Valued Member
17
Years of Service
User Offline
Joined: 21st Mar 2007
Location: Robbinsdale, MN
Posted: 12th Aug 2009 03:25
Will the new version support multiple terrains?
kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 12th Aug 2009 03:27
Yes, as it will be possible to choose which terrain you delete, multiple terrains will be supported.

kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 12th Aug 2009 13:41
Quadmapping is now done. Not tested, but should work fine.

N3wton
15
Years of Service
User Offline
Joined: 3rd Jun 2009
Location: Leeds, UK
Posted: 12th Aug 2009 13:44
Quote: "Not tested, but should work fine."


Thats what bill gates said about vista

Yours
N3wton

kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 12th Aug 2009 16:33 Edited at: 12th Aug 2009 16:45
haha!

I'm at my nans so I cant work for the next few hours.

When I get it all working I can release updates pretty much instantly as no conversion will be required!

Which means Instead of updates every month, you can have them every week! possibly days.

I will be working on the build terrain functions when I get back.

Once their done, I can post up a few renders.

Heres the order i will add all the features in:


Make Terrain
Make Terrain functions
Quadmapping
Terrain Generation
Set Quadmap heights
Get Ground Height
Get Ground Normal (useful for vegetation)
Texturing
Detail Mapping
Positioning
Collision meshes
LOD
Quad Rotation
Exclusion
Environment mapping
RTMS - With extra brush commands and support for realtime texturing and exclusion
Make Terrain from memblock and Make memblock from Terrain. - Will build loading commands on these commands
Save Terraind and Load terrain commands
Quad Reduction

Duffer
21
Years of Service
User Offline
Joined: 9th Feb 2003
Location: chair
Posted: 12th Aug 2009 16:38
and Save and Load BT Terrain.....

a long time dabbler with DBC and DBPro with no actual talent but lots of enthusiasm...
kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 12th Aug 2009 17:02
Ok, just rearranged a few for you.

I could make a save/load quadmap command now. But quadmaps are made per LOD Level (the system changes the "active quadmap" for each sector depending on current LOD Level to quickly generate the final quadmap which gets used on the terrain). That could cause problems as i gotta come up with a way on storing whole terrains in 1 file. Ill sort it out though.

To get terrain streaming working, I will make something called a "regional quadmap". Which is basically a Quadmap for a large bit of terrain. These will have to be kept separate from the main terrain file For fast streaming.

revenant chaos
Valued Member
17
Years of Service
User Offline
Joined: 21st Mar 2007
Location: Robbinsdale, MN
Posted: 12th Aug 2009 17:14
Quote: "Yes, as it will be possible to choose which terrain you delete, multiple terrains will be supported."

Does this mean that the new version will be compatible with Evolved's Deferred shading shaders (assuming the terrain shaders would require a bit of modification)?
kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 12th Aug 2009 18:03
They should work without modification anyway. Make sure that you run it in Texture mode 1 though. Which is default.

kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 12th Aug 2009 20:35
Update: Back on my PC now. Over the last few minutes, I got heightmaps to load. Now I just have to decode the data, split it and create some sectors!

kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 13th Aug 2009 01:21 Edited at: 13th Aug 2009 01:23
Ok, Quadmap generation is complete.

Heres a test for you guys.


Times to generate a 256x256 Quadmap.

BT 1.05 - 2 secconds (approx)

BT 1.06 - 16 millisecconds

Note: This doesn't include the actual generation of terrains, just build the internal structure and fill it with data. With the quadmap already generated, 1.05 loads maps of the same size in about 2 - 3 secconds. These will also improve but not as much.

Another Note: Quadmapping was added after the initial 1.05 release, and was not put into a proper released version. The Device Recovery demo utilises Quadmapping though.

BMacZero
18
Years of Service
User Offline
Joined: 30th Dec 2005
Location: E:/ NA / USA
Posted: 13th Aug 2009 03:21
Nice. That's what a rewrite gets you .



kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 14th Aug 2009 02:29 Edited at: 14th Aug 2009 02:30
Yep,

Quadmap generation is now done. Sector mesh generation from quadmap is also done. Build function is done. Continue build function is done.

heres a little extract from both dlls to show the difference in cleanness.

New:


Old:




I hope this wont put you off blitzterrain 1.05. just as a reminder, the above old code does the job very well and is bug free. It only means that building will be faster in 1.06.

The old code was generated by a dba - cpp converter, the new code has been handwritten by me .

I have moved alot of the sector generation into the build function, and that takes 16ms to load a terrain with the extra code included.

Texturing is in my todo list.

kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 14th Aug 2009 17:36
Sector generaton is now DONE!

Blitzterrain is now generating the objects for sectors!

N3wton
15
Years of Service
User Offline
Joined: 3rd Jun 2009
Location: Leeds, UK
Posted: 14th Aug 2009 18:49
nice

anynews when 1.06 is gonna be out?

I want to use it in my new project, so people can make there own maps...

yours
N3wton

kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 14th Aug 2009 20:36 Edited at: 14th Aug 2009 20:36
1.06 is TBA. It depends on how nice my mum is.

Blitzterrain 1.06 generates a 128x128 terrain in 94 ms!!!

Thats from make terrain function to the initialise terrain function. Build loop included!

That means you can generate 10 128x128 terrains in less than a seccond!

1.05 took 3 - 4 seconds.

Blitzterrain 1.06 is 40x faster at loading than 1.05!!

C0wbox
18
Years of Service
User Offline
Joined: 6th Jun 2006
Location: 0,50,-150
Posted: 14th Aug 2009 21:37
Quote: "It depends on how nice my mum is."

Err, what? - Did I miss something there?

Either way, on a serious/mature note - how does your mum affect the release of versions?

kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 14th Aug 2009 21:53 Edited at: 14th Aug 2009 21:58
She doesn't like me spending all my time programming. .

Just an announcement, I have now designed another algorithm.

Its called realtime Quadmap modification.

It will open up realtime exclusion (excluding/including) tiles on the fly.

Realtime Quad Rotation and Quad Reduction. Imagine an editor which calculates the detail of your hills as you edit them, and changes the detail of the tiles your editing in realtime!

I have designed the above. It will be put in later though.

N3wton
15
Years of Service
User Offline
Joined: 3rd Jun 2009
Location: Leeds, UK
Posted: 14th Aug 2009 23:13
Tell your mum its for the greater good!

or slip her a sleeping tablet in her coffee

Yours
N3wton

BMacZero
18
Years of Service
User Offline
Joined: 30th Dec 2005
Location: E:/ NA / USA
Posted: 14th Aug 2009 23:22
That'd be ironic .



kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 15th Aug 2009 01:55 Edited at: 15th Aug 2009 22:53
Right, no more updates for the second half of today unfortunately. I have spent the last few hours solving a weird bug. Its solved now.

Took hours because variables were just randomly blanking. Got stressed about it so I got a beer. Drank that down, 5 minutes later bug solved. Beer is excellent .


Here's a screenshot. Its not much, but it only took 1/10th of a second to generate. I don't get to see my awesome loading screen any more .

[image attached]

I shall have heightmapping working tomorrow

Attachments

Login to view attachments
kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 15th Aug 2009 22:13 Edited at: 15th Aug 2009 22:53
Say Hello to my little friend.

His name is HeightMapping!


[image attached]


Still a little poorly though...

Attachments

Login to view attachments
kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 15th Aug 2009 22:52 Edited at: 15th Aug 2009 22:54
Hes feeling better now.

[image attached]

I will introduce you guys to his sister next. Her name is texturing.

Attachments

Login to view attachments
kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 15th Aug 2009 23:20
I cant add texturing right now. Well I can but I have more important things to do first.

While developing all that I have also made it possible to run in DarkGDK. It compiles as a .lib with DarkGDK stuff, but I haven't tested it yet. Getting it work with GDK will be my next mission.

draknir_
18
Years of Service
User Offline
Joined: 19th Oct 2006
Location: Netherlands
Posted: 16th Aug 2009 11:13
awesome
kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 16th Aug 2009 13:08 Edited at: 16th Aug 2009 13:09
It now compiles for Dark GDK. It makes a terrain and returns its number which seems to be correct. I shall make a little Dark GDK demo.

The dark gdk version will be object oriented.

kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 16th Aug 2009 15:01 Edited at: 16th Aug 2009 15:04
Ok, heres how streaming is going to work.

The player position will always be at 0,0,0. This is because when floating points get high, floating point accuracy decreses so objects will begin to jerk. This means that the world must go past the player.



Heres a simple way on doing it.

When player moves into a different block call command

BT SetStreamPosition blockrow,blockcolumn

This will make the terrain engine check if any blocks need to be loaded/deleted and load/delete them. It would load blocks bit by bit.

This will cause the entire terrain to shift so the current block which was set in the above command is positioned at 0,0,0. This means that all your objects will need to shift.

You will need to stream your object data. (as in trees, buildings, etc)


Does that sound easy enough?

KISTech
16
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 16th Aug 2009 20:47
That's pretty much what I was expecting, and for all the same reasons.

kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 16th Aug 2009 20:52 Edited at: 16th Aug 2009 20:54
Cool.

This is how id like to make it load streamed terrains

BT LoadStream terrainid,"MediaTerrainStream%BLOCK%.stm"

When loading %BLOCK% gets replaced by a 5 digit number like eg block 1 would be in 00000.stm, Block 2 in 00001.stm, etc.

kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 16th Aug 2009 21:24 Edited at: 16th Aug 2009 22:18
Because I'm now using proper C++. I can take advantage of DBPros internals.

1 thing I can now do, is create all the terrains frames (container for meshes) in 1 go. Instead of creating one at a time and merging them.

Changes in structure:

1.05:

Loop through LOD levels
create mesh
Apply heightmaps and stuff
Endloop

Merge meshes using add limb command. (slow)


1.06:

Create meshes altogether

Loop through LOD levels
Apply QuadMap (fancy way on storing terrain data)
endloop



As you can see, the second one is a lot faster.




I had a bit of an off day today. Couldn't sleep last night so its been hard to concentrate all day. So I'm just going to call it a day early tonight and hopefully be more awake tomorrow. Sorry about lack of updates today.

kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 19th Aug 2009 14:43 Edited at: 19th Aug 2009 14:44
Sorry for no updates. I've been working like mad on a new feature. I'll keep it secret for now though... But I think you guys will like it.

Its my 16th birthday today. Having loads of people round so I doubt that I would get a chance to work today.

I shall have some cool features to show off soon.

kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 19th Aug 2009 19:25 Edited at: 19th Aug 2009 19:26
Just thought of a fast way to do frustum culling.

Its called QuadTree frustum culling. Instead of frustum culling every single sector, we can first frustum cull the whole terrain. If thats visible, we split it into 4 parts and frustum cull those. Some will be visible, some wont. The ones that aren't visible we will forget about, no more culling checks needed. Next we split the remaining boxes into 4 and cull them again. Eventually we get down to the last few sectors which are be visible.

This should improve FPS by Quite a bit. It will use logarithmic complexity instead of linear.



Linear complexity means the more elements the less speed

Logarithmic complexity means the more elements, less speed but the speed decreases less each time until it almost doesn't decrease at all.

kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 20th Aug 2009 21:18 Edited at: 20th Aug 2009 21:49
I just thought, why make people who dont use the RTMS have to keep a tonne of information which isnt any use to them?

So now we have a new command. BT EnableRTMS Terrainid,enabled. Disabled by default. If kept disabled, the system will optimise Quadmaps and delete Quadmesh data. Quadmeshes are blocks of memory generated from a Quadmap to Make or change a mesh. If you keep it disabled, and attempt to use the RTMS, the system will start allocating Qmeshes and deleting them straight after in your loop. Big slow down.

Quadmeshes were added on monday, so their quite new.

kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 21st Aug 2009 18:00 Edited at: 21st Aug 2009 18:04
I now made it so BlitzTerrain no longer uses the vertexdata commands. When making its objects it inserts all vertexdata and indexdata directly into DBPros internal arrays.

It generates a 512x512 terrain in 312 milliseconds, that's about 524000 polys!!

RAM usage has increased by about 25% since previous releases, but that's because of new algorithms which massively increase load and run speeds. You can reduce this by disabling optimisation.

BMacZero
18
Years of Service
User Offline
Joined: 30th Dec 2005
Location: E:/ NA / USA
Posted: 21st Aug 2009 18:04
Quote: "It generates a 512x512 terrain in 312 millisecconds, thats about 524000 polys!!"

Very nice!



kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 21st Aug 2009 18:12 Edited at: 21st Aug 2009 18:13
Thanks BMacZero


Everyone,
Quick demo attached. This is where I got the above numbers from. Please post your loading time!

Attachments

Login to view attachments
N3wton
15
Years of Service
User Offline
Joined: 3rd Jun 2009
Location: Leeds, UK
Posted: 21st Aug 2009 18:16
Looking good

Took 546 ms and i was getting around 110 fps

Yours
N3wton

BMacZero
18
Years of Service
User Offline
Joined: 30th Dec 2005
Location: E:/ NA / USA
Posted: 21st Aug 2009 18:18
I got 297 ms and about 130 FPS.



Login to post a reply

Server time is: 2024-11-23 13:55:47
Your offset time is: 2024-11-23 13:55:47