Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(1 edit) (+1)

I like your idea, although it is very hardcore and inherently ambitious (simulator).

A few comments about game and code: 

1) Relative to the rotation of the spacecraft. Although the possibility of direct activation of the RCS does exist, in fact, the rotation of aircraft and spacecraft is controlled either by setting the angular velocity or by setting the angle of rotation. In general, it would be good to develop a simple regulator for controlling the angular velocity of the spacecraft. 

2) And I looked at your source code, and I can say that you do not need to manually attach the activation of the engine to a particular button and there is no need for pre-manual distribution of thruster in directions, instead, in simple cases, you can use a dot-product to determine which engines are directed in the right direction for the desired movement and rotation, for example, like in my example in Activation method. I don't set any threshold in this example, because this script does not interact with physics, but is only needed for special effects, but you can set a special threshold (for example, if dot-product is greater than 0.5). This works well if your engines are directed orthogonally or collinearly to each other. You can see how this works in practice in the demonstration of my other old example.

(1 edit)

Thank you for your feedback!

Regarding comment 1: It's a great idea, personally I would add an option to turn the regulator on/off, I will certainly implement this if I continue the  project.

comment 2: Doing it manually didn't feel like the proper way but time was running short and I didn't spend it looking for a better way. Your solution sounds very interesting, I presume it only works properly with orthogonal/colinear engine setups as you said? Thinking about it I only use engines in this fashion so that wouldn't be a problem. Can it handle any number of engines at arbitrary positions/orientations? (all orthogonal/colinear of course)

(thanks for the source code, will look into it)

(+1)

This solution will work in any case. In other words, the engines that are necessary for the required movement will always be activated.

However, if, for example, you have asymmetric pairs of engines with different thrust and any angles, and you act on Rigidbody through engines as now, then there will be side effects. For example, you have right-hand engines: the first with 1 kN and the second with 2 kN that are located at the same distance from the center of mass, and if you use my dot product approach to get acceleration to the left, then both engines will be activated at maximum power, and in addition to the linear force of 3 kN, you will also get torsion. To avoid such side effects, dot-product alone will not be enough and in order to accurately determine what the thrust should be for each engine to provide the necessary torque and linear acceleration, you will have to solve the linear programming problem. Alternatively, use a direct impact on Rigidbody, and use thrusters only as a special effects emitter, and in this case, you will only activate special effects using dot-product. which will be logically similar to realistic ones.

(1 edit)

Thanks for the explanation!