Thursday, September 14, 2017

Update 50: Combat and 50!!

5 years and 50 posts later, here we are, still working through the combat mechanics. Amazingly, I'm still making regular progress. I think the keyword here is regular, there have definitely been some large gaps in progress.

However, the combat is proceeding along nicely. I've added projectiles and the destructive terrain back. I've added back the shoulder cam when you are aiming and choosing your target. The enemy and player are now dealing (and receiving) damage. I almost have a quasi game here. 

Here you can see the setup of the level, with the second (shoulder) camera ready



The view from the shoulder cam. The models really look low res here!

Boom!


 Before the shot...

"Missed", that is the end of that wall!


Here you can see the ray-cast passing through the enemy, it was a hit!


Next on the list is basic AI, it's time for the enemy to respond to your actions and try to defeat you. 

Thursday, August 31, 2017

Update 49: Added weapons to the characters

I have now added weapons to the characters. The Simple Military pack has a variety of weapons, but at this stage, I've assigned a 'modern assault rifle' for the 'good guys', and a AK47 for the 'bad guys'.




I also added a muzzle flash when the gun shoots (it shows for just a fraction of a second).




Next I will add projectiles and add back in the destructive environment that I started with, all those years ago.

Sunday, August 27, 2017

Update 48: Implementing the turn state diagrams

Next I've been working on implementing more of the game, which is a big departure of most of my posts, where I've been working on game mechanics, usually in isolation. I'm calling this the "player state diagram". You can see this represented in a state diagram below. Also encased in the diagram is a road map of the features I've implemented and what I plan to implement next.




When a player has finished all of their moves, it switches to the enemy turn, where the (overly simplified AI) decides to just pass ("Patrol"), and switch back to the player. Since the player still can't attack, I think this is fair. 

Next we need to add AI to the player to move into cover and shooting between the two teams...

Tuesday, August 22, 2017

Update 47: Cover and Flanking

In my last update I showed a screenshot with a soldier in cover. In this latest update, I've added an enemy and added the code that marks the players as in cover or being flanked/out of cover.

Here my player is in cover (the enemy has a lower chance of hitting the player and dealing damage):




Here my player is flanked and not in cover (the enemy has a much higher chance of hitting the player and dealing critical damage):


There was actually quite a lot of rework involved in the code and corresponding systems to get the enemy soldier to (re-)appear and have everything work. The next update will be even more involved as I refactor the code into more systems and add more players and enemies - adding turns that switch back and forth after movement.

Monday, August 14, 2017

Update 46: OpenTile

Two years can really fly by. Growing families, big work projects, small home projects, and as many distractions as you can throw at a sticky wall, here I am. I haven't been doing nothing, I just haven't been writing about it. I'm trying to change the not writing about things problem today.

One of those mini projects I've been working on is very relevant for this project. About a year and a half ago, I started a GitHub project I've called OpenTile. OpenTile is an opensource solution to create the building blocks and data structures for a tile based game. There is no UI, apart from the ASCII files, but it's being built in C#, with a branch for Unity3d. There is currently functionality for basic path finding, possible available tiles (for movement), cover, as well as a number of utility functions. 

I've found this framework really helpful for building a game. I'm able to focus on fundamental functionality such as path finding or cover in a simple ASCII UI, and then it's much easier to integrate the changes into a full 3d engine - with the confidence that it works.

In the screenshots below you can see two simple examples that show the output of path finding on a large map with varied obstacles.





In Unity3D, this is what the result looks like on a small test map:





Friday, October 16, 2015

Update 45: Rebuilding random levels

Using the new resources I have, I've rebuilt the level generator, generating diorama levels with a wooden border again. I was pleasantly surprised how well the level generation code looked and worked, after not looking at this code for a year. Here are a few screenshots showing the progress. At this point I only have 5 variations of tiles, so there is a lot of repetition, but it's easy to add more tiles. Here are some screenshots: 








Next is path-finding!

Friday, October 9, 2015

Update 44: Splitting the Engine

XCOM is obviously a huge influence to this project, both the 1994 and 2012 versions. In a recent interview, XCOM designer Jake Solomon talked about a "Cinematic" piece of the XCOM engine. This was a really insightful and interesting way to think about how the player is immersed in the game via movie like cuts that are interlocked throughout game play. The idea is that when you have a move, the engine, (I'm going to call this the "Interaction" engine, as this is where the player makes choices and then observes the results), calculates the result of, essentially, the next 15-20 seconds. This is then fed into a "Cinematic" engine, which moves the camera around to create a movie like feel. This is what puts the camera behind the player to shoot, moves the camera to see an enemy when a overwatch action occurs and helps to show the 'killcam'. This also helped to explain a few glitches that happened where you would sometimes shoot through cover, probably because the engine considered the cover to not be in the way.

For example: A player decides to move to another location. The interactions engine figures out along the players path if anything will happen (enemy overwatch) and predetermines all results. (perhaps in this case, an enemy will have an overwatch event, shoot at the player and kill them mid path). This information is all passed to the Cinematics engine which controls the result. The camera would start by showing the players movement until it reaches the point of the overwatch event, where it would move the camera to show the enemy firing and then move again to show the player dying.

I really like this idea and think there are a lot of benefits in implementing it. You are essentially making it easier to test, (as you can setup the same set of events and reply them in the cinematic engine), as well as really separating the core mechanics of the game from the visual representation.

I'm really leaning towards trying to implement my own version of this, and this is the perfect time to integrate it in. Anyone else thought of an idea like this before?