WIP SHMUP : Learn basics

A place for people with an interest in developing new shmups.
User avatar
9uile
Posts: 50
Joined: Mon Jan 13, 2020 4:57 pm

WIP SHMUP : Learn basics

Post by 9uile »

Hello,

"A place for people with an interest in developing new shmups."

It seems that this forum is for me ! :)
I'm trying to learn basic skills to made a shmup in UNITY.
I'm not ready to make a whole game so i try to learn step by step the essentials mecanics.

Here is a video of my first attemps :

https://www.youtube.com/watch?v=DSTfL2oWIfc

Please tell me what i should do next !!!
Thanks !
User avatar
hechelion
Posts: 29
Joined: Wed Oct 02, 2019 2:19 am

Re: WIP SHMUP : Learn basics

Post by hechelion »

If you have learned from 0, then you have a very good progress.
The normal thing is to learn to create simple games before more complex projects, you know, learn to crawl before walking.
But in your case you are doing very well.
Congratulations.
User avatar
9uile
Posts: 50
Joined: Mon Jan 13, 2020 4:57 pm

Re: WIP SHMUP : Learn basics

Post by 9uile »

Thx hechelion !
Do you have ideas for my next steps ?
User avatar
9uile
Posts: 50
Joined: Mon Jan 13, 2020 4:57 pm

Re: WIP SHMUP : Learn basics

Post by 9uile »

Here is a new video :
bullet & himing missile
https://www.youtube.com/watch?v=0_RF4wz33Jc

Is there a way to include the video directly in the post ?
User avatar
hechelion
Posts: 29
Joined: Wed Oct 02, 2019 2:19 am

Re: WIP SHMUP : Learn basics

Post by hechelion »

The behavior for that missiles look very nice. Congratulation.
The next step?
Learn it about shooters patterns, one thing is the physic of moving, but another thing is make good patterns.
User avatar
9uile
Posts: 50
Joined: Mon Jan 13, 2020 4:57 pm

Re: WIP SHMUP : Learn basics

Post by 9uile »

thank you hechelion :)

I read some posts in the forum and i wonder how dealt with enemy spawning. Not just spawn enemies like a lot of tutorials i saw in YT but construct a full level.
As i know, i have two main choices :

1. Make a complete level in the scene who scrolls down to the player and activate enemies (and other prefabs if needed) just before they enter in the camera view.
pros : have a look on the level structure in the editor.
cons : place manually all prefabs at the right place in the scene.

2. Use a kind of timeline script generation (i don't know the right keyword to ask my friend google) to instanciate prefabs in a specific order based on time.
pros : I can easily create text file and test it in game. Have a direct look of what is fun to play. copy/paste interesting sequences to built a full level.
cons : At the moment, nothing because i really want to test it !!!!

I need your advices and if you have any ressources (videos, blogs ...) to make a level with timeline script generation, it will be AWESOME !!
User avatar
hechelion
Posts: 29
Joined: Wed Oct 02, 2019 2:19 am

Re: WIP SHMUP : Learn basics

Post by hechelion »

Normally, is better load in memory only what you need so, the timeline script is a most efficient solution over load all enemies at the beginning.

My game used some similar to timeline, but is more scroll advance that time, I have a list or parameters, the first is the scroll position and the rest, are the parameters for the class constructor. So, the enemies always spawn in the same point.
The cons are you need a lot of imagination to build the level, and a lot of time to probe and improve. unless you make a GUI application for this.
User avatar
9uile
Posts: 50
Joined: Mon Jan 13, 2020 4:57 pm

Re: WIP SHMUP : Learn basics

Post by 9uile »

hechelion wrote:My game used some similar to timeline, but is more scroll advance that time, I have a list or parameters, the first is the scroll position and the rest, are the parameters for the class constructor. So, the enemies always spawn in the same point.
Could you share some lines of your code to have an idea of what it looks ?
User avatar
hechelion
Posts: 29
Joined: Wed Oct 02, 2019 2:19 am

Re: WIP SHMUP : Learn basics

Post by hechelion »

9uile wrote:
hechelion wrote:My game used some similar to timeline, but is more scroll advance that time, I have a list or parameters, the first is the scroll position and the rest, are the parameters for the class constructor. So, the enemies always spawn in the same point.
Could you share some lines of your code to have an idea of what it looks ?
This is the routine that loads enemies in my game.
pLstInvoke is a sort list of a custom structure, where I have the "time" when the enemy will be loaded and information such as the enemy's ID, position and optional parameters that are passed to the enemy's constructor.

Code: Select all

    Public Sub Logic(byVal Ptime as integer) Implements INTERLEVELS.Logic

        'llamada a carga de enemigos
        If pLstInvoke(pIndexInvoke).Time = pTime Then
            Do While pLstInvoke(pIndexInvoke).Time = pTime
                oScreen.LoadEnem(pLstInvoke(pIndexInvoke).ID, pLstInvoke(pIndexInvoke).posX, pLstInvoke(pIndexInvoke).posY, pLstInvoke(pIndexInvoke).Param, pLstInvoke(pIndexInvoke).MinRank, pLstInvoke(pIndexInvoke).NeedBoss, pLstInvoke(pIndexInvoke).Cadena)
                pIndexInvoke += 1
                If pIndexInvoke >= pLstInvoke.Count() Then pIndexInvoke = 0
            Loop
        End If
    End Sub
User avatar
n0rtygames
Posts: 1001
Joined: Thu Mar 15, 2012 11:46 pm
Contact:

Re: WIP SHMUP : Learn basics

Post by n0rtygames »

Is this your actual code?

What scripting language are you using? I thought you were working in Unity so I would expect to see C# given the year as Unity have pretty much deprecated js/boo/unityscript
facebook: Facebook
User avatar
hechelion
Posts: 29
Joined: Wed Oct 02, 2019 2:19 am

Re: WIP SHMUP : Learn basics

Post by hechelion »

n0rtygames wrote:Is this your actual code?

What scripting language are you using? I thought you were working in Unity so I would expect to see C# given the year as Unity have pretty much deprecated js/boo/unityscript
Nop. I don't use Unity. My game is programming over Visual Basic .NET with SFML library. I like to move to C# with core, but first I like to end "Evorales".
User avatar
9uile
Posts: 50
Joined: Mon Jan 13, 2020 4:57 pm

Re: WIP SHMUP : Learn basics

Post by 9uile »

I now understand why i didn't understand your code. :D
User avatar
9uile
Posts: 50
Joined: Mon Jan 13, 2020 4:57 pm

Re: WIP SHMUP : Learn basics

Post by 9uile »

Hello, i want to recreate bullets cancel : e.g. when an enemy is killed, all these his bullets (and only hers) are dying. How to achieve this when there's a lot of bullets an enemies on screen ? (unity, c#)
User avatar
casualcoder
Posts: 346
Joined: Sat Apr 21, 2012 4:35 am
Location: West Coast, Canada

Re: WIP SHMUP : Learn basics

Post by casualcoder »

9uile wrote:Hello, i want to recreate bullets cancel : e.g. when an enemy is killed, all these his bullets (and only hers) are dying. How to achieve this when there's a lot of bullets an enemies on screen ? (unity, c#)
In VariaBULLET2D I put this into the system with a simple custom shot modification. A demonstration of the "BulletsToCoins" example:

Image

Of course you can convert the bullets to anything (or repool, or destroy) just as easily.

This is the code used in VariaBULLET2D to make it happen. Obviously it depends on the other code in the system, but might help you figure out how to do it on your own. Coin object is set in the inspector for this shot prefab:

Code: Select all

    public class CoinOnDestroyed : ShotLinearNonPhysics
    {
        public GameObject Coin;

        public override void Update()
        {
            base.Update();

            OnEmitterDestroyedDoOnce(
                shot => {
                    GameObject coin = GameObject.Instantiate(Coin);
                    coin.transform.position = shot.transform.position;
                    coin.transform.rotation = shot.transform.rotation;

                    RePoolOrDestroy();
                }
            );
        }
    }

If you have a ton of bullets that might cancel like this, it'll probably be more performant instead of instantiating/destroying (which is costly in large amounts on a single frame) to have a separate set of frames defined in the inspector, that replace the previous animation frames (turning them into "coins" or whatever)... along with a secondary shot behavior script which is disabled until the conversion occurs, at which point you just disable the previous shot script type and enable the new one (to move the converted shot in some different manner than the original shot).
User avatar
9uile
Posts: 50
Joined: Mon Jan 13, 2020 4:57 pm

Re: WIP SHMUP : Learn basics

Post by 9uile »

That’s nice !! I’m still working on my script and it’s almost finished. I hope...
The way i proceed is :
When an enemy is instanciate, i create a enemyID and mark each emitted bullet.
Then, just before the death of enemy, i launch a function to destroy bullets marked with this id.
My code is messy at the moment but each day a little step. :)
User avatar
9uile
Posts: 50
Joined: Mon Jan 13, 2020 4:57 pm

Re: WIP SHMUP : Learn basics

Post by 9uile »

I would like to work a bit on design. Just before, i wonder which resolution screen i have to choice. I want to avoid size error doing my pixel art because i'm not an artist. Currently i use the pixel perfect camera (in unity)with these settings. I'm not sure if it's good.

Assets pixels per unit : 16
reference resolution x480 y270
upscale render text : not checked
pixel snapping : not checked
Crop Frame : x and y checked
strech fill : not checked

If someone accurate knows, please tell me :)
Thanks
User avatar
casualcoder
Posts: 346
Joined: Sat Apr 21, 2012 4:35 am
Location: West Coast, Canada

Re: WIP SHMUP : Learn basics

Post by casualcoder »

I always use a pixel per unit (PPU) of 10. For me it's easier to do a bit of mental math when keeping .1 unit = 1 pixel. (if wondering why not just go 1PPU, it's overkill and I've heard is bad for correctly generating physics although not sure if it's a myth or not).

Other than that, I haven't really used the "pixel perfect" camera as I've (over many years) tried many "pixel perfect" setups in Unity, including making my own, and at every point I was disappointed with something that resulted in far from pixel perfect behavior.

But I haven't totally written it off yet. I have a project I'm working on where I have the option to project the camera to a quad, and then scale it up to keep those nice chunky pixels.

But there is a bit of "shimmering" that happens when the pixels don't perfectly land on the grid, producing a subtle aliasing type effect which is visible as shimmering.


I may end up leaving it in as a user enabled "pixel snap" setting, but beyond that I've learned to make peace with the not-so-pixel-friendly nature of Unity.
User avatar
9uile
Posts: 50
Joined: Mon Jan 13, 2020 4:57 pm

Re: WIP SHMUP : Learn basics

Post by 9uile »

I still don't know how to choose my ref resolution...
x480 y270 seems to be good to use the full size of an hd screen.
But...
If i want to use a resolution playable on a 1080p hd screen (yoko and tate) and on an arcade monitor (tate), is this resolution the better choice ?
x810 y1080 (ratio 3:4)

I would like to be sure about resolution before starting design, art and so on...
User avatar
casualcoder
Posts: 346
Joined: Sat Apr 21, 2012 4:35 am
Location: West Coast, Canada

Re: WIP SHMUP : Learn basics

Post by casualcoder »

I hear you. I was in the same circumstance recently when starting a vertical shmup project which will end up on lots of platforms, from mobile to console to PC, so I had to set my initial resolution first before doing anything else.

I settled on 480x270 as it scales well in all of the typical HD resolutions and allows the base pixel count I'm looking for.
User avatar
9uile
Posts: 50
Joined: Mon Jan 13, 2020 4:57 pm

Re: WIP SHMUP : Learn basics

Post by 9uile »

We are almost two having this res ! (480*270) :)
Do you use the pixel perfect unity package ?

Yesterday i'm looking for an alternative because this res is a bit wide.
I think that maybe 405*540 could be good (not tested yet).
why ? Because it's a ratio of 3:4 and it should be displayed correctly on hd screens.
Correctly because on :
yoko hd -> only black blocks on the right and left sides, full height used. (x810,y1080)
tate hd -> only black blocks on up and bottom, full width used. (x1080,y1440)

and with a 3:4 ratio, it should be also good on older screens... ?
(ps : i'm not interrested on smartphone res)
User avatar
9uile
Posts: 50
Joined: Mon Jan 13, 2020 4:57 pm

Re: WIP SHMUP : Learn basics

Post by 9uile »

I'm looking with existing (big INDIE) games to find good looking resolutions.

In Super Hydorah and Celeste, the resolution must be 320*180 because on the picture below (1920*1080) each pixel is stretched to a 6*6 square.
Super Hydorah :
https://game-guide.fr/wp-content/upload ... .44.13.png
Celeste :
https://cdn03.nintendo-europe.com/media ... ste_01.jpg

In Axiom Verge, the resolution must be 480*270 because on the picture below (1920*1080) each pixel is stretched to a 4*4 square.
https://gocdkeys.com/images/captures/ax ... -key-4.jpg

Maybe is more safe for a first dev to choose the smallest res 320*180.
IMO, with this res, pixel art is either shitty either good.
User avatar
9uile
Posts: 50
Joined: Mon Jan 13, 2020 4:57 pm

Re: WIP SHMUP : Learn basics

Post by 9uile »

Hi! New update.
I worked on enemy fire. This should cover a wide range of situations.
I did take a lot of time but if i make a shmup with shitty shoots, well ... it will be a shitty shmup ... :)

Enjoy !
Do not pay attention to the calculation of the fps at the top left corner, it messes when I capture the video from unity.
https://youtu.be/3MEfBRKQT14

Thank you for giving me your opinions as usual! :)
User avatar
heli
Posts: 585
Joined: Fri Sep 13, 2019 3:58 pm

Re: WIP SHMUP : Learn basics

Post by heli »

1 : You need a menu
2 : Game over
3 : Score

Once you have this framework, things will be simple.
Most important.

Learn C++, unity sucks with C# only.
For SHMUPs unity no good, you need something simpler that runs better.
Just tell me 1 good SHMUP thats made with unity ?
User avatar
9uile
Posts: 50
Joined: Mon Jan 13, 2020 4:57 pm

Re: WIP SHMUP : Learn basics

Post by 9uile »

Yes, you're right !
A menu, a gameover screen (so i need also a game ? :) ) and a score/highscore.
I think i need a pause and exit menu.

heli wrote:Just tell me 1 good SHMUP thats made with unity ?
I don't know but i learn unity with YT tutorials at first.
User avatar
heli
Posts: 585
Joined: Fri Sep 13, 2019 3:58 pm

Re: WIP SHMUP : Learn basics

Post by heli »

Good.
Once you have this system you can add games.
Empty project that works.

So many options ?, implement all and select per game.
pieslice
Posts: 200
Joined: Sat Mar 01, 2008 12:15 pm
Location: Finland

Re: WIP SHMUP : Learn basics

Post by pieslice »

heli wrote:1 : You need a menu
Learn C++, unity sucks with C# only.
That's not 100% true.

1. You can add native code via DLLs
2. The Core Engine features are native code, most likely C++ (this depends on platform; some Android features will run on Java for instance) - only scripts have the Mono Backend
3. In deployed builds the c# code will be re-compiled to C++ with IL2CPP
4. There are tools that allow you to write MonoBehaviours with C++
5. If you decide to opt out monobehaviours, chances are the ECS will run stuff faster than you can do by hand with C++ if you constrain your code to a single thread
pieslice
Posts: 200
Joined: Sat Mar 01, 2008 12:15 pm
Location: Finland

Re: WIP SHMUP : Learn basics

Post by pieslice »

casualcoder wrote:
But there is a bit of "shimmering" that happens when the pixels don't perfectly land on the grid, producing a subtle aliasing type effect which is visible as shimmering.
I may end up leaving it in as a user enabled "pixel snap" setting, but beyond that I've learned to make peace with the not-so-pixel-friendly nature of Unity.
If you have hierarchical object composed out of several sprites, you need to snap all of the child objects perfectly to the pixel grid so they will move nicely aligned to their parent.

This is not strictly Unity issue, you'll end up with this problem even in plain Graphics APIS (opengl etc.) if you do not make the correction maths for pixel perfect alignment.

Code: Select all

    public class CoinOnDestroyed : ShotLinearNonPhysics
    {
        public GameObject Coin;

        public override void Update()
        {
            base.Update();

            OnEmitterDestroyedDoOnce(
                shot => {
                    GameObject coin = GameObject.Instantiate(Coin);
                    coin.transform.position = shot.transform.position;
                    coin.transform.rotation = shot.transform.rotation;

                    RePoolOrDestroy();
                }
            );
        }
    }
Did you know that lambdas generate 8 bytes of heap every time they are called, so you should use methods instead of lambdas for callbacks that happen frequently.
pieslice
Posts: 200
Joined: Sat Mar 01, 2008 12:15 pm
Location: Finland

Re: WIP SHMUP : Learn basics

Post by pieslice »

heli wrote: For SHMUPs unity no good, you need something simpler that runs better.
Just tell me 1 good SHMUP thats made with unity ?
Psyvariar Delta
User avatar
9uile
Posts: 50
Joined: Mon Jan 13, 2020 4:57 pm

Re: WIP SHMUP : Learn basics

Post by 9uile »

Regarding this page,
https://levvvel.com/169-resolutions/
I think that my previous choice for my game resolution 480*270 was not good... (divisible by 8 to be a true 16:9)

Should i move to 640*360 which is a standard ? (360p)

edit : or 320*180 ?? but not divisible by 8...
User avatar
9uile
Posts: 50
Joined: Mon Jan 13, 2020 4:57 pm

Re: WIP SHMUP : Learn basics

Post by 9uile »

I make some progress with scrolling and build a simple level with UNITY 'rule tiles'.
I change my resolution to 320*180.
It's not so small when i open the gaming area.

Now i need enemies, it's so calm in here !!

https://www.youtube.com/watch?v=C23smsf ... dex=5&t=0s
Post Reply