Terrain destruction vol.3

Finally, physics destruction is completed, I have reduced number of triangles per object to necessary minimum by storing object envelope in it. Than when collision occurs I make geometric difference between ground and explosion vertices, in this example it is simplified circle, but it can be everything (just imagine laser which creates deep but slim holes – great for passing). Final concave polygon is triangulated. Graphics and physics store the same triangles and as far as that’s good for graphics is not as efficient for physics (convex polygons are better)

Another new thing is the animation, created using ExploTexGen. It can generate texture that contains  sequence of smaller images. I only have to manipulate texture coordinates to jump to the correct place – position of the next frame.

Here is video where you can see this news. In middle of film you can see bullet controlled by mouse (I stopped simulation then grabbed it) Ps. youtube screwed my video : (

Terrain destruction vol.2

After long break with posting ( caused by achieving bachelor’s degree – successful btw^^ ) I managed to create various holes in terrain.  Shape of hole can be circle, rectangle, convex polygon, concave also, generally every shape that can be represented by list of vertices. Here you can see circular holes (wire frame view enabled)

Previous Image
Next Image

You can see on pics that in some places there are unnecessary triangles. The algorithm is not optimized, it is based only on dividing into smaller triangles:

1.    Find triangles that collide hole shape in certain place ( bullet AABB test)
2.    For each found triangle:

–    A = triangle vertices, B = hole vertices
–    Make polygon difference (complement), output polygon C =A B
–    triangulate C and add to world triangles that we get
–    delete original triangle A

I still need something to merge multiple triangles into one bigger

First attempt to make playable game, real time world destruction

This video shows few new features:

  • player which is fully physically simulated, that mean he has limited power and if you try to push body which has large mass that can be difficult. I am not using bullet engine’s player controller, it is useless for me. I don’t know why people use it, writing own player logic based on rigidbody is simpler and works better. You  can ask, why you created player approximated by single sphere instead of ragdoll? answer is simple. I want that game will be focused on multiplayer. Synchronizing one body takes less bandwidth than doll( I believe ragdoll synchronization consumes 10 times more bandwidth, there are necessary synchronisations for each body part eg legs, feet, head, hands…)
  • real time world destruction – for now it works only for rectangular shapes, algorithm is very simple and I am little ashamed of it, it’s very ineffective(but works:P ) In future it need to be rewritten for custom polygons, it’s not so easy because of concave polygon appearing, so i will need some convex decomposition algorithm.Btw. it’s not like Minecraft destruction which is “fixed”
  • level layers, clouds are scrolling slower than main colliding layer
  • there are bullets fired by player but they are hard to see on this video( set 480p and fullscreen to better view)