Let's rock

posted in Blue stain for project Shoot
Published March 06, 2016
Advertisement

Hi.
I don't have a lot to show this time. I fixed a few things and added others. Here is the list in no particular order:
- Disable light when linked object is no more active. The bug was visible in the latest video.
- Corrected weapons group activation. In the previous video, a weapon was not shown because the activation was not correct.
- Added guided missile weapon type (for players and enemies).
- Corrected pattern following. The optional pause at any control point was working only when at the first control point.

For the guided missile weapon type, it was not really difficult: in the same manner I have a pool of objects instances for shots, I added a pool of patterns (like the ones used to move objects in the demo menu and enemy ships in the level) consisting of only two control points. The first point is always <0, 0, 0> and when a guided missile is fired, I update the first control point tangent to be the "X" vector of the weapon, the second point to be the position of the target and its tangent to the vector "target - weapon". When the shot object is updated, if it has a target, I keep updating the second point of the pattern to match the relative position of the target. All the movement is done by the existing code for pattern following. The added code is small and it is working quite well.

I also played a bit with Blender. I wanted to rework my rocks. I had a simple way to create one (I may have seen it somewhere but I don't know where) and finally did a small script to generate it automatically. The method is:
- create a cube
- create a plane
- rotate the plane and move it away from the cube centre
- cut the cube with the plane
- repeat with more planes
This is a very basic method but it gives what I need. I added a few things:
- the resulting object is bevelled
- a parameter allows to smooth or not the final object

Here are rocks generated with this method in only one action:
[sharedmedia=gallery:images:7267]

I attached the script if someone is interested. Maybe I will add a UI to set the parameters instead of modifying the values in the file. Just load the file in the text editor of Blender, empty the scene and hit Alt+p.

Have fun.

Previous Entry Pick-ups
Next Entry Effects
7 likes 2 comments

Comments

JTippetts
Nice job on the rock script. It is a lot easier than doing all the slice planes at once.
March 07, 2016 08:52 PM
alfith

Thank you.

I noticed a typo in it, the rotation matrices creation should be:


mrwx = Matrix.Rotation(rx, 4, Vector((1, 0, 0)))
mrwz = Matrix.Rotation(rz, 4, Vector((0, 0, 1)))

The vectors are probably normalized before being used but it is better like this.

March 08, 2016 05:41 AM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Profile
Author
Advertisement

Latest Entries

Not my game but...

1467 views

Spaceship update

1793 views

Big WIP

2245 views

Late creation

1314 views

Hidden gold

2132 views

Effects

2348 views

Let&#39;s rock

3215 views

Pick-ups

2368 views
Advertisement