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

Pages: 1 2 [3] 4
31
General / Re: Now to the ram "issues"
« on: October 26, 2017, 06:02:00 am »
Just because you're attempting to re-make a game in C++/SFML from a game engine doesn't guarentee improved performance. A lot of these popular engines have invested a lot of resources (time, money etc..) into development and I'd imagine in a lot of cases out perform a lot of home-brew engines.

Anther thing to note, Game Maker does convert the "textures" into texture pages which can reduce the impact the texture sizes loaded in memory.

32
General discussions / Re: is Migratable to SFML?
« on: October 10, 2017, 08:20:02 am »
Firstly,

Sprite Animation: - No
Image Loading - Yes
Drawing Feature - Yes
UI Event Handling tool - No
Built in Texture Packer - No

However, ALL of those features SFML is capable of if you implement them yourself. SFML is not a game engine.

33
Network / Re: Tcp server dealing with clients disconnecting
« on: September 28, 2017, 07:58:57 am »
You're making some very basic mistakes here. You should probably look deeper into vectors and smart pointers. 

34
General / Re: Sfml to exe
« on: September 22, 2017, 12:31:31 am »
The DLL's (if not compiled statically) are required to be in the same directory as the executable (*.exe).

35
Hi,

I (and I'm sure many others) was in the exact position you are in when I first started shifting from game engines (such as Game Maker) to pure code many years ago. Code can get messy, fast. It is mainly lacking overall programming experience and therefore, your code management is nonexistent. I didn't know where to start either, I didn't even know what keywords to search in google. So I decided the best thing to do, was to invest in a book. This was the book I picked up:

SFML Game Development
https://www.packtpub.com/game-development/sfml-game-development

It taught me the basics on how to manage my code, split code up into appropriate classes and using the correct containers for the right job. You can learn similar things online however; IMO, books are worth the quality.

36
I had this exact same issue & came to the same conclusion you did. Sadly this is the case.

37
Window / Re: Can't update and clear the window
« on: August 02, 2017, 12:44:43 am »
Clears the window straight after you display the back buffer that you've drawn to. Therefore those draw calls are redundant.
Although often the clearest way to use clear, draw and display is to place them in that exact order, it doesn't actually matter where they go in your code, just as long as they go in that order.
In this case, once everything has been drawn to the back buffer (draw), the back buffer is swapped with the front (display). Then, the back buffer (new one - was the old front) is cleared - not affecting the stuff just drawn as it's now on the front.

Thanks for correcting me! I indeed made a mistake by stating that  ;D

38
Window / Re: Can't update and clear the window
« on: August 01, 2017, 03:27:26 am »
I have got some problems regarding my project and I'm creating a quiz game where the window needs to be refreshed every time a new question appears. The initial menu works fine. But after the 1st question appears, the window doesn't update and doesn't clear when using the window.clear() function. Please help me in this regard.

while(window.isOpen())
{
    Event event1,event;

    while (window.pollEvent(event1))
    {
        if (event1.type == Event::Closed)
                window.close();
    }
    if (event1.type == Event::TextEntered && done == false)
    {
    if (event1.text.unicode < 128 && event1.text.unicode !=0)
        {
        str1 = static_cast<char>(event1.text.unicode);
        text2.setString(str1);
        //done = true;
        }
    }

    //window.clear();;
    window.draw(rect1);
    window.draw(rect2);
    window.draw(text2);
    window.draw(text1);

    window.draw(text3);
    window.draw(text4);
    window.draw(text5);
    window.display();


   if (Keyboard::isKeyPressed(Keyboard::Return))
        {
            if(text2.getString()=="1")
                /*{j=1;}
        }
    if(j==1)*/

        {
            text2.setString("");
            text1.setString(line1[i]);
            text3.setString(line1[i+1]);
            text4.setString(line1[i+2]);
            window.draw(rect1);
            window.draw(rect2);
            window.draw(text1);
            window.draw(text2);
            window.draw(text3);
            window.draw(text4);
            window.draw(text5);
            window.display();
   if (event.type == Event::TextEntered && done == false)
    {
    if (event.text.unicode < 128 && event.text.unicode !=0)
        {
        str1 = static_cast<char>(event.text.unicode);
        text5.setString(str1);
        }
    }

    window.draw(rect1);
    window.draw(rect2);
    window.draw(text1);
    window.draw(text2);
    window.draw(text3);
    window.draw(text4);
    window.draw(text5);
    window.draw(rect3);
    window.display();
    window.clear();


   if (Keyboard::isKeyPressed(Keyboard::Return))
        {
            if(text5.getString()=="a")



               /* {j=2;}
        }
    if(j==2)*/

       {
            text5.setString("");
            //window.clear();;
            text1.setString(line1[i+2]);
            text3.setString(line1[i+3]);
            text4.setString(line1[i+3]);
            window.draw(rect1);
            window.draw(rect2);
            window.draw(text1);
            window.draw(text2);
            window.draw(text3);
            window.draw(text4);
            window.draw(text5);
            window.display();
   // window.close();
   if (event.type == Event::TextEntered && done == false)
    {
    if (event.text.unicode < 128 && event.text.unicode !=0)
        {
        str1 = static_cast<char>(event.text.unicode);
        text2.setString(str1);
        //done = true;
        }
    }
//done=false;



    //window.clear();;
    window.draw(rect1);
    window.draw(rect2);
    window.draw(rect3);
    window.draw(text1);
    window.draw(text2);
    window.draw(text3);
    window.draw(text4);
    window.draw(text5);
    window.display();



   if (sf::Keyboard::isKeyPressed(sf::Keyboard::Return))
        {
            if(text5.getString()=="1")



               /* {j=2;}
        }
    if(j==2)*/

       {
            text5.setString("");
            //window.clear();;
            text1.setString(line1[i]);
            text3.setString(line1[i+1]);
            text4.setString(line1[i+2]);
            window.draw(rect1);
            window.draw(rect2);
            window.draw(text1);
            window.draw(text2);
            window.draw(text3);
            window.draw(text4);
            window.draw(text5);
            window.display();

        }
            }
}
}
}
}
}
 

I think you are lacking some basic understanding of SFML, perhaps you need to invest in some time in some tutorials? or purchase one of the many SFML books to get you started. A few issues in your code:

Code: [Select]
    window.draw(rect1);
    window.draw(rect2);
    window.draw(text1);
    window.draw(text2);
    window.draw(text3);
    window.draw(text4);
    window.draw(text5);
    window.draw(rect3);
    window.display();
    window.clear();

Clears the window straight after you display the back buffer that you've drawn to. Therefore those draw calls are redundant.

  • You're mixing a lot of events with draw calls. Which could work, but makes it hard to know what is going on.
  • event1 and event?
  • In your case, your event checking should happen in the while(window.pollEvent(event) loop


39
You need the CSFML binaries to be in the same directory as the .NET libraries.

40
SFML projects / Re: A small puzzle-platformer I've been working on
« on: July 20, 2017, 07:16:24 am »
I think it's quirky. You've clearly put a lot of effort into this and I think this could evolve into a great game. I look forward to seeing more updates as you progress along.  :)

41
SFML projects / Re: A small puzzle-platformer I've been working on
« on: July 20, 2017, 01:08:35 am »
I've been working on a small puzzle-platformer for a few weeks, and I think it's the best looking game I've made so far. Here are a few features I've implemented:

- Wall jumping
- The ability to freeze entities
- The ability to possess other people
- An 8-bit auto tiling engine
- Crates!

Here are some of the features in action

http://imgur.com/fbkaui2

And here's a quick shot of the tiling system

http://imgur.com/tsZZpQV

And here's a small album of all the gifs of the game

http://imgur.com/a/JJSgQ

I don't have a name for it yet, but I'm planning to release it soon. I don't want it to become a huge project, just something small. If you thought it looked interesting, I post updates on my twitter.

That's really cool! I like the interactions with the mouse, will they always be that way? or is that just for testing?

42
I still don't think we've got enough information to come to the conclusion of it being a bug. If the problem appears to be within the server which isn't using SFML, then we can't rule out that the code itself might not be compatible with a TCP client that SFML creates. It almost sounds as if in your scenario the client was refused. Have you tried a SFML server/client connecting to the localhost?

I haven't looked at the SFML networking source code; you may have to debug the SFML source to see what is required.

One also begs the question on why you are bothering to not use SFML for both server & client?

Edit:

Sorry, I noticed in your C++ example you had both SFML server/client. It just wasn't specified in your scenario. So did you actually test the SFML server/client together?

43
General / Re: Drawing outside the window
« on: July 18, 2017, 03:36:09 am »
Is it possible to use SFML (+OpenGl if necessary) to read/draw from/to the screen 'directly'? I would like to be able to query the screen state (like a big 2d array of RGB values, or similar) and write to the screen (manipulate specific pixels).

No, you will need to use OS specific functions.

44
Graphics / Re: Pixel Color
« on: July 04, 2017, 04:18:40 am »
SFML forum,

 How can I read the color of a specific pixel on the screen?

jerryd

Your best bet to my knowledge would be to use a Window.capture() which returns an image, then you can use getPixel(x, y). It'll be a very expensive operation.

45
General / Re: can't open sfml-window-d-2.dll
« on: July 03, 2017, 05:04:10 am »
Try adding the .dll to the executables directory.

Pages: 1 2 [3] 4