Starborne Newbie Game Project Help

There is already a thread in the Works in Progress section outlining the idea of the game, so you should probably look at that to figure out what I’m talking about. Anyway, I’m a noob looking for assistance in making this sort of FPS/space sim. I just need help with…well, just about everything. I don’t really know where to start. I have done some tests, but it just doesn’t seem like anything I can do now is good enough to make it into the final game, so I’m kind of stuck just doing tests. I know I should learn Python, so I’m trying. Hopefully, if I get some replies to the other thread, I can figure out what I’m doing and ask about more specific issues. Thanks in advance!
Please help!

All right, first question. As you’ll know if you decided to spend half your life reading my Works in Progress thread, I am planning to use rather long blaster bolts so that a bolt’s position in one frame overlaps with its position in the next. The problem with this system is that if someone shoots into an object at point-blank range, the bolt will simply appear, and not move into the object. Consequently, it would appear to protrude through the target. Also, if I wanted the gun to spawn the bolt, the bolt’s center would have to be at the very back. Otherwise, I would need to use an empty that was quite far out in front of the gun. My current solution idea is this: The gun will spawn two empties at the muzzle. One empty moves at the same speed as the bolt object. One is stationary Either the gun or the empty also spawns a plane textured like the bolt, but this one is much shorter. It then stretches between the two empties until the empty has traveled a distance equal to the length of a bolt. (This would be done with a timer (maybe a property?), and I would match up the length of the bolt with a certain number of frames at the bolt’s speed.) The empties and stretching thing would then be destroyed and replaced with the regular bolt object. Unfortunately, as I don’t know Python (although I’m sort of learning) I don’t know how to stretch things, nor do I know how to set a timer (though that’s possible without Python, isn’t it?). Anyway, I’d appreciate thoughts on my idea and possibly methods for carrying it out, though it’ll likely be a while before I get to a point at which that’s necessary.

Hello Kaet
I’ll be glad to help you, but I’lll not read your “novel”, I’m a tired and lazy person!
So, please (re)post, one question/one sentence ( and use line break, please!)

Well, it’s a rather complicated question, and I had a proposed solution, and I wanted to know if it was valid. That’s why it was such a long post.

If you’re trying to do lasers, I would recommend Python without any empties (or just one). You would spawn the laser object from the gun end (or an empty at the gun end), and then stretch it via obj.scaling to equal the distance to the target, if it’s close enough (the distance is greater than the maximum length of the laser beam). Otherwise, set the beam to be the maximum distance.

Okay. Thanks. I’ll get back to you once I know Python and have some idea what you’re talking about. (Actually, I think I get what you’re saying. I was originally thinking of something similar, but the trouble with that idea as I understand it is that then there will be inconsistency. The beam will take a few more frames to get to one point if the target is close than it would if the target is further away. Also, I think it would look better if the bolt always seemed to grow from the end of the gun. Still, though, you probably know infinitely more about this than I do, so I will certainly keep your idea in mind.)

Okay. I thought about it a little more, and now I get what you’re saying. I thought you meant stretch over time. Sorry. Anyway, that solution is brilliant, and I’ll probably end up using it. Thanks.

Another question: So, if I use Python and I have ideally around a hundred fighters, probably less, plus capital ships with lots of turrets, and all of the fighters and turrets for each side have pretty much the same programming, could I just loop one script through them and it would be like having just one set of logic bricks?

Okay, new problem, since no one seems to be replying. I’m planning to use a track-to-nearest script for the fighters, but I read somewhere that the track-to actuator has an axis that it always tries to point up. This is resulting in somewhat 2D dogfights in my tests where every fighter has one target, and I do have 3D enabled. They do move up and down somewhat, just not much. So, is there any way to turn off that function with Python? Also, if anyone has a track-to-nearest script, I’d love to be able to use it. I am hoping to sell this game, but I’d credit you.


  1. Use near sensor to get hitObjectList. Check its team. No friendly fire.

  2. Sort that list using getDistanceTo.

  3. …after cheking rayCast. If LOS (line of sight) required.

  4. Turn that turret.

  5. Tanks using 2 rotation. The tusk (left/right), the turret (up/down)

  6. Use applyRotation until it reach certain accuracy using getVectTo.

  7. Aim further/in front of the moving object.

  8. Reload! Adjust fire!

  9. Good luck!


Well, I don’t really get all of what you’re saying, but the question is, how much overhead will this produce? I’m planning to have dozens of fighters and at least two turrets per capital ship (moved to simulate more). I don’t know if I’ll bother having the fighters and turrets lead their targets, but I probably will, as it would otherwise be difficult for them to hit anything.

Hi kaet I’ve been prototyping a large sale 3d space battle game. I too have reach the limit of the logic bricks, especially when dealing with tracking to objects.I fear its time to face the mighty python. I am hoping you can refer me to some if the materials you are or have been using to study the language sincerely a fellow blender enthusiast.

We’re in the same boat, my friend. I had some tutorials online, but I don’t remember what they were, as my dad found them. I’ll tell you as soon as I can ask.

Well, I’m also working on a space FPS/sim, but it’s indoors. Nonetheless there is a public blend that may help you. Go to the Latest Project link in my sig, and the first post has a link to the public blend.
In it are scripts (that you can use, or copy bits of) that handle weapons, damage, and so on.
If you want explanations, or for me to make a tut about any of the scripts, then just ask.
Soon there will also be some AI scripts in that blend, but they aren’t done yet.

Well, I think my damage system will be quite unusual (one-hit-kill in space, one-hit-kill on vitals on ground), but the scripts could probably help me understand Python better. Thanks a lot!

That’s way more realistic, but the way that I’ve rigged things is so that:

Each bullet has a property called damage
Each enemy/player has a property called Health.

Then the script does the rest!

OK Kaet, I see your stress, and I want to help you out…

  1. For the lightning bolt gun. If you have trouble setting a python script, use logics to understand how things run, then, later, once you’ve learned it, use python.
    Animate your bolt plane to strech, from 0 to maximum, ply this animation till it collides with an enemy object.
    Collision[enemy] inv. ==> and=> IPO: play (continue)

  2. I’ll eventually face the same problem soon, having hundreds of fighters… So far, what I have in mind is to use one script per group. The group could be a squadron or all objects from a capital ship group. So, the script will loop through specific objects. This is because I want the ships or enemies to shoot at the same target.

  3. In the same optics. Using the same logic, avoid the track to actuator, since it has that restriction. You can use a orient to object script, that could do a better job, but that will imply using python.

If you are like me, more an artist than a programmer, start doing your models, and do the programming later, or get someone to do it for you. Looking for scripts will be time consuming, and some times exhausting.
Since you are at the beginning, put your efforts into learning python, it will give you the freedom to do your own scripts.

I could spare some time to help you out, but you need to plan your project out, so that you know exactly what you need.
During you planning stage, get to learn python… I couldn’t learn it back then, otherwise, my project would have been much more advanced by now!
Good luck!

Oh, alirbaj, the tutorials were at a site called sthurlow. Thanks for the help, torakunsama. I haven’t been talking about any lightning bolt gun, though there probably will be one in the game. I meant bolt as in “blaster bolt”, not as in “lightning bolt”. However, that method will be helpful for beam weapons. As a matter of fact, I would advise against having multiple fighters attacking the same target. When I used track-to for that, it worked once, but in my current .blend, all of the fighters go into really close formation, and if there was collision damage, they would all explode. I plan to use a script that will find the closest object with the property “badfighter” or “goodfighter” and track-to, orient object to, or whatever needs to be done to it in order to attack. That was suggested by someone (I don’t remember who; it might actually have been you) in my WIP thread. This should make the combat nicely fluid and logical, so that evasive action will naturally flow from it. My only concern is that at the beginning of a fight, when the two fighter forces attack each other head on en masse (think Battle of Endor), they’ll all move toward each other and all sixty-some fighters will collide in a fiery crash. (I originally wanted something like a thousand, but really, sixty or seventy should be enough. The battles won’t be massive, probably with three battlecruisers against five with supporting smaller capital ships.)

The setup I was talking about should not use a track to actuator, nor will the ships be facing in the direction they are shooting. I just gave the possibility of various ships attacking the same ship, like a capital ship. Navigation scripts, must have priority over fighting…

So do you have turrets on your fighters, or will it be like in Battlefront II where you see a Vulture Droid flying beside you and shooting out the sides of its guns…? That’s… really annoying, especially when you’re in an interceptor and there are tons of bombers flying around shooting in random directions with guns that can one-hit-kill you…