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

Pages: 1 [2] 3 4
16
General / Re: Game Server Structure
« on: October 22, 2014, 03:41:09 pm »
i'm still at beginning, have to make fully working BOT system then add players, so protecting/securing code phase will be at the end.

EDIT:

ToDo List:
let npc be aware of map.
AI + they should attack each other (not in real game)
data echange between maps (for players)

17
General / Re: Game Server Structure
« on: October 22, 2014, 09:09:57 am »
i meant to not let them make the string longer.

18
General / Re: Game Server Structure
« on: October 22, 2014, 06:19:34 am »
i dont use strings anywhere (except player name or some text in game) even npc name is an enum in server.
About changing string-names in client, first way to "protect" it, is using char[] but still... not enough.

EDIT:

so i assume theese are the most suitable containers for my needs.

std::vector<std::unique_ptr<entity::Actor>> m_npcs;
std::deque<std::unique_ptr<entity::Actor>> m_players;

std::vector = there is only static amount of npcs that respawns on death
std::deque = because player can change his/her map, so i need to delete in middle

19
General / Re: Game Server Structure
« on: October 21, 2014, 10:46:40 am »
now i understand.

Well, static things like Hitpoints,Shield,Wapons are in application/ram, and (as you said) stats will be in database (persistent)

20
General / Re: Game Server Structure
« on: October 21, 2014, 09:10:39 am »
i dont use any DB/File, intead i use computer memory:

databaseNPC, databaseMap: (example)
enum iType
{
        A = 0,
        B,
        C
}

struct iStruct
{
        int a;
        int b;
        int c;
}

static std::map<enum, const iStruct> m_db;

funcs:
static void initialize(); // to add all npcs .or. maps to db
static const iStruct get(const enum);
 

i use this for npcs & maps that's the reason of std::map

21
General / Re: Game Server Structure
« on: October 20, 2014, 09:56:50 pm »
i'm not quite sure what do you want to tell me with that :D

22
General / Re: Game Server Structure
« on: October 20, 2014, 04:11:23 pm »
It's not "local" game, it's multiplayer, so maps are paused except map/s where is/are player/s.

23
General / Re: Game Server Structure
« on: October 20, 2014, 06:29:28 am »
I've already done this couple of minutes ago before i read your post :D :

managerMaps.cpp
Maps::Maps()
{
        m_maps.reserve(global::MAP::MapsAmount);
}

m_maps is a std::vector

but thanks :) .

24
General / Re: Game Server Structure
« on: October 19, 2014, 11:31:15 am »
Xornand: thanks :) it helped a lot.

And that std::vector, well i never used it because it reallocate everything when added something new but when i read your post then i reallized this in my mind :D : (f**k, i use only static amount of maps and npcs....., he's right)  ;D

25
General / Re: Game Server Structure
« on: October 18, 2014, 11:35:26 am »
okay, i'll try to "explain" more

EDIT: i hope it's better now :) .

26
General / Game Server Structure
« on: October 18, 2014, 11:04:06 am »
Hello, after long time  ;D .

I want help because i've got problem with my game-server code structure (c++) VS2013.

#I'm getting quite pissed off when:
 - i want to let ent/npc get some data from map,
 - exchanging data between two maps

@ because the structure looks like this:

Main - calls funtion Server::run() to prepare an initialize enviroment.
   |
Server - everything what this does is controling FPS and calls MapMgr::update()
   |
MapMgr - there is std::map<enum, std::unique_ptr<Map>> to store maps & updates them.
   |
Map - std::deque<std::unique_ptr<EntActor>> storing npcs & in update() calling ptr -> update();
   |
EntActor - whole interface, move, goto, health, shield, speed .....

EntActor::update()
moves/rotates entity to specified location, or try attack any near player by data from Map.

and this whole system is one-way, should i make some sort of a global-message-bus ?
Please tell me if you have better idea :) .

# Problem begins when i want to port/move EntActor from map1 to map2.

27
Feature requests / Re: System specs
« on: June 16, 2014, 03:33:00 pm »
Quote
And what if not? You quit with a nice error message? :P
it was morning and nothing else I could think of :D

Quote
You can also use the specs for auto-configuration of the program's settings.
very nice idea, like in "Call Of Duty" and many others :) .

28
Feature requests / System specs
« on: June 16, 2014, 05:58:43 am »
wouldn't it will be nice to have some commands
to get system specifications like amount of ram ? :)
in windows it is thru GetSysytemMetrics() [ i hope i am right :) ]

# it could look like this:
sf::System::Cpu::Amount();
sf::System::Cpu::Speed(); [in Hz]

sf::System::Ram::Size(); [in KB]
sf::System::Ram::Usage(); return Vector2u(used, left);

sf::System::Gpu::Size(); [in KB] // i'm not so sure about writing this on my own
 

point: check if game can run of that system, or other :D
You can also use the specs for auto-configuration of the program's settings.

if this will be accepted, then i can write code for windows.

29
Graphics / Re: onCreate() text glitch
« on: May 11, 2014, 04:44:06 pm »
I was just curious, so i tested that function. :)

30
Graphics / Re: onCreate() text glitch
« on: May 11, 2014, 01:12:29 pm »
class Window : public sf::RenderWindow
{
        private:
                sf::Font font;
                sf::Text text;

        public:
                void onCreate()
                {
                        font.loadFromFile("assets/fnt/orbitron/medium.otf");

       
                        text.setFont(font);
                        text.setCharacterSize(14);
                        text.setColor(sf::Color::White);
                        text.setString("0123456789-\nabcdefghijklmo\npqrstuvwxyz");
                }

                void draw_()
                {
                        draw(text);
                }
};

void main()
{
        Window window;
        window.create(sf::VideoMode(800,600,32), "...");

        while (window.isOpen())
        {
                window.clear();
                window.draw_();
                window.display();
        }
}

Pages: 1 [2] 3 4