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.

Code Snippets / Huge Memblock Terrain & Editor

Author
Message
Syncaidius
19
Years of Service
User Offline
Joined: 22nd Mar 2005
Location: United Kingdom
Posted: 18th Apr 2006 12:04 Edited at: 18th Apr 2006 12:06
Ive been working on this project for quite a while now. I've created a way to create a big memblock terrain (180064 Polys) while still being able to maintain 215 Frames per second. This may run slower on computers with lowers specs than me.

The terrain also includes a cursor which you move around on the terrain to edit it. while you edit the terrain, the FPS drops to 38, but for me that is still sufficient. Again, this may run slower on computers with lower specs.

It works by creating the terrain, block by block. Then to increase performance, the blocks that are not visible, are culled/hidden (by DBP automatically).

If the terrain doesnt perform very well, you can reduce the values of the variables (found near the top of the source) to make the terrain smaller.

The terrain isnt textured yet because I need to find a way of texturing it without sucking too much of the FPS.

I dont know how well this may perform on other peoples computers, so
some kind of feedback would be nice.

Currently working on WORLD, a free world editor for DBP and another world building tool for the OMMORPG project!

Attachments

Login to view attachments
Syncaidius
19
Years of Service
User Offline
Joined: 22nd Mar 2005
Location: United Kingdom
Posted: 18th Apr 2006 18:04
I dont know if anybody has checked this out yet.......

Currently working on WORLD, a free world editor for DBP and another world building tool for the OMMORPG project!
Yarbles
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Toronto
Posted: 18th Apr 2006 18:12
It crashes for me.

But I haven't upgraded to the latest version of DBPro yet.

Syncaidius
19
Years of Service
User Offline
Joined: 22nd Mar 2005
Location: United Kingdom
Posted: 18th Apr 2006 18:14
did you have the required dll installed?
I did include it in the zip file. It needs the 'matrix1extend' dll to work.

Currently working on WORLD, a free world editor for DBP and another world building tool for the OMMORPG project!
Yarbles
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Toronto
Posted: 18th Apr 2006 18:20
Yeah I did, and the example in the zip file works for me, but your code in "Memblock Terrain.dba" crashes at compile time without an error. I'm still using u5.8 though.

Syncaidius
19
Years of Service
User Offline
Joined: 22nd Mar 2005
Location: United Kingdom
Posted: 18th Apr 2006 18:25 Edited at: 18th Apr 2006 18:30
I compiled it with u6.0 - RC6, maybe thats the problem, or maybe not.... I dont have any idea why it crashes

Currently working on WORLD, a free world editor for DBP and another world building tool for the OMMORPG project!
RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 18th Apr 2006 20:42
I was able to get it to run with 5.8. But I get this weird grey-out area everytime the matrix is edited (see attached pic). Great work DBKing. Looking forward to seeing this evolve.


Open MMORPG: It's your game!

Attachments

Login to view attachments
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 19th Apr 2006 04:08
Yeah looking great. Just needs a little better mouse/ corsor control (keep mouse on terrain/ in screen). Also this culling code may help if your terrains are made of limbs (haven't looked at all of the code yet):

http://forum.thegamecreators.com/?m=forum_view&t=67369&b=6

Syncaidius
19
Years of Service
User Offline
Joined: 22nd Mar 2005
Location: United Kingdom
Posted: 20th Apr 2006 20:48 Edited at: 20th Apr 2006 20:54
Does anybody know how to create polygons which share some of the same vertexes using memblocks?

The terrain was created with polygons having 3 vertexes each, which is what is killing the frame rate when you start to edit the terrain...

Maybe if I can get polygons to share polygons, the whole thing might run quicker. Here's a basic picture of what I want to do:


When I create a model in 3DS Max, convert it to an X model, it's adjacent polygons share vertexes with each other. I just dont know how to do this using memblocks...

EDIT:
@Lost in Thought:
If I decide to use limbs with the terrain, your fustrum culling code will be the first I have a go at using.

@RiiDii:
Errm... thats one of my stupid mistakes, I forgot to remove the texture that I tried to apply to the terrain... I still have to write proper UV values, but for now, I'm working on this shared vertex thingy

Currently working on WORLD, a free world editor for DBP and another world building tool for the OMMORPG project!
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 20th Apr 2006 22:41
Quote: "Does anybody know how to create polygons which share some of the same vertexes using memblocks?"


Can't be done with memblocks in DBP (though I think you can in DBC oddly enough). It would have to have a face index in the fvf format which it doesn't. You can however make your tiles in a modelling app and use the new vertex commands on them instead of memblocks. Or use a modified version of my .x exporter code that can share verts and then reload the model. At present I left out the vert sharing in the export because I was too busy to finish it 0_o

Login to post a reply

Server time is: 2024-11-27 00:07:54
Your offset time is: 2024-11-27 00:07:54