Open Linko-3D opened 1 year ago
More fitting for godot demos repo I think?
More fitting for godot demos repo I think?
It is a single .gd with few lines of code.
So what? Not everyone makes a RTS and even those that do, many do not need pan or zoom.
If we went with this, people would soon clamor for other camera templates, e.g. bounded and unbounded, springy 3D, etc etc.... you can see how the list goes on and on
So what? Not everyone makes a RTS and even those that do, many do not need pan or zoom.
If we went with this, people would soon clamor for other camera templates, e.g. bounded and unbounded, springy 3D, etc etc.... you can see how the list goes on and on
You can remove the feature you don't want.
A good spring camera 3d template for TPS games would be very good to have. We have many nodes that could have built-in minimalist scripts, they are hidden in the pop-up script menu like for the CharacterBody2D and 3D templates, they don't bloat the interface.
CharacterBody2D and 3D templates
What templates are you talking about? (Might be they are too well hidden, if we have templates already, might be worth to have some for commonly used cameras indeed)
For example, here is the platformer character template, it is buit-in inside Godot 4: https://i.imgur.com/sJPbaiq.png And the script it creates: https://i.imgur.com/9jNvE8t.png
If the checkbox is enabled Godot creates a minimalist script to have a character that can move left and right, jumps with gravity. I plan to make a CharacterBody2D RTS with my RTS camera, with the right-click it rotates on move at the cursor's position and will be compatible with the new pathfinding if enabled. We have a template for the CharacterBody3D already included, it creates a basic FPS script using the latest Godot 4 classes, it moves toward the -Z direction.
It will be very useful to speed up game development and in game jams. We don't need internet to use them, nothing to import. And it creates a very clean, easy to understand and optimized code as a good starting point.
Many nodes could have templates since like I said they are hidden. VehicleBody3D with basic controls from keyboard and joystick with acceleration, braking and steering. Camera3D for RTS like Dota, flying camera, TPS. No need to import addons every time, they are just few Ko of data in a single .gd.
Gotcha! Yep, I can see how such minimal templates could be useful, and since we already have some I can definitely see both a 2D RTS camera and a 3D spring arm camera as templates, as they're probably very common uses (and can be tweaked to specific needs easily such as bounded/non-bounded behavior for 2D)
For reference, script templates this proposal refers to are located in:
I was trying to do that camera movement for hours without looking on tutorials, got one solution but was a lot heavier that yours, thank you.
Describe the project you are working on
Godot 4 has added built-in templates like basic movements for CharacterBody2D and CharacterBody3D.
I suggest a template for the Camera2D to make RTS games. You can pan the camera, zoom, unzoom, it zooms toward the mouse's position and you can set a max zoom and unzoom. It has the least amount of line of codes. It will be useful for all RTS 2D games. Here is the script:
Describe the problem or limitation you are having in your project
Needing an RTS camera 2D.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
This is to make the game faster by having a camera ready for 2D RTS games.
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
When you select the Camera2D, you click on create script, in the popup menu the Template line will suggest in the menu the RTS Camera 2D.
If this enhancement will not be used often, can it be worked around with a few lines of script?
It will be very useful for RTS games that need paning and/or zooming features.
Is there a reason why this should be core and not an add-on in the asset library?
It is very minimalistic, it is a .gd with few lines of code so it can be a core feature.