Jump to content
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. The Criminal Enterprises
      2. Updates
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Red Dead Online

      1. Blood Money
      2. Frontier Pursuits
      3. Find Lobbies & Outlaws
      4. Help & Support
    3. Crews

    1. Grand Theft Auto Series

      1. Bugs*
      2. St. Andrews Cathedral
    2. GTA VI

    3. GTA V

      1. Guides & Strategies
      2. Help & Support
    4. GTA IV

      1. The Lost and Damned
      2. The Ballad of Gay Tony
      3. Guides & Strategies
      4. Help & Support
    5. GTA San Andreas

      1. Classic GTA SA
      2. Guides & Strategies
      3. Help & Support
    6. GTA Vice City

      1. Classic GTA VC
      2. Guides & Strategies
      3. Help & Support
    7. GTA III

      1. Classic GTA III
      2. Guides & Strategies
      3. Help & Support
    8. Portable Games

      1. GTA Chinatown Wars
      2. GTA Vice City Stories
      3. GTA Liberty City Stories
    9. Top-Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    1. Red Dead Redemption 2

      1. PC
      2. Help & Support
    2. Red Dead Redemption

    1. GTA Mods

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Red Dead Mods

      1. Documentation
    3. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    4. Featured Mods

      1. Design Your Own Mission
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Rockstar Games

    2. Rockstar Collectors

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Movies & TV
      5. Music
      6. Sports
      7. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. Announcements

    2. Support

    3. Suggestions

*DO NOT* SHARE MEDIA OR LINKS TO LEAKED COPYRIGHTED MATERIAL. Discussion is allowed.

Methodology for "slide on edges" (skateboard grind) mod


Pocketsand
 Share

Recommended Posts

Pocketsand

I'm a software engineer and have to work with geometries, vectors, spatial data, etc. in my day-job.  I have done a little bit of mapping for, and reverse engineering of, games in the past so I am thinking it may be fun to try and code a "grind on edges" mod, perhaps to complement the existing skateboard mod.  E.g. it would allow you to slide along edges in the world, like in Tony Hawk's Pro Skater.

 

I have read about a bit about modding GTA but I feel I am still in that "you don't know what you don't know" phase. I am thinking of breaking the project into milestones, I have put my thoughts next to each:

 

  1. Be able to move (slide) player between two arbitrary points (use native `TASK_PED_SLIDE_TO_COORD`? Maybe discover how sliding down ladders or over cars works?)
  2. Be able to identify edges in the world capable of grinding (how does the engine know when an edge can be grabbed for climbing over? how does a vehicle know when it hits a kerb, ray casting?)
  3. Extract points/path from edges and use work from milestone 1. to slide player along edge

 

I do not know if custom animations are possible yet and it would be a whole another chunk of work so have not included that/player pose as a milestone.  But even if it didn't look good I think it could be fun just to be able to slide about on the worlds edge's -- what do you folks think?  Please would someone be able to nudge me in the direction or tell me if they think I am missing something obvious.

Edited by Pocketsand
Link to comment
Share on other sites

Pocketsand

Sorry to bump, I realise I should have maybe put this in Coding.  I thought that forum was reference-only but I see others are asking questions in there.

 

I have thought of a possibly very convoluted way of doing it:


Make the skateboard or some sort of invisible platform as a train model.

Inject (if possible) or preload train track nodes along the grindable edge(s).
Use CREATE_MISSION_TRAIN(...) to spawn the model under/around the player at the point of collision with the edge and set the inertia and direction of the train to match that of the player.

Link to comment
Share on other sites

I find the idea of what you are proposing intriguing but I just don't think the world is configured in a way that would make it possible... not without manually placing huge amounts of usable data into the world first.

 

GTAV's world is effectively a limited-interaction 3D platformer and as such, instead of looking for edges to interact with, you're looking for collision steps with enough space above them, to accommodate the player. If you notice, you can't hang from anything, when you stand next to something the right height and hit the jump/climb button, it goes through the complete climb sequence and either stands on top if there is space to stand, or jumps completely over if there isn't. If the area above is blocked, nothing happens. You only ever walk off things forwards, unless there's a ladder there and you get lucky with it deciding to let you climb down it instead of falling down to the ground. The process it goes through is a good indication of the level of interaction the game expects you to have.  That means there are no defined edges in the world, which means if you want some, you would have to define them all yourself.

 

Might be worth spending some time in the skateboard park in La Mesa, look at that small space and consider how many edges you would need to define, just to make that tiny segment of the world usable for grinding. Once you have defined them all, you're going to have to do some extensive spatial partitioning to make checking for them a practical scenario. I think you could be looking at edge numbers in the 6-digit range at least, possibly even more considering you can get on top of pretty much every building in the game.

 

If you could define all the edges, you could probably handle the collision and motion with line intersection checks. Define a line from the front of the board to the back, check that line against the edge line and if they intersect, move that intersection point in the direction of travel along the edge, with the player at a relative offset. I don't think you'd need train nodes and invisible models if you have defined the edges, you'd probably have enough data to work with. But speaking as someone who likes collecting and working with data, there isn't enough money in the world that would make me want to define all the edges in the GTA V world. And of course you've also got the added factor that some of those edges could be on destructible objects, so you'd need to be checking for the presence of the objects to validate the presence of the edge.

 

And then there's animations, of which sadly there are no such thing as custom ones... at this point in time anyway. They were coming several years back and we still don't have them, so there's a high chance they might never turn up. So you're going to be stuck with standing, crouching and not much else.

 

I think if the world was configured differently, where it expected you to interact with edges, you'd have a much brighter prospect than the one I have unfortunately painted. I don't want you to take what I have said as me saying "You can't do it". I am a strong believer that the only person who can prove if something is impossible, is yourself when you've tried to make it possible. But I also think it's better to go in armed with the potential pitfalls beforehand, so you're approaching it with overcoming them in mind all the time. I'll play devil's advocate on one hand but I'll also offer solutions if I can think of any at the same time.

  • Like 2
Link to comment
Share on other sites

Pocketsand
On 5/20/2020 at 7:57 PM, LeeC22 said:

GTAV's world is effectively a limited-interaction 3D platformer and as such, instead of looking for edges to interact with, you're looking for collision steps with enough space above them, to accommodate the player. If you notice, you can't hang from anything, when you stand next to something the right height and hit the jump/climb button, it goes through the complete climb sequence and either stands on top if there is space to stand, or jumps completely over if there isn't. If the area above is blocked, nothing happens. You only ever walk off things forwards, unless there's a ladder there and you get lucky with it deciding to let you climb down it instead of falling down to the ground. The process it goes through is a good indication of the level of interaction the game expects you to have.  That means there are no defined edges in the world, which means if you want some, you would have to define them all yourself.

  

Thanks for your reply and the detailed explanation, that makes a lot of sense.   

 

On 5/20/2020 at 7:57 PM, LeeC22 said:

Might be worth spending some time in the skateboard park in La Mesa, look at that small space and consider how many edges you would need to define, just to make that tiny segment of the world usable for grinding. Once you have defined them all, you're going to have to do some extensive spatial partitioning to make checking for them a practical scenario. I think you could be looking at edge numbers in the 6-digit range at least, possibly even more considering you can get on top of pretty much every building in the game.

Yeah, that's a good idea.  And a fair point about the quantity of edges... maybe I can figure out a way to do it from the collision mesh. Forgetting the "grind on edges" mod for a second.... could be quite funny just to try and trick the game into selecting random nodes from the collision mesh to use as a train track or perhaps even the nav mesh.  Roads=Rails mod? 😄

 

On 5/20/2020 at 7:57 PM, LeeC22 said:

If you could define all the edges, you could probably handle the collision and motion with line intersection checks. Define a line from the front of the board to the back, check that line against the edge line and if they intersect, move that intersection point in the direction of travel along the edge, with the player at a relative offset. I don't think you'd need train nodes and invisible models if you have defined the edges, you'd probably have enough data to work with. But speaking as someone who likes collecting and working with data, there isn't enough money in the world that would make me want to define all the edges in the GTA V world. And of course you've also got the added factor that some of those edges could be on destructible objects, so you'd need to be checking for the presence of the objects to validate the presence of the edge.

 Thanks that's a good idea, and simpler than what I was considering.  I wasn't sure how easy it would be to move the player in an arbitrary direction but if I figure that out I can then do the line intersection thing maybe with edges defined provided by some edge detection algo -- maybe could even do that in shading language.  And, yeah, lots of opportunity for bugs.  I think even if I could implement something basic I would be happy.

 

On 5/20/2020 at 7:57 PM, LeeC22 said:

And then there's animations, of which sadly there are no such thing as custom ones... at this point in time anyway. They were coming several years back and we still don't have them, so there's a high chance they might never turn up. So you're going to be stuck with standing, crouching and not much else.

  I think I read CodeWalker can import/export YCD files to 3DS Max but I assume from what you're saying there is more to it than that.  Even if it were possible be I would be way out of my depth and am not sure I have enough commitment yet to start gluing ping-pong balls to myself and trying to do my own ghetto mocap.  That said, my housemate is a professional 3D character artist so maybe he'd know something.

 

On 5/20/2020 at 7:57 PM, LeeC22 said:

I think if the world was configured differently, where it expected you to interact with edges, you'd have a much brighter prospect than the one I have unfortunately painted. I don't want you to take what I have said as me saying "You can't do it". I am a strong believer that the only person who can prove if something is impossible, is yourself when you've tried to make it possible. But I also think it's better to go in armed with the potential pitfalls beforehand, so you're approaching it with overcoming them in mind all the time. I'll play devil's advocate on one hand but I'll also offer solutions if I can think of any at the same time.

 

Thanks -- I share the exact same attitude but just lack the modding experience to make an informed decision so that's the sort of answer I was looking for.  Fortunately, so much great work has been done by others reversing the game it seems like a "less impossible" task today than it would have been 5 years ago.  I will probably start having a play trying to do some really simple things and try to build it up piece by piece over time. Probably by the time it is done GTA 6 will be out with a skateboard vehicle  😂

  • Like 2
Link to comment
Share on other sites

8 minutes ago, Pocketsand said:

I think I read CodeWalker can import/export YCD files to 3DS Max but I assume from what you're saying there is more to it than that.  Even if it were possible be I would be way out of my depth and am not sure I have enough commitment yet to start gluing ping-pong balls to myself and trying to do my own ghetto mocap.  That said, my housemate is a professional 3D character artist so maybe he'd know something.

In theory, YCD files should just be hierarchy based rotations and translations applied to the model rig. What I presume has made things difficult, is knowing whether those transformations always apply from the root node, or from a specific bone in the IK chain. We used to store animations as point sets that were interpolated between but the IK system changed all that to something more flexible... but with flexibility often comes complexity, which can be a pain when you're trying to decypher how someone else has done things. But the videos in that link are over 12 months old, so it shows that it's a baby-steps process figuring it out. I'm sure it will get there but then you have to count on whoever succeeds being willing to share the information... and that's not guaranteed outcome unfortunately.

 

40 minutes ago, Pocketsand said:

Fortunately, so much great work has been done by others reversing the game it seems like a "less impossible" task today than it would have been 5 years ago.  I will probably start having a play trying to do some really simple things and try to build it up piece by piece over time.

I wish other people approached modding with that mindset. So many people jump in with huge ambitions and then get disillusioned by not being able to achieve them. I have over 300 mod project folders, some of which perform just a single, simple task. Each small task is a nugget of information and experience and eventually, they all add together to make bigger things possible. Although I have to hold my hands up and confess that my first mod was way bigger than I should have attempted but coming from a game-dev background had prepared me for that kind of thing, so I felt I could take it on.

 

There are plenty of people on this forum that will happily share anything they know though, so never fear asking a question, no matter how big or small it is. If we don't know outright, then what you have asked is a learning opportunity for the rest of us, so we'll be happy to get involved with finding that answer. I'll build test mods at the drop of a hat, I like finding and visualising information and data.

 

So we'll all be looking forward to Tony Hawk grinds Los Santos. :D

  • Like 2
Link to comment
Share on other sites

Pocketsand
16 hours ago, LeeC22 said:

I'm sure it will get there but then you have to count on whoever succeeds being willing to share the information... and that's not guaranteed outcome unfortunately.

Yeah, given the spirit of modding I am kind of surprised there are those who keep research/work close to their chest.  Then again, I had a guy add a 3D skybox to a map I made for CS: Source, change the credit on the wall to "Map by [him]", and reupload it to FPS banana under his own name with and a PayPal link in the description.  So I guess people like him don't help.
 

16 hours ago, LeeC22 said:

I wish other people approached modding with that mindset. So many people jump in with huge ambitions and then get disillusioned by not being able to achieve them. I have over 300 mod project folders, some of which perform just a single, simple task. Each small task is a nugget of information and experience and eventually, they all add together to make bigger things possible. Although I have to hold my hands up and confess that my first mod was way bigger than I should have attempted but coming from a game-dev background had prepared me for that kind of thing, so I felt I could take it on.

I've learnt the hard way :) Without money on the line people probably do not brush up against the "minimum viable product" idea and, even if they do, it can take some discipline and practice to ship something that falls short of your vision.

 

I think your approach makes sense... a sort of monorepo of tiny libraries or reference projects.  I may well try to emulate that.
 

16 hours ago, LeeC22 said:

There are plenty of people on this forum that will happily share anything they know though, so never fear asking a question, no matter how big or small it is. If we don't know outright, then what you have asked is a learning opportunity for the rest of us, so we'll be happy to get involved with finding that answer. I'll build test mods at the drop of a hat, I like finding and visualising information and data.

Thanks, I'll bear that in mind :) [<- is it me or does the smiling emoticon on this forum look like the strained goodbye smile of a dying man?]

 

16 hours ago, LeeC22 said:

So we'll all be looking forward to Tony Hawk grinds Los Santos. :D

Haha, cheers mate, so will I :D

Edited by Pocketsand
Link to comment
Share on other sites

  • 1 year later...
Ben.Heartagram

Hedgy bmx mod have this feature, grinding on edges, you need to check that out

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.