mspraggs / potentia

Southampton Game Jam 2015
0 stars 0 forks source link

Shooting through things. #101

Open DivFord opened 8 years ago

DivFord commented 8 years ago

If you stick your weapon into a prop or block, the projectile doesn't collide with it. So you can fire through crates and walls.

Fyll commented 8 years ago

Yeah, as I said in the Hitboxes thread, Bullet's start a long way away from the Player right now. I'll need to change how Bullets work to fix this, so I was going to leave it until I redo Bullets (which is next on my list).

DivFord commented 8 years ago

Ooh! Does this mean bullet sprites will be aligned with the gun now? So I can do asymmetric bullets? Also, while I'm asking for things; I learned during the ProcJam that impact animations make the bullets look much better. Will the system support that? For reference, here's the bullet spritesheet I used in the jam. First frame is normal bullet, the others are the impact animation.

test_bullet

EDIT: And here's one you might actually be able to see on a white background… energyblast

Fyll commented 8 years ago

Sure, I'll try to make that work. I haven't started any code yet, but I may over this weekend.

My current plans involve splitting bullets into two types: Bullets and Fans. Bullets would be discrete, and Fans would be continuous. Then, Bullets would be singly defined by a position, a velocity, and a speed, and Fans would be defined by a base, a direction, and an angle. Beams would be Fans with 0(ish) angle.

DivFord commented 8 years ago

Sounds good. Is this "fans" in the openGL sense? As in, are we talking about a continuous stream of particles, or about a polygon?

Fyll commented 8 years ago

A polygon. The continuous stream is rather dodgy, whereas a beam should really act as a single collision (rather than a series of collisions). Fan, specifically, for the Flamethrower (and possibly a 360 degree fan for the magnet gun?). I'm not sure how this'd work sprite-wise, but I'll se what the code wants, then report back.

DivFord commented 8 years ago

It's the flamethrower I was wondering about… I think what you've proposed is probably exactly what we need for the drain beam and suchlike, but graphically, the flamethrower really ought to be a stream of particles.

Fyll commented 8 years ago

Really? I'd've thought waves would have looked better.

DivFord commented 8 years ago

Have a look at these: http://bulk2.destructoid.com/ul/233443-how-i-learned-to-love-the-videogame-flamethrower/Flamethrower4-620x.jpg

https://i.ytimg.com/vi/7G53ZZpsSvU/hqdefault.jpg

Pretty sure they use particles for that effect.

Fyll commented 8 years ago

Hmm. The bullets seem to grow as they get further away in the first one.... That doesn't fit into either of the categories I've defined.

The second one looks like it has the fire slow down as it gets older, thus allowing a lot of fire to hang around as smoke.

I was honestly picturing more of a fan like pattern, rather than a beam. A beam would be good for spraying, but I think it'd look wierd without a lot of fiddly effort being put in. I think one of my worries is that this seems to lie heavily on the Fire, which really doesn't look that good.

DivFord commented 8 years ago

I can see how bullets growing could be tricky. Surely a drag on the bullets is more doable though?

My worry with the textured fan is that it would have sharp edges, which won't look right. I suppose it depends how the fan turns out to work.

If we did do the particle beam thing, I think the solution would be to jitter the aim direction of the bullets. That seems like it wouldn't be too complicated, it's just whether it's worth the effort. Are there other weapons that might need the bullets jittered? Did we suggest a chain gun?

As for the fire, I can try to fix the graphical side of that, but I get the impression we have different ideas of how it should work. I'll make a new issue for it.

Fyll commented 8 years ago

As it turned out, the problem about the Bullets starting too far away from you wasn't really a problem at all. It's pretty much fixed now.

Drag on Bullets should be quite easy, it'd only need me to make the Bullets' hitboxes be created uniquely for each of them, rather than just all copying a constant templates. This'd also probably be a good idea for allowing differently sized bullets.

As for jittering, I can see that, although the code would be rather against it at the moment (but we'll have to see how the new code turns out). The trouble is that, as you say, I don't know of many guns that would want sprays... How would a chain gun fit into puzzle solving though? Is there more than one use for a chain gun? We've already got the Cannon as a standard shoot things gun. Actually, thinking about it, I'm pretty sure the chain gun came up as a pickup or upgrade suggestion. Upgrades obviously don't really fit into the game at the moment, but it could work as a pickup with no clear purpose, like the speed change ones.

DivFord commented 8 years ago

Even with the weapons we have at the moment, flicking through them is a bit irritating. Maybe it would be worth looking into upgrades as a way to add functionality to existing weapons rather than just adding new ones. It would mean we could reduce the amount of weapon-switching required, but avoid overwhelming people with all the abilities from the beginning.

I'm not convinced it should be a pickup though… Making tool pickups cuts into the number of tools we have available as rewards for completing zones.

I see your point on the jittering though. Let's see what we can do for the flamethrower using existing code before we do anything drastic.

Fyll commented 8 years ago

The trouble is, what if you want to use the cannon rather than the chain gun? The chain gun seems like it might be a bit chaotic, where the cannon allows control. Maybe if a gun menu was available? Then pressing space would bring it up and you could use the mouse to select one, or something like that. Considering that, by the end of the game, we expect them to have ~12 or so guns (3 per zone, 4 zones? I can't remember), that does seem like a lot of guns to flick through one at a time.

I admit that tool pickups may not necessarily be the best idea, but I think a couple of things (like things that make the gun stronger, faster, better, or harder), would work fine. That way, as they aren't necessary to solve any puzzles the base weapon couldn't they'd just be fun extras. I do feel that, as a Player, given the choice between a chain gun and something else, I'd go for the something else, as it's something new.

I had a (bad) idea for the fire: do you think it'd be nice to have it essentially be a flamethrower? Bullets are already animated, and they'd be able to ignite things they touch. My main concern is the speed with regards to collisions, as it'd probably slow things down a fair bit (unless the fire only generates a few bullets).

DivFord commented 8 years ago

We did talk about binding tools to number keys, though that requires people to remember which is which. If your gun menu is doable, it sounds like it might work quite well. Alternatively, we could do what I thought you meant which is to have various tool "slots" or "categories" and a menu to pick which tool to put in each. You'd swap the cannon for the chain gun in the menu, but still use the current controls to switch between the cannon/chain gun and the ice wand. Not sure this is a particularly good take on it, but I thought I'd throw it out there.

Not that we can't have pickups which interact with puzzles. It might be fun to add extra functionality to a tool for a level.

With all respect, I think that probably is - as you say - a bad idea. Just having enough non-interactive particles to make the fire look fiery is putting a strain on the system. I dread to think what would happen if they all worked as bullets...

Fyll commented 8 years ago

Was this not supposed to be a mouse and arrow game? As in, aim/shoot/change weapons with the mouse, move with the keyboard. Using space to change weapons was only added later as a more convenient method for people without a mouse. Unless you mean scrolling through guns is awkward, which would surprise me (although I am currently mouseless).

The question I have is then, isn't this supposed to be something of a fast(ish) game? Pausing the game to rearrange guns would be rather flow breaking I'd imagine. Also, if we had few enough slots that it'd be easy to flick through them, you'd probably have to rearrange them quite regularly later in game, and if there are enough slots to avoid that, then we're pretty much back where we started.

I realise I may have been a bit vague. I didn't mean that all Pickups must not interact with the puzzles, but rather the opposite: that some pickups not interacting with the levels would be acceptable (and that the gun "upgrades" would fall into this category).

Fair enough. Processing power aside, I think it'd be quite nice. Unfortunately, processing power is probably our most precious commodity at the moment.

DivFord commented 8 years ago

I think we've always framed it as a puzzle game, so it needn't necessarily be fast-paced. Admittedly, it doesn't play that way at the moment, but I think that's just down to a few variables. Mainly the speed at which the lizard moves.

I do mean that scrolling through is awkward. Yes, it's faster than the space bar, and you can go back when you overshoot, but you still have to stop long enough to work out which gun you've switched to. It's tolerable at the moment, but we're going to have more guns, and, more importantly, the player's going to have different guns each time. That means the order isn't fixed, so they're unlikely to learn the list each time. Hence my enthusiasm for the gun menu. I'm not so attached to the slots idea.

As an alternative, could we borrow the system from Zelda? That is: use the menu to assign tools to buttons, then use the buttons to switch the active tool. It seems to work for them, and, assuming each room uses a small selection of tools repeatedly, rather than using lots of tools once each, you could expect to go into the menu once or twice per room. I think that's reasonable...

Fyll commented 8 years ago

Huh. I wonder where I got the idea that it was supposed to be fast from then....

While you couldn't learn the absolute order, you would slowly build up to the collection of guns you end up with, so would learn it as you go. As for scrolling, what if the gun icons appeared immediately, but then faded out? That way you'd be able to see what gun you're on straight away. I've been picturing it like I saw in a game (I can't remember what though) a fair while ago, where there were 5 squares in the bottom left corner: one in the corner (the current gun), one above that (the next gun), and one above that that's half faded out (the next next gun), plus one to the right of the current gun (the previous gun), and one to the right of that (the previous x2 gun) which is also half faded out. Then this would wheel around as you scrolled.

As for a menu, maybe just have it tucked away at the top or side of the screen, then you can just go and click on the gun. It keeps with the mouse+keys style.

Does Zelda do that? Oh yeah... Wow it's been a while since I've played one of them (not counting Skyward Sword). I feel that they've got rather a different setup to us though. They need a few things occasionally, rather than several things quite a lot.

DivFord commented 8 years ago

The wheel thing sounds nice. Means re-doing the art, but if it's mainly copy and paste I don't mind.

It does sound like the requirements for the interface are going to depend on how the game plays. Maybe we should try to get some playable levels in then revisit this.

Fyll commented 8 years ago

As long as all of the guns are visually distinct, the picture alone would probably suffice, and you've already got those.

Fyll commented 8 years ago

Actually, with regards to animated bullet collisions, that's currently essentially already a thing (Objects can animate before death of a certain type + Bullets are Objects => Bullets can animate when they collide with something). You can try doing it yourself if you want to, but I'd be fine to do it while rewriting all of this stuff if need be (it really would be quite minimal).

So yeah, feel free to start drawing things.

DivFord commented 8 years ago

Sweet.

I already drew a new cannon bullet. I'll push it at some point. Unless I'm very much mistaken, none of our other weapons are actually going to be using bullets when you finish this overhaul, so I'll hold off on them until we know how the fans work out.

Fyll commented 8 years ago

Well, weren't you vying for Flamethrowers to use Bullets?

DivFord commented 8 years ago

Good point. If we're doing the drag thing, is it possible to base the animation on time elapsed or current velocity? I think you pointed out that one of the examples I linked to was using the fire projectiles as smoke near the end of their lifetimes, which seems like a smart approach.

Fyll commented 8 years ago

Hmm...

The animations aren't really "based" on anything. They're more just triggered. In theory, I'd probably handle this by just triggering the animation as soon as they get created, and have its duration be equal to the life of the bullet (a bit hacky, but it'd fit nicely in with everything else).

Fyll commented 8 years ago

Okay. Bullets/Guns are mostly rewritten now. Beams are also now in.

I mainly wanted to push before Christmas came around and I forget what all of the code means....

I'll need to know how the animations will look before the numbers can be coded in, but the code does exist now (it's commented out in Bullet.hpp).

DivFord commented 8 years ago

I like it!

I tried replacing the ice-wand bullet with a blue square, and that works fairly well. Feel free to take a flood-fill tool to the textures and see what you think.

My one complaint would be that the beam extends comically slowly. Is there any way to change that? My instinct would be to make it near-instantaneous.

Fyll commented 8 years ago

There's a speed parameter in BulletData (the beam part), so feel free to adjust that to your liking. I left it slow for now because I wanted to show off that it could go slowly (also because I was too lazy to try finding sensible values...). There's also width and maxLen if you want to fiddle with those either.

I'm considering adding a bit of code to say that, if the speed is 0.0f, extend as far as you can, immediately. At the moment, an incredibly high speed (~1.0f) may cause a few collision oddities, so it'd be nice to have a way around that.

EDIT: Okay, done and pushed this now. I decided that using 0.0f was just dodgy, and fixed up the code so that you no longer shoot through things, then backtrace. Consequently, if you put in 0.0f, it will treat it as 0.0f. If you want it to be instantaneous, just make the speed greater than or equal to the max length.

Fyll commented 8 years ago

I know you said to wait until we had some content, but I was bored so gave it a shot anyway. I've made a first attempt at the gun-wheel thing I suggested back up a ways, and it looks pretty good to me (still bugged that I can't remember where I stole the idea from). Obviously, the current sprites are just a placeholder because I was feeling too lazy to even go and look in the sprite folder for a better alternative, but the gist is what matters here I feel.

Opinions? Keep, bin, change to be more like an inventory?