Posted: 26th Oct 2003 23:20
Sorry about the smooth stairs its an invisible wedge in cshop. My geforce 2 gets about 40 - 60 fps with the lightmap on.
Posted: 27th Oct 2003 1:45
Ahh, the invisible ramp trick. And yea that's about the same fps as mine when I'm in 16 bit mode, 32 bit slows it down. How difficult is it to export a .x light map from cshop? There doesn't seem to be a lot of info on it in the cshop forum.

gbuilder.
Posted: 27th Oct 2003 1:45
Any chance you can make an exe of it? I cant compile it without DBPro.
Posted: 27th Oct 2003 2:13
Exexutable Versions
http://stateproperty.users.btopenworld.com/lmxcol.zip

To export a light map after creating a light I used dreamflower's .x exporter and it makes all of the files for you, then I just used the code in the source to load it.

http://www.dreamflowers.org/
Posted: 27th Oct 2003 7:02
The few things I don't like about the the re-work code is that gravity is now at a constant rate. This isn't very realistic. It will make ramps smoother, but I like the realism. Second, now if you accidentally walk off the map you fall forever. And finally I hate "WASD" controls. I only use mouse for movement in any FPS.

I do like the "invisible ramp" for stairs. I was too lazy to do that. Besides, I don't think it makes too big a difference in a finished game. Nice work though.

-Kensupen
Posted: 29th Oct 2003 17:34
OK tried this new one and I think :

o Get rid of the magnetic gravity - too unrealistic and it annoyed me, being sucked to the ground when I fell off the bridge.

o Keep the ramps for stairs gimmick - at first I thought this looked a bit iffy, but realised many commercial games (Max Payne being one) used this method. Only drawback is on stairs where each step is longer eg
+ Code Snippet
-------------
              |
              ---------------


o Major bug found when you walk into the corner opposite the gap where you can fall off the map. Screen starts to stripe and flicker-very bad!!!
Posted: 30th Oct 2003 0:51
"I only use mouse for movement in any FPS."
what about strafing?
what FPS use only mouse...?
Posted: 31st Oct 2003 2:18
question:
will this collision code only work for one .x model?

only object 1 recieves collision. The rest of the models have no collision. i originally thought the collision detection deteced for any model, not just your world
Posted: 1st Nov 2003 7:03
The way the code is written now is that only one object is getting checked for collision. If you wanted to have a huge level, you'd have to split it up and write a function to find out which object number to pass to the collision code. You can use ANY model. It doesn't have to be the one I made or made in any specific program. I tried one from Milkshape and CShop. Both worked fine.

To answer the "strafing" comment. I use a really screwed up key combo. I have "s" for walk backwards and "z" is strafe left "x" is strafe right. I use the mouse to look, walk forward and shoot/act.

-Kensupen
Posted: 1st Nov 2003 21:57
Will using more than one model ata time for collision hurt the speed a lot?

I was going to use the collision code for the buildings in my RPG (they arent simple).. i will have around maybe 100 buildings in the game... i cant put them all into the level model because new ones are built and some get destroye

is there a way for the code to detect all .x faces no matter the model?
Posted: 1st Nov 2003 22:12
The more times you call my collision code per do/loop the slower it is. My roommate came up with a good solution. Do a distance check for each object and only check collisions one the one(s) you are close to. This will keep the FPS up and still give you collisions with all objects.

-Kensupen
Posted: 2nd Nov 2003 8:45
Sounds like a useful way to do it, any chance of an example piece of code..?

gbuilder.
Posted: 2nd Nov 2003 17:34
Heres example on counting the distance of two points in space. Its only X and Z axis tho, but you can improve it.

+ Code Snippet
rem Get The Distance
distance# = SQRT(((playerx# - objectx#) * (playerx# - objectx#)) + ((playerz# - objectz#) * (playerz# - objectz#)))

rem And this is self explanatory....
If distance# < 500
GOSUB collision
endIF


Then u'll need to make many routines for the different objects. Function would be much more wiser to do. I could convert it into function If I have time. Or someone else can.

Hope this helps, and please aks for more help!
Posted: 3rd Nov 2003 14:28
Has Anyone been able to get this code to work not beinging in first
person? I perfer 3rd person view any day over first. I tried nuclear-
glory's dll and got the same result as this code. Has anyone ever
made a good game with dbpro in 3rd person?
Signed,
Frustrated
Posted: 4th Nov 2003 16:47
My game has a zones thing, in which I would only check for collision if the building object is in the same zone as my character. My question is, how do i decide which object i want kensupen's collision code to check?

thanks
Chris

edit: by zones i dont mean zones like EQ..in my game i classify it differently. when you load a map/level, the whole map area is called a region, and it is subdivided into square zones. if a model is in your zone or next to your zone, the ocmputer calculates his stuff.

another edit: i can check collision for more htan one object at a time right?
Posted: 5th Nov 2003 2:24
I have made a demo of sort like you state here. I have a massive level (.X) and I divided it into 36 smaller squares. What you'd have to do is figure out which model number you are over/on. (The model number of the smaller piece of the region) Then use the collision code against that model number.

You can call this code as a function as many times as you like, but it slows down massively when the intersect object is used more than 25 times/loop. My check does 9, so you can prolly call it 3 times without too much FPS loss.

I think you can append one model to another to make everything you load (trees, barrels,etc.) to become part of the level at load time. I'm not possitive or even sure how to do it. I usually just make everything into the level that I want collision against.

If I ever find the time, I'm going to make a QuakeII or Counter Strike type single player deathmatch demo. I'm going to use my collision code, make the level in CShop and it will have operations doors and lifts. You will have to interact with levers/buttons also. I may do a rescue the VIP type. All depends when I find the time and/or get bored enought to start it.

-Kensupen
Posted: 5th Nov 2003 22:59
kensupen where is this demo?
Posted: 6th Nov 2003 5:41
Look Mom... no bubble sort!

You really don't need it since you just need to know the one direction that has the closest intersection...
Posted: 7th Nov 2003 5:50
I never released the demo of my massive landscape because I couldn't get it to look ok. The textures and normals were all hosed so I stopped working on it. The functionality was all there, but I never went any further. I explained everything I did in that program above.

-Kensupen
Posted: 7th Nov 2003 9:04
By the way... great work Kensupen!

Do you think without the overhead of the bubble-sort, that you could do many more intersection calculations than before?

I tested your code on one of my own .X CShop levels and it worked very nicely. This is SO very cool!