Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

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

April 24, 2024, 02:48:45 PM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsCommunityDevLogsGearend - 2D Metroidvania *Old Thread*
Pages: 1 2 3 [4] 5 6
Print
Author Topic: Gearend - 2D Metroidvania *Old Thread*  (Read 26223 times)
marvinhawkins
Level 1
*


I love lamp


View Profile WWW
« Reply #60 on: June 16, 2014, 06:32:26 PM »

This is looking nice. Adding this to my follow list.
Logged

SolarLune
Level 10
*****


It's been eons


View Profile WWW
« Reply #61 on: June 17, 2014, 12:39:27 AM »

Thanks, man.

I started refactoring more of my code today, but it was more work than it was worth, I think. I ended up undoing the changes and going back to the previous code, haha.

I tweaked my palette a bit to get some better colors and re-animated the NPC that will stand in as the kind of overseer of the area.



New overseer's on the left.
Logged

jeffgmelton
Level 0
**



View Profile WWW
« Reply #62 on: June 20, 2014, 05:51:55 PM »

This looks great, love the art style!
Logged

SolarLune
Level 10
*****


It's been eons


View Profile WWW
« Reply #63 on: June 26, 2014, 12:59:59 AM »

Thanks!

I am currently refactoring the game's core code. Instead of using functions for everything, I've started to use classes and instances. This was mainly to have code completion through PyCharm, but it also is very, very useful as it allows me to fully exploit inheritance between objects and sharing code. For example, both "advanced" NPCs and the player can share code, and they can also share functions (gravity handling, jumping, or dying, for example). It's a lot cleaner than the past way my code worked (in which the "class" instance was stored in a variable, and then the class's methods were called through that variable, like "obj['character'].HandleGravity()").

I am ALSO refactoring the enemies' code. There are only two enemies currently, but they used to run functions, and each basically had their own code bases (even though they did a lot of the same things). To solve this, I decided to implement a system called Behaviors.

Basically, each instance of the Character class (including enemies) can have one or more Behaviors running on it at any given time. These Behaviors could range from things like following the target to escaping from it, shooting at a target, dodging attacks, blocking, and so on. This allows for basically the maximum amount of code re-use between enemies (as the enemies will look different, but perform the same in the code).

All I have to do to set up new enemies is to define their unique properties (how much health they have, how much Scrap they drop when defeated, how much attack power they have, etc), define any new Behaviors if I need to, and add them to the character. This should make it a ton easier to define new enemies as well as new behaviors, as well as troubleshoot when problems arise.

Each Behavior is an instance of a class. This allows me to have tweakable variables that are easy to edit. For example:


self.add_behavior(self.Behaviors.Follow(min_dist = 5, max_dist = 10, max_spd = 10))


... Adds a new following behavior that makes the following character stay at a distance of between 5 and 10 units away and have a maximum move speed of 10 units a second. There's also other variables in there that have default values I didn't tweak. The handle_behaviors() function in the character's class handles carrying out these behaviors. I can also remove behaviors later if I need to.

I recently thought of having a weight value for behaviors, as well, to influence either which ones take precedent over others, the chance that the behavior is executed, or the degree to which the behaviors happen. I haven't decided exactly, but I think it could be useful to add in (for example, weighting Escape more than Follow could make a more skittish enemy that runs away from you a lot more than follows you around?). It feels like if executed correctly, this could kind of be pretty organic...

I've also come up with the idea of Random and Sequence Behaviors. These should be useful for unpredictable and bosses respectively. A Random Behavior will execute one of a set of behaviors randomly (i.e. choose between escaping, shooting, and blocking). A Sequence Behavior will execute a series of Behaviors in a row, like a boss would (i.e. shoot, shoot, wait, follow, jump, wait, and repeat).

One thing I've yet to approach are enemies that physically behave like the player, with parts that can be equipped, for example. It's definitely something to consider.

I think I'm getting / have some cool ideas for gameplay mechanics - the combat might even be a bit out of the ordinary... Shocked
« Last Edit: June 26, 2014, 01:07:49 AM by SolarLune » Logged

dancing_dead
Level 2
**


View Profile
« Reply #64 on: June 26, 2014, 01:23:29 AM »


(..)
I've also come up with the idea of Random and Sequence Behaviors. These should be useful for unpredictable and bosses respectively. A Random Behavior will execute one of a set of behaviors randomly (i.e. choose between escaping, shooting, and blocking). A Sequence Behavior will execute a series of Behaviors in a row, like a boss would (i.e. shoot, shoot, wait, follow, jump, wait, and repeat).

I can't quite catch from your descriptions, if you're familiar with Behavior Trees or not, but, if not, really give them a read, your Behavior concept, sequence and random behaviors are very close to behavior tree standard kit, and behavior trees are very easy and even fun to use! given a good collection of behavior nodes, you can construct new, complex behaviors so easy you won't believe yourself it's happening Well, hello there!

a good starting point is this presentation (you'll have to register on the site, if you haven't, but that's it) + source for the presentation. it's in c++, but the examples are simple, so it shouldn't be too hard to translate into python.

sorry, if you're already familiar with them, I just really, really like them.
Logged
SolarLune
Level 10
*****


It's been eons


View Profile WWW
« Reply #65 on: July 02, 2014, 12:32:51 AM »

Spent the last few days refactoring the enemy AI. I'm pretty much done, which is awesome.

I think I ended up taking a bit of your advice, dancing, and expanded the behavior system to include BehaviorTrees. A BehaviorTree is just basically a list of behaviors that can be added to or removed from. You can also toggle behaviors that have been added and get Behaviors that have been already added to the tree under a certain branch, so you can make some complex AI out of those behaviors by turning on or off behaviors as necessary.

For example, you can set up a "rush" behavior that will have enemies rush the player, shooting and attacking with everything they've got, but when they see the player's shooting, then they pull back and toggle on a "defend" behavior to block attacks.

This behavior execution is also available on all CCharacter instances, so even the Player can execute Behaviors. This would be very useful in a co-op situation in which the Player's AI could easily take over if the Player leaves the game, and Follow around the remaining player, shooting at enemies and dodging attacks and stuff. It could also work against the player, as if you're controlling an unwilling robot as it does its own thing.

Although, dancing's suggestion seems to be a lot more effective and sounds really cool for more complex AI (if I understand behavior trees from other sources; I didn't really feel like signing up to read up on that particular site). I apologize if I misunderstand or if I'm not fully grasping the abilites that behavior trees can afford.

While it would be nice to have cool advanced behavior systems, for my purposes, I don't think I'll be needing entire Behavior systems. Most enemies will be single-minded in their strategies, and bosses will probably choose from a selection of behaviors or perform a sequence of behaviors.

Anyway, I also refactored the weapon system a bit to make it easier to use and understand (for myself, of course). The weapons are instances of a weapon class that stores weapon-related variables (how much attack power the weapon has, how quickly the weapon fires, etc).

I've also come up with a few more parts (haven't implemented any more yet, though). I think one of them will be fists that enable combos and charge solar energy while attacking. I have to iron out exactly how all of the weapons and parts will work, though - some parts will be passive in terms of their abilities (i.e. freeze time when you take a lethal hit), while others seem like they'd be best suited to have an active ability. However, I don't think I want to have additional ability buttons if I can avoid it - there's already a few buttons I'm using. This means that the abilities would have to be intuitive to the mechanic of the part - for example, if I have double jump feet, then you would just press jump in the air, and not the "foot ability" button. That limits the customization a bit, but I think it would make the game a lot easier to play.

I added a Collision() Behavior that allows me to make characters bounce on colliding with specific types of terrain, or do other things on collision, which is cool. Behaviors are kind of like Components, but they themselves don't do anything. I feel like this might be a weakness in my code, as if the Behavior handled the actual execution, then I'd be able to test a Behavior to see if it executed correctly (useful for some Behaviors, like the Collision one), which would help to make those more complex Behavior Trees. I could test Behaviors anyway, but it wouldn't be as clean. But I don't really need it, so it doesn't really matter. I'll make a video showing my code base soon - I know some people are interested over on my YT channel.

I also added sprites flashing red for characters whose health drops low enough. Because both enemies and the player inherit from the base CCharacter class, they both display this effect, which is cool.

I tweaked the Bladed Sentry to become way more aggressive when it turns critical, which makes it an interesting enemy that's not entirely predictable. On second thought, maybe I'll make it so that it speeds up after it's been attacked - that would be a more dangerous enemy, for sure.

I want to create new enemies, weapons, and areas (or at least spruce up the areas I've got already) soon, which should be a lot of fun.

Anyway, here's a GIF.

« Last Edit: July 02, 2014, 12:38:37 AM by SolarLune » Logged

aberrantmike
Level 0
**



View Profile WWW
« Reply #66 on: July 02, 2014, 03:26:00 PM »

faalow
Logged
_metamythical
Level 0
**



View Profile WWW
« Reply #67 on: July 02, 2014, 04:59:20 PM »

Excellent!
Logged

ucupumar
Level 0
**


View Profile
« Reply #68 on: July 02, 2014, 08:38:16 PM »

It's amazing how can you do with Blender Game Engine. Hand Thumbs Up Left Hand Thumbs Up Right

In your last devlog video, sometimes there's black bar show up between objects. I've been using BGE too, from my experience, effects on different camera can cause late response to the scene, does it bug relate on this BGE behavior?

And one more question, how do create particle on BGE? Do you hardcode emit particle on your python script/logic brick?

Anyway, nice game, I hope it will be completed soon.
Logged

SolarLune
Level 10
*****


It's been eons


View Profile WWW
« Reply #69 on: July 04, 2014, 02:07:23 PM »

Thanks, you guys.

@ucupumar - Oh, hi, haha. Wouldn't expect to find another BGE user here. If I know what you're talking about, those black lines are just slight margins between tiles. I believe other engines also have a similar problem. I need to add some padding (or scale down the UV map a bit at close distances) to get rid of it, but that can wait until later.

My particles are just hardcoded, yeah. Each particle runs a little script to move around and animate.

I made a video talking about how I do my GUI a bit (nothing that you guys probably wouldn't know about).
Logged

SolarLune
Level 10
*****


It's been eons


View Profile WWW
« Reply #70 on: July 07, 2014, 07:03:11 AM »

Refactored my weapons code considerably, moving the weapon shooting code from the player to the weapon classes themselves. I added a Bipedal class for characters like you (that can equip two weapons) and gave each such character their own copies of the equippable weapons (so that they can wield weapons too). Haven't made any Bipedal characters yet other than the player robot, but laying the ground-work's important, too.

I also added rockets and rocket jumping. Not sure if I want to keep rocket jumping in there as a solution to puzzles, but I like the mechanic. Smiley



Logged

dek
Level 1
*



View Profile
« Reply #71 on: July 07, 2014, 07:10:17 AM »

Splosions are looking good! And rocket jumping sounds fun.
Logged

wzl
Level 1
*



View Profile WWW
« Reply #72 on: July 07, 2014, 10:01:33 AM »

Very pretty and some nice ideas! Followed  Well, hello there!
Logged

Long pork is people! wzl's burrow
SolarLune
Level 10
*****


It's been eons


View Profile WWW
« Reply #73 on: July 10, 2014, 08:15:14 AM »

Hey, thanks.

Here's some devlog vids!






Logged

1mafx
Level 0
**


View Profile WWW
« Reply #74 on: July 10, 2014, 01:48:44 PM »

Cool ! I like devlog videos... following
Logged

SolarLune
Level 10
*****


It's been eons


View Profile WWW
« Reply #75 on: July 16, 2014, 12:33:37 AM »

^ Thanks!

I've done quite a bit in the past few days. I was thinking about crowd-sourcing this, but I think I'm going to bypass that and just try to finish the game. I also want it to be a bit short (so that I can finish it). I'm probably going to cut a lot of the ideas I had (like upgrades and optional missions). However, the game should still be Metroidvania like, with hidden areas and cool items to use.

Anyway, I've started on another area - a nautical research facility.



The background still needs some work, but I think it's coming along okay so far. I've also got the player bobbing around in the water (a bit unrealiably at the moment, though, haha). Need to refine it, but it's coming along.
Logged

BomberTREE
Level 9
****



View Profile
« Reply #76 on: July 17, 2014, 11:17:16 AM »

Good to know you're cutting for success, have fun man! Keep it up  Hand Thumbs Up Right
Logged
Farage
Guest
« Reply #77 on: July 17, 2014, 08:49:08 PM »

The game is beautiful and the style is great.
I'm a little against pixel rotation without interpolation, but its all cool when it comes to a game like that.
Also, i didn't know you could make games directly on Blender, this blew my mind.
Logged
lai-studioguts
Level 0
***


Hello. Kobo would like to be your friend.


View Profile WWW
« Reply #78 on: July 22, 2014, 12:37:36 AM »

<3 METROIDVANIAAAAAAAAAS
Logged

karlozalb
Level 5
*****


Do or do not.There is no try.


View Profile
« Reply #79 on: July 22, 2014, 01:11:01 AM »

I like the visual style, that dark style and lighting setting looks cool Smiley

BTW great missile impulse :D
Logged
Pages: 1 2 3 [4] 5 6
Print
Jump to:  

Theme orange-lt created by panic