About Store Forum Documentation Contact



Post Reply 
Vim bindings or how to work with Visual Studio instead
Author Message
shmu Offline
Member

Post: #1
Vim bindings or how to work with Visual Studio instead
Hmm, maybe I'm nuts, but I've been using Vim for about 10 years and it boosts my code writing and editing quite a lot. In every code editor I work with, be it Visual Studio, VS Code, WebStorm or PyCharm, hell, even in sick hybrid-Emacs-based editors, I use Vim bindings.

I searched but did not find if the Esenthel code editor supports Vim bindings. I believe it does not because not every one is a Vim freak like me.

If I understand correctly, I can use Visual Studio as an external editor for my Esenthel project. I tried to fiddle around with it (first steps in Esenthel) but did not understand something about the workflow. How do I edit assets on the Esenthel editor, but keep them in sync with the code in Visual Studio? I've found a post explaining that I can't sync the code back from VS to Esenthel, so how do I work with the two programs together? Couldn't find information about that.

Or maybe better - will there ever be Vim bindings smile?
11-12-2016 02:00 AM
Find all posts by this user Quote this message in a reply
Zervox Offline
Member

Post: #2
RE: Vim bindings or how to work with Visual Studio instead
This is what packaging assets does when you release-

you will notice in VS files you find reference to engine.pak and project.pak(I believe this is what the first pak is called) and a line path with Esenthel/Projects/large weird name.

basically what the line and project.pak is, is the path/archive of the assets which is used, so whenever you add an asset in the editor/it is added to the Projects folder, when you export the assets to archive then you get a .pak archive file) you just right click in the editor on any asset you want and copy its uid and use the UID to create the selected object from VS(this part works the same in the VS editor).

Never heard of Vim tbh.
(This post was last modified: 11-12-2016 04:06 AM by Zervox.)
11-12-2016 04:04 AM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #3
RE: Vim bindings or how to work with Visual Studio instead
Hi,

This is described here:
http://www.esenthel.com/?id=doc#External_IDE
http://www.esenthel.com/?id=doc#Accessin...s_(ExtIDE)

If you want to work with VS only, then in Esenthel Editor you will manage only game assets, and on VS only code assets.
Check the Auto.cpp file that was generated when you created the VS project from EE Editor, it does asset loading from either PAK (when publishing) or from project folder data (when testing).
You need to generate the PAK only when publishing, otherwise, just use project folder data (no work needed).

Sorry that there's no option to change the keys in the Editor at the moment.
11-12-2016 08:12 AM
Find all posts by this user Quote this message in a reply
shmu Offline
Member

Post: #4
RE: Vim bindings or how to work with Visual Studio instead
Hello Esenthel and Zervox, thanks for the quick responses.

Let me start by this: do I need the source license of the engine to work with Visual Studio or any other external IDE? I am currently evaluating the free demo version and I think I'm facing compilation problems because I don't have the source so I want to know if I'm trying in vain.

For example, after opening the vcxproj from the exported folder, the file "@@headers.h" can't be found by the VS editor. I also tried F8 from inside EE, which opened a VS that detected the Esenthel symbols fine but after building and launching the app it said "Can't find shader Main" or something like that. So do I need the engine source or I am doing something funny?

I am searching the forums and the net but I don't seem to find anything relevant.

As for Vim bindings, it's more than just simple re-assigning different keys to different functions of the editor, but I see there's no useful further discussion about this at the moment. If you are feeling adventurous you might want to give the Vim tutorial a try. You might even like it! http://www.vim.org/download.php

Thanks for the help.
11-12-2016 05:48 PM
Find all posts by this user Quote this message in a reply
Zervox Offline
Member

Post: #5
RE: Vim bindings or how to work with Visual Studio instead
No you do not need source, after you exported the project to visual studio, did you move it? if so that might be the problem and you should check the paths used in the different files.(not sure if EE uses relative paths or absolute paths to find the @@header or engine.pak(not finding engine.pak or building towards an older engine.pak will cause the shader main problem) when it exports, been a long time since I exported a project)

I do not really need anything else than pure Visual Studio for programming as such I never use the EE code editor and I got notepad+ for anything else. smile but thanks anyways. smile

in Auto.cpp you will find something like
Code:
cchar *C   EE_PHYSX_DLL_PATH   =(                                          (WEB || EE_PUBLISH) ? L"Bin"             : L"D:/Esenthel/Esenthel3SDK/Bin");
cchar *C   EE_ENGINE_PATH      =((WINDOWS_NEW || MOBILE) ? L"Engine.pak"  : (WEB || EE_PUBLISH) ? L"Bin/Engine.pak"  : L"D:/Esenthel/Esenthel3SDK/Bin/Engine.pak");
cchar *C   EE_PROJECT_PATH     =((WINDOWS_NEW || MOBILE) ? L"Project.pak" : (WEB || EE_PUBLISH) ? L"Bin/Project.pak" : L"D:/Esenthel/Esenthel3SDK/Projects/"funky name here"/Game");

Make sure these paths are correct.

as you can see it has two paths for all of them, one being Bin/ and one being a absolute path(Disc:/folder/) in the case it is using Bin/ you just copy the files you get warning about not finding from Esenthel3SDK\Bin to folder of your project/Bin(make it if its not there)

the same with stdafx.h found the project folder
Code:
#include "D:/Esenthel/Esenthel3SDK/Bin/EsenthelEngine/EsenthelEngine.h"

make sure this folder is correct
(This post was last modified: 11-12-2016 06:45 PM by Zervox.)
11-12-2016 06:36 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #6
RE: Vim bindings or how to work with Visual Studio instead
Hi,

I just did this:
1) open "Tutorials" project
2) make sure "1 - Basic App" application is active
3) Open in VS (F8)
4) in VS - Debug \ Start Without Debugging
5) all OK

or

1) open "Tutorials" project
2) make sure "1 - Basic App" application is active
3) Build \ Export \ VS 2015 project
4) Open Project.sln
5) in VS open Auto.cpp and set EE_PUBLISH=false;
6) Debug \ Start Without Debugging
7) all OK

If you're getting different results, please let me know
11-12-2016 10:34 PM
Find all posts by this user Quote this message in a reply
shmu Offline
Member

Post: #7
RE: Vim bindings or how to work with Visual Studio instead
Hello Zervox, Esenthel,

As for Zervox's solution:
I indeed changed the EE_PROJECT_PATH to the correct path of the folder of my test project. I wrote the requried functions on a new Main.cpp and it did compile! However, when the application's window was opened it was black and a message box appeared saying "Can't load Shader "Main"". I should try the process again with a blank project. Maybe my fiddling did something bad.

As for Esenthel's solution:
I tried both and had similar results. It wouldn't compile complaining about both Auto.cpp and Main.cpp that: "fatal error C1853: 'x64\Debug DX11\1 - Basic App.pch' precompiled header file is from a previous version of the compiler, or the precompiled header is C++ and you are using it from C (or vice versa)". I'm using Visual Studio 2015 Community. I guess it got a different version of the MS compiler than the one that built the bundled precompiled headers? I don't recall changing the default compiler of my copy of Visual Studio in any way.
11-13-2016 10:25 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #8
RE: Vim bindings or how to work with Visual Studio instead
In VS you can do just "Build \ Rebuild Solution"
The compiler is the same, but this error occurs when it's called by 32 bit or 64 bit app.
(EE is mainly 64, but VS is mainly 32, that's my guess).
11-13-2016 11:09 PM
Find all posts by this user Quote this message in a reply
shmu Offline
Member

Post: #9
RE: Vim bindings or how to work with Visual Studio instead
I've got it working(!).

First, I had Esenthel installed in a folder with a space character in it. I installed it in a normal C:\Esenthel directory instead, tried what you suggested with the tutorials and it worked from Visual Studio.

However, I tried a new project from scratch and ran into some problems but I managed to overcome them. I will summarize:

I created a new project, created an application, created a Main.cpp code file (inside EE). I then exported the code to a Visual Studio project and moved it to a new folder. I opened the .sln and changed Auto.cpp's EE_PROJECT_PATH to the new folder's path as well as set EE_PUBLISH to false. I then edited the Main.cpp, which had nice #includes that I guess the EE created, and wrote the five required functions in order for the project to compile. I forgot to EE_INIT() in the beginning InitPre so I had the 'Shader not found problem' -_- but with the EE_INIT() function it disappeared.

Two things are worth noting and asking:

First, when I did NOT create a Main.cpp in EE and only in VS, I could #include 'stdafx.h' in the empty Main.cpp (created in VS) but #include "@@headers.h" did not resolve. This prevented me from calling EE_INIT() which is not fun. I did notice however that it corrected me when the signature for Update or Init did not return bool. Thoughts?

Second, I'm not exactly sure the space in the path to the Engine.pak in Auto.cpp was the culprit. You know the engine better than me, could it be that there is a non-space-path-friendly function somewhere? Even if so, it's completely fine. Installing Esenthel in a strange folder is indeed strange and C:\Esenthel or similar is reasonable and sane.

Thanks for helping.
11-13-2016 11:21 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #10
RE: Vim bindings or how to work with Visual Studio instead
Hi,
Glad you've got it working.
To my knowledge, EE works fine with paths with spaces.
I don't recommend creating new projects from scratch, but just exporting a simple app from EE Editor, it will save you a lot of trouble to set everything up.

Quote:First, when I did NOT create a Main.cpp in EE and only in VS, I could #include 'stdafx.h' in the empty Main.cpp (created in VS) but #include "@@headers.h"
Perhaps you've created the CPP file in another folder?
Then you need to do #include "path..../@@headers.h" <- correct path
11-13-2016 11:36 PM
Find all posts by this user Quote this message in a reply
shmu Offline
Member

Post: #11
RE: Vim bindings or how to work with Visual Studio instead
I have a small correction to what I did - the EE_PROJECT_PATH in Auto.cpp should not be changed - otherwise the Project.pak could not be found by the exported project and assets woudln't be loaded. Assets changed in EE to this project will get updated in this Project.pak as far as I understand.

A questions though as I'm still new to this. When the project grows and more .cpp files should be added, considering I'm doing this as a VS project, how do I add .cpp files? I create new ones from VS normally and only the first Main.cpp is needed from within EE in order to get stuff going in the beginning?

Regarding @@headers.h - the Main.cpp was in the same folder as Auto.cpp so it should've worked, but that's not an issue right now as the Main.cpp from EE works. It's more interesting to me what I asked in the previous paragraph.
11-13-2016 11:49 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #12
RE: Vim bindings or how to work with Visual Studio instead
Main.cpp created from EE isn't anything special, you can create the CPP files any way you wish, and just add them to VS project.
If the Main.cpp was in the same location as @@headers.h then it should work for sure.
Perhaps you made some typo, in the include file name.
11-14-2016 01:28 AM
Find all posts by this user Quote this message in a reply
Post Reply