I'm above average at LUA and I've been thinking about this new sports game for about 18 months. Can't shake it and it's time to make some concepts for play testing.
Discovered LOVE and flicked through the manual. LOVE has a physics engine which frankly, I never even thought about so that's fantastic!
I'm planning out a top down sports game. Think hockey - looking straight down. There will be a puck. Two teams. Physical objects moving around and bumping into each other.
This is day 1 and I'm going to love this journey. I'm not a noob programmer but I am noob to LOVE and it's libaries. Any early words of caution as I start this?
Cheers n beers.
Noobie just discovered LOVE. Tips for a top down sports game?
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Noobie just discovered LOVE. Tips for a top down sports game?
Current project:
https://togfox.itch.io/backyard-gridiron-manager
American football manager/sim game - build and manage a roster and win season after season
https://togfox.itch.io/backyard-gridiron-manager
American football manager/sim game - build and manage a roster and win season after season
Re: Noobie just discovered LOVE. Tips for a top down sports game?
I'm still reading lots. Can anyone suggest if I can or should use the different physics libraries? I'll have hockey players voicing of each other and the wall and whilst subjected to force and momentum they will have 'free' will to influence their movement and the game.
I'm currently setting up classes, properties and functions and intended to make my own physics (velocity/acceleration/mass/impulse/momentum) but if there is an easier way then I'll read up on that.
I'm currently setting up classes, properties and functions and intended to make my own physics (velocity/acceleration/mass/impulse/momentum) but if there is an easier way then I'll read up on that.
Current project:
https://togfox.itch.io/backyard-gridiron-manager
American football manager/sim game - build and manage a roster and win season after season
https://togfox.itch.io/backyard-gridiron-manager
American football manager/sim game - build and manage a roster and win season after season
Re: Noobie just discovered LOVE. Tips for a top down sports game?
It's called box2d. love.physics is your best shot, but there is also bump.lua and my humble fizzx: https://github.com/2dengine/fizzx
The easy part is the physics. Use long edge shapes for the boundaries of the hockey ring. Restitution must be greater than 0 so that the puck can bounce around. Linear damping can be used on the puck so that it slows down gently. You will need sensor shapes for the goals.
The hard part will be the AI if you this is going to be player vs CPU. I suggest starting out with just two players locally, without any AI.
Last edited by ivan on Sat Dec 11, 2021 8:18 am, edited 1 time in total.
Re: Noobie just discovered LOVE. Tips for a top down sports game?
So I'm thinking out loud, remembering this is day 2 in my Love2D journey, that I want a bunch of physics bodies. These are AI. They have their own mind/will/actions and will execute those 'normal' movements with Body:applyLinearImpulse and let the physics engine deal with collisions and rebounds etc.
Yes? On the right track? Or no.
Edit: ... overhead action games. [FIZZX] THANKS!!
Yes? On the right track? Or no.
Edit: ... overhead action games. [FIZZX] THANKS!!
Current project:
https://togfox.itch.io/backyard-gridiron-manager
American football manager/sim game - build and manage a roster and win season after season
https://togfox.itch.io/backyard-gridiron-manager
American football manager/sim game - build and manage a roster and win season after season
Re: Noobie just discovered LOVE. Tips for a top down sports game?
With love.physics one body can have multiple shapes/fixtures, therefore you could just use one "ground" body for everything static.
The AI will have to figure out how to move these bodies and where to apply forces.
Like I said, this can be very complicated so you probably want to start with local multiplayer.
Re: Noobie just discovered LOVE. Tips for a top down sports game?
I'm quite comfortable with the math and vectors and angular velocities for determining who needs to move where. I already have four love.graphic.draw.circles chasing each other around the screen as an exercise. These are driven with a class I made up called 'hockeyplayer'.
I guess i was asking if should I use ''applyLinearForce' to make an AI object move in a known direction to make that body move towards that direction and let love.physics deal with momentum, collisions and rebounds?
After a contact, the AI would evaluate its new positron and then apply an adjusted linear force to try to complete its goal.
Is ApplyLinearForce the best method for my AI controlled hockey players?
Edit: apply force might be better. I'll read some more!
I guess i was asking if should I use ''applyLinearForce' to make an AI object move in a known direction to make that body move towards that direction and let love.physics deal with momentum, collisions and rebounds?
After a contact, the AI would evaluate its new positron and then apply an adjusted linear force to try to complete its goal.
Is ApplyLinearForce the best method for my AI controlled hockey players?
Edit: apply force might be better. I'll read some more!
Current project:
https://togfox.itch.io/backyard-gridiron-manager
American football manager/sim game - build and manage a roster and win season after season
https://togfox.itch.io/backyard-gridiron-manager
American football manager/sim game - build and manage a roster and win season after season
Re: Noobie just discovered LOVE. Tips for a top down sports game?
ApplyForce should be called every frame over longer periods of time (for example: jetpacks, cars, etc) whereas applyImpulse is used once for (more-or-less) instant changes in velocity (jumping or throwing projectiles).
Read up a little bit on Newtonian physics and in particular the following two formulas:
Impulse = change in velocity * mass (instant change in velocity)
Force = mass * acceleration (acceleration or change in velocity over time)
Like I said, AI is a difficult subject, so I can't really help much beyond that.
Read up a little bit on Newtonian physics and in particular the following two formulas:
Impulse = change in velocity * mass (instant change in velocity)
Force = mass * acceleration (acceleration or change in velocity over time)
Like I said, AI is a difficult subject, so I can't really help much beyond that.
Re: Noobie just discovered LOVE. Tips for a top down sports game?
Thanks. I think I need to apply force to the AI and apply impulse to the puck.
I think at this point I need to stop reading and experiment. Thanks.
I think at this point I need to stop reading and experiment. Thanks.
Current project:
https://togfox.itch.io/backyard-gridiron-manager
American football manager/sim game - build and manage a roster and win season after season
https://togfox.itch.io/backyard-gridiron-manager
American football manager/sim game - build and manage a roster and win season after season
Re: Noobie just discovered LOVE. Tips for a top down sports game?
Just celebrating my game is functional. Not pretty, but functional.
In just over a week Love2d has allowed me to make a playable concept of a sports field full of bodies moving around and reacting via Newtonian physics.
Appreciate the tips. Onwards and upwards.
In just over a week Love2d has allowed me to make a playable concept of a sports field full of bodies moving around and reacting via Newtonian physics.
Appreciate the tips. Onwards and upwards.
Current project:
https://togfox.itch.io/backyard-gridiron-manager
American football manager/sim game - build and manage a roster and win season after season
https://togfox.itch.io/backyard-gridiron-manager
American football manager/sim game - build and manage a roster and win season after season
Who is online
Users browsing this forum: Ahrefs [Bot] and 207 guests