Results 1 to 24 of 24
  1. #1
    Skaarj
    Join Date
    Jun 2012
    Location
    Belgium, Originally Canada
    Posts
    18

    Default Porting a game from just C++ "engine" to UDK?

    Hey guys, I'm new to the forums and pretty new to UDK as well, (I've looked at very basics from the Mastering Unreal Tech vol.1)

    My question is fairly simple but looking through the Mastering book all I see is level design stuff which isn't exactly what I need. I have made classes in C++ for making a procedurally generated map in 3D (a dungeon explorer type of game) and I'm wondering if I can just take them into UDK with some fair ease and make it run there or if I have to completely re do them all in unrealscript etc to make it work again.
    It was an exam project but now that that's done I would very much like to keep working on it as I think it could be a pretty decent game.

    I have started looking through the Getting Started: Programming Pages (just found while writing this post) so I don't know if my question is fully answered in there or not. Any replies on this would be great. I think UDK would be pretty perfect and make this game development quite a bit easier if it's not to much hassle to integrate my classes (they have a bit of DirectX code in them right now which can be taken out fairly easily though).

    Thanks ahead of time for any replies

  2. #2
    Boomshot
    Join Date
    Aug 2011
    Posts
    2,287

    Default

    Aside from other issues you may face regarding dynamically generated levels in UDK, let's address the code port.

    There is no direct access to C++ in UDK without a full UE3 license (big money). So you have two options.

    1) Port the code to UnrealScript. It should be more than capable of handling it, but you'll need to adjust to the language which is different to c++.

    2) Use DLLBind to encapsulate your code in C++ and communicate results between it and UnrealScript.

    I would choose option 1. The burden of interfacing with the DLL may not be worth the effort considering you will still have to do a lot of coding in UnrealScript for both the communication wrapper and actual level generation. There are lots of limitations with DLLBind.

    http://udn.epicgames.com/Three/DLLBind.html

  3. #3
    Skaarj
    Join Date
    Jun 2012
    Location
    Belgium, Originally Canada
    Posts
    18

    Default

    Hmm, that's unfortunate. Well good to know I guess. Doesn't seem like UScript is to different from C++ itself. Off the top of my head, is there a rand function in Uscript? Cause I'll need a random (preferably like srand() or else the levels will probably start repeating more often than not...). With my generated levels, I have some meshes I made in Max that I use as they are all tiles so like a corner tile, single wall tile and a few others, does UDK handle OBJ's or is it some other thing I have to export again?

    Thanks for the reply though, really appreciate it. Guess I'll start reading the UScript tutorials :P. Either way, probably good practice anyway cause next year I need to work in UDK for school for level design.

  4. #4
    Boomshot

    Join Date
    Feb 2010
    Location
    Portugal
    Posts
    2,162

    Default

    Quote Originally Posted by TooLzor View Post
    Hmm, that's unfortunate. Well good to know I guess. Doesn't seem like UScript is to different from C++ itself. Off the top of my head, is there a rand function in Uscript? Cause I'll need a random (preferably like srand() or else the levels will probably start repeating more often than not...). With my generated levels, I have some meshes I made in Max that I use as they are all tiles so like a corner tile, single wall tile and a few others, does UDK handle OBJ's or is it some other thing I have to export again?

    Thanks for the reply though, really appreciate it. Guess I'll start reading the UScript tutorials :P. Either way, probably good practice anyway cause next year I need to work in UDK for school for level design.
    I'm not sure if UDK can import obj files. But it can import FBX.

  5. #5
    Skaarj
    Join Date
    Jun 2012
    Location
    Belgium, Originally Canada
    Posts
    18

    Default

    Ah great, that should work too cause I know Max can export FBX too.

  6. #6
    Iron Guard
    Join Date
    Nov 2007
    Location
    USA
    Posts
    662

    Default

    Yes, Rand is built in, here are some useful functions.

    http://wiki.beyondunreal.com/Legacy:..._Functionality

    I'd recommend using yoru C++ as a prototype but re-implement in UnrealScript. You can probably keep the majority of your class structure intact, mirroring in in UnrealScript and name the functions the same so you can keep the layout straight in your head. The guts of the functions will probably be different. It would be smart to add a little at a time, testing to make sure the project compiles and runs as expected instead of trying to port everything at once.

    (Pretty sure ) You will need to import your assets into the UDK Editor and make them packages, which you can then work with from UnrealScript. I saw the FBX import comment above, I haven't used that.
    Last edited by mikepurvis; 06-11-2012 at 11:13 AM.

  7. #7
    Skaarj
    Join Date
    Jun 2012
    Location
    Belgium, Originally Canada
    Posts
    18

    Default

    Ah you guys are great. So let me get this straight though, if I bought the $99 commercial license, then I could have access to using just my C++ or would I still have to port to UScript/dllBind? Cause if it's only 99 that's not to shabby really.

  8. #8
    Boomshot

    Join Date
    Feb 2010
    Location
    Portugal
    Posts
    2,162

    Default

    Quote Originally Posted by TooLzor View Post
    Ah you guys are great. So let me get this straight though, if I bought the $99 commercial license, then I could have access to using just my C++ or would I still have to port to UScript/dllBind? Cause if it's only 99 that's not to shabby really.
    IIRC you'd need another type of license to get access to C++, and you'd have to pay much more.

  9. #9
    Boomshot
    Join Date
    Aug 2011
    Posts
    2,287

    Default

    Quote Originally Posted by TooLzor View Post
    Ah you guys are great. So let me get this straight though, if I bought the $99 commercial license, then I could have access to using just my C++ or would I still have to port to UScript/dllBind? Cause if it's only 99 that's not to shabby really.
    No, you gain nothing from the license except the right to publish. Don't confuse UDK licensing with UE3 licensing.

    UnrealScript is an object-oriented language and comes with all the faculties you might expect for game development.

    http://udn.epicgames.com/Three/Unrea...Reference.html

  10. #10
    Skaarj
    Join Date
    Jun 2012
    Location
    Belgium, Originally Canada
    Posts
    18

    Default

    yea I'm reading the UScript ref now. Ah I didn't understand that part before. Is kind of a shame but ok guess it's time to learn UScript. @Mike, Yea I wouldn't even think of trying to port everything at once when it's new syntax/language haha, that's just asking for explosions where there shouldn't be any.

  11. #11
    MSgt. Shooter Person
    Join Date
    Feb 2011
    Location
    Denmark
    Posts
    282

    Default

    Quote Originally Posted by TooLzor View Post
    Ah you guys are great. So let me get this straight though, if I bought the $99 commercial license, then I could have access to using just my C++ or would I still have to port to UScript/dllBind? Cause if it's only 99 that's not to shabby really.
    No the 99$ is for what you got now if you make something and release it. The 'big money' is for a UE3 licence which they don't put a price on on their pages, loose estimates says 300.000$ I believe.

    Edit -> when you walk away from your pc to make a toast and come back and press post then you get delayed post like this one.
    Last edited by jpvg; 06-11-2012 at 11:35 AM.

  12. #12
    Skaarj
    Join Date
    Jun 2012
    Location
    Belgium, Originally Canada
    Posts
    18

    Default

    Hud/Scaleform, I've seen a topic on scaleform in the UDN. Is that actually integrated with UDK or is it another thing you would have to actually buy from Autodesk to integrate with UDK? Would be pretty sweet if it came with it haha.

  13. #13
    Boomshot

    Join Date
    Feb 2010
    Location
    Portugal
    Posts
    2,162

    Default

    Quote Originally Posted by TooLzor View Post
    Hud/Scaleform, I've seen a topic on scaleform in the UDN. Is that actually integrated with UDK or is it another thing you would have to actually buy from Autodesk to integrate with UDK? Would be pretty sweet if it came with it haha.
    From my experience you need to download Adobe Flash. I think there's a student version, not sure tough.

  14. #14
    MSgt. Shooter Person
    Join Date
    Feb 2012
    Posts
    265

    Default

    Quote Originally Posted by TooLzor View Post
    Hud/Scaleform, I've seen a topic on scaleform in the UDN. Is that actually integrated with UDK or is it another thing you would have to actually buy from Autodesk to integrate with UDK? Would be pretty sweet if it came with it haha.
    Yes, Scaleform is fully integrated into UDK. The development tool(s) (Adobe Flash Professional), not so much.

  15. #15
    MSgt. Shooter Person
    Join Date
    May 2012
    Posts
    139

    Default

    adobe flash professional can be rented for $29 a month for at will cancellation, or $19 a month for a year long contract with them. Source

  16. #16
    Skaarj
    Join Date
    Jun 2012
    Location
    Belgium, Originally Canada
    Posts
    18

    Default

    So, Adobe Flash Pro cs5.5 should suffice? Got it in my cs5...just not installed. (the joys of student licenses...finally coming in handy :P)

  17. #17
    Iron Guard
    Join Date
    Nov 2007
    Location
    USA
    Posts
    662

    Default

    Yes. 4 will also work.

  18. #18
    Skaarj
    Join Date
    Jun 2012
    Location
    Belgium, Originally Canada
    Posts
    18

    Default

    Well, guess I'll learn flash/actionscript stuff and Uscript. Although really UScript already just looks like a lil cross between Java/C++ which is great cause I'm decently fluent in C++

  19. #19
    Skaarj
    Join Date
    Jun 2012
    Location
    Belgium, Originally Canada
    Posts
    18

    Default

    Well I'm kind of not understand UScript that much it seems. When making a class does it Always have to extend something? A lot of my classes in the C++ version are just stand alone ones that don't inherit (although for my tiles I do use a factory design pattern to handle them.) from anything else. Also, I haven't really been able to find code itself for doing one of the big main things I need, which is setting a mesh in the game world and then translating it to where it needs to be (it's still grid based dungeon generation) Is there any tutorial type resources that I could be pointed to? I did find a few posts about Dungeon Generation ( SolidSnake's Derelict 9 and a few others) but not much in code wise.

  20. #20
    Boomshot
    Join Date
    Aug 2011
    Posts
    2,287

    Default

    All classes must inherit from Object.uc, even the the most basic of non-actors. Non-actor classes are instanced using new instead of Spawn().

    All meshes and other rendering primitives are components, added to an Actor. You can inspect some core classes to understand how it all fits together and then create your own dedicated classes if needed. Take a look at DynamicSMActor_Spawnable and it's inheritance chain for your needs.

  21. #21
    Boomshot
    Join Date
    Aug 2011
    Posts
    2,287

    Default

    And as a quickstart the basic pattern is:

    Code:
    local DynamicSMActor_Spawnable A;
    
    A = Spawn(class'DynamicSMActor_Spawnable'); // you can also specify the location as a parameter, look it up in Actor.uc
    
    A.StaticMeshComponent.SetStaticMesh(StaticMesh'Package.YourStaticMesh');
    
    A.SetLocation(DesiredPosition);

  22. #22
    Skaarj
    Join Date
    Jun 2012
    Location
    Belgium, Originally Canada
    Posts
    18

    Default

    Awesome, thanks again Spoof.
    I'm looking at the class above that one now cause _spawnable just has 2 lines in it. Also, just found the book for unreal scripting that Angel_Mapper released, so hopefully (in the next few days when it arrives) I'll stop asking the uber noob questions for a while :P

  23. #23

  24. #24
    Skaarj
    Join Date
    Jun 2012
    Location
    Belgium, Originally Canada
    Posts
    18

    Default

    Hey again,

    So another thought just came up, is it possible to do design patterns in UScript? I use a abstract factory pattern in the c++ version of my game and am wondering if I'll have to more or less un pack that from design to just normal style. Any idea?


 

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.