Product Chat / When are we going to swim

Author
Message
PCS
8
Years of Service
User Offline
Joined: 7th Jul 2016
Playing:
Posted: 16th Jan 2019 18:38 Edited at: 16th Jan 2019 18:40
I was wandering. Now that we can enter the water is it not now the time to finalize a swimming hud / animation, so the player can swim normal up and down and forward in the water with an simple arm animation.
Another question, would it be easier for let say a person  who can make gun rigging with the arms animation, to just make the swimming animation with arms or not.?

Any thoughts on this?


Pcs
Windows 7 Professional 64-bit
Intel(R) Pentium(R) CPU G3260 @ 3.30GHz (2 CPUs), ~3.3GHz RAM 16GB NVIDIA GeForce GT 730
DirectX Version: DirectX 11
Bored of the Rings
GameGuru Master
19
Years of Service
User Offline
Joined: 25th Feb 2005
Location: Middle Earth
Posted: 16th Jan 2019 20:12
https://forum.game-guru.com/thread/219463?page=1#msg2597716
Professional Programmer: Languages- SAS (Statistical Analysis Software) , C++, C#, VB, SQL, PL-SQL, JavaScript, HTML, Three.js, Darkbasic Pro (still love this language), Purebasic, others
Hardware: Dell Precision 490; AMD Radeon HD 7570; 12GB.
PCS
8
Years of Service
User Offline
Joined: 7th Jul 2016
Playing:
Posted: 16th Jan 2019 20:42
@Bored of the Rings, i have seen that thread, but the problem is that you can not swim up and down with the mouse while pressing the forward key (w) in the water , if you don't hold the space bar then you go down. and this is not an action of swimming we need an script were you can maybe move forward with the W key and at the same time move up and down with the mouse. test it your self, and you will see we need proper swimming motions and an animation hud with arms.

Teabone has done outstanding work so far but now we need to swim properly, ( no offence to Teabone )

if possible someone with animation experience can maybe makes as a swimming hud and if we are lucky then maybe AmenMoses , or Smallg can fill in the correct script for it.
Windows 7 Professional 64-bit
Intel(R) Pentium(R) CPU G3260 @ 3.30GHz (2 CPUs), ~3.3GHz RAM 16GB NVIDIA GeForce GT 730
DirectX Version: DirectX 11
GubbyBlips
5
Years of Service
User Offline
Joined: 14th Jan 2019
Location:
Posted: 16th Jan 2019 23:29
Agreed absolutely. If anyone can figure out the animations, I could possibly help with the basic script (outside of animations-- and separate from core WASD input). What I would need to know is what is the function that calls the water level? Also, how to rotate the player?

Of course considering the thread mentioned earlier, Teabone is far ahead in this arena- and it seems working on core variables. What would be a quick and simple fix is if forward movement was pushed, and that the player not sink, but slowly rise (to water level). These two little things in and of themselves would dramatically help. On Steam I recommended a "properties" insert that gave buoyancy in a percentage from 0-100 to any entity. Styrofoam and beach balls are 99% buoyant, land animals/ humans and ice cubes are about 10%... bricks are 0!

Valid entries?
SetFreezePosition(x,y,z)
SetFreezeAngle(ax,ay,az)
TransportToFreezePosition()
PM
Corno_1
GameGuru Tool Maker
13
Years of Service
User Offline
Joined: 3rd Nov 2010
Location:
Posted: 17th Jan 2019 12:16
Quote: "What I would need to know is what is the function that calls the water level? Also, how to rotate the player?"

There are different commands, so you need to know what you want.
There is the GetWaterHeight() command for the actual height and the GetGamePlayerStateUnderwater() if the player is underwater.
To control the player, you can look at the SetGamePlayerControl commands in the global.lua. Maybe there is something for you.
Ebe Editor Free - Build your own EBE structures with easy and without editing any text files
Thread and Download
PM
Teabone
Forum Support
18
Years of Service
User Offline
Joined: 8th Jun 2006
Location: Earth
Posted: 17th Jan 2019 23:45 Edited at: 17th Jan 2019 23:53
What was added to Github wasn't 100% of all my tests. Preben helped to get some of what I was working out, so we could get started quickly on adding the under water visual shaders he put together and the water sliders others had touched on. However swimming was not focused on with the build that went out.

A lot of work is still required to get swimming in properly. As what we have right now actually has a lot of bugs that can prevent the player from moving in some case or cause FPS drains. Also gameplay wise its not satisfactory by most of us. Also the space to float is not ideal but this was implemented quickly just so that we can also throw in the under water shaders and water slider controls.

What I was more hoping to achieve (or magically hoping someone would lend some hands in):

Example of Swimming in Skyrim (visuals, controls and drowning mechanics):


Essentially, trying to replicate similar to what we had in FPSC. Its still a bit silly that 5 years in and FPSC is further along than GG in some key areas such as swimming.

FPSCx10 Water Shaders, Slider and Swimming:


Part of my implementation tests that were not added or finished included a lot of modifying of how the players health system would work. In that the heartbeat nonsense wouldnt start till the player was lesser than 60% of his/her health. Also add other visuals for drowning instead of just red screen death. Underwater grasping for air sounds instead of heart beat injury. Also consideration for allowing certain weapons to work under water and others to not. Something that Lee started in the global player lua script that wasnt completed. However since my github respiratory got all mucked up since i have troubles wrapping my head around fixing it, i gave up on a lot of efforts and reverted my files back vanilla/stock. I just dont have that kind of time to be playing around with scripts as I used to. Prior id spend about 9 hours a day, now I have no more than 30 minutes. hopefully someone is able to work their magic on this request. Its a needed feature and a sadly missed one that existed in FPSC.

To add, we were going to add swimming animations to this using the same hands as the modern day ones. But it really does require swimming by moving forward with angular directional control. Which is standard in games with water since Playstation 1 days.
Twitter - Teabone3 | Youtube - Teabone3 | Twitch - Teabone3 | TGC Assets - Store Link | Patreon - Teabone3

i7 -2600 CPU @ 3.40GHz - Windows 7 - 8GB RAM - Nivida GeForce GTX 960
GubbyBlips
5
Years of Service
User Offline
Joined: 14th Jan 2019
Location:
Posted: 18th Jan 2019 00:55
Amen Teabone! You mean Ape Escape for PS1 hehe! Fun! I think I finished all that game- maybe.
For me, I don't know anything about animations. All I can do is rotate something around and move it-- if I'm lucky.

Thanks Corno_1 for that info.
My incentive to GG script at the moment isn't huge either. Maybe I pick it up shortly...
At least it seems some collision happens in moving entities now- very good!
PM
GubbyBlips
5
Years of Service
User Offline
Joined: 14th Jan 2019
Location:
Posted: 22nd Jan 2019 04:27
Is there a way to see the current script for the swimming-- and if there are any (movement) features that can be tweaked-- I'd give it a try?

I have managed to get cars/ objects to move and jump, with collision (if that's not a lucky fluke?!) So where are we at in it? (swimming)
PM
Avenging Eagle
19
Years of Service
User Offline
Joined: 2nd Oct 2005
Location: UK
Posted: 22nd Jan 2019 07:23
Quote: "Is there a way to see the current script for the swimming"


I believe all the swimming code is contained within the gameplayercontrol.lua script, located in scriptbank.

AE
GubbyBlips
5
Years of Service
User Offline
Joined: 14th Jan 2019
Location:
Posted: 22nd Jan 2019 21:09
There's a major problem in there. A> it's all hard-coded, and the only states I see are when player (actually camera) enters water or exits water. Then there is drowning, and sounds- that's it. No freedom to fix the movement of the player-- that I can see.
B> as mentioned the camera (not player) dictates when player is in water--?! Why?! A GG user might want 3rd person, with camera 4-500 units distant, and that in no way is helpful to put camera dictating when player enters/ exits water. What's goin on here?

Actually, I'm looking at it closer, maybe we can come up with something, but for now, the player angle is not responsive to the functions to call it to the camera angle.
PM
Belidos
3D Media Maker
8
Years of Service
User Offline
Joined: 23rd Nov 2015
Playing: The Game
Posted: 22nd Jan 2019 21:49
The answer to B is simple, becausr there is no player in gameguru, just the camera, third person was just hacked onto the first person camera, basically the camera is still the player and the third person character us just an npc thats dragged around by the camera.

Primary Desktop:
i7 7700,k NV1070 8GB, 16GB 3200mhz memory, 1x 2TB Hybrid, Win10.

Secondary Desktop:
i5 4760k, NV960 2GB, 16GB 2333mhz memory, 1x 2TB Hybrid, Win10.

Laptop:
i3, Intel 4000 series graphics, 6GB memory, 1x 500gb HDD, Win8.1.
cybernescence
GameGuru Master
11
Years of Service
User Offline
Joined: 28th Jan 2013
Playing: Cogwheel Chronicles
Posted: 22nd Jan 2019 21:50 Edited at: 22nd Jan 2019 21:52
It's not hard coded, there is complete freedom to move through the water. Camera and player position are both available. It is all possible within gameplayercontrol.lua.

However it does take some getting used to all of the different states and what they are there for in the stock script. Adding TP into the mix also takes a fair bit of testing but is possible. I had to make no engine changes to get surface and under water swimming working, but it did take a fair bit of time and lots of testing.

A few people have got swimming working already , but I understand they are focused on their own game-play or are waiting until after their game is released to then provide to community.

Edit - you can glimpse TP surface swimming in the pic below, complete with foot splash

Cheers.
GubbyBlips
5
Years of Service
User Offline
Joined: 14th Jan 2019
Location:
Posted: 23rd Jan 2019 04:35
TP? What you mean? I got a box of it by the loo.
For now I suppose I'm going to look into sending the player along with a controlled entity ie TransportToFreezePosition
3rd person would look pretty cool though.

But the angle of player is not responding to calls of SetFreezeAngle(GetCameraAngleX(0),GetCameraAngleY(0),GetCameraAngleZ(0))
TransportToFreezePosition(1)
x returns up and down views, y returns horizontal views, and z does nothing (guess that makes sense).
PM
cybernescence
GameGuru Master
11
Years of Service
User Offline
Joined: 28th Jan 2013
Playing: Cogwheel Chronicles
Posted: 23rd Jan 2019 07:23
Typically the first person player would follow the surface swim direction of the y look (player) angle, so the transport position would be calculated using that and the speed value to derive new x and z player coordinates.

Once that is working can overlay the X player angle to swim up and down, calculating the player y position value as well as x and z.

It took some wrangling to switch the player from terrain physics collision mode and swim mode - getting the player to know when approaching shore, was even more tricky for third person TP view to get the character to smoothly walk into shallow water and transition from walk to swim animations.

Also had to use ray casts to check for terrain and entities around player once swimming.

Could be other ways of doing this I guess.

Cheers.
Teabone
Forum Support
18
Years of Service
User Offline
Joined: 8th Jun 2006
Location: Earth
Posted: 24th Jan 2019 16:17
Quote: "the problem is that you can not swim up and down with the mouse while pressing the forward key (w) in the water , if you don't hold the space bar then you go down"


I should add that in those video examples of what i was working on, the space bar was not part of the mechanic. And something I never intended to be. I believe that was tacked on to what I worked on as a way to call it "swimming" rather than just "the ability to now go under water". Which was okay with me... as long as full implementation of swimming controls followed. But that unfortunately didnt happen.
Twitter - Teabone3 | Youtube - Teabone3 | Twitch - Teabone3 | TGC Assets - Store Link | Patreon - Teabone3

i7 -2600 CPU @ 3.40GHz - Windows 7 - 8GB RAM - Nivida GeForce GTX 960
GubbyBlips
5
Years of Service
User Offline
Joined: 14th Jan 2019
Location:
Posted: 29th Jan 2019 03:54
I think I got a script going for swimming pretty good. At least one I like.
A little confusion and struggle-- but that's par for seeing as Lua isn't my native language!

What we could use now is animators that want to link it-- we need arms moving... and hud(s) would be great!
Also someone please consider-- this is outside of GamePlayerControl.

Can you activate a script (continuously active) solely inside a trigger zone? Yes, it seems possible.
I know a couple elegant scriptwriters out there that have done it-- AmenMoses for one?! Vehicles driving inside zones...
That way a custom script takes over when you are in water (ie triggerzone which you bound to your lake-shore.)
It's late tonight for me though...

Also I haven't got it set for 3rd person, just 1st.
PM
GubbyBlips
5
Years of Service
User Offline
Joined: 14th Jan 2019
Location:
Posted: 29th Jan 2019 04:05
I am basically now against hard- coded swimming. Or at least if there is some options available to
turn it on and off. Also, it's not ALWAYS that you want to swim in the direction of your look-direction
maybe you want to look behind you or to the side, when the sharks are closing in!
And mostly you want to look down-- all while swimming in basically a straight path.
People have swiveling necks-- ya know.
So my script has both options by a press of a key.

Wheres the fishing spears?!
PM
cybernescence
GameGuru Master
11
Years of Service
User Offline
Joined: 28th Jan 2013
Playing: Cogwheel Chronicles
Posted: 29th Jan 2019 07:52
Presumably the player only moves/swims when the wasd keys are pressed and when not can look around (including up/down) for sharks as needed? Though yes that would be cool if can still swim in one direction while looking around a little.

There is a basic script on the forums for surface swimming that is not integrated with the gameplayercontrol as was done before that player control was made available on lua and lots of other lua commands. Yours sounds like it will improve on that.

Triggering swimming code might be easier by checking player height against the water level value and if water is active. Then the ‘zone’ is always tied automatically to the area of water and only kicks in if water is active on level. Just a thought.

There are other aspects you may come across that will likely be easier by changing or adding a new function to the main player control, such as held breath, ripples, collision though depends how far want to go with this. Otherwise the separate code will ‘fight’ with the main player control logic. The down side is need to keep a back up of the changes as a new release of GG can overwrite the code.

Cheers.
GubbyBlips
5
Years of Service
User Offline
Joined: 14th Jan 2019
Location:
Posted: 29th Jan 2019 19:23
Thanks. Much appreciated advice cybernescence.
Well, there really is no "swimming" at all now in GamePlayerControl.
There is simply existing in the water awkwardly, and moving at a cold snails pace lol!
But with a couple tweaks, it's adequate for the time being.
For a script like mine, it would help a lot if animated arms where incorporated because
the main confusion is when you turn swimming directions independent
of "look" direction, but your swim path is not obvious because--
ya know-- not 3rd person.

I'll have a try on fiddle with 'Y' camera controls...
PM
Corno_1
GameGuru Tool Maker
13
Years of Service
User Offline
Joined: 3rd Nov 2010
Location:
Posted: 29th Jan 2019 19:59
For a start in swimming, you can take my first tries in gameplayercontroller.lua

replace this:

with this:


it is pre alpha and a lot of code is missing but it gives a first impression, what I want to do
Ebe Editor Free - Build your own EBE structures with easy and without editing any text files
Thread and Download
PM
PCS
8
Years of Service
User Offline
Joined: 7th Jul 2016
Playing:
Posted: 30th Jan 2019 16:58
Thanks Corno_1 , i will check it out. thanks for the hard work.
Windows 7 Professional 64-bit
Intel(R) Pentium(R) CPU G3260 @ 3.30GHz (2 CPUs), ~3.3GHz RAM 16GB NVIDIA GeForce GT 730
DirectX Version: DirectX 11

Login to post a reply

Server time is: 2024-10-06 18:23:30
Your offset time is: 2024-10-06 18:23:30