Skip to main content

News

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

0 Members and 5 Guests are viewing this topic.
  • Fat Cerberus
  • [*][*][*][*][*]
  • Global Moderator
  • Sphere Developer
Re: Sphere SFML v0.75alpha
Reply #150

Edit:
Ugh! People are created after the update script has ran at least once.


That seems like odd behavior, you'd think something like that would go right into the map-loading routine.  Looks like Sphere has more quirks than anyone realized! :P  Good thing the engine codebase is so clean, or things like this would be a nightmare to emulate.
neoSphere 5.9.2 - neoSphere engine - Cell compiler - SSj debugger
forum thread | on GitHub

Re: Sphere SFML v0.75alpha
Reply #151
What's the current state of your map engine implementation? I've noticed that when running my current project, the SCRIPT_ON_ENTER_MAP is never called (which is unfortunate as that's the entry point to my engine!)

  • Radnen
  • [*][*][*][*][*]
  • Senior Staff
  • Wise Warrior
Re: Sphere SFML v0.75alpha
Reply #152
The version up now, has like a 10 - 15% working map engine. The one in development now has like a 75% working map engine, barring extra features like Layer parallax and reflection, and this one has map scripts working.
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 #153
What does the fatal error "Source array was not long enough" mean? I keep trying to run Specs with it with each new commit, but I get this every time:

Code: [Select]
Compiled Script: "Threads.renderAll();"
Compiled Script: "Threads.updateAll();"
Compiled Script: "analogue.runMapEvent(GetCurrentMap(), 'enter');"
Compiled Script: "analogue.runMapEvent(GetCurrentMap(), 'leave');"
Compiled Script: "analogue.runMapEvent(GetCurrentMap(), 'leaveNorth');"
Compiled Script: "analogue.runMapEvent(GetCurrentMap(), 'leaveSouth');"
Compiled Script: "analogue.runMapEvent(GetCurrentMap(), 'leaveEast');"
Compiled Script: "analogue.runMapEvent(GetCurrentMap(), 'leaveWest');"
Compiled Script: "analogue.initMap();"
68.044921875
Fatal Error: Source array was not long enough. Check srcIndex and length, and th
e array's lower bounds.
Line 0:


The weirdest part is, despite the so-called "fatal error", the engine seems to run anyway--but I get a completely blank engine window hovering around 60 FPS.
neoSphere 5.9.2 - neoSphere engine - Cell compiler - SSj debugger
forum thread | on GitHub

  • Radnen
  • [*][*][*][*][*]
  • Senior Staff
  • Wise Warrior
Re: Sphere SFML v0.75alpha
Reply #154
Hmm, that might be due to a map that's too small? I need to revisit the map drawing routine. See, I make a cutout of the area of the screens size. However for maps smaller than the screens size you get the above error. I thought I had a fix, but it seems to not be working. Don't expect the map engine to work perfectly however, ;)
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 #155

Don't expect the map engine to work perfectly however, ;)


Oh believe me I don't, it's just that there was no indication that was a map engine-related error; if you hadn't just told me that it was, I'd have assumed a bug in the JS engine or something.

But yes, I do have a tiny 1x1 map since that was the only way I could get my opening scene to show up on a black screen without flashing a map for a split second first.
neoSphere 5.9.2 - neoSphere engine - Cell compiler - SSj debugger
forum thread | on GitHub

  • Radnen
  • [*][*][*][*][*]
  • Senior Staff
  • Wise Warrior
Re: Sphere SFML v0.75alpha
Reply #156
Ok, small maps are now fixed. Also I added an Abort() implementation that behaves like the Sphere Abort but doesn't do the same thing. I am still trying to figure out how to manually call an error with line numbers just like calling abort would do. somehow I need to invoke a custom error message, and apart from just tossing in a random syntax error, I don't know how to do that in Jurassic.

See how far you get LordEnglish, and I'll try to diagnose the rest.
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 #157
Well the error went away, but I still get a black screen, and I'm not even really using the map engine right now, literally the flow of my engine is MapEngine() -> analogue:map:enter(), which creates a person, attaches the camera to it, then immediately hands over control to Scenario for the opening scene.  So I finally stuck an Abort call in the analogue enter() function, and it looks like the enter script is never being called.  Well, that explains that.

That out of way, I tried testing the battle engine WITHOUT starting up the map engine, but the minute I got to the title screen (after re-enabling it) it errored out with "GetPlayerKey is not defined". Damn.

Additionally, got this when trying to start the battle engine: GradientCircle is not defined (my MP gauge uses it).
  • Last Edit: August 17, 2013, 10:29:22 am by Lord English
neoSphere 5.9.2 - neoSphere engine - Cell compiler - SSj debugger
forum thread | on GitHub

Re: Sphere SFML v0.75alpha
Reply #158
Small suggestion: at the moment functions like GetSystemFont create a new font object every time they are called, loading the font each time. These should really be cached, otherwise scripts that call them in a loop will quickly run out of memory.

  • Fat Cerberus
  • [*][*][*][*][*]
  • Global Moderator
  • Sphere Developer
Re: Sphere SFML v0.75alpha
Reply #159
I think that was done intentionally, so that if the user makes changes to the object the changes don't propagate between calls (the idea is to get an unmolested stock object).  It's really not good to call functions like this in a tight loop anyway, even if you know it just returns a cached value.  Function calls carry overhead, so every one you call inside of the loop adds up.
neoSphere 5.9.2 - neoSphere engine - Cell compiler - SSj debugger
forum thread | on GitHub

  • Radnen
  • [*][*][*][*][*]
  • Senior Staff
  • Wise Warrior
Re: Sphere SFML v0.75alpha
Reply #160
GetSystem* used to not return copies but I think that changed for precisely what Lord English said. You can of course, cache your own system resource. :)
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

Re: Sphere SFML v0.75alpha
Reply #161

GetSystem* used to not return copies but I think that changed for precisely what Lord English said. You can of course, cache your own system resource. :)

Yeah, I'm lazy and often use GetSystemFont().drawText for debugging.

A possible solution would be to cache the texture rather than the whole object.

  • Radnen
  • [*][*][*][*][*]
  • Senior Staff
  • Wise Warrior
Re: Sphere SFML v0.75alpha
Reply #162
Texture caching is used for the GetSystemArrow's. Modifying them just replaces their texture, but recalling it just gives you back the original texture reference. I can do this for fonts too, but there were some optimizations in place so that you directly edit the underlying texture atlas. This means GetSystemFont() and GetSystemWindowStyle() will keep cloning but GetSystemUp/Down/Arrow's are free to use in a loop.
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

  • Radnen
  • [*][*][*][*][*]
  • Senior Staff
  • Wise Warrior
Re: Sphere SFML v0.75alpha
Reply #163
I tried JSIL on this beast and it works! ... sorta.

So, I got it to finally read in all of the dependencies to run the program, but then it get's caught up: "Failed to find game.sgm in startup/"

So, at least it's searching for a game in the startup folder if one is not specified. So, I'm close but not quite.

Edit: the error here is that there indeed is a game.sgm in the startup folder!! So I don't know why it can't find it.
  • Last Edit: November 30, 2013, 09:40:49 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
  • [*][*][*][*][*]
  • Administrator
  • Senior Administrator
Re: Sphere SFML v0.75alpha
Reply #164
Once you get to a usable point I highly recommend creating a JSIL branch in your sphere-sfml repo or in the web-sphere repo! ^_^

Let me know if you need the reference map engine JS done before that happens, since I'll be working on it Sunday afternoon.