4

I am looking for a C++ IDE in which I can actively play the game and test the updates live instead of testing it, redoing th code, compiling it and running it again. I'm running Windows 7 x86 professional.

Josh Crozier
  • 233,099
  • 56
  • 391
  • 304
Brandon
  • 77
  • 1
  • 6
  • `test the updates live instead of testing it compiling` Not possible. – Chris Laplante Aug 15 '12 at 17:02
  • not a programming question per say. but eclipse does have background compiling as a feature.. – iKlsR Aug 15 '12 at 17:03
  • really cause other languages can, so i was just hoping that it was possible with c++... – Brandon Aug 15 '12 at 17:03
  • 1
    Non-compiled language can, like HTML, but C++ can't. – Chris Laplante Aug 15 '12 at 17:04
  • 1
    Well, the IDE isn't so much the problem here is it? It's up to you to set up your game to load from external resource files that you can update on the fly. As for the compiled parts of the code... not really possible in C++ – TheZ Aug 15 '12 at 17:04
  • @iKLsR eclipse is java though isnt it? – Brandon Aug 15 '12 at 17:04
  • You want a game engine..check out the cryengine demo. I've seen a friend use it and jumped right into gameplay without compiling. – Shawn Mclean Aug 15 '12 at 17:04
  • @user1601163 eclipse does c++ but the bg compiling feature is only for java iirc. it 'could' suit your needs.. – iKlsR Aug 15 '12 at 17:05
  • Also, you might have more informative solutions (granted you revise your question) if you ask the people on http://gamedev.stackexchange.com/ – TheZ Aug 15 '12 at 17:06
  • alright thanks guys i was just hoping it would be possible... thanks for your help though. – Brandon Aug 15 '12 at 17:07
  • 8
    Guys: just because C++ is designed to be compiled ahead of time, and in almost all instances is compiled ahead of time, doesn't mean it cannot be done any other way. LLVM has a working C++ JIT code-generation system. I'm not sure why this got so many downvotes and was closed, other than the fact that there's a lot of misinformation about "compiled" vs "interpreted" languages. – Mooing Duck Aug 15 '12 at 17:08

6 Answers6

4

This isn't really an answer, and so probably shouldn't get upvotes, but has information.

I don't know of any C++ IDE that can do runtime updates of code, but it's definitely not impossible. There's lots of C++ assemblers which already JIT code, live updates is merely the next step that no IDE has taken quite yet that I know of.
asmjit can JIT C++
Visual Studio can JIT C++/CLI (which isn't quite C++) (RMartinho corrects that VIsual Studio compiles C++/CLI to IL, and then JITs the IL. Tehcnically different.)
cling uses the clang fruntend and LLVM backend, which has a JIT code generation system.

R.Martinho has also reminded me that Microsoft Visual Studio already has this feature. http://msdn.microsoft.com/en-us/library/esaeyddf(v=vs.100).aspx If you "stop" the code, you can make changes, and it will apply those changes and resume execution.

Mooing Duck
  • 64,318
  • 19
  • 100
  • 158
  • Edit and Continue has significant issues, and I've found it doesn't work on most game development projects. – Doug Binks Feb 13 '15 at 09:51
  • @DougBinks: The only issue I've ever experienced is that you can't edit functions that are in the call-stack and aren't on top. Or that I hadn't enabled the edit-and-continue option in compilation options – Mooing Duck Feb 13 '15 at 23:34
  • 1
    The full list of unsupported situations is listed on the MS site: https://msdn.microsoft.com/en-us/library/0dbey757(v=vs.120).aspx . The lack of support for optimized code is a big issue for games, and you can't change the layout of objects making serious changes impossible. – Doug Binks Feb 15 '15 at 11:14
3

There's an interesting project at http://runtimecompiledcplusplus.blogspot.co.uk/ that is working on this problem and looks like it might work for you; I haven't used it myself but it looks active if still a little raw. It uses the Visual Studio 2010 compiler.

ecatmur
  • 152,476
  • 27
  • 293
  • 366
  • That looks intimidating, but I may have to try it sometime. Unfortunately, it doesn't look like it allows editing of existing code, merely adding "plugins" – Mooing Duck Aug 15 '12 at 17:26
  • That's not the case. RCC++ does allow editing of existing code, though some initial changes are required. – Doug Binks Feb 13 '15 at 09:46
1

You can't run C++ code without compiling. Minor syntactic differences between languages shouldn't be an issue so you shouldn't limit yourself to just one language.

I suggest you give Unity a chance; there's a fairly robust free version available. You can write scripts in C# (a language similar to C++), or UnityScript (somehting similar to JavaScript) or Boo (similar to Python) and you can test the results right away, without having to compile.

Paul Manta
  • 30,618
  • 31
  • 128
  • 208
  • C++ has to be compiled yes, but not necessarily to assembly, nor does it necessarily require a restart. – Mooing Duck Aug 15 '12 at 17:24
  • as im finding visual studio can do it already, and i have unity and i use it on occasion but i never really got trained for it and im not limiting myself to one language im 15 and this is my frist language i was just hoping that it is was possible – Brandon Aug 15 '12 at 17:33
1

What about Edit and Continue in Visual Studio? In order to use it, you have to pause execution (either by breakpoint or Pause button), recompile and resume. Note, that you can edit the code while the program is running. I know you can't test the game live, but you don't have to reload resources etc. It's IDE integration makes it really easy and straightforward to use.

If you want changes to be visible live, though, consider using script language such as Lua. One of their purposes is what you want to achieve.

Bartek Banachewicz
  • 38,596
  • 7
  • 91
  • 135
1

I've listed the options for runtime compilation of C++ code on the alternatives wiki page of Runtime Compiled C++.

From the sounds you may interested in either Recode or Alcanterea.

Doug Binks
  • 237
  • 3
  • 5
0

Organize your C++ game to use plugins, and add a feature to load a new (binary version of) plugin during the game.

Then, you could play your game, recompile a plugin, reload it (so invoke your dynamic linker at runtime), and continue playing.

It is not failproof, but it might usually work.

Of course you cannot unload a plugin which has some active call frame on the (or some thread's) call stack. I would suggest to avoid unloading old plugins...

Basile Starynkevitch
  • 223,805
  • 18
  • 296
  • 547