State of Repository

Thoughts on the further development of Haven & Hearth? Feel free to opine!
NullSoldier
Posts: 1
Joined: Fri Jan 14, 2011 7:10 am

State of Repository

Post by NullSoldier »

Hello, I just recently found this project and have been playing with a few friends. While we've been enjoying ourselves quiet a bit we've all noticed a few things that generally bug us all. For instance, the movement system is very unfriendly to users. It's the opposite of a good user experience. Good user experience dictates that when you click a location, your character will navigate to it's destination using a path finding algorithm and not linearly interpolate stupidly running into every object in it's path forcing you to be stuck into various objects. This really bugs me as a developer because it would be so easy to avoid this. I dug into the repository and to my horrification all it does is use a linear interpolation of two points for movement. (LinMove.java) There's no logic at all to the movement code. I'm probably going to take it upon myself to write a new movement system which creates multiple LinMove commands calculated by a path finding algorithm so I can create a RelayMove system.

However that's not really the issue I've had. After looking through the repository I found some of the most cryptic code imaginable. I must advocate that as developers you strive to make more easily readable and debuggable code. I'm not insulting the quality of code however the memory address space is more than a single byte I assure you. Can anyone really tell me what any of the following variables even do? s, t, c, a, da, dt? Seriously...

Anyway, if I decide to write some code I'll have to create a patch and submit it for review. There's definitely some other things that I want to fix as well... like adding a resolution drop down box to the options screen. Happy coding.
Serg
Posts: 1
Joined: Thu Jan 13, 2011 3:33 am

Re: State of Repository

Post by Serg »

s = speed
t = time
c = ???
a = acceleration
da = delta acceleration (rate of change of the acceleration)
dt = delta time (rate of change of time)

Come on man, you claim to want to program, but you can't figure out THAT?
User avatar
KoE
Posts: 536
Joined: Fri Jun 12, 2009 5:01 am

Re: State of Repository

Post by KoE »

First off, don't bother, they don't take outside help.

Second off, loftar seems to hate this sort of thing and possibly retooling things in general. (You would be surprised at how long it took pathfinding for animals to get in the game.)

Third off, c is the speed of light, duh.
User avatar
Granger
Posts: 9255
Joined: Mon Mar 22, 2010 2:00 pm

Re: State of Repository

Post by Granger »

NullSoldier wrote:Anyway, if I decide to write some code I'll have to create a patch and submit it for review. There's definitely some other things that I want to fix as well... like adding a resolution drop down box to the options screen. Happy coding.
Gilbertus is the most used client, so adding client-side pathfinding to it would give most benefit to all of us.
Plus the screen resolution thingy is already fixed there (you can simply resize the window).
⁎ Mon Mar 22, 2010 ✝ Thu Jan 23, 2020
flaw
Posts: 140
Joined: Sat Dec 26, 2009 2:50 am

Re: State of Repository

Post by flaw »

Granger wrote:Gilbertus is the most used client
Highly doubtful.
User avatar
loftar
Posts: 9096
Joined: Fri Apr 03, 2009 7:05 am
Location: Your character database

Re: State of Repository

Post by loftar »

The main reason for LinMove being hard to figure out isn't so much the variable names, but the model it reflects. The information the client receives is the starting and target coordinates of the movement, and the number of server-side cycles that it will take the object to get from the start to the target. It's less than obvious that the client deals with server-side cycles at this point, but it's the method that gives the highest precision, since updates can contain the exact current cycle since the start of the movement.

Either way, you can see that reflected in the getc() function of LinMove; dx and dy is obviously the difference (delta) in position between start and target, and them being multiplied by a (which ranges from 0.0 to 1.0) to yield the actual coordinate, should be a hint that a is the amount of movement completed.

If you're complaining about short variables names in general, I would refer you to this post. ;)

Either way, I doubt you're much helped by looking at the linear interpolation. Since the actual movement happens on the server anyway, you can't modify it there. LinMove only reflects what happens authoritatively on the server. If you wanted to implement client-side pathfinding, you would rather have to send move commands along the path in series. And yes, I know it should be done server-side.
"Object-oriented design is the roman numerals of computing." -- Rob Pike
User avatar
Oddity
Posts: 1983
Joined: Sun Jun 20, 2010 12:04 am
Location: BC, Canadia

Re: State of Repository

Post by Oddity »

flaw wrote:
Granger wrote:Gilbertus is the most used client
Highly doubtful.
Why do you say that?
jadamkaz wrote:ah i remember my run in with odditown they are good ppl im sure the only reason they killed ME is because they are troll hunters and i was a troll
User avatar
saltmummy626
Posts: 1165
Joined: Sat Apr 03, 2010 11:24 am

Re: State of Repository

Post by saltmummy626 »

loftar wrote:I would refer you to this post. ;)
*scratches head* wow uh, That post was met with such hostility that I thought it should just die, so I left it alone... I see people talked in that thread a bit before it (hopefully) went away forever.

back on topic though, path finding would be nice, make running from animals faster but... I don't know why but I like the movement of characters the way it is.
Want to touch my fibula?
Image
Gulgatha, place of the skull.
User avatar
loftar
Posts: 9096
Joined: Fri Apr 03, 2009 7:05 am
Location: Your character database

Re: State of Repository

Post by loftar »

saltmummy626 wrote:
loftar wrote:I would refer you to this post. ;)
*scratches head* wow uh, That post was met with such hostility that I thought it should just die, so I left it alone...
I meant my post in that thread, not the thread as such.
saltmummy626 wrote:back on topic though, path finding would be nice, make running from animals faster but... I don't know why but I like the movement of characters the way it is.
I like the current character movement in that it doesn't do unexpected things. If every action had pathfinding, you might find that you click on an oven that happens to be past a closed palisade, have swimming on, and your character takes the route through the deep end of the nearby lake while you aren't watching...

If pathfinding is automated for characters then I, for one, would like it to be a rather modest version that just avoids corners and other such simple things.
"Object-oriented design is the roman numerals of computing." -- Rob Pike
User avatar
Granger
Posts: 9255
Joined: Mon Mar 22, 2010 2:00 pm

Re: State of Repository

Post by Granger »

loftar wrote:I like the current character movement in that it doesn't do unexpected things. If every action had pathfinding, you might find that you click on an oven that happens to be past a closed palisade, have swimming on, and your character takes the route through the deep end of the nearby lake while you aren't watching...
Yea, that would be bad. Reminds me of original C&C where the harvester always took the route through the enemy base...
If pathfinding is automated for characters then I, for one, would like it to be a rather modest version that just avoids corners and other such simple things.
It would be helpful if the pathfinding would be able to divert 1-2 tiles (max) from linear movement path to just avoid collisions with stuff in the way.
Should also give a speedy algorythm since the search space is smaller...
⁎ Mon Mar 22, 2010 ✝ Thu Jan 23, 2020

Return to “Critique & Ideas”