• Ever wanted an RSS feed of all your favorite gaming news sites? Go check out our new Gaming Headlines feed! Read more about it here.
Status
Not open for further replies.
Oct 27, 2017
6,467
UGH! i just had a huge setback. Unity crashed and didn't save anything, now i can't even get the bird to jump when i tap when it used to do it just fine...fuck me.

So now the bird won't move and the pipes won't move but nothing changed in the scripts...AAAGH! game development sucks!!!
 
Oct 27, 2017
6,467
I feel you. I'm pretty much in the same boat. I do have some scripting experience in GameMaker, but Unity is a whole other beast. I have a billion tiny mistakes in every change I do.
Regarding your code: for the future, I'd advise you to name things in a less confusing way. like "isSapwnImmediate" for the bool etc. The more I code, the more I understand how important naming is - Because in the future, you'll also have a ton of methods and variables and if you don't give them names you can understand, you won't remember what and how to do with them later.
Good luck!

I do agree with Weltall Zero - I have no idea what delegates even are, and they really shouldn't be needed for building a flappy bird clone... Maybe you can switch to a simpler tutorial. Unity has some awesome stuff in learn.unity.com (it's where I'm going whenever I want to learn a new component or system.)
thanks, I'm like 2 hours into this tutorial. I just want to see it through to the end now, lol. i can't restart. haha
 

AfterCoffee

Member
Feb 18, 2019
118
UGH! i just had a huge setback. Unity crashed and didn't save anything, now i can't even get the bird to jump when i tap when it used to do it just fine...fuck me.

So now the bird won't move and the pipes won't move but nothing changed in the scripts...AAAGH! game development sucks!!!
Does console tell you anything?perhaps reference problems ?=)
 

Weltall Zero

Game Developer
Banned
Oct 26, 2017
19,343
Madrid
Thanks, yeah I am probably rushing a bit, but just wanted to get something under my belt, you know. I'll probably finish this project up and then take it slower from here.

EDIT: Weltall Zero My biggest problem is that I'll do exactly what he says and get an error where he doesn't. Like I put my pipes with the exact same variables as him using the parallaxer script and his move but mine remain stationary and i get an error that i don't understand where it's coming from. Very frustrating all things considered.

Sorry to be blunt, but if you don't understand what you're doing, I don't think you're really getting much under your belt, nor do I think that's your biggest problem. Following instructions blindly without understanding what you're doing is extremely limited as a formative experience. There are no shortcuts to actual learning. To that point, see below.

I feel you. I'm pretty much in the same boat. I do have some scripting experience in GameMaker, but Unity is a whole other beast. I have a billion tiny mistakes in every change I do.
Regarding your code: for the future, I'd advise you to name things in a less confusing way. like "isSapwnImmediate" for the bool etc. The more I code, the more I understand how important naming is - Because in the future, you'll also have a ton of methods and variables and if you don't give them names you can understand, you won't remember what and how to do with them later.
Good luck!

I do agree with Weltall Zero - I have no idea what delegates even are, and they really shouldn't be needed for building a flappy bird clone... Maybe you can switch to a simpler tutorial. Unity has some awesome stuff in learn.unity.com (it's where I'm going whenever I want to learn a new component or system.)

Let me redirect both of you to this post I keep redirecting people to. :)
www.resetera.com

Indie Game Development |OT 2018| Come, help, learn, show and tell!

I 200% recommend this set of online courses by the University of Michigan (particularly courses 1 and 4): the teacher is amazing and they are ridiculously complete, easy to follow, and comprehensive; they also start from one hundred percent entry level...
These are not just "tutorials", but fully fledged, college courses with an actual (and fantastic) teacher, designed for people who have never coded, and entirely free if you follow the steps in the post. The ones I recommend are frankly amazing and were my own springboard to Unity. I know all of this sounds too good to be true, so just try them for yourselves and be convinced. :)
 

dude

Member
Oct 25, 2017
4,634
Tel Aviv
Weltall Zero Thanks man! I'll take a look! I've mostly used YouTube tutorials of varying quality so far, so I'm sure that will come in handy.
I don't know if I'll do their whole course, because I learn best when I'm trying to do a specific thing. But I'll definitely give it a watch.

thanks, I'm like 2 hours into this tutorial. I just want to see it through to the end now, lol. i can't restart. haha
Honestly, 2 hours into a tutorial is nothing... and the one you were trying is way over-complicated for the end result. I'd just start a new one or try the resource above. You'd burn way less time in the long-run IMO.

BTW, Opinions - headbob when walking - yes or no? On the one hand, tiny extra bit on immersion, makes moving feel a bit less like sliding. On the other hand - a bit annoying.
 

Alic

Member
Oct 25, 2017
59
BTW, Opinions - headbob when walking - yes or no? On the one hand, tiny extra bit on immersion, makes moving feel a bit less like sliding. On the other hand - a bit annoying.

I'm pretty sure the correct answer is, if you don't need it (if your game doesn't feel like it needs it to become something interesting, or fun, or wherever you want to go with what you're making) don't add it yet. Only add the next thing that needs to be in there, and keep going like that until you have something you can watch people play. It can help to make a list of all the things you aren't adding, so you don't feel like they're just disappearing into the void. You can always come back to any little feature/game feel detail if you actually need it. Often a decision like this will become a lot more clear once you know more about what you're making.

That said, I have a tendency to do the exact opposite of this on personal projects. It's way too much fun sometimes to say "hmm... not sure if I need it, maybe I'll implement it and then I can test it both ways!" It feels like you're really learning in the best way, sometimes, when you let yourself do that.
 
Oct 27, 2017
6,467
Weltall Zero Thanks man! I'll take a look! I've mostly used YouTube tutorials of varying quality so far, so I'm sure that will come in handy.
I don't know if I'll do their whole course, because I learn best when I'm trying to do a specific thing. But I'll definitely give it a watch.


Honestly, 2 hours into a tutorial is nothing... and the one you were trying is way over-complicated for the end result. I'd just start a new one or try the resource above. You'd burn way less time in the long-run IMO.

BTW, Opinions - headbob when walking - yes or no? On the one hand, tiny extra bit on immersion, makes moving feel a bit less like sliding. On the other hand - a bit annoying.
His tutorial is three hours but it's probably taken me 5-6 to complete it😂😅. Just let me do this. I need it.
 

dude

Member
Oct 25, 2017
4,634
Tel Aviv
I'm so happy! The demo of my visual novel has been downloaded over 1000 times now!
Nice! Congrats! If you post a link it'll be at least 1001 ;)


I'm pretty sure the correct answer is, if you don't need it (if your game doesn't feel like it needs it to become something interesting, or fun, or wherever you want to go with what you're making) don't add it yet. Only add the next thing that needs to be in there, and keep going like that until you have something you can watch people play. It can help to make a list of all the things you aren't adding, so you don't feel like they're just disappearing into the void. You can always come back to any little feature/game feel detail if you actually need it. Often a decision like this will become a lot more clear once you know more about what you're making.

That said, I have a tendency to do the exact opposite of this on personal projects. It's way too much fun sometimes to say "hmm... not sure if I need it, maybe I'll implement it and then I can test it both ways!" It feels like you're really learning in the best way, sometimes, when you let yourself do that.
What I found out is that working only on what's needed can lead to having a lot of features implemented at like 80%, and then you have a game that is technically working but feels wonky and incomplete... I like to work by looking at "cost" (how much time and effort is needed to add something), next to "value" (how much of an effect it has on the game) and I also take in mind priority (how important it is at this point in development, which is a fuzzy thing at this early stage where everything is important.)
So, head-bobbing is pretty easy to do (low cost), has a low priority right now (traversing is working and feels alright, if a bit floaty) and the value is unknown (it could improve movement or make it worse, but in either case by a small amount.) So in this case, I'd agree that head-bobbing might not be what I should focus on right now, but it's also theoretically very easy to implement - So I considered adding it now. But yeah, I think it might have been procrastination tactic, since it's so minor and I don't even know if it'll improve the game in any way, so I'll just move on to other things haha.
 
Oct 26, 2017
3,913
UGH! i just had a huge setback. Unity crashed and didn't save anything, now i can't even get the bird to jump when i tap when it used to do it just fine...fuck me.

So now the bird won't move and the pipes won't move but nothing changed in the scripts...AAAGH! game development sucks!!!

Since scripts are not edited within Unity itself, at a guess I'd say your problem lies in your level rather than in your scripts.

Make sure all scripts are attached to the appropriate entities. Connect the debugger in visual studio assist and put breakpoints in the activation functions of your classes and make sure the classes are being hit.
 
Oct 27, 2017
6,467
Hi guys, finished the whole tutorial but still have that problem since the crash. I uploaded the whole project and have every script I made. If you have time I would love someone to check it out and let me know what I did wrong. Obviously only if it doesn't interfere with anything you're doing. I'll definitely take my time on the next game and learn more of the ends and outs of development on my own. But I think overall I did a good job even though I'm running into this problem.

A big problem is that this shows no errors. there's a facebook error when i first start the project, but after clearing them, it never shows up again and i did nothing with facebook so i don't understand why that comes up. There are zero errors in the scripts themselves and there's no errors for the things I do in unity itself, so i really don't know what is going on with the game at this point. I'm changing the bird later, so don't mind that it looks wonky.


Thanks for the help. I definitely appreciate it.
 
Oct 26, 2017
3,913
I don't know the specifics of "RequireComponent" in Unity, but make sure the entities upon which you are attaching these scripts do in-fact have those components on them. (Perhaps they were lost in the crash). Without that, I would assume a class instance of the script would not be created.

Also, attach your debugger as I suggested earlier. Put breakpoints in your Update functions and make sure they are all getting hit.
 
Oct 27, 2017
6,467
I don't know the specifics of "RequireComponent" in Unity, but make sure the entities upon which you are attaching these scripts do in-fact have those components on them. (Perhaps they were lost in the crash). Without that, I would assume a class instance of the script would not be created.

Also, attach your debugger as I suggested earlier. Put breakpoints in your Update functions and make sure they are all getting hit.
I attached everything he did the exact same way and his worked just fine. What kind of debugger do you suggest? Where do I get them from?

That's why I'm confused because I've followed every step he did, this time I think I definitely don't have any typos and yet still nothing is working like his did.
 
Oct 26, 2017
3,913
I attached everything he did the exact same way and his worked just fine. What kind of debugger do you suggest? Where do I get them from?

That's why I'm confused because I've followed every step he did, this time I think I definitely don't have any typos and yet still nothing is working like his did.

Have a read of this (Assuming you're using visual studio). The debugger is an invaluable tool on your gamedev adventures

(Specifically the debugging system)
 
Oct 26, 2017
3,913
Thanks a lot. I've been using the Visual Studio Code.


I'm not sure if VS:C has a similar guide, but it definitely has a debugger, hopefully you'll be able to find the info you need on how to connect it with a quick google.

The debugger lets you do lots of useful things. Some of the most handy features are:

* Breakpoints: Allows you to pause the execution of the code at a specific line and inspect what all of the class's variables currently are
* Call Stack: Useful when the game crashes. Allows you to see which line of code the game crashed on, and how it reached that line of code
 

Aurelioking

Member
Oct 28, 2017
61
For Weltall Zero and anyone else interested in using the Playable API for animations, here is how my hacky way works.
(if anyone with more experience with the API has any tips feel free to point out my dumb approach).

The player script is basically a Class based Finite State Machine built on a slight modification to this fsm system prime31 StateKit.
For a quick explanation on what a fsm is or how to implement one http://gameprogrammingpatterns.com/state.html (amazing resource btw, in C++).

Each state has an onEnter(), onUpdate() and onExit() method that get called when the state is entered, exited and onUpdate() is called every frame until the state is exited.

So for example the neutralPlayer, which is a subclass of the abstract Class State, is the following:
(i removed some parts of the code to only focus on the animation part)

C#:
public class NeutralPlayer : State
    {     
        AnimationClip idleAnimation;     
        PlayableGraph animGraph;

        public NeutralPlayer (AnimationClip idleAnimation) // constructor
        { 
            this.idleAnimation = idleAnimation;           
        }

        public override void onEnter()
        {
            base.onEnter();
            AnimationPlayableUtilities.PlayClip(actor.animator, idleAnimation, out animGraph);
           // the animationClip is played as soon as the state is entered, the graph animGraph is created by the AnimationPlayableUtilities utility.                   
        }     

        public override void onExit()
        {
            base.onExit();
            animGraph.Destroy(); // destroys the graph, when this state will be re-entered it will be re-created from scratch.
        }

        public override void onUpdate() { }

        public override void check_transition()
        {
            if (actor.controller.collisions.tDown && myInput.getButtonDown(0,inputAction.Cross))
                fsm.changeState<Jump>();
        }
    }

This works pretty well and is a clean way to separate player behaviours. check_transition() runs every frame and checks if the fsm can move to another state.
Note that an Animator component is still required to play animations, the AnimatorController however is not needed for this approach. In the documentation linked at the beginning of this post there is an example of mixing animations and AnimatorControllers in a graph.

But what if you want to execute some code at a specific frame of an animation?
For example if you have an Attack state and want to know when an attack animation is done so you can change state to neutral, or if from a specific frame of the attack animation you are able to jump cancel, how can you get that information?

My hacky solution is a mix of animation events and a helper Class :
On the animation clip i manually set up events which notify the helper class (which is basically made up of different boolean flags) and sets the corresponding flags to true or false.
When the state is exited these flags are all returned to false.
The code, using the Attack state as an example:

C#:
public abstract class Attack : State
    {
        public AttackHelper attackHelper;

        public ComboTree comboTree;      

        PlayableGraph animGraph;
     
        public Attack(AttackHelper attackHelper, ComboTree comboTree)
        {          
            this.comboTree = comboTree;
            this.attackHelper = attackHelper; // the helper class        
        }

        public override void onEnter()
        {          
            base.onEnter();  
            myInput = InputManager.inputManagerinstance;        
            isDone = attackHelper.isAttackDone = false;
            attackHelper.unsetFlags();
            attackHelper.setAttackCollider();
            AnimationPlayableUtilities.PlayClip(actor.animator, comboTree.getCurrentAttack().attackAnim, out animGraph);          
        }

        public override void onExit()
        {
            base.onExit();                
            attackHelper.clearHitCollection();          
            isDone = false;  
            animGraph.Destroy();            
        }

        public override void onUpdate()
        {
            isDone = attackHelper.isAttackDone;

            if(attackHelper.isActiveFrames)//checks if the attack is active
                attackHelper.checkAttackHit(comboTree.getCurrentAttack());      

        }

        public override void check_transition()
        {
            if (myInput.getButtonDown(0,inputAction.Square))
            {      
                if(attackHelper.canMoveToNextAttack && isDone == false)
                {
                    if(comboTree.hasNextLight())
                    {              
                        comboTree.moveToNextLight();
                        resetAttackState();                                          
                    }
                   
                }        
               
            }          

            if (isDone) // if the animation is done return to neutral, isDone gets its value from the AttackHelper helper class
            {
                comboTree.resetTree();
                fsm.changeState<NeutralPlayer>();  
            }
                   
               
            if(attackHelper.canJumpCancel && myInput.getButtonDown(0,inputAction.Cross))
            {
                Debug.Log("JUMPCANCELLING");
                fsm.changeState<Jump>();
            }
               
        }

        public virtual void resetAttackState()
        {
            onExit();
            onEnter();
        }

       
    }

Some caveats:
The events are kind of annoying to set up manually but only if you have lots of animations.
I don't use any blending between animations, if you do and use animation events make sure that they actually fire. Blending is supported in the Playable API.
In older versions of Unity people found that sometimes animation events would not fire (not sure, found reading old threads), i read somewhere (maybe the Unity forums) that the bug was fixed 100%.
I'm not an expert on animations, actually i'm not an expert period. This is just how my code evolved.

For anyone interested in animating an attack system i found this post where the/one of the devs from punch planet talked about how he handles attack animations, his user is wilpowrr https://old.reddit.com/r/Unity3D/comments/7nrm85/animating_an_attack_hit_boxes_weapon_trails/
He advises against using animation events, which i agree with, even if i'm using them it "feels" wrong. But i also just grab sprites from the internet for visualization purposes, i don't work with an artist.

I got the idea of using animation events by a mix of necessity, banging my head against a wall and this GDC talk by platinum games , they talk about animation flags around the 13 minute mark but i recommend watching it fully, very informative and entertaining (plus Yoko Taro).
 

Hanuli

Member
Oct 28, 2017
169
Finland
Finally made a jam game I'm proud of, check it out. The theme was parallel universe.

I played your game! It was very cool! I could see I being made into a full fledged puzzle game. I like that you didn't feel the need to explain everything to me and that the mechanics were simple yet have potential for lots of depth! I wasn't sure how to leave a rating, but I commented under the game.

---------------------------------------

Sometimes I have a problem with my writer that he doesn't take into account that I have to draw everything he writes in the story.

Example: A character is mentioned to wear an apron. Now I fucking have to draw the apron! I tell my dumbass friend to change the line because the apron is mentioned exactly once and I don't wanna draw it for one line!

He changes the line, but soon forgets and now the damn apron is mentioned 3 times in various places, so fuck it! I'm gonna draw the apron!
Here she is! The army veteran sass-ass wearing a cute apron!

Oqc6WxP.png
 

Alic

Member
Oct 25, 2017
59
Nice! Congrats! If you post a link it'll be at least 1001 ;)

What I found out is that working only on what's needed can lead to having a lot of features implemented at like 80%, and then you have a game that is technically working but feels wonky and incomplete... I like to work by looking at "cost" (how much time and effort is needed to add something), next to "value" (how much of an effect it has on the game) and I also take in mind priority (how important it is at this point in development, which is a fuzzy thing at this early stage where everything is important.)
So, head-bobbing is pretty easy to do (low cost), has a low priority right now (traversing is working and feels alright, if a bit floaty) and the value is unknown (it could improve movement or make it worse, but in either case by a small amount.) So in this case, I'd agree that head-bobbing might not be what I should focus on right now, but it's also theoretically very easy to implement - So I considered adding it now. But yeah, I think it might have been procrastination tactic, since it's so minor and I don't even know if it'll improve the game in any way, so I'll just move on to other things haha.

It sounds like you already have a good mental model developed for prioritizing these things. You're absolutely right that you have to work on the important little details to get the core of what you're making feeling good and not like a bunch of features 80% done.

Anyway, I don't know enough to give specific, useful input. I was assuming you're early in development on something, but I could be totally wrong. Your response made me think more clearly about what I was trying to say though, so I'm putting this down more for myself than for you :)

Expanding on what I was saying before, "cost" and "value" can be deceptive, because while it's easy to look at the cost of one thing, it's impossible to calculate the cost of all the little details you'll think about after you finish the detail you're working on, and so it can go, on and on, for a long time. And while it can seem like the value of some feature is clear, making value decisions about little details ("this will make my game feel a little closer to a polished aaa game") tends to make it a LOT harder to "kill your babies" when you realize that you should fundamentally change the design of your game, or just take the feel or aesthetic in another direction, and you've got a bunch of little details you love that will also have to die.

This is stuff I learned from other people when I started working on a team, but I haven't sat down to write about it. I think I'm particularly afraid of this stuff as a pitfall because I tend to do exactly the opposite when I'm working by myself, so talking about it and making it a conscious process (hopefully) really helps.


I'm so happy! The demo of my visual novel has been downloaded over 1000 times now!

Congrats! That is a really awesome milestone, here's to the first of many! Also, wishlisted -- it looks cool!

Finally made a jam game I'm proud of, check it out. The theme was parallel universe.

Just played it, really nice slow building puzzles! It feels like the beginning of a cool thing. What are the other games that do top down 2d/platformer 2d switching over the same space? I can't think of one right now.
 
Last edited:

Mipmap

One Winged Slayer
Member
Nov 1, 2017
378
Hi all, first time posting in here! I'm a 3D artist and animator kicking an idea around for a game.

I've been researching and experimenting with ways to make a game with clay-like, malleable characters in 3D (Unity). The goal is to make characters that can morph and blend between a variety of very different shapes. I've looked at metaballs, raymarched SDFs, marching squares, and several other techniques but these techniques are really performance heavy if I'm targeting something like the Switch.

Apologies if this is too technical, but the two techniques I'm leaning towards are:

1. Vertex Texture Animation from Houdini into Unity - This allows me to convert essentially anything to a polygon mesh, including liquid/melting sort of objects, using the shader to move the vertices around.
2. Alembic / geometry cached animation - Updating the geo every frame stop motion style. This gives the best results visually but I don't know if it can be optimized enough to target the Switch.

I could also look at rendering out stop-motion style animation as 2d sprites, since I'm going for a 2.5D style platformer. Ideally I'd like to keep it 3D geometry though.

Edit: Here's an alembic exported from Houdini to Unity as a test.
qvDvg9P.gif


Are there any other techniques I could look into, or any tips on optimizing morphing geometry? I can post some examples I've done as I get further along.
 
Last edited:

Benz On Dubz

Member
Oct 27, 2017
763
Massachusetts
Hi all, first time posting in here! I'm a 3D artist and animator kicking an idea around for a game.

I've been researching and experimenting with ways to make a game with clay-like, malleable characters in 3D (Unity). The goal is to make characters that can morph and blend between a variety of very different shapes. I've looked at metaballs, raymarched SDFs, marching squares, and several other techniques but these techniques are really performance heavy if I'm targeting something like the Switch.

Apologies if this is too technical, but the two techniques I'm leaning towards are:

1. Vertex Texture Animation from Houdini into Unity - This allows me to convert essentially anything to a polygon mesh, including liquid/melting sort of objects, using the shader to move the vertices around.
2. Alembic / geometry cached animation - Updating the geo every frame stop motion style. This gives the best results visually but I don't know if it can be optimized enough to target the Switch.

I could also look at rendering out stop-motion style animation as 2d sprites, since I'm going for a 2.5D style platformer. Ideally I'd like to keep it 3D geometry though.

Edit: Here's an alembic exported from Houdini to Unity as a test.
qvDvg9P.gif



Are there any other techniques I could look into, or any tips on optimizing morphing geometry? I can post some examples I've done as I get further along.

That is certainly very neat.

I think animating the vertices in the shader with a texture gives you a great trade-off between speed, flexibility, and quality. It should be fine on a Switch (and Unity) provided you budget correctly.

You can also bake the morph vectors into, say, the vertex colors and skip the texture fetch all together. This isn't flexible, but it's super fast and guaranteed to work on any modern hardware.

If possible, maybe consider a second dynamic vertex stream that you can update on the cpu for maximum flexibility (if Unity allows it). Use the smallest vertex format possible. You might have to get clever with Unity's scripting language to optimize it
 

issa

Banned
Oct 26, 2017
1,030
Riyadh, Saudi Arabia
I played your game! It was very cool! I could see I being made into a full fledged puzzle game. I like that you didn't feel the need to explain everything to me and that the mechanics were simple yet have potential for lots of depth! I wasn't sure how to leave a rating, but I commented under the game.
Thanks. Only other jam participants can rate it as far as I know.

Just played it, really nice slow building puzzles! It feels like the beginning of a cool thing. What are the other games that do top down 2d/platformer 2d switching over the same space? I can't think of one right now.
Thanks. I definitely see the potential of actually developing it further. Not sure if I've seen the switching idea before but the diving in shadows part is from a stealth Splatoon game idea I had a while back.
 

Mipmap

One Winged Slayer
Member
Nov 1, 2017
378
That is certainly very neat.

I think animating the vertices in the shader with a texture gives you a great trade-off between speed, flexibility, and quality. It should be fine on a Switch (and Unity) provided you budget correctly.

You can also bake the morph vectors into, say, the vertex colors and skip the texture fetch all together. This isn't flexible, but it's super fast and guaranteed to work on any modern hardware.

If possible, maybe consider a second dynamic vertex stream that you can update on the cpu for maximum flexibility (if Unity allows it). Use the smallest vertex format possible. You might have to get clever with Unity's scripting language to optimize it
Cool, I'll continue with the vertex animation path and see where it goes. Do you have any info or links on baking the morph to vertex color rather than using a texture? The position map that houdini exports is a very odd looking map so I'll have to see how that can be baked into the mesh. Thanks for the help!
 

Raonak

Banned
Oct 29, 2017
2,170
Havent posted here in a while, but I'm always chugging away on my games.

I made a trailer for DOT a few months back. It honestly looks quite neat now. way better than the previous trailer.


Due to google's new policy of requiring all android games to have a 64bit version, I had to make the decision to upgrade the engine from GMS1 to GMS2.
Which incurred a relatively heavy pricetag, because i had to re-buy the export modules. On the plus side, GMS2 is so much more pleasant to use than 1. Worthy upgrade I think.

After regaining the ability to port to android, i decided to take a crack at optimising the game. On PC it runs perfectly, but some of the later levels were chuggy, even dropping the PC frames from 500+ to less than 60 at times. Obviously, for such a basic looking game it had to be changed.

The optimisation efforts were a GREAT success.

As it turned out, collisions were the main problem, namely with vision cones. In a level with 10ish enemies, the collision logic for checking if a vision cone was hitting a wall was doing a check 660 times a frame, and since there were hundreds of wall instances in a level, it was hugely slowing down the game.
I decided, since the game is gridbased, to use a grid system.
Basically getting all walls to register the fact they are indeed walls in a grid data structure. each tile is 32x32, which corrisponds to 1 cell of the grid.
So now vision cones only had to do proper collision checks against "interactive objects" and just do a simple lookup check on the grid. I rewrote a lot of the movement logic to take into account the grid system too. Walls will now essentially register on the grid, then destroy themselves. massively reducing the instance count of any given level.

This rose the framerate of a later level from 15fps on android, to over 70fps. It runs so buttery smooth now.

The game is "feature complete" in that it works. technically, i just need to make the final boss, and I have a fairly basic game with 18 levels available.
But it feels like it's missing something. I'm not sure what though... I think it's missing "charm"? I can't really pinpoint what it is, but there is something it needs.
I wanted to add in some sort of basic story, but am having massive writers block, and i'm not sure if that'll even improve it at all.

---

In addition to that, i'm still working on my fangame, "Super Pokemon Eevee Edition".

Finished the 8th gym, and creating a train set piece. The train is the only way to reach "Victory Road" where the final boss of the game lies, but a snorlax is blocking the path, so you need to find a flute, to wake the snorlax, to board the train.


U5GHtEA.png


After numerous redesigns, I quite like how the train looks now. And well, like all train sequences, something interrupts the journey.
I wanted to do a full uncharted 2 style derailment sequence, but that'd just take too much work.

I'm planning the next update to end after the train set piece. And then the following update to reach the end of the game.
wow. Can't believe i'm almost at the finish line. quite eeiry since i've been working on the game since 2010... never though a pet project would spin into this whole thing.
 
Oct 27, 2017
6,467
Havent posted here in a while, but I'm always chugging away on my games.

I made a trailer for DOT a few months back. It honestly looks quite neat now. way better than the previous trailer.


Due to google's new policy of requiring all android games to have a 64bit version, I had to make the decision to upgrade the engine from GMS1 to GMS2.
Which incurred a relatively heavy pricetag, because i had to re-buy the export modules. On the plus side, GMS2 is so much more pleasant to use than 1. Worthy upgrade I think.

After regaining the ability to port to android, i decided to take a crack at optimising the game. On PC it runs perfectly, but some of the later levels were chuggy, even dropping the PC frames from 500+ to less than 60 at times. Obviously, for such a basic looking game it had to be changed.

The optimisation efforts were a GREAT success.

As it turned out, collisions were the main problem, namely with vision cones. In a level with 10ish enemies, the collision logic for checking if a vision cone was hitting a wall was doing a check 660 times a frame, and since there were hundreds of wall instances in a level, it was hugely slowing down the game.
I decided, since the game is gridbased, to use a grid system.
Basically getting all walls to register the fact they are indeed walls in a grid data structure. each tile is 32x32, which corrisponds to 1 cell of the grid.
So now vision cones only had to do proper collision checks against "interactive objects" and just do a simple lookup check on the grid. I rewrote a lot of the movement logic to take into account the grid system too. Walls will now essentially register on the grid, then destroy themselves. massively reducing the instance count of any given level.

This rose the framerate of a later level from 15fps on android, to over 70fps. It runs so buttery smooth now.

The game is "feature complete" in that it works. technically, i just need to make the final boss, and I have a fairly basic game with 18 levels available.
But it feels like it's missing something. I'm not sure what though... I think it's missing "charm"? I can't really pinpoint what it is, but there is something it needs.
I wanted to add in some sort of basic story, but am having massive writers block, and i'm not sure if that'll even improve it at all.

---

In addition to that, i'm still working on my fangame, "Super Pokemon Eevee Edition".

Finished the 8th gym, and creating a train set piece. The train is the only way to reach "Victory Road" where the final boss of the game lies, but a snorlax is blocking the path, so you need to find a flute, to wake the snorlax, to board the train.


U5GHtEA.png


After numerous redesigns, I quite like how the train looks now. And well, like all train sequences, something interrupts the journey.
I wanted to do a full uncharted 2 style derailment sequence, but that'd just take too much work.

I'm planning the next update to end after the train set piece. And then the following update to reach the end of the game.
wow. Can't believe i'm almost at the finish line. quite eeiry since i've been working on the game since 2010... never though a pet project would spin into this whole thing.

Looks really good to me and I like the aesthetic a lot. I'm super jealous. How long did it take to make?

So I fixed the flappy Bird clone but now I can't get some of the things to show up in the scene or background. This is really getting on my nerves. I think it might be because he made this with an older unity build in mind so my stuff just isn't working the same way. It's so hard to tell.
 

Benz On Dubz

Member
Oct 27, 2017
763
Massachusetts
Cool, I'll continue with the vertex animation path and see where it goes. Do you have any info or links on baking the morph to vertex color rather than using a texture? The position map that houdini exports is a very odd looking map so I'll have to see how that can be baked into the mesh. Thanks for the help!

You bet.

I'm unfamiliar with houdini's position map, but if it contains displacements, you can normalize the values and plug them directly into your vertex colors with an export script.

If not, you can get the before and after positions of a vertex one of your tools:
1. Calculate (newPosition - oldPosition)/maxPossibleDisplacement for each vertex. This should be a value from 1 to 0.
2. Plug the result into vertex color and export.
3. Multiply vertexColor by maxPossibleDisplacement in your vertex shader to recover your morph vector.
4. Add this to your vertex's position

If this is too much work, just use the texture map. I think you'll be fine :)
 

Weltall Zero

Game Developer
Banned
Oct 26, 2017
19,343
Madrid
For Weltall Zero and anyone else interested in using the Playable API for animations, here is how my hacky way works.
(if anyone with more experience with the API has any tips feel free to point out my dumb approach).

The player script is basically a Class based Finite State Machine built on a slight modification to this fsm system prime31 StateKit.
For a quick explanation on what a fsm is or how to implement one http://gameprogrammingpatterns.com/state.html (amazing resource btw, in C++).

Each state has an onEnter(), onUpdate() and onExit() method that get called when the state is entered, exited and onUpdate() is called every frame until the state is exited.

So for example the neutralPlayer, which is a subclass of the abstract Class State, is the following:
(i removed some parts of the code to only focus on the animation part)

C#:
public class NeutralPlayer : State
    {    
        AnimationClip idleAnimation;    
        PlayableGraph animGraph;

        public NeutralPlayer (AnimationClip idleAnimation) // constructor
        {
            this.idleAnimation = idleAnimation;          
        }

        public override void onEnter()
        {
            base.onEnter();
            AnimationPlayableUtilities.PlayClip(actor.animator, idleAnimation, out animGraph);
           // the animationClip is played as soon as the state is entered, the graph animGraph is created by the AnimationPlayableUtilities utility.                  
        }    

        public override void onExit()
        {
            base.onExit();
            animGraph.Destroy(); // destroys the graph, when this state will be re-entered it will be re-created from scratch.
        }

        public override void onUpdate() { }

        public override void check_transition()
        {
            if (actor.controller.collisions.tDown && myInput.getButtonDown(0,inputAction.Cross))
                fsm.changeState<Jump>();
        }
    }

This works pretty well and is a clean way to separate player behaviours. check_transition() runs every frame and checks if the fsm can move to another state.
Note that an Animator component is still required to play animations, the AnimatorController however is not needed for this approach. In the documentation linked at the beginning of this post there is an example of mixing animations and AnimatorControllers in a graph.

But what if you want to execute some code at a specific frame of an animation?
For example if you have an Attack state and want to know when an attack animation is done so you can change state to neutral, or if from a specific frame of the attack animation you are able to jump cancel, how can you get that information?

My hacky solution is a mix of animation events and a helper Class :
On the animation clip i manually set up events which notify the helper class (which is basically made up of different boolean flags) and sets the corresponding flags to true or false.
When the state is exited these flags are all returned to false.
The code, using the Attack state as an example:

C#:
public abstract class Attack : State
    {
        public AttackHelper attackHelper;

        public ComboTree comboTree;     

        PlayableGraph animGraph;
    
        public Attack(AttackHelper attackHelper, ComboTree comboTree)
        {         
            this.comboTree = comboTree;
            this.attackHelper = attackHelper; // the helper class       
        }

        public override void onEnter()
        {         
            base.onEnter(); 
            myInput = InputManager.inputManagerinstance;       
            isDone = attackHelper.isAttackDone = false;
            attackHelper.unsetFlags();
            attackHelper.setAttackCollider();
            AnimationPlayableUtilities.PlayClip(actor.animator, comboTree.getCurrentAttack().attackAnim, out animGraph);         
        }

        public override void onExit()
        {
            base.onExit();               
            attackHelper.clearHitCollection();         
            isDone = false; 
            animGraph.Destroy();           
        }

        public override void onUpdate()
        {
            isDone = attackHelper.isAttackDone;

            if(attackHelper.isActiveFrames)//checks if the attack is active
                attackHelper.checkAttackHit(comboTree.getCurrentAttack());     

        }

        public override void check_transition()
        {
            if (myInput.getButtonDown(0,inputAction.Square))
            {     
                if(attackHelper.canMoveToNextAttack && isDone == false)
                {
                    if(comboTree.hasNextLight())
                    {             
                        comboTree.moveToNextLight();
                        resetAttackState();                                         
                    }
                  
                }       
              
            }         

            if (isDone) // if the animation is done return to neutral, isDone gets its value from the AttackHelper helper class
            {
                comboTree.resetTree();
                fsm.changeState<NeutralPlayer>(); 
            }
                  
              
            if(attackHelper.canJumpCancel && myInput.getButtonDown(0,inputAction.Cross))
            {
                Debug.Log("JUMPCANCELLING");
                fsm.changeState<Jump>();
            }
              
        }

        public virtual void resetAttackState()
        {
            onExit();
            onEnter();
        }

      
    }

Some caveats:
The events are kind of annoying to set up manually but only if you have lots of animations.
I don't use any blending between animations, if you do and use animation events make sure that they actually fire. Blending is supported in the Playable API.
In older versions of Unity people found that sometimes animation events would not fire (not sure, found reading old threads), i read somewhere (maybe the Unity forums) that the bug was fixed 100%.
I'm not an expert on animations, actually i'm not an expert period. This is just how my code evolved.

For anyone interested in animating an attack system i found this post where the/one of the devs from punch planet talked about how he handles attack animations, his user is wilpowrr https://old.reddit.com/r/Unity3D/comments/7nrm85/animating_an_attack_hit_boxes_weapon_trails/
He advises against using animation events, which i agree with, even if i'm using them it "feels" wrong. But i also just grab sprites from the internet for visualization purposes, i don't work with an artist.

I got the idea of using animation events by a mix of necessity, banging my head against a wall and this GDC talk by platinum games , they talk about animation flags around the 13 minute mark but i recommend watching it fully, very informative and entertaining (plus Yoko Taro).

I'm on vacation right now but I'll try to remember and give this a thorough check when I get home, thanks! :)
 

Incarne

Member
Aug 29, 2018
18
Hey guys, here are a few recent characters I've made for the Zelda-like game I'm working on. Any critiques welcome!

s41es59.png


w5eehRD.png


hVZj4mE.png
 

Hanuli

Member
Oct 28, 2017
169
Finland
Hey guys, here are a few recent characters I've made for the Zelda-like game I'm working on. Any critiques welcome!

s41es59.png


w5eehRD.png


hVZj4mE.png

These look really cool! Maybe a bit unsettling. Are you going for a majora's mask kind of vibe? I know nothing about modeling, so I can't give advice, but I think the models look clean and professional.
 
Oct 27, 2017
6,467
Why can't I just get this game to work. I really need help. I even restarted the fucking project using his code that he put on a public GitHub type website and I still run into fucking problems. Now it says NullReferenceException : Object Reference not set to an instance of an object...but that's bullshit because I did exactly what he did again and even used his own fucking code. the only difference is I used a different sprite than him. I just really need someone to help me take a look at the fucking thing.


I'm using his TapController which works fine on his project of the game. but mine doesn't work like his does even though I did everything to the damn letter.!!!!

And when I open his project in my unity and everything works and all I want to do is change the sprites to what I want them to be and I can't. Say I want the pipes to become buildings and I switch the pipe sprite to my building sprite, when i click play, his pipes still show up. I just need help. I'm going crazy doing this. If anyone has time please let me know.
 

Incarne

Member
Aug 29, 2018
18
These look really cool! Maybe a bit unsettling. Are you going for a majora's mask kind of vibe? I know nothing about modeling, so I can't give advice, but I think the models look clean and professional.
Thanks a lot buddy. By unsettling, do you mean scary? I am channeling some of my favorite Zelda's for this project. Pretty excited to see things come to life!

  • Wind Waker - In terms of cartoon, cell-shaded visual charm.
  • Majora's Mask - Dark theme, story telling, NPC Depth / side quests
  • LttP - Dungeons, puzzles, etc
 

Hanuli

Member
Oct 28, 2017
169
Finland
Thanks a lot buddy. By unsettling, do you mean scary? I am channeling some of my favorite Zelda's for this project. Pretty excited to see things come to life!

  • Wind Waker - In terms of cartoon, cell-shaded visual charm.
  • Majora's Mask - Dark theme, story telling, NPC Depth / side quests
  • LttP - Dungeons, puzzles, etc
Scary might be a bit strong word? Maybe scary-lite? I think you've done well with the atmosphere if you try to emulate those games!
 

Incarne

Member
Aug 29, 2018
18
Scary might be a bit strong word? Maybe scary-lite? I think you've done well with the atmosphere if you try to emulate those games!
Thanks! Good to know it is scary-lite hehe

These are all amazing, but the skeleton with the octopus tentacles as goat / demon horns is "Greninja's tongue is his scarf" levels of freaking genius. Hats truly and well off, love it!
Whoa thanks! That comparison means a lot! :D

I love these. Awesome job!
:D :D
 
Oct 27, 2017
6,467
Finally figured out all the problems and now I'm trying to build and run but unity can't find my Android SDK. Even though I've got the latest Android studio installed. Anyone know what to do about that?
 
Status
Not open for further replies.