[WIP] Sticky Gel Test

Avatar
FelixGriffin
2,680 Posts
Posted Aug 29, 2013
Replied 5 hours later
Okay, I'll make it today's Hammer Notepad.
Advertisement
Registered users don’t see ads! Register now!
Avatar
FelixGriffin
2,680 Posts
Posted Aug 30, 2013
Replied 1 day later
http://www.youtube.com/watch?v=ZEHZRpkBshc
Avatar
sicklebrick
876 Posts
Posted Nov 11, 2013
Replied 2 months later

Cross post from this thread:

post101214.html#p101214

but here's some real sticky gel in action without level rotation,

scripts, surface normal traces or paint triggers. (Modded client)

9Zj6IR_9fL4

Avatar
Gemarakup
1,183 Posts
Posted Nov 11, 2013
Replied 16 minutes later
Yeah, but that's an override. Unless I'm wrong.
Avatar
FelixGriffin
2,680 Posts
Posted Nov 11, 2013
Replied 2 minutes later
Wow, you disassembled the client and enabled the old code? I'm definitely impressed!
Avatar
sicklebrick
876 Posts
Posted Nov 11, 2013
Replied 29 minutes later

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
img
img

Avatar
FelixGriffin
2,680 Posts
Posted Nov 12, 2013
Replied 18 hours later
So does this truly work on any surface without in-Hammer modification?
Avatar
sicklebrick
876 Posts
Posted Nov 12, 2013
Replied 1 hour later
Well, it doesn't work on glass or gratings... behaves prettymuch like any other paint. But yeah, didn't have to do anything special in hammer. You can spawn a sprayer in any old map and have a little fun with it ^^
Avatar
FelixGriffin
2,680 Posts
Posted Nov 12, 2013
Replied 1 hour later
That's even more impressive. What did you use to patch the memory?
Avatar
sicklebrick
876 Posts
Posted Nov 12, 2013
Replied 4 hours later

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.

Avatar
FelixGriffin
2,680 Posts
Posted Nov 12, 2013
Replied 6 hours later
Would you be willing to release this as a patch file? I don't know if this is illegal or not, but if the VAC hasn't detected it it's probably safe.
Avatar
sicklebrick
876 Posts
Posted Nov 13, 2013
Replied 4 hours later
Well, the plan is to release it as a barebones sourcemod that you can do what you like with - that is if I can fix the bounding box problems, etc. It'll contain a patched client.dll (sourcemod menu fix) and a patched server.dll (sticky gel) just like other source mods.

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 :\

Avatar
FelixGriffin
2,680 Posts
Posted Nov 13, 2013
Replied 6 hours later
That sounds awesome, thanks!

Is there anything that this is specifically incompatible with?

Avatar
sicklebrick
876 Posts
Posted Nov 13, 2013
Replied 2 hours later
So far I've not done a hell of a lot of actual testing.
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 :smile:

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.

Avatar
PortalCombat
306 Posts
Posted Nov 13, 2013
Replied 1 hour later
... so you are playing with sticky gel, huh? Nice to see someone put some effort into the old valve code. =)
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. :thumbup:

Avatar
Gemarakup
1,183 Posts
Posted Nov 13, 2013
Replied 1 hour later
You can't blame them for being dizzy...
Avatar
FelixGriffin
2,680 Posts
Posted Nov 13, 2013
Replied 1 hour later
Right now I know of three completely separate models of implementing the gel (which are still in development, so not counting Omni's), each with its own pros and cons. It would be interesting to throw all three of them into a sourcemod and see how well they'd work together:

  • 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.

Avatar
sicklebrick
876 Posts
Posted Nov 14, 2013
Replied 10 hours later

PortalCombat wrote:
... because i always "hated" valve's playtesters for being confused with the use of the gel... :thumbup:

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:

http://pastebin.com/r4uEjy8b

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.

Avatar
CamBen
973 Posts
Posted Nov 14, 2013
Replied 37 minutes later
One question... Could this code be implemented into a gmod swep?
Advertisement
Registered users don’t see ads! Register now!
Avatar
sicklebrick
876 Posts
Posted Nov 14, 2013
Replied 2 hours later
Unlikely - GMod runs LUA for its scripting system while P2 runs squirrel (vbscript).
There's an old tool called "Gravity Hull" from before the workshop update which allowed similar behaviour though ^^