Getting map coords with client?

Forum for alternative clients, mods & discussions on the same.

Moderator: Phades

Getting map coords with client?

Postby Atomicscottsman » Thu May 23, 2013 6:10 pm

So i have a basic understand of java, and a very basic understanding of game design in java. I was just wondering about something dealing with coordinates: since the client has to consistently keep the players x and y(that way the client knows where you are compared to the server), why can't a custom client simply take that info and display it?

Is it because the client acts like a window to the server, and never sees the x,y, or something to do with how the client and the server talk?

Thanks for any info, and sorry if this has been answered somewhere, i searched enders client post but saw nothing.
Last edited by borka on Tue Jun 18, 2013 5:51 am, edited 1 time in total.
Reason: edited missleading title
Atomicscottsman
 
Posts: 13
Joined: Sun Sep 18, 2011 11:38 pm

Re: Finding map coords?

Postby NOOBY93 » Thu May 23, 2013 7:39 pm

Pretty sure it's because client is a window. Notice that you can't open inventory when your internet doesn't work. Only the options window.
Jalpha wrote:I believe in my interpretation of things.
User avatar
NOOBY93
 
Posts: 6528
Joined: Tue Aug 09, 2011 1:12 pm

Re: Finding map coords?

Postby mvgulik » Thu May 23, 2013 10:49 pm

Atomicscottsman wrote:... since the client has to consistently keep the players x and y(that way the client knows where you are compared to the server), why can't a custom client simply take that info and display it?


Any client can take and show any general location coordinates that are send from the server to the client.
But whats the use ... if you know there randomized on every game-location-jump you make.

(The client don't need to know your characters real coordinates in the game-world.)
mvgulik
 
Posts: 3774
Joined: Fri May 21, 2010 2:29 am

Re: Finding map coords?

Postby Atomicscottsman » Fri May 24, 2013 12:03 am

mvgulik wrote:
Atomicscottsman wrote:... since the client has to consistently keep the players x and y(that way the client knows where you are compared to the server), why can't a custom client simply take that info and display it?


Any client can take and show any general location coordinates that are send from the server to the client.
But whats the use ... if you know there randomized on every game-location-jump you make.

(The client don't need to know your characters real coordinates in the game-world.)


Ohh ok. Why doesn't the client keep the real coords? Is your current position in the world saved on the server, and the client simply sends an update to the server, adding or subtracting to the x/y stored on the server?
Atomicscottsman
 
Posts: 13
Joined: Sun Sep 18, 2011 11:38 pm

Re: Finding map coords?

Postby borka » Fri May 24, 2013 12:29 am

you're aware that the game engine and server isn't programmed in Java?!?
Avatar by SacreDoom
Java 8 - manually downloads - good to check for actual versions url here:
viewtopic.php?f=42&t=40331
Remember what the dormouse said: Feed your head Feed your head
User avatar
borka
 
Posts: 9965
Joined: Thu Feb 03, 2011 7:47 pm
Location: World of Sprucecap

Re: Finding map coords?

Postby Atomicscottsman » Fri May 24, 2013 12:48 am

You again thwart me haha, borka. It would appear only the client is written in java, which i thought meant the server would be too. If not java, what then?

Edit: But still, no matter the programming language, the client is just a window yes?
Atomicscottsman
 
Posts: 13
Joined: Sun Sep 18, 2011 11:38 pm

Re: Finding map coords?

Postby borka » Fri May 24, 2013 1:19 am

User avatar
borka
 
Posts: 9965
Joined: Thu Feb 03, 2011 7:47 pm
Location: World of Sprucecap

Re: Finding map coords?

Postby mvgulik » Fri May 24, 2013 1:31 am

Atomicscottsman wrote:... the client is just a window yes?

Yep. Its just a (local to your computer) GUI to the game (on the server).
mvgulik
 
Posts: 3774
Joined: Fri May 21, 2010 2:29 am

Re: Finding map coords?

Postby Atomicscottsman » Fri May 24, 2013 1:45 am

borka wrote:http://www.havenandhearth.com/forum/viewtopic.php?f=7&t=29915&p=386460&hilit=server+programming+language#p386460


Why is that? Do they prefer C over java, or does C allow more?
Sorry for all the questions.
Atomicscottsman
 
Posts: 13
Joined: Sun Sep 18, 2011 11:38 pm

Re: Finding map coords?

Postby boshaw » Fri May 24, 2013 2:08 am

Atomicscottsman wrote:So i have a basic understand of java, and a very basic understanding of game design in java. I was just wondering about something dealing with coordinates: since the client has to consistently keep the players x and y(that way the client knows where you are compared to the server), why can't a custom client simply take that info and display it?

Is it because the client acts like a window to the server, and never sees the x,y, or something to do with how the client and the server talk?

Thanks for any info, and sorry if this has been answered somewhere, i searched enders client post but saw nothing.


Coordinates of objects are stored in https://github.com/dolda2000/haven-clie ... n/Gob.java . You can get them via gobvar.getc() where gobvar is some Gob class variable.
As mvgulik mentioned, these are randomized every time you log in, change maps, and teleport. It used to be non-randomized and people had clients to do live-tracking of all their users, but that's pretty much impossible now unless you took the time to do some custom mapping stuff so it would keep an updated map based on every minimap you get and try to match you exactly to where it expects you to be on the world map.

Atomicscottsman wrote:
borka wrote:http://www.havenandhearth.com/forum/viewtopic.php?f=7&t=29915&p=386460&hilit=server+programming+language#p386460


Why is that? Do they prefer C over java, or does C allow more?
Sorry for all the questions.


I'm sure loftar has his reasons, but a few that come to my mind are:
1) In C you're not very restricted as far as what you can do with your data (ie: pointers, etc). Onto that there also might be tricks he can do in C that are needed that can't be done in Java
2) No garbage collection, all the memory is manually managed and he can manage it in a way that it won't cause delays or time issues during critical sections where you need to get the operations done quickly and a gc run during that could ruin that.
User avatar
boshaw
 
Posts: 1590
Joined: Tue Jun 01, 2010 10:22 pm

Next

Return to The Wizards' Tower

Who is online

Users browsing this forum: Claude [Bot] and 0 guests