Commit Graph

63 Commits

Author SHA1 Message Date
Francois Belair
7241bc754b Separate ArriveDemo's drawing from root node
Closes #26
2020-02-08 18:19:04 -05:00
Francois Belair
809b0c53df Fix Seek/Flee demo boundaries not drawn correctly
Closes #27
2020-02-08 18:16:49 -05:00
Nathan Lovato
6132a0aa25 Refactor the demos to support screen resizing
Add BackgroudLayer and DemoInterface scenes that we can reuse across demos
Set the game to 2D and extend window modes

Part of #21
2020-02-08 15:40:43 -06:00
Francois Belair
18931a9623 Fix FollowPath loops back to start on open paths
Fixes #18
2020-02-08 12:05:24 -05:00
Francois Belair
5627a5636a Fix demo picker blank scene
It did not have a file path by default, but had an index.
Also, the camera on Seek/Flee caused the Go Back button not to show.
The scene's been amended and the camera removed, since it wasn't
actually useful.
2020-02-08 11:44:54 -05:00
Nathan Lovato
b6226d45b0 Remove comment 2020-02-08 09:43:00 -06:00
Nathan Lovato
8e04378b1c Refactor and improve the demo picker
Improve the UI styles
Add a button to go back to the demo picker
Simplify the code that handles text
2020-02-08 09:36:06 -06:00
Francois Belair
7329758fd4 Add demo selector as main scene
Closes #20
2020-02-08 01:52:10 -05:00
Nathan Lovato
021a4821ec Update the code reference for the 1.0 release 2020-02-07 09:43:31 -06:00
Nathan Lovato
98d3be13f8 Simplify code in the FollowPath demo
Use draw_polyline to draw the path
Renamed some variables
2020-02-07 09:08:45 -06:00
Francois Belair
dc9a57e7fd Append _ to apply_steering and fix yield on ready 2020-02-07 09:56:03 -05:00
Răzvan C. Rădulescu
1baed58659 Review smart agents
I made minimal changes, mostly cosmetic like so:

- rename KinematicMovementType to MovementType since
  GSTKinematicBody2DAgent.KinematicMovementType.COLLIDE for example is
  really more than a mouthful with repeated Kinematic in the name
- add optional movement_type parameter to the constructor, otherwise
  we'd be forced to construct the object and then specify as an
  aditional step the type of movement if we want something else than the
  default
- rewrote the constructor to yield on ready and removed _on_body_ready
- renamed _apply_steering to apply_steering as this is a public method
- renamed _on_SceneTree_frame to _on_SceneTree_physics_frame
2020-02-07 12:29:45 +02:00
Francois Belair
2ae06d3da3 Split agent types into specialized classes 2020-02-06 16:30:53 -05:00
Francois Belair
85784791ec Add and have most demos use specialized agents
The agents auto-update themselves and can calculate their velocities.
This keeps the user from having to create an update_agent function.
It can also save the user from having to keep track of and update
velocities at all by using the provided `apply_steering` method.

Closes #15, closes #16
2020-02-06 16:00:41 -05:00
Francois Belair
57f3c4a24a Make calculate_acceleration return void
This makes the code more in line with GDQuest gdscript guidelines about
 not both transforming state and returning a value.
2020-02-06 14:46:21 -05:00
Francois Belair
52ca9ade74 Make window always on top, add missing background 2020-02-04 12:35:46 -05:00
Răzvan C. Rădulescu
3f58cc4921 Finish look and feel of the toy demos
Based on the 2D Beginner Project look, these demos now have the colorful
GDQuest "theme" to them.

This had the effect of removing the circle and triangle/ship sprites as
everything is drawn in Godot directly.
2020-02-04 12:12:51 +02:00
Răzvan C. Rădulescu
4fceb866f7 Use beginner 2d platformer visual style 2020-02-03 18:07:43 +02:00
Francois Belair
ae3c3569ee Add tags: moniker for virtual functions
Works with the docs maker accordingly
2020-02-02 12:48:58 -05:00
Francois Belair
3cf2089ada Add missing virtual tag 2020-01-30 18:24:47 -05:00
Francois Belair
b62d7f05aa Amend docstring w/ virtual funcs and private vars 2020-01-30 13:06:35 -05:00
Nathan Lovato
0586878fcf Fix the style of booleans and virtual functions in the API
Made booleans start with a prefix, e.g. is_open
Added a leading underscore to two virtual functions
Added VIRTUAL comment above several virtual functions
Renamed accel -> acceleration in a function
2020-01-29 15:53:57 -06:00
Nathan Lovato
bd41d5987c Edit docstrings in src/Behaviors 2020-01-29 10:13:12 -06:00
Francois Belair
4885707145 Improved how the AI looks in Pursue VS Seek demo
They were looking kind of floaty, moving not like spaceships but like
they were on ice. Now they travel along their orientation, towards
where the player is/will be.
2020-01-29 10:04:47 -05:00
Francois Belair
9c87dcf7f0 Fix unknown mangling issue from previous commit
For some reason, github's merge destroyed a lot of newlines, which
broke GSTPath.
2020-01-29 09:26:20 -05:00
Francois Belair
62ad172767 Move class docstring to top of class
For documentation purposes, current tools expect it there.
2020-01-28 23:56:10 -05:00
Nathan Lovato
6276fc0413 Update code reference
Proof and edit docstrings in all the base types and proximity types
Remove docstring for the _init builtin callback
2020-01-27 17:31:10 -06:00
Francois Belair
2d8bdaebd7 Add documentation strings to behaviors 2020-01-27 13:24:05 -05:00
Francois Belair
5f6dd15c0e Add documentation strings for base types 2020-01-27 12:57:51 -05:00
Francois Belair
e95e3bf386
Quick start and reference guides (#7)
Add quickstart guide and quickstart demo

Authored by Razoric and edited by Nathan and Johnny.
The purpose of the guide is simply to give an overview of what the
behaviors are there for, and a quick look at how to actually make use
of them in the basis of this toolkit, with some explanatory comments.
The actual user's manual will be built out of the API reference.
2020-01-27 11:39:06 -05:00
Francois Belair
8228694713 Refactor var names for consistency aka min/max 2020-01-22 11:55:49 -05:00
Francois Belair
0eb4adc48c Fix bug for collision avoid direction reversed
Once the agent was close enough to a neighbor, it tried to get closer
instead of away.
2020-01-21 12:49:46 -05:00
Francois Belair
fe00d231b8 Fix typo in seek instructions 2020-01-17 09:17:06 -05:00
Francois Belair
0a21aaf3fc Fix bug using wrong random number generator 2020-01-16 21:58:29 -05:00
Francois Belair
dffec9efa6 Add avoid collisions demo 2020-01-16 17:27:04 -05:00
Francois Belair
6e6f27505c Fix init time setters and export Follow variables
The use of `not is_inside_tree()` before setting the setting class' value
meant that the starting values would always be the default. Moving the
value setting before checking for tree readiness fixes the issue.
2020-01-16 12:31:02 -05:00
Francois Belair
86cd22cfde Merge branch 'master' into features/final-toys 2020-01-16 11:08:53 -05:00
Francois Belair
dde2825bde Fix divide by 0 bug in FollowPath demo 2020-01-16 11:08:23 -05:00
Răzvan C. Rădulescu
1f44bace3e Improve and review the available demos
- simplify code when possible
- add a simple info panel
- adhere to the "new" gdscript guidelines
2020-01-16 17:04:27 +02:00
Răzvan C. Rădulescu
f3f40848a1 Update folder structure for FoollowPath Demo 2020-01-16 15:30:55 +02:00
Răzvan C. Rădulescu
1a37b2bee0 Update project to follow GDScript guidelines closer
Used `var variable := 0.0` as discussed in the Godot issue, instead of
`var variable: = 0.0`.

Mostly these are minor/cosmetic changes, but I've also reorganized the
folder structure (naming of folders) to reflect our guidelines, plus
made some minor changes to the demo codes. Still work in progress.
2020-01-16 10:44:44 +02:00
Francois Belair
b325976139 Add path following toy demo 2020-01-15 17:15:40 -05:00
Francois Belair
0a8551e5c9 Remove GUI and export variables in demo scripts
Since we don't want to come up with a GUI maintenance system and
instead focus on the steering behaviors, all relevant variables have
been moved as exported in the main demo script for each toy.
2020-01-15 14:15:31 -05:00
Francois Belair
617b837772 Fix bug with implementation of drag in Arrive
Drag should inexorably draw towards 0, but when slow enough it could
instead cause a reverse direction.
2020-01-15 10:44:21 -05:00
Francois Belair
0e95c24c7f Add GDQuest theme to improved Pursue demo
Changed text boxes to sliders to improve usability. This also involved
adding some simple graphics, since the _draw method is not
anti-aliased and doesn't look great.
2020-01-13 16:15:44 -05:00
Francois Belair
82d92016a4 Add GDQuest theme to improved seek demo
Replaced the text boxes with sliders to improve usability.
2020-01-13 12:38:46 -05:00
Francois Belair
b0442982d0 Implement demo for separation and cohesion 2020-01-12 10:25:10 -05:00
Francois Belair
a01f5d5b2e Clean up and improve group behaviors' code
The first pass was somewhat obtuse and lacked a common class that
differentiated them from behaviors that didn't use Proximities.
2020-01-12 10:24:03 -05:00
Francois Belair
780e6038b8 Add FollowPath behavior 2020-01-12 10:23:51 -05:00
Francois Belair
84f0465b88 Add AvoidCollision behavior 2020-01-12 10:23:42 -05:00