BSP and levels

Blitz3D Forums/Blitz3D Programming/BSP and levels

myspys(Posted 2003) [#1]
hiya

i'm starting to play with 3d-stuff, and my first "project" will be to duplicate quake 3 (yeah yeah)

loading bsps sounded perfect, 'cause then i can just rip the levels out and start from there

the level renders fine (VERY advanced ;) and everything works, but how do i detect if the player-entity has collided with for example a portal/teleporter or a "jump-thing"?

do i have to create invisible entities where those things are, and then do collision testing against those, or can i actually say "this item/part of the map is a jump-thing and has collision id 15" etc?

thanks in advance

/ d


jhocking(Posted 2003) [#2]
From your "yeah yeah" I assume you already know the first thing I am going to point out, that you shouldn't do something big like Quake for your first project.

As for teleporters and jump pads, there are a number of approaches, most of which are specific to one or the other (ie. they are different devices and must be handled differently.) For detecting when the player has entered a teleporter simply using EntityDistance will probably do. Just check EntityDistance between the player and every teleporter every frame. Or if that slows things down stagger the checks so that you aren't checking every teleporter in the level every frame. But EntityDistance is a fast command so unless you have a LOT of teleporters checking them all every frame is no big deal.

For jump pads you specifically want to check when the player is on top of and touching a jump pad. Depending on how you are coding player control there are two ways of detecting what is beneath the player: just using the built-in collision detection and commands like CollisionEntity, or doing a linepick straight down to detect what is below the player.


myspys(Posted 2003) [#3]
something like quake is probably too big, but i've been coding before, and it feels like a good first thing to do 'cause there are a lot of things to learn along the way. oh well, we'll see how it turns out :)


collisionentity would work very well, so would linepick, BUT if i'm going to use them i need to either make the jump pad pickable or give it a "collision id" (via entitytype)

can do that for the whole map, but don't think it will work very well if the whole map acted like one big jump pad ;o)


why should the different things be handled differently btw?
both should be "if player has collided with this unit, do action connected to this unit", or am i missing something?
the action has to be different, for obvious reasons, but the actual detecting of the player has collided..

thanks again

/ d


jhocking(Posted 2003) [#4]
It depends on how exactly you want teleporters to behave. Normally (eg. in Quake) teleporters are a volume of space whereas jump pads have to actually be stepped on. If you want your teleporters to be floor triggers just like jump pads than sure you can just use the same technique for both.

Of course you will need to ID devices like jump pads to distiguish them from the rest of the level. Were you asking how to setup those ID's? Because that depends on how you are creating the level. I don't think LoadBSP carries over entity information but I could be wrong; I've never used BSP maps in Blitz.

Hm, there may be a way to detect the texture of the surface collided with/picked. If you know this or that texture is always a jump pad that would work as an identifier.


myspys(Posted 2003) [#5]
that's what i was hoping to be able to do

anyone know if it's possible to tell which texture the player has collided with?

or if it's possible to say "all entries of this piece have collision number 10"? (via entitytype)
(from information in a BSP)


Neochrome(Posted 2003) [#6]
you know im working on a quake thinggy, tho its more Doom with puzzles. Big project, been ongoing since early 2002,

i found that having too many Collision ID's (entitytype) slowed the whole game down because, something to do with checking the whole games polys 10 or 40 times per frame, got a bit slow.. So i had to re-think.. I came up with naming the entities' Sounds like it would slow things down.. It does. But its a MASSIVE speed increase compared to doing Collision detects!

example. you have a few doors. each has a name something like "door_1" "door_2" and so on. but they keep the same collision type. in my case.. coll_world = 2 ;)

simply use the thing = Entitycollided(...) the thing var will contain the objects number and you can simply do t$ = entityname$(thing) and it will be the same.. as if you did collision types for each item.

Hope this helps


morduun(Posted 2003) [#7]
You =can= parse the BSP file manually without too much trouble. Long time ago I released a public demo that parsed out lights and area volumes and reintroduced them into the map as sprites and alpha'd cubes but I can't find it at the mo. I'l do some more digging if you're interested in this approach.

[EDIT] found it here. [/EDIT]


myspys(Posted 2003) [#8]
morduun, woooh. exactly what i was looking for

many many thanks to you :o)