Atrik
Community Members-
Posts
869 -
Joined
-
Days Won
45
Atrik last won the day on October 6
Atrik had the most liked content!
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
Atrik's Achievements
Primus Pilus (7/14)
838
Reputation
-
Implementing forces in Unit Motion (HELP WANTED)
Atrik replied to Atrik's topic in Game Development & Technical Discussion
@Thalatta come on... The reason you had to build it to test it, it's because it changes the engine (like 90%+ of the change of this PR are engine improvements). -
Implementing forces in Unit Motion (HELP WANTED)
Atrik replied to Atrik's topic in Game Development & Technical Discussion
There is no IP on anything here so you can do whatever you want. Just note that this is not merged yet so we don't know for certain when it will be part of the game. It is tested (thanks to those who did!) and ready for next release but the timeline is tight so it really depends on if someone awesome pick it up for review. -
Implementing forces in Unit Motion (HELP WANTED)
Atrik replied to Atrik's topic in Game Development & Technical Discussion
Almost not terrible. Screencast from 2026-10-06 22-06-11.webm For those who don't know the muskox in 0AD have 0 animations, so they look awful when they walk around.. -
Hi @marga_, I'm only seeing mention of animations from @Stan`, not from you, so I'm not sure if I missed something.. I think they are a different skillset then modeling? However if you are actually into animations I would love for you to consider helping with some that would heavily enhance : With the above, units can be kicked away, staggering, and they can charge (attack while moving, or attack while turning). Each of them would look so much nicer with proper animations! If this is something that get your interest, it could be very helpful.
-
Hopefully you will even be able to get proper interpolations for flying units next release. https://gitea.wildfiregames.com/0ad/0ad/pulls/9253 I even started this PR when I saw your helicopter video
-
Implementing forces in Unit Motion (HELP WANTED)
Atrik replied to Atrik's topic in Game Development & Technical Discussion
The damage is scaled with relative speed. And it has a threshold* you can set in the template (could be 0 too). It's called charge in the code but trampling could be somewhat descriptive too since it's any collision that would trigger the effects. *the threshold is only checking the charger own speed, so 0 for elephants makes the unit coming into contact to also count as hit. So it is somewhat a bit trampling. -
Implementing forces in Unit Motion (HELP WANTED)
Atrik replied to Atrik's topic in Game Development & Technical Discussion
If we give them "charge" but with 0 damage it's indeed what that would be. They'll be pushing immobile units a bit better, like current cav and archer elephants. But they cannot push a entire crowd (They would need to be 'solids' for this). -
Implementing forces in Unit Motion (HELP WANTED)
Atrik replied to Atrik's topic in Game Development & Technical Discussion
Thank you so much @guerringuerrin for the deep testing and helping and pushing me for the elephant deadlocks issue!! Together with the balancing of states, I also think we got it to somewhere where they became very nice to play with. What mainly changed in the last commit is that when two elephants push each other, the one that would push the other into wall yield, and let the other one push him. A few other small tweaks for when there are in large group pushing each other too should make deadlocks temporary there too. -
Implementing forces in Unit Motion (HELP WANTED)
Atrik replied to Atrik's topic in Game Development & Technical Discussion
We don't decompose the collision vector. We calculate the resulting impulse from the contact normal, and the spin actually comes from calculating the torque given the impact position to the center. Since the shape is (almost) a rectangle, then it's just about calculating the lever effect on a axis - the contact point projected on it. Velocities are also calculated based on this closest point. I think to apply your idea it would be to add a scaling to the lever effect? But I'm not sure it's always desirable, for example on the choke point wouldn't that create more units facing the wrong direction of movement? -
Implementing forces in Unit Motion (HELP WANTED)
Atrik replied to Atrik's topic in Game Development & Technical Discussion
Wait, but I told you it does for collision, just not for the 'soft' push who are mostly meant to keep units apart more then simulating a collision. So for 'soft' pushs you don't really want to scale it down with velocity. It's not so much about complexity you even tried yourself it's just less then 10 lines of codes, less if we refactor with the one for collision. But why would it help rotation here? -
Implementing forces in Unit Motion (HELP WANTED)
Atrik replied to Atrik's topic in Game Development & Technical Discussion
The shape is a radius around a segment, a 2D capsule, which you generally picture as a rectangle but for small segments, it start being more circular. They are, and for boats their footprint shape was displayed as it was (the champion ele had the triangle one because it's a champion). Since they are long shapes, there it looks more like a rectangle then for elephants. So I was approximating them as being all rectangle, but now that it is drawn for elephant, it's obvious that it's a bit less true for them. Although they are still pretty close to a rectangle. For buildings, it was always was one contact point anyway, as it doesn't use the hitbox used for pushing. But the example you gave was still trickery! The wall was blocking the unit from complying to the push because of having one less degree of freedom. -
Implementing forces in Unit Motion (HELP WANTED)
Atrik replied to Atrik's topic in Game Development & Technical Discussion
This hitbox you used are the model's bounds but aren't accurate to see what the unit collide with. It's my bad for not doing the obvious : adding a debug for visualizing the actual footprint used for collision. I was debugging mostly using boats to this time because they have everything more extreme than elephants : inertia, size, and they even have drifting effects. For them, the footprint is already accurately displayed when you select them, but now I added the debug so we can also see it for elephants. Also it made me realize that for boats it's fair to approximate their shape to a rectangle, but not so much for elephants who have different ratios, so when we spoke about corners, we highly exaggerated their extent for elephants : Yellow is the debug footprint. You can now display it by enabling Unit motion overlay and selecting the elephants. I'm convinced that a lone elephant pathing got better. He'll be more resilient to solving hitting a building corner for example. Lone elephant with other non-solids that used to block them it's even more obvious. I'm doing the tweaks I can to make herds of elephant not too terrible but they will always be less agile then normal units @real_tabasco_sauce do you think we could also slightly increase both their pop cost/res cost, and make them a bit more tanky? So that you get their new ability with micro but getting tones of them is still not as easy? -
Implementing forces in Unit Motion (HELP WANTED)
Atrik replied to Atrik's topic in Game Development & Technical Discussion
It is kind of the case depending on how you look at it : We could say that units aren't actually pushed, they just look at every neighbor that look too close to them, then they move away from them. Consuming all forces they calculated, tells them where they have to go for this turn. So it's them actually moving away.. Well since all that is a bit some abstraction of physical events probably there are as many way to phrase it as you want. Edit : I meant is that the pushing range is already some kind of way to communicate to units to move away. But maybe if you wanted to add one that apply only to allies but further then the normal push one, it could be a good idea for example for rams where you want them to push allies but enemy can still block the way. It's a good idea. Edit 2: Now I have regret dropping my initial approach about a forward area in front of units used for charging, that would be maybe a few lines of codes to just make it possible to apply to allies only... I'm glad for the involvement, it shows that this is an interesting topic and that many things will sprout out of it. In fact, a big highlight of this project is that it will be easy, even from a mod, to plug in forces into UnitMotion. Examples : weather, spells (attractions, repulsion)... -
Implementing forces in Unit Motion (HELP WANTED)
Atrik replied to Atrik's topic in Game Development & Technical Discussion
Like a simplification that doesn't account for friction? -
Implementing forces in Unit Motion (HELP WANTED)
Atrik replied to Atrik's topic in Game Development & Technical Discussion
But right now a collision is only detected once for a pair. I imagine this idea would require to do two. I did a quick attempt for ellipse. It wasn't going in the right direction so I dropped it. Thinking about it I think I can explain why it's a bad idea : ellipses are too good to tile up a given space regardless of if the shapes are aligned or not, creating interlocking patterns. A drawing not at all accurate but to give the idea : For the same area, the ellipses can compress easier regardless of orientation. Whereas the rectangles force a spacing. And there corner impacts actually helps keep it that way. Really? Where can I get it?
