summaryrefslogtreecommitdiff
path: root/src/game-server/map.cpp
AgeCommit message (Collapse)AuthorFilesLines
2013-01-29Silenced some eclipse warningsErik Schilling1-1/+5
2011-10-15Added script bindings for reading map objectsErik Schilling1-1/+9
map_get_objects([string filter]): returns all object of the current map optionally filtered by type. map_get_object_property(handle object, string key): returns the value of the property of the object. map_get_object_bounds(handle object): returns x, y, width, height of an object. map_get_object_name(handle object): returns name of an object. map_get_object_type(handle object): returns type of an object. Mantis-issue: 397 Reviewed-by: Thorbjørn Lindeijer
2011-03-20Moved defines.h and manaserv_protocol.h into 'common'Thorbjørn Lindeijer1-1/+1
Just seems a bit more organized to me.
2011-03-16Path finding: Moved F cost from PathInfo to LocationThorbjørn Lindeijer1-17/+15
The F cost represents the estimate of the total cost from source to destination. It is only relevant to sort the locations to be checked, so there is no point in assigning it to each coordinate of the map. With maps up to 200x200, the memory usage is reduced by 160 kB! :P Reviewed-by: Bertram
2011-03-11Moved freeing of map position to Actor destructorThorbjørn Lindeijer1-1/+2
It was done in both the Character and the Monster destructors, but I don't see how any Actor should be excluded from this. Now it also happens for NPC, Effect and Item, though only NPC has a relevant walkmask. Also fixed a small issue introduced in 97e0a9eb170499 and added an assert to freeTile. We should be able to assert that a tile can only be freed if it was blocked. Reviewed-by: Stefan Dombrowski
2011-03-11Split path finding out of the Map classThorbjørn Lindeijer1-104/+140
Extracted the path finding algorithm out of the Map class and introduced a new class called PathInfo that has the path finding information that used to be part of MetaTile. This allows a single vector of path information to be shared between all maps running on the server, significantly reducing the memory overhead per map (for 200x200 maps, the memory reduction is about 1 MB per map). Part of this change is some cleanup, like moving the 'occupation' counts into MetaTile, inlining some methods for performance reasons, and using STL to simplify memory management. Mantis-issue: 106 Reviewed-by: Bertram
2011-03-10Server-Wrap the open and closed list members in path finding.Yohann Ferreira1-66/+40
This prevents some weird things happening especially on crowded maps. I also removed the unused findSimplePath() function. Reviewed-by: Thorbjorn.
2011-01-10Removing default argument values from Map definitionStefan Dombrowski1-2/+1
The default argument values had no effect, because they are not in the declaration. Updating the codeblock project, because protocol.h had been renamed. Reviewed-by: Bertram
2011-01-09Removed the superfluous point struct.Yohann Ferreira1-2/+2
It was too close from the Position class and it leads to making the server handle one or another type through the code. Still bugged me many times while making changes. Reviewed-by: Jaxad.
2011-01-03Got rid of the superfluous DEFAULT_TILE_HEIGHT/WIDTH.Yohann Ferreira1-1/+4
We've got DEFAULT_TILE_LENGTH in defines.h for that. Trivial fix.
2010-11-14Renamed .hpp files into .h for consistency.Yohann Ferreira1-1/+1
Also added an header to the autoattack.{h,cpp} files. Big but trivial fix.
2010-10-17Dehardcode the tileWidth and height, except for the speed conversion.Yohann Ferreira1-2/+2
The speed conversion needs a standard tile length anyway and can be improved later once the movement code will start to handle beings size. Reviewed-by: Crush.
2010-02-07Update Copyright date for Manaserv.Bertram1-1/+1
2009-12-06Fixed name of the project in copyright headersThorbjørn Lindeijer1-7/+6
Also updated the headers to refer to the GPL by URL instead of suggesting to contact the FSF by snail mail, as per the latest GPL usage instructions.
2009-10-09Mostly synced the client and server code for path finding.Bertram1-29/+22
2009-07-01Remove a stray comment.Roderic Morris1-2/+0
2009-07-01Remove complex path finding for players. Add a simple path finding algorithm ↵Roderic Morris1-2/+50
to map.
2009-03-27Fixed compile warningBjørn Lindeijer1-5/+5
2009-03-19Implemented the possibility to have maps with or without PvP combat.Philipp Sehmisch1-0/+8
PvP is governed by the map property "pvp". Currently it can be either "none" for no PvP combat or "free" for unrestricted PvP combat. "none" is the default value which is used when pvp is undefined. Later addition of more sophisticated PvP modes is possible.
2008-11-16Got rid of CVS/Subversion $Id$ markersBjørn Lindeijer1-2/+0
2008-07-03avoid map reading crash, arbitrary tile sizes, enable new mapsRoderic Morris1-16/+2
2008-04-20Fixed some compiler errors/warnings.Bjørn Lindeijer1-0/+1
2008-03-15Implemented script binding for controllig movement of beings and fixed a ↵Philipp Sehmisch1-4/+9
crash caused by the new blocking system (thanks to peavey for reporting).
2008-03-13added assert headerPhilipp Sehmisch1-0/+1
2008-03-13Implemented dynamic and selective pathblocking. Monsters are blocked by ↵Philipp Sehmisch1-23/+92
player characters and other monsters, player characters only by monsters.
2007-10-27Made it compile with GCC 4.3Guillaume Melquiond1-2/+3
2007-07-28Revert to the old pathfinding system without collision with beings, as the ↵Guillaume Melquiond1-34/+8
new one is too cpu intensive.
2007-06-30Implemented basic monster AI and fixed a stability problem caused by the ↵Philipp Sehmisch1-23/+24
spawn areas.
2007-03-05Added an abstrart base class for characterdata, in order to use the same ↵Rogier Polak1-2/+2
serialize and deserialize functions on both the accountserver and the gameserver.
2007-01-03Split persistent player data from game server data. Enabled inventory code back.Guillaume Melquiond1-0/+302