Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible (and easy) to compile this source code? #1

Open
byxor opened this issue Oct 26, 2017 · 31 comments
Open

Is it possible (and easy) to compile this source code? #1

byxor opened this issue Oct 26, 2017 · 31 comments

Comments

@byxor
Copy link

byxor commented Oct 26, 2017

I don't see any makefiles, and I'm assuming this code requires additional libraries that we don't have access to.

@byxor byxor changed the title Is it possible to compile this source code? Is it possible (and easy) to compile this source code? Oct 26, 2017
@ericwomer
Copy link

The real problem right now is the legality of even looking at this code. As this isn't released via the copyright owners.

@LWSS
Copy link

LWSS commented Nov 30, 2018

The way they have it set up is that certain folders will have subfolders for each platform.
Like in Sys they have NGC for Nintendo GameCube, NGPS for the playstation, XBox for the xbox, and Win32 for windows.

In each of these folders there are cpp and h files starting with p_ for platform specific implementations.

Unfortunately it is missing some of the Win32 folders, in big parts like Gfx, Music, SoundFX, Movies.

It looks possible to build one of the console versions with the right toolchain, but for PC, you would have to do some work.

@byxor
Copy link
Author

byxor commented Dec 5, 2018

Just write our own. Easy! 😉

@ericwomer
Copy link

Just write our own. Easy! wink

Are you talking a complete rewrite or using an existing engine?

@byxor
Copy link
Author

byxor commented Dec 8, 2018

I was only joking, but if the platform-dependent code isn't that big, it wouldn't be too difficult to rewrite from scratch. I'm pretty sure CHC has done this before.

@ericwomer
Copy link

Its the legality of the issue, if we could get the current ip/source rights owners to sign off on it I would suggest taking out what we need, loading resources (models, images) and scripting (loading and running) and adding it to a compatible modern engine and go from there, if not, we would have to not look at the code and start from scratch to keep the lawers off our asses. I haven't looked much at the code, but from what I searched for online, its a renderware based game, like GTA and others, so I don't think its as complete as you think.

@LWSS
Copy link

LWSS commented Dec 9, 2018

@salamanderrake
sounds like ur making excuses bub

I haven't looked much at the code

I don't think its as complete as you think

how can you make this conclusion 🤔

@ericwomer
Copy link

Simple, because it was released by a studio, someone in the studio, or had access to the code, that didn't have rights to the code to the renderware engine its self, kind like how helium rain released their game code minus the UE4 engine its self and the 3d party stuff from the ue4 market. Also where is the documentation and the build scripts? They either had access to only one folder or they decided to only copy one folder.

@swift502
Copy link

swift502 commented Dec 14, 2018

To me, it feels very complete in terms of gameplay mechanics. We can now replicate the exact gameplay of Tony Hawk. We have the exact "magic values". And everything is very nicely commented. (In a Neversoft fashion)

/* ----------------------------------------------------------------
* End on File
* ---------------------------------------------------------------- */
/* This file ends here, DON'T ADD STUFF AFTER THIS */
// Ha ha I added some stuff... FUCK YOU SONY!

The most interesting stuff seems to be in SkaterCorePhysicsComponent.cpp, that's where we could never be sure until now. Few other SkaterComponents and I think you're done. Sipmly offload everything else (assets, rendering, etc.) onto a different engine.

I'll attempt at doing this but it is indeed a massive project to take on. I'll see how it goes for me. I must say though, I was very excited to see that about 90% of my predictions on how acid drops, spine transfers and verts work were correct. Feels good. 🙂

@thug1src @salamanderrake Btw when was this leaked? 2016? How did I miss it? And why thug of all games?

@ericwomer
Copy link

Commits on Feb 13, 2016 from what the commits say. Like I said before, my only concern is the legality of it all, its nice to have the code, but it would suck to start on this, just to have some piss-poor lawer jump up our asses and shut it down. I've seen it done to the wine project with the windows 2000 leaks and bits of that being pushed into trunk.

@swift502
Copy link

swift502 commented Dec 16, 2018

I was thinking about rewriting the important bits in a different language (C#, javascript, ...). I can't imagine someone connecting your polished rewrite and integration into something like Unity with this leaked code. I might be wrong though.

But looking further into the code, I'm not so sure any of this is a great idea.

Whenever you stop tracking a ramp, there's about 14 raycasts just to make sure you're really off a ramp.

// there is no collision, which usually mean we have gone off the end of a qp but might mean the tracking point has drifted off the top
// of the very polygon (it might not be exactly horizontal), so try tracking down up to 30 inches to see if we can find it again
for (int i = 0; i < 10; i++)
{
m_col_start[Y] -= 3.0f;
m_col_end[Y] -= 3.0f;
collision = get_member_feeler_collision(0, mFD_VERT);

And when acid dropping / spine transfering, there's 80 raycasts to find out if there's something you can transfer to.

bool CSkaterCorePhysicsComponent::look_for_transfer_target ( const Mth::Vector& search_dir, const Mth::Vector& start_normal, bool& hip_transfer, Mth::Vector& target, Mth::Vector& target_normal )
{
// take a bunch of steps forward until we find one
// This is not very good, as we have to do 80 collision checks....
// we really need to optimize our collision detection to be able to select a set of "nearby" object
// or to select a set that intersects a sphere, or a plane
// (here, we could just get the set that intersects the plane)
// this could be statically cached by the colision code, and have one set
// or perhaps more flexibly, each "feeler" could have a set of objects
// that it deals with (defaulting to the set of all objects)

I thought we could easily port the key mechanics something like Unity physics, but the algorithms are incredibly primitive and rely on the optimized custom physics that they have going. And I think it would be very challenging to optimize it properly in a different engine.

In short, doing anything with this is probably a bad idea for several reasons. It's nice to explore and get inspired if you wanted to potentially make your own Tony Hawk game, and it would be nice to have the latest version (THPG) of these algorithms, but that's about it.

@ericwomer
Copy link

There are engines from Godot to UE4 that could be used.

@ericwomer
Copy link

@swift502 @LWSS @byxor It looks like who ever leaked this (if its even a leak or what) tried to updated it at least after 2011 (C++11)

uint* ptr = reinterpret_cast< uint* >( 0x00000001 );
It looks like someone tried to updated the code, so this may not be vanilla or maybe, like in the code it suggests, may be for other versions of the games. There is also a main in the code,
int main ( sint argc, char** argv )
, so it suggests that the game is here, weather or not the renderware side of it or other deps are here is another question.

@LWSS
Copy link

LWSS commented Dec 19, 2018

@salamanderrake
reinterpret_cast is older than C++11

I do know that they were using gcc, because I saw some __attribute__ when I was trying to get it to compile.

@ericwomer
Copy link

@salamanderrake
reinterpret_cast is older than C++11

I do know that they were using gcc, because I saw some __attribute__ when I was trying to get it to compile.

Yeah, I see that now, I thought all those *_cast were a c++11 thing.

@ericwomer
Copy link

Also we could just wait for the next TH inspired game from a different publisher, http://www.nintendolife.com/news/2018/02/tony_hawk_laments_the_fact_that_he_doesnt_own_the_pro_skater_brand

@byxor
Copy link
Author

byxor commented Dec 28, 2018

@swift502 @salamanderrake

It's exciting to see this discussion suddenly blow up. I don't think pursuing compiling this will be worth it for anyone; It's a lot of work and most people would continue playing THUG Pro anyway.

Maybe someday someone will use this engine to build a full THPS6, but I think THUG Pro is the grand finale of THPS for the foreseeable future. However, don't let me deter you, this would be an exciting project that I could reap the sweet benefits from. 😉

@ericwomer
Copy link

THUG Pro? THPS6? Or are you talking about the codewords for the other no PS games in the code its self? It seems there are conflicting stories about THPS6, on one hand Tony Hawk was talking about continuing the franchise after activation in 20016, but yet again this year in feburary TH said he dosen't own the rights to the THPS brand, so I don't know exactly whats going on. No one would use this engine to make anymore THPS games as its renderer is based of the now defunct renderware library. Well thats not true, as they could pull the THPS code out and use a different rendering library, but thats what they did for the last game I believe.

@byxor
Copy link
Author

byxor commented Dec 29, 2018

@salamanderrake
THUG Pro is a THUG2 mod. It released in ~2014, revived THPS and has had an expanding community ever since. It's the definitive way to play THPS. You can join our discord server if you're interested.

THPS6 doesn't exist.

@michael-fa
Copy link

michael-fa commented Feb 7, 2019

doing anything with this game is probably (better to) just go and reverse the game you'd like to make better..
It's kinda weird for me actually - btw im not that experienced in doing that but I got a really long, hard time reversing it at first.

@byxor
Copy link
Author

byxor commented Feb 7, 2019

A giant chunk of the game is written in the QB scripts anyway (which aren't in this repo). There are QB decompilers and compilers out there (that don't work very well) that make that form of modding much more accessible than C++.

Even if we never recompile or rewrite the engine, we still have control over a large portion of content.

@michael-fa
Copy link

A giant chunk of the game is written in the QB scripts anyway (which aren't in this repo). There are QB decompilers and compilers out there (that don't work very well) that make that form of modding much more accessible than C++.

Even if we never recompile or rewrite the engine, we still have control over a large portion of content.

yep. Thats what you really wanna do overall.. I only reversed all I need to access every qb related stuff - that made did it even tho the engine is weird for me to "understand"

@Cybertwip
Copy link

Has anyone successfully compiled to either platform?

Is the code complete? and if not, what is missing?

@michael-fa
Copy link

michael-fa commented May 11, 2021 via email

@swift502
Copy link

swift502 commented May 11, 2021

@balancedwolf I believe it would be infinitely easier to just borrow the important bits of code for the movement, and all of the magic constants, but replace physics, rendering and UI with a modern day solution (Unity, Unreal), than to piece the code together and reimplement all the ancient or missing libraries and assets.

@Cybertwip
Copy link

I have the Xbox .xbx data files, they can be ripped directly from the original THUG Xbox game, I think this game in particular does not have data encryption, I will try to build an Xbox version, Just wanted to make sure this code is complete, and if not, there could be a restoration task long to be done

@Cybertwip
Copy link

Believing CMake would make it easier to generate solution files for this game in particular, Dev Kits will be needed also, UWP seems happy with anything you throw and it wouldn't be hard to translate between the old Xbox to Xbox One.

@Cybertwip
Copy link

I've forked the project, skatecareer.h is missing, must create, and possibly more files will be missing

You'll need DirectX 8
https://archive.org/download/dx8a_sdk/DX8a_SDK.exe

For Win32 we will need to emulate the Xbox IDirect3DPalette8, which might be as well a texture

I'll keep going in a chance

https://github.com/balancedwolf/thug

Branch is Win32. All PS2 and GameCube source files were removed, so don't expect them

@Cybertwip
Copy link

I wonder if it's worth reconstructing all of this? Probably a few months or years to have it running properly.

@michael-fa
Copy link

michael-fa commented May 15, 2021

There's way too much unmentioned problems or just missing code.
Park editor or some other editors are missing.
I contacted Mick West, and he told me some stuff thats missing, and what "kind of" time/state this is from.

Doing anything, I guess best is to recycle bits of the code.
Better; For anyone expierienced... I follow Mick for game dev stuff, he posted tons of stuff online just go search him.
He explained how to handle game input and process all other stuff in the best way that there's a natural feeling.
Something along the lines about MainLoop - Controller Input -> Game Logic -> Graphics Loop or whatever.

@LWSS
Copy link

LWSS commented May 16, 2021

There's way too much unmentioned problems or just missing code.
Park editor or some other editors are missing.
I contacted Mick West, and he told me some stuff thats missing, and what "kind of" time/state this is from.

Doing anything, I guess best is to recycle bits of the code.
Better; For anyone expierienced... I follow Mick for game dev stuff, he posted tons of stuff online just go search him.
He explained how to handle game input and process all other stuff in the best way that there's a natural feeling.
Something along the lines about MainLoop - Controller Input -> Game Logic -> Graphics Loop or whatever.

Can you post it in here? I just see UFO schizo postings on his twitter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants