Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Radnen

Pages: [1] 2
1
SFML projects / Sphere Game Engine SFML port
« on: August 07, 2013, 04:32:49 am »
So, there is a video game creation program called Sphere. It's been around since 1997, and is therefore old. It was billed as an RPG game creation engine, but has since been used to make really any kind of game. It has a built-in tilemap engine and handles things like windowstyles (the borders of popup windows) fonts (as bitmaps) and spritesets (images with frames, delays,  directions, and indices). It uses JS as the game scripting language - the first to do this for that purpose - and it's API is very easy to use to get started, and up and running.

Sphere-SFML is a re-implemnation of the Sphere game API using SFML as the base for video game presentation. I wanted to make sure it's old API is kept intact so games made all the way back in 2001 can still run. But I also wanted to add new modern features, such as shaders and particle systems (It has a particle system but it's very clunky).

Anyways, I'm doing this in C#. This is a departure since the original was written in C++ and was cross-platform. But with some help from Mono I think I can make it cross platform - people mainly used Sphere under Wine anyways, so at least I have that option as a fallback.

As far as development goes I'd say I'm close to 80% realization of the Sphere game engine and API. I'll post screenshots of actual working games soon. Sphere had an abstraction layer for audio and graphics, so it had both a software and hardware driver. But the hardware driver is pretty bad and under SFML I can get a 400% speedup from sphere games.

The source code:
https://github.com/Radnen/sphere-sfml

tl;dr SFML is being used to resurrect a dinosaur - how cool is that!? Hell even it's JS engine is called "Jurassic".

2
DotNet / Re: Mono with OSX
« on: July 31, 2013, 11:40:09 pm »
I don't understand. I would first need to obtain a file named: libsfml-window.2.dylib

For me to even play around. I don't see that file anywhere in the sources... Well I do but it's like 1kb and I don't think it's even a proper dylib... right? I put it into ../Frameworks/ folder and still nothing happens.

3
DotNet / Re: Mono with OSX
« on: July 31, 2013, 08:12:34 pm »
Hmm, so those dylib files were the C++ source! :P

So I guess I have to build the csfml source into dylib files and use that.

Edit: same issue,
Mono: DllImport error loading library 'libcsfml-window.2.0.dylib': 'dlopen(libcsfml-window.2.0.dylib, 9): Library not loaded: @executable_path/../Frameworks/libsfml-window.2.dylib
  Referenced from: /Users/user/code/Engine/Engine/bin/Debug/libcsfml-window.2.0.dylib
  Reason: image not found'.
 

4
DotNet / Re: Mono with OSX
« on: July 31, 2013, 11:59:23 am »
Yes, I did the same for them. I noticed in the lib folder of the OSX 2.0 binary release that there are libsfml-graphics.2.0.dylib and libsfml-graphics.2.dylib. I don't understand the difference. Also the error I'm getting:

Mono: DllImport unable to load library 'dlopen(libsfml-graphics.2.0.dylib, 9): Library not loaded: @executable_path/../Frameworks/libsfml-window.2.dylib
  Referenced from: /Users/user/code/Engine/Engine/bin/Debug/libsfml-graphics.2.0.dylib
 

Seems to suggest that the mono libraries call other stuff from another library and I don't know where to begin with resolving that. For example, in the libsfml-window-2.0.dylib, libsfml-system.2.dylib is referenced but really not used by the .Net files. I begin to wonder if SFML.net is OSX compatible? I remember getting SFML.net to work in Linux by using .so files, but this seems different.[/code]

5
Feature requests / Re: Module music formats
« on: July 31, 2013, 10:21:17 am »
If instruments and samples are packed into the music files directly, they can't be shared right? So how do you keep music files small if instruments and samples are duplicated in each of them?

No they can be shared. The files are small since only the instruments needed (no more than 32, say) are stored and the instruments aren't that huge ~a few kb's in space.

If you want to do a bit of light reading here's a wikipedia page: http://en.wikipedia.org/wiki/Module_file

6
Feature requests / Re: Module music formats
« on: July 31, 2013, 10:07:20 am »
No; they do not. Sometimes you come across large module files since high-quality instruments and other samples were packed in with them. It's a very portable filetype - even though there and hundreds of them. The major players are .it, .mod, .xm, and .s3m

The rest are variations or not often seen.

I mean I'm okay with wav and ogg - you can 'render' midi and module music to those types, but it bloats filesize and I can't force someone to convert their songs if they don't want to - it's not just for me this feature but for a community of game makers.

7
Feature requests / Re: Module music formats
« on: July 31, 2013, 09:06:51 am »
I'm using C sharp, there are no good sound libraries out there for it. I guess I can try to make my own bindings.

I find that statement very hard to believe, just considering FFMPEG alone and what it can do. Look at my signature for the VideoStreamer I made with FFMPEG and I wrote my own simple bindings, but if you do not want to write your bindings there are already a good number of FFMPEG .NET bindings out there.

And getting past FFMPEG there is irrKlang, BASS, NAudio, Alvas.Audio, AudioLab, SoundTouch, and how many others out there. But you say there is no good libraries?

They are not free for commercial use. The latter half lack the types of files I want to play. And anything GPL is a nightmare.

I've been looking around for a free to use; open source; multi-format playback; mono compatible library and I have yet to find one. Now I wonder why SFML has such a limited # of types! Outside of wav and ogg you have virtually nothing that fits the bill.

:/

8
DotNet / Re: Mono with OSX
« on: July 31, 2013, 07:50:21 am »
The standard DLLNotFoundException: "csfml-graphics-2.dll". I thoroughly read through the dllmap tutorial on the mono website and the above *should* work.

Now the only other change I made is to use the name you used in the DllImport sections:
<configuration>
    <dllmap dll="csfml-graphics-2" target="libsfml-graphics.2.dylib" />
</configuration>
 

But that is not working. It doesn't even attempt to load the dylib or dll. I put the dylib file into the same folder as the executable, btw.

Edit: I got somewhere!

I added the config to the sfml-graphics-2.dll file instead and it now looks for the correct dylib file. But now I'm again getting a DllNotFoundException on the dylib file... hmm maybe a misspelling? I'm getting closer.

Edit: impossible.
Mono: DllImport error loading library '/Users/user/code/Engine/Engine/bin/Debug/libsfml-graphics.2.dylib': 'dlopen(/Users/user/code/Engine/Engine/bin/Debug/libsfml-graphics.2.dylib, 9): image not found'.

That is the exact path where the dylib is!! What is going on here!?

Edit:
I realized it was libsfml-graphics.2.0.dylib. I made that change... and still it complains that it doesn't exist.

Okay.. now I have this:
Mono: DllImport unable to load library 'dlopen(libsfml-graphics.2.0.dylib, 9): Library not loaded: @executable_path/../Frameworks/libsfml-window.2.dylib
  Referenced from: /Users/user/code/Engine/Engine/bin/Debug/libsfml-graphics.2.0.dylib
 

9
DotNet / Mono with OSX
« on: July 31, 2013, 04:17:39 am »
So I'm having trouble getting SFML to run under Mono on OSX. I added config files to the dlls, but I don't know if I did it right.

I add csfml-graphics-2.dll.config to the exe directory, and add the libsfml-graphics.2.dylib to it.
The config looks like this:
<configuration>
    <dllmap dll="csfml-window-2.dll.config" target="libsfml-graphics.2.dylib">
</configuration>
 

It should work; any ideas?

10
Feature requests / Re: Module music formats
« on: July 30, 2013, 01:54:46 am »
I'm using C sharp, there are no good sound libraries out there for it. I guess I can try to make my own bindings.

11
Feature requests / Module music formats
« on: July 29, 2013, 01:43:23 am »
I love module music files for their amazing small size to sound quality ratio.

I do propose a solution, not just a request:
I want you to upgrade the sound package of SFML to use audiere since it supports all the current (major) sound types and far, far, far more and it is known to be cross platform and mature, and is opensource/free I think if the license works out for you it would be a great start.

There are other libraries you can use but they have horrendous licensing. I'm using SFML 2.0.Net and I found the supported music/sound types lacking, I can't find any good audio libraries out there. But audiere is great, but no C-sharp bindings exist, plus you'd want to edit the C++ version before you make bindings of it, and so this is again great for that case.

12
DotNet / Re: RenderStates causing blank images to appear
« on: July 09, 2013, 11:37:28 pm »
Thank you! I was reading the docs and forgot about that C# idiom. I set up default parameters and now it's working just fine.

Also another strange thing:
VertexArray array = new VertexArray(PrimitiveTypes.Quad, 4);

array[0].Position = new Vector2f(0, 0);
 

Is an error due to not being able to set a returned value. You really can't fix that it's just another weird C# thing that makes coding a bit more interesting. :P So that means for the most part VertexArray is just about useless in .NET.

13
DotNet / Re: RenderStates causing blank images to appear
« on: July 09, 2013, 10:25:54 pm »
The code to do that is here:

        private Texture _image;
        private Sprite _sprite;
        private RectangleShape _shape = new RectangleShape();
        private RenderStates state = new RenderStates();

        public ImageInstance(ObjectInstance proto, string filename)
            : base(proto)
        {
                _image = new Texture(GlobalProps.BasePath + "\\images\\" + filename);
                _sprite = new Sprite(_image);
                PopulateFunctions();
                state.Texture = _image;
                DefineProperty("width", new PropertyDescriptor(_image.Size.X, PropertyAttributes.Sealed), true);
                DefineProperty("height", new PropertyDescriptor(_image.Size.Y, PropertyAttributes.Sealed), true);
        }
 

Drawing the sprite works, the texture loads just fine.

In fact just doing this makes the image invisible:
Program._window.draw(_sprite, new RenderStates());
 

14
DotNet / [solved] RenderStates causing blank images to appear
« on: July 09, 2013, 10:35:37 am »
Can someone help me with a weird issue? I'm trying to draw a transformed image. An image where the x's and y's can be whatever so it can look skewed, pinched, etc. with a texture.

The code I do that is here:
        [JSFunction(Name = "transformBlit")]
        public void TransformBlit(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4)
        {
            Vertex[] array = new Vertex[4];
            Color c = new Color(255, 255, 255);

            array[0] = new Vertex(new Vector2f((float)x1, (float)y1), c, new Vector2f(0, 0));
            array[1] = new Vertex(new Vector2f((float)x2, (float)y2), c, new Vector2f((float)_image.Size.X, 0));
            array[2] = new Vertex(new Vector2f((float)x3, (float)y3), c, new Vector2f((float)_image.Size.X, (float)_image.Size.Y));
            array[3] = new Vertex(new Vector2f((float)x4, (float)y4), c, new Vector2f(0, (float)_image.Size.Y));

            Program._window.Draw(array, PrimitiveType.Quads, state);
        }
 

Excuse the float conversions, I can only get doubles from the JS environment. The state object has the Texture property set to the texture I'm using. It should work! I am loading the texture before setting the state, and making sure it's not disposed in any way. Drawing the texture alone as a sprite works, but not this method. And this is AFAIK the only method where you can skew the drawn image.

You can try the code out at: https://github.com/Radnen/sphere-sfml
Just download, run in visual studio and have at it. The demo code should draw an image in the upper-left that is not a spaceship, but a face. As you can see, it's invisible even though transformBlit is being used. Removing the state will make it draw a white rectangle. So I know it's working, but just not applying the textured state.

15
DotNet / Re: Exceptions when using Transform.GetInverse()
« on: August 28, 2012, 09:35:10 am »
I can confirm that this code does not work for me either as of August 28th 2012.

I'm using the 2.0 RC that has been hosted on the site (and its csfml files), I believe there was something broken in that build (that is perhaps fixed by now).

Pages: [1] 2