Slag: A Nascent Tank Game?
Posted: Sat Nov 24, 2012 8:23 am
Hey!
This is my latest project.
It's kind of a spin-off of Endless War 6.
I'm not usually inclined to share my code, but I figure I won't be getting very far anyways.
College apps, and whatnot. Indefinite hiatus.
I've attached the .love file. You can just rename it to a .zip, and thereby access the contents.
I used N++ in development.
The entire interface part has yet to be written.
Also the enemies.
And the shooting (on hit) has to be refined.
( viewtopic.php?f=4&t=11798 )
Check the love.keypressed(key) function to see some tester functions.
What currently exists:
A tank!
And it moves.
And it shoots.
And has a shield.
And it has individually destructible parts, the destruction of which influence the overall functionality of the tank (mainly in movement/shield). I pretend that damaged parts are still working just fine; only when they are completely destroyed does the tank suffer in functionality.
Oh and there's some walls. Just a box.
And a bunch of HUDs, and some output.
And it has a bunch of other shit, too numerous to list. There is an update log at the bottom (It's all commented out.), so you can check that.
THE IDEA, AND SOME MORE INFORMATION:
The idea is to have a whole list of upgradable (or rather, unlockable) parts, which offer varying levels or types of performance. This is the "big thing" here.
The hull is the heart of the tank. Within it is the engine, which provides "force".
The armor protects every part from a certain amount of damage before it is destroyed. All damage hits the armor first.
The treads (split into left and right) provide "speed". The movement of the tank is determined by the product of speed and force.
The generator projects a shield around the tank which dampens damage.
The turret houses the main and side weapons of the tank. It cannot be directly damaged, but is destroyed when the hull is. The turret also has its own stats: turnSpeed and heatMax.
The main weapon and side weapon... well there'll be several types:
Bullet: Yes.
Shell: Exploding bullets. Yep. Explosive damage decreases as radius increases. Linear?
Laser: Instantaneous-travelling and penetrating bullets.
Spray: Things like flamethrowers and corrosive weapons. Yeah, it gets a little sci-fi.
All made possible by sensors. Beautiful idea, sensors.
If a destroyed part is hit, the damage is redirected to the hull.
Player performance across levels would unlock higher echelons of tank parts.
All parts have a certain weight; higher-performance parts would generally weigh more.
I have a whole list of parts and names and stats. Ask if you specifically want to see it; it's kind of a bitch to type out.
The shield mechanism is my brainchild. The shield has its own energy level, which is reduced whenever the tank is hit. But it also reduces the amount of damage dealt to the parts of the tank by its current percentage value. The shield itself still takes full damage, but regenerates over time. Larger values of shield will be more difficult to deplete and therefore provide protection over more damage. Because the shield takes the damage before its damping effect is calculated, no damage will ever be completely mitigated.
Destruction of the generator also destroys the shield.
The turret rotates the entire way around. This was a bitch to program, and there's some pretty intense logic in it.
Shooting has a fixed value of inaccuracy. This is calculated with polar coordinates (lots of conversion, to and from Cartesian coordinates...)
The accuracy could decrease over continued shooting, but I didn't feel like going there.
Shooting produces screen shaking and weapon heat.
Screenshake undergoes exponential and linear decay; heat undergoes linear decay (rate partially scales with heatMax and is partially constant... if that makes sense).
When overheated, the tank may not shoot until heat falls below a certain level (30% of heatMax).
There's a function which modifies numbers for printing by appending a certain number of spaces to the beginning of the resultant string-to-be-printed. This centers the number. The number of spaces is determined by the scale of ten of the value.
Trust me, this matters.
This is my latest project.
It's kind of a spin-off of Endless War 6.
I'm not usually inclined to share my code, but I figure I won't be getting very far anyways.
College apps, and whatnot. Indefinite hiatus.
I've attached the .love file. You can just rename it to a .zip, and thereby access the contents.
I used N++ in development.
The entire interface part has yet to be written.
Also the enemies.
And the shooting (on hit) has to be refined.
( viewtopic.php?f=4&t=11798 )
Check the love.keypressed(key) function to see some tester functions.
What currently exists:
A tank!
And it moves.
And it shoots.
And has a shield.
And it has individually destructible parts, the destruction of which influence the overall functionality of the tank (mainly in movement/shield). I pretend that damaged parts are still working just fine; only when they are completely destroyed does the tank suffer in functionality.
Oh and there's some walls. Just a box.
And a bunch of HUDs, and some output.
And it has a bunch of other shit, too numerous to list. There is an update log at the bottom (It's all commented out.), so you can check that.
THE IDEA, AND SOME MORE INFORMATION:
The idea is to have a whole list of upgradable (or rather, unlockable) parts, which offer varying levels or types of performance. This is the "big thing" here.
The hull is the heart of the tank. Within it is the engine, which provides "force".
The armor protects every part from a certain amount of damage before it is destroyed. All damage hits the armor first.
The treads (split into left and right) provide "speed". The movement of the tank is determined by the product of speed and force.
The generator projects a shield around the tank which dampens damage.
The turret houses the main and side weapons of the tank. It cannot be directly damaged, but is destroyed when the hull is. The turret also has its own stats: turnSpeed and heatMax.
The main weapon and side weapon... well there'll be several types:
Bullet: Yes.
Shell: Exploding bullets. Yep. Explosive damage decreases as radius increases. Linear?
Laser: Instantaneous-travelling and penetrating bullets.
Spray: Things like flamethrowers and corrosive weapons. Yeah, it gets a little sci-fi.
All made possible by sensors. Beautiful idea, sensors.
If a destroyed part is hit, the damage is redirected to the hull.
Player performance across levels would unlock higher echelons of tank parts.
All parts have a certain weight; higher-performance parts would generally weigh more.
I have a whole list of parts and names and stats. Ask if you specifically want to see it; it's kind of a bitch to type out.
The shield mechanism is my brainchild. The shield has its own energy level, which is reduced whenever the tank is hit. But it also reduces the amount of damage dealt to the parts of the tank by its current percentage value. The shield itself still takes full damage, but regenerates over time. Larger values of shield will be more difficult to deplete and therefore provide protection over more damage. Because the shield takes the damage before its damping effect is calculated, no damage will ever be completely mitigated.
Destruction of the generator also destroys the shield.
The turret rotates the entire way around. This was a bitch to program, and there's some pretty intense logic in it.
Shooting has a fixed value of inaccuracy. This is calculated with polar coordinates (lots of conversion, to and from Cartesian coordinates...)
The accuracy could decrease over continued shooting, but I didn't feel like going there.
Shooting produces screen shaking and weapon heat.
Screenshake undergoes exponential and linear decay; heat undergoes linear decay (rate partially scales with heatMax and is partially constant... if that makes sense).
When overheated, the tank may not shoot until heat falls below a certain level (30% of heatMax).
There's a function which modifies numbers for printing by appending a certain number of spaces to the beginning of the resultant string-to-be-printed. This centers the number. The number of spaces is determined by the scale of ten of the value.
Trust me, this matters.