Sunday, June 30, 2013

First real punch

I've been studying and testing for a while and I came out with a solution for the interaction (such as I give the punch and the opponent gets the hit). It will be a huge amount of code, if I stick on this solution, but it will be very precise. I tried to use the native functions for the collisions but they ain't work well because we are, anyway, in a 3D environment.
So I have to list all the combinations of action between the 2 players and determine what is what for each one when, obviously, the 2 players are close enough to each others.
At the moment I'm using the opponent as a sparring partner. I managed to do the first interaction which is the normal frontal punch (Z key) and a normal "got hit" animation. Moreover I added a kind of spark animation between the punch and the body which indicates the hit is given. I added also two different sounds: one from the opponent that gets hit and the other the normal sound of the hitting punch.
Here the screenshot of the first real given punch.

Uploading the screenshot I noticed the shadow of the challenger is slightly shifted to the left. Fixed just now.

Sunday time

Happy Sunday to everyone. I started this Sunday (I can't go out yet due to a local virus I've got) watching the F1 GP of Silverstone (great final part of the race) and relaxing a bit. Then I started coding again using as background music a compilation of Chris Hulsbeck (an great video game composer since the C64) which is very motivating.
I corrected several minor bugs and a little glitch which was making an animation flickering a bit. Now is nice and fluid. With a little trick and just 2 lines of code I now the shadow when jumping moves backward giving a very realistic effect. The shadow itself going backward goes also smaller (prospective) automatically because drawn in a 3d environment.
Now it is time to start to study the collisions.

Saturday, June 29, 2013

Flipping sprites commands and shadows!

Took me something like 5 hours of deep study and coding but we have the flipping sprites once they cross each others.
Making the visual flipping haven't been that hard but it took so much time to make all the routine to invert the commands (the action you normally do with punch+left for example now is done with punch+right) and to retouch all the code of the shadows that actually have to flip too! Fortunately thanks to a little trick I didn't have to use another set of sprites (same mirrored) but the same ones saving a lot of memory.
Now, finally, starts the interaction with the other bad guy which will be for very long time (till the AI will be developed - final step) just a sparring partner :D


Point of the situation so far

Ok in this exact moment we have 2 players on the screen, one just there (your opponent) but animated in standing position and with his own shadow. The other is your character controllable with the keyboard, with a good range of actions (not complete yet) and his own shadow. Animated background and 3D environment with lateral scrolling (parallax effect of the combat floor) and vertical scrolling when jumping.
So far so good.
From the picture you can see the presence of the 2nd character and the brand new shadow system.
Before to make the two opponents interact I need to make the routine that swap the players (and the controls) once they cross each others. I don't really know how to do it and how is realized in other games so i will start to study and analyze some other fighting games.

new shadows

I spent the whole day so far to rewrite the code for the shadows (which I just wrote yesterday). Before the shadow was basically an ellipse under the player's sprite more or less like in many other fighting games. I wanted to make real shadows, shadows that follow the physic rules and the character's movements. I was training and the idea about how to do that just came in my mind. After 3 hours of trying, coding, re-design we have dynamic shadows! The move along the main sprite movements and they change inclination depending where the sprite is comparing with the virtual pint of light. The effect in motion is amazing. Very happy about that.
I just placed another character sprite in the came...standing still...meaning I will start the interaction between fighters....hard part!

Friday, June 28, 2013

Defenses

I just added the defense with  the key "C". You can defend by standing and in low position. The defense has priority on all the other moves but don't let you (of course) attack. You can't defend yourself when jumping.
Seems to work just fine. It's almost time to make some interactions, from tomorrow I will start to work at the code to actually give pain to some other bad guy.
Time to sleep.

The character has a shadow

I added a shadow to the character. The shadow moves along the player sprite and it alternates 2 frames (so far): large shadow and normal shadow depending from the action of the player: in fact some character sprites are wider than others. Now is just 2 frames to see if the global effect works (and it does), we'll see later on if is the case to put some additional ones.

The image of the shadow has been created with the large use of the glow effect around a single black pixel: in this way we can see the shadow but there is the transparency necessary to create a realistic shadow effect.
In the screenshot you can see the glowing shadow (large one) while the character is kicking.

Thursday, June 27, 2013

New actions, credits and few sound experiments

I've being coding till late and I added few more action with new punches and kicks. So far the combinations are the following:

Basic Controls:
Moviments:
Arrow -> (RX): Walk forward
Arrow <- (LX): Walk backward
Arrow up (UP): Jump perpendicular
Arrow down (DW): Low position
UP plus RX or LX: Jump diagonal backward and forward

Actions:
Z is the Generic punch key    
Z (alone): normal punch
Z plus DW: punch in low position
Z plus DW plus RX: uppercut punch from low position
Z plus UP: jumping punch (slightly in low direction)
Z plus LX: rolling punch

X is the Generic kick key
X (alone): normal kick
X plus DW: ground kick in low position
X plus DW plus RX: front kick in low position
X plus DW plus LX: rolling ground kick in low position
X plus LX: rolling kick
X plus UP: jumping kick (slightly in high direction)

I fixed few minor bugs and a glitch in the main animation. I added (key F!) a textual page with the credits (what a hard part...) and the controls of the game so far (same I copied and pasted here) and I started to play a bit with the sound. Generally punches have their sound and a different sound for kicks: special kicks and punches (at the moment kick + left or punch + left) have their own sound. Jump action has a little sound too. Also a little background music is now playing.

Tomorrow I will add some missing punches/kicks and I will work on the shadow of the player. Special actions (like for example the fireball or similar) will be developed later on because every character has a different one.

Sweet dreams.

A lot of punches and kicks

After a whole afternoon of coding now our main character can execute 5 different kinds of kicks and 4 different kinds of punches. Few of them very nice to see and play. Kicks and punches change if you are standing still, if you are jumping or if you are on your knees.
After I studied how the alarm instances of GM work I put just some code space where will be executed everything before the play. For the moment there is just an animation of our character that waves to us before starting.

I can't post the whole source code so far (I will eventually when the engine will be stable and almost finished) but if whoever wants to have a look just drop me a message and I'll share it with you.

I'm not posting any pictures atm just because I'm working at the commands and the animation of the main character...there won't be a lot to see from a picture. Eventually I will post soon a video.

punches and kicks

I started to work on the punches and the kicks. Atm you can do the basic punch (standing) with Z and I just added the basic kick with X. So far there is no combination for these two keys (Z for punches and X for kicks) and direction arrows to give a different punch or kick: that's why is time now to write down the pattern with the whole combination of possible kicks and punches and relative keys: this one will be the same for all the characters. I believe I will add then 2 special movements each character with two separate keys, this will require a different code for every character. Anyway it's too early to talk about this. Let's get back in the normal punches and kicks patterns.

Wednesday, June 26, 2013

punch

The simple standing punch is now possible with the key "z". It took longer than I was thinking because I had to calibrate the timing of the punch and the fact you cant just keep on punching by holding "z" but you need a bit of delay in it.
Now the punch works only standing and I didn't face yet all the possibilities of punching in movement and so on. I'm just doing the basis and soon I'll write down all the possible combination of actions for the main character.
Good Night

Up and down done

Not as easy as I was thinking but now the character goes on the knees and jumps. Plus jump backward and forward if multiple keys are pressed. While jumping a little vertical scrolling has been added, When going down the camera will zoom a bit on the player creating a nice dynamic effect.

walking update

Ken can now walk forward and backward. I added the needed animation frames to the main sprite and I synchronized the whole thing with the movement. Looks good. Next jumping and "on the knee position".

PC issues

Normally I deliver all my work on MAC. Unfortunately I need to develop the code on PC because I can use a better version of GM plus I can "rely" on a worse machine in order to give a first check to the code that will be transported to a mobile for example. Therefore I use a very small and powerless notebook which just abandoned me right now.
I'm working on getting it back alive saving, at least, the whole work of yesterday.

Tuesday, June 25, 2013

Day one is over

The first day on the project is over but a lot has been done already.

To have some graphics to start with (and to check if the scripts are working) I'm using old background of the Street Fighter saga as well as the sprites.

My basic idea was to create a real 3D landscape with a little and narrow floor which represents the combat floor, and a wall behind which is used as base for the background.

The camera-view will be facing the wall and perpendicular to the floor and will move with the player.

I will texture the floor with the original bitmap part of the combat floor (at the time the part with the parallax effect) and I will texture the wall behind with the texture of the original background.

After a lot of tries and calibrations....it works!

I have the floor scrolling in prospective (because i'm using a real 3d) and the background scrolling slower (because is more far away comparing to the camera point).

The final effect is exactly like the original, funny thing is that the original was using several parallax layers to imitate the 3D...here I'm using the 3D to imitate the old parallax effect.

I needed to calibrate sizes, ratios and some other parameters to give the best deep effect i could get and I nailed it indeed.

I'm using a time_line to rotate the texture of the background (i'm coding in GM8.1) to give the effect of the animated background and it works very well.

Finally I inserted already a sprite (a big one) to set the proportions and to calibrate the scrolling. Basically the sprite move left and right (with arrow keys) and the camera follows the sprite: being a 3d environment the scrolling goes by itself. Camera and sprite have already a left - right limits.

The sprite if no key is touched is in idle animation already. all good for the first day

I post a Picture, consider that all is in movement and 3d!
goodnight

first things first ...

I remember back in time that Street Fighter II (the arcade version) was such a good game. At the time I used to program the C64 and, with more satisfaction, the Commodore Amiga. Unfortunately if the version of the game on the popular console (at the time) such us Sega Megadrive or Super Nes was very well done, the conversion on Amiga was extremely disappointing: everything was under the standard of the 16bit commodore's machine.

I believe that the best tech points of the game (arcade version) are three overall:
1) The parallax scrolling (with the fake 3d effect of the combat floor)
2) The animated background (along with other graphic effect like the shadows and the use of colors)
3) The speed and fluidity of the game

Even today I believe that technically these are three good points to start with. Of course playability will be paramount (as well as good storyboard and characterization of the players) but now is a way too early to talk about that.

Let's get into the code then.

The new idea: a fighting game

Here I am posting the very first article on this new blog. Long story short: I'm Ivano, I live in Curacao and I run a company specialized in Internet marketing, online gaming and "similar stuff". Lately the business is going very slow therefore I decided together with my business partner Filippo to vary our business and explore new possibilities.
Whether Filippo decided to dedicate his time pushing the envelope in web-design, I decided to bring up one more time my old passion of coding and video-games programming.
The first idea was to realize a quite easy 3D engine that can be used on multiple platforms (especially mobiles). I was first of all trying to refresh my memories about writing programs with a goal to develop a racing game to use as local app, the circuit in fact was the reproduction of the streets of Curacao.
Why this introduction if this blog is titled "making of a fighting game"?
Because while I was working on my 3D engine came back in my mind the old Street Fighter and all the clones of it and I've been thinking that with the potential of my 3d engine plus some good idea the fighting game could be much more catchy than a racing game and, nevertheless, way easier in terms of simulation and physics.
And here we are, this is the first day of working on the project "fighting game".