Module: Pathfinding
- Defined in:
- docs/4_Systems_003_Map_Engine.rb
Defined Under Namespace
Modules: TagsWeight, Target Classes: Cursor, Request
Constant Summary collapse
- OPERATION_PER_FRAME =
Amount of node to calculate in one frame (OPTIMISATION)
150
- OPERATION_PER_REQUEST =
Amount of node by requests in one frame (OPTIMISATION)
50
- COST_RELOAD =
Cost of the reload
15
- COST_WATCH =
Cost of the watch
9
- COST_WAIT =
Cost of the wait
1
- OBSTACLE_DETECTION_RANGE =
Obstacle detection range
9
- TRY_COUNT =
Amount of try count
5
- TRY_DELAY =
Number of frame before two path search when the first one fail
60
- PATH_DIRS =
Directions to check
[1, 2, 3, 4]
- WAITING_ROUTE =
Move route when waiting for a new path
RPG::MoveRoute.new
- TAGS_WEIGHT =
Weight of the tags, the higher is the cost, the more the path will avoid it
{GameData::SystemTags::Road => 2, GameData::SystemTags::TSand => 4, GameData::SystemTags::SwampBorder => 20, GameData::SystemTags::DeepSwamp => 30, GameData::SystemTags::MachBike => 1000, GameData::SystemTags::TGrass => 20}
- DEFAULT_SAVE =
Default save state
[]
- PRESET_COMMANDS =
Method giving a preset command (the 5 first move commands)
Array.new(5) { |i| RPG::MoveCommand.new(i) }.method(:[])
Class Method Summary collapse
-
.add_request(character, target, tries, tags) ⇒ Boolean
Add the request to the system list and start looking for path.
-
.clear
CLear all the requests.
-
.debug=(value)
Enable or disable the debug mode.
-
.debug_add(from, cursor, path)
Add a path to display.
-
.debug_clear(from = nil)
Clear the pathfinding debug data.
-
.debug_update
Update the pathfinding display debug.
-
.load
Load the data from the Game State.
-
.operation_per_frame=(value)
Set the number of operation per frame.
-
.remove_request(character) ⇒ Boolean
Remove the request from the system list and return true if the request has been popped out.
-
.save ⇒ Array<Pathfinding::Request>
Create an savable array of the current requests.
-
.update
Update the pathfinding system.
Class Method Details
.add_request(character, target, tries, tags) ⇒ Boolean
Add the request to the system list and start looking for path
3504 3505 |
# File 'docs/4_Systems_003_Map_Engine.rb', line 3504 def self.add_request(character, target, tries, ) end |
.clear
CLear all the requests
3512 3513 |
# File 'docs/4_Systems_003_Map_Engine.rb', line 3512 def self.clear end |
.debug=(value)
Enable or disable the debug mode
3531 3532 |
# File 'docs/4_Systems_003_Map_Engine.rb', line 3531 def self.debug=(value) end |
.debug_add(from, cursor, path)
Add a path to display
3544 3545 |
# File 'docs/4_Systems_003_Map_Engine.rb', line 3544 def self.debug_add(from, cursor, path) end |
.debug_clear(from = nil)
Clear the pathfinding debug data
3535 3536 |
# File 'docs/4_Systems_003_Map_Engine.rb', line 3535 def self.debug_clear(from = nil) end |
.debug_update
Update the pathfinding display debug
3538 3539 |
# File 'docs/4_Systems_003_Map_Engine.rb', line 3538 def self.debug_update end |
.load
Load the data from the Game State
3526 3527 |
# File 'docs/4_Systems_003_Map_Engine.rb', line 3526 def self.load end |
.operation_per_frame=(value)
Set the number of operation per frame. By default it’s 150, be careful with the performance issues.
3516 3517 |
# File 'docs/4_Systems_003_Map_Engine.rb', line 3516 def self.operation_per_frame=(value) end |
.remove_request(character) ⇒ Boolean
Remove the request from the system list and return true if the request has been popped out.
3509 3510 |
# File 'docs/4_Systems_003_Map_Engine.rb', line 3509 def self.remove_request(character) end |
.save ⇒ Array<Pathfinding::Request>
Create an savable array of the current requests
3523 3524 |
# File 'docs/4_Systems_003_Map_Engine.rb', line 3523 def self.save end |
.update
Update the pathfinding system
3519 3520 |
# File 'docs/4_Systems_003_Map_Engine.rb', line 3519 def self.update end |