Hello Guest, please login or register.
Did you miss your activation email?
Login with username, password and session length.

Pages: [1] 2   Go Down

Author Topic: {Development Journal} U.N. Squadron/Area 88 Engine  (Read 5752 times)

0 Members and 1 Guest are viewing this topic.
{Development Journal} U.N. Squadron/Area 88 Engi...
« on: February 14, 2011, 06:56:43 pm »
  • *
  • Reputation: +12/-2
  • Offline Offline
  • Gender: Male
  • Posts: 4849
This topic is for keeping a development journal online of my U.N. Squadron Engine/Remake project.  I am putting this here at ZFGC since I enjoy the user base and feel like many of you have good insights into others' works.  I would like feedback through out this project in any way.  Once finished, not only will there be a complete game but also an engine for anyone to easily use and modify to make their own shoot 'em up or U.N. Squadron games.

For those of you who never played U.N. Squadron/ Area 88
<a href="http://www.youtube.com/watch?v=M2GZQKAlXyU" target="_blank">http://www.youtube.com/watch?v=M2GZQKAlXyU</a>

Screenshots(Will contain screenshots of any build).




RELEASES

Release 3 Feb. 24, 2011
Release 2 Feb. 17, 2011
Release 1 Feb. 14, 2011
« Last Edit: February 26, 2011, 10:01:23 am by Theforeshadower »
Logged
  • Super Fan Gamers!
Re: {Development Journal} U.N. Squadron/Area 88 ...
« Reply #1 on: February 14, 2011, 07:05:14 pm »
  • *
  • Reputation: +12/-2
  • Offline Offline
  • Gender: Male
  • Posts: 4849
02/14/2011
Started development using place holder sprites.  The first thing I am working on are scripts for the loading of images and attributes of the different planes.  This will make everything very easy to modify in the eventual engine as only values need to be changed to change the plane.  The scripts will also be recycled for use in the HUD cockpit image.  I think the same scripts can re-tooled for use with enemies that function the same but have a different appearance.

Some decisions regarding my remake:
~silky 60 FPS
~ability to replay missions in a New Game+ mode with increased difficulty to allow the player to purchase more than just the usual 3 fighter planes.
~more fighter planes and weapons (only for New Game+ mode).
~Story Mode with Shin Kazama based upon the reboot anime released in 2004.


The game will still use Super Nintendo music and graphics as I believe they are excellent.  Anyway, I back to working on this.  Peace.
Logged
  • Super Fan Gamers!
Re: {Development Journal} U.N. Squadron/Area 88 ...
« Reply #2 on: February 15, 2011, 01:06:15 am »
  • *
  • Reputation: +12/-2
  • Offline Offline
  • Gender: Male
  • Posts: 4849
Release 1 - Requires Game Maker 8 Lite or better

Features
*Movement Engine
*obj_plane
   Some variables of obj_plane are derived from the script.  Thus when I make different scripts for the different planes, the obj_plane would be changed.
*obj_globals
   Just ow I like to handle the creation of globals.  I am sure I have everything there one might need except for continues.


Most everything is place holder even if it looks like it is from U.N. Squadron.
    Movement is dependent on the script I wrote.  Depending on which (there will be more) script is loaded, speed, armor,etc will be changed.  I then went on to the script.  Now, I have literally no experience with scripts in GM.  I always execute code in objects. I figured I could set up scripts that are loaded based upon global.plane.  For now, it is an if statement, where as later I am sure I am going to change it to a switch.
    I could have just made different plane objects that were created based upon global.plane but I figured 1 object would be the best way.  Eventually, the character chosen would also impact each fighter plane capabilities.
    The immune status is still a work-in-progress.  It fits well for the entrance but I feel it may be too long for when I eventually add getting hit.
    The background object controller... I may also change this to scripts, not too sure yet.  Basically, you have the controller object just scrolling the backgrounds.  If you want to change each background, you go to the room setup and change the background images.  Should be easy enough.  If you want different speeds, you can modify the background controller object.  This would be useful later on for if someone wanted to created a level that flows at different speeds.  The coder could setup a timeline that changes the rate at which the backgrounds are scrolled.  So, the more I think about it, scripts would probably become the more useful approach.

Anyway, enough rambling from me.   Download is in the attachments.  Not much to do except see the source code and move around.  The coding is probably not the neatest.  I don't smooth out my code until i feel that something is close to 100% where it needs to be.  Future release would have code indented the way I like it instead of the way it is now.
Logged
  • Super Fan Gamers!
Re: {Development Journal} U.N. Squadron/Area 88 ...
« Reply #3 on: February 15, 2011, 06:48:46 am »
  • *
  • Reputation: +9/-0
  • Offline Offline
  • Gender: Male
  • Posts: 3725
Seem nice for a start. I have a few remarks to make. I could say something about your coding conventions, like using '=' instead of '==' and your use of multiple keyboard_check(vk_up) in the same event. But it is not worth it. And you have made some real progression.

For just defining I wouldn't use an object, because that object remains as long as the room remains and which GM processes every cycle. It is probably better to define in initialization script and have the background controller object or the first room's creation event call the script.

But my biggest problem with your code is that you repeat the code below 3 times. Once in the Begin Step event, Once in the Step event and once in the End Step event. How often do you need to repeat the exact same thing in a game cycle. The keypresses do not change, nor does the canMove variable. And because the image index only changes by .1 it has only effect 1 in 10 gamecycles. Maybe even less. Know what your code is doing.
Code: [Select]
//Sprites and Animations
if canMove = true
{
if !keyboard_check(vk_up) && !keyboard_check(vk_down)
{
    if image_index > 2
    {
        image_index -= .1;
    }
    else if image_index < 2
    {
        image_index += .1;
    }
    else
    {
        image_index = 2;
        image_speed = 0;
    }
}
else if keyboard_check(vk_up)
{
    if image_index < 4
    {
        image_index += .1;
    }
    else
    {
        image_index = 4;
    }
}
else if keyboard_check(vk_down)
{
    if image_index > 0
    {
        image_index -= .1;
    }
    else
    {
        image_index = 0;
    }
}
}
Logged
Re: {Development Journal} U.N. Squadron/Area 88 ...
« Reply #4 on: February 15, 2011, 06:56:29 am »
  • *
  • Reputation: +12/-2
  • Offline Offline
  • Gender: Male
  • Posts: 4849
Oh, the repeating is something I did because of a strange "flicker" glitch I was getting.  Remove the Begin and End to see it it happens to you.  What I mean is that when you are moving and release the up key, the image would go back to the idle image but before it gets there, it flicked into a different frame.  Maybe I had too much to drink while I was coding or something.(Being totally honest, I was drinking while I was coding lol)

I do not know.  I'll look into it.

Also about the "="  I was thinking the entire time of using == instead but I chose to use =.  I know very well that most languages use == for comparison and that using an = sets the left side equal to the right side.

Finally, when I use a defining object for globals, it is used in-game in the very first room, such as a logo or whatever.  I will look into init_script but for me in the past it seems to not go well this is the first time I am really trying to learn scripts.
« Last Edit: February 15, 2011, 07:00:53 am by Theforeshadower »
Logged
  • Super Fan Gamers!
Re: {Development Journal} U.N. Squadron/Area 88 ...
« Reply #5 on: February 15, 2011, 07:19:34 am »
  • *
  • Reputation: +9/-0
  • Offline Offline
  • Gender: Male
  • Posts: 3725
Well, that was easily fixed. If you do not work with image_speed then you need to do your own thresholding. The same goes when the default sprite is not 0. You forgot to do the animation thresholding. I fixed it for you, including an ugly if...else if... else if.... construction you had.
Code: [Select]
//Sprites and Animations
if canMove = true
{
    if keyboard_check(vk_up)
    {
        if image_index + .3 < 4
        {
            image_index += .3;
        }
        else
        {
            image_index = 4;
        }
    }
    else if keyboard_check(vk_down)
    {
        if image_index - .3 > 0
        {
            image_index -= .3;
        }
        else
        {
            image_index = 0;
        }
    }
    else
    {
        if image_index > 2
        {
            image_index -= .3;
            if image_index <= 2
                image_index = 2       
        }
        else if image_index < 2
        {
            image_index += .3;
            if image_index >= 2
                image_index = 2
        }
        else
        {
            image_index = 2;
            //image_speed = 0;
        }
    }
}
Logged
Re: {Development Journal} U.N. Squadron/Area 88 ...
« Reply #6 on: February 15, 2011, 08:48:32 am »
  • *
  • Reputation: +12/-2
  • Offline Offline
  • Gender: Male
  • Posts: 4849
See...That is what I get for drinking while coding.  I understand what you did.  I use it when I mess with platformer gravity since  I use my own gravity variables.    Thanks, Niek.  It's good to have someone else look at your own code every now and then.
Logged
  • Super Fan Gamers!
Re: {Development Journal} U.N. Squadron/Area 88 ...
« Reply #7 on: February 17, 2011, 04:45:06 pm »
  • *
  • Reputation: +12/-2
  • Offline Offline
  • Gender: Male
  • Posts: 4849
2/17/2011

Been working on the Heads-Up-Display.  Seems like something easy to do in light of having exams and been sick as hell lately.
I was wondering what kind algorithm can I do for the score and currency.  If I was using GM pro, it would be a simple font_add_sprite.  However, I am using GM 8 lite.  I already have the sprite for numbers ( 0 - 9 ).  I think I tried something like this once.

I think I had some code for a game that had different variables for each number shown for the score.  Everything was dependent on the ones place.

Something like:
ones = 0;
tens = 0;
hundreds = 0;
thousands = 0;

and so on.

Every time ones >= 10, then I reset ones = 0 and added 1 to tens.  If tens >=10 , then hundreds += 1;  and so on.
The problem lies in the small chance that 2 or more enemies die at the exact same time(which will happen with certain weapons.)  Thus, if 3 enemies are destroyed and are each worth say 9 points, then that is 27 points total but the game would only see it as 10.

One way to avoid this somewhat is have systematic scoring system( 10, 20, 50, 100, etc).  So that if an enemy worth 20 points is destroyed, it adds 2 to the tens value.

Of course, you still have a normal global score variable which the player won't see but should equal out to what I stated above.
I also thought about taking the global score and using math on it to draw the sprFont.
Ones would be easy:
Psuedo
draw_sprite(x,y,global.score,1);

But once you get over 10, it becomes tricky.

Any thoughts? Probably way off target with this.
Logged
  • Super Fan Gamers!
Re: {Development Journal} U.N. Squadron/Area 88 ...
« Reply #8 on: February 17, 2011, 07:08:35 pm »
  • *
  • Reputation: +9/-0
  • Offline Offline
  • Gender: Male
  • Posts: 3725
I have no real idea what your algorythm is trying to do, but if you have a score and you want to display it by using sprites there is a lot easier way to do it. Here is an example of how I did it with the ruppees in the MCS Engine:

Code: [Select]
//Draw Wallet Icon
    draw_sprite(sprWalletIcons, 2, r-48, b-16);
    //calculate the digits
    fd = global.cur_ruppees div 100;
    sd = (global.cur_ruppees mod 100) div 10;
    td = (global.cur_ruppees mod 100) mod 10;
    //Draw the digits
    draw_sprite(sprWalletDigits, fd, r-32, b-12);
    draw_sprite(sprWalletDigits, sd, r-24, b-12);
    draw_sprite(sprWalletDigits, td, r-16, b-12);
You just have one variable for the score and if you have a maximum number of digits you just calculate what digit to draw. However if you have more than four digits it is probably bettr to use a while loop for the drawing and calculations.
Logged
Re: {Development Journal} U.N. Squadron/Area 88 ...
« Reply #9 on: February 17, 2011, 07:37:52 pm »
  • *
  • Reputation: +12/-2
  • Offline Offline
  • Gender: Male
  • Posts: 4849
I have no real idea what your algorythm is trying to do, but if you have a score and you want to display it by using sprites there is a lot easier way to do it. Here is an example of how I did it with the ruppees in the MCS Engine:

Code: [Select]
//Draw Wallet Icon
    draw_sprite(sprWalletIcons, 2, r-48, b-16);
    //calculate the digits
    fd = global.cur_ruppees div 100;
    sd = (global.cur_ruppees mod 100) div 10;
    td = (global.cur_ruppees mod 100) mod 10;
    //Draw the digits
    draw_sprite(sprWalletDigits, fd, r-32, b-12);
    draw_sprite(sprWalletDigits, sd, r-24, b-12);
    draw_sprite(sprWalletDigits, td, r-16, b-12);
You just have one variable for the score and if you have a maximum number of digits you just calculate what digit to draw. However if you have more than four digits it is probably bettr to use a while loop for the drawing and calculations.

That's what I was looking for.  I just don't know all the math functions.  Thanks, Niek.
Logged
  • Super Fan Gamers!
Re: {Development Journal} U.N. Squadron/Area 88 ...
« Reply #10 on: February 17, 2011, 11:09:27 pm »
  • *
  • Reputation: +12/-2
  • Offline Offline
  • Gender: Male
  • Posts: 4849
Damn you, Niek.
Now I have to work with that a bit.  The score would be max at 999,999; however, the actual score numbers only appear once the thresholds have been reached:

Psuedo
Score < 10
only show  ones
Score > 10
show tens and ones
Score > 100
show hundreds tens and ones

Nothing too major.
------------------------------------------------------------------------------------


Release 2
I began adding some more stuff.  Sorry, I like to add alot then work out the bugs later...sue me :(
The cockpit image loads fine.  It just needs some work with timers.  Some variables will be changed later on as different pilots recovery more quickly.  I think this will be added to the character scripts.  Things like hurt_cooldown and immune_cooldown would be different based upon what script was loaded.  Since the basic concept is down, I am thinking about making a scrHurt, scrImmune, and scrShoot.  I need more practice with scripts.  Need to get rid of this mess in STEP events that I have let myself get into.

Anyway, still works with GM8 Lite.  If you want to test some stuff:
-Z to shoot
Works pretty damn good for level 1.  You can check it to the game if you want.  In the actual game, if you hold Z, only 10 shots fire before you have to press it again.  You also cannot spam it in the real game, so I chose to not let you spam it in my remake.
-H to test hurt and immune statuses
Affects the cockpit and health bar images.  The cockpit was originally it's own object but I figured I should draw as much as possible with the HUD with one object instead of having half-dozen HUD objects.

I think the code is a little messy.  When I finish taking a break from this(about to play some SC2), I will look over the code to see what I can clean up.  I will also try the scripts I was mentioning earlier.
« Last Edit: February 19, 2011, 09:02:47 pm by Theforeshadower »
Logged
  • Super Fan Gamers!

Mamoruanime

@Mamoruanime
Re: {Development Journal} U.N. Squadron/Area 88 ...
« Reply #11 on: February 18, 2011, 07:59:27 am »
  • ^Not actually me.
  • *
  • Reputation: +9/-0
  • Offline Offline
  • Gender: Male
  • Posts: 9786
I'm kind of surprised you're going for the SNES version and not the arcade version :P
Logged
Re: {Development Journal} U.N. Squadron/Area 88 ...
« Reply #12 on: February 18, 2011, 06:23:42 pm »
  • *
  • Reputation: +12/-2
  • Offline Offline
  • Gender: Male
  • Posts: 4849
I'm kind of surprised you're going for the SNES version and not the arcade version :P
I never played the arcade version.  That and from everything I have read, the SNES version is the better one with the only downfall being no co-op.
Logged
  • Super Fan Gamers!
Re: {Development Journal} U.N. Squadron/Area 88 ...
« Reply #13 on: February 19, 2011, 10:53:34 am »
  • *
  • Reputation: +9/-0
  • Offline Offline
  • Gender: Male
  • Posts: 3725
Okay, I took a look at your code and am wondering why you have 2 HUD objects, 1 giant mostly empty image for the HUD and still have the three step events.

Oh yeah and H does not work and there is no checking whether your plane gets beyond the views bounds.

And finally, you do not destroy the bullets when they get beyond the views bounds. In a few minutes I had a several hundred bullet objects lagging the game.
Logged
Re: {Development Journal} U.N. Squadron/Area 88 ...
« Reply #14 on: February 19, 2011, 07:06:39 pm »
  • *
  • Reputation: +12/-2
  • Offline Offline
  • Gender: Male
  • Posts: 4849
Okay, I took a look at your code and am wondering why you have 2 HUD objects, 1 giant mostly empty image for the HUD and still have the three step events.

Oh yeah and H does not work and there is no checking whether your plane gets beyond the views bounds.

And finally, you do not destroy the bullets when they get beyond the views bounds. In a few minutes I had a several hundred bullet objects lagging the game.
The giant HUD object is just placement.  It is going to do to the objHUDdraw object.  The bullets are also just something I threw in.  H works just fine Niek o.0  I just pressed it 10 times in a row on R2...It only effects the cockpit image and healthbar.

The bullets should be finished on the next release which will include the instance_destroy() goodness.  I also know there are no bounds.  That will get finished when the HUD is finished.  I wonder if you are losing frames or something with the H issue.  On the release of H is when the code kicks in for testing.
Logged
  • Super Fan Gamers!
Re: {Development Journal} U.N. Squadron/Area 88 ...
« Reply #15 on: February 19, 2011, 07:24:53 pm »
  • *
  • Reputation: +9/-0
  • Offline Offline
  • Gender: Male
  • Posts: 3725
H works just fine Niek o.0  I just pressed it 10 times in a row on R2...It only effects the cockpit image and healthbar.
:huh: Both releases in the first post link to R1 and in every post that has an attachement it is also R1. You haven't provided us with R2 yet. Or am I missing something.
Logged
Re: {Development Journal} U.N. Squadron/Area 88 ...
« Reply #16 on: February 19, 2011, 09:01:41 pm »
  • *
  • Reputation: +12/-2
  • Offline Offline
  • Gender: Male
  • Posts: 4849
H works just fine Niek o.0  I just pressed it 10 times in a row on R2...It only effects the cockpit image and healthbar.
:huh: Both releases in the first post link to R1 and in every post that has an attachement it is also R1. You haven't provided us with R2 yet. Or am I missing something.

Crap, R2 is there.  Let me fix the link.  It's my fault.  Uploaded R1 again though I thought I did R2...Ooops
« Last Edit: February 19, 2011, 09:03:42 pm by Theforeshadower »
Logged
  • Super Fan Gamers!
Re: {Development Journal} U.N. Squadron/Area 88 ...
« Reply #17 on: February 20, 2011, 08:27:35 am »
  • *
  • Reputation: +12/-2
  • Offline Offline
  • Gender: Male
  • Posts: 4849
Not releasing anything soon, but I will keep you updated :D.

2/20/2011
Took care of instance_destroy() for obj_bullet since Niek was getting sand in his boots >:D.
Getting hit is so much smoother.  I coded a separate timer for getting hit.
So now:(NOTE: Though it is real code, it is not in the proper events and such.  So it is somewhat psuedo.  I have it in the proper events on my end.)
Code: [Select]
hit = false;
hitcooldown = false;

if hit = true
{
     hitcooldown -= 1;
}
else if hit = false
{
     hitcooldown = 90;
}

Then while hit = true, the health bar smoothly decreases like the real game does.  The health bar stays at a flashing danger until hurtcooldown becomes 0.  Hurtcooldown becomes 0 once hitcooldown is 0.  Immune is still being used since the first second you get hit, you need to become immune.  I could remove immune status altogether now that I think about it since I could just code something like:
if hitcooldown < 90 && hitcooldown > 60
{
   //add the former immune code here
}

I do not know if it will really clean anything up.  I would have to recode some stuff a bit on the objHUDdraw.  Also, all the HUD drawing is now fully into objHUDdraw, including the overlay :D.

Just working on smoothing some stuff out any way I know how to.
Logged
  • Super Fan Gamers!

Mamoruanime

@Mamoruanime
Re: {Development Journal} U.N. Squadron/Area 88 ...
« Reply #18 on: February 20, 2011, 08:52:10 am »
  • ^Not actually me.
  • *
  • Reputation: +9/-0
  • Offline Offline
  • Gender: Male
  • Posts: 9786
Problem with that is you're constantly setting hitcooldown to 90 when you're not being hit. Might want to add another condition in there to ignore the setting of the value if it's already at the cooldown value. Also it's a good idea to put those things into variables or constants if it's a set amount. For example hitcooldown = _COOLDOWN_MAX or something. There are also a few better ways to to do this with less variables, but that should suffice for prototyping :P
Logged
Re: {Development Journal} U.N. Squadron/Area 88 ...
« Reply #19 on: February 20, 2011, 09:11:42 am »
  • *
  • Reputation: +12/-2
  • Offline Offline
  • Gender: Male
  • Posts: 4849
Problem with that is you're constantly setting hitcooldown to 90 when you're not being hit. Might want to add another condition in there to ignore the setting of the value if it's already at the cooldown value. Also it's a good idea to put those things into variables or constants if it's a set amount. For example hitcooldown = _COOLDOWN_MAX or something. There are also a few better ways to to do this with less variables, but that should suffice for prototyping :P

The cooldowns will eventually be different based upon pilot like the game itself.  For the check, a simple
 if (hit = false and !hitcooldown = 90)
{
 hitcooldown = 90;
}
should work.  Max_cooldown will be needed though, so I should probably do that instead sicne the max will change based upon character.
Logged
  • Super Fan Gamers!
Pages: [1] 2   Go Up

 


Contact Us | Legal | Advertise Here
2013 © ZFGC, All Rights Reserved



Page created in 0.121 seconds with 74 queries.