Wrapper Expirement

Show us your works in progress and request feedback

Post » Mon Mar 16, 2015 5:42 am

Unsatisfied with the graphics performance of web browsers on my machine I wanted to see what kind of performance I would get making my own wrapper. The idea was to run an exported html5 game with the V8 JavaScript engine and then only implement the parts of the browser that the game needs to run.

Here's an example of the results so far. A python/javascript hybrid that can run an exported C2 game. ...well actually a small subset of C2 games.

Packaged example:
https://dl.dropboxusercontent.com/u/542 ... withpy.zip
Wip wrapper script:
https://dl.dropboxusercontent.com/u/542 ... nwithpy.py

You could try dropping in another exported game but it may not work, because a lot is not implemented. Basically it has enough to draw objects and handle mouse events so far. The performance is better than I expected considering I don't think I've done it in the fastest way possible and it's running in python.

The goal is to get rendering, input and sound working, as well as some AJAX for file access. I probably won't be implementing everything else such as video, networking or form controls. This probably won't ever be a complete browser engine, just enough of it to run games.
B
85
S
27
G
85
Posts: 5,068
Reputation: 57,870

Post » Mon Mar 16, 2015 6:30 am

To be honest, according to my benchmark performance, it's complete bottleneck after all.
B
91
S
31
G
29
Posts: 3,129
Reputation: 27,789

Post » Mon Mar 16, 2015 2:24 pm

If I understand your description correctly, are you trying to create a browser engine specifically for games?
Whatever the case, I'm sure that it'll be something special by the time you've completed it. :)
I will have to give it a test after I get home from work.
Be sure to check out my Metroidvania game, A Hole in the Earth
B
59
S
24
G
3
Posts: 359
Reputation: 5,683

Post » Mon Mar 16, 2015 5:54 pm

@Joannesalfa
If you mean graphics, then I too find that as a bottleneck on my pc with html5.

@ryanrybot
Yeah, that's basically what it is and it's ending up much simpler to get going than I originally supposed.
B
85
S
27
G
85
Posts: 5,068
Reputation: 57,870

Post » Mon Mar 16, 2015 6:49 pm

Can Python use webgl even?
Image ImageImage
B
164
S
49
G
138
Posts: 7,957
Reputation: 91,880

Post » Mon Mar 16, 2015 7:12 pm

Really cool project rojohound! :)

Anyway, here's some errors I got:

8 bit issue (seems to happen with spritesheets, but not single images. 24bit png works fine):

*** EXCEPTION ***
Failed to load image "images/enemyspawner-sheet0.png". Reason: PNG not supported
: 8-bit only
File "<string>", line 261, in <module>
Press any key to continue . . .

Also, anything with keyboard commands won't run. Maybe you could allow such projects to boot, even if the controls don't work yet?

EDIT: curious about newts question. Does your framework support effects?
Don't lose your work. Backup your game with Dropbox.
B
43
S
10
G
10
Posts: 1,106
Reputation: 9,157

Post » Mon Mar 16, 2015 7:55 pm

That does sound really cool @R0J0hound!
Is there any possibility that this could eventually be used instead of something like NW.js?
Be sure to check out my Metroidvania game, A Hole in the Earth
B
59
S
24
G
3
Posts: 359
Reputation: 5,683

Post » Mon Mar 16, 2015 8:10 pm

R0J0hound wrote:@Joannesalfa
If you mean graphics, then I too find that as a bottleneck on my pc with html5.



No, it's not about the graphics, in that case if you keep playing, keep spawing sprites until 50, you will notice the bottleneck is starting, you don't want to see it keeps freezing in every seconds. Maybe it needs garbage collection or something else.
B
91
S
31
G
29
Posts: 3,129
Reputation: 27,789

Post » Mon Mar 16, 2015 8:55 pm

@newt
I just am implementing 2d right now, but in the future I think could do webgl by wrapping all needed webgl calls to opengl or something. The limiting factor would be differences in the shading language.

@TiAm
The png issue is a limit of the graphics library I'm using, right now I'm working around it by converting all the png files to be 32 bit after I export.

Keyboard support is not implemented yet, just most of mouse and enough of the canvas to draw stuff. Soon though.

@ryanrybot
Most certainly. As you can see with the example it does work, although work could be done to package it up in a nicer way.

@Joannesalfa
It's probably the overhead of running through python and lack of optimization with the renderer. Once I get things working I'll have a good outline of all the stuff that needs to run, and I could convert the bottle necked parts to C to avoid python. Also the GC could be an issue, I haven't investigated if I need to manually call it yet.
B
85
S
27
G
85
Posts: 5,068
Reputation: 57,870

Post » Mon Mar 16, 2015 9:19 pm

Well it certainly is quite the experiment.
Good luck.
Image ImageImage
B
164
S
49
G
138
Posts: 7,957
Reputation: 91,880

Next

Return to Works in Progress/Feedback Requests

Who is online

Users browsing this forum: No registered users and 2 guests