Module: Pathfinding
- Defined in:
- docs/4_Systems_003_Map_Engine.rb
Overview
You can customize the cost of each tag in TAGS_WEIGHT.
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
3626 3627 |
# File 'docs/4_Systems_003_Map_Engine.rb', line 3626 def self.add_request(character, target, tries, ) end |
.clear
CLear all the requests
3634 3635 |
# File 'docs/4_Systems_003_Map_Engine.rb', line 3634 def self.clear end |
.debug=(value)
Enable or disable the debug mode
3653 3654 |
# File 'docs/4_Systems_003_Map_Engine.rb', line 3653 def self.debug=(value) end |
.debug_add(from, cursor, path)
Add a path to display
3666 3667 |
# File 'docs/4_Systems_003_Map_Engine.rb', line 3666 def self.debug_add(from, cursor, path) end |
.debug_clear(from = nil)
Clear the pathfinding debug data
3657 3658 |
# File 'docs/4_Systems_003_Map_Engine.rb', line 3657 def self.debug_clear(from = nil) end |
.debug_update
Update the pathfinding display debug
3660 3661 |
# File 'docs/4_Systems_003_Map_Engine.rb', line 3660 def self.debug_update end |
.load
Load the data from the Game State
3648 3649 |
# File 'docs/4_Systems_003_Map_Engine.rb', line 3648 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.
3638 3639 |
# File 'docs/4_Systems_003_Map_Engine.rb', line 3638 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.
3631 3632 |
# File 'docs/4_Systems_003_Map_Engine.rb', line 3631 def self.remove_request(character) end |
.save ⇒ Array<Pathfinding::Request>
Create an savable array of the current requests
3645 3646 |
# File 'docs/4_Systems_003_Map_Engine.rb', line 3645 def self.save end |
.update
Update the pathfinding system
3641 3642 |
# File 'docs/4_Systems_003_Map_Engine.rb', line 3641 def self.update end |