Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I know you are looking for someone to take over this project.. #2

Open
sfinktah opened this issue Sep 1, 2016 · 7 comments
Open

I know you are looking for someone to take over this project.. #2

sfinktah opened this issue Sep 1, 2016 · 7 comments

Comments

@sfinktah
Copy link

sfinktah commented Sep 1, 2016

And in a way I have, but probably not in the direction you were thinking.

I've hacked it (square peg, round hole, very heavy hammer) into working with DirectX11 directly as an alternative to Coherent-UI.

It is (if I can say nothing else positive about it) building against the current release of CEF (and I'm not saying it wasn't previously).

And it does work, it works great.

I have, however, hit a rather large SMACK ME IN THE FACE brick wall.

I was trying to implement JavaScript functionality in what we can arguably call "the opposite direction." - at least in respect to what you've coded for. So-called "Window Binding."

Firstly I naively copied this lovely example:

CefMessageRouterConfig config;
CefRefPtr<CefMessageRouterBrowserSide> browser_side_router_ = CefMessageRouterBrowserSide::Create(config);
CefMessageRouterBrowserSide::Handler* handler_ = client::binding_test::newHandler();
browser_side_router_->AddHandler(handler_, 1);

Which compiled fabulously but provided no functionality.

After some digging, I discovered the concept of Render and Browser threads, and then that you do not actually inherit from CefBrowserProcessHandler or CefRenderProcessHandler. In fact, I realised that for all the hacking around in your code, I didn't even know for sure that it had separate threads.

Oh, I'm not an idiot, I'm sure it has threads, I'm just at a bit of a loss as to how to go about binding to the render thread.

I've worked with Awesomium and even with a custom in-house WebKit derived framework, and am almost nauseatingly familiar with the:

frame->ExecuteJavaScript("alert('ExecuteJavaScript works!');",

method of JavaScript interaction. At the time (several years ago now), I remember going to some lengths to achieve faux async operatings through repeated polling and other such hideousness.

But now that there is the possibility of doing this:

void MyRenderProcessHandler::OnContextCreated(
    CefRefPtr<CefBrowser> browser,
    CefRefPtr<CefFrame> frame,
    CefRefPtr<CefV8Context> context) {
    // Retrieve the context's window object.
    CefRefPtr<CefV8Value> object = context->GetGlobal();

    // Create a new V8 string value. See the "Basic JS Types" section below.
    CefRefPtr<CefV8Value> str = CefV8Value::CreateString("My Value!");

    // Add the string to the window object as "window.myval". See the "JS Objects" section below.
    object->SetValue("myval", str, V8_PROPERTY_ATTRIBUTE_NONE);
}

/* javascript */
alert(window.myval); // Shows an alert box with "My Value!"

I'm quite excited.

Unfortunately, I cannot seem to jam in a facsimile of OnContextCreated (that would have been too easy) and have had epic failures trying to implement things like:

CEFCryHandler::CefRefPtr<CefMessageRouterRendererSide> renderer_side_router_ = ...

causing eventual crashes, due to the rather stubborn insistence of &browser->GetMainFrame()->GetV8Context() to always be NULL. I may have had success if I could have identified a better point to initiate, OTOH I might have the third end of stick.

It has occurred to me, that there may be issues related to spinning off threads when you're a DLL hooked into an already large executable process that doesn't belong to you, and that there may be reasons that I do not presently understand preventing me from accomplishing Window Binding.

As I said at the start, I know this is not a project you are overly-invested in, but it looks like I'm the only person who has done anything further than just fork your project... even if I am butchering it. (And FTR, almost all the CryEngine bindings are still there, they've just been removed from requiring the actual engine. Had to loose the plugin manager too, unfortunately.)

If you have any time to make suggestions, I would welcome them. Other than the obvious one, which is just use Coherent-UI. That's not an option, because I'm not a game developer, just a "mod maker."

@hendrikp
Copy link
Owner

hendrikp commented Sep 1, 2016

Hi, if you want to pull data from inside of javascript i would recommend to implement a file handler that provides the data as JSON through REST API styles.

Yes there is 2 threads in the plugin the one writing to the texture and the others. (And a lot more threads in CEF itself).

The version as is on github works without crashes with the old version, so its probably one of the changes introduced by you or by using an other CEF version.

@hendrikp
Copy link
Owner

hendrikp commented Sep 1, 2016

ah yeah and those are pretty CEF related questions try their mailing list im sure someone will have an idea there.

@sfinktah
Copy link
Author

sfinktah commented Sep 2, 2016

Oh, please don't misunderstand, it has never crashed outside the times I have attempted to allocate a non-existent pointer to CefV8Context.

Your work is still flawless. I will attempt to separate the very minor updates required for compatibility with the current framework, minor as it is.

I have just noticed that in the cef/ framework included with your repo, there is a class OSRWindow, from which a MainBrowserProvider is derived, which is related to the CefRenderHandler you implement. All those classes are gone from the latest CEF release, and it's possible that the functionality I am looking for did not exist (at least not for OSR) at the time you wrote it.

Incidentally, brilliant idea about the REST API, my data requirements are not that intense (just implementing an in-game menu), so I will take a look at CEFCryPak. (Yes, I still use your CEFCryPack class, just without any actual packs.)

Thanks for your time, and just out of curiosity, you didn't stop work on this because you got poached by Coherent by any-chance? There are vapors of nuance that might suggest you are not wholly without connection to that project.

@hendrikp
Copy link
Owner

hendrikp commented Sep 2, 2016

No I'm just working on my job and by the side on the game Miscreated. I
think Coherent is a very good solution is all, its integrations go much
deeper then this CEF plugin performance wise.

CEF though is also a very good solution as Steam uses it (so its the next
best) being better then Awesomium and the like.

@hendrikp
Copy link
Owner

hendrikp commented Sep 2, 2016

In fact feel free to apply
https://twitter.com/miscreatedgame/status/770305396691140608 were searching
C++ programmers that can work with huge codebasis.

@fkhaller
Copy link

fkhaller commented Sep 2, 2016

I will be applying again. Can't work full-time though, but I have
experience with modding and building the engine.

,Forrest Haller

On Fri, Sep 2, 2016 at 8:52 AM, Hendrik Polczynski <[email protected]

wrote:

In fact feel free to apply
https://twitter.com/miscreatedgame/status/770305396691140608 were
searching
C++ programmers that can work with huge codebasis.

2016-09-02 14:50 GMT+02:00 Hendrik Polczynski [email protected]:

No I'm just working on my job and by the side on the game Miscreated. I
think Coherent is a very good solution is all, its integrations go much
deeper then this CEF plugin performance wise.

CEF though is also a very good solution as Steam uses it (so its the next
best) being better then Awesomium and the like.

2016-09-02 11:52 GMT+02:00 sfinktah [email protected]:

Oh, please don't misunderstand, it has never crashed outside the times
I have attempted to allocate a non-existent pointer to CefV8Context.

Your work is still flawless. I will attempt to separate the very minor
updates required for compatibility with the current framework, minor as
it
is.

I have just noticed that in the cef/ framework included with your repo,
there is a class OSRWindow, from which a MainBrowserProvider is derived,
which is related to the CefRenderHandler you implement. All those
classes
are gone from the latest CEF release, and it's possible that the
functionality I am looking for did not exist (at least not for OSR) at
the
time you wrote it.

Incidentally, brilliant idea about the REST API, my data requirements
are
not that intense (just implementing an in-game menu), so I will take a
look
at CEFCryPak. (Yes, I still use your CEFCryPack class, just without any
actual packs.)

Thanks for your time, and just out of curiosity, you didn't stop work on
this because you got poached by Coherent by any-chance? There are
vapors of
nuance that might suggest you are not wholly without connection to that
project.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#2 (comment),
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAH99qOpnONE-4V--
UCEIvwkzU6YEesgks5ql_HJgaJpZM4JyVPN>
.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#2 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AKCDr7Pvu7rsMHWD3HMYcCUoiHM2wwXeks5qmBwbgaJpZM4JyVPN
.

@sfinktah
Copy link
Author

@hendrikp Coherent say nice things about you in their blogs, I'm sure it is an excellent solution, but since they refused to send me a trial version (or even respond to my request), assumedly due to my honestly in not pretending to be the head of an indy game developing company, I have difficulty in actually recommending them to my clients.

With regards your C++ job, it's certainly not for me, but I will sent it to a former business partner of mine who is an absolute legend with both C++ and x64_86 fasm. He's more on the Linux/OS X side of the fence, I believe the last time he ran windows was when he needed to play Crysis 3.

Oh, our business venture involved (among other things) him writing a distributed, webkit based 'people emulator' (we were using Awesomium before that) headless browser.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants