[WIP] Sticky Gel Test
Cross post from this thread:
but here's some real sticky gel in action without level rotation,
scripts, surface normal traces or paint triggers. (Modded client)
yishbarr wrote:
Yeah, but that's an override. Unless I'm wrong.
Well, basically there are vectors for the player's "up" direction (player's rotation), and the camera's "up" (camera's rotation). I worked out that those were still functional if you change them
In the same chunk of memory (like 60 bytes away) I noticed it was writing the angle of the sticky gel you're stood on somewhere, but not doing anything with it.
So I just patched that to write it over the player's rotation, then borrowed a few bytes from speed paint immediately below to write those values over the cam's rotation too.
I guess you could call it an override yeah, I think of it as a bridge or something? The original code that does that is probably still in the game somewhere, but it'll be tough as hell to trace if it even is, because since it's not being used, I can just add a breakpoint and trace back to what's making the changes.
Quick before and after in case anyone likes a bit of assembly.
Modifications in Red


Just OllyDbg:
http://www.ollydbg.de/version2.html
I used the Cheat Engine to search for sequences of numbers (like the player's hitbox) that are listed in "cl_dumpplayer 1". Those are more or less stored in sequence in memory, so it was easy to find the rotation vectors just above those, add a breakpoint and find out what writes to those (In OllyDbg). I noticed that there was something writing the connected paint angles nearby to that memory area, and when I traced to find what was writing that, by chance it was another function I'd already documented a while back to do with detecting paint.
I can't really see Valve taking issue with that since well, does it really matter if the .dlls were recompiled or just altered by hand? That and I've taken steps to disable challenge mode and have mentioned glittertits to at least 2 staff members
Gonna be a little busy over <Holiday Name Here> so I can't really say when it'll be ready though :\
Is there anything that this is specifically incompatible with?
There's a chunk of code that smoothly rotates the camera though, which has been a little problematic when entering portals. (The effect that makes the camera turn 'up' when you're in 2 floor portals)
So if you're on sticky wall for example, and you put a portal on another sticky wall at another angle, then go through to it, the camera will try and rotate to the angle of the gel around the portal you just exited. The paint override will try and write one value, while this smoothing effect will try and write another at the same time. The result is almighty spazz out as the two fight to rotate the cam/player, and neither wins.
It would be easy enough to disable this smoothing, but that might make normal portalling a bit choppy through floor portals... so ideally I'd like to fix that but I'll have to wait a bit to spend s'more time working on it 
Edit:
But you must bear in mind that they removed it because it wasn't finished and had plenty of issues in the first place. I might not be able to fix a lot of it so it might end up being that you'll have to disable players going into portals or something crazy. We'll see.
I would love to see a mindbending level to play with, because i always "hated" valve's playtesters for being confused with the use of the gel. hehe...
Nice work, I hope you can finish that and get rid of the last problems. ![]()
-
Mine works with most other test elements and allows jumping, crouching, and normal types of movement, but only works on perpendicular corners and everything needs to be func_brush.
-
Lambda's allows all sorts of detailing without optimization problems, but movement is different than normal and has to be tuned properly. It also only works on perpendicular corners.
-
Sickle's allows detailing and works on any surface, regardless of angle, and has normal movement, but glitches up if the player uses portals at the same time and requires a sourcemod. It's the only one which allows paint sprayers as well as bombs.
All of them allow wall-walking and have rather jerky rotation.
PortalCombat wrote:
... because i always "hated" valve's playtesters for being confused with the use of the gel...
Yeah, I was a bit annoyed with this too. I was discussing with LP how in the game Prey, it was done quite tastefully so as not to disorientate the hell out of the player, for example there was always a very obvious "down" region with flat ground, and just small sections where you'd be on the wall, so you always have a large reference point and smooth transitions. In other bits, where there were two actual 'ground' areas at 90 degree angles for example they'd build both exactly like any other flat section with railings and lights, and barrels and things, so you'd very quicky settle into the new orientation, and if you'd gone through a portal, wouldn't notice at all.
FelixGriffin wrote:
Right now I know of three completely separate models of ...
I'll be honest, I've always been a bit annoyed with people being cryptic about how they've implemented rotation - especially since keeping it to yourself doesn't actually help you get more rotatey maps to play and have always encouraged people to make derivatives of this:
http://steamcommunity.com/sharedfiles/f ... d=77888760
source + instructions
||Here's the source:
How it works:
-You trace three lines from the base of the player with TraceLine()
-From those 3 points you can figure out the angle of the surface you're stood on.
(ty Omni for hinting at that)
-Rotate the level to match that angle.
How to set it up:
-TraceLine only really works on solid BSP
-TraceLine doesn't work on func_brush
-The only parentable item TraceLine works on is "func_weighted_button"
-Those can be parented, work with traceline and work while disabled/nodrawed, etc.
-Hide them under surfaces you'll want to walk on.
How rotation works:
-Everything movable is parented to the level
-Portals and stuff are disabled briefly
-Carried cubes are warped inside the player, so they're not dropped when rotated.
-The parented level rotates (the hidden "player_pickup" is also rotated)
-a trigger_vphysics_motion rotates the gravity for regular things like cubes back to where the floor was (setlinearforceangles(angle))
-most things are unparented ( stuff that doesnt have to is left)
-portals are prodded with a stick and asked to re-open in their new positions.
Limitations:
-I removed the Quaternion code at the last minute, in an attempt to make it easier to understand for everyone, leaving a slight gimbal lock issue; Could be fixed, or ignored with clever level design.
-It could be a little faster.||
Despite its failings, I went to a fair bit of effort to keep the amount of maths down, and use simple solutions to solve problems like grav rotation. All that's missing really is the actual paint, and let's face it... triggers 'cause how else you gonna do it.
There's an old tool called "Gravity Hull" from before the workshop update which allowed similar behaviour though ^^