Req: Engine

Just wondering if there are any tutorials on a god engine?
Have seen Mr.White’s tutorial, but i know there’s a better design :slight_smile: An inline or someting smaller than the V4 big box thingy :smiley:

Thanks in advance :slight_smile:

Short stroke seems to give good power.

The easiest thing is perhaps to follow Adam’s or White’s tutorial, play around with stuff and when your design is good, tweak it.

But i can’t figure out how to add more pistons, Bearing of the crank and so on.
I totaly suck at E2 :open_mouth:

every piston works within a 180 degree radius within a circle: meaning half of the crankshafts turning circle, the piston pushes and the other half it it pulls (if it is bidirectional).

I’ll use my newest engine as an example:

Here I’m using two pistons with 180 degree difference in the angles…
always use piston one as reference to the following pistons: piston one is 0 degree along it’s path as it starts fireing: then piston two fires 180 degree after piston 1, and so it continues along the circle.

a code example can be:



if(Bearing>0&Bearing<180){Piston1=thrust}


or my own code:



Piston1=((cos(Bearing)^3)*thrust)


a two piston engine is rather weak because it has two “blind spots” the point of adding more pistons decreases the blind spots by adding the pistons with equal amounts of degrees between each piston.
General rule of thumb : degrees between each piston = 360 divided by number of pistons

[media]http://www.youtube.com/watch?v=jdAo5zuqAzs

It doesn’t always work… WHYYY!! snip

http://operatorchan.org/v/src/v43939_engine%20Lycoming%20XR-7755%2010-ft%20long-%205-ft%20dia-%205000.jpg

****Where is your god now? (Lycoming L-7755)

[editline]25th May 2011[/editline]

Engines with short cranks, shitloads of pistons, and server-crashing complexity seem to make massive amounts of power.

ALso, hydraulic engines make insane amounts of torque. Personally, I’m slowly working up the will to attempt something like a quasiturbine in gmod.

Best enjun evar.

Also, Shogoll’s 6 cylinder shortcrank boxer engine seems to be a great engine to have, perfectly balanced and great throttle response.

That reminds me: there was an addon a while back where you could tweak the physics engine, remove the speed limit and rpm limit, what was that called again?

I believe it was called Jinto’s Physics Mod.

[editline]edit[/editline]
http://www.facepunch.com/showthread.php?t=585848

it’s integrated now into gmod anyway with console commands.

I’ve never gotten those commands to work, any help?

i don’t remember them off the top of my head…I just basically surfed around console seeing what it would autocomplete for me. If I remember them I’ll pass 'em your way, though.

[editline]25th May 2011[/editline]

though if you up your speed and stuff, shit breaks really easy. Like if I set my max rpm to 2500, even racewheels and offroadwheels dig through ground really easily. It’s not worth the hassle usually.

I’d be much more interested in using it for aero purposes.

I’d only use it for engine testing purposes: I found out that my best engine has a max rpm of 1500, and then stays stable there.

it’s kind of difficult to get a good power to weight ratio in gmod, since engines are limited to lower rpms. The max rpm gmod allows (I think 545 by default) is essentially a diesel’s idle.

[editline]26th May 2011[/editline]

It’s very very possible, but it’s still kind of a disappointment.


lua_run physenv.SetPerformanceSettings({MaxVelocity = blah  MaxAngularVelocity = blah2})

Just type whatever you want instead of blah and blah2
Default max velocity is 3500 u/sec, default max ang velocity is 3600 deg/sec

[editline]26th May 2011[/editline]

You can fix this by changing the MaxCollisionsPerObjectPerTimestep and MaxCollisionChecksPerTimestep.


Default MaxCollisionsPerObjectPerTimestep = 10
Default MaxCollisionChecksPerTimestep = 500

The reason wheels go through the floor is because they reach their collision limit per timestep, and aren’t checked for collisions again by the engine, and thus fall through the floor.
With wheels it’s a bit of a play-off between having more polygons in the collision mesh and having less bounce, but risking them sinking or having less polygons in the collision mesh, but more bounce and reduced chance of sinkage.

Be wary though, if you increase the max collisions per timestep, contraptions that aren’t properly no-collided will cause a lot more lag than usual, and potentially could crash the server.

And how would I go about running those lua commands?



lua_run *codegoeshere*


Put that in the console.
So if you wanted to change max velocity, max angular velocity, and the maximum collisions per timestep you would do



lua_run physenv.SetPerformanceSettings({MaxVelocity = 10000  MaxAngularVelocity = 36000  MaxCollisionsPerObjectPerTimestep = 30  MaxCollisionChecksPerTimestep = 750})


It’s pretty much just this:



lua_run physenv.SetPerformanceSettings({somevariable = somevalue})


Thanks a bunch!

Is this saved ingame for all times you run Gmod or must I type it each time I start the game?