caves fully made out of hmps

Posted By: broozar

caves fully made out of hmps - 02/17/06 13:18

hi all,
many of you searched for a method to make caves using terrains, but they failed with the ceiling. "hmp file format is a simplified mdl format, and to turn hmps, you must make them mdls first", was the main answer. but there is a better, faster way. i cannot believe i am the first one who thought of that... surely i am not.

look, this is a shot from the floor to the ceiling:

i know it is just an ugly test level... but look: both terrains are hmp files, the lower one has nothing applied, the upper one uses a simple effect -->
that is all the code:
Code:

texture entSkin1;

technique vegetation
{
pass p0
{
Texture[0]=<entSkin1>;
ZWriteEnable=True;
CullMode=None; // CCW when sigle sided polys, or None when double sided polys

ColorArg1[0]=Texture;
ColorOp[0]=Modulate2X;
ColorArg2[0]=Diffuse;
}
}



no more need to make it an mdl.
Posted By: ello

Re: caves fully made out of hmps - 02/17/06 13:31

better use CW or CCW in that case. none takes up twice the performance
Posted By: broozar

Re: caves fully made out of hmps - 02/17/06 13:34

yeah, but that´s the trick ^^ you can use both sides of the terrain, for the ground of the world AND ceilig for the cave together! so you don´t need 2 hmps, which would, in my opinion, slow the game down too... it was just an idea.
Posted By: ello

Re: caves fully made out of hmps - 02/17/06 13:38

oh, in that case you are right;) but. you shouldnt use the same texture for floor and ceiling. thus better use two passes, one with cw the other with ccw and use different effects/textures
Posted By: broozar

Re: caves fully made out of hmps - 02/17/06 14:04

yeah ^^ that´s a cool idea! gonna try it.

[edit] here is it, have fun

Code:

texture entSkin1;
texture entSkin2;

technique vegetation
{
pass p0
{
Texture[0]=<entSkin1>;
ZWriteEnable=True;
CullMode=CCW; //

ColorArg1[0]=Texture;
ColorOp[0]=Modulate2X;
ColorArg2[0]=Diffuse;
}

pass p1{
Texture[1]=<entSkin2>;
ZWriteEnable=True;
CullMode=CW;

ColorArg1[1]=Texture;
ColorOp[1]=Modulate2X;
ColorArg2[1]=Diffuse;
}
}


Posted By: mk_1

Re: caves fully made out of hmps - 02/17/06 16:36

That's even slower 'cause u use two passes.

ello meant you should use two different effects (one using CW and one CCW) for floor and ceiling.
Posted By: broozar

Re: caves fully made out of hmps - 02/17/06 16:46

he said "thus better use two passes".
separating the code in two is no deal- i just wanted to post it because i often read the request for an upside-down terrain. and, i learned sth. myself...

surely, in a game, i´d use two terrains, one with cw and one ccw, as you suggested, because it is unprobable that i´ll have to move transitionlessly from outdoor to a cave area.
Posted By: Pappenheimer

Re: caves fully made out of hmps - 02/17/06 19:30

Did you make a cave in a level with this method? Normally, there occure several difficulties until a new solution like this fits with the purposes of a level!

Walls with smearing textures at the walls comes to my mind when I think of terrains as caves!
Posted By: Gafgar

Re: caves fully made out of hmps - 02/17/06 19:52

why not use a model and polygon collision? ^^
Then you can have one model for both the parts .. and have a mother seam between them ^^
Posted By: tuschcarsten

Re: caves fully made out of hmps - 02/18/06 18:39

Polygon collision is very buggy in A6....
..I don#t like it yet... it has to be improved much..



...but cool Idea
Posted By: Matt_Aufderheide

Re: caves fully made out of hmps - 02/19/06 19:24

Quote:

Polygon collision is very buggy in A6....
..I don#t like it yet... it has to be improved much..





hmm, actually this is not true. polygon collision is perfect, I have used it in many projects, and have never seen a single problem. Try my SPhere Engine demo, the indise level is made entirely out of models and used poly collsion, and works perfectly. You can use C-Move and c_rotate to move, c_trace to trace, and so on. All these functions have worked flawlessly for me over and over.
Posted By: Gafgar

Re: caves fully made out of hmps - 02/19/06 21:41

The only situation there is problem with C_trace is when models have animations but that is still no problem except some script and some fps drop.. as long as the animation is no bone animation... (because then it is impossible to update the collision hull…)
(I told this in the bug hunt… so maybe it is fixed now… I don’t know…)
Posted By: tuschcarsten

Re: caves fully made out of hmps - 02/21/06 14:01

hmm my player model in carrottiminators gets stuck in some models with c_move and my.polygon = on;
Posted By: Gafgar

Re: caves fully made out of hmps - 02/21/06 14:21

It is very hard for the engine to calculate a collision between two entities with my.polygon set to on.
The only entities that should have my.polygon set to on should be the one really needs it.
It is always more CPU expensive to have my.polygon = on.
© 2023 lite-C Forums