Game Development Community

Developing a Soccer Game and Physics

by Gustavo Boni · in Torque Game Engine · 05/19/2006 (7:34 am) · 12 replies

I was wondering to develop a soccer game for my post graduation program. While wondering hours ago, i tried to imagine the dificulties to develop this with TGE.

- Camera: i would need to implement a new camera system to see the field like in a "God View Mode". This resource would might help Advacend Camera

- Physics: i would need to integrate a new physics system to TGE for the Ball behavior be as realistic as it can.

- Artificiall Inteligence: this is very important in a soprt game, maybe the most difficult to implement.

- Some other things like the GamePlay, when the Player is with the ball the game rules, etc.

I just could think in this points for now.

Physics is the part of the game that worried me about. I would need to integrate new systems like ODE or Newton. Do you know how difficult is this? What is better to integrate with TGE? Or maybe the resource for Rigid Shapes is what i'm looking for?

Thanks in Advance,

Gustavo Boni

#1
05/19/2006 (8:10 am)
Http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=10258

- For the Physics
#2
05/19/2006 (11:17 am)
Dont use the rigid shape for football. Use a physics lib or code your own ball physics.

For AI - buy the book "Programming game AI by example". Has a soccer game as example using steering behaviours. Not very hard to code at all.
#3
05/19/2006 (12:38 pm)
@Thomas: Thanks Thomas =)

I'll look for this book.

And about Newton x ODE x PhysicX? How is better to implement with Torque? And how dificult is this?

@SphyxGames: Thanks too, but im looking for something free. =( However it's a great resoruce =)
#4
05/19/2006 (1:03 pm)
Implementing an outside physics package is not an easy process. There are a lot of considerations (especially if you are hoping to have networked physics) and a large number of hooks. There are several ODE topics and a TDN article on it. The ODE topics are good markers for the TGE hooks to understand how to hook in Newton, ODE, Aegea, Tokamak, etc.
#5
05/19/2006 (1:33 pm)
If the only physics you need is a ball, I would look into coding your own physics for an object. Marble Blast uses a custom coded object for it's marble, not a fancy external physics lib or anything. Especially if you planned on making it multiplayer, as you'll be able to do the network syncing from the ground up. Also consider that realistic physics are not necessarily what you'll need for a soccer game. At least many such games I remember playing give you general "control" of the ball when it's in posession of a player, and the only physics would be when the ball is kicked. And then how that works depends on the mechanics for your gameplay. Can you put spin on the ball, curve it, etc?

So I would first figure what kind of actual gameplay controls you are looking at doing, and then look into what sort of setup for ball physics is going to work best for you.
#6
05/19/2006 (1:46 pm)
@David Blake: Thanks, i've read this topics and the TDN article. I think it was good to give me a way.

@Paul: yes the realistic physics i mean is only with the Ball, maybe implement my own physics for this object be the best way. However it just worth if easier than integrate an physic system in the TGE. I'm suposing i need to know very well physics to code for my self an behavior for the Ball like Marble Blast.
And about the GamePlay: you'll control just one player, is not like the most soccers games where you control the role team. Thus, i really need a good physics for the ball.

Thanks

Gustavo
#7
05/19/2006 (3:10 pm)
Quote:Dont use the rigid shape for football.

I tried to use RigidShape for a puck... not a good idea. It's not very stable for such a small object. I may try the PhysX resource, but i think i'll end up implementing my own.
#8
05/19/2006 (4:10 pm)
Like I said, have you actually thought about how the gameplay is going to work? Every soccer game I've played has the ball stay with the player controlling it unless they kick it away. Realistic physics aren't any good for that, as it would be impossible to have the player actually colliding and kicking the ball along with them properly. So unless your planning on using some sort of system where you really just kick the ball around everywhere (which I only see as a setup for soccer minigames where you're basically running an object into a ball), then physics api or not, you're going to have to do some kind of custom setup for having the ball be interacted with by players.
#9
05/19/2006 (7:42 pm)
Quote:Every soccer game I've played has the ball stay with the player controlling it unless they kick it away. Realistic physics aren't any good for that, as it would be impossible to have the player actually colliding and kicking the ball along with them properly.
I think you want both. What i did with the RigidShape is allow for it to be mounted on to the controlling player. The player would included a mount point that was animated for the puck when standing still, skating with the puck, etc. When the player had control of the puck it would be mounted and follow the animations. When shot or passed the puck would go back into a physics mode allowing for interesting interactions with the ice, the boards, the pipes, off blocking players, etc. When the player skated back over it the puck would turn off physics and mount again.

I'm pretty sure this is fairly standard across sports games with different levels of "physics" on the ball/puck/whatever. Hell... even Unreal Tournament 2004 "Bombing Run" game mode did this.
#10
05/19/2006 (10:50 pm)
PhysX is free, if you make use of the HW
#11
05/20/2006 (1:12 am)
Yes. Which makes it pretty much useless as nobody is going to have those cards.
#12
05/20/2006 (8:34 pm)
Using a physics SDK for a ball is overshoot, by large. Getting a ball moving realistically is among the most basic physics stuff one can code.

Get your programmer pride up and cut the "but I would need to know physics" line. If you don't know it, google it. There's tons of resources on the 'net where you can get such info in various degrees of depth, from academic-like papers, to game-oriented code samples. I'm sure you'll find interesting articles at gamedev.net, I remember learning enough from there and a few other sources to build my own collision system in my pre-Torque days.