• Porting HL movement to Unity3d
    31 replies, posted
https://www.youtube.com/watch?v=H1miLXW3BCA Started this 2 days ago, basically just 1:1 porting from source A while ago my friend had an idea for a standalone combat surf game with matchmaking, so I might prototype this idea and see how fun it is.
Completely unrelated. But how did you get the textures to tile like that instead of it stretching and filling the entire face?
Not sure if Crayz is using the same thing but if you import the Prototyping standard asset pack there's a grid shader that does it.
I use this shader that maps to worldspace. There's a proper term for it that I can't think of right now, I think Unity has one too but it's not exposed in the editor Shader "Diffuse - Worldspace" {     Properties{         _Color("Main Color", Color) = (1,1,1,1)         _MainTex("Base (RGB)", 2D) = "white" {}         _Scale("Texture Scale", Float) = 1.0     }     SubShader{         Tags{ "RenderType" = "Opaque" }         LOD 100         CGPROGRAM         #pragma surface surf Lambert         sampler2D _MainTex;         fixed4 _Color;         float _Scale;         struct Input         {             float3 worldNormal;             float3 worldPos;         };         void surf(Input IN, inout SurfaceOutput o)         {             float2 UV;             fixed4 c;             if (abs(IN.worldNormal.x)>0.5)             {                 UV = IN.worldPos.yz; // side                 c = tex2D(_MainTex, UV* _Scale); // use WALLSIDE texture             }             else if (abs(IN.worldNormal.z)>0.5)             {                 UV = IN.worldPos.xy; // front                 c = tex2D(_MainTex, UV* _Scale); // use WALL texture             }             else             {                 UV = IN.worldPos.xz; // top                 c = tex2D(_MainTex, UV* _Scale); // use FLR texture             }             o.Albedo = c.rgb * _Color;         }         ENDCG     }     Fallback "VertexLit" }
Could you document how you are making it feel like HL movement? I've tried to make something like this, by also trying to look how source did it but I've never got the right feeling on my attempts
Yeah sure. After I get it figured out and solid I'll update OP with some info
Seems like it's lacking camera shakes. BUT you could probably sell this on the asset store, as I'm sure lots of people are looking for something like this
I guess Havok prevents interpenetration while physx encourages it in a way, and intepenetration has been a massive pain in my dick. I don't even have to be surfing to be interpenetrated, I can just be standing still on solid ground. Any sort of interpenetration at all results in shit results out of sweep tests, and it's pretty much fucking everything up. It's been interesting
viewmodel shit https://streamable.com/tooqf
Recoil will be based on controllable patterns with randomization and inaccuracy. This video demonstrates only the pattern mechanic. https://streamable.com/w9nlb
Hey @Crayz , your project looks pretty dope. I'd PM you but I don' think PM exists in Newpunch yet. I've been struggling with making HL Movement happen for ages, and I actually came here today to post a thread asking a question about this, then I found your thread! I tried to do it with a bunnyhop-friendly modified GoldSRC code https://github.com/crashfort/HL-Cam-Mod/blob/master/pm_shared/pm_shared.c But some things confuse me and I don't understand how they're supposed to work. I ported over PM_Accelerate and PM_WalkMove and their Vector Functions, but I am having some issues getting movement to work. I tried adding a place in FixedUpdate() like this: void FixedUpdate() { if (allowMovement) { if (!controller.isGrounded) { controller.Move(PM_WalkMove() * Time.fixedDeltaTime) ; } } } This doesn't work at all! The "forward" and "right" vectors get initialized as Vector3.zero as I didn't find a place to give them values. Also, I don't see a place in either PM_Accelerate or PM_WalkMove where I should plug in the TransformDirection (the direction where the player is looking). This shit is driving me crazy.
No need for TransformDirection, just assign forward to transform.forward and right to transform.right at the start of WalkMove. Whatever transform you're referencing here, make sure it's the one that rotates/looks around with your mouse. You can probably keep these two vectors in the function scope too, since they aren't use anywhere else.
Thanks! I improved it a ton and the only thing I'm missing right now is Gravity which I am not so sure where to implement. I tried adding velocity.y -= gravity on my friction function but that ain't do it. Here's my code for anyone who might wanna try it. I'm missing a few functions but if you have MouseLook down already it should be a piece of cake. I've also noticed a weird distortion in my inputs, when I press W and D together my velocity on those axes becomes equal to sqrt(2) instead of 1. Why is that?
I created a website and set up social media accounts today. Check OP for links
Working on a Valve BSP importer surf_cow-style (author Mr.Cow) https://i.imgur.com/0c8lXUK.png de_dust2: https://i.imgur.com/tE3osTu.jpg
Razer was kind enough to allow the use of his map surf_concordia - it's been very helpful in making improvements to the bsp importer and adding support for various Source Engine entities like trigger_push, trigger_teleport etc, and I think it will be a fun map once I get this game to a playable state. My map loader now also works with multiple formats (surf_concordia = bsp, surf_grass = unity). Ideally official maps will be created in Unity, and BSP support is for community modding & servers to load up their favorites from Source Engine or whatever. https://streamable.com/wxl4l I've made progress on networking as well, taking some time to get my shit situated so I can develop and test both the server and client within the same project. In this video, clicking "practice" actually starts up a local dedicated server and connects to it, but the controllable player is only on the client. I'll be able to expand on this to develop all of the multiplayer logic, hopefully
refactoring 50% of my code because unity's monobehaviour design is stupid, why did i even try god damnit
Will Fragsurf, as the name suggests, be just a surf game with Combat Mode or will there be Time Attack surfing? Like you know it from CSGO / 1.6?
My plan is to create the core gameplay, then add modding support which should allow for any gamemode. Initial plan is to have round based 1v1/2v2/3v3, and also a deathmatch mode
Client prediction & reconciliation is in. I was relying on Unity's rigidbody for collision restitution before, but you can't simulate a single physics object without simulating everything else. So now I just apply restitution manually during each movement step, which makes it very easy to rewind and resimulate a player. Host is red, client is blue. Also added an entity which simply networks convars to synchronize clients with server. https://streamable.com/y0f9h
That sounds awesome! Cool If you need a tester just ask me, im starting surfing in 1.6 and doing it everyday till today !
I'm happy to see your interest I'll let you know when it's time for testing, just make sure to check back here from time to time
I have even more than just interest, the project is one of the few projects who really interest me here. I've been waiting for that for more than 10 years now, surfing has been coming out as an independent game!
Awesome, I feel exactly the same & I suppose that's why I'm creating it. If you have any ideas for maps or guns or anything related to gameplay I'd like to hear it, game design isn't really my focus and I kinda want to put it into the hands of the combat surf community. You should join the steam group, it'll be easier to get in contact there when it's time for testing: Steam Community
The question is, how do you want to shape your battles? You want to play with guns? Like Counterstrike? Or should it be a little more primitive? I have to say Surf Maps at cs with fights I always found stupid, because you could theoretically shoot with the weapons over the whole map. That's why I think it would be cool if you had a more primitive fighting system, like the bowfights at Rust and maybe there's a crossbow that is stronger. And on the wave itself, you can only fight with a knife or something. In my eyes it's stupid to do it like CounterStrike, otherwise it doesn't stand out from the game. Furthermore, you can prevent that you can shoot people from somewhere on the map, a bow doesn't shoot far and the arrow flies a bow, I would think mega cool!
Yep, in cs people can fly around at max velocity and still be able to kill from across the map, I would like to create combat that has more depth. I haven't considered not using guns but I like the idea of bows, they could add a lot to gameplay. Level design would be interesting, there should be enough surf for skilled players to maintain momentum but also enough platforms to stop and use the bows
@Crayz ye something like that sounds great. I think you can try different things but it should not be the case that you can kill people all over the map. You should be forced to surf to reach certain spots where you can fight. And I think this kind of thing really works with weapons that are maybe just a little more primitive than an AK-47 or an AWP. I'm really excited and can't wait to try it out!
Multiplayer is now functional, shooting/killing/respawning/joining/leaving/etc. is in. I ran a dedicated server on my machine and tested with a friend from across the state to make sure my local environment performs the same as a live environment, had a few small issues but everything is now good. At this point I think I will stop adding features and polish what currently exists to host a proper playtest with multiple people. Not sure how long it'll be before the playtest happens, weather is getting nice and I might be getting busy with irl work soon. https://streamable.com/syeei aeeh I had to re-create the Steam group if you'd like to rejoin, it's the same url
Yep, I rejoined No military weapons! :D We need bows! Hopefully I can take part in the game test, that would make me happy :)!
What about ragdoll physics? Will be added in future? I want to see bugged ragdolls flying across all map.
Sorry, you need to Log In to post a reply to this thread.