Skip to main content

News

Topic: GetVersion Question (Read 9089 times) previous topic - next topic

0 Members and 1 Guest are viewing this topic.
GetVersion Question
I've come across some parts of my code that function in Sphere 1.5 and do not function in miniSphere.

I'm trying to get the code to function in both. I thought that maybe if I added in the GetVersion it would make the code functional again. However, since I added in the GetVersion part var CurrMap is returning as undefined in both Sphere & miniSphere.

Perhaps this is not the way GetVersion functions?

Code: [Select]
var GCM = GetCurrentMap();
var GCM_S = GCM.split("/");
var GCM_SA;
var CurrMap;

if (GetVersion() < 2.0)
{
GCM_SA = GCM_S[1];
}else{
GCM_SA = GCM_S[3];
}

CurrMap = GCM_SA.slice(0, -4);
  • Last Edit: August 22, 2017, 11:08:51 pm by Miscreant
"I am to misbehave." - Malcom Renyolds, Captain of Serenity

  • Fat Cerberus
  • [*][*][*][*][*]
  • Global Moderator
  • Sphere Developer
Re: GetVersion Question
Reply #1
Which version of miniSphere are you using?  In the latest versions GetCurrentMap() should return exactly the same string in both engines.  I fixed a bug a few versions ago where it would return the full SphereFS path of the map file, so maybe that's the problem you're having.
neoSphere 5.9.2 - neoSphere engine - Cell compiler - SSj debugger
forum thread | on GitHub

Re: GetVersion Question
Reply #2
Quickly drawing the version number to the screen... it is 2.
"I am to misbehave." - Malcom Renyolds, Captain of Serenity

  • Fat Cerberus
  • [*][*][*][*][*]
  • Global Moderator
  • Sphere Developer
Re: GetVersion Question
Reply #3
No no, I meant the version number of the engine, not the API version.  Are you using 4.8.4 or an earlier version?
neoSphere 5.9.2 - neoSphere engine - Cell compiler - SSj debugger
forum thread | on GitHub

Re: GetVersion Question
Reply #4
ah, looking at my backup dir. I had installed miniSphere 4.5.11
"I am to misbehave." - Malcom Renyolds, Captain of Serenity

  • Fat Cerberus
  • [*][*][*][*][*]
  • Global Moderator
  • Sphere Developer
Re: GetVersion Question
Reply #5
If you upgrade to 4.8.4 then you won't need the version check for this.

To answer the original question though, you were using GetVersion() correctly, it returns 2.0 for miniSphere and 1.5 for Sphere 1.5.  Note that in JS, 2.0 === 2, i.e. there is no concept of an integer type.
neoSphere 5.9.2 - neoSphere engine - Cell compiler - SSj debugger
forum thread | on GitHub

Re: GetVersion Question
Reply #6
I just updated miniSphere and GetCurrentMap is not returning the same value...
"I am to misbehave." - Malcom Renyolds, Captain of Serenity

  • Fat Cerberus
  • [*][*][*][*][*]
  • Global Moderator
  • Sphere Developer
Re: GetVersion Question
Reply #7
That's interesting, Sphere 1.5 is apparently not normalizing the path.  It's been my experience with Sphere 1.5 that the string returned by GetCurrentMap() is relative to maps/, but for some reason you have an extra redundant ../maps/ component in there.  Strange.

In any case if you're just trying to get the filename, this will work regardless of what its directory path is:

Code: [Select]
GCM_SA = GCM_S[GCM_S.length - 1];
neoSphere 5.9.2 - neoSphere engine - Cell compiler - SSj debugger
forum thread | on GitHub

Re: GetVersion Question
Reply #8
Off Topic: Now, with the update to miniSphere 4.8: the graphics are displaying very slow and player movement is no longer fluid.
"I am to misbehave." - Malcom Renyolds, Captain of Serenity

  • Fat Cerberus
  • [*][*][*][*][*]
  • Global Moderator
  • Sphere Developer
Re: GetVersion Question
Reply #9
Hm, not sure what would have caused that.  I made a lot of changes to the internal rendering since 4.5, but none of those should have slowed it down, if anything the upgrade should have made things a lot faster. :(
neoSphere 5.9.2 - neoSphere engine - Cell compiler - SSj debugger
forum thread | on GitHub

Re: GetVersion Question
Reply #10
I'm developing on a quad core with 4gigs of memory.

Are there min reqs for miniSphere?
"I am to misbehave." - Malcom Renyolds, Captain of Serenity

  • Fat Cerberus
  • [*][*][*][*][*]
  • Global Moderator
  • Sphere Developer
Re: GetVersion Question
Reply #11
CPU-wise, requirements should be on par with Sphere 1.5 (in fact Duktape is 2-3x faster than the old SpiderMonkey used by 1.5).  GPU requirement is definitely a lot higher though, since it's all shader-based nowadays (1.5 is software-rendered unless you use the horribly optimized OpenGL plugin).

In the absence of a dedicated graphics card, I'm going to say the minimum requirement would be a Sandy Bridge i5, circa 2011.
neoSphere 5.9.2 - neoSphere engine - Cell compiler - SSj debugger
forum thread | on GitHub

Re: GetVersion Question
Reply #12
I'm pretty sure my vid card is a nVidia GeForce 7300.
"I am to misbehave." - Malcom Renyolds, Captain of Serenity

  • Fat Cerberus
  • [*][*][*][*][*]
  • Global Moderator
  • Sphere Developer
Re: GetVersion Question
Reply #13
Wow, GeForce 7300 is circa 2005... so that's a pretty old machine then.  The oldest PC I think I have access to is an Athlon X4 635 from around 2010.  I can look into it to try to figure out what caused the performance regression but I don't think you're ever going to get miniSphere to run adequately on that machine.
neoSphere 5.9.2 - neoSphere engine - Cell compiler - SSj debugger
forum thread | on GitHub

Re: GetVersion Question
Reply #14
I'm not sure what all the specs are by memory. I can say that the machine I used before this one was almost 20 years old though.

although. miniSphere 4.5.xx functioned with no slow down of graphics.
  • Last Edit: August 23, 2017, 01:32:56 am by Miscreant
"I am to misbehave." - Malcom Renyolds, Captain of Serenity