Skip to main content

News

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

  • Radnen
  • [*][*][*][*][*]
  • Senior Staff
  • Wise Warrior
Re: Sphere SFML
Reply #30

Also, it can run games already? Nice!


Just about *anything* that doesn't use the map engine or certain function calls that I hadn't implemented, to see the list check out the project and run through it's test cases. I'll try to enumerate a better list later today, but so far I have:

Color object 100%,
Images, 100%,
Windowstyles 100%,
Fonts 90%,
Input minus mouse wheel and joystick axes (so like 90%),
Surfaces like 20%.

Nothing with the map engine, yet. But I have emulated the Sphere command queue in another project of mine, so I know exactly how it works.
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
Reply #31
Hmm, do you have anything precompiled for us non-.NET folks? I wanna try out some stuff. :) (In Windows now, too, so it'll Just Work.)

  • Radnen
  • [*][*][*][*][*]
  • Senior Staff
  • Wise Warrior
Re: Sphere SFML
Reply #32

Hmm, do you have anything precompiled for us non-.NET folks? I wanna try out some stuff. :) (In Windows now, too, so it'll Just Work.)


Oh, uh soonish. :)
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
Reply #33
Okay. I can wait until things get stable. :P

Edit: Oh! Uh... The Japanese full-width font was on, for some reason. Strange, normally it toggles between regular text and Japanese, not this weird stuff...

  • Radnen
  • [*][*][*][*][*]
  • Senior Staff
  • Wise Warrior
Re: Sphere SFML
Reply #34
I'll put up an alpha build. I should add a webpage or it too. Check the OP for a download. Use -game to run a game, just like in normal sphere. It worked for me... but you *might* need to have the games in a /games folder for now I haven't tested a full path, but it should work.
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
Reply #35
Thanks! Checking it out right away.

(Fixed the link, tengudev is a .com. ;))

(edit - TENGUDEV is a .com, spheredev is still .org ;)  ~neo)
  • Last Edit: July 16, 2013, 03:45:02 pm by N E O

  • DaVince
  • [*][*][*][*][*]
  • Administrator
  • Used Sphere for, like, half my life
Re: Sphere SFML
Reply #36
Well, it will certainly run your game, no matter if I just run the engine or use -game! But trying any of my own test games, it always crashes with the following (tried translating the error from Dutch):

Code: [Select]
C:\Users\Vincent\Downloads\temp\sphere-sfml-0.5\sphere-sfml>Engine -game games\D
aVince-Examples\Example2\game.sgm

Unhandled exception: System.ArgumentOutOfRangeException: Length can't be lower than zero.
Parameter: length
   bij System.String.InternalSubStringWithChecks(Int32 startIndex, Int32 length,
Boolean fAlwaysCopy)
   bij Engine.Objects.GameFile.ReadFile(String filename)
   bij Engine.Program.Main(String[] args)


This happens even if I set it as the startup game.
One of the games I tried is attached.

EDIT: re-uploaded so it works without the time.js system script, and uses SetFrameRate() instead (it checks if the functionality SetFrameRate exists, first).
  • Last Edit: July 14, 2013, 06:38:47 pm by DaVince

  • Radnen
  • [*][*][*][*][*]
  • Senior Staff
  • Wise Warrior
Re: Sphere SFML
Reply #37
Ok, I see what's wrong.

I also don't have RequireSystemScript. So, I'll have to add those in 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

  • DaVince
  • [*][*][*][*][*]
  • Administrator
  • Used Sphere for, like, half my life
Re: Sphere SFML
Reply #38
Nice! Looks better, too. And I fixed the test for now by using SetFrameRate instead (if the function exists).

A request: being able to run the game by dragging its game.sgm or directory to engine.exe. In other words, supporting "Engine.exe path/to/game". The old engine was able to do this, and it's useful for quick testing (dince I need to find the console and cd to the path right now).
  • Last Edit: July 14, 2013, 10:10:20 pm by DaVince

  • Radnen
  • [*][*][*][*][*]
  • Senior Staff
  • Wise Warrior
Re: Sphere SFML
Reply #39
Alright.

Wow, setCharacterImage will be tough to do! It involves dismantling the font's texture atlas and rebuilding it with the new letter added. Jeez.

Edit: alright, it is done. I'll make a newer version soon after I implement a few more things.

Edit: dragging and dropping a game over the .exe seems to set the working directory to the directory of the dropped item. Hmm... I need to do some changes to fix system scripts access in that case.

Edit: finished that, phew! I couldn't compromise at all. If you load from the exe, the working directory becomes the exe's which makes the game's directory unavailable, but if you load with a file dragged and dropped onto it, the working directory becomes the games, which makes /system directory unavailable. So I had to say "hey, no matter where you are executing from just remember this executable and the game and use those explicitly". I wanted to have an implicit working directory, but that's not going to happen.

I'll have a new download up soon. Just a few more API features and I'll go.

Edit: And it's done another release is up.
  • Last Edit: July 15, 2013, 02:33:53 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

  • Radnen
  • [*][*][*][*][*]
  • Senior Staff
  • Wise Warrior
Re: Sphere SFML
Reply #40
Sounds added! I've put up a new version, get while it's hot!
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
Reply #41
Nice work! However, the engine crashes when I change my system volume (currently outputting through a secondary HDMI source, if that matters). It's also making a very slight high-pitched noise during the silent menu (and it will crash when changing the volume there, too).

I like the pitch changing feature. :P

Oh, and I can't up the volume in-game when I turn it down. It seems to set a new upper limit or something.

Edit: something else, the ctrl key isn't detected properly. The attached demo tries checking if you press ctrl, and it will only continue if you press right ctrl, not left ctrl.
Edit 2: that Hmm rectangles demo from before reports it's running at 63 FPS instead of the fixed 60.
Edit 3: IT modules won't load (unsupported format). That's fine and all, but instead of aborting, the engine locks up and crashes with a Windows error message. Try the attached SoundTest. It seems to recognize that the sound format isn't supported, but then it seems to try and play it anyway.
Edit 4: the colours do something funky they don't do in regular Sphere. Check the attached DaVince-AnimTest and pay attention to the colour-changing text.
Edit 5: In the attached DaVince-textdemo, most of the characters from the font aren't drawn! I only see these characters: ! 0 :
  • Last Edit: July 15, 2013, 07:11:40 am by DaVince

  • Radnen
  • [*][*][*][*][*]
  • Senior Staff
  • Wise Warrior
Re: Sphere SFML
Reply #42
1. the pitch changing features is in normal sphere too.
2. the volume SFML takes is between 0 and 100, there might still be a rounding issue when converting from 0 and 255, but my tests seem to pass.
3. SFML has RControl and LControl. :P I may need to make a separate global variable for ctrl and tie it to both buttons. Same for Alt and Shift.
4. SFML doesn't use fixed timestep. When you set it to 60fps it'll aim for 60. It has to do with the OS sine it idles/sleeps between frames and that's not perfectly timed.
5. I need to move away from SFML's sound library, if you want to know hat types it can load go here: http://www.mega-nerd.com/libsndfile/
6. Hmm, weird.
7. Well, the letters started to consume the whole texture atlas! Ok, I have made the texture atlas larger and now it works. I was testing with smaller fonts and that didn't happen. Anyways I'll try for an automatic detection.
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
Reply #43
Quote
2. the volume SFML takes is between 0 and 100, there might still be a rounding issue when converting from 0 and 255, but my tests seem to pass.

Your test game starts at 255, and I can go down as much as I like, but I can only go back up a few bits. So when I lower the music volume to 245, I can only get back up to around 247. If I go down to 200, I can only get back up to 202. That's what I meant.

  • Radnen
  • [*][*][*][*][*]
  • Senior Staff
  • Wise Warrior
Re: Sphere SFML
Reply #44

Quote
2. the volume SFML takes is between 0 and 100, there might still be a rounding issue when converting from 0 and 255, but my tests seem to pass.

Your test game starts at 255, and I can go down as much as I like, but I can only go back up a few bits. So when I lower the music volume to 245, I can only get back up to around 247. If I go down to 200, I can only get back up to 202. That's what I meant.


Right, but the difference from 255 and 253 is not the same as 100 and 98, because of this mapping issue, you can't climb back up (or very far), since things are floored you can only go down. In sphere if you notice things go down in 1 increments while in my version it can down in 1 to 3 increments due to the rounding + conversion. This can be fixed with an independent value scaled to fit SFML and Sphere.

Edit: and it's fixed.
  • Last Edit: July 15, 2013, 07:34:11 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