Wesnoth code - shortest way calculation and coordinates

Discuss the development of other free/open-source games, as well as other games in general.

Moderator: Forum Moderators

Post Reply
Darkry
Posts: 7
Joined: July 22nd, 2011, 3:48 pm

Wesnoth code - shortest way calculation and coordinates

Post by Darkry »

Hi,
I would like to know how in Wesnoth is calculated the shortest way for a unit and a circle how far the unit can go. I'm not concerned about terrain obstacles, but only about the princip.
And second think that is related with the first question is how BfW works with coordinates. Is for the calculate used the one from the game map (0,0, 0,1, ...) or there is some more complicated system like this: http://bluubekt.s3.amazonaws.com/pastebin/hex.gif.

I don't know C++ very well so I can't look at it directly into the code.

I'll use this informations for develop my project Wesnoth Online (http://forums.wesnoth.org/viewtopic.php?f=36&t=35275)

Sorry for my English :-)
Max
Posts: 1449
Joined: April 13th, 2008, 12:41 am

Re: Wesnoth code - shortest way calculation and coordinates

Post by Max »

[edit] sorry, didn't read your question carefully enough - you already stated that you don't know c++ [/edit]

http://svn.gna.org/viewcvs/wesnoth/trun ... cation.hpp
http://svn.gna.org/viewcvs/wesnoth/trun ... cation.cpp

and higher level stuff (that e.g. takes terrain into consideration):
http://svn.gna.org/viewcvs/wesnoth/trunk/src/pathfind/
Last edited by Max on November 10th, 2011, 9:58 pm, edited 1 time in total.
Darkry
Posts: 7
Joined: July 22nd, 2011, 3:48 pm

Re: Wesnoth code - shortest way calculation and coordinates

Post by Darkry »

Thanks. But I know only C#, PHP, JavaScript, HTML, SQL and CSS :-).
C++ is little bit different and I can't orientate in it.
User avatar
Sapient
Inactive Developer
Posts: 4453
Joined: November 26th, 2005, 7:41 am
Contact:

Re: Wesnoth code - shortest way calculation and coordinates

Post by Sapient »

http://www.wesnoth.org/wiki/User:Sapient... "Looks like your skills saved us again. Uh, well at least, they saved Soarin's apple pie."
Post Reply