logo
Main

Forums

Downloads

Unreal-Netiquette

Donate for Oldunreal:
Donate

borderline

Links to our wiki:
Wiki

Walkthrough

Links

Tutorials

Unreal Reference

Usermaps

borderline

Contact us:
Submit News
Page Index Toggle Pages: 1 Send TopicPrint
Hot Topic (More than 10 Replies) [HP1] ScriptSource, headers and precompiled binaries. (Read 5304 times)
han
Global Moderator
Unreal Rendering Guru
Developer Team
*****
Offline


Oldunreal member

Posts: 572
Location: Germany
Joined: Dec 10th, 2014
Gender: Male
[HP1] ScriptSource, headers and precompiled binaries.
Oct 22nd, 2015 at 7:25pm
Print Post  
Based on my headers for Disney's Brother Bear I made headers for Harry Potter and the Philosophers Stone. Afterwards I use a slightly modified UExporter to extract the ScriptSource using the batchexport commandlet.

ScriptSource:
http://coding.hanfling.de/launch/nonofficial/HarryPotterScriptSource.zip
http://coding.hanfling.de/launch/nonofficial/HarryPotterScriptSource11.zip

Unofficial PubSrc:
http://coding.hanfling.de/launch/nonofficial/HarryPotterPubSrc11_20170323.zip *new*
http://coding.hanfling.de/launch/nonofficial/HarryPotterPubSrc11_20151205.zip

Precompiled Binaries:
http://coding.hanfling.de/launch/nonofficial/HarryPotterPubSrc11_Binaries_201703...*new*
http://coding.hanfling.de/launch/nonofficial/HarryPotterPubSrc11_Binaries_201512...

I would love to see someone using this to make a patch for this game addressing the widescreen issue or to add a multiplayer. Smiley
« Last Edit: Mar 23rd, 2017 at 10:38pm by han »  

HX on Mod DB. Revision on Steam. Löffels on Patreon.
Back to top
 
IP Logged
 
[]KAOS[]Casey
Developer Team
Betatester
Offline


nedm

Posts: 3200
Joined: Aug 7th, 2011
Gender: Male
Re: [HP1] Script Source and UCC
Reply #1 - Oct 22nd, 2015 at 7:51pm
Print Post  
You can't just use setres or ini modify for widescreen, or is FoV locked? There are ways in unreal 1 to just directly use a "set" command to set your fov, if "setfov" is blocked, i think you do set playerpawn desiredfov or fov directly. This is all just off the top of my head
  
Back to top
 
IP Logged
 
han
Global Moderator
Unreal Rendering Guru
Developer Team
*****
Offline


Oldunreal member

Posts: 572
Location: Germany
Joined: Dec 10th, 2014
Gender: Male
Re: [HP1] Script Source and UCC
Reply #2 - Oct 22nd, 2015 at 8:29pm
Print Post  
The problems are actually more severe. The game UI is scaled to match the horizontal resolution while beeing initially designed for 4:3 resolutions. This basically cuts off parts of the menus. The main menu screen already misses two out of four buttons. However, I haven't checked in detail what is affected. The same issue is still present in Disney's Brother Bear and likely in HP2 too.

It would also be nice to have more resolutions to selectable on the options screen because just 640x480 / 800x600 / 1024x768 are selectable.
  

HX on Mod DB. Revision on Steam. Löffels on Patreon.
Back to top
 
IP Logged
 
han
Global Moderator
Unreal Rendering Guru
Developer Team
*****
Offline


Oldunreal member

Posts: 572
Location: Germany
Joined: Dec 10th, 2014
Gender: Male
Re: [HP1] ScriptSource, headers and precompiled binaries.
Reply #3 - Dec 5th, 2015 at 12:34am
Print Post  
First public release of my unofficial headers for Harry Potter. See first post for download links.

Readme:
Quote:
These are Headers/Libs for Harry Potter and the Philosophers Stone 1.1,
to enabled C++ programming for this Game.

They headers are based on unrealpubsrc224v, ut432pubsrc, UnrealPubSrc227i
and ut436-opengldrv-src-090602. The Libs were created with dumpbin/lib.

Contents:
Core                  Headers/Libs for Core.dll
Engine                  Headers/Libs for Engine.dll
Window                  Headers/Libs for Window.dll
DirectX7            Headers/Libs needed for D3DDrv
D3DDrv                  D3DDrv out of ut432pubsrc with minor changes
OpenGLDrv            OpenGLDrv out of ut436-opengldrv-src-090602 with minor changes
SamplePackage            Sample for packages out of ut432pubsrc
SampleNativePackage      Sample for native packages out of ut432pubsrc
Launch                  Launcher based on unrealpubsrc224v/UnrealPubSrc227i
UCC                  UCC out of ut432pubsrc with minor changes

12/2015 by Sebastian Kaufel

Visit http://coding.hanfling.de/launch/


I also uploaded prebuild binaries for the projects in the PubSrc (UCC, Launch, D3DDrv, OpenGLDrv). I haven't changed much on these compared to their orginal source. For UCC it is basically just added loading exporters and factories based on int entries. Launch is not exactly as in the game, but instead shows the config wizard (and does not enforce SoftDrv or D3DDrv anymore) and also includes code to make sure at least 5ms passes between frames (else the game runs too fast). Log files are not saved in the user directory. D3DDrv/OpenGLDrv basically just have the DrawTriangles/MaxVertices implemented compared to their original source.

So have fun with it.
  

HX on Mod DB. Revision on Steam. Löffels on Patreon.
Back to top
 
IP Logged
 
Solid_Snake FirePhoenix
Full Member
***
Offline


stray lone wolf

Posts: 130
Location: Planning Project "Platinum"
Joined: Jul 31st, 2015
Gender: Male
Re: [HP1] ScriptSource, headers and precompiled binaries.
Reply #4 - Dec 5th, 2015 at 11:01am
Print Post  
so basically the game can be modded now?
  
Back to top
IP Logged
 
han
Global Moderator
Unreal Rendering Guru
Developer Team
*****
Offline


Oldunreal member

Posts: 572
Location: Germany
Joined: Dec 10th, 2014
Gender: Male
Re: [HP1] ScriptSource, headers and precompiled binaries.
Reply #5 - Dec 5th, 2015 at 11:33am
Print Post  
Yes.
  

HX on Mod DB. Revision on Steam. Löffels on Patreon.
Back to top
 
IP Logged
 
Solid_Snake FirePhoenix
Full Member
***
Offline


stray lone wolf

Posts: 130
Location: Planning Project "Platinum"
Joined: Jul 31st, 2015
Gender: Male
Re: [HP1] ScriptSource, headers and precompiled binaries.
Reply #6 - Dec 6th, 2015 at 7:38pm
Print Post  
well all right! good job han solo. I hope too see some downloadable mods for the HP game in the near future. imagine the whole game being remade as a whole unreal game where you gib skarrj throughout hogwarts. most of the maps in HP1 look like perfect DM maps. Grin
  
Back to top
IP Logged
 
dustinechoes849
Senior Member
****
Offline


General Protection Fault!

Posts: 346
Location: /home/dustinechoes849/unreal/
Joined: Feb 28th, 2015
Gender: Male
Re: [HP1] ScriptSource, headers and precompiled binaries.
Reply #7 - Apr 9th, 2016 at 2:31am
Print Post  
Solid_Snake FirePhoenix wrote on Dec 6th, 2015 at 7:38pm:
well all right! good job han solo. I hope too see some downloadable mods for the HP game in the near future. imagine the whole game being remade as a whole unreal game where you gib skarrj throughout hogwarts. most of the maps in HP1 look like perfect DM maps. Grin


we need this
  


don't bother trying to message me over AIM, I haven't used that in years lol
I have a Discord, the number thingie is #6413
Back to top
IP Logged
 
djbff
New Member
*
Offline


Oldunreal member

Posts: 5
Joined: Jan 17th, 2017
Re: [HP1] ScriptSource, headers and precompiled binaries.
Reply #8 - Jan 17th, 2017 at 5:28am
Print Post  
han wrote on Oct 22nd, 2015 at 7:25pm:
Based on my headers for Disney's Brother Bear I made headers for Harry Potter and the Philosophers Stone. Afterwards I use a slightly modified UExporter to extract the ScriptSource using the batchexport commandlet.

ScriptSource:
http://coding.hanfling.de/launch/nonofficial/HarryPotterScriptSource.zip
http://coding.hanfling.de/launch/nonofficial/HarryPotterScriptSource11.zip

Unofficial PubSrc:
http://coding.hanfling.de/launch/nonofficial/HarryPotterPubSrc11_20151205.zip

Precompiled Binaries:
http://coding.hanfling.de/launch/nonofficial/HarryPotterPubSrc11_Binaries_201512...

I would love to see someone using this to make a patch for this game addressing the widescreen issue or to add a multiplayer. Smiley


This is awesome, thanks so much. I got a wave of nostalgia recently and decided to start playing with this and the second HP game again, and was wondering if any of the fancy Unreal Engine 1 enhanced renderers could be used to pretty it up any. An OpenGL driver is definitely a step in the right direction!

Being super curious what the insides of a game that defined my childhood actually looked like, I've spent about an hour or so going over the code and seeing how they scripted everything. Some of the comments are pretty funny Grin :

Code
Select All
//Uh oh, is this a hack?  dunno.  Seems ok.  If Vold has been killed, add 60 points to harrys house points.
playerHarry.Add60HousePointsToGryffindor(); 



But to more interesting matters, I've done some digging on the widescreen menu clipping issue and I think I've found the root of it. Everything in the menus seems to be layed out internally on a canvas of 640x480 and then stretched to whatever resolution you're running at. The problem is that the way it sets the dimensions using this code (example taken from FEBook.uc starting at line 730):

Code (C++)
Select All
if(bResolutionChanged)
		{
		root.SetScale(root.realwidth/640);
		bResolutionChanged=false;
		} 



This code would work great for any screen that had an aspect ratio the same as 640x480 but would result in a cropped screen exactly like what we're seeing when using any other aspect ratio. A possible fix:

Code (C++)
Select All
if(bResolutionChanged)
		{
		root.SetScale(root.realheight/480);
		bResolutionChanged=false;
		} 



This means that the menu will be to the left side instead of being centred and will have a big bar to its right, but will not be cropped at the bottom at any resolution wider than 640x480. This will need to be fixed in a couple places, but is probably easy as a project-wide search-and-replace. Ideally, we could also figure out a way to centre the menu canvas as well (x origin = root.realwidth / 2 - (root.realheight * (4/3)) / 2  would work on the math end, we'd just need to inject that value where it counts).

The problem now is that I have no idea how to make a patch from these .uc files to test it out. I'm pretty new to tinkering with the Unreal Engine so you'll have to forgive my disorientation. Can you instruct me on how to do this?

Also, have you tried this source extraction process with HP2: Chamber of Secrets yet? It's not as badly affected by the widescreen clipping bug as HP1 but it would be nice to take a look at its guts and use an updated D3D or OpenGL renderer with it as well.
  
Back to top
 
IP Logged
 
han
Global Moderator
Unreal Rendering Guru
Developer Team
*****
Offline


Oldunreal member

Posts: 572
Location: Germany
Joined: Dec 10th, 2014
Gender: Male
Re: [HP1] ScriptSource, headers and precompiled binaries.
Reply #9 - Jan 23rd, 2017 at 11:18pm
Print Post  
djbff wrote on Jan 17th, 2017 at 5:28am:
Being super curious what the insides of a game that defined my childhood actually looked like, I've spent about an hour or so going over the code and seeing how they scripted everything. Some of the comments are pretty funny Grin

Sound like a resonable start.

Quote:
But to more interesting matters

I think one could tinker with options for stretched/touch inside/unscaled center when it comes to the general layout. Another relevant point would be to add some dynamic resolution selection as other games offer. Code for that can be found in like most other games...

Quote:
The problem now is that I have no idea how to make a patch from these .uc files to test it out. I'm pretty new to tinkering with the Unreal Engine so you'll have to forgive my disorientation. Can you instruct me on how to do this?

I recommend starting with reading: http://www.hypercoop.tk/infobase/archive/unrealtech/frameset.htm
Starting at "Level Design" all the way down. "Mod Development" should cover the basic about how to build a package. However there might be some subtle differences. Looks like some games including HP1 try to even recompile scripts if (afaik) the last modification timestamp of the script files is newer than the package file (touch will help), which can be annoying.

In general there are two options for a patch: Create additional packages, and pull in your classes as there are numerious config options in the ini file (Console (as a start for replacing the rootwindow class and other ui stuff), GameInfo, Player class, etc.).

The other option is to rebuild the stock packages. Typically this is a bad idea as this can easily conflict with other people work, but I don't think this will be an issue for this game at all, and probably the better starting point for a patch project. However, this requires that one does have the (extracted) resources the package imported. [Eventually commenting out the resource import lines without deleting the package files with the changed behaviour when recompiling does actually work without having the resources].

In any case, currently it is not possible to extract all resources in HP1, but I started porting over a heavily stripped down version of my toolkit package and started to extending it to support exporting of the remaining required resources. I'll release that once I wrapped up the remaining things. So far, I already fixed a couple of issues in the headers during the process, so there will be an updated header release too. Below is a breakdown of resource types include in the *.u files. Typically you won't require all types for each package, so some packages end up beeing easier to rebuild from scratch.

Packages
Though I haven't checked it in detail, it looks like they actually ship all packages they embedded inside the *.u files. Otherwise I already ported over my commandlet to extract those.

Sounds
Already supported out of the box.

Textures
Also supported out of the box, might fail when encountering ScriptedTextures or FractalTextures inside embedded packages. However my batchexportcommandlet won't fail in this case. Only thing one needs to be aware of is that for very low texture dimensions the stock texture exporters do have troubles. But usually either pcx or bmp will work even for those.

James Meshes (*_[a|d].3d)
Extracting those with my exporter derived from those Smirftsch gave me once seems to work fine. And yes there are a few of them inside HP1.

Bitmap Fonts
Basically those are textures with some glyph borders, which do get removed during import. I have an exporter with some heuristics which can reconstruct those, and it seems to work correct for HP1 too.

TrueType Fonts
These come in two flavors in HP1. The 'classic' like for any other game beeing sampled while imported, so in this case you need the Fonts installed on your system. Whats new in HP1 is the 'RenderNative' option. In this case just the font name and height is stored. So you won't have to worry about those.

Skeletal Meshes/Animations
I have some limited success with the SkeletalMesh and Animation exporter Smirftsch supplied. Extracting SkeletalMeshes does work and they appear to show up correct inside a *.psk viewer. I think I still got a crash when encountering a specific SkeletalMesh, but I need to recheck this.
For Animations the situation isn't that easy. They did some changes to the storage of the skeletal animation. One being that they just store references to (probably the) KeyQuat/Pos/Time inside the AnalogTracks to some per Animation array, which now isn't any issue anymore. But the other change is that they seem to not use FQuat/FVector/FLOAT for those, but instead 6/6/1 byte. So I need to figure out their storage format, but I still have a couple of ideas to try left...

Gestures
This is a HP specific resource (using the PATTERN IMPORT lines) with *.hpg (Harry Potter Gesture?) files. I haven't checked it yet, but I suspect that these are some homebrew format which more or less mirrors whats inside the Gesture class. So far I don't expect that this would get to complicated to figure out.


Quote:
Also, have you tried this source extraction process with HP2: Chamber of Secrets yet? It's not as badly affected by the widescreen clipping bug as HP1 but it would be nice to take a look at its guts and use an updated D3D or OpenGL renderer with it as well.

I tried a bit of a different approach though, though I have some apparently more or less working UCC exectuable for it now. However the script source have been stripped out of all packages but Core, Engine and Editor (same as for Brother Bear), so one doesn't get very far so easily. In any case I haven't yet started any major work on building a header set for HP2 to build an run some more own C++ code. More or less I wan't to wrap up things for HP1 and probably for Brother Bear first as HP2 is the game they released in between. So chances are that most of the stuff is sth. in between.

I'll build headers for this game at some point, but that is likely not gonna happen anytime soon. However regarding the missing script text, it consists of two parts: the resource imports and the 'real' script code. I have some commandlet to reconstruct the resources import lines, though it currently lacks support for SkeletalMeshes, the special rendernative ttf fonts and Gestures. In any case one needs to figure out otherwise used TTF fonts by hand. When it comes to 'real' script code, I currently working on some script text rebuilder/function decompiler commandlet. So far I'm halfway through with the easy part as in reconstructing the general class layout and defprops, e.g. what one gets for free when one runs it in context of the game. There are other script decompilers out there. Afaik all of them are standalone tools, and I have no idea how reliable they are and whether they support HP2. The only decompiler I tried was the one in UExplorer, and it has a lot of issues, most noticable a lot of declarations beeing off, functions inside state code entirely missing and unusuable defaultproperties. So in any case, even if I just get to the point before decompiling functions it'll probably still be a nice complement to other script decompilers.
Another rather exotic idea I have is to make use of the stored ScriptCRC (unless it got invalidated when the script source was stripped) to build a database of the ScriptCRCs in HP2 and compare it to those of HP1 (and eventually other games). I have the hope that this will at least yield some matches to get back the exact source. Probably there are a lot of classes inside UWindow unchanged.

So much for now..
  

HX on Mod DB. Revision on Steam. Löffels on Patreon.
Back to top
 
IP Logged
 
han
Global Moderator
Unreal Rendering Guru
Developer Team
*****
Offline


Oldunreal member

Posts: 572
Location: Germany
Joined: Dec 10th, 2014
Gender: Male
Re: [HP1] ScriptSource, headers and precompiled binaries.
Reply #10 - Feb 1st, 2017 at 2:18pm
Print Post  
Small status update:
I added support for Gestures to HTK. So far the the exported and reimported and exporterd again gesture files are the same on disk. I still do want to write some simple diff commandlet to compare them inside the packages to remove last doubts. I expect them to fully work though.

Situation for SkeletalMeshes and Animations is more complicated. The crash I prior reported was a bug in the code I got and trivial to fix. Remapping of the PolyFlags to the in psk PolyFlags was also missing and I added that.

However after a lot of experimentation I noticed that the reference skeleton in the psk files are sometimes flipped, rotatated, etc. and that the bone animations not applied to the mesh faces did otherwise play fine.

Turned out they flipped the Orientation.W component of the root bone compared to ut. After applying this change to the reference skeletons root bone on export the reference skeleton exports fine, the animations applied to the mesh don't screw up anymore but when playing the animations the mesh jumps to the orientation of the reference skeleton without the Orientation.W flip. I think I need to apply this flip at some point in the animation exporter too, but I haven't spent much time on this yet.

One thing I want to do for the skeletal mesh exporter is to double check on the Materials as I suspect that eventually some remapping is required there in certain situations. Also I want to rebuild material names in a way the ActorX exporter would produce the same ordering/polyflags if this mesh would be loaded in this form into Max/Maya. Basically I would like to wrap this up before moving towards working on the animation export.

For animation export there are a few things worth to mention. PSA files do use a fixed animation rate, so the time between animation frames is always constant. However the animation importer can drop animation frames so this rate gets non constant. I'm not aware whether the importer can add additional keyframes at some random point in between. If I understood it correctly so far, the current animation exporter source exports NumFrames# animation frames as stored in the FMeshAnimSeq. So far I don't know whether this value refers to the original number of keyframes or the reduced one.
Afterwards the exporter exports make up NumFrames equal distanced timestamps to be and exports the animation at this frames, either by interpolation or by taking an animation frame as is by some small epsilon test. However in case of KWG the animation frames are always integer multiples of a floating point value (e.g. quantized), so it would make sense to either add an option (in case AnimSq.NumFrame is not the orginal pre import keyframe count) or to always (in case AnimSq.NumFrame is the original pre import keyframe count) to match this quantization on import and export the existing keyframes as is (after decompression them out of the FAnimVec's) and just interpolate the positions in between. In any case I need to check if this is also true for animations in like UT, where the timestamps of the animation frames are float. Eventually the current code actually does it implicit by the epsilon test. If this in fact the case I prefer rewriting the code to make this explicit.

So much for my SkeletalMesh/Animation trial by fire first encounter.
  

HX on Mod DB. Revision on Steam. Löffels on Patreon.
Back to top
 
IP Logged
 
han
Global Moderator
Unreal Rendering Guru
Developer Team
*****
Offline


Oldunreal member

Posts: 572
Location: Germany
Joined: Dec 10th, 2014
Gender: Male
Re: [HP1] ScriptSource, headers and precompiled binaries.
Reply #11 - Mar 23rd, 2017 at 10:40pm
Print Post  
New Header release, including rebuild binaries out of the PubSrc. For the binaries I think the only relevant changes was an addition of an -preferences option to HP.exe, which just pops up the preferences aka advanced options windows. This feature is sort of handy for HTK.
  

HX on Mod DB. Revision on Steam. Löffels on Patreon.
Back to top
 
IP Logged
 
Huckleberry Pie
New Member
*
Offline


Oldunreal member

Posts: 4
Joined: Nov 3rd, 2018
Re: [HP1] ScriptSource, headers and precompiled binaries.
Reply #12 - Nov 3rd, 2018 at 10:31am
Print Post  
Solid_Snake FirePhoenix wrote on Dec 6th, 2015 at 7:38pm:
well all right! good job han solo. I hope too see some downloadable mods for the HP game in the near future. imagine the whole game being remade as a whole unreal game where you gib skarrj throughout hogwarts. most of the maps in HP1 look like perfect DM maps. Grin

Excuse for the bump, but I've actually ported the Hogwarts hallway map from HP3 to UT2003 some eight years ago. It was just the matter of figuring out how to export the static meshes and reimport them to something that UT2003 can understand, albeit with some flickering issues if I may recall. I've lost the sources to them unfortunately, but it was fun fragging random characters in that map lol.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint
Bookmarks: del.icio.us Digg Facebook Google Google+ Linked in reddit StumbleUpon Twitter Yahoo