Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411490 Posts in 69371 Topics- by 58428 Members - Latest Member: shelton786

April 24, 2024, 05:42:01 PM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsCommunityDevLogsTrampoline Gunmen III - Lucky Strike (Win PC)
Pages: [1]
Print
Author Topic: Trampoline Gunmen III - Lucky Strike (Win PC)  (Read 5280 times)
Sketcz
Level 0
**



View Profile WWW
« on: August 19, 2011, 09:05:18 AM »

Trampoline Gunmen III - Lucky Strike

System: Windows PC

Current lines of code: 1200+


I had better post this diary otherwise I’ll either quit the project without completing it, or finish it without documenting anything. Work seems sporadic, with days at a stretch lacking motivation, and at other times it eating all my time. Which is ridiculous, because I don’t expect anyone will be interested in this. But I suppose completing it will eradicate an itch that has bothered me since around 1999. Crikey, this thing must have been “in the making” for as long as Duke Nukem Forever was.

There have been previous TrampGun games:

Tramampolining Gunmen
Tramampolining Gunmen 1.5
Trampolining Goats
Trampalien Gunmen DC (Dreamcast)
Trampoline Gunmen: Turbo Deux (big sequel, AI, backrounds!)
Trampoline Gunmen: Minigame$
Trampoline Gunmen Quadro (4 player simultaneous)

More info can be found HERE.


TGIII is sort of a series reboot.



It’s 100% Windows as opposed to DOS like the previous games. It’s coded in QBasic 64, and I’ve put a lot of effort into it. It will feature:

* An actual godamn working ARRAY to track bullets
* Selectable characters with unique traits
* 1P mode with AI, story and endings
* 2P mode (natch)
* Animated stage backgrounds
* Music tracks
* Voice acting
* Some degree of physics which takes into account gravity/inertia (can be toggled)
* Options menu (maybe customisable controls, maybe)
* Save data
* Improved minigames, if I have time


I’m definitely past the halfway mark now. Although not coded in a high-level language, or using complex maths, it’s proven to be a very interesting and often satisfying experiment. I really think students should be taught programming at school, as part of their maths classes, because even if it doesn’t have a direct effect on tangible real-life skills, it’s still a valuable experience and requires good problem solving skills. It really sharpens the mind. There was a time in the UK (at least in some schools) in the 1980s where kids were taught programming – the British Broadcasting Corporation even helped with the creation of the BBC Micro which was used in schools. I’ll never be able to match the stuff done my fellow TIGSourcers, but on a conceptual level I can now totally understand what developers mean when they get technical in their explanations, thanks to programming over the years.

PHASE ONE



First I made some progs to give me screen references when coding. I like SCREEN 13 in QB because it’s fast, has more colours which are easily accessed (over 200, whereas SCREEN 12 only has like 15 by default), and the low resolution means I have to put less effort into graphics. I can then tell people I’m into the 8-bit vibe, when in actual fact I’m just lazy. I suppose I should use QB64’s ability to load image files, but manually drawing stuff is more hands on, allows for easy character animation with DRAW, LINE and CIRCLE, and I must admit I actually kinda like how it looks. Unless you’re really good in creating PNG, GIF or whatever image files, the game runs the risk of looking cheap and nasty really easily. Mine is still cheap and nasty, but like I said: it’s totally channelling the 8-bit vibe.



First I made a COLOR chart. You know what I don’t like? Having to omit the silent U from the word colour in QB. Superfluity is a joy in life. Anyway, this was fun, just PRINT the number while using that same number for the COLOR.



Next were references for a PIXEL GRID and PRINT GRID. You know what’s weird? When drawing stuff the first number is the horizontal axis. When printing text, the first number is the vertical axis. Bloody wonky that is.

I also grabbed some paragraphs of code from other programmes which I felt I might need (such as one that prints the CHR$ pressed on the keyboard, and some INKEY$ detection).


PHASE TWO

On to the game proper. In my planning stages I decided the new game would need energy bars and other info, so the arena would be vertically squashed and more horizontal. Which is fine, since it’s a horizontal game. I made a quick arena draft which looked good, then decided to check it against my original TG game. Turns out TGIII was actually taller! Back to the drawing board to redo the outer limits, since a shorter stage allows more energy bar space. Then I added the score at the bottom...



This when I had my first hurdle: SCREEN 13 claims to allow printing up to 25 vertical places, except points 24 and 25 actually scroll the screen! Meaning you’ve really only got up to 23 when in a loop. Which was too high and left a ton of wasted space. And I had the level timer at the top of the screen - I absolutely wanted the scores at the base. So I had to have it that the game prints to the lowest line before drawing anything else, to prevent scrolling. Technically it stops printing after that, so the text would get wiped out with a CLS command or rogue floating graphics. I’m wondering, should I change the numbers to symbols ala Street Fighter? I like numbers because they’re easy to work with...



Next I drew the bullets and ammo box. All pretty easy. In earlier games ammo was represented by an A in the box, but this time I wanted an image of bullets. Next spent time making my first new character via DRAW. Ended up MUCH longer than I expected. Based him on the guy in the green vest from the first game, on the right side. I eventually switched his shirt from green to blue, since I wanted an army-type character all in green. Changed his skin tone from Simpsons yellow to beige as well. To facilitate animation I drew the gun and arms separately, and had them PSET slightly differently too. Each character’s falling/ascent direction is based on a switch which is either 0 or 1, so I just add this to the PSET which results in a rather nifty arm animation as he rises and falls.

Next I added the Energy Bars, and Power Bars which will be used for special attacks. Kinda like Super Moves in Street Fighter. Took a while to find the right range of colours (see above chart), but eventually settled on Yellow to Red for energy and Pink to Blue for POW. Every character needs to charge POW to 50, but everyone’s starting POW and Health Energy is different (strong characters get 100, weaker ones only get 50). Coupled with different MAX ammo limits, and strengths of attack, plus specials, I’m hoping this adds enough diversity to keep people interested. One character’s special is he shoots out a tiny cow, which homes in on the enemy.



Implemented basic movement (up and down) and speed changes, plus an ARRAY for shooting bullets. I allow for up to 20 bullets per character, though this is only theoretically possible with one character. The army guy can fire up to 5 at a time. So if he fires 5, then touches the ammo box he can fire another 5, plus his POW move will release a wall of 10 bullets, making for a total of 20. Most characters though will only have between a max of 4 and 6 onscreen at any one time. Still, theoretically neat!

« Last Edit: August 19, 2011, 09:16:30 AM by Sketcz » Logged
Sketcz
Level 0
**



View Profile WWW
« Reply #1 on: August 19, 2011, 09:06:30 AM »

PHASE THREE

After a couple of days break I went back to it with a two-pronged assault: draw up the character list with stats for speed changes, and add some inertia-based physics. Not a lot, just a little. The game would be based around 5 gear speeds: Very Slow, Slow, Medium, Fast and Very Fast (or 0.15, 0.3, 0.5, 0.7 and 0.9, for you mathematicians). Only one character has all 5, most have 2 or 3 speeds (the Hobo has Very Slow and Slow, for example). Also wrote the stories and formulated ideas for their POW moves.

Before I get on to explaining the physics and the super neat trampoline animation, let me reveal the roster of characters:



The goat/yak thing I actually changed the design of, to make him look more like the goat from my previous Trampoline Goats game with Cthulu tendrils (what do you guys think? Old or new design?). Most of the characters refer to personal in-jokes, so while the idea of equine gallows, sentient beards, and gherkin jars stuffed with a cooked chicken carcass are hilarious to me and some who know me, they probably make no sense to any of you. In which case excellent! Some of my favourite games have been rich with impenetrable dev in-jokes. The Lawnmower Priest is based on a previous game I made, while Jeffer has some nods to an amazing UK indie developer who I’m a fan of (guess who and win a prize!).


Mango
His special POW is he shoots a tiny cow that homes in on opponents. An all-rounder. The POW name is based on a conversation I had with my brother, as we were walking down a country lane with cows in the adjacent field. He said it was creepy how they followed us along, always watching us, and I said: "Little know fact, right, is that cows are actually omnivores. They subsist on a diet of grass and genitals. That's why they have 4 stomachs. Three are to process grass, one is for human flesh. After a bull stamped in Spain, 1967, when the army were called in to secure the town, they found that cows had partially consumed those they'd killed. Seriously, cows always go for the genitals." Being an adult he knew I was talking BS (lol), but ever since then we've had a running joke, and will randomly mention to people: "Hey, do you know cows are actually omnivores? True fact."  Screamy


Hobo
This one is interesting. He has infinite speeds changes and a massive high attack, but only one bullet at a time and is very slow, plus has low health. Requires further testing for balancing.


Natali
Two guns with two separate ammo amounts. Her whip attack sends a horizontal line across the screen at her Y height, thereby acting as ceiling to potentially trap enemies.


Lawna
The idea of a wheelchair based character came from someone on the NTSC-uk forum, who said that the change in dynamics could be interesting in a game (what kind of real-life difficulties do wheelchair users face?), but that publishers today would be afraid to tackle such a subject. Is my game the first to feature a playable wheelchair-bound character? I also like the visual image of a wheelchair bouncing on a trampoline. Lawna is quite powerful too since she'll be the only character who can recharge health (her POW move) and has a 50/50 chance of getting a new bullet when touching the trampoline. I'm wondering, since she can heal herself, should I have her health constantly decreasing at a very slow rate, but stopping once it reaches 1?


Azdash
Army guy with lots of ammo but weak attack. His POW sends a wall of bullets and temporarily boosts his attack power.


Jeffer
Weird character who depletes enemy's POW, constantly charges his own, and whose POW attack is more strange than useful. I love the Cthulu tendrils coming from the goat's head.

Huh?
Secret 7th character
I've not coded him in yet, but I have an idea for how he plays (no speed changes, pure gravity physics, and a boomerang).

I’ve slowly tweaked their specs and story over the weeks to make each feel unique and hopefully create distinctive play styles.

The Hobo has infinite speed change abilities, since it doesn’t require ammo for him. Also, when a character is travelling at their slowest speed and going upwards, and they try to slow down further, they change direction and fall downwards. I liked the idea of this since it allowed tactical play – do you change direction to avoid being hit but risk less ammo and a longer journey back to the box? This led to an interesting quirk where the Hobo could indefinitely cancel his ascension and fall back down, leading to an infinite quick bounce on the trampoline. I looked cool and was a lot of fun, but I reckoned it might make him impossible to beat, so I removed that ability from him. Others can still Cancel though.

This part was a lot of fun, trying to invent new ways for characters to behave. Jeffer reduces enemy POW when hitting them. Natali has separate ammo for shooting and speed changing. Lawna has a 50/50 chance of getting an extra bullet when touching the trampoline. And so on.

What was NOT fun was drawing all these characters. It took AGES. Then I had to reverse then all for the other player. At first I thought I would have to manually go through altering every instance of the letter E to the letter H, but in the end I loaded sections of the source code up in Microsoft WORD and had it automatically replace E with Q, then H with E, then Q with H. Rinse and repeated for L, R and F, G.



Once I had them drawn and their stats down I spent a long time adding inertia and a trampoline animation. The physics ended up needing a day’s worth of debugging just to make it feel “right”. I suspect it’s the same for all such games. I wanted it so that rate of ascent slowed slightly, and wanted descent to increase slightly, but not to the degree that it negated the need for speed gears. There’s a counter (P1grv for example) which is continuously increasing, and in turn is being added to the player Y position, in addition to their chosen direction and speed (for example travelling up could be -0.7, while receiving +0.15 due to gravity). The MAX for gravity is based on your then chosen speed gear, while things like touching the trampoline or ammo result in negative gravity – this means you leap off the trampoline with a spring in your step, and you float away gently from the ammo box at the height of your ascent. It works great.

I don’t understand real-world physics so I just made this up and tweaked until it felt right. Eventually it did and I thought the tramping animation looked super awesome. Then I left it for several days.


PHASE FOUR

A right pain in the arse this was. I intended to start adding special powers now, but instead spent an entire weekend-day debugging it. Tweaked everyone’s stats and made it so that firing your gun added power, even if you didn’t hit anything (which should prevent stalemates). Needed to alter the hit box as well, since bullets were passing through people’s legs.



To aid debugging, I also made a DEBUG button, which pauses the game and switches to a screen printing most of the game’s variables, which should aid future tweaking. I also added a button to instantly reload ammunition, activate blood splats and the KILL animation.




Once I’ve implemented special powers, I’d like people to play this beta and offer feedback on the game’s balancing – so will leave these debug options in. These will be disabled prior to the final release though.




Next I added stuff like blood splats and sparks when firing your gun. Not difficult just dull, since it’s mainly trial and error with a lot of tweaking. Since my game is based around a MAIN LOOP followed by a SECONDARY LOOP for movement, I had to be very careful to connect every single animation to the timing of the secondary loop, thereby ensuring it’s the same speed on everyone’s computer. When I first started coding in 1998 I only had one main loop in my games, not realising everyone’s computer would run things differently. At that time I used SOUND to slow things down, but that was screwy. Here the sounds will be separate files, and timing should be correct.

Since I’ll be including a SAVE FILE with the game, once a user has tweaked the speed to their liking, it will always be like that, until it ends up on another PC. Currently I have to type in the speed I want each time.

FUN FACT: the blood splats and gun sparks use randomised LINES and CIRCLES, meaning each is unique! A bit like snowflakes.

The dullest stuff though was tweaking inertia and trying to correct a bug. This bug had me really stumped: after touching the ammo box, if you’re going at Slow or Medium speed and switch to Very Slow, your character flies upwards suddenly until he retouches the ammo. But why?



Disabling the line of code which implements gravity showed that it was a result of gravity (as I expected). So I went through every single line of gravity based code, disabling them one by one to find the culprit. Nothing specific – it appeared to be the entire system somehow. Then I went through every line which added anything to the player’s Y position. Again nothing.

It only happened when pushing down though, while travelling down and away from ammo. So I focused on the paragraph for the down button. Eventually I narrowed it to a line of code which switches M/S speeds to VS, but I couldn’t fathom why. I made a quick and dirty fix which sort of corrected the problem, but removed inertia for 50% of the screen area (which wasn’t much fun). I intended to have this as a toggle in the final game if I couldn’t fix it.

Then while trying to fall asleep I had an epiphany!

Touching the ammo box adds negative gravity, right? Well it’s based on your then current Speed Gear. At M/S speeds and above it results in something like -0.5. But speed VS makes you go down at a rate of only 0.15, so the negative gravity causes you to fly up! Although I added a cap to maximum downwards gravity, I never capped the negative gravity. A quick line of code which caps it at -0.2 for VS speeds fixed the problem quite nicely. You move up ever so slightly, as if you’d fired downward propulsion on a rocket, but gravity soon takes over negating it and sending you downwards.



If Trampoline Gunmen interests you, I recommend you test out Turbo Deux for 1P and 2P modes, AI, and some awesome backgrounds. Quadro for 4 player simultaneous modes, and Minigame$ for really cool 1P games which save your hi-score. These will require a PC capable of running DOS (Win XP is great) or DOSbox, though this is a bit wonky with speed detection – so you will need to manually reset it. DOWNLOAD HERE.




TG: Quadro


TG: Minigames - Bounce for me Baby


If there's a demand for it, I might go back and correct some bugs in these earlier versions and recompile them for modern windows systems.



Anyway, back to Trampoline Gunmen 3...

Finally I cleaned up the character select screen and wrote a list of sounds and voice clips which I’ll need. Fancy your voice in my game? Keep an eye out for a request topic at some point!

I will probably also need some music, otherwise I might just rip some Street Fighter II tunes and call it a day.


More entries as I make them (probably won’t be for a while).

STUFF TO DO STILL IN TG3:
Special powers
Backgrounds
AI
Sound Fx
Music
Endings


EDIT:
Well, managed to get 2 POW attacks drafted up this evening. Here's one of them in action:
« Last Edit: August 19, 2011, 01:53:46 PM by Sketcz » Logged
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic