Sign in to follow this  

In-editor gameplay preview - How? (from a design perspective)

This topic is 3490 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, it's me again... In the Crysis Sandbox 2 Editor (and I believe something similar exists in the new UnrealEd), you can hit CTRL-G and it will let you play the game inside the editor with virtually no loading times. Now this is a very useful feature for level designers, and I'm wondering how you would do something like that from a code-design perspective. One way this could work is to actually run the game inside the editor, but keep it paused until the user presses a button. The tricky thing I believe is to share the scene graph/tree/list between the game and the editor. Here's the thing: right now my engine is somewhat componentized and the game logic resides in its own DLL. However, the code in there not only deals with the actual game logic, it also creates the render window, an instance of the renderer, the scene graph and puts everything together. The reasoning behind this was that you should be able to influence every aspect of the game including the window creation by modifying just the game DLL. Of course that kind of design is inherently bad for the whole "run in editor" thing. So now I think I need to shift responsibilities a little, but that's easier said than done. Let's say the game DLL displays a title screen and menu when it starts up, obviously it shouldn't do that when running inside the editor. I could of course just pass the DLL a boolean variable "isRunningInEditor" when it starts up, but I dunno if that's such a good idea. So I was wondering if any of you had any experience with this kind of thing and I'm very much interested in how you approached it. Thanks a bunch in advance and sorry about the length

Share this post


Link to post
Share on other sites
Put all of your application-independent engine code in one library, such as sound, graphics, physics, input, etc.

This library should be shared between your game executable and editor executable. Then both the editor and game itself can use the same engine code, but in different ways.

Share this post


Link to post
Share on other sites
Thanks for the reply!

Actually, that's already kind of how it is. I have separate DLLs for audio, rendering, physics and input which could easily be shared by the editor and the game. I guess my problem really centers around who creates the scene graph, who brings up menus and logo screens and such...

If I'm being unclear, please let me know.

Share this post


Link to post
Share on other sites

This topic is 3490 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this