scorvi's in-game editor

Everything about the development of Urho3D.

scorvi's in-game editor

PostPosted by Lumak » 31 May 2016, 21:00

I recently started working with scorbi's in-game editor found in his samples, 06_InGameEditor.
When I was looking for his lost github link, I discovered that he also has Urho3DIDE repository, doh!
His IDE says "WIP does not work" and hasn't been updated for a year?

Anyway, I just converted the gizmo.as to c++ and have that working in the editor, see pic below (nothing impressive, just a terrain lvl with gizmo).
I'm curious if there are others doing the same work and would like to corroborate our efforts.

pic:
Show spoiler
Image
Last edited by Lumak on 01 Jun 2016, 03:11, edited 1 time in total.
Lumak
Have many posts
Have many posts
 
Posts: 425
Joined: 08 Jun 2015, 15:38

Re: scorvi's in-game editor

PostPosted by Lumak » 01 Jun 2016, 00:41

I made a process of adding the in-game editor to any game or application easy by simply adding a few lines to a CMakeLists.txt.

Using 19 vehicle demo as an example:
Code: Select all
# Define target name
set (TARGET_NAME 19_VehicleDemo)

# Define source files
define_source_files (EXTRA_H_FILES ${COMMON_SAMPLE_H_FILES})

#=================
# BEG: in-game editor
#=================
include_directories ( ../../Tools/InGameEditor/Source ) 
include_directories ( ../../Tools/InGameEditor/Source/UI ) 
file (GLOB IGE_CPP_FILES ../../Tools/InGameEditor/Source/*.cpp ../../Tools/InGameEditor/Source/UI/*.cpp  )
file (GLOB IGE_H_FILES ../../Tools/InGameEditor/Source/*.h ../../Tools/InGameEditor/Source/UI/*.h  )
source_group ("Source Files\\InGameEditor" FILES ${IGE_CPP_FILES})
source_group ("Header Files\\InGameEditor" FILES ${IGE_H_FILES})
### set ###
set (SOURCE_FILES ${CPP_FILES} ${H_FILES} ${IGE_CPP_FILES} ${IGE_H_FILES})
#=================
# END
#=================

# Setup target with resource copying
if (EMSCRIPTEN)
    # Override the Urho3D default
    math (EXPR EMSCRIPTEN_TOTAL_MEMORY "64 * 1024 * 1024")
    if (URHO3D_TESTING AND URHO3D_TEST_TIMEOUT LESS 15)
        set (URHO3D_TEST_TIMEOUT 15)
    endif ()
endif ()
setup_main_executable ()

# Setup test cases
setup_test ()


The in-game editor code is built with whatever game you add to it. It's not a stand alone lib/so/dll that you link with.
There are changes that you need to add to your game code:
Add:
// 1) add to your constructor
RegisterInGameEditor(context);

// 2) add after you've created the game scene
context_->RegisterSubsystem(new InGameEditor(context_));
GetSubsystem<InGameEditor>()->SetGlobalScene( scene_ );

// 3) in your HandleUpdate(...) func.
if ( GetSubsystem<InGameEditor>()->IsVisible() ) return;

That's it. Very simple process.

Here's the outcome:

Image

Comments and/or feedback welcome.
Last edited by Lumak on 01 Jun 2016, 03:52, edited 1 time in total.
Lumak
Have many posts
Have many posts
 
Posts: 425
Joined: 08 Jun 2015, 15:38

Re: scorvi's in-game editor

PostPosted by Lumak » 01 Jun 2016, 03:51

I've looked at scorvi's Urho3DIDE repository and it looks like he made lots of improvements from the original 06_ingameeditor.
I'll be merging those changes.
Lumak
Have many posts
Have many posts
 
Posts: 425
Joined: 08 Jun 2015, 15:38

Re: scorvi's in-game editor

PostPosted by sabotage3d » 01 Jun 2016, 20:06

Nice. I played with this long time ago and I was quite useful.
User avatar
sabotage3d
Have many posts
Have many posts
 
Posts: 515
Joined: 25 Oct 2014, 13:26

Re: scorvi's in-game editor

PostPosted by Lumak » 02 Jun 2016, 17:08

sabotage3d wrote:Nice. I played with this long time ago and I was quite useful.


I agree. It is useful.

I've built and ran scorvi's Urho3DIDE and it works. Although there are some bugs, he's put in lots of good code base to work off of.
Lumak
Have many posts
Have many posts
 
Posts: 425
Joined: 08 Jun 2015, 15:38

Re: scorvi's in-game editor

PostPosted by Lumak » 02 Jun 2016, 21:42

This is becoming more like a blog, ha.

Anyway, I got to thinking why rewrite the editor scripts to c++ when there are people who maintains and updates it.

Doing a small experiment, I was able to call the editor script, similar to how urho3dplayer does it, from my game and loaded it no problem. Only small change to the script was to pass my game's scene and have it not reset the scene. I have a fully functional editor running in my game.

I will no longer be pursuing the c++ editor.
Lumak
Have many posts
Have many posts
 
Posts: 425
Joined: 08 Jun 2015, 15:38


Return to Developer Talk

Who is online

Users browsing this forum: No registered users and 0 guests

cron