Mirage Source

Free ORPG making software.
It is currently Sat Apr 20, 2024 1:02 pm

All times are UTC




Post new topic Reply to topic  [ 588 posts ]  Go to page 1, 2, 3, 4, 5 ... 24  Next
Author Message
PostPosted: Fri Jan 05, 2007 10:40 am 
Offline
Knowledgeable
User avatar

Joined: Mon Jul 24, 2006 2:04 pm
Posts: 339
We have some smart programmers here, but more importantly, there are a lot of creative people here, so I wanted to know if I can get some of your guys's help. I am currently facing a problem with updating packets for movement. Why movement? Well movement is something that happens a hell of a lot, so it suffers a hell of a lot from packet headers. If you move 3 tiles in a second, which isn't that fast, that is 120 bytes in a second from just TCP and IPv4 packet headers.

Anyways, heres the link:
http://www.vbgore.com/forums/viewtopic.php?t=1406

Sorry it is lengthy, I tried my best to explain things (though probably didn't do a great job). Anyways, please post your suggestions here or there. Any suggestions are helpful.

Thanks for your help! :D

_________________
NetGore Free Open Source MMORPG Maker


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 05, 2007 12:18 pm 
Offline
Pro
User avatar

Joined: Mon May 29, 2006 3:26 pm
Posts: 493
Location: São Paulo, Brasil
Google Talk: blackagesbr@gmail.com
What I think you can do, and is actualy what I am doing is to make the distance checks server side, the way you didn't want to do becouse you said it uses to much CPU. I don't think it is that much CPU. I know the check would be used thousand of times each second if there are a lot of players online but you should do a speed test to see how many of this tests can be done with out any speed problem. Is a simple:
Code:
ok=0
If getplayerx(a)<getplayerx(b) then
    If getplayerx(a)+(mapxsize/2)+1>=getplayerx(b) then
        If getplayery(a)<getplayery(b) then
            If getplayery(a)+(mapysize/2)+1>=getplayery(b) then
                ok=1
            end if
        elseif getplayery(a)<getplayery(b) then
            If getplayery(a)-(mapysize/2)-1<=getplayery(b) then
                ok=1
            end if
        end if
    endif
elseif getplayerx(a)>getplayerx(b) then
    if getplayerx(a)-(mapxsize/2)-1<=getplayerx(b) then
        If getplayery(a)<getplayery(b) then
            If getplayery(a)+(mapysize/2)+1>=getplayery(b) then
                ok=1
            end if
        elseif getplayery(a)<getplayery(b) then
            If getplayery(a)-(mapysize/2)-1<=getplayery(b) then
                ok=1
            end if
        end if
    end if
end if
if ok = 1 then
    SENDPLAYERPOSITION
end if

Just quickly did this, not sure if is the best code and with less checks but I realy don't think that this cpu usage will be so big that it may stuck the server.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 05, 2007 12:50 pm 
Offline
Community Leader
User avatar

Joined: Mon May 29, 2006 1:00 pm
Posts: 2538
Location: Sweden
Google Talk: johansson_tk@hotmail.com
All that checking just to make sure if you should send the players positions to the other players seems useless. I will think about this and see if I get an idea or something.

But concerning the sending of the location to other online players, that should probably be map-wise, and not be divided up even if scrolling is used.

Moved to "Advanced Questions".

_________________
I'm on Facebook!My Youtube Channel Send me an email
Image


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jan 06, 2007 12:35 am 
Offline
Knowledgeable
User avatar

Joined: Mon Jul 24, 2006 2:04 pm
Posts: 339
Oops, sorry about the wrong section, William. :oops:

Problem with that, Dragoons Master, is you either end up with the 2nd routine I listed (the vbGORE v0.2.2 method) and you get many "ghosts" since you don't update their position again until they are back in the screen (so you will see them at their old position until you run into their real position, then they will warp over there).

Either that, or you have to check if they move out of the screen (so extra checks to see if they are moving away from you, and if they moved out of the view area), then delete the character, then remake them when they come back into view (which means you have to constantly do distance checks to see if they are in range and make and "update row" when the user is moving to force update any character that enters their view when they move). See how bulky it gets? :wink:

_________________
NetGore Free Open Source MMORPG Maker


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jan 06, 2007 12:48 am 
Offline
Pro

Joined: Mon May 29, 2006 1:40 pm
Posts: 430
Does vbGore have scrolling? Otherwise I'm not sure what the diff is between the screen and the map is.
How does the scrolling work, what is the map size in relation to the viewable screen?


Top
 Profile  
 
PostPosted: Tue Jan 25, 2022 7:15 am 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 480361
Alie


Top
 Profile  
 
PostPosted: Tue Jan 25, 2022 7:16 am 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 480361
174.7


Top
 Profile  
 
PostPosted: Tue Jan 25, 2022 7:17 am 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 480361
PERF


Top
 Profile  
 
PostPosted: Tue Jan 25, 2022 7:18 am 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 480361
PERF


Top
 Profile  
 
PostPosted: Tue Jan 25, 2022 7:19 am 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 480361
NIRV


Top
 Profile  
 
PostPosted: Tue Jan 25, 2022 7:20 am 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 480361
Ding


Top
 Profile  
 
PostPosted: Tue Jan 25, 2022 7:21 am 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 480361
Radi


Top
 Profile  
 
PostPosted: Tue Jan 25, 2022 7:23 am 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 480361
Davi


Top
 Profile  
 
PostPosted: Tue Jan 25, 2022 7:24 am 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 480361
Gall


Top
 Profile  
 
PostPosted: Tue Jan 25, 2022 7:25 am 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 480361
Emil


Top
 Profile  
 
PostPosted: Tue Jan 25, 2022 7:26 am 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 480361
Retu


Top
 Profile  
 
PostPosted: Tue Jan 25, 2022 7:27 am 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 480361
John


Top
 Profile  
 
PostPosted: Tue Jan 25, 2022 7:28 am 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 480361
Capc


Top
 Profile  
 
PostPosted: Tue Jan 25, 2022 7:29 am 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 480361
Bora


Top
 Profile  
 
PostPosted: Tue Jan 25, 2022 7:30 am 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 480361
dili


Top
 Profile  
 
PostPosted: Tue Jan 25, 2022 7:31 am 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 480361
Deko


Top
 Profile  
 
PostPosted: Tue Jan 25, 2022 7:33 am 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 480361
Thom


Top
 Profile  
 
PostPosted: Tue Jan 25, 2022 7:34 am 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 480361
Roco


Top
 Profile  
 
PostPosted: Tue Jan 25, 2022 7:35 am 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 480361
Micr


Top
 Profile  
 
PostPosted: Tue Jan 25, 2022 7:36 am 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 480361
Tuli


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 588 posts ]  Go to page 1, 2, 3, 4, 5 ... 24  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 18 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group