Results 1 to 25 of 25
  1. #1

    Question Loading C++ code in UDK

    Hi,

    I'm new to UDK I'm currently evaluating this engine for a project and I'd like to load some simulation code I have in C++.

    Looking at the documentation I found some old document explaining how to load external C++ as DLL and calling it as Native Function.
    http://udn.epicgames.com/Two/NativeFunctions.html

    Is this possible on UDK or was only available of old version of Unreal Engine with public source code?

    Thanks a lot for your help

  2. #2
    MSgt. Shooter Person
    Join Date
    Nov 2009
    Posts
    43

    Default

    Not possible. That feature is what separates the licensee's from the UDK license.

  3. #3
    MSgt. Shooter Person
    Join Date
    Nov 2009
    Posts
    207

    Default

    There is a hack you can do to partially get around the problem. By setting up a second executable on the local machine that is listening you can send it requests via TCPLink. It then executes your code and returns the results. It's slow, inefficient, and not suited to a lot of tasks but might work for you.

    I myself am very disappointed that we cannot run our own independent or 3rd party code as it makes several game types and non-entertainment applications virtually impossible to write effectively or poses an impractical level of porting from existing, tested, and optimized code into unrealscript.

  4. #4
    MSgt. Shooter Person
    Join Date
    Nov 2009
    Posts
    45

    Default

    It would be nice if we got a pre-built sdk (like havok and physx do) that we could use with c++ and extend via plugins.

  5. #5
    MSgt. Shooter Person
    Join Date
    Nov 2009
    Location
    Denmark.
    Posts
    224

    Default

    Would have been nice if there where a lib and some header files for making external dll's (even limited, but executed by the game) like if dll exists "mymod.dll", then execute it and have like 4 functions in there like maybe

    on_load()
    on_unload()
    on_update()
    on_render()

    And where you have access the basic stuff like materials, network, scripting and such from this lib/header stuff.

    But i guess, even in a limited way, it would be giving away too much

    Or maybe perhaps, if even possible, they could find a way to speed up unreal script execution time, that would be awesome too (or change it to something faster).
    Theia Online (Under Construction) http://www.theia-online.com
    Sys: Intel Quad @3.4 Ghz, ATI HD 5770 OC Ed (pri), NVIDIA 8800 Ultra (PhysX), 4 Gig Ram, 3.8 TB total HDD.

  6. #6
    MSgt. Shooter Person
    Join Date
    Mar 2008
    Location
    Madison, WI
    Posts
    131
    Gamer IDs

    Gamertag: PC: PacerEx

    Default

    Quote Originally Posted by jeffro11 View Post
    Not possible. That feature is what separates the licensee's from the UDK license.
    I don't know exactly why native functions are not available for the UDK but I hope, ultimately, the main difference between a full licence and a UDK licence is the commitment of tech support you get from Epic. I hope that Epic decides they can expose native methods in the UDK without it costing them a great deal of time or money.

  7. #7
    MSgt. Shooter Person
    Join Date
    Nov 2009
    Posts
    45

    Default

    it would be nice if unreal script had a feature like python's ctypes, where you can access dlls directly from python, and writing wrappers is really fast

  8. #8
    MSgt. Shooter Person
    Join Date
    Nov 2007
    Location
    The Netherlands
    Posts
    386
    Gamer IDs

    Gamertag: LennardF1989

    Default

    It would be cool if Epic released the header files, so we can compile our own DLL's like we could with UT Classic, which opens native possibilities without having to temper with the real source.

  9. #9

    Default

    Ok I understand the situation.

    Sure it would be great if Unreal Script could interface to DLL or Lib. I'm really not expecting to see anything of unreal source code for free. That is fair enough but just giving the power to Unreal Script to load external DLL would really allow great freedom for the creation of different games. As is UDK is more for mod building. Oh well still nice that is free for everyone to play with. I guess I'll just have to look at something else for my current needs.

    Thanks everyone for the help!

  10. #10
    Skaarj
    Join Date
    Nov 2009
    Location
    Sometimes stay in HangZhou, China, and in Seoul, Korea
    Posts
    2
    Gamer IDs

    Gamertag: head77x

    Default But... What is this description?

    Native(PackageName)
    Indicates that "this class uses behind-the-scenes C++ support". Unreal expects native classes to contain a C++ implementation in the .EXE. Only native classes are allowed to declare native functions or implement native interfaces. Native classes must always derive from another native class. Native classes create an auto-generated C++ header file with the necessary glue to interact with the script variables and specified functions. By default, the PackageName is the package that the script class resides in. For example, if the class were in the Engine package, the resulting auto-generated header would be called EngineClasses.h.

    http://udn.epicgames.com/Three/Unrea...e.html#Classes
    ----------------------------------------------------
    and Here...........
    ----------------------------------------------------
    Advanced function specifiers
    Native
    You can declare UnrealScript functions as native, which means that the function is callable from UnrealScript, but is actually implemented (elsewhere) in C++. For example, the Actor class contains a lot of native function definitions, such as:

    native(266) final function bool Move( vector Delta );
    The number inside the parenthesis after the native keyword corresponds to the number of the function as it was declared in C++ (using the AUTOREGISTER_NATIVE macro), and is only required for operator functions. The native function is expected to reside in the DLL named identically to the package of the class containing the UnrealScript definition.

    http://udn.epicgames.com/Three/Unrea...tionSpecifiers
    ----------------------------------------------------

    Where can I find that UDK not include these features???

    ^^; I wannt try to get information more...
    Last edited by head77x; 11-11-2009 at 08:15 AM.
    Head77x - Netmego.com's CTO

  11. #11
    Redeemer
    Join Date
    Nov 2007
    Posts
    1,207

    Default

    Those references are there because the documentation we have access to is a subset of the full licensee documentation set. Notably the pages on how to actually create native classes are not accessible.
    Nightblade, a stealth based total conversion for UT3

  12. #12
    Redeemer
    Join Date
    May 2000
    Location
    between the monitor and chair
    Posts
    1,523

    Default

    There is no support for C++ code (or any other language than UnrealScript) so stop asking about it.
    If Epic ever decides to include support for native code in the UDK you will be notified.
    Michiel 'El Muerte' Hendriks
    Magicball Network - Little Big Adventure community
    the Unreal Admin page - Unreal server administration
    UnrealWiki - UnrealScript and UnrealEd wiki.
    UnCodeX - powerful UnrealScript tool for programmers

  13. #13
    MSgt. Shooter Person
    Join Date
    Nov 2009
    Posts
    45

    Default

    why not discuss about it?

    feature requesting counts as valuable feedback. how would the developers know what is needed if the people using it don't talk about what their needs are?

    it is odd when feature requests are dealt by some members of the community like this. i believe that this type of comment should have been made by the admins or some other official voice.

  14. #14

    Default

    There are valid requests and pointless requests. Requestzing a feature for free that only licensees are allowed to use belongs to the latter category.
    Wormbo's UT/UT2004/UT3 mods | PlanetJailbreak | Unreal Wiki | Liandri Archives

    <@Mych|Lockdown> ...and the award for the most creative spelling of "Jailbreak" goes to ... "Gandis Jealbrake Server"
    Note that your questions via PMs will be ignored if they actually belong in the forum.

  15. #15
    MSgt. Shooter Person
    Join Date
    Nov 2009
    Posts
    45

    Default

    yes, but shouldn't this be decided by the staff?

    this talk is not about getting the unreal source code, it's about interfacing the engine with exterior components via c++. an sdk if you want. like you get with physx, havok, fmod, and other middle-ware that has a free pre-compiled sdk.

    licensing terms tend to change, making some of the licensees only features available for the rest of us(ie havok physics)

  16. #16
    MSgt. Shooter Person
    Join Date
    Mar 2008
    Location
    Madison, WI
    Posts
    131
    Gamer IDs

    Gamertag: PC: PacerEx

    Default

    Quote Originally Posted by elmuerte View Post
    There is no support for C++ code (or any other language than UnrealScript) so stop asking about it.
    If Epic ever decides to include support for native code in the UDK you will be notified.
    No, keep asking so Epic knows how important that feature is to people.

  17. #17
    MSgt. Shooter Person
    Join Date
    Nov 2009
    Posts
    434

    Default

    Quote Originally Posted by spooky_paul View Post
    yes, but shouldn't this be decided by the staff?

    this talk is not about getting the unreal source code, it's about interfacing the engine with exterior components via c++. an sdk if you want. like you get with physx, havok, fmod, and other middle-ware that has a free pre-compiled sdk.

    licensing terms tend to change, making some of the licensees only features available for the rest of us(ie havok physics)
    Correction, Havok Physics, animation and behavior sdk(binary only version) is free for noncommercial usage. (check their license)
    http://www.havok.com/index.php?page=noncommercial

    and indeed an api to the udk code is appreciated. (no need for engine sourcecodes, just hooks to functions (with example code and api's)
    Last edited by saymoo; 11-11-2009 at 11:48 AM.

  18. #18
    MSgt. Shooter Person
    Join Date
    Mar 2008
    Location
    Madison, WI
    Posts
    131
    Gamer IDs

    Gamertag: PC: PacerEx

    Default

    Quote Originally Posted by Wormbo View Post
    There are valid requests and pointless requests. Requestzing a feature for free that only licensees are allowed to use belongs to the latter category.
    We don't know why Epic has decided to exclude native code execution and we don't know whether it is a possibility for a future release.

  19. #19
    MSgt. Shooter Person
    Join Date
    Nov 2009
    Posts
    45

    Default

    Quote Originally Posted by saymoo View Post
    Correction, Havok Physics is free for noncommercial usage. (check their license)
    The same with FMOD, but both offer SDKs (libs and header files) for non-commercial use.

    LE:Actually Havok is free for games priced up to 10$ (the last lines from here). The ideea was that they both offer a fully-functional SDK.
    Last edited by spooky_paul; 11-11-2009 at 12:04 PM.

  20. #20

    Default

    AFAIK UE3 executables are statically linked. Earlier engine versions could dynamically load DLLs based on package names. That feature was removed from UE3, mainly for security reasons. A game engine that allows you to load arbitary DLLs just invites abuse. As such, it's a good thing you can't load external code. Doing so would also cause several inconsistencies in the engine concepts: Only Unreal packages are downloadable (DLLs, etc. are no packages) and UnrealScript runs in a sandbox that does not have full access to the system.
    Wormbo's UT/UT2004/UT3 mods | PlanetJailbreak | Unreal Wiki | Liandri Archives

    <@Mych|Lockdown> ...and the award for the most creative spelling of "Jailbreak" goes to ... "Gandis Jealbrake Server"
    Note that your questions via PMs will be ignored if they actually belong in the forum.

  21. #21
    Skaarj
    Join Date
    Nov 2009
    Location
    Sometimes stay in HangZhou, China, and in Seoul, Korea
    Posts
    2
    Gamer IDs

    Gamertag: head77x

    Default Where can I get information the license for this features?

    Sorry, elmuerte. I have more questions...

    I just wanna know about this feature more correctly.
    Because, If someone want to get license ( include my company ), he must know about this more correctly.

    If UDK does not include this feature, How I can get this feature? Will Epic send to me the other version's UDK after contract?

    I hope if someone know about this, please notice.....
    Head77x - Netmego.com's CTO

  22. #22
    MSgt. Shooter Person
    Join Date
    Mar 2008
    Location
    Madison, WI
    Posts
    131
    Gamer IDs

    Gamertag: PC: PacerEx

    Default

    Maybe there could be separate security domains for UScript execution so that only "blessed" scripts can execute certain native methods.

  23. #23
    MSgt. Shooter Person
    Join Date
    Nov 2009
    Posts
    45

    Default

    Quote Originally Posted by Wormbo View Post
    AFAIK UE3 executables are statically linked. Earlier engine versions could dynamically load DLLs based on package names.
    The static linking is the only way you can go on consoles. And having only one code base is justifiable.

    Quote Originally Posted by Wormbo View Post
    That feature was removed from UE3, mainly for security reasons. A game engine that allows you to load arbitary DLLs just invites abuse.
    How?

  24. #24
    Redeemer
    Join Date
    May 2000
    Location
    between the monitor and chair
    Posts
    1,523

    Default

    Quote Originally Posted by spooky_paul View Post
    why not discuss about it?
    Of course you are free to discuss anything you like. But there is no point in putting forth feature request Epic knows about that various people want, but has already decided not to act upon.

    Quote Originally Posted by spooky_paul View Post
    yes, but shouldn't this be decided by the staff?
    They already decided. Otherwise the UDK would have shipped with headers. Also given the fact that UE3 is statically linked and does not have any standard functionality for loadable modules. In that case Epic would need to implement a loadable module support specific for UDK, which will take quite some effort and thus will probably have a very low priority.

    Quote Originally Posted by pacerx View Post
    No, keep asking so Epic knows how important that feature is to people.
    Epic knows about it. It has been asked for in the past 7 years. If they ever decide to grant native code possibilities (like they have previously done with the UE2Runtime in certain license constructions) you will read about it in an update from Epic.

    Quote Originally Posted by pacerx View Post
    We don't know why Epic has decided to exclude native code execution and we don't know whether it is a possibility for a future release.
    See above.

    Quote Originally Posted by head77x View Post
    Sorry, elmuerte. I have more questions...

    I just wanna know about this feature more correctly.
    Because, If someone want to get license ( include my company ), he must know about this more correctly.

    If UDK does not include this feature, How I can get this feature? Will Epic send to me the other version's UDK after contract?
    Right now, the only way to get this functionality is by getting a full license. And as far as I know Epic is dedicated to keep releasing updated version of the UDK for some while.

    If Epic ever decides to to create an additional UDK license (besides the 3 they have now) you will probably read about it in nice big friendly letters on udk.com and this forum.
    Michiel 'El Muerte' Hendriks
    Magicball Network - Little Big Adventure community
    the Unreal Admin page - Unreal server administration
    UnrealWiki - UnrealScript and UnrealEd wiki.
    UnCodeX - powerful UnrealScript tool for programmers

  25. #25
    MSgt. Shooter Person
    Join Date
    Nov 2009
    Posts
    207

    Default

    The only reason Epic will decide to reconsider their stance on the subject of native code is if it's in their financial interests. That being said the more people that want this feature, will use this feature, and most importantly will make additional revenue off of this feature tips the balance in favor of implementation. Making them aware of our existence and why and how it will help both parties is a worthwhile goal.

    Clearly someone ran the numbers and decided to change their long standing policy on not being able to sell mods without a full priced license. Things change, this can be one of them.


 

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Copyright ©2009-2011 Epic Games, Inc. All Rights Reserved.
Digital Point modules: Sphinx-based search vBulletin skin by CompletevB.com.