Tuesday, March 11, 2014

The following is the changelog for the AI scripts that I've spent the quarter working on.

3:35 PM 1/15/2014

I have absolutely no idea why it never occurred to me to update and record revisions like this until now.


v1.0

Added:


AI searches for targets. Upon hitting a wall, it will adjust direction left or right depending on which is
closer to target.


-Attack rate. Small timer that allows adjustment to how fast the enemy can attack.

- Enemies now stop if they're about to walk off a cliff. If they're making sharp turns around a corner, they
might still blunder over a ledge, though; not much I can do about that at the moment with this particular method.



v1.1

Added:

Enemies now update targets again; they'll (presumably) stop if target lost (or killed), and will change targets if attacked.

Hopper code begun.

Hopper stops when inside attack range, and turns to face target. Hopper pauses outside of range, then lunges at target.

Enemies now correctly shoot projectiles. (Eugine)

Enemies now correctly use ramps. Going up ramps is slow due to current physics, but enemies will go down them if their target
is on the ground and below them.



v1.2


????


v1.3

- Hopper attacks now wait for attack animations to quit playing before moving to next state/etc.

- Hopper now has the intended behavior for which it was designed: It approaches players, leaps in, attacks, and leaps outward.


- Juggernaut functionality in. Currently broken because turning off personal gravity makes every OnGround check return true. When Eugene fixes that, this will work fine.

- Wisp functionally implimented, waiting on ability to detonate when hit.

- Code structuring partially implimented




v1.4

- Bot objects updated for rigid bodies (by Eugene)

- Juggernaut now correctly falls [Eugene fixed personal gravity bug.]

- Juggernaut's stomp/slam ability implimented and functional, but currently does not wait for animation to finish.

- Enemies now have differing sizes and textures. These textures are literally me just throwing existing textures on top of them because I don't know how to make new ones from scratch yet. But it's enough for visual distinction between enemies, especially considering that the resizes and textures exist to show differentiation between enemies until we get the actual enemies in the game anyway.




11:34 AM 2/10/2014

v1.5:


- Bots no longer stare into the void when they find a cliff, again. Reducing the amount the moveDir is reduced by fixed this; this implies the cutoff Eugine implimented to get an enemy to stop using their movement animation when their moveDir is really small actually physically makes their movement zero, rather than simply using the idle animation.


- Bot scripts now extend from main AI script. Main AI script houses standard AI functions - movement, obstacle and pit detection, and so on - while the scripts for individual enemies now exclusively handle their individual behaviors.


- The basic low-level enemy is now BasicEnemy. TestEnemy still exists and has not been removed to avoid it breaking some levels, but be advised that it won't use updated movement/AI code.




3:03 PM 2/11/2014
v1.6:

- bots now use materials again for visual distinction.


- Found bug where bots will walk off cliffs sometimes because their Y coord is juuuust slightly different from their target's. This is because receiving knockback pops them up in the air, and when they land their y coord is slightly different. Fixed this by adding a threshold - Enemies will now only ignore collision in front of them and the absence of ground below them if their target is half a meter above or below their position.


- Bots now face their targets independantly of the direction in which they're moving, (the aiming code is in CHR_PHY, and the actual line is AimAt(GameObject);) This is a large first step for more advanced movements. Next step is looking into switching around between local and global positions and movement. Actually getting them to /stop/ facing something is unknown; maybe just send it a null?


- Because of the new facing code, EndMove can be called to nuke moveDir without locking its rotation, meaning we don't have to divide moveDir by a rediculous number to get it to stay in place, which in turn means the visual issue of enemies moving in place no longer exists.


- Bug found where enemies would seemingly randomly stop moving, permanently. Bug was in bFaceTarget incorrectly turning itself off; bug fixed.


- Juggernaut now makes sure target is on ground before jumping at they ass.

- Snatcher functional. Movement is slightly wonky and needs refinement; jumps towards, and if it misses, it hops straight up, then loops. When it collides with a player, it'll start syphoning EXP from whoever it's attached to. This exp goes into a pool, and whoever kills the snatcher gets its base exp plus all the exp it syphoned.

- Basic ranged enemy fixed, and now attacks at range like it's supposed to.

- Sandra will shoot her boomerang, but the boomerang goes flying over the target and does not return. Also too fast.

- Wisp uses damage radius, and no longer does stupidly absurd amounts of knockback.(Seriously, how'd it get put to 70? O_o)

- Juggernaut's knockback now knocks slightly less upward.





5:08 PM 3/4/2014
v1.7

- Enemies now have a tentative wandering thing. If idle, and without a target, they'll move in a random direction for a random duration every so often. Bug found in that discovering a pit will have them stuck and staring at it. Rotating the enemy them to the direction in question fixed this. Will sometimes wander off cliffs; not entirely sure why as of yet.


- various AI tweaks regarding attack speed, damage, knockback, etc.


- Kinematic to false for ragdolling. Animations need to not play to work. Ragdoll wizard sets up colliders; remove them. No gravity.
The following is the changelog for the scripts and objects I built for level construction. I made them with the intention of exposing as much needed behavior and abilities for the level designers without them ever having to touch a line of code.


5:40 PM 1/21/2014

James Ensley



Added:


- Retooled pressure plates so you could throw an object at them in unity, rather than have to monitor
their progress in the level script. You can now do either. This is intended to ease level design, and make
things a lot more plug-n'-play. Currently the only thing this modifies is movers.

- Added movers. Movers require a target, and this target can be anything. When the timer runs up, it'll start
moving towards the target at the speed you set. "stuttering" is for a visual affordance to players that the object
is about to move.

I'm calling them "movers" rather than just "wall movers" as originally intended, because they can be used in any direction.
Note that if it's too fast, or moves too far (hence stutterMaxDist) it /will/ clip right through players and enemies,
and there's not much I can do about that.



To use pressure plates, just make a primative (or, later, do this with a mesh), throw the Pressure Plate script
at it, then make sure "Is Trigger" is checked in the Box Collider component. Movers

Anything with bActive == false does not activate or do anything until it bActive == true. Pressure plates are
currently the only way to activate an object with bActive set to false, though you could also do so in level
scripts.



5:48 PM 1/23/2014


- Renamed "pressure plates" to "triggers", to reflect that their functionality is for internal level development. You can still use them
as pressure plates, of course.

- Triggers now can trip only once, if needed.

- Made "Spawn switcher"s. Throw your player spawns into it in the order you want them to be used, and have triggers target it. Each time a
trigger activates it, it sends the next player spawn in the list to the scene manager. Need to have the triggers only hit once!




6:04 PM 1/25/2014


- Added tool for throwing text on screen. Use triggers to change from one line to the next. Extremely basic, just for quick playtesting.

- If triggers have a sound attached to them, they play when triggered.





7:19 PM 1/28/2014 v 1.2

- TextToScreen tool now has nearly every variable inside it exposed, so you can put it wherever the hell you want.


- Triggers now /should/ have weight limits (untested). If weightLimit is set to anything above zero, the combined charMass of everything touching it needs to be equal to or above weightLimit to trigger it.




4:08 PM 1/29/2014 v1.3


- Movers now truncate position and stop on the aimtarget they're aiming towards, and then deactivate.

- Movers can have one impulse to trigger or many; once activated, they ignore further impulses until they reach their next waypoint, at which point they snap to it and deactivate. Another impulse at that point will turn them back on, and they'll move to their next waypoint. For this reason I'd highly recommend any trigger that triggers them be one use ONLY if you are absolutely certain it'll be at a complete stop when triggered - otherwise the level might be broken and they'd have no way to get the mover moving again.

- Movers now support multiple targets, and effectively have a wapoint system. But it's a little wonky - you have to tell it how many targets you're using twice: one or the actual array, and one for the script because I have no way of getting the actual number in the array. 

- Movers can now cycle between different waypoints. Does not return to start position though


- Portals now implimented. Anything touching it is sent to whatever target gameobject you give it. If you want a two-way portal system, rather than a one-way teleport, set the target to another Portal instance and check bEndPortal. bEndPortal needs to be checked because it will send information regarding what is being moved to it so it doesn't immediately teleport the object back to the first portal.


- "Pain volumes" implimented. Pain volumes are configurable objects that can deal pulsing damage based on a timer to anything colliding with them. For lava or otherwise insta-gib, decrease the timer to zero and increase the damage to something absurd.

Pain volumes have a damage duration timer, meaning you can have a timer until it damages, and a second timer that controls how long the window is open for something to be damaged. Whenever something is damaged by a pain volume, it's added to a list, and anything inside this list will not further be damaged by the pain volume. The end of the duration timer resets this list.

A third timer is the offset timer. This is a delay before the main damage loop starts, and is intended so that you can have many instances of this volume - as a gyser, for example - and have them all going off at different times, but at the same loop speed.




4:04 PM 2/9/2014

v1.4:

- Changed "activateMe" to "Activate", because it'd be easier to change the tools on my end than figure out what would break on Eugene's.

- Triggers now can be player-activated only. Because it's annoying to have bots offscreen change your spawn points.

- Triggers now support having multiple targets.





5:28 PM 2/11/2014

v1.5


- Movers can now deactivate at each stop, or cycle through them. (bConstantMove = true)

- Movers can now go through a complete cycle before stopping. (bDeactivateAtEnd = false)


- Rather than going through the trouble of setting up movers to use as resetable falling platforms, I just made a simple falling platform script. You just throw in the distance you want it to fall, and when triggered, it stutters, then falls. It comes back on its own, though you can configure it not to (bNoReturn).





11:02 AM 2/16/2014
v1.6

- Movers no longer move when game is paused.

- Movers can push characters away. (Eugene)

- Movers optimized slightly in that you don't have to set the number of targets twice. Most things no use this method, and can have multiple targets.

- Timer implimented. This is mostly intended to be used to help in offsetting things - such as having enemy spawners be able to spawn at different times - but can also be used to delay anything from being activated.

- Counter implimented. This records every Activate impulse sent to it, and once that reaches a customizable number, it activates another target. This is generally how you'd handle levels where you're required to kill x number of enemies; the spawners would send an Activate impulse to this once their spawns were all killed, and once those were handled, this would Activate an EndRoom object. MAKE SURE ANYTHING THAT SENDS TO THIS ONLY TRIGGERS ONCE.

- EndRoom implimented. Level devs now have a way to directly move from one room to the next by simply sending an Activate impulse to it. I named it EndRoom rather than EndLevel because "level" is a word that has multiple meanings in this game (it's referred to both as the play area and the thing you need to accuire to win the game) and I wanna reduce confusion.


- Destructable objects in. This is very much a hacked-together thing, and unlike everything else, isn't just a script you can throw on an object to make it work. Destructable objects are literally handled as an enemy, and have to be set up as such, then with this script on top of it.

I took the liberty of making them shake when hit, as a visual affordance that attacking it does something.



9:48 AM 2/17/2014
v1.7

- "Splitter". Nodule that when an enemy passes through it, it differentiates what player hit it last, and sends an Activate impulse to the target in that slot. In other words, it activates different things based on which player hit the enemies that pass through it.

- Counter script now has the option to have a visual component. Throw textures at it, and it'll start with the first texture. (Will overwrite normal textures on it.) Every texture past that will be changed to each time the counter is triggered.


- Stutter effect now repeatable for movers. Once they hit the end of the line, if they loop, they'll turn stutter back on again.


- Chest script done. Needs two box colliders - one set to be a trigger, and one without. One will block the player, the triggering one will record when and by who it gets hit. When a player smacks it three times, it'll pop up a little "+XP" thing, give the player who hit it XP, and despawn. Uses ItemXP instead of GiveXP, specifically because GiveXP gives 25% of that exp to everyone else.

The chest you want to use is GrindChest. The other chest object is being retarded and I'm stuck in a situation where I can't do anything to it, so I made a prefab of it, but the new prefab uses the meshes in the old one, so not sure what to do here.


- Destructable wall fixed to not need other scripts to work; Eugene's iteration not needed.

- Death trigger. When it takes damage, it sends an activate pulse to everything in its list. Useful for levels with obstacles and lava; when the lava rises, it could take out this object, which could move to another spawn, so players won't use the previous one that would drop them in the now-higher lava.

- Falling platforms. Are a simplified mover, and just fall straight down by a configurable amount when triggered.

- Music box. Drop a song in it and it'll play that song when the level loads. Basic for now.


- temporary "popup" scripts. Literally just for showing when something is receiving bonus exp or losing it in a non-conventional manner (read: Snatcher syphoning it.)


11:56 AM 3/7/2014
v1.8

Triggers and most objects capable of sending an activate impulse now have visual representations in-editor; they draw green lines to the things they're connected to.