Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

 
Advanced search

877740 Posts in 32883 Topics- by 24317 Members - Latest Member: jgallant

May 20, 2013, 10:21:51 AM
TIGSource ForumsDeveloperTechnical (Moderators: Glaiel-Gamer, ThemsAllTook)Live coding in c++?
Pages: 1 [2]
Print
Author Topic: Live coding in c++?  (Read 1656 times)
Polly
Level 2
**


View Profile
« Reply #15 on: August 16, 2012, 12:04:04 PM »

If you really want, you can code parts of live-editing, like adding a text field into your game, and for example, jump height takes the number from that text box. Simple enough, works well.

Being able to adjust a value is just a tiny fragment of what you want to / can do in real-time though. Live coding particularly shines when you can add & modify & remove code + assets while your game is running.

Here is a short example showing live OpenGL development.
Logged
kamac
Level 10
*****


Notorious posts editor


View Profile WWW Email
« Reply #16 on: August 16, 2012, 12:35:06 PM »

That is nice, althrough, I don't see a reason of why wouldn't somebody use some scripting language for tests (like LUA) for live editing. Simply make your application get script contents from a file every x seconds. That could do well too. If you'd want to use OpenGL commands, just register those you need for that scripting language and you're done. When you get the desired effect, just port the code in seconds to C++. Shouldn't be much of a challenge.
Logged

makemake
Level 0
*


View Profile
« Reply #17 on: August 20, 2012, 12:48:51 AM »

 Sure you can do this in C++ -- use DLL's, have robust ability to serialize everything in and out(Unreal has this already because of the GC). Also depending on how large your DLL is this might not be so fast. I do not feel that this is worth the effort.

 
The easiest way would be to use Lua(or similar language).  Monitor any loaded scripts for changes, if they change reload them, you will need some custom code to handle reloading certain things, but if you spend the time to set it up initially it should work fairly well.
Logged
jari
Manbaby
*


View Profile
« Reply #18 on: August 20, 2012, 06:25:26 AM »

Something like this?
Logged
kamac
Level 10
*****


Notorious posts editor


View Profile WWW Email
« Reply #19 on: August 20, 2012, 08:29:45 AM »

Something like this?

This looks interesting. Would be cool if Microsoft could put that ready into their VC++s though.
Logged

enthrallstudios
Level 0
***


View Profile Email
« Reply #20 on: August 21, 2012, 09:53:16 AM »

Honestly, the best way to go about this is using a scripting system. So the core engine is written completely in C++ but game logic is completely written in Scripts. You can use whatever language you want, and then edit it on the fly with not hassle at all. For Python look into Boost.Python (unless you are using C++0x). For Lua look at LuaBind. For JAvascript look at V8. There is also a tool called SWIG that could help with scripting.
Logged
dougbinks
Level 0
*


View Profile WWW
« Reply #21 on: August 29, 2012, 08:17:26 AM »

I'm a bit biased being one of the authors of the Runtime Compiled C++ system mentioned, but I don't agree that adding a scripting system is the best way to go about being able to rapidly iterate on game code. Even with an automatic binding system like LuadBind you still need to put considerable effort into creating a decent interface to your C++ code (especially if you want runtime editing without having to reset state), and there are debugging and performance issues to be concerned with afterwards. Scripting is certainly one of the potentials to look at, but it's not obvious to me that it's the best approach.
Logged
Pages: 1 [2]
Print
Jump to:  

Theme orange-lt created by panic