Game Programming and Development Tools

General Opening Discussion – Phillip Martin

Phillip Martin
Member

Posts: 56
From: Yeppoon, QLD, Australia
Registered: 01-31-2001
Well, its a tad empty here, so I thought I'd post at least one message.

I just registered, so I thought I'd try and start some sort of discussion. Anything really, graphics, sound, networking, whichever. I'm open.

I'll try and start one discussion though. Myself and a friend of mine are discussing ways of allowing water to flow freely through a map, like a river, and allow the world to be changed and the water flows to appropriate locations. We've come up with a few ideas, but I'd like to hear anyone elses.

The current plan at the moment, is to check whenever a peice of terrain is modified, check to see if it is nearby any water, and if it is, extend the water surface in a flowing like fashion towards the new piece of terrain. No details yet, just the general idea.

Anyhow, look forward to contributing in the future.

Phillip Martin

Believer

Member

Posts: 80
From: British Columbia, Canada
Registered: 01-30-2001
Hi, I'm new here too... how long has this site been up anyway?

Your water problem is interesting. If you are building a 3D world a simple thing to do is simply have a large textured quad at a certain elevation that is as large as your whole map. If your terrain is above this plane then the water is invisible, but as you gouge out parts of the terrain and get it below the water level it becomes visible. Simple and easy and looks pretty good too (depending on your textures of course).

But that assumes all your water is on one level. If you want to have rivers and streams that flow downhill, well that's a bit more complicated ;-)

Phillip Martin
Member

Posts: 56
From: Yeppoon, QLD, Australia
Registered: 01-31-2001
No idea how long the site's been around, but I'm gla dI found it. Christian programmers are few and far between.

And yes, that is what would happen currently in my application. Instead of having just one large water quad, there's only water for parts of the landscape which go below water level, and as soon as that happened, then the water would appear. But as you pointed out, doresn't really work well for flowing water

Hmm. If the water was modelled in a similar way to the landsapce, specifiying slopes and whatnot, you could effectively model a sloped river. hmm. Might be interesting , and it might work too. Whack in some extra information for the speed of flow, and whack in some floating objects, and you've got yourself a flowing river look alike.

I'll keep on playing, thats fer sure.

Any other ideas? Post some other topcis on other things too if you feel that way inclined too!

Phillip Martin

Krylar

Administrator

Posts: 502
From: MD, USA
Registered: 03-05-2001
Heya...I'm not exactly sure when the CCN went up, but I believe it was near the end of July 2000. So it's not even a year old yet! I have to agree that Christian programmers are few and far between, so I hope you guys stick with us to help keep these boards alive

I have nothing to offer on the water stuff...3D is a bit over my head at this point, but I wanted to address the other questions.

Thanks for joining in on the talks!

-Krylar

------------------

joeG

Member

Posts: 90
From: OK, US
Registered: 01-20-2001
How much detail do you need? I remember the MechWarrior 3 demo used textures to simulate a flowing river. If that's enough for you then you can figure out an algorithm to find the direction with the steepest slope on a u,v height map, or even on the polygons (more accurate) themselves! Then you would create an animated water texture and slap it on the parts (using u,v mapping) of the landscape that were found to be candidates for your river.

But this doesn't account for rocks creating eddies in the flow, or for convincing splash effects. The solution lies with the wave equations and finding a more specialized solution for small amplitude waves that you are more likely to find in rivers. Or you can just concentrate on figuring out how to simulate the flow patterns of water and slap bump/specular maps on the surface of the water polygons to simulate normal waves.

I think you could do it, it just needs a bit more time to figure out.

joeG

joeG

Member

Posts: 90
From: OK, US
Registered: 01-20-2001
How much detail do you need? I remember the MechWarrior 3 demo used textures to simulate a flowing river. If that's enough for you then you can figure out an algorithm to find the direction with the steepest slope on a u,v height map, or even on the polygons (more accurate) themselves! Then you would create an animated water texture and slap it on the parts (using u,v mapping) of the landscape that were found to be candidates for your river.

But this doesn't account for rocks creating eddies in the flow, or for convincing splash effects. The solution lies with the wave equations and finding a more specialized solution for small amplitude waves that you are more likely to find in rivers. Or you can just concentrate on figuring out how to simulate the flow patterns of water and slap bump/specular maps on the surface of the water polygons to simulate normal waves.

I think you could do it, it just needs a bit more time to figure out.

joeG

Phillip Martin
Member

Posts: 56
From: Yeppoon, QLD, Australia
Registered: 01-31-2001
Thanks for the info and the welcome Krylar, it is much appreciated.

And if you have any 3D, or any general programming questions, don't forget to ask. Thats what the board is here for right!

Hows your Direct X adventures coming along (That seems to be among your most recent articles)? I just a quick look through your tutorials and stuff, and they are very good and well written. Thumbs up!

Have you got any information on the Christian game you are making? I'm really interested in it, and the ideas for it.

Phillip Martin

Phillip Martin
Member

Posts: 56
From: Yeppoon, QLD, Australia
Registered: 01-31-2001
joeG:

Yeah, you're right, I don't particularily feel like doing a general solution fluid simulator or flowing liquids, not really my field of interest right now.

Just getting a 'close enough is good enough' approximation is all I'm after. If I consider any obstacles to be just cynlinders in the water, it should be easy enough to work out a fudged way of getting objects and some textures to flow around it. I'll have a play with it when I get chance over the next few days, and see what I can come up with, and let you all know.

I'm not really after the perfect solution, I just wanted to fill out an empty discussion Forum

Believer

Member

Posts: 80
From: British Columbia, Canada
Registered: 01-30-2001
Ok, what else do you want to talk about (I've run out of ideas on the water thing - short of writing a complicated water flow simulation).

Perhaps we all should share a little bit about ourselves and see where that takes us?

I'll start. I'm 32, married, have a 9 year old son. I own a successful ISP business that allows me to work from home and gives me a little free time to work on fun projects (God has really blessed this business, I can talk about that too if you want). My latest fun project is the development of a 3D game engine based on OpenGL.

Over the years I've done a fair amount of socket programming and written various MUD/talker engines. The natural thing for me would be to make some sort of multi-player online game. The server and network side is the easy part in my case, it's the 3D graphics that I'm new to (but I think I'm doing ok so far).

My first idea for a "game" is a 3D talker - a chat system. You would connect to a central server where you could walk around a virtual 3D world and chat with other people. You could choose your "body" from a set of predefined ones, each with multiple "skins" to select from. Little or no actual gaming aspect (nothing to hunt or kill, no points to accumulate, etc). Just a friendly community atmosphere, a fun place to hang out. From time to time there would be special events in this world (firework displays, treasure hunts, etc.).

Another idea is similar, except it would be an online amusement park. Ever seen Sim Themepark? Or Roller Coaster Tycoon? Kinda like those but online. Again, mainly a social thing, but with rides and balloons :-)

As for my engine... Last week I wrote a set of ray casting routines for use in collision detection. Still a little more to do there though. I've done a skybox module that uses ray casting to determine if the sun is occluded or not, in which case it draws sunbeams and lens flares. Looks pretty cool.

I've also completed a large part of a skybox alternative, which is a sky dome. The dome accurately calculates the position of the sun, moon, and stars (kinda neat to be able to pick out real constellations), does sunsets and sunrises, etc. Not as fast as a skybox but more realistic. I'm debating which one to use in the 3D chat system.

I'm working on a model loader now, and world partitioning (I'm using what I called layered quadtrees - kinda like an octree but not quite). When this part is done I should be able to get a working prototype online.

Another thing I enjoy a lot, which will come in handy with my current project, is AI. I've played with various forms of AI since college. My forte was natural language parsing and recognition. This has allowed me to build "bots" that log into a MUD or chat system that talk to people in a fairly convincing way (it's amusing to watch through the eyes of a bot as a newbie strikes up a conversation with them :-)

Anything in all that interest you?

Mack

Administrator

Posts: 2779
From:
Registered: 01-20-2001
Welcome to CCN! Glad to have you on board!

------------------

Briant

Member

Posts: 742
From: Stony Plain, Alberta, Canada
Registered: 01-20-2001
Hey Believer,

Where in Canada are you? There's a surprisingly high percentage of us here.

About your 3D talker: that's a cool idea. You should check out firetalk.com, and see if their app supports plug-ins. They've got the audio chat thing already fully functional, and it's getting really popular. Another idea is developing it on top of ICQ, which is even more popular.

Bri

Phillip Martin
Member

Posts: 56
From: Yeppoon, QLD, Australia
Registered: 01-31-2001
I'm 21 years old, and I got married just over 1 month ago (Praise the Lord!) I've been working at a software company called Surpac Software for 9 months now. Its been an amazing blessing just getting that job. I live in the small city (<50,000) and you just can't find development jobs here.

It lets me work from home sometimes, so I can spend time with my wife, and the people I work with are fantastic.

I'm finishing off a mathematics degree now, taking care of my wife, programming, doing some more programming, and then to take a break I'll do some more programming

I've been programming since I was a youngster (yeah yeah, I know I still am ) and am mainly a 3D enthusiast. I unfortunately haven't done much lately as a lack of free time restricts me somewhat. I'm interested in just about every field of development, I even got excited about Design Pattern not long ago (In hind sight, I must have sounded silly, but it was really neat).

I'm interested in AI, but don't have much of practical experiece, lots of ideas, but no implementation to show off.

I've written a few public proggies, nothing that I'm proud of, but I hope to rectify that soon. I also have many many unfinished projects

Anyhow, thats pretty much me programming wise, as I can't think of much else.

[This message has been edited by Phillip Martin (edited February 01, 2001).]

Phillip Martin
Member

Posts: 56
From: Yeppoon, QLD, Australia
Registered: 01-31-2001
Howdy lads,

Would you like to expand on that Layered Quad-tree thing beleiver?

I was trying to think of what it could be, and in the context of landspaces the only thing I could think of is have multiple quad trees to allow to over hangs and tunnels and what not.

Or are you using it to subdivide the entire world in discrete slices?

I don't know, and its got me curious


Believer

Member

Posts: 80
From: British Columbia, Canada
Registered: 01-30-2001
Mack: thanks, glad to have found this place!

Briant: I'm on Vancouver Island in British Columbia. I'll look into the firetalk.com thing - thanks.

Philip: Congratulations on your recent marriage, that's awesome! I got married when I was 21 as well (11+ years now).

As for my layered quadtree thing... in most outdoor style maps a full blown octree results in a lot of empty nodes. I find that a couple of stacked quadtrees saves RAM and allows for some optimizations in my case. So the world is divided into, say, 64 x 64 sectors horizontally, but maybe 2 or 4 or 8 levels vertically.

Consider an object, placed into a quadtree or octree, that overlaps an edge or corner, meaning it's actually in anywhere from 2 to 8 nodes at the same time. How do we deal with this? One way is to split the object, but what if it needs to be movable? Another method would be to place a pointer to the object in each node, but again - moving it around can be a pain.

Instead I use a "loose" structure (search google.com for "loose octree" and you'll find lots of info that explain how they work. This means no splitting, no muliple pointers, etc. For speed I also pre-allocate all nodes in the structure, even if they are empty, which is why the stacked quadtrees are a win over a full blown octree for memory.

Phillip Martin
Member

Posts: 56
From: Yeppoon, QLD, Australia
Registered: 01-31-2001
Ahh yep, I understand. Thanks for explaining.

I found the absurd memory wastage of an octree a bit of adrawback too. One thing you might want to look at maybe is splitting an octtree on one plane at a time (producing two nodes), rather than splitting each node into eight more nodes. It would produce the result you are after, but it might not be worth the effort. Determining when you split along what planes would be a bit troublesome, but its something to ponder. Something for me to ponder one day too. hmmm.....

Thanks for the info on the loose octrees, mucho intresting. Slightly similar to what I'd come up with, but probably a fair bit easier. I was toying with the idea of being able to store larger objets on non-leaf nodes. I hadn't actually done it, so I can only guess at a few of the snags involved, but it'd be interesting to try. One problem wuld be unnessecary checking of wether an object is in a node or not (If an object is in a non-leaf node, we'd have to recheck every time if its in any of its children nodes) That would be a pretty big negative.

Believer

Member

Posts: 80
From: British Columbia, Canada
Registered: 01-30-2001
quote:

One thing you might want to look at maybe is splitting an octtree on one plane at a time (producing two nodes)

Yes, that's essentially what it boils down to (but then it's not a OCTtree anymore :-) I call them layered quadtrees. Same thing I guess.

quote:

I was toying with the idea of being able to store larger objets on non-leaf nodes.

My quadtrees do that. This gets a little hard to visualize because it's 4 dimensional, but here goes...

Each quadtree in the stack is actually a set of quadtrees. The first one in the set encompasses the whole world, the second level splits it into 4, then 16, and so on down to a predefined level. An object is positioned in the structure based on it's size (this determines which level in the quadtree pyramid it goes into), it's X/Z location (determines which square in the quadtree it goes into), and it's Y position (determines which layer in the quadtree stack it goes in.

Because it's a quadtree and symetrical, you can determine where an object should go with simple and fast math. Objects (in my worlds anyway) don't change size, so the level within the pyramid never changes, only the square and possibly the stack level. Because all the nodes are preallocated, it's a simple matter of changing a couple pointers to move an object from one to another.

Phillip Martin
Member

Posts: 56
From: Yeppoon, QLD, Australia
Registered: 01-31-2001
I understand. Its just how you visualise it that makes the difference I guess. Good idea though, and that particular explanation made a gerat deal of sense, so thumbs up, and thanks.

I'm writing a document for deforming meshes with bones and whatnot for a firend at the moment, hopefully it might turn into a nice friendly and readable document one day.

Phillip Martin