depends on your learning style. I would always take a tutorial I can read at my own pace over a video tutorial on any topic. Evidently, by the amount of successful tutorial videos a lot of people disagree though
If you don't use delta then on a slower computer the whole game will just move slower.
If you use delta then the game will always move at the same speed, but with lower precision at a slower computer.
If the delta is very high and there is a fast moving object moving towards a small collidable obstacle then it might happen that the fast object is just going through the obstacle because at one physics step it is before the obstacle and the next physics step it is already past the obstacle.
I'm pretty sure that move_and_slide or move_and_collide corrects for this (move_and_slide uses the delta internally), but I don't have a hard source
These are not the same though. With the pro method you will essentially move faster diagonally while the hacker method compensates for that by normalizing the vector.
Still, changing the position directly is in most cases still the noob way, especially without delta. For player movement you'd want to use move_and_slide most of the time.
Unity was too heavy on disk space and performance.
Godot has better linux support
Godot is designed to work better with git
Looking at a scene file I can actually understand what it means (and if necessary, even solve a merge conflict)
I've always had a preference open-source software (they can't do stuff like unity is doing now)
The one time I tried Unity I found it annoying to use (to be fair, I might not have given it a proper change. I tried to learn it during the same weekend gamejam that I had to actually use it)
Usually the Open source definition is used for the term, though not everyone agrees with that. The unreal and unity source code are not open-source according to that definition (obvious example: they require a fee for projects that make money above a treshold). GPL, MIT, Apache and BSD are open-source according to those definitions. I think DBAD is not open-source according to those definitions.
Open-source does not just mean that the source is available, but also that you can use and share the code for whatever you want. For Unreal you are only allowed to share the code with other licencees and any use is still subject to the Unreal EULA.
Make sure you have enough free disk space. I'm low on disk space on my machine and when updating after a long while it sometimes need to download more than the available space I have
Basically you bind they key or key combo to a script and based on which window is currently active you can send a different keypress/combo to that window
Make the navigation polygon an octagon or plus shape. In the center of the edge should the navigation polygon should touch the edge, but in the corners it shouldn't.
This will probably make diagonal movement in an open field weird though.
For an earlier project I made some scripts to generate a navmesh from the collision polygons. This works also with other objects that could be nearby.
Tell me if you want more explanation about this.
How do you mean making the components modular? I'm talking about only having data components.
Here is an oversimplified example of the style I mean:
def draw_system(components, number_of_entities):
for ent in range(number_of_entities):
sprite = components["sprite"][ent]
position = component["position"][ent]
if sprite is not null and position is not null:
draw_sprite(position, sprite)
def combat_system(components, number_of_entities):
for attacker in range(number_of_entities):
strength = components["strength"][attacker]
position = component["position"][attacker]
if sprite is not null and position is not null:
for victim in range(number_of_entities):
victim_health = components["health"][victim]
victim_position = components["position"][victim]
if victim_health is not null and victim_position is not null and position == victim_position:
victim_health -= strength
systems = [combat_system, draw_system]
def main():
number_of_entities = 3
components = {
"sprite": ["dummy", "player", "stone"],
"position": [(1,1), (3,2), (5,1)],
"health": [3, 10, null],
"strength": [null, 2, null]
}
while True:
for system in systems:
system(components, number_of_entities)
sleep(1)
A framework would have more efficient ways to loop over components and of course you should not put everything in the global scope.
It sounds like you're describing a specific project or a specific framework. Could you link some examples of that?
Entity: The entity is a general purpose object. Usually, it only consists of a unique id. They "tag every coarse gameobject as a separate item". Implementations typically use a plain integer for this.
There is no data inside the entity; it is just an id.
Component: the raw data for one aspect of the object, and how it interacts with the world. "Labels the Entity as possessing this particular aspect". Implementations typically use structs, classes, or associative arrays.
Components hold all the data that applies to a certain entity.
Stuff that you would put in a component could be the name, level, playerclass, hitpoints, stats.
All these items could be in different components, but when they're only used together they could also be in one component together.
All instances of a compent in the game world are stored together in a single array (or other indexed collection; a hashmap is often used when a component is used only a few times). The entities are the indices of this array.
If you have some value that is the result of some calculation (like the health of the player) then you would probably either calculate that each time you use that in a system. If the health is based on class, level, bufs etc then the Combat system should depend on the class, level, bufs components.
I think we mostly agree about systems.
Only point is that it does not necessarily have to be a class; it can be just a function.
It often is a class because one may want to store meta-information, or because it is easier to store the system as a value this way.
It somewhat depends on how your nodes are structured.
What nodes do you have?
You basically have to create a collision shape node and add that to the same entity. Then in that collision shape you draw a shape that somewhat matches your image.
You could try to add code for that yourself (look up "raster image vectorization"), but that will be a lot of work
It will be much easier to draw a collision polygon (or another shape) that approximates the shape by hand.
Also remember that a pixel perfect collision shape is not even desirable for most games. In case of a platformer you don't want your hero to hang on to the side of the platform by a single pixel from the horns on their head.
Most of the time simple shapes like rectangles and circles are enough.
I think much of general software architecture does not apply anymore when working inside an engine like Godot. The Godot developers have made some decisions about how to the project is structured and you'd best just flow with those decisions. Trying to create a full architecture (like most books are about) will likely make you clash with the way godot works (unless you just use it as a library and create your own main loop. I wouldn't reccomend this for a small or medium sized project).
It sounds somewhat similar to the problem I had where running into a slope would launch you in the air (I used move_and_slide instead of move_and_slide_with_snap which could explain the difference in behaviour).
If you are on the ground then all movement on the y axis is determined by the ground you are walking on. Your code (and my old code) takes the previous y velocity in account for the next movement, which is not really what you'd want when walking up a slope.
If the y velocity coming out of move_and_slide is larger than the y of the input velocity and it is also larger than 0 then you are walking up a slope. My solution was to set the y velocity to either the desired y velocity or 0 in that case:
# vel.x and vel.z get overwritten earlier by the user input
# vel.y get overwritten if the player jumps
var oldvel = vel
vel = self.move_and_slide(vel, Vector3(0, 1, 0), true, 4, deg2rad(60))
# prevent slopes from launching the player into the air
if vel.y > 0 and vel.y > oldvel.y:
vel.y = max(0, oldvel.y)
I think in my case the player can still move up slopes, but only very slowly
There are components (which are just data containers; no code) entites (which are just an identifier to link some different components together; usually just an integer) and systems (which are just functions that operate on a combination of components).
No inheritance or methods are required by the pattern (though specific frameworks may use them).
Such a structure is useful when you are writing your own main loop for the code, but Godot has most physics, movement and dawing built in already. If you want to use ECS you'd have to throw away a lot of engine features which you then have to reinvent using ECS.
What would you consider ECS? just having a few nodes with scripts that contain only data that you attach to an entity node, and then some global notes? and then add some global scripts that process all these nodes?
Unless you're using godot as a library while you wite your own structure with the main loop I very much doubt that ECS will make your life easier. There's too many built-in systems already that assume the node based workflow.
ECS is not really object oriented by the way. Object oriented programming is about putting data and the functions that operate on that data together, while ECS is about seperating data and functionality.
what's the difference between making the enemies rigidbodies and spawning one thousand random rigidbodies?
What is limited in the godot renderer? I'm not familiar with unity and I'm curious what could be better in godot
depends on your learning style. I would always take a tutorial I can read at my own pace over a video tutorial on any topic. Evidently, by the amount of successful tutorial videos a lot of people disagree though
If you don't use delta then on a slower computer the whole game will just move slower. If you use delta then the game will always move at the same speed, but with lower precision at a slower computer. If the delta is very high and there is a fast moving object moving towards a small collidable obstacle then it might happen that the fast object is just going through the obstacle because at one physics step it is before the obstacle and the next physics step it is already past the obstacle.
I'm pretty sure that move_and_slide or move_and_collide corrects for this (move_and_slide uses the delta internally), but I don't have a hard source
that's more than three times as much last week (when the members couldn't be found)
These are not the same though. With the pro method you will essentially move faster diagonally while the hacker method compensates for that by normalizing the vector.
Still, changing the position directly is in most cases still the noob way, especially without delta. For player movement you'd want to use move_and_slide most of the time.
I use something similar to https://gist.github.com/hoffoo/11300578
Usually the Open source definition is used for the term, though not everyone agrees with that. The unreal and unity source code are not open-source according to that definition (obvious example: they require a fee for projects that make money above a treshold). GPL, MIT, Apache and BSD are open-source according to those definitions. I think DBAD is not open-source according to those definitions.
Open-source does not just mean that the source is available, but also that you can use and share the code for whatever you want. For Unreal you are only allowed to share the code with other licencees and any use is still subject to the Unreal EULA.
Make sure you have enough free disk space. I'm low on disk space on my machine and when updating after a long while it sometimes need to download more than the available space I have
Thanks! I've always found the options for
findconfusing and hard to remember (I usually piped the output into other commands).fdseems much easier.You could take a look at firefox ctrl-q workaround
Basically you bind they key or key combo to a script and based on which window is currently active you can send a different keypress/combo to that window
Maybe a softer transition would work better
Make the navigation polygon an octagon or plus shape. In the center of the edge should the navigation polygon should touch the edge, but in the corners it shouldn't.
This will probably make diagonal movement in an open field weird though.
For an earlier project I made some scripts to generate a navmesh from the collision polygons. This works also with other objects that could be nearby.
Tell me if you want more explanation about this.
How do you mean making the components modular? I'm talking about only having data components.
Here is an oversimplified example of the style I mean:
A framework would have more efficient ways to loop over components and of course you should not put everything in the global scope.
It sounds like you're describing a specific project or a specific framework. Could you link some examples of that?
There is no data inside the entity; it is just an id.
Components hold all the data that applies to a certain entity. Stuff that you would put in a component could be the name, level, playerclass, hitpoints, stats. All these items could be in different components, but when they're only used together they could also be in one component together.
All instances of a compent in the game world are stored together in a single array (or other indexed collection; a hashmap is often used when a component is used only a few times). The entities are the indices of this array.
If you have some value that is the result of some calculation (like the health of the player) then you would probably either calculate that each time you use that in a system. If the health is based on class, level, bufs etc then the Combat system should depend on the class, level, bufs components.
I think we mostly agree about systems. Only point is that it does not necessarily have to be a class; it can be just a function. It often is a class because one may want to store meta-information, or because it is easier to store the system as a value this way.
It somewhat depends on how your nodes are structured. What nodes do you have?
You basically have to create a collision shape node and add that to the same entity. Then in that collision shape you draw a shape that somewhat matches your image.
We are talking about different definitions of ECS.
What you consider an Entity I would put mostly in Components.
What you consider componens I would consider to be helper functions.
I don't have much time now. I'll reply more later
I don't think there's any builtins for that.
You could try to add code for that yourself (look up "raster image vectorization"), but that will be a lot of work
It will be much easier to draw a collision polygon (or another shape) that approximates the shape by hand.
Also remember that a pixel perfect collision shape is not even desirable for most games. In case of a platformer you don't want your hero to hang on to the side of the platform by a single pixel from the horns on their head. Most of the time simple shapes like rectangles and circles are enough.
I think much of general software architecture does not apply anymore when working inside an engine like Godot. The Godot developers have made some decisions about how to the project is structured and you'd best just flow with those decisions. Trying to create a full architecture (like most books are about) will likely make you clash with the way godot works (unless you just use it as a library and create your own main loop. I wouldn't reccomend this for a small or medium sized project).
It sounds somewhat similar to the problem I had where running into a slope would launch you in the air (I used
move_and_slideinstead ofmove_and_slide_with_snapwhich could explain the difference in behaviour).If you are on the ground then all movement on the y axis is determined by the ground you are walking on. Your code (and my old code) takes the previous y velocity in account for the next movement, which is not really what you'd want when walking up a slope.
If the y velocity coming out of move_and_slide is larger than the y of the input velocity and it is also larger than 0 then you are walking up a slope. My solution was to set the y velocity to either the desired y velocity or 0 in that case:
I think in my case the player can still move up slopes, but only very slowly
Addition:
full player movement script
demo with old behaviour
demo with fixed behaviour
The difference is notable when walking up a rock.
Are we talking about the same ECS? I'm talking about the pattern described by Adam Martin.
There are components (which are just data containers; no code) entites (which are just an identifier to link some different components together; usually just an integer) and systems (which are just functions that operate on a combination of components).
No inheritance or methods are required by the pattern (though specific frameworks may use them).
Such a structure is useful when you are writing your own main loop for the code, but Godot has most physics, movement and dawing built in already. If you want to use ECS you'd have to throw away a lot of engine features which you then have to reinvent using ECS.
What would you consider ECS? just having a few nodes with scripts that contain only data that you attach to an entity node, and then some global notes? and then add some global scripts that process all these nodes?
Unless you're using godot as a library while you wite your own structure with the main loop I very much doubt that ECS will make your life easier. There's too many built-in systems already that assume the node based workflow.
ECS is not really object oriented by the way. Object oriented programming is about putting data and the functions that operate on that data together, while ECS is about seperating data and functionality.
the docs have a best practices section. It may not teach everything, but it could be some help