rickbatka / co-op-engine

A prototype engine for our planned co-op game. This is where we will make it work, make it network, and make it feel fun. No AI, level design, etc.
2 stars 0 forks source link

Destroyable object #11

Closed reddenx closed 10 years ago

reddenx commented 10 years ago

Mainly the method of disposing objects from the world:

EDITS: changed reqs to more match this objective and exclude other issues

rickbatka commented 10 years ago

Random idea, take with grain of salt: should the pathfinding cost be calculated? We know the cost of destroying the wall, something like (HP * defense rating). We could come up with a weighted algorithm that heavily favors open squares, then uses the computed cost of destroying to calculate cost.

Probably way overengineered now that I type I out, but fun to think about.

reddenx commented 10 years ago

I figured we could break it down to time spent. From the enemy's attack stat we can determine how much time it would take to break down the wall. For normal empty areas we calculate the time it would take to move from one to the other. We could even add some weight to squares that are within reach of towers so they intelligently avoid the defenses.

EDIT: when we close this, lets move this conversation to pathfinding

reddenx commented 10 years ago

Idea gathered from previous project: A weapon contains a list of effects to be applied on attack. These can contain things like, damage health, damage energy, apply burning, apply bleeding, root etc. Each other game object has a list of current effects which are acting on that object. The effect object can either be instant apply, or have a time it lingers on the object. For certain effects like root or slow the object would have an apply and clear method that changes the stats of the game object (or adds things to a mod stat set we haven't created yet) Hmmm maybe even instant apply effects have a life, so when hit they aren't hit again by the same swing of a weapon (similar to what you are doing now just in a different more general structure)

rickbatka commented 10 years ago

notes: WeaponEffect: (or DamageEffect? CombatEffect?)


This is done. Weapons have lists of effects they apply on their targets. The target's Combat Component is responsible for calling Apply, Update, and Clear on the effects (or maybe ignoring them if they resist, etc).

rickbatka commented 10 years ago

This is done (with some slight caveats): I'm not deleting from the world. Instead, objects have Dying and Dead states & animations. We can delete dead objects after a period of time if we feel like we want to in the future.

Also, you never set an object to state Dead. You set them to Dying and let the components (combat component in this case) move them to the next state after the dying animation is over.

Need to get towers & enemies to have their own state property sets, because as we discussed, players will still be able to play when dead - running back to the respawner, etc.

Next steps:

rickbatka commented 10 years ago

(closing this out. if we really do decide we want separate state machines for towers and enemies, it can go in the state machine issue anyway.)