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 - Spodi

Pages: 1 [2] 3 4 ... 10
16
SFML projects / NetGore - C# open source MORPG engine
« on: December 17, 2010, 01:16:46 am »
Version 0.3.5 has been released.

Quote from: "Change log"
This release mostly contains bug fixes and design improvements, both in the database and in code.

- Many database tables now use auto_increment instead of the next free ID. Tables that do not insert/delete rows outside the editor, such as character and item templates, still use the next free ID.
- Added EventCounters class, which is like a very high-performance, light-weight version of WorldStats. See the feature description for more details.
- All object events now use EventHandler to adhere to the .NET standard practices better
- All events in NetGore are now invoked by using a .Raise() extension method that will, by default, log and swallow any exceptions thrown by the event listeners
- Added new mini-project to check the NetGore code to make sure events are all being invoked properly
- Content files can now be "recycled", which puts them in a special "recycled" asset folder instead of actually deleting them. Basically like a custom Recycling Bin for NetGore's content.
- The sound and music can now be edited and auto-updated via the editor
- Can now properly create and delete particle effects and emitters
- Can now define custom filters in StringRules
- When there is an issue with loading content, it won't spawn a message box every second

And as always, many more changes were made, and the complete listing can be found in the SVN logs.

17
DotNet / RenderImage woes
« on: December 08, 2010, 11:59:29 pm »
Any updates on this, Laurent?

18
General discussions / How works complicated 2D animations
« on: December 01, 2010, 11:36:03 pm »
You can still use a skeleton. If its a side-scroller, you can get away with using just a 2d skeleton and slapping sprites onto the joints instead of having to deal with skinning. Otherwise, you'll have to create a 3d model and render it in a 2d plane.

19
General / Save's file
« on: November 30, 2010, 12:46:18 am »
That is pretty much the approach people will take when encrypting their game files. Most people don't really bother with encrypting it much. Even a lot of commercial games leave their save files unencrypted - some while even using a human-readable format such as XML. But plenty of games use their own format (usually just binary file I/O since it is fast and often easy to serialize) so it looks encrypted, when in reality its just in a format that makes no sense to you.

Any algorithm would do. I'd personally go for something very fast with no inflation if I were to ever do this. Though if I wanted to obfuscate the save files, I'd prefer to just compress it with a fast, light-weight compression algorithm. That way you get some other benefit instead of just obfuscating the data.

It really isn't worth putting much time or effort into it, and definitely not worth using something that will have a noticeable impact on performance. If people care enough, they will just reverse-engineer the decryption code from your program's binary. Or, even easier, just use a memory editor.

I personally find encrypted save files more annoying than anything. At least when its unencrypted and in a format you can understand (like XML), you can repair your own faulty save files (like if your character gets stuck in a wall).

20
General discussions / SFML 2 for OS X comes true!
« on: November 25, 2010, 10:07:48 pm »
Great work, Hiura! Greater portability is always a good thing. :)

21
SFML projects / NetGore - C# open source MORPG engine
« on: November 24, 2010, 09:42:05 pm »
Version 0.3.4 has been released.

22
Graphics / Post Effects question
« on: November 21, 2010, 09:03:13 pm »
This might be a good resource to read for the basics on GPGPU:

http://www.mathematik.uni-dortmund.de/~goeddeke/gpgpu/tutorial.html

23
Graphics / Post Effects question
« on: November 21, 2010, 05:00:09 am »
Generally, if you want to grab values out from the GPU and bring it back into system memory, you will want to write it to a texture. Basically just like drawing, but the generated image isn't for the purpose of displaying.

24
DotNet / RenderImage woes
« on: November 15, 2010, 08:30:25 pm »
Alright, here is a similar test program that makes it much easier to see the issue at hand:

Code: [Select]
using System;
using SFML.Graphics;

namespace ConsoleApplication2
{
    class Program
    {
        static void Main()
        {
            Random rnd = new Random();

            using (var rw = new RenderWindow(new SFML.Window.VideoMode(800, 600), "Test"))
            {
                rw.UseVerticalSync(true);

                // Create shape to create test sprite
                Shape sh = Shape.Rectangle(new FloatRect(8, 8, 32, 32), Color.White);
                int i = 0;

                RenderImage buffer = null;
                while (rw.IsOpened())
                {
                    rw.DispatchEvents();

                    // Update the view to fit the RenderWindow
                    rw.SetView(new View(new FloatRect(0, 0, rw.Width, rw.Height)));

                    // Change shape color
                    if (++i % 50 == 0)
                        sh.Color = new Color((byte)rnd.Next(0, 255), (byte)rnd.Next(0, 255), (byte)rnd.Next(0, 255), 255);

                    // Ensure the RenderImage is created with the same size of the RenderWindow
                    buffer = CreateBuffer(rw, buffer);

                    if (!rw.Input.IsKeyDown(SFML.Window.KeyCode.A))
                    {
                        // Draw with buffer

                        // Draw to the buffer
                        buffer.Clear();
                        buffer.Draw(sh);
                        buffer.Display();

                        // Clear the screen and draw the buffer to the screen
                        var s = new Sprite(buffer.Image);
                        rw.Draw(s);
                        rw.Display();
                    }
                    else
                    {
                        // Draw without buffer
                        rw.Clear(Color.White);
                        rw.Draw(sh);
                        rw.Display();
                    }
                }
            }
        }

        static RenderImage CreateBuffer(RenderWindow rw, RenderImage existingBuffer)
        {
            // If the buffer doesn't exist or is the wrong size, it must be created
            if (existingBuffer == null || existingBuffer.Width != rw.Width || existingBuffer.Height != rw.Height)
            {
                // If the buffer already exists, dispose it
                // NOTE: This disposal is what breaks the rendering. Remove it and it works again.
                if (existingBuffer != null)
                    existingBuffer.Dispose();

                // Return the new buffer
                var ret = new RenderImage(rw.Width, rw.Height);
                return ret;
            }

            // Existing buffer is already the correct size, so do not recreate
            return existingBuffer;
        }
    }
}


Basically, when I resize the window, the display "freezes". Its like the RenderImage isn't recreated with the new size and retains the image that was last drawn to it. This only seems to happen when Dispose is called on the RenderImage.

Some things to note:
1. Even though the screen is "frozen", everything else seems to work fine.
2. If you draw without the buffer (press A), then go back to drawing with the buffer, it starts working again.
3. Even when the RenderImage is garbage collected (comment out the dispose, add GC.Collect() in game loop), it doesn't seem to have this issue.

Hopefully that is enough info. :)

25
DotNet / Call to invalid method: sfShader_Create
« on: November 13, 2010, 08:47:03 pm »
Quote from: "Laurent"
Do you think that I should do it for every constructor of every class? Or maybe only resource classes (Image, Font, SoundBuffer, Shader)?


Right now, every resource class has a constructor that takes a string that loads from file (at least from what I remember). So it should be fine leaving the rest as they are since the Shader is just a special scenario that just happens to be able to load from a raw string.

26
DotNet / RenderImage woes
« on: November 13, 2010, 08:43:06 pm »
Thanks Laurent, that seems to fix the disposal issues. :)

I'm still getting the "screen not redrawing" issue. Though I don't know yet if its an issue on my side or SFML's. I'll look into it again when I have the chance, and if its still a problem, try to create a better example and description of the issue I am having.

27
DotNet / Call to invalid method: sfShader_Create
« on: November 13, 2010, 07:46:36 pm »
Now that we have this public LoadFromString, and you removed the default constructor, how should we go about using it without loading a shader from somewhere else first? :wink:

From what it looks like, the LoadFromString was never added since there was already a public constructor using a string (for loading from file). Maybe LoadFromString can be introduced as a public static method:

Code: [Select]
public static Shader FromString(string shader)
{
    return new Shader(sfShader_CreateFromMemory(shader));
}

Shader(IntPtr shader) : base(shader)
{
    if (This == IntPtr.Zero)
        throw new LoadingFailedException("shader");
}


Its a pretty common approach in .NET for when you have multiple constructors with very similar (or identical) parameters, but the way the parameters are used are very different.

28
DotNet / Using CurrentView
« on: November 13, 2010, 07:38:45 pm »
Unless I am missing something here, the following should update the view before each draw:

Code: [Select]
using System;
using SFML.Graphics;

namespace ConsoleApplication2
{
    class Program
    {
        static void Main(string[] args)
        {
            using (var rw = new RenderWindow(new SFML.Window.VideoMode(800, 600), "Test"))
            {
                Shape sh = Shape.Rectangle(new FloatRect(8,8,32,32), Color.Green);

                while (rw.IsOpened())
                {
                    rw.DispatchEvents();
                    rw.CurrentView.Reset(new FloatRect(0, 0, rw.Width, rw.Height));
                    // rw.CurrentView = rw.CurrentView;
                    rw.Draw(sh);
                    rw.Display();
                }
            }
        }
    }
}


But the changes made to CurrentView don't actually take affect until you do a hack like I have above in the commented-out line. If you leave that line commented out, CurrentView.Reset() appears to have no affect. Adding the commented out line, the view is resized as expected.

29
DotNet / RenderImage woes
« on: November 13, 2010, 07:27:16 pm »
It is hard to say exactly. One frequent problem is an AccessViolationException while the RenderImage disposes. I believe this is caused by:

Code: [Select]
myDefaultView.Dispose();

I had this commented out in my game to prevent the exception, but when calling Dispose, it still resulted in a strange issue where the RenderImage seems to refuse to update. It would continue to show the old display even though I am using a new RenderImage. On occasion, it would sometimes fix itself for no apparent reason. Recreated the RenderWindow would also fix it until you dispose of the RenderImage again.

30
DotNet / Call to invalid method: sfShader_Create
« on: November 13, 2010, 07:17:24 pm »
Thanks. :)

At the risk of sounding like a butt, the following should also be removed now:

Code: [Select]
static extern IntPtr sfShader_Create();

Code: [Select]
static extern IntPtr sfImage_Create();

And I'm not sure about this one, but:

Code: [Select]
void LoadFromString(string shader)

That method is never used. Was it supposed to be public?

Pages: 1 [2] 3 4 ... 10
anything