Counter-Strike 1.6

I’m trying to create in my spare time one version of Counter-Strike 1.6, who want to help.

Project URL: PlayCanvas 3D HTML5 Game Engine

The project already has:

  • gsg9 model with the material, but not all animations
  • de_dust2 model without material

What needs to be properly implemented:

  • Player movement
  • Player animation

Future implementations:

  • Weapons
  • Shots
  • Flashbang, Smoke, etc

Looks like you’ve made a good start! :smile:

It seems you already have the animations for the GSG9. Looks like the capsule collision and rigid body components are missing from your Player model. That’s why he’s not moving around at the moment.

I can’t actively work on the project with you, but I’m happy to give advice on this thread whenever you need it!

There is to use the own model GSG9 to detect collisions? I believe this would help detect if the bullet hit the player.

The player already has these two: http://prntscr.com/9cs9l8

For hit detection in original game, they’ve had skinned model approximated by rectangles for different parts of a body. Bullet collision was calculated with those rectangles. Although player collision with level was simple cylinder.

You think I should leave the own model for hit detection or as the original? I believe that the more precise the better.

It would be nice if everything in videogame development was precise and accurate, but the reality is that you have to balance performance with accuracy. The priority is just to get something simple working first and then refine it. So maybe start with the player approximated by a capsule (in fact, you can use the actual capsule that represents his physical shape). After that, you could maybe improve it by using capsules around the characters bones. But start simple.

As for the problem of the character not moving, thanks for pointing out that the colision and rigid body components are there. But unfortunately, they are not on the player entity. You either need to have the player model on the entity with the physical shape or as a child of the entity with the physical shape. I believe what currently happens is that the capsule moves around but leaves the model (and camera) behind because they are not affected by it in the hierarchy.

1 Like

The problem is that it worked before importing the map. I do not know why it stopped working

Can you share the model file that fails to be uploaded?
And if console has any errors?

It gave no error, but I had to take a “Re-Import”.

Download: http://www.solidfiles.com/d/312113002f/

@will, @max

How do I add the shots on the walls? and How can I create the effect of blood on the wall/floor when the character is reached?

This is called Decals.
There is no engine-level implementation for decals.

What can I do to solve this?

Implement Decals :smile:
It is not an easy feature, there are various implementation techniques described in the web.

Easiest for now and the simplest would be simply create a plane in place rotated based on normal of surface, and fade that plane with time out, and then delete it. So that you don’t get too many decals.
For optimisation you can create pool of decals, lets say 64 decals. And reuse decals from it. If in scene already all 64, take the oldest (that is about to fade out and disappear), and rudely reuse it. That way it wont hurt performance badly.

1 Like

@max, how do you get the normal of surface where a raycast hit the mesh?

Check out the raycastFirst function:

http://developer.playcanvas.com/en/api/pc.RigidBodyComponentSystem.html#raycastFirst

The callback is passed a pc.RaycastResult object:

http://developer.playcanvas.com/en/api/pc.RaycastResult.html

That has the surface normal where the ray hits (property nam: normal).

Ah, that’s great, everything you need is there.

Thanks @will.

1 Like