Skip to main content
↑
↓
Spherical forums
Community for the
Sphere game engine
New?
Contact Us
to register an account!
1 Hour
1 Day
1 Week
1 Month
Forever
Community
Help
Search
Recent Posts
Log in
Contact Us
News
Spherical
Facebook
-
Twitter
-
Discord chat
New?
Contact us
to register an account!
Sphere Development
Engine Development
Sphere - Web Edition
1
Print
Topic: Sphere - Web Edition
(Read 9326 times)
previous topic
-
next topic
0 Members and 2 Guests are viewing this topic.
N E O
Hero Poster
Posts: 585
Making it happen!
Logged
Administrator
Senior Administrator
Sphere - Web Edition
July 16, 2013, 04:51:33 pm
The official thread for Sphere - Web Edition.
Repository:
https://github.com/sphere-group/web-sphere
For utilities written in JavaScript, visit the
Sphere Web Utilities repo
.
For casiotone's implementation of the Sphere API in JavaScript, visit
this thread
.
Sphere - Web Edition has a
pixi.js
branch and a
three.js
branch. Possible future implementations may include a
Turbulenz
branch.
Radnen
Big Chungus
Posts: 1,440
Sphere Studio Developer
Logged
Senior Staff
Wise Warrior
Re: Sphere - Web Edition
Reply #1
–
July 16, 2013, 05:28:38 pm
I might have to add primitives to the pixi-branch of Sphere soon.
If you use code to help you code you can use less code to code. Also, I have approximate knowledge of many things.
Sphere-sfml
here
Sphere Studio editor
here
N E O
Hero Poster
Posts: 585
Making it happen!
Logged
Administrator
Senior Administrator
Re: Sphere - Web Edition
Reply #2
–
March 01, 2014, 09:51:07 pm
An (admittedly kinda old) article on "fast sprite rendering" on an HTML5 canvas:
http://www.pawfal.org/dave/blog/2012/04/fast-html5-sprite-rendering/
Probably something the more advanced of us here already realized regarding graphics programming, but still useful. IIRC this technique is how the map engine tile rendering in Sphere SFML works, right? If so, this will probably be the technique I use in the reference code for web map rendering.
Last Edit
: March 01, 2014, 09:54:41 pm by N E O
Radnen
Big Chungus
Posts: 1,440
Sphere Studio Developer
Logged
Senior Staff
Wise Warrior
Re: Sphere - Web Edition
Reply #3
–
March 01, 2014, 10:57:35 pm
That technique is shit.
Edit: to add on to what I said, it's shit for quite a few games. Imagine updating every pixel each time the camera moves. I think it worked to the guys advantage since I think he had more of a point and click game where the imagery is primarily stationary and as the player moves from one position to the other only those tiles redraw. This is how .NET winforms draws controls; this is how I did it in my map editor, but not what I did for my SSFML engine. It would bet terrible in an actual camera based game environment, or any game that runs at an fps.
I actually did attempt that style in Sphere; redrawing only things that change - for menus and got good results. The trick is you always render at 0 fps. The problem is that if you have any animations, or need a mouse to move you're kind of back at square 1. He got away with mouse movement since mouse movement is apart from the canvas control (not drawn with it). The trick in sphere is to use a surface and draw on to that surface only the things that update. But surface handling is usually terrible, and even if you draw the mouse separately you'll need at least a solid fps count so the player can move the mouse and click things with precision.
Plus at the end of the day SSFML is using hardware anyways, so why not just go all out and do what your gfx card was designed to do?
Furthermore, it also worked to his advantage since rendering was his bottleneck and drawing anything at all was literally 1000 times more expensive than the code telling it how to draw what to draw. It's not quite that bad in Sphere.
Last Edit
: March 01, 2014, 11:55:12 pm by Radnen
If you use code to help you code you can use less code to code. Also, I have approximate knowledge of many things.
Sphere-sfml
here
Sphere Studio editor
here
N E O
Hero Poster
Posts: 585
Making it happen!
Logged
Administrator
Senior Administrator
Re: Sphere - Web Edition
Reply #4
–
March 02, 2014, 04:04:08 am
Ah, ok. Thanks for clearing that up for me.
Back to the drawing board for map rendering then :/
Radnen
Big Chungus
Posts: 1,440
Sphere Studio Developer
Logged
Senior Staff
Wise Warrior
Re: Sphere - Web Edition
Reply #5
–
March 02, 2014, 05:29:05 am
It really depends on the type of game. If you were doing a SimCity like game, the method you found would work quite well. But the game has a camera. However if the camera moves per-tile, you are still n times faster than pixel movement, if n is the size of your tiles in pixels. It'll scroll like my Sphere Map Editor, but at least you get really fast tile drawing results.
I don't know, but would it be too much to toggle that support? Realtime vs. deferred viewport. Where realtime draws everything as fast as needed and deferred only draws when the camera moves or entities update? In that way small games can take full use of the deferred feature while larger action-oriented games can use the realtime setting.
It's just that deferred = realtime if everything updates, but slightly slower since it must make the extra consideration of what to update.
Last Edit
: March 02, 2014, 05:31:08 am by Radnen
If you use code to help you code you can use less code to code. Also, I have approximate knowledge of many things.
Sphere-sfml
here
Sphere Studio editor
here
N E O
Hero Poster
Posts: 585
Making it happen!
Logged
Administrator
Senior Administrator
Re: Sphere - Web Edition
Reply #6
–
March 02, 2014, 04:08:38 pm
A toggle on the web version sounds good.
DaVince
Legendary Poster
Posts: 1,001
Logged
Administrator
Used Sphere for, like, half my life
Re: Sphere - Web Edition
Reply #7
–
March 05, 2014, 06:25:57 pm
Isn't there any WebGL-based 2D library you could be using for this instead?
Spherical Downloads Repo
||
My (really old) Sphere stuff
Flying Jester
Legendary Poster
Posts: 1,161
Logged
TurboSphere Developer
Re: Sphere - Web Edition
Reply #8
–
March 05, 2014, 07:45:07 pm
Or just WebGL in the raw?
Learn some history?
The Flying Jester's Blog of Sorts
N E O
Hero Poster
Posts: 585
Making it happen!
Logged
Administrator
Senior Administrator
Re: Sphere - Web Edition
Reply #9
–
March 06, 2014, 12:53:46 pm
If I knew GL I would use GL
Until then, my reference code will be raw 2D Canvas manipulation.
Rahkiin
Medium Poster
Posts: 152
Mac OSX Developer
Logged
Re: Sphere - Web Edition
Reply #10
–
March 06, 2014, 05:29:03 pm
Oh yeah, GL. It is such a PITA... I would probably use it in my runtime if I would know it too xD Knowledge of GL seems to be quite the bottleneck...
Pegasus API:
https://github.com/sphere-group/pegasus
Delphinus:
https://github.com/joskuijpers/delphinus
DaVince
Legendary Poster
Posts: 1,001
Logged
Administrator
Used Sphere for, like, half my life
Re: Sphere - Web Edition
Reply #11
–
March 08, 2014, 02:31:22 pm
Quote from: N E O on
March 06, 2014, 12:53:46 pm
If I knew GL I would use GL
Well... That's exactly why I mentioned "a library". But if that's just not going to work with this project, then raw Canvas it is for now I guess.
Spherical Downloads Repo
||
My (really old) Sphere stuff
1
Print
Sphere Development
Engine Development
Sphere - Web Edition