Skip to main content

News

Topic: Sphere SFML v0.90 (Read 107036 times) previous topic - next topic

0 Members and 2 Guests are viewing this topic.
  • Radnen
  • [*][*][*][*][*]
  • Senior Staff
  • Wise Warrior
Re: Sphere SFML v0.75alpha
Reply #165
It should be complete, that's what JSIL does. I need 0 percent JS effort to do any work. Provided I can correctly set up the website it runs on.

Edit 1:
I had a discussion with JSIL's creator and he says that this is a massive waste, and it has everything to do with browser game development. See, he's emulating .NET's file IO at best because you can only load files asynchronously in a browser. Now, he was able to synchronously load games - if you tried them on his website - but they were in the pipe so-to-speak. There is a problem when you are trying to load other peoples assets, which is precisely what Sphere does since it's a game engine.

I could get by with a simple demo, but I can't ever run a full game efficiently with it. :/

I think it better to try and recreate Sphere in JS god willing. Which would prove to be a very difficult task and be no easier than what JSIL could do since you'll also run into certain problems with file loading, while loops, window handles, and speed. But at least you'll have lower level access, and the ability to custom tailor it to the game you are wanting to run.

Edit 2:
That said, we did discuss a way of doing it via a bootstrap JS file that pumps game data into the JSIL virtual file system. It might then work...
  • Last Edit: December 01, 2013, 04:55:00 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

  • DaVince
  • [*][*][*][*][*]
  • Administrator
  • Used Sphere for, like, half my life
Re: Sphere SFML v0.75alpha
Reply #166
Nice work! Too bad about the complications.

Would it be possible to parse JS files beforehand, look for any Load* functions and preload/cache all of these? And then implement the actual Load* functions to refer to the preloaded files. This would obviously add a loading screen before the actual Sphere game can run, but would it solve any of the mentioned problems?

Hmm, I wonder, would Native Client be any kind of solution? That'd be Chrome-only, though...
  • Last Edit: December 01, 2013, 11:45:45 am by DaVince

  • Radnen
  • [*][*][*][*][*]
  • Senior Staff
  • Wise Warrior
Re: Sphere SFML v0.75alpha
Reply #167

Hmm, I wonder, would Native Client be any kind of solution? That'd be Chrome-only, though...


It only supports C and C++. :/
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
  • [*][*][*][*][*]
  • Administrator
  • Senior Administrator
Re: Sphere SFML v0.75alpha
Reply #168
I'd suggest emscripten+asm.js (if emscripten can compile C#) before attempting to port to Native Client first. Maybe emscripten on the original C++ engine if C# isn't doable?

Re: Sphere SFML v0.75alpha
Reply #169
It would be possible if you could compile C# or CIL to LLVM bytecode, but as far as I know you can't.

I've been trying to compile some pieces of TurboSphere using emscripten (such as the spritebatcher, possibly for use in web-based Sphere engines). An issue there is having both the version of V8 that node.js wants and the one TurboSphere wants living together in harmony on a Linux system. There are some issues with the plugin system, too, since it does fancy things with function pointers.

I haven't tried compiling the original engine using emscripten...I'm still struggling to get it compiled on Linux in the first place. But if you can compile Sphere using Clang+LLVM, it should be pretty easy from there.

  • Mooch
  • [*][*][*]
Re: Sphere SFML v0.75alpha
Reply #170
Nice progress so far, Radnen ^_^

Hey, I thought up something to feature-request of Sphere-SFML. A hotkey to automatically Open Last Project. Or even better, an option to automatically open the last project when the editor is launched. Because - and I'm probably not alone here - every single time I open up the Sphere editor I have to go to File > Open Last Project. Why not let it be default?

  • Radnen
  • [*][*][*][*][*]
  • Senior Staff
  • Wise Warrior
Re: Sphere SFML v0.75alpha
Reply #171
1. That question does not belong in the engine thread.

2. That editor problem is already solved in my Sphere Studio. It's in the settings, just tick the box that says "automatically open last project."

3. If you are not using my editor, I can't add that to the old one, sorry. :/
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

  • Mooch
  • [*][*][*]
Re: Sphere SFML v0.75alpha
Reply #172
1. Whoops, sorry! I Searched for Sphere-SFML and this is the only topic about Sphere-SFML that showed up. If you want me to delete my last message and this one, and you can delete yours just there, lemme know, so as to un-gunk up your topic. Sorry again.

2. I can't get Sphere Studio to work, didn't know that was already in that. Good thinking.

3. I know, I'm gonna convert to SFML when at least Beta launches. Didn't know if such a feature would be in there, just wanted to throw out the idea.

  • Fat Cerberus
  • [*][*][*][*][*]
  • Global Moderator
  • Sphere Developer
Re: Sphere SFML v0.75alpha
Reply #173
For #1, since you seem to be confused about this: sphere-sfml is just an engine, one of several that implements the Sphere API. The editor is a totally separate piece of software.  Editor-related feature requests (such as yours) have nothing to do with sphere-sfml or any other engine.

As for Sphere Studio, you should have .net 4.5 installed. If you have an earlier version than that it probably won't work.
  • Last Edit: December 16, 2013, 07:16:13 pm by Lord English
neoSphere 5.9.2 - neoSphere engine - Cell compiler - SSj debugger
forum thread | on GitHub

  • Mooch
  • [*][*][*]
Re: Sphere SFML v0.75alpha
Reply #174
Oh! I was confused on that point. I could've sworn I read that Radnen was redoing/adding to the API, though, that Sphere-SFML was basically a ground-up Sphere rewrite.

Wait, yeah. Sorry to muck up your topic even more, but Rad said in my Gauntlet topic he was adding multiplayer support to Sphere-SFML. If Sphere-SFML is just implementing the existing Sphere API, how can he add stuff? I guess I sorta don't understand what "a Sphere engine" is. Someone can just PM me if you don't want more clutter in the topic.

Re: Sphere SFML v0.75alpha
Reply #175
Yes, Sphere-SFML is a complete rewrite of Sphere. It takes no source from the original (it can't easily, it's in a different language).

Both Radnen and I are adding new features to the API and refining old ones with Sphere-SFML and TurboSphere respectively. Sphere-SFML takes a more compatible route, mainly adding switches for new features that, when omitted, will default to Sphere behaviour. I took a more ambitious route, and so TurboSphere is not directly compatible with Sphere (you'd need some extra code to make Sphere games work in TurboSphere--not much, but still not totally backwards compatible like Sphere-SFML is).

I believe that most of the additions to Sphere-SFML are either new functions or added optional parameters to existing functions, so all the original Sphere API functions can still work the way they do in Sphere 1.5-1.6.

As far as Engine vs. Editor, look at the binaries in the Sphere folder.

An Engine runs games. That's all it can do. You can't edit maps, it has no GUI, it just plays games. This is called `engine.exe` in Sphere.

The Editor, on the other hand, can't actually play games. It can edit and save files, and it can launch the engine, but it does not have the guts to actually play a game on its own. This is called `Editor.exe` in Sphere.

  • Mooch
  • [*][*][*]
Re: Sphere SFML v0.75alpha
Reply #176
*salutes*

Got it. And thanks. And sorry >_>

  • Radnen
  • [*][*][*][*][*]
  • Senior Staff
  • Wise Warrior
Re: Sphere SFML v0.75alpha
Reply #177
I wanted to do some speedruns on SSFML, and I compiled a document that outlines the speed of execution for a non-trivial task in Sphere 1.5, 1.6 and SSFML.

All detailed in a report here: http://radnen.tengudev.com/Speeds%20of%20Sphere%20Engines.pdf

tl;dr:
- SSFML is 28x faster than Sphere 1.6 and 58x faster than Sphere 1.5
- Sphere 1.6 is about twice as fast as Sphere 1.5
- Incrementing for loops in the check section is quite fast.
- In Sphere 1.6 and SSFML: += 2 is slower than doing 2 ++ increments. In SSFML it can be as much as 12 individual ++ is faster than a += 12.
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

  • Fat Cerberus
  • [*][*][*][*][*]
  • Global Moderator
  • Sphere Developer
Re: Sphere SFML v0.75alpha
Reply #178
How is ++ so much faster than +=?  I thought at the machine level ++ is the same as += 1, so you'd think the successive increments would be slower, not faster. ???
neoSphere 5.9.2 - neoSphere engine - Cell compiler - SSj debugger
forum thread | on GitHub

  • N E O
  • [*][*][*][*][*]
  • Administrator
  • Senior Administrator
Re: Sphere SFML v0.75alpha
Reply #179
IIRC most/all modern CPU instruction sets have an "increment by 1" instruction, and "a += 1" is usually just shorthand for "a = a+1" (an assign and a non-optimized addition of a number).