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

Improvements for Duke Nukem Forever (2011) #85

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

DaZombieKiller
Copy link

@DaZombieKiller DaZombieKiller commented Jul 6, 2024

  • DNF uses var pointer(T) instead of var pointer syntax
  • delegate<T> fields are compiler-generated in DNF and cannot be defined in source
  • FUNC_Delegate is 0x400000 in DNF
  • 0x20000000 is FUNC_DevExec, it is often combined with 0x200 which gives 0x20000200
  • 0x00800000 is CPF_Comment and the syntax is var T name ?("comment");

@DaZombieKiller
Copy link
Author

I wonder if it's worth implementing a class/property flag remapper like what exists for UnrealScript opcodes. Then UELib can have its own internal representation of the flags that can be safely checked, instead of needing to manually remap and handle engine-specific flags (especially for cases where the same flag happens to be stored in a different bit compared to most implementations). Any thoughts on this?

@EliotVU
Copy link
Owner

EliotVU commented Jul 6, 2024

Looking good, I'll leave it open for now, as you are still pushing commits.

@EliotVU
Copy link
Owner

EliotVU commented Jul 6, 2024

I wonder if it's worth implementing a class/property flag remapper like what exists for UnrealScript opcodes. Then UELib can have its own internal representation of the flags that can be safely checked, instead of needing to manually remap and handle engine-specific flags (especially for cases where the same flag happens to be stored in a different bit compared to most implementations). Any thoughts on this?

Yes, see

public enum PackageFlag

I ran into this issue badly when supporting UE4 package flags, and implemented a way to abstract the unique flags for any particular game. It's only a matter of duplicating the efforts for all classes, or those with the most impact.

@EliotVU EliotVU added game Game specific ue2 labels Jul 6, 2024
@DaZombieKiller
Copy link
Author

I might attempt that in a separate PR later then, since it's probably out of scope for this one. The changes I have now should be the last of them, so feel free to merge the PR if it looks good.

If you want to mess around with the DNF compiler yourself, I have a (heavily WIP) reconstructed SDK and UCC available here: https://github.com/DaZombieKiller/DukeForeverSDK (feel free to open a discussion there if you need help setting it up, I haven't written any documentation yet).

@EliotVU
Copy link
Owner

EliotVU commented Jul 15, 2024

Thanks, I'll merge this later, I plan to adjust some changes like 'IsCompilerGenerated' to generalize it for all games, e.g. generated delegates are expected to be prefixed with 'DELEGATE'

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

Successfully merging this pull request may close these issues.

None yet

2 participants