Tweaking game physics

Avatar
JackSafari
85 Posts
Posted Sep 28, 2010
I have well over 1000 hours playing the original game of Portal, and can play the entire game end-to-end (without glitches, cheats, or scripts\tools) easily under 30 minutes. One thing I've noticed is that many of the original maps have their physics tweaked so that some things are either harder or easier depending on the puzzles in the maps.

A few examples:

  • Some doors open\close faster.
  • Turret reaction time is faster\slower
  • Fling distances varies
  • Throwing things to hit a target is harder\easier.
    So here is my question: Are these subtle things independently controlled at the mapping level through Hammer, or at times is there more going on at the C++ source code level to tweak the individual maps to have slightly different physic behavior? I understand there are many parameters to control objects which can be made through Hammer. And I also understand the C++ source code has not be released for Portal, so we can't look at it to see what they done at the lower levels. From what I've read, Valve modified\enhanced the game engine significantly from the HL2 game engine.

To be clear, I am not asking how to do the these things in Hammer,** I just want to get a general idea if there are some** physic tweaks in the original game that are being done at the C++ level (specific to each map), thus can't be done in maps\mods. The physics in fan made maps\mods seem very consistent, nothing like some of the tweaks I've noticed in the maps from the original game.

Thanks :smile:

Advertisement
Registered users don’t see ads! Register now!
Avatar
hanging_rope
435 Posts
Posted Sep 28, 2010
Replied 2 hours later
Well then.
* Some doors open\close faster.
This is quite easy to do in hammer, so that isn't code related.

  • Turret reaction time is faster\slower
    I think that's just your imagination. And also, since it uses AI, it can be a bit "hit and miss", so it is probalby just the way the code is ordered that causes this to happen. (Wait... The order of the code shouldn't do anything much. Probably something to do with how the game orders importance of certain things.

  • Fling distances varies
    That is definately done in hammer... Unless your talking about the amount of momentum needed for a certain fling, in which case it is due to the "physics bubble" around the portal which isn't as acurate as normal Physics.

  • Throwing things to hit a target is harder\easier.
    Thats just because the physics engine is not perfect, and certain things happen different ways when you do them differently.

Quote:
The physics in fan made maps\mods seem very consistent, nothing like some of the tweaks I've noticed in the maps from the original game.

Hmmm... Well, from your examples from original portal, they should be just as varied, is it possibly because you only play through custom maps a few times, and thus don't notice it as much as in the origonal portal?

I ussually experience the opposite; Physics is more uneven in custom maps than it is in the original portal.

Quote:
and can play the entire game end-to-end (without glitches, cheats, or scripts\tools) easily under 30 minutes

So can I, Hi-five! (virtually of course).

Avatar
JackSafari
85 Posts
Posted Sep 28, 2010
Replied 8 hours later
Thanks for the comments. Hi-5 back! :biggrin: In general, the type of physic\map tweaking I am referring to is very subtle. The type that only advance gamers and mapper\modders would be able to detect. Some what like noticing a couple missing pixels on 1920x1080 flat screen and being slightly obsessive about really small details (but, that's also how people get really good too). :mrgreen:

Some real examples would be from Chamber-13. Being able to toss the cube and trigger the super button is noticeably easier compared to tossing the cube in other chambers. In chamber-12, its practically impossible to toss the cube from upper ledge and have it activate the super button. I have practiced 100s of times trying to perfect the toss and thus far get less than 3% success, about on par with random throws & luck. In Chamber-13, I get about 50% success. If they did tweak the physics slightly, there probably isn't much difference between the two chambers, but just enough so that the success rate is much lower in 12 than in 13 when tossing the cube. Also, in Chamber-13, the door to the exit elevator opens\closes slower, just enough to shoot a portal past it as it closes (when a cube toss triggers the door, but cube falls\bounces off super button). Example of Chamber-13 cube toss. No reason to watch the entire video, just Chamber-13.

Avatar
Mevious
205 Posts
Posted Sep 28, 2010
Replied 11 minutes later

JackSafari wrote:
Some real examples would be from Chamber-13. Being able to toss the cube and trigger the super button is noticeably easier compared to tossing the cube in other chambers. In chamber-12, its practically impossible to toss the cube from upper ledge and have it activate the super button. I have practiced 100s of times trying to perfect the toss and thus far get less than 3% success, about on par with random throws & luck. In Chamber-13, I get about 50% success. If they did tweak the physics slightly, there probably isn't much difference between the two chambers, but just enough so that the success rate is much lower in 12 than in 13 when tossing the cube. Also, in Chamber-13, the door to the exit elevator opens\closes slower, just enough to shoot a portal past it as it closes (when a cube toss triggers the door, but cube falls\bounces off super button). Example of Chamber-13 cube toss. No reason to watch the entire video, just Chamber-13.

All of these things are caused by entities in the map as edited in Hammer. None of them as far as I know are done at "the C++ level". The button thing is caused by the presence of a trigger_vphysics_motion on some buttons (specifically buttons where you would want to toss a box on them from a distance). The door speed is just a setting required for every door. Fling distances could be changed by the presence of a trigger_push, whether you have portal funnel on, some physics glitch, or something, but I've never noticed this consistently different from map to map. For the turret timing differences, I'm going to go with hanging_rope and say it's probably just your imagination.

Avatar
msleeper
4,136 Posts
Admin
Posted Sep 28, 2010
Replied 20 minutes later
Absolutely nothing you have listed about wanting to do would need to be done on the "programming level".

The turrets do have different timing settings, but again, that's all done in Hammer. The "Fast Retire" flag makes them wake up and go to sleep more quickly.

npc_portal_turret_floor

Avatar
Mevious
205 Posts
Posted Sep 28, 2010
Replied 8 minutes later

msleeper wrote:
The turrets do have different timing settings, but again, that's all done in Hammer. The "Fast Retire" flag makes them wake up and go to sleep more quickly.

Ah I never noticed that, probably because I don't like using turrets.

Avatar
hanging_rope
435 Posts
Posted Sep 30, 2010
Replied 2 days later

Mevious wrote:
msleeper wrote:

The turrets do have different timing settings, but again, that's all done in Hammer. The "Fast Retire" flag makes them wake up and go to sleep more quickly.

Ah I never noticed that, probably because I don't like using turrets.

...How did I know msleeper would say something to disprove my turret point?
I should have brought this point up earlier: It is IMPOSSIBLE to have variations within a single map that are exclusively on the C++ level. (To my knowledge of how source works). It may be possible to make C++ level adjustments to specific levels, but valve generally doesn't do that. Most of the time they use C++ to create the entities so it is easier to change the map from within hammer. This also makes it faster to tweak gameplay.

tl;dr: Everything can be done in hammer.

Avatar
msleeper
4,136 Posts
Admin
Posted Sep 30, 2010
Replied 54 minutes later
Not really trying to "disprove" you, just clarifying the facts. I was fucking with turrets recently and used the flags so it was fresh on my mind.
Avatar
hanging_rope
435 Posts
Posted Sep 30, 2010
Replied 1 hour later

msleeper wrote:
Not really trying to "disprove" you, just clarifying the facts.

I know. however,I had the feeling that someone that has used turrets recently would remember something.

Avatar
Omnicoder
299 Posts
Posted Oct 14, 2010
Replied 13 days later

hanging_rope wrote:
Mevious wrote:

msleeper wrote:

The turrets do have different timing settings, but again, that's all done in Hammer. The "Fast Retire" flag makes them wake up and go to sleep more quickly.

Ah I never noticed that, probably because I don't like using turrets.

...How did I know msleeper would say something to disprove my turret point?
I should have brought this point up earlier: It is IMPOSSIBLE to have variations within a single map that are exclusively on the C++ level. (To my knowledge of how source works). It may be possible to make C++ level adjustments to specific levels, but valve generally doesn't do that. Most of the time they use C++ to create the entities so it is easier to change the map from within hammer. This also makes it faster to tweak gameplay.

tl;dr: Everything can be done in hammer.

Valve has plenty of map specific hacks in half life. I recall a line from the ep2 source code that read something like:

Quote:
//!!!HACKHACKHACK!!! If the player tries to crossbow over alyx while shes crouching it is absorbed by her physbox, set her as owner. player loses a kill but at least the shot fires right
if (engine->MapName == "ep2_outlands_05")
this->Owner = pOther;

Advertisement
Registered users don’t see ads! Register now!
Avatar
WinstonSmith
940 Posts
Posted Oct 14, 2010
Replied 2 hours later

Omnicoder wrote:
Valve has plenty of map specific hacks in half life. I recall a line from the ep2 source code that read something like:
Quote:

//!!!HACKHACKHACK!!! If the player tries to crossbow over alyx while shes crouching it is absorbed by her physbox, set her as owner. player loses a kill but at least the shot fires right
if (engine->MapName == "ep2_outlands_05")
this->Owner = pOther;

Hah! Sounds a lot like VALVe to preserve the environmental integrity of the game if it means injuring the actual gameplay.

I have to start looking through that code more, some of the stuff makes me laugh hard.