Not logged inOpenClonk Forum
Up Topic Development / Developer's Corner / Editor as separate executable
- - By Sven2 [us] Date 2016-09-28 18:11
What do you think about changing the makefiles so instead of calling the editor using parameters to the main executable (openclonk --editor), we make it a separate program similar to the dedicated server?

The code base would not change much. Basically, Application.isEditor becomes an #ifdef. But we could remove Qt dependencies from the main executable and we wouldn't have to maintain the "build openclonk without Qt" case (which is currently broken) any more.

One downside would be that we would have two executables, adding ~6MB of file size.
Parent - - By Marky [de] Date 2016-09-28 18:24
I'd welcome that, but as far as I can judge: the justification seems to be my laziness. I downloaded the qt libraries, and I set up the solution with Cmake again, but I cannot get the code to compile. So, if I could compile again without having the editor (which I don't need for simply adding new stuff to the engine), then I'd be happy. Alternatively, if "build openclonk without Qt" worked fine I'd be happy, too.
Parent - - By Luchs Date 2016-09-28 21:57

>Alternatively, if "build openclonk without Qt" worked fine I'd be happy, too.


You're on Windows, right? It should work on Linux.
Parent - By Marky [de] Date 2016-10-05 21:23
Yes, I am on windows. I will look into it again later, maybe I did something wrong when I created the solution with CMake.
Parent - - By Luchs Date 2016-09-28 22:17
I'd prefer to keep it as-is. Other downsides I can think of:

(1) Longer build. It's pretty slow already, having a third "openclonk" target would make it ~1.5 times slower.

(2) The build breaks often because noone builds openclonk-server during development. Introducing another #ifdef configuration may make this worse?

(3) Qt is also useful in fullscreen mode to open URLs.

Do we really want people to build openclonk without the editor anyways? The dev experience should be "oh I can just click that button and create my own stuff!", not "I think there's some way to create scenarios, but I have to install the editor first".
Parent - - By Sven2 Date 2016-09-29 13:53

> (1) Longer build. It's pretty slow already, having a third "openclonk" target would make it ~1.5 times slower.


Yes, that's true. Maybe if we put the common things of server, openclonk and editor into a lib and then have smaller individual projects, we can speed up things again

> (2) The build breaks often because noone builds openclonk-server during development. Introducing another #ifdef configuration may make this worse?


Yes. But the point is: We already have the editor-ifdefs because we have Qt-ifdefs. The only difference is that right now, noone tests the non-qt-path so it's usually broken. If we had a separate editor, that path would be tested with every snapshot

> Do we really want people to build openclonk without the editor anyways? The dev experience should be "oh I can just click that button and create my own stuff!", not "I think there's some way to create scenarios, but I have to install the editor first".


The button in the main menu should stay of course and the editor executable would always be shipped with the game.
Parent - - By Isilkor Date 2016-09-29 15:39

> The only difference is that right now, noone tests the non-qt-path so it's usually broken. If we had a separate editor, that path would be tested with every snapshot


Nobody tests the openclonk-server build either, even though it's as simple as clicking "Build solution" or typing "make" before committing. It's by no means required to outsource testing the build to the horribly slow build nodes.
Reply
Parent - By Sven2 [us] Date 2016-09-29 15:45

> Nobody tests the openclonk-server build either, even though it's as simple as clicking "Build solution" or typing "make" before committing. It's by no means required to outsource testing the build to the horribly slow build nodes.


Well, that's exactly why the build nodes are helpful. If it weren't for them, the server build would always be broken. Now it's only broken for a few commits until someone needs a snapshot.

99% of the time, we do not care for the speed of the build nodes as long as we always have a recent snapshot. On the other hand, I think it's really cool to have an automated test for the server and mape builds.
Parent - By Isilkor Date 2016-09-28 22:18
If we introduce more build configurations, can we please make the engine more modular first so we can reuse compiled code from a library? Adding openclonk-server to the build pretty much doubled the build times and they're already long enough as is.
Reply
Parent - - By Sven2 Date 2016-09-29 13:54
Since most replies went against this change, I'll put it on hold for now.
Parent - By Clonkonaut [de] Date 2016-09-29 15:36
Making openclonk-server build faster is nonetheless a good idea!
Reply
Parent - - By Marky [de] Date 2016-10-05 21:25
Is there an option to start the game in windowed (= previous editor) mode, without the whole editor interface? The editor runs slow on my computer with about 8 FPS, and I don't actually need the full editor functionality most of the time.
Parent - - By Sven2 [us] Date 2016-10-05 23:22
No, the old editor has been removed (or will be removed if anything is still left).

There is no reason for the new editor to be significantly slower than the old editor. Maybe you can do a profiler run to see where that extra time is spent?
Parent - - By Marky Date 2016-10-06 19:29 Edited 2016-10-06 19:45
First results:

I scheduled the profiler to stop after 100 frames.

Custom scenario, old editor:
FPS: Between 17 and 35

Profiler statistics:
==============================
00023ms  Direct exec
00009ms  JPTP.FxIntCheckBounceTimer
00004ms  Global.ScheduleCall
00004ms  Global.FxIntScheduleCallTimer
00004ms  Environment_Configuration.OpenMainMenu
00002ms  Global.Find_Or
00001ms  Global.Particles_JumpPad
00001ms  Global.Find_Func
00001ms  LFTP.CheckVerticalBoundaries
00001ms  SEGU.Activity
00001ms  SEGU.ShowWeapon
==============================


Custom scenario, new editor:
FPS: Between 7 and 11

Profiler statistics:
==============================
00024ms  Global.FxIntScheduleCallTimer
00024ms  Global.ScheduleCall
00024ms  Environment_Configuration.OpenMainMenu
00004ms  Direct exec
00004ms  JPTP.FxIntCheckBounceTimer
00001ms  Global.Find_Or
00001ms  Global.Find_Func
00001ms  SEGU.ShowWeapon
==============================


Goldrush, old editor

FPS: Between 15 and 16

Profiler statistics:
==============================
00011ms  Global.FxIntScheduleCallTimer
00005ms  Tree_Deciduous.CheckSeedChance
00005ms  Tree_Deciduous.Seed
00003ms  Direct exec
00003ms  Butterfly.CheckTurn
00002ms  Global.FxIntGrowthTimer
00002ms  Butterfly.Activity
00002ms  Clonk.FxIntTurnTimer
00002ms  Clonk.GetInteractableObjects
00002ms  Clonk.FxIntWalkTimer
00002ms  GUI_Controller.FxIntUpdateInteractionTimer
00002ms  GUI_Controller.UpdateInteractionObject
00002ms  Tree_Coniferous2.CheckSeedChance
00002ms  Tree_Coniferous2.Seed
00001ms  Global.OnCompletionChange
00001ms  Global.Find_Or
00001ms  Global.Anim_Const
00001ms  Global.ScheduleCall
00001ms  Global.GetObjWidth
00001ms  Global.GetComponent
00001ms  Butterfly.MissionComplete
00001ms  Butterfly.MoveToTarget
00001ms  Butterfly.GetAttraction
00001ms  Clonk.GetExtraInteractions
00001ms  Clonk.GetDirection
00001ms  Clonk.GetCurrentWalkAnimation
00001ms  Time.DoSkyShade
00001ms  Time.FxIntTimeCycleTimer
00001ms  Time.AdjustToTime
00001ms  Time.IsNight
00001ms  Lorry.TurnWheels
==============================


Goldrush, new editor
FPS: Between 9 and 10

Profiler statistics:
==============================
00010ms  Global.FxIntScheduleCallTimer
00005ms  Global.FxIntGrowthTimer
00005ms  Lorry.TurnWheels
00005ms  Global.ScheduleCall
00005ms  Butterfly.MissionComplete
00005ms  Clonk.FxIntWalkTimer
00004ms  Butterfly.CheckTurn
00002ms  Time.FxIntTimeCycleTimer
00002ms  Time.DoSkyShade
00002ms  Time.AdjustToTime
00002ms  Global.OnCompletionChange
00002ms  Direct exec
00001ms  SproutBerryBush_Sprout.IsHarvestable
00001ms  GUI_Controller.UpdateInteractionObject
00001ms  GUI_Controller.FxIntUpdateInteractionTimer
00001ms  SproutBerryBush_Sprout.IsInteractable
00001ms  Tree_Deciduous.Seed
00001ms  Ambience.ExecutePlayer
00001ms  Ambience.Execute
00001ms  Clonk.FxIntTurnTimer
00001ms  Clonk.GetMenu
00001ms  Clonk.GetInteractableObjects
00001ms  Clonk.GetCurrentWalkAnimation
00001ms  Clonk.GetDirection
00001ms  Butterfly.GetAttraction
00001ms  Butterfly.Activity
00001ms  Butterfly.MoveToTarget
00001ms  Global.Sound
00001ms  Tree_Deciduous.CheckSeedChance
==============================
Parent - By Sven2 Date 2016-10-08 01:57
Yes, the time is not spent in script. You should check a C++ profiler for the engine code.
Up Topic Development / Developer's Corner / Editor as separate executable

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill