29 May 2015

Combat demo/prototype

Finally!

It's taken a while, but here I finally have a (slightly confusing) version of the game, which is playable without simply being a walking simulator!

So yes, combat has been implemented, it's by no means the final version, and everything might change. Currently, there is only top-down shooting, no side-on shooting yet. The only ability currently implemented is Straight-lightning, which can be used by pressing "1" while in isometric view.

Now, characters don't really have health in the traditional manner, instead they have vital organs (Brain, Hearts (two of them because Lo), lungs and a magic organ). These can be damaged in several ways, stopped and destroyed. Currently the only damage-type makes organs burned, because electricity, but in the future I plan to have damage types that bruise and cut as well. If an organ is stopped, it can still be brought back up running (Currently this can be done with the hearts by hitting them with lightning again, though this does damage them), if an organ is destroyed, it's gone, no more organ for you!

Now, if the Brain or both hearts have been stopped or destroyed, a character is dead, all the other organs currently have no effect, but they will in future versions (stopped lungs for example will quickly result in death, but not instantly and stopped magic organ will stop a person from casting magic.)

So yes, this version of the game has two characters on each side visually indistinguishable from eachother (Not intentionally, but that will be changed later on, I just wanted a combat version to be released). Player 1 has the two characters on the left, and player 2 has the two characters on the right.
Trees don't block shots atm, and if you hit a character, it just picks a random organ to damage for a random amount (So if you're lucky you can insta-kill a character).

Anyway, no images today! Instead, here is a nice game!


Controls are:
Left Mouse Button: Select/deselect characters in Isometric, Firing Straight-lightning in Top-Down
(Hold)Right Mouse Button: Move the camera
WASD: Movement
1: Top-Down mode (For shooting straight-lightning)
Esc: Exit Top-Down mode without shooting
Numpad Enter: End turn (I'll have to fix this being only numpad)

To, uuhm, exit the game, you have to forcefully quit it... I forgot to add in an exit button or something like that =P. So either play the game in windowed mode, or use ctrl+shift+Esc, and then end the "Tacshoot" process (That's what the game is called to the system)

Anyway, if you find any bugs, please do comment below, if you have any feedback, post below or if you just want to say something related to me, this site, or the game, post below in the comments! Oh, and if you need help with anything, do ask as well!

All (non hateful) comments are appreciated!

07 May 2015

Top-Down and map-saving/loading

Hello again readers,


I've finally managed to make the top-down view display. I must admit, the manner in which I did it is somewhat of a roundabout kind of way, but it allows me to do interesting things in the future like custom maps (without much effort) and even procedurally generated maps(though that isn't the plan currently).

What I did first, was set up a system in my Unity editor which allows me to make a map in the editor, which I can then save to a text file. This required me to rotate the isometric map about 45 degrees though, which proved to be a slightly tricky mathematical problem for me to solve with me making a few dumb mistakes along the way.

Eventually I figured out that there is a relatively simple equation which allows me to put any tile or tile-based object(Objects which snap to a tile). To get the Text X position (Xt) on the square grid, you take the Game X position (Xg), add that to the Game Y position (Yg), then divide all that by 1.28 (because bordering tiles are 0.64 units of distance away on the X axis, and 0.64 units on the Y axis, and we are adding the Xg to the Yg, so we arent looking for the exact distance between the tiles using pythagoras and that stuff) So the formula for that is: (Xg+Yg)/1.28=Xt. To then get the Text Y position (Yt), you will want to use (-Xg+Yg)/1.28=Yt. After figuring that out, I just had a few problems with rounding which were swiftly solved, and now I can very easily turn this:
Current testing map in the editor
 Into this:
Current testing map in the Map.txt file. Can you figure out what is what?
After finishing that part, all I had to do was make sure the game loaded that text file into memory at the start of the game. Then to actually get the top-down view, I simply had to do the reverse of what I did before, which turns out to be the following formula for Game X: (Xt-Yt)*0.64=Xg. Then to get the Game Y position you do: (Xt+Yt)*0.64=Yg.

I also had to make some new graphics of course, they turned out okay, but I'm not going to win any graphical art prizes with it.

So thats how we turn this:
Isometric in game screenshot
Into this:
Top down in game screenshot of the same location. Ignore the characters, I haven't done them yet.
I didn't yet change the characters to be correctly placed nor are the graphics there proper (obviously).
But that will be a quick change and the first thing I will do next.

What all of this means, is that I can now start working on combat, and actually get this game playable (Not necessarily fun, but we will see). This also means that its quite possible that with my next blog-post there will be a playable demo! (I'm not making any promises though) Note that that combat wont have the 2D view in it just yet, I first want to get something playable out before I start doing that.

So yes, if you have any questions, feel free to ask! (Oh, and if you find any spelling or grammar errors, feel free to point them out too)