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

Pages: [1] 2 3
1
General / Re: how to properly handle input/events?
« on: September 17, 2014, 05:28:46 pm »
I did understand but just extra info for maybe different ways, for example if i google command based communication system i don't really get anything useful. maybe some source that it in a bit more detail maybe a comparison with other alternatives what alternatives are there could you even do a full game without one?

2
General / how to properly handle input/events?
« on: September 17, 2014, 05:11:49 pm »
Hello,

I Read the SFML game development book, and am very interested in how it handled input/events in its command based system. Is there anymore information on that subject? Also is this the best way if situational what other good methods are there? Should input be separated from other events? Should other systems than the entity system receive events? If so with the same system as the entities or different ones?

please help me and thank you for reading my post  :).

3
Feature requests / sf::vector and and azerty and qwerty feature requests
« on: August 17, 2014, 08:21:37 pm »
I would like to recomend 2 features one is more a convenience one and i know that sfml is not intended for convenience features but I still think it should be implemented.

1) being able to use math between a sf::Vector and a single number(a int or float etc) with operator overloading something like
sf::Vector2f position(2,4);
position += 1;
position *=  2;
 

and that position would equal 6,10 most vectors of other programs and libraries have this functionality

2) being able to get the type of keyboard (azerty, qwerty) being on a azerty myself this would help, so for example automaticaly detact the keyboard type and adjust the key bindings acordingly like wasd keys most of the time are wrong on azerty's

thank you for reading :)

4
General / Re: Recomended book
« on: June 09, 2014, 06:44:20 pm »
thank you,

I already found the page on StackOverflow but right now i would like something more game oriented.
And more general than for example physics or ai still great suggestions all I might look closer at programming linux games.
I also read the majority of Game programming patterns because it was available online also online books are very handy because i can start reading them right away. I might also take a closer look at game programming gems but i can't see anywhere to buy it are they still sold?

5
General / Recomended book
« on: June 09, 2014, 04:02:17 pm »
Hello,

I really like sfml and i bought the sfml game development book and think its a good read,
also i read several comment by popular members of this forum like nexus
that online tutorials aren't really good.

And books are best for good programming practice so i want to ask for a good book/books to read after sfml game development, I know this is the only book about sfml but books that use other language's are also good like SDL as long as it is platform independent because I work on Linux so no direct X there are enough books about that.

thank you for reading.

6
Feature requests / Re: sf::color change individual values
« on: February 18, 2014, 02:32:18 pm »
sorry i thought you could not acces them directly
so i tried using getters and setters wich didn't work so sorry

7
Feature requests / sf::color change individual values
« on: February 18, 2014, 01:26:44 pm »
I would like to request a feature for sf::color
that you can set and get individual attributes like r,g,b and alpha
it is very annoying to set them al together because you need to create
a seprete r,g,b variables to store at wich they are now

8
General / Re: strangest error with std::cout
« on: February 18, 2014, 11:22:49 am »
thanx I didn't use auto because I am not very used to that idea yet thanx vor the idea I am going to
use it now and I first had it->second but that gave some strange errors so

9
General / Re: strangest error with std::cout
« on: February 18, 2014, 09:43:04 am »
ok i foud out it had nothing to do with the function i posted it was in the following function i called
the hasValue function

std::unordered_map<std::string, KeyMapping>::iterator InputStates::hasValue(KeyMapping key)
    {
        for(std::unordered_map<std::string,KeyMapping>::iterator it = mKeyMap.begin();it != mKeyMap.end();it++)
        {
            if((*it).second == key)
            {
                return it;
            }
        }
        return mKeyMap.end();
    }
 

i accedently put the "return mKeyMap.end();"
after the if instead of after the for loop

but can anyone explain why this error was evaded after i put a std::cout in front it is so strange

10
General / strangest error with std::cout
« on: February 17, 2014, 03:32:09 pm »
okey i am making an library where it is possible to bind a string to a key
take a look at the following function
void InputStates::createMap(const std::string& map,const KeyMapping& key)
    {
       
        std::cout << std::endl;
       
        std::unordered_map<std::string, KeyMapping>::iterator i= hasValue(key);
        //std::cout << "create map 2" << std::endl;
        if(i != mKeyMap.end())
        {
                //std::cout << "create map 4" << std::endl;
            KeyMapping& tmp = mKeyMap[map];
            //std::cout << "step 1" << std::endl;
            mKeyMap[map] = key;
            //std::cout << "step 2" << std::endl;
            (*i).second = tmp;
            //std::cout << "create map 5" << std::endl;
        }else
        {
                                       
                //std::cout << "create map 3" << std::endl;
            mKeyMap.insert(std::make_pair(map, key));
        }
    }
 

nothing looks wrong does it?
it works perfectly until i remove or comment out the std::cout << std::endl;
at the begining of the function it chrashes the moment the function is called
so please help this is really the strangest problem i have ever seen

11
SFML projects / Re: mage engine
« on: January 21, 2014, 04:45:47 pm »
can I ask another quistion regarding the code

  • I wouldn't return internal details like a map's iterator. Try to encapsulate data and functionality.
how do you mean and how would you do it then [/list]

12
SFML projects / Re: mage engine
« on: January 19, 2014, 09:47:00 pm »
this code is written quickly and will most probably not work

Why do you post it then? Where do you define delta? Where do you include you ball.hpp? Where is your ball.hpp? How should mge::entityManager manager(); work?

I skimmed over the code of your "engine" and saw some manual memory management (new Square()) but no deletes, so your entityManager is leaking because you do not delete the memory you allocated on the freespace. (erase will only delete the pointer but not the memory he points at). Two options to solve the problem.

  • Use the C++11 smartpointers std::unique_ptr / std::shared_ptr. So you don't have to call delete manually. (I highly recommend this way)
  • Delete the objects manually


AlexAUT



I didn't really have time yet to write a full explanation of everything and stuff I will certainly but Nexus asked for it so I quickly made this without even testing so...

and ball.cpp needed to be .h

also I am not really used to c++11 yet and smart pointers I might do a little research though

How do you mean the GPL is not good I thought it was a open source licence that made you free to do with it want you want

Maybe you should read up on licenses  ;) Not all licenses are equal, not even open source licenses. The biggest problem with GPL is that it is a virus, it requires any code that uses a library that has a GPL to use also use a GPL license (because of derived works).

Quote
is the LGPL better then?

Not by much, the only difference is that if you link dynamically you don't need to use GPL/LGPL license.

ok then
which licence do you recommend?


13
SFML projects / Re: mage engine
« on: January 19, 2014, 04:24:01 pm »
Ok the explanation I wanted to do that but not really had the time to at the and of this post I will post a short explanation of the modules.

How do you mean the GPL is not good I thought it was a open source licence that made you free to do with it want you want
is the LGPL better then?

I know it is not really a game engine yet but I am planing to make it one it is just not yet complete.

I did the things you said except the second and the two latest: the second because i don't really understand it,
the fifth for the same reason and the last because I don't really want to depend too much an c++11 and i am not really used to it
so i don't know a lot yet

explanation: entity system
a system for managing entities
you create a entity by creating a class that inherits entity
then you create a entity manager object add entities to it update and render it like this:

a ball entity example
ball.cpp
#include "entity_system/Entity.h"

class ball : public mge::Entity
{
        public:
                ball();

                void update(double delta);
                void render(sf::RenderWindow& window);
        protected:
        private:
};
 

and the main code
#include <SFML/Graphics.hpp>
#include "entity_system/entityManager.h"

int main()
{
    sf::VideoMode VMode(800, 600, 32);
    sf::RenderWindow Window(VMode, "SFMLCoder Tutorial - Empty Window");
    mge::entityManager manager();
    manager.add(new ball());

    while (Window.IsOpened())
    {
        sf::Event Event;
        while (Window.PollEvent(Event))
        {
            switch (Event.Type)
            {
            case sf::Event::Closed:
                Window.Close();
                break;
            default:
                break;
            }
        }
        manager.update(delta);
 
        Window.Clear(sf::Color(0, 255, 255));
        manager.draw(window);
        Window.Display();
    }
 
    return 0;
}
 

this code is written quickly and will most probably not work

14
SFML projects / mage engine
« on: January 19, 2014, 03:16:15 pm »
hey this is a little beta engine I am making on top of sfml it currently only has 2 modules entity system and input module
it is called mage engine after the first name i have given it (mge which stands for mvl's  game engine)

the git repository can be found here:
https://github.com/unerize/mage-engine

any help is appreciated and if you add something i do not quite understand (i am not that good at c++ yet)
I would like to have a explanation.

also what do you think it is my first biblically released bit of code so any commentary is also appreciated

15
i am geusing it is something i had  problem with (it stil does not work with my own code ) but at least for the code of others it works
but it is that you need to port forward for the port you are using

Pages: [1] 2 3
anything