Pixel Movement

by Forum_account
Pixel Movement
A pixel movement library for isometric and top-down maps.
If there are any lags, what can i do to prevent them? Give me detailed information if you could. Maybe the amount of players, mobs, map size or whatever else it could be. I'd like to have this running smoothly when i use it, but only if it can run smoothly with many players in one map without LAG.
In response to Proxon
Proxon wrote:
If there are any lags, what can i do to prevent them? Give me detailed information if you could. Maybe the amount of players, mobs, map size or whatever else it could be. I'd like to have this running smoothly when i use it, but only if it can run smoothly with many players in one map without LAG.

It depends on what causes the lag. Most lag that players experience is just a consequence of network latency which can't be avoided. I'd guess that another common cause of "lag" is having AI loops running for lots of enemies that uses up a lot of CPU time. The library has some examples of how to improve performance - check the demo in the "optimization-demo" folder.
Alright. There's no point to making this pixel movement if you get the exact same problem that many other people in the past have had when making these pixel movements.

If there's a way for you to figure out how to avoid the lags by doing some programming you should do it otherwise this will be very bad for many games no matter how popular it is on byond.

When you figure out how to fix it i will use it, until then I'll stick with things that do not lag.
In response to Proxon
Proxon wrote:
When you figure out how to fix it i will use it, until then I'll stick with things that do not lag.

There's nothing to fix. All network communication has latency which can adversely affect gameplay but there's no way around it. This article might provide some more useful information.
Have you ever thought that maybe there's a way to code those issues away?
Maybe a separate program to work with the pixel movement to make it more efficient?
In response to Proxon
Proxon wrote:
Have you ever thought that maybe there's a way to code those issues away?

When you send messages from one computer to another there will always be some delay. You can alleviate this problem by making games that players can run locally (instead of having dedicated servers) and by having multiplayer aspects without actual multiplayer gameplay - for example, you could have players compete against each other for high scores and still have everyone run the game locally.
For some reason, if I have a mob that's bigger than 32x32 it doesn't appear on the map :/

Nevermind, I was being an idiot c:
This may or may not have been reported already.
I was experimenting a bit and taking a look at the libary, while it has no importance at all, here an improvement on the distance_to() proc, which I would simplify;

distance_to(atom/a)
var dx = (px + pwidth / 2) - (a.px + a.pwidth / 2)
var dy = (py + pheight / 2) - (a.py + a.pheight / 2)
if(PixelMovement.distance == PixelMovement.EUCLIDEAN)
return sqrt(dx * dx + dy * dy)
else if(PixelMovement.distance == PixelMovement.BYOND)
return max(abs(dx), abs(dy))
else return abs(dx) + ab(dy)


Not really any improvement but for those who cares about efficiency and memory usage, it is jut a small improvement, as dx and dy are always the same, and are defined three times, which could have been avoided at first hand.
loading pixel-movement.dme
isometric-demo\demo.dm:25:error: pdepth: undefined var
isometric-demo\demo.dm:39:error: pz: undefined var
isometric-demo\demo.dm:50:error: pdepth: undefined var
isometric-demo\demo.dm:52:error: pz: undefined var
isometric-demo\demo.dm:56:error: ramp: undefined var
isometric-demo\demo.dm:57:error: ramp_dir: undefined var
isometric-demo\demo.dm:61:error: ramp: undefined var
isometric-demo\demo.dm:62:error: ramp_dir: undefined var
isometric-demo\demo.dm:63:error: pdepth: undefined var
isometric-demo\demo.dm:67:error: ramp: undefined var
isometric-demo\demo.dm:68:error: ramp_dir: undefined var
isometric-demo\demo.dm:73:error: pdepth: undefined var
isometric-demo\demo.dm:78:error: pdepth: undefined var
isometric-demo\demo.dm:83:error: pdepth: undefined var
isometric-demo\demo.dm:90:error: pdepth: undefined var
isometric-demo\demo.dm:96:error: pdepth: undefined var
isometric-demo\demo.dm:99:error: ramp_dir: undefined var
isometric-demo\demo.dm:100:error: ramp: undefined var
pixel-movement.dmb - 18 errors, 0 warnings

Tried to compile/run it. Didn't work.
seems like a very nice library, but I can't get it to work with my project when I launch my game, I just cant move, and my macros don't seem to work either, and there was nothing in the documentation saying what to avoid or take out to avoid such a problem. If you have any ideas pls let me know cuz I would like to try this out.
Page: 1 2 3 4