I need help with a Tank game?
by Vladaboy Mx · in Torque Game Builder · 09/22/2007 (1:51 am) · 22 replies
I'm a beginner with TGB and i would like to make a tank shooting game,
And the problem is that i dont know how to code the tank turning, what i would like to make is a tank that when a key is pressed i turns for a amount of degrees aproupriate and then when it is turned and the same key is pressed it just moves on, and i would like the tank to move tile by tile.
Thanks, Vladimir.
And the problem is that i dont know how to code the tank turning, what i would like to make is a tank that when a key is pressed i turns for a amount of degrees aproupriate and then when it is turned and the same key is pressed it just moves on, and i would like the tank to move tile by tile.
Thanks, Vladimir.
#2
Well ok then i have to change the holle game... the the tank should move in 360 degres with tje mouse as the aim, whitch i still dont know how to code? and i need help? would someone help me with this?
thx, Vladimir.
09/22/2007 (5:55 am)
Ok then i wont use them :)Well ok then i have to change the holle game... the the tank should move in 360 degres with tje mouse as the aim, whitch i still dont know how to code? and i need help? would someone help me with this?
thx, Vladimir.
#3
From a gameplay perspective, it worries me if a player would just have to put his mouse on what he wishes to shoot. If one is available, an XBox 360 USB controller would be great in that you could control the tank with the left stick and the turret with the right. Unless of course, you decide to read the mouse's change in distance on the X-axis to rotate the turret, because that would make aiming still require skill. There's no reason why you couldn't use both.
09/22/2007 (6:06 am)
It sound like you want the tank to move with the keyboard and the turret to move with the mouse. In this case, the turret should be mounted to the tank chassis.From a gameplay perspective, it worries me if a player would just have to put his mouse on what he wishes to shoot. If one is available, an XBox 360 USB controller would be great in that you could control the tank with the left stick and the turret with the right. Unless of course, you decide to read the mouse's change in distance on the X-axis to rotate the turret, because that would make aiming still require skill. There's no reason why you couldn't use both.
#4
but could you help me with the actual making? I can draw an awsome tank no prob, but i realy need help with the tank movement code.
thanks, Vladimir.
09/22/2007 (7:10 am)
Well i am making a game for Windows PC.but could you help me with the actual making? I can draw an awsome tank no prob, but i realy need help with the tank movement code.
thanks, Vladimir.
#5
09/22/2007 (8:17 am)
Since you don't have a license for TGB, I cannot really provide much help to you. If you have access to the tutorials though, read through them until you understand implementing movement.
#6
There is a Behavior Tutorial and project sample that gets installed. The sample project is installed in your GarageGames directory. In this project are examples of the various types of movement behaviors, one being a tank.
Why is tile movement a problem? I have a 2D tile game I want to port to TGB and it moves a character sprite a full tile at a time.
09/22/2007 (9:28 am)
If you are using the latest version, you should have access to Behaviors. Behaviors let you tie functionality to an object. One of the built-in behaviors is Tank Movement. Place the Tank Movement behavior onto your Tank sprite.There is a Behavior Tutorial and project sample that gets installed. The sample project is installed in your GarageGames directory. In this project are examples of the various types of movement behaviors, one being a tank.
Why is tile movement a problem? I have a 2D tile game I want to port to TGB and it moves a character sprite a full tile at a time.
#7
For example, a strategy game for which I'm providing some help doesn't use tiles or pixel-perfect movement; the game uses regions like Risk. Another title, my main project does use a tile-based map, but not tile based movement because the testers (both at that point) didn't like being pushed that into that last square and getting around obstacles didn't feel right. Because those examples don't use tile-based movement, that shouldn't mean that tile-based isn't the right choice for all games, just that it wasn't right for those. In my mind, a tank based game would be something like Iron Tank or even Combat for the Atari.
A tank has some capacity to rotate, generally less than than is presented in games. A tile based, or even hex based games reduces that rotational capacity. If one is using tiles, restricting it to 90deg movements would not feel appropriate to most players; hexes would increase the granularity to 60deg per movement. With free rotation, one could rotate their tank as little as one mil, which would probably be more enjoyable to most players, especially if the control was real-time. For a turn-based game or a non-action game, tile-based movement can help to readily gauge distances and provide unit movement limitations which may be appropriate for particular playstyles.
09/22/2007 (12:31 pm)
Tile movement is a problem for a tank sort of game because it makes things less granular, the movement becomes quite clunky and unnatural. For an RPG or strategy game, tile-based movement is a fine choice. Super Mario Brothers works great with tilemaps, but if Mario could only move a full tile or not at all, it would not have been enjoyable. For example, a strategy game for which I'm providing some help doesn't use tiles or pixel-perfect movement; the game uses regions like Risk. Another title, my main project does use a tile-based map, but not tile based movement because the testers (both at that point) didn't like being pushed that into that last square and getting around obstacles didn't feel right. Because those examples don't use tile-based movement, that shouldn't mean that tile-based isn't the right choice for all games, just that it wasn't right for those. In my mind, a tank based game would be something like Iron Tank or even Combat for the Atari.
A tank has some capacity to rotate, generally less than than is presented in games. A tile based, or even hex based games reduces that rotational capacity. If one is using tiles, restricting it to 90deg movements would not feel appropriate to most players; hexes would increase the granularity to 60deg per movement. With free rotation, one could rotate their tank as little as one mil, which would probably be more enjoyable to most players, especially if the control was real-time. For a turn-based game or a non-action game, tile-based movement can help to readily gauge distances and provide unit movement limitations which may be appropriate for particular playstyles.
#8
09/22/2007 (1:21 pm)
Thanks for the response. After re-reading your post I realize you were specifically responding to a tank game. I originally read it to mean movement tile-by-tile was difficult in TGB. Thank for the clarification.
#9
For now i Just need code for the 360 movement and shooting... if someone could help i would be very thankfull!
I'm sorry for my spelling i'm from a non english country :)
09/22/2007 (2:36 pm)
Yea now i see that i shouldent use tiles, but i dont have the lates version, i have the 1.1.1, and i would like to build something i buildet in Delphi some time before and add fancy stuff in the engine like particle efects turret rotation, and all the things that were very hard in Delphi, and made posible by the TGB.For now i Just need code for the 360 movement and shooting... if someone could help i would be very thankfull!
I'm sorry for my spelling i'm from a non english country :)
#10
09/23/2007 (7:52 am)
Anyone? could someone help me with this problem.
#11
09/23/2007 (8:16 am)
If you ask these in the private forums and upgrade to 1.5.1, you'll definitely be able to get some help. Still, you need to work your way through the basic tutorials so you can understand simple movement. When you get that, you'll just change your movement to be rotational and forward instead of along the x and y axes. Unfortunately, it's discouraged to give out any sort TorqueScript to non-licensees.
#12
09/23/2007 (8:35 am)
Well i wanted to make something in TGB before i actualy buy it.
#13
09/23/2007 (8:51 am)
It feels like you're missing the point. The demo isn't so you can make a game, it's so you can get a feel for the capabilities. If you could make your own games with just the demo, nobody would license the full version. Use the demo to get a general idea of the product. If one could just use other code and the demo, they could make a whole game without even buying the engine. It's only $100, a nominal risk.
#14
09/23/2007 (11:47 am)
I know and you are right, i will consider that.
#15
(removed question.)
09/27/2007 (6:40 pm)
Quote:If you are using the latest version (1.5.x), you should have access to Behaviors. Behaviors let you tie functionality to an object. One of the built-in behaviors is Tank Movement. Place the Tank Movement behavior onto your Tank sprite.
There is a Behavior Tutorial and project sample that gets installed. The sample project is installed in your GarageGames directory. In this project are examples of the various types of movement behaviors, one being a tank.
(removed question.)
#16
09/27/2007 (9:12 pm)
John, it's a good thing you managed to avoid being condescending.
#17
09/28/2007 (8:17 am)
(removed acknowledgment.)
#18
Merely copying another person's code will not help him understand his problem. Programmers shouldn't be cargo cultists. Besides, Steven pointed it out in a respectful way, you just resorted to insulting people. It's really a great way to make this community look like jerks. Obviously the original poster read what Steven S wrote, he just didn't understand it.
Hopefully a moderator will clean up this thread, in the public forums people should try to avoid deliberately tarnishing this site's reputation.
09/28/2007 (10:54 am)
Are you always like that? Merely copying another person's code will not help him understand his problem. Programmers shouldn't be cargo cultists. Besides, Steven pointed it out in a respectful way, you just resorted to insulting people. It's really a great way to make this community look like jerks. Obviously the original poster read what Steven S wrote, he just didn't understand it.
Hopefully a moderator will clean up this thread, in the public forums people should try to avoid deliberately tarnishing this site's reputation.
#19
If you are going to post in "newbie" threads such as this one, please keep in mind exactly what Jason is getting at--newbies by definition need more than just "here's the code, if you can't do it you suck" mentality. I'm not saying John meant it that way, but that is exactly how it came across--so please everyone keep in mind the nature of posts here, and a professional and helpful way of approaching the communication!
09/28/2007 (11:15 am)
I'm not going to moderate the forum, but I do want to interject that Jason's point is a valid one--especially in a "Trial" forum area.If you are going to post in "newbie" threads such as this one, please keep in mind exactly what Jason is getting at--newbies by definition need more than just "here's the code, if you can't do it you suck" mentality. I'm not saying John meant it that way, but that is exactly how it came across--so please everyone keep in mind the nature of posts here, and a professional and helpful way of approaching the communication!
#20
Jason, I think you misunderstand the license restrictions. As far as I know, you can help out the "newbies" with sample TorqueScript and programming logic. You just can't post any source code to the TGB engine.
Vladaboy, Can't you download TGB 1.5 as a trial? I suggest doing it. The Behaviors will make so many things so much easier for you.
If you still need help getting this to work, post again, I'll help how I can.
10/14/2007 (12:42 am)
Aiming the turret with the mouse and moving the tank with the keyboard isn't really that bad of a control scheme. The Nintendo Wii has a fun little tank game on Wii Play with similar controls. It's lots of fun and can be quite difficult!Jason, I think you misunderstand the license restrictions. As far as I know, you can help out the "newbies" with sample TorqueScript and programming logic. You just can't post any source code to the TGB engine.
Vladaboy, Can't you download TGB 1.5 as a trial? I suggest doing it. The Behaviors will make so many things so much easier for you.
If you still need help getting this to work, post again, I'll help how I can.
Torque 3D Owner Jason Ravencroft