Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags
(+1)

Thanks for the reply. Instead of structs, I use empty GameObjects for each position in the formation. This way, I could do more with it like access its Transform component or attaching different components to it like Colliders, etc. Anyways, really cool work on your part.


I've read your blog that explains how you made your earlier football game. Very well explained! I learnt a lot from it for my game. Thank you! I just have a question regarding what you refer to as the 'formation position or rectangle' which decides whether the team is attacking or defending. Could you please just make a few more remarks here about how would one could code something like this for their game? I'm not understanding how do I apply this biased position for all the players in the field using this focus rectangle. I'm letting the difference between the player's default position and his ideal position given by the Hungarian algo control how the player should move. Kindly, elaborate a little on this subject.


Best,

(1 edit) (+1)

I'm happy it helped you! I do find it hard to understand what exactly you want me to explain more about, and also text is a crappy medium to explain things that should be explained visually :( I'll try..

The formation rectangle is more of a result, than an actual 'object'. For example, the striker might be at coords (1, 0) in the formation setup: the most forward position, and in the middle. But during a match, they're only there while their team is attacking, and the ball is close to the opponent goal. While defending, this player might end up at (-0.5, 0) - halfway it's own half (but still the most forward of their team).

So, the original formation might have players positioned from (-1, -1) to (1, 1), but during a game, this rectangle is compressed. For example at the start of a match, both teams are on their own halves, so the players of team 1 would be between (-1, -1) to (1, 0), which you could visually see as the formation rectangle being compressed in the 'depth' axis. then as the ball moves forward, this rectangle moves up.

Again, this is not an actual rectangle, but just a result of the player's positions moving up and down with the action, while still retaining the formation's 'form'.

I hope this helps.. (but it could also be that you already understand this, but have a problem with translating this to actual code/math?)

(+1)

Thank you for your reply and explanation! I think what was confusing me a little is that you use a normalized coordinate system from -1 to +1. Thanks a lot for taking the time to explain your hard work to other people and also for sharing your work.