clyde

Amateur Game Making Night

Recommended Posts

You guys are actually on to a classic problem. Unity is based upon a composition design pattern. It's something that is great for making games, but often doesn't fit well with object oriented languages or deep inheritance design.

Don't feel ashamed for designing components that inerhit straight from the core entity class (mono behaviour in unity). You're probably on the right track.

Share this post


Link to post
Share on other sites

God, me too. It makes me feel so inadequate. Hah.

It is rather intimidating, but it also makes it look possible.

Share this post


Link to post
Share on other sites

You got it, it's because this

for(int i = 0; i < array.Length; i++)
{
  //do something
}
looks nicer than:
int counter = 0;
while(counter < array.Length)
{
  //do something
  counter++;
}
The bonus is your counter variable (int i) is scoped only for the for loop.

If you put either of these in an Update method, would it initialize the i variable (or the counter variable) back to zero everytime it updated?

Share this post


Link to post
Share on other sites

I'm just going to say it here: I want to say thank y'all constantly for the advice and answers, but it would be half the posts in the thread so I don't. Know that your input is appreciated.

Share this post


Link to post
Share on other sites

The bonus is your counter variable (int i) is scoped only for the for loop.

 

Is this in unity right? Does it work the same in GameMaker? I'm not used to that!

Share this post


Link to post
Share on other sites

Is this in unity right? Does it work the same in GameMaker? I'm not used to that!

 

Yup, and you don't even have to declare the variable type in GameMaker.

Share this post


Link to post
Share on other sites

I use Matlab for my maths, so not declaring the variable type is the norm for me:) I get caught out on little things like that when I'm playing in other languages though.

Share this post


Link to post
Share on other sites

Haha, I'll try! :tup: Just for funsies last night I put a bunch of the AI characters on the track to race themselves. In this vine they're just chasing each others tail, but every once in a while someone got ahead of the pack! Hooray for that guy.

 

Next up is giving them a couple of different personalities, like one of them brakes a bit at every turn, playin' it safe. And also, I need to make it so they avoid obstacles, i.e. the player or anything I might put on the tracks. That would also hopefully fix them just stopping dead on walls..

 This could be a game in itself. I think it would be really fun to bet on the races. Maybe I can use my winnings to bribe competitors, sabotage cars, and take the risk of placing illegal modifications on them.

Share this post


Link to post
Share on other sites

It is rather intimidating, but it also makes it look possible.

Oh, no, it's not intimidating. I know it's possible. I could totally do everything he's doing, and probably faster (sans art)! (No offense.)

 

But I'm lazy, and so I feel inadequate and ashamed.

Share this post


Link to post
Share on other sites

Oh, no, it's not intimidating. I know it's possible. I could totally do everything he's doing, and probably faster (sans art)! (No offense.)

But I'm lazy, and so I feel inadequate and ashamed.

Well I look forward to playing games made by the inadequate and ashamed. Sounds kinda interesting.

FIGHTING!! (is what they yell to each other in romantic-comedy Korean dramas)

Share this post


Link to post
Share on other sites

Oh, no, it's not intimidating. I know it's possible. I could totally do everything he's doing, and probably faster (sans art)! (No offense.)

 

But I'm lazy, and so I feel inadequate and ashamed.

 

Offense Taken!

 

No, not really..

Share this post


Link to post
Share on other sites

One of the defining mistakes that beginners make when it comes to game design is not taking into consideration scope. In fact, I'm pretty sure that getting in way over your head is akin to how nearly everyone has a disastrous first love. I've heard that there are theories that "first love" is an evolutionary process we've acquired to introduce us to pitfalls of poor mate selection at an early age in development so we avoid making the mistake in the future when it counts.

 

When it comes to "first loves" I'm sure there are a few people who hit it out of the park the first try and have a happy life. However, like most people, what usually happens is that it teaches valuable lessons and hangs around in some fashion for a long time. What I'm trying to communicate is that it's important to start small for a good number of reasons, one of the major reasons is that a lot of folk who start up end up never finishing anything, ever. That leads to frustrations which in turn leads to giving up.

 

Start small, really small. Pong is a good start and if you feel like it's boring then try spicing it up but resist the temptation to start designing a multi-hour RPG or minecraft clone after you learn about OOP or classes, you'll struggle and probably give up due to frustration. Remember that it's a process and you're never going to know everything because it's an art and is still being innovated upon, that's part of the fun at least in my case. It's not about talent or determination, it's about not having a firm grasp of how long it may take to develop content. A lot of the games developed out there have many workers per team and even they usually underestimate the scope of their ideas.

 

I've been making games for about a year and a half and only recently completed my first solo project but I learned a lot by working on different aspects of development on different projects after an extended period of time. However, finishing a game was very satisfying and reaffirming so I highly recommend biting off only that which you are able to chew comfortably, there's no rush!

 

I'm new to using forums so I have some questions about some ideas I have:

 

1. How would I go about submitting a topic for sticky? Is there someone in charge I could speak with?

2. What is a good way to keep track of people who reply to my posts? I don't want to ignore someone who may have asked a question due to my ignorance. Is there software that is available or maybe the forum itself has an option to notify you if someone quotes or replies to your post?

Share this post


Link to post
Share on other sites

yeah the thing I started working on, when I finished the Unity book I was reading and going through, has really turned out to be kind of a monster in scope. I was having fun coding it and I'm really liking the scripting in c# part but I spent two days this week struggling to understand how animations and character movement would work. Not to mention my complete lack of understanding of how 3D modeling works (Blender is frightening). But I'm considering this "game" an extension of the learning process. Now that I understand how the Animator component works and how to animate sprites and deal with shaders a bit, I can use that in the future. But the game itself is kind of a giant mess. I've learned so much about C# and OOP in general recently to know that everything will need a complete rewrite anyway.

 

1. How would I go about submitting a topic for sticky? Is there someone in charge I could speak with?

2. What is a good way to keep track of people who reply to my posts? I don't want to ignore someone who may have asked a question due to my ignorance. Is there software that is available or maybe the forum itself has an option to notify you if someone quotes or replies to your post?

 

1. I think thats just up to the mod(s)

2. check your notification settings at your profile

Share this post


Link to post
Share on other sites
//Declare an array of type int
int[] myNumberArray;

//set a variable for length of the array so the loop knows when to stop
int arrayLength = 10;

//this is a standard for loop in c#
for(I = 0; I < arrayLength; I++)
{
   //you can do whatever you wish with your array in this for loop
   myNumberArray[i] = I;
}

Can you post your code?

 

I guess my question is why a foreach instead of a for loop?

 

I see that in C# elements are not mutable in a foreach loop. I don't use them often so I'm not super familiar with them but from what I can tell a foreach loop is good for outputting the elements of a list, not for mutating them. For instance in Unity you could use it to monitor values in a list of variables by using a foreach loop and inside doing Debug.log(arrayElement).

 

@danimo: I was thinking about starting a Unity questions thread seeing as there are quite a few people getting started and Unity being one of the more popular engines. Unity has an official Answers website but it's not somewhere I'd have a detailed discussion over time and I remember being hesitant to post my questions there starting out.

Share this post


Link to post
Share on other sites

YO GUYS THIS IS STILL A WORK IN PROGRESS BUT MY FLAPPY JAM GAME IS COMING ALONG NICELY I'D SAY??

 

http://www.twigbits.com/wp-content/uploads/poopybird/2014-02-21/Poopy%20Bird.html

 

(name will probably be changed to Twirly Bird because that's a much better name - thanks BigJKO!! - and, really, is the pooping necessary? (answer is no, no the pooping is NOT necessary))

 

Next up: rest of the art (made by my friend!), sound effects, actually keeping a score, and a menu (possibly with high score, possibly stored on my website so everyone can compete! O: ).

Share this post


Link to post
Share on other sites

YO GUYS THIS IS STILL A WORK IN PROGRESS BUT MY FLAPPY JAM GAME IS COMING ALONG NICELY I'D SAY??

 

http://www.twigbits.com/wp-content/uploads/poopybird/2014-02-21/Poopy%20Bird.html

 

(name will probably be changed to Twirly Bird because that's a much better name - thanks BigJKO!! - and, really, is the pooping necessary? (answer is no, no the pooping is NOT necessary))

 

Next up: rest of the art (made by my friend!), sound effects, actually keeping a score, and a menu (possibly with high score, possibly stored on my website so everyone can compete! O: ).

 

Nice! I like the variation in environments. The game play is appropriately frustrating.

 

One small criticism, I can't really get a clear view of the main sprite because it's always rotating. Thus I don't have an image in my head of what the bird actually looks like. Probably putting a still version of it on the menu screen it would fix that issue. Also, I was hoping for more actual poop in the game itself.

Share this post


Link to post
Share on other sites

Is there any specific reason why you can't edit elements of arrays using foreach? 

 

I think you could do internal edits of the object, but if you're talking about changing the order of the array, or adding or removing objects from the array, the reason is that a foreach is functionally similar to a for loop where you create a temporary variable to hold the current array object.

 

// objectArray is an existing array of objects

foreach(Object currObject in objectArray)
{
    // play around with currObject
}

for(int i = 0; i < array.Length; i++)
{
    Object currObject = objectArray[i];

    // play around with currObject
}

Because currObject is a temporary "pointer" to the object inside the array that only hangs around for this iteration, if you made it equal something else (ie. currObject = someOtherObject), it wouldn't affect the array itself.

 

It's generally a bit tricky to play around with ordering/adding/removing while you're iterating through an array in any case - the way I usually do it is to loop through once and figure out what I want to do (ie. make a list of objects to remove), and then do the operation in a way that isn't looping through the array.

Share this post


Link to post
Share on other sites

You can get some really wierd bugs from removing or adding items in an array when trying to loop through it, that's for sure.

Share this post


Link to post
Share on other sites

I agree with that for sure. In the past I cannot remember using an array for anything other than storing a group of objects together so they could be iterated through whenever I needed. I could see it being useful for 2D tiling somehow but I'm not sure how that'd work out.

Share this post


Link to post
Share on other sites

I agree with that for sure. In the past I cannot remember using an array for anything other than storing a group of objects together so they could be iterated through whenever I needed. I could see it being useful for 2D tiling somehow but I'm not sure how that'd work out.

 

Arrays are pretty good for pooling objects because you never delete from it, which is usually the thing that causes issues. You do shift stuff around but not in a way that should cause any problems.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now