x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

What is the most lightweight way to write and compile code?

I'm not sure if this is right, but from what I'm reading around the web I'm getting the feeling that in order to work with code in UE4, I may not in fact have to compile the engine.

Is this right?

I'm working on a project that contains some code, what is the easiest way for me to alter and compile that code?

Do I have to build the engine, or can I get away with skipping that part? I've seen people talk about 'code projects' vs 'building the engine', but not totally sure what that means.

Product Version: UE 4.8
Tags:
more ▼

asked Sep 23 '15 at 08:17 AM in C++ Programming

avatar image

Asher S Einhorn
650 93 80 180

avatar image Asher S Einhorn Sep 23 '15 at 08:24 AM

I'm guessing that you don't actually have to compile the engine unless you want to actually change it. is that right? Can i just compile my code and run it from the normal launcher? (as in, not the one that you would run from VS)

avatar image Jakey113G Sep 23 '15 at 09:15 AM

I'm pretty sure you can use the compile from within the launcher to hot reload your c++ code project. In general building in visual studio isn't that painful, you can right click the game solution and select just to build that.

I'm also 99% sure when you build the project it checks if the engine is modified and if it isn't just uses the existing generated binaries, rather than rebuilding the entire engine solution.

avatar image tenowg Sep 23 '15 at 09:54 AM

careful with a full source (downloaded from github) and make sure you hit build and not rebuild project ;) made that mistake myself once, it will clean the whole project (engine and all), but this isn't a concern from a binary download.

avatar image Asher S Einhorn Sep 24 '15 at 08:01 AM

Why is that dangerous?

avatar image tenowg Sep 26 '15 at 05:51 AM

its not dangerous, it just cleans everything, and starts rebuilding, everything... So if you are building on a Github unreal source download, it takes about an hour to just get to your code.

(comments are locked)
10|2000 characters needed characters left

2 answers: sort voted first

You do not have to build the engine every time you compile your code. If you create the code project from within the editor only your code will be compiled and linked to the engine code. Matter of fact, the engine code should show as readonly in VS if you choose this option. And is pre-compiled.

IF you want to modify the engine code, you will need to download the code from GitHub, run some files, and spend about an hour compiling the code, I assume this is not the common use case, and you likely didn't do this from the start, nor will you need to do this now.

So to answer your question, the easiest way to modify game code, would be to load it into VS, right click on the game project, and click build.

BTW just for general info: If you click "Build Solution" from the menu bar at the top, the build will now fail in 4.9, you need to right click on your game project and select build there.

more ▼

answered Sep 23 '15 at 09:51 AM

avatar image

tenowg
116 5 7 11

avatar image Asher S Einhorn Sep 23 '15 at 10:23 AM

if i've built the code in VS, is there a way to remove that so I'm again just using the pre-compiled version? I'm having issues with the project building so I'd like to try reverting to whatever the defaults were.

avatar image tenowg Sep 23 '15 at 06:16 PM

The easiest way I know of to tell if you are using the binary distribution or the custom build from github is to look at the version number of you project in the launcher. If it says something like 4.8 or 4.9.1 then you are using the binary distro, if it says "Other" then you are using a custom build.

If it gives a version number, you are already on the default.

If it says other then you need to find the .uproject file in the head of you project fold and right click and choose the option to switch which version of unreal source you are running under.

(comments are locked)
10|2000 characters needed characters left

I'm not sure if this is right, but from what I'm reading around the web I'm getting the feeling that in order to work with code in UE4, I may not in fact have to compile the engine.

Is this right?

Right you not have to compile the engine to work with code. Until you are planing to modify the engine.

I'm working on a project that contains some code, what is the easiest way for me to alter and compile that code?

I suggest, use the binary version of the engine. Which you get from the Epic Game Launcher->Library. And to work with code under Windows use Visual Studio 2013. My latest news is that VS Solution creation for UE4 in special 4.8 do not work with VS2015. The support for VS2015 will come with the UE 4.10 engine version. Under OSX you will work with the UE4 Editor and XCode. Regarding Linux I don't know. A common workflow under windows would be. Create a Code Project from the UE4 Editor. The UE4 Editor will then open the VS Solution, you will compile your first code. From this point you can modify you code in Visual Studio or other Text Editors (But I still sugest VS) and just press the compile button in the UE4 Editor to compile your code and hot reload it into the editor. So... Edit code in Texteditor/VS, Start compile from UE4. To debug your code, you have to lauch your UE4 Project from Visual Studio debugger instead the Epic Game Launcher.

Do I have to build the engine, or can I get away with skipping that part? I've seen people talk about 'code projects' vs 'building the engine', but not totally sure what that means.

As all answer right away say, you do not have to build the engine if you use the engine binary from the Epic Game Launcher. And to clarify that "code projects" and "building the engine" means "Code projects" are projects there the developers write C++ code to extend your game/project. You don't have to write code in a game/project, because a lot in UE4 can be done in Blueprint the Epic visual sripting language. But as you say you use code you would use a code project.

"Building the engine" is if you grab the code base from GitHub(not the epic game launcher) and compile/build the complete engine code by your self. As written I didn't suggest it until you want to change the engine. Extending the Engine with modules is a other topic....

more ▼

answered Sep 24 '15 at 06:25 AM

avatar image

ThePathfinder
135 6 6 18

(comments are locked)
10|2000 characters needed characters left
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question