Xorifelse
I'd love to elaborate about discussions...........
- Reaction score
- 87
I'm currently thinking about possible ways to make mmorpg, the basic view is like 2d, but I'm hammering about the best way to create emumerations.
For example, I'd like only that the server sends packages about units in range of a player, but how to do this isn't as easy as most people think.
Yeah, ofcourse I can loop though all the units x and y pos on registered on the server, but that can lead to giantic loops and slow down server execution.
Now I have a theory in mind, that instead of using x and y positions I just have a unit struct with an unsigned integer named pos. Where I'd do a mathematical formula which would store both the x and y postion in 1 integer. This would seriously improve the loop speed.
However, my experience with c++ isn't that good, in fact I barely know the syntax. So I'd like to ask some of the C++ guru's here if their are better ways to do struct enumerations of player struct position.
Thanks in advance.
For example, I'd like only that the server sends packages about units in range of a player, but how to do this isn't as easy as most people think.
Yeah, ofcourse I can loop though all the units x and y pos on registered on the server, but that can lead to giantic loops and slow down server execution.
Now I have a theory in mind, that instead of using x and y positions I just have a unit struct with an unsigned integer named pos. Where I'd do a mathematical formula which would store both the x and y postion in 1 integer. This would seriously improve the loop speed.
However, my experience with c++ isn't that good, in fact I barely know the syntax. So I'd like to ask some of the C++ guru's here if their are better ways to do struct enumerations of player struct position.
Thanks in advance.