binary zoo
Welcome, Guest. Please login or register.
Did you miss your activation email?
January 19, 2018, 01:32:39 PM

Login with username, password and session length
Search:     Advanced search
30178 Posts in 1158 Topics by 195 Members
Latest Member: dianeanderson
* Home Help Search Login Register
+  binary zoo
|-+  Game Development
| |-+  Guest Dev Blogs (Moderator: JDog053)
| | |-+  Small test of my terrains with a simple vehicle & suspension rig
Pages: 1 [2] 3 Go Down Print
Author Topic: Small test of my terrains with a simple vehicle & suspension rig  (Read 11848 times)
T_M_C
1000 XP
*
Offline Offline

Posts: 3000

TMC


View Profile Email
« Reply #15 on: May 22, 2012, 11:43:34 AM »

Aha, i've been sussed.

Guilty as charged Mlud.   Grin

Yeh, i've been coding, cough, the equivelant of, sphere on a matrix.   Shocked

Although it's a little bit more advanced than that.

I've coded my own first person camera and landscape routines.

But i havn't used the inbuilt Blitz commands like linepick but instead used my own point in polygon and point to plane routines to make it faster.

I've got an idea for an RPG.   Party based.  Think of, Legends of Grimrock, but with outdoor locations as well, and not tile based scrolling but smooth 3d.

I'd love to do an Ultima 7 style of game in 3d actually.

But it's very early days yet.  

I'm just experimenting and prototyping.

At the moment i'm stuck on texturing the landscape.

So, am fishing around for some tutorials.

Don't know if anything will come of it, but it's been fun so far.

TMC

« Last Edit: May 22, 2012, 11:45:37 AM by The_Masked_Coder » Logged
fog
Zookeeper
1000 XP
*
Offline Offline

Posts: 13185



View Profile WWW Email
« Reply #16 on: May 22, 2012, 02:55:49 PM »

Sounds good.  I sometimes wish I was more like you and could develop a variety of different genres.  I just don't feel inspired to tackle anything hugely different.  Tongue

I've coded my own first person camera and landscape routines.

But i havn't used the inbuilt Blitz commands like linepick but instead used my own point in polygon and point to plane routines to make it faster.

I've got an idea for an RPG.   Party based.  Think of, Legends of Grimrock, but with outdoor locations as well, and not tile based scrolling but smooth 3d.
You thought about raytracing?  Hardware being what it is it's a valid option these days, especially if you don't have a native 3D engine.

This is done using sprites in AGK and I like the retro Doom era look to it.  And for me the other advantage is it's quite pixelated so the artwork doesn't have to be great.


Logged

T_M_C
1000 XP
*
Offline Offline

Posts: 3000

TMC


View Profile Email
« Reply #17 on: May 23, 2012, 10:17:10 AM »

Quote
Sounds good.  I sometimes wish I was more like you and could develop a variety of different genres.  I just don't feel inspired to tackle anything hugely different.


Well, i guess you can only code what you want to code.

But i do find trying different projects helps to keep things fresh and keeps me motivated.



That Raycaster looks pretty cool.

I was actually thinking about trying a Raycaster type of system for an old school Out Run style game, but never bothered trying any code.
Those old school racers built the road from strips of horizontal lines and moved them left and right for the corners.
Pretty clever technique back in the day.

I've never done any Raytracing actually.  Which is rather strange i think, as it's one of those things that does interest me.

I'd still like to keep my graphics and techniques fairly low tech.

But at the moment i really like the idea of writing a sprawling 3d rpg.  It would be my biggest project to date though.  Over 5 years i reckon.

The landscape system i've got at the moment, creates a localised terrain mesh around the player, as the players moves throughout the world.
This allows for huge landscapes but only a relatively small 3d mesh.
All thats really needed is one large, memory resident, heightmap.

The trouble i'm currently having though, is that i want to assign different textures to different quads in that terrain mesh.
But the UV system doesn't allow for that, as verticies share UV coordinates.

So, i'm not sure how everyone else does it.  And i'm not having much luck finding any tutorials either.   Roll Eyes

TMC
« Last Edit: May 23, 2012, 10:20:59 AM by The_Masked_Coder » Logged
JDog053
Moderator
1000 XP
*
Offline Offline

Posts: 2421


View Profile
« Reply #18 on: May 23, 2012, 02:27:44 PM »

I did that for golf, but it was a massive hack! Tongue depending on what a quad was assigned to on the map, i'd offset the texture coordinates to display the texture. If I was to texture golf again i'd have used multi-texturing and better interpolation.
Logged
Prime_8
1000 XP
*
Offline Offline

Posts: 1438



View Profile WWW
« Reply #19 on: May 23, 2012, 04:24:27 PM »

sorry been busy ..
you should see the stuff Aarron put in ember re terrain texturing using 'splat' maps .

lots of what you want to do is a basic goal of ember .

but rites nowdepends your needs , if you use a shader or render textures you can

this i like ... http://wiki.splashdamage.com/index.php/A_Simple_First_Megatexture#Distribu tion_Pattern_2

oh just found this today ..
||
ehhehe http://g.co/doodle/fg7ayj
« Last Edit: May 23, 2012, 04:31:11 PM by Prime_8 » Logged

Prime_8
1000 XP
*
Offline Offline

Posts: 1438



View Profile WWW
« Reply #20 on: May 23, 2012, 04:55:47 PM »

TMC .
"
The trouble i'm currently having though, is that i want to assign different textures to different quads in that terrain mesh.
But the UV system doesn't allow for that, as verticies share UV coordinates.
"
\you need a shader .. that looks at the global texture.

the 'roving terrain , lets call it a skirt .  as it is like a huge skirt arround your player .
if i get you .. your localized mesh will scal height of each vert in real time .
here is the low tech thing ..
:: low tech ..
if you are sourceing one large texture that is the main color map of teh terrain .. the possibly some tilled details to support closeup details.

~ you know teh size of your virtual terrain .. be it memory res height map or noise table .
noise table will be faster that HM texture .  so load your map into a 2 dim array .

you need to code a small function to normalise your position x,z on terrain to match ,upper left os 0,0 and lower right is 1.0 , 1.0  .. 
you position getting function now returns accurate UV point in a main texture ..  ( and use multipliers to get teh UV of the tiled texure layers )
assume your skirt never rotates .. it's orientation on y axis stays 0deg .  so take teh vert position of each vert in your skirt .
use your realx,z coords to UV function , and update that verts UV data respectivly .
& if yo uuse a height map .. you can lookup the height at the UV coord . set that vert's Y height to that value in the height map or if like i do i use a perlin function that takes input in UV ( 0 - 1.0 ) . so how simple rite .

you now have a roving patch .

if you build height map table make a reading finction that lets you get value by normalised UV , with a choice of interpolation between the cells
ie uv is 0-1.0   on a height map of 1024x1024 ..    0.5 would give you 512 , of course .  but you can use a interpolation .. beteen table values .. so it is just a 2d lookup table.

:: now if you must have a unique texture on each quad , you will have to up your vert count by 4* simplemesh  - (1 row *2)
if you use a shader you can use distribution map on a mega texure ..
 or non shader , use ams formual + soem tricks you can use render to textuure .(slower)

confused yet ?

Logged

T_M_C
1000 XP
*
Offline Offline

Posts: 3000

TMC


View Profile Email
« Reply #21 on: May 24, 2012, 10:55:29 AM »

Thanks for the info guys.   Grin

Thanks for the explanations Prime.

I wanted to avoid using shaders as i'm currently using Blitz3d which doesn't support them.

I wanted to keep the system pretty low tech and retro.


The mega texture system seems really cool but is overkill for me.

Didn't John Carmack invent that, or at least uses it now for his games.


I did manage to find a gamedev article yesterday which suggested that the vert count needs to be increased to allow each quad to have it's own non shared UV coordinates.

Which makes sense.

But i'm thinking back to a landscape system i wrote in Dark Basic Classic, which bassically used seperate quad polygons for each landscape quad.

But this had problems where gaps would appear along the seams of each polygon.  Even when verticies shared the exact same world position.

So, i'm thinking that this might happen again if i up the vertex count in my landscape.

But i won't know until i try.

So, i'll code that and see what happens.

By the way Prime, that Google link points me to the inventor of the Moog Synthesiser.  ?

TMC
« Last Edit: May 24, 2012, 10:57:47 AM by The_Masked_Coder » Logged
fog
Zookeeper
1000 XP
*
Offline Offline

Posts: 13185



View Profile WWW Email
« Reply #22 on: May 24, 2012, 01:01:26 PM »

I wanted to avoid using shaders as i'm currently using Blitz3d which doesn't support them.
For some reason I thought you were using Bmax with no native 3D and that's why I suggested using raycasting.  Just ignore me lol  Tongue
Logged

T_M_C
1000 XP
*
Offline Offline

Posts: 3000

TMC


View Profile Email
« Reply #23 on: May 25, 2012, 11:05:23 AM »

Quote
For some reason I thought you were using Bmax with no native 3D and that's why I suggested using raycasting.  Just ignore me lol 


Lol.

Well, actually, my Quaternion stuff i had just written was all in Blitzmax, and i was using scaled sprites to represent the 3d.

It looked pretty cool and retro.

I did consider using Blitzmax with 3rd party 3d support, ( Blitzmax even supports the Blitz3d 3d engine ), but decided against it, as i know they all have issues of one sort or another.

So, i went back to the system i know works and is stable, albeit quite out of date these days with Blitz3d.



Anyways, the good news is i've cracked my terrain issues.

I ended up using a seperate quad ( 2 triangles ) for each terrain square, with terrain square verticies sharing the same world space.  Ie, overlapping.

This allows any texture to be mapped to the terrain quad as it's independant from anything else.

And i don't get the gaps in the seams where i thought i might.  Even at low resolutions.

I first tried using a multi texture.  ie, putting several textures into one image and then calculating the uv's for the texture i wanted within that image, but this showed up some seams where one texture bled into another.  Not good.

But the solution was really simple.

Just use single images as textures.

This also means the uv's are all in the range 0 - 1.  Which makes things very easy.

Last night i ported across my collision routines and can now walk all over my terrain, even with slight camera bob.

It meant rewriting the system to use terrain quads instead of terrain verticies but it's a much better system for it.

I'm really pleased with the terrain system.  It's easily the best i've written to date.

Now i can have huge landscapes to define my world.
As all thats needed to define the landscape is a 2d heightmap array.

And i can seamlessly traverse the world.  Walking from one end to the other continuously.


The next things i want to add are some mods to the controls.

I want to implement the World Of Warcraft system.

This has 2 modes.

Mode 1 is your standard fps controls.

Mode 2, is when a mouse button is held down, and the player has free look, but his direction of travel doesnt change.

Combine this with auto run and you can glance around at the scenry as you carry on in the same direction.

It sounds quite trvial, but i found it to be an awsome game mechanic.

Very easy and intuitive to use.


I also need to implement jumping too.


I suppose i ought to start another thread for this.   Tongue

TMC


Logged
JDog053
Moderator
1000 XP
*
Offline Offline

Posts: 2421


View Profile
« Reply #24 on: May 25, 2012, 04:41:30 PM »

I got the bleeding aswell, but i'm sure there is a clamp option?

That aside, glad you've solved your issue! Smiley
Logged
fog
Zookeeper
1000 XP
*
Offline Offline

Posts: 13185



View Profile WWW Email
« Reply #25 on: May 25, 2012, 06:15:38 PM »

Mode 2, is when a mouse button is held down, and the player has free look, but his direction of travel doesnt change.

Combine this with auto run and you can glance around at the scenry as you carry on in the same direction.

It sounds quite trvial, but i found it to be an awsome game mechanic.

Very easy and intuitive to use.
Yeah I like that gamepad FPS controls let you freely look around while moving in any direction.  That's quite hard to do with keyboard & mouse.
Logged

T_M_C
1000 XP
*
Offline Offline

Posts: 3000

TMC


View Profile Email
« Reply #26 on: May 26, 2012, 10:39:12 AM »

Yeh, i have options in Blitz3d to clamp the textures too, but it didn't make any difference.


Last night i couldn't sleep, so cured my insomnia by doing a spot of coding into the early hours.

I've now got my World Of Warcraft camera modes in place and working well.

This has a cursor on screen which will be used to highlight in game characters and objects as well as menu items.

Left clicking the screen enters normal fps mode and right clicking enters free look mode, which springs back the camera yaw to the direction of travel when released.

It works quite well.  It's a pity i dont have wow installed so i can compare it.

I also added jumping which works well too.

I have a small issue, where running down a slope, steps the camera down, as the camera is moved horizontally, thus it repeatably gets airbourne.

I'll have to modify the code that moves the camera along the plane of the landscape polygon.

I think i've come up with a way to do that.


I also coded a mesh smooth routine.

This is a filter that turns a random spiked terrain into a terrain of smooth rolling hills.

It was just a case of averaging heights in the heightmap based on a 9 nearest neighbours algorithm.

Was really easy to implement and creates great looking plains.



Another issue thats arisen, is that the lighting system in Blitz3d is pretty rudimentary.

And any kind of lighting, although produces darkened shadowy areas behind the hills also shows up texture seams.

Turning off the light, gets rid of the seams, but i lose the shading.

Not sure what to do about it.

As i can't see a solution at present.


TMC
Logged
Prime_8
1000 XP
*
Offline Offline

Posts: 1438



View Profile WWW
« Reply #27 on: May 26, 2012, 08:31:15 PM »

wow great stuff,

:: a good engine should never show gap where 2 edges share same end point vector locations ..

i think i shoudl whip up dispersion pattern map system that uses render textures or daynamic textures.

use one big blending texture and smaller belnd patterns . but do / calculate the tiles in ram and apply them . 

( quads with unique verts is very handy if vert count is irrelevent , and can auto cull , optimise in some 3d engines. )

what i got done on my current team project ::
Logged

T_M_C
1000 XP
*
Offline Offline

Posts: 3000

TMC


View Profile Email
« Reply #28 on: May 28, 2012, 12:05:12 PM »

Nice Video Prime.

 Grin

TMC
Logged
Prime_8
1000 XP
*
Offline Offline

Posts: 1438



View Profile WWW
« Reply #29 on: May 28, 2012, 03:07:59 PM »

how much detail do you need in your shadows ?
& do tehy need to be realtime dynamic ?  ( sun / light source move relative to terrain )

if sun is static relative to your terrain .
place a top down camera over your terrain (without textures, and set vert /mesh color to white , just geometry ) in isometric view .. tunr on your light .
grab teh pixels of the view your terrain is in to a image or array and save to tga or such .
now set a 2nd or extra UV set / layer for your terrain .. where the UV is spread evenly without tilling over whole terrain .
ie terrain TL is 0,0 and BR is 1.0,1.0 UV .

now apply that texture to your terrain ?/ tiles  in multiply , or multiply bright ..

( see my terrain tool ans that is how i bake my light maps )
Logged

Pages: 1 [2] 3 Go Up Print 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines
Simple Audio Video Embedder
Valid XHTML 1.0! Valid CSS!