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 / Terrain Maker / Generator and then walk on it

Author
Message
JackDawson
14
Years of Service
User Offline
Joined: 12th Jul 2011
Location:
Posted: 8th Sep 2011 06:58
@ WLGfx, sent you an email. Hopefully I can explain what I am doing in more detail that way.

@ Pincho, when your free and have finished up your other project, let me know and I'll explain more of what I'm doing. Good luck on your other project though.

"Life is like a box of chocolates.. eat it before it melts."
Pincho Paxton
22
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 8th Sep 2011 15:35 Edited at: 8th Sep 2011 15:37
Well I have a feeling that my ant project will take a year, and then tweaking it will take a few months. I also have another big project on hold. And I have a Visual Basic program that just needs tweaking.

JackDawson
14
Years of Service
User Offline
Joined: 12th Jul 2011
Location:
Posted: 8th Sep 2011 18:54 Edited at: 13th Sep 2011 19:52
If you guys are interested, I finally added the water shader.




And the updated source code ActiveTerrain-9-8-2011e.zip is attached to this post. I just need to work out a few glitches, but its working at least.

EDIT : Make sure to scroll down if you want the latest code.

"Life is like a box of chocolates.. eat it before it melts."
WLGfx
17
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 8th Sep 2011 19:17
Got your email Jack... Nice water shader. That's one of the things I'll have to have a fiddle about with, shaders...

So far there's 3 of us that can work on something. I can do most of the coding and even when it comes to C++, I'm quite good at that. Although I'm useless at graphics...

Warning! May contain Nuts!
chafari
Valued Member
19
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 8th Sep 2011 19:20
Awesome !! This is the faster water shader I've seen. I'll use it.

Cheers.

I'm not a grumpy grandpa
Mugen Wizardry
User Banned
Posted: 8th Sep 2011 19:24 Edited at: 8th Sep 2011 19:32
EDIT: WRONG THREAD 1! ><

CHECK OUT MY WEBSITE AT http://imageposeidon.com/ !
Mugen Wizardry
User Banned
Posted: 8th Sep 2011 19:27 Edited at: 8th Sep 2011 19:31
EDIT: DARN IT! WRONG THREAD 2!

CHECK OUT MY WEBSITE AT http://imageposeidon.com/ !
JackDawson
14
Years of Service
User Offline
Joined: 12th Jul 2011
Location:
Posted: 8th Sep 2011 19:47 Edited at: 13th Sep 2011 19:53
LOL its cool Mugen..

Ok, FILE UPDATED with new Zip file.

ActiveTerrain-9-8-2011g.zip

EDIT : Make sure to scroll down if you want the latest code.

"Life is like a box of chocolates.. eat it before it melts."
WickedVixen
18
Years of Service
User Offline
Joined: 28th Mar 2007
Location: New Brisbane, Utopia Prime, VGC GHQ
Posted: 9th Sep 2011 03:38
@JackDawson
This is truly impressive! I may be able to integrate this into an FPS-styled RPG of sorts... Maybe something super-simple, but nonetheless, it's a possibility...

Keep up the great work!

P.S. I am using U77 and I have NO BUGS.

JackDawson
14
Years of Service
User Offline
Joined: 12th Jul 2011
Location:
Posted: 9th Sep 2011 05:21 Edited at: 9th Sep 2011 05:22
Quote: "P.S. I am using U77 and I have NO BUGS."


Wait until you add items that cause a shadow. You'll see the bug. Its why a couple of us are sticking with version 7.061.


Quote: "This is truly impressive!"


Hey thank you. I appreciate it. I cannot take all the credit though. If it was not for some of the others on this forum, I would not have gotten this far. Again though, thank you for the kind words. Cheers

EDIT : It has a long way to go, but I am working on the textures for the terrain next up. As well as the day / night cycle.

"Life is like a box of chocolates.. eat it before it melts."
WLGfx
17
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 9th Sep 2011 14:12
@JackDawson - I'll probably have a good luck at how you've implemented the shadars in this because I agree, it looks so much nicer now. I've got a busy couple of days now before I get to work on my texture gradients which you can use if I get it working. Part 1 is done, mixing them.

Warning! May contain Nuts!
JackDawson
14
Years of Service
User Offline
Joined: 12th Jul 2011
Location:
Posted: 9th Sep 2011 15:04
@ WLGfx - One word.. SAAAAWEEEET !!

"Life is like a box of chocolates.. eat it before it melts."
WickedVixen
18
Years of Service
User Offline
Joined: 28th Mar 2007
Location: New Brisbane, Utopia Prime, VGC GHQ
Posted: 10th Sep 2011 23:17
@JackDawson:
It refuses to compile, but the executable works-- and that's the one I tested! It is truly amazing!

I will look forward to the next few revisions... LOL

JackDawson
14
Years of Service
User Offline
Joined: 12th Jul 2011
Location:
Posted: 11th Sep 2011 18:01
@ Anitarquious I

Quote: "It refuses to compile, but the executable works-- and that's the one I tested! It is truly amazing!"


Uhmm can you explain more as to why my code will not compile ? Give me the error report or something to see why it will not compile. Take a screen shot or something.

Also, it will compile from 7.061 and higher. However the 7.07 and higher it would not show the shadows correctly. ( Tested by several of us with version 7.07x already. )

Also you made the quote earlier :
Quote: "P.S. I am using U77 and I have NO BUGS."


And this contradicts what you said earlier. So now you have me confused what your doing.

"Life is like a box of chocolates.. eat it before it melts."
WickedVixen
18
Years of Service
User Offline
Joined: 28th Mar 2007
Location: New Brisbane, Utopia Prime, VGC GHQ
Posted: 13th Sep 2011 06:52 Edited at: 13th Sep 2011 06:59
@JackDawson... I did not have bugs, but I was using the application that you provided in the ZIP file-- No Bugs... O.o

No bugs at all!... Just recompiled it-- it went without a hitch-- and I was impressed with the speed it compiled! I had the folder open, the last time I tried, where your project resided. (That's gotta be closed for a proper build or compile & run. Works fine...

AS You've Mentioned: The shadows in U77 are incorrect. As stated, they are improperly rendered. Any reason why this happens, or is it a direct result of the Artificial Light (the small sphere) or the cubes? The cubes look solid but kind of ambient, was this your intention? I went over your source and did not find anything that would set the ambient nature of the cubes.

I'm thinking that it's a shader rewrite bug in U77 (wasn't a faster shader system one of the bug fixes in U77?), and that TCG may need to drop a quick patch to U77 (using the old shader parts of U76).

Didn't mean to confuse you there. >_< Sorry.

EDIT: Just checked your G version-- Nice Water shader!-- it works well and it's pretty fast. With my dual core HP it holds a good 125-145 FPS, but it doesn't seem to be too fast, even with the screen stat updates. GOOD WORK!

JackDawson
14
Years of Service
User Offline
Joined: 12th Jul 2011
Location:
Posted: 13th Sep 2011 14:20 Edited at: 13th Sep 2011 19:26
@ Anitarquious I -- Yea the shadows are not set by a shader. That is nothing more then the simple "set shadow shading on" command for each object. It utilizes the position of the main light. Since fog causes issues it makes me think its casting a light which is interfering with the main light in the scene. ( But this is only with the 7.7x versions. )

What I'm trying to solve right now is speed and optimization. I was going to change and add a lot of environment goodies with this. But speed turned out to be the problem. That and fog - AGAIN. It seams that Fog is not properly coded in DBP. Because its buggy when its being used.

What I'm trying to solve is how to use particles instead. And then maybe I can set it up as a Camera view only situation. But, that's proving more difficult then I originally planned.

The Ambiance of the cubes was all do to the distance of the FOG. IF you take the fog out, you will see the change. You can setup the fog to a further distance from your camera and when you walk up on the cubes, you'll see them without the ambiance.

One way or another I'll get this finished. Its just taking more time then I was expecting.

EDIT : Updated Screen shot to show you what I am getting. The water colors are now working. The underwater colors are now working. I put that purple sphere in there to show the shadow off the water. Apparently Fog does work, if I was using it correctly. Now that I can see what it can do in more detail, its working better now.



"Life is like a box of chocolates.. eat it before it melts."
JackDawson
14
Years of Service
User Offline
Joined: 12th Jul 2011
Location:
Posted: 13th Sep 2011 19:35 Edited at: 13th Sep 2011 23:29
Ok all. Here is the newest code. Now the thing is, I have changed some file names and I am in the middle of putting functions in their place. The MAIN.DBA file is supposed to be your main loop and global settings. Slowly this is getting more organized.

Two problems :

1.) Not optimized yet. I added the functions for multithreading that I'll use later. Those functions are not being used yet.

2.) The angle of the camera is effecting the position of the shadows on the water. Which it SHOULD NOT be doing. But I have not added the code yet to correct the problem. I'll work on that next.

Updated Code here : ActiveTerrain-9-13-2011a.zip

EDIT : By the way, if you notice I started a new thread here about this problem that is currently in the code.

http://forum.thegamecreators.com/?m=forum_view&t=189369&b=1



"Life is like a box of chocolates.. eat it before it melts."
JackDawson
14
Years of Service
User Offline
Joined: 12th Jul 2011
Location:
Posted: 14th Sep 2011 01:30 Edited at: 14th Sep 2011 01:46
Ok guys, updated the code thanks to Green Gandolf's Help with the camera FOV issue of all the cameras I had a hard time with.

UPDATE : ActiveTerrain-9-13-2011c.zip

Updated picture with shadows in the correct spot now.



"Life is like a box of chocolates.. eat it before it melts."
Mugen Wizardry
User Banned
Posted: 14th Sep 2011 01:41
Simply divine! Keep up the good work! And I am ENJOYING studying this code!

CHECK OUT MY WEBSITE AT http://imageposeidon.com/ !
JackDawson
14
Years of Service
User Offline
Joined: 12th Jul 2011
Location:
Posted: 14th Sep 2011 01:43 Edited at: 14th Sep 2011 01:44
You might want to re-download it again. I put up the wrong zip with the same name. Other one has been deleted and the good working one is now in its place. So its fixed now.

Quote: "Simply divine! Keep up the good work! And I am ENJOYING studying this code!"


Thanks man. Lot of working going into this. I hope that all the new ones can understand it as well. I'm trying to make it as easy to read as I possibly can.

"Life is like a box of chocolates.. eat it before it melts."
Pincho Paxton
22
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 14th Sep 2011 03:04
Looks really good! If you are wondering what to do next, Green Gandalf also worked on water breaks. These are the waves that come into shaw with a white froth effect. You might be interested in trying those.

JackDawson
14
Years of Service
User Offline
Joined: 12th Jul 2011
Location:
Posted: 14th Sep 2011 05:11 Edited at: 14th Sep 2011 05:13
Yea, I was working on a few things first for the water colors. Now the water movement needs improving. Here is a screen shot of my final colors.

And now for movement I will be needing to manipulate the Matrix of the water directly. That is going to take some work. I would however like to see GG's idea and see if it could help me out here.



"Life is like a box of chocolates.. eat it before it melts."
Mugen Wizardry
User Banned
Posted: 14th Sep 2011 13:44 Edited at: 14th Sep 2011 13:44
Can you make it so if an object falls into the water, all the vertices around it get distorted and it creates that water ripple effect? Just like real water?

CHECK OUT MY WEBSITE AT http://imageposeidon.com/ !
Mugen Wizardry
User Banned
Posted: 14th Sep 2011 14:03
Also, the water looks a bit distorted when looking at it up close

CHECK OUT MY WEBSITE AT http://imageposeidon.com/ !
Mugen Wizardry
User Banned
Posted: 14th Sep 2011 14:44
Ok, a few things. 1st. I've made it so that no matter what Y position the water is, it will ALWAYS detect whether or not the "camera" is above or below the water. 2nd. I'm having a problem adding my perfect camera following routine to the Active Terrains. I'm also having trouble positioning the player object.

Here's the code:



CHECK OUT MY WEBSITE AT http://imageposeidon.com/ !
JackDawson
14
Years of Service
User Offline
Joined: 12th Jul 2011
Location:
Posted: 14th Sep 2011 19:36 Edited at: 14th Sep 2011 19:39
@ Mugen Hey bro. . Remember what the definition of Hi-Jacking a Thread ? Well your now doing that.

Quote: "I'm having a problem adding my perfect camera following routine to the Active Terrains"


Please bro, start your own thread on this. My thread here is only about the status of Active Terrain, not about other subjects. This way it stays on topic.

Also, EDIT your last posts. You do not have to keep adding more and more posts when no one else has replied. So please man, instead of creating extra posts, just edit the previous post if not one else has responded after that post. Thanks man.

"Life is like a box of chocolates.. eat it before it melts."
JackDawson
14
Years of Service
User Offline
Joined: 12th Jul 2011
Location:
Posted: 14th Sep 2011 22:00
I got this in my email and yet I do not see the post here.

Quote: "The following reply was posted by ShaytariaII into DarkBASIC Professional Discussion to a thread you are watching:

It IS about Active Terrains "


But to respond to this, his post is not about active terrain. His post is how to use my code in HIS project. Not mine. So its why I asked him politely to make his own thread.

Just clarifying this.

"Life is like a box of chocolates.. eat it before it melts."
WickedVixen
18
Years of Service
User Offline
Joined: 28th Mar 2007
Location: New Brisbane, Utopia Prime, VGC GHQ
Posted: 15th Sep 2011 04:09 Edited at: 15th Sep 2011 04:55
@JackDawson
The newer version seems to be quite good (from the screenshots).
I am going to DL this and test a few things. (If it looks like I can manipulate your code (or get a better understanding from it), I'll start another thread and see what can be done...

Thanks!

[EDIT] I looked this over and tested it without adding anything. This is a great piece of code! Keep up the GREAT work! Once I get things set up, I will let you know. (Different Thread; Possibility of Many Questions. LOL )

JackDawson
14
Years of Service
User Offline
Joined: 12th Jul 2011
Location:
Posted: 15th Sep 2011 05:02 Edited at: 15th Sep 2011 05:38
Given time, I'll try to add more and more ( // ) comments to the source code to explain more of what it is doing. If you notice, over time, I have been adding comments all over. And I am trying to separate different parts of the code specific to what it is.

The globals are all over the main.dba. I am eventually hoping to have them with the dba file they are associated with. But that will take some time.

EDIT : I forgot to mention I am using 1.07.
I do not know how I got this version, but it works.. Even with the shadow color troubles I had earlier, it works correctly with this version.


"Life is like a box of chocolates.. eat it before it melts."
JackDawson
14
Years of Service
User Offline
Joined: 12th Jul 2011
Location:
Posted: 15th Sep 2011 09:34 Edited at: 15th Sep 2011 09:35
Hey guys, an updated and slightly altered / optimized version of the code. This time though, I set up the mouse so that it only rotates the screen if your holding down the left mouse button.

I also added more comments and organized the globals a bit better.

Enjoy

File Name : ActiveTerrain-9-15-2011a.zip

"Life is like a box of chocolates.. eat it before it melts."
JackDawson
14
Years of Service
User Offline
Joined: 12th Jul 2011
Location:
Posted: 15th Sep 2011 17:05 Edited at: 28th Jun 2012 07:08
EDIT : Scroll down if you want the latest version.
WickedVixen
18
Years of Service
User Offline
Joined: 28th Mar 2007
Location: New Brisbane, Utopia Prime, VGC GHQ
Posted: 16th Sep 2011 06:04
Works Great! Altered the "avatar height" and changed around a couple of things. Noticed that the FX on the water is squarish/rectangular. It's fine for a quick render, but for something a little more realistic, that may have to be changed... :/

Could the squarish water surface rendering be a problem with Direct X, DBPro 3D rendering or an anomaly with the FX you're using?

Also a bit of tearing of the water on the land when the land height is very close to the water's texture plane. It happens in several spots-- I can work with that with a health or an epilepsy warning-- so, no harm, no foul... (Unless this can be rectified some other way... LOL)

I also included another couple of files (nothing's been implemented as of this post) and I'm going to drop my accomplishments (and changes) to another thread, possibly in the WIP forum, as soon as I implement my RPG elements into the World you provided.

Thanks JackDawson! This works well. I have a toon shader .FX file, if you'd be interested. Just let me know.

Thanks again!

JackDawson
14
Years of Service
User Offline
Joined: 12th Jul 2011
Location:
Posted: 16th Sep 2011 09:14 Edited at: 16th Sep 2011 10:46
@ Anitarquious I : Appreciate the love bro.. yea the water shader will not look that bad once I add waves to the scene. You wont exactly see the squarish look.( in theory at least ) And I am on a REALLY slow laptop, so I am happy just to see what I have so far. Also, keep in mind, if your speaking about the youtube video, the game is a lot cleaner then what that video shows. I shown my friend the video and then had him play it on his 6 core. On my dual core laptop, I get roughly 80 to 95 Frames a second, currently. But on his, he had over 300. lol


Quote: "I have a toon shader .FX file"


I would definitely like to see that. Could be interesting in another project, if not for this one in some way.

"Life is like a box of chocolates.. eat it before it melts."
JackDawson
14
Years of Service
User Offline
Joined: 12th Jul 2011
Location:
Posted: 16th Sep 2011 10:45


Well thanks to a few guys who know more about programming then I ever will, I now finally have something that works WITH shadows on the matrix.

Big thanks goes out to all of you for helping me see this through.

You can now download the latest update : ActiveTerrain-9-16-2011a.zip

"Life is like a box of chocolates.. eat it before it melts."
darkvee
19
Years of Service
User Offline
Joined: 18th Nov 2005
Location:
Posted: 17th Sep 2011 05:31
Wow looks really nice JackDawson. Keep up the good work.

darkvee
WLGfx
17
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 17th Sep 2011 18:36
Yep, excellent work. I'll probably look into the shading code pretty soon. Thumbs up

Warning! May contain Nuts!
JackDawson
14
Years of Service
User Offline
Joined: 12th Jul 2011
Location:
Posted: 17th Sep 2011 23:25
Thanks guys. Yea.. I might stop with this thread now that it has water and shadows. Originally, with my first posting, I was not going to pursue past getting it working with land and water. But as I add other things I am seeing that this source code needs a LOT more optimizing. So I will be rewriting it again, from scratch, but this time I have some experience under my belt.

We'll see what comes next.

"Life is like a box of chocolates.. eat it before it melts."
WickedVixen
18
Years of Service
User Offline
Joined: 28th Mar 2007
Location: New Brisbane, Utopia Prime, VGC GHQ
Posted: 18th Sep 2011 13:03 Edited at: 18th Sep 2011 13:07
@JackDawson
Here's the toon shader. I hope this works for that project you mentioned.
I haven't used it on your water/terrain just yet, but I think I might try, just to see how this would look. ^_^

Enjoy...

The file is available to anyone who wants to use it. I did not create this shader, but I am working on a couple of others for another project.

JackDawson
14
Years of Service
User Offline
Joined: 12th Jul 2011
Location:
Posted: 18th Sep 2011 17:25
Much appreciated Anitarquious I.

"Life is like a box of chocolates.. eat it before it melts."
WickedVixen
18
Years of Service
User Offline
Joined: 28th Mar 2007
Location: New Brisbane, Utopia Prime, VGC GHQ
Posted: 19th Sep 2011 02:37 Edited at: 19th Sep 2011 02:39
@JackDawson, If you want to post a version of your terrain/water with this shader, I'd love to see it. Having a couple of issues with it loading, but I think it's on my end...

Found the issue! I had too many windows open! ^_^ O.o

JackDawson
14
Years of Service
User Offline
Joined: 12th Jul 2011
Location:
Posted: 19th Sep 2011 03:59
Quote: "Found the issue! I had too many windows open!"


haha. I have done that too.

Thanks for the shader. I might be trying it in another project though. Thank you though.

"Life is like a box of chocolates.. eat it before it melts."
WickedVixen
18
Years of Service
User Offline
Joined: 28th Mar 2007
Location: New Brisbane, Utopia Prime, VGC GHQ
Posted: 21st Sep 2011 05:03
Quote: "Thanks for the shader. I might be trying it in another project though."


No problem. I hope it will be useful...

Login to post a reply

Server time is: 2025-08-08 17:10:14
Your offset time is: 2025-08-08 17:10:14