Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

370 Neutral

About nesseggman

  • Rank
  1. nesseggman

    forget c++

    I started with C++ as my first language and then branched out to Java and C#. Later I learned less similar languages, like Python.   Going back to C++ of course sometimes you will need to use reference a little more than normal, you're not going to "forget" it.   Think of it like playing a game at the arcade, and then playing a game on a home console port. You don't forget how to play the arcade game just because you are playing the home version. Programming is the "game" and the console or control is your "language." If you play at the arcade again after playing your home version for a long time, you will of course have to get used to it again but you will not have forgotten how to play.   EDIT: It was said, but your goal is not to memorize a language. Even professional developers of many years still use language references. They don't have the whole language memorized inside and out. As you get experience you will of course memorize more and more syntax, but you'll never know every last thing and retain it fully. And it's much more useful to be familiar with many languages than to know one single language at such an arbitrary level of perfection.   The skills you gain by learning C++ will transfer to C#. C++ and C# are very similar, and at your level, you probably won't even notice much difference at this point.
  2. Thanks so much !!   @eck - OK, I understand your Option 1 better now. When I read it before, I thought you meant to create the affectedStats variable within the Parameters/CharacterStats class as a member of that class, not as a member of the Potion class. It was just an ambiguity of English language that I interpreted improperly :) And I understand why you were using CharacterStats. I just use "Parameters" because in Japanese games the characters' stats are always called Parameters and I refer to them as such often and it just feels natural to me. Though I probably should've thought about it more and used a different name for the sake of this topic :)   @npyren - Thank you! I will have to learn about delegates and lambda expression because this is something I haven't explored yet. Even if it doesn't lead to a solution that fits for my problem now, a big part of wanting to make this RPG was that I knew it would challenge me to learn much more about programming concepts and language tools without being too overwhelming.   Thanks everyone for their answers :3
  3. @Hodgman: Thanks for the reply. I realize that classes work that way, but what I'm wanting to do is point to a value (a member variable of a class), and not the class itself. There are many different variables in the class Parameters and I want the Potion class to know which one to access in its own functions. I realize I can point to a member it to access it once, but I want to be able to hold a reference to know which member to access each time. IDK if I am explaining this properly, sorry.   @Eck: Thank you. I was originally doing pretty much exactly what you used for the example in Option 2, but I felt like there should be a more simple/compact way to do it.   I feel like this is similar to what you meant in Option 1 but I'm not really sure. Would it be possible for you to expand on that just a bit more?   Specifically, "If your Potion has a CharacterStats member variable named affectedStats," what type of variable would affectedStats be and what would it hold? It still can't hold a refernece or pointer, so I don't think I'm understanding this example properly. Plus every instance of Potion would have a different affected stat and I'm not sure how it would keep track of that.   What I'm wanting to do is point to a value/class member variable, and not the class itself. I feel like Option 2 will end up being the way I have to go, though.   I just feel like there's some kind of better way that I'm missing though. Like as if there should be a way to just store in a variable which of the CharacterStats variables I want to affect, and just be able to use that variable to change the value.   Like to just be able to write a single line like target.CharacterStats.affectedStat += potionStrength; and just be able to have affectedStat essentially 'point' to one of the CharacterStats variables, and be different for every created Potion object.   I realize what I just typed doesn't actually make sense, but I feel like it should be that simple. Is it just not possible to do something like this or something similar enough/simple enough in C#?   I also realize after typing that example that what I was trying to do wouldn't really work with a pointer anyway, as there's no actually instantiated variable with an address to point to in this case. But just... I feel like there's a solution here I'm not seeing. Perhaps I'm not explaining what I want to do well enough to 'click' with the right answer, or perhaps what I'm wanting to do simply isn't possible in any simple form like I'm imagining.   I don't mind doing the Option 2, as that's what I was originally doing anyway, but if there's a better way, I'd like to know about it/try it. I feel like this kind of concept could be really useful for all kinds of things in the future, too.
  4. I'm a self-taught noob and taught myself programming with C++, but now I'm building a game in Unity with C# and I'm fairly new to C#.   I have a class called Parameters that pretty much is just a giant list of variables of stats (HP, attack, defense, etc.) for the game's characters.   Then I have a class called Item and a child class called Potion.   I want the Potion class to be able to hold a variable that tells it which one of the variables in the Parameters class it needs to affect.   I don't want to create a separate class for weapon potion, health potion, defense potion, etc, so that an individual instance of Potion could be easily customized by a random generator (or player generation system). And then I could just call the Use() function of the Potion class that does something like whateverVariableInParametersThisItemWorksWith += potionStrengthValue.   I feel like the way I should accomplish this is have a pointer within Potions that points to a variable in Parameters. But... that's not really how C# is supposed to work, so I really don't know what to do. I don't want to use a pointer and I want to understand C# better...
  5. nesseggman

    Is Unity 3d right for a horror game?

    As for the lighting in Unity, since it was mentioned in a few comments, the free version of Unity is really terrible with built-in lighting. Pretty much you're not going to get any decent lighting or shadow effects whatsoever, unless you can program them yourself essentially from scratch. The engine features for lighting are pretty much ALL restricted until you buy the pro version for $1500.   This can be detrimental to your game if you want to rely on lighting for effect. Though there are workarounds, of course, but it will be a huge pain and you'll have to know a lot about lighting.   However, you can still make a very creepy game without using the lighting effects. Personally I think the game Clock Tower on SNES is very creepy and it's made with bright 2D sprites. Into the Gloom on Desura is a really creepy game made in Unity's free version. Personally it scared me a lot. It doesn't use lighting effects to create atmosphere but is still very scary.The recently popular Five Nights at Freddy's game is completely 2D and used pre-rendered 3D stills (which you can make in something like Blender). The infamous Imscared was made in GameMaker, an engine designed for 2D, and doesn't use advanced lighting or anything to be scary, but rather some unique mechanics and 'story.' (The links are to YouTube plays of those games if you were curious to their gameplay).   In short, there are tons of examples that the engine is not what is important to make a horror game; it's all in the design.   Since you don't seem to have a very strict idea of what you're wanting to make right now, consider designing your game around a concept that won't need intricate lighting if you're using the free version of Unity, or if you really want to do some intricate lighting, look elsewhere or buy the pro version of Unity.
  6. nesseggman

    [Game] Mustache Ride

    Hey guys :) I've finally finished and released my first 'real' game.   It's a web game on Kongregate, but I'm working on a mobile version, too <3   You can play it here. It's a score-attack infinite flyer type game. It's actually really fun to try and get the high scores and stuff. During development I would get addicted to playing and just want to play it instead of work on it. I really created a game that I would personally love. Even after the 2 months it took me to make it, and all the testing and playing I've done, I still play it every day. It's a lot of fun!   Hope you guys will check it out <3 I'm personally very proud of it. If you have a Kong account please feel free to rate the game and compete on the leaderboards!   If you wanna learn more about the game before playing, I made a dev blog and IndieDB page for it.
  7. nesseggman

    Game Maker Studio?

    Personally, I found GMS able to make games more easily and more naturally than other popular engines, if you're wanting to make certain types of games, particularly more simply 2D games; however, the cost of the export packages is pretty steep when you can export to all the same platforms on something like Unity for free (which also does 2D pretty well now). I also was very frustrated with GMS's sound capabilities (or lack thereof). Hope you don't want looping music in your game or anything like that.   It's pretty limited, but if you're creating something that works fine within those limitations, I think it's great. The organization and combination of scripting + drag/drop makes for really fast production on 2D games.
  8. nesseggman

    Fruit Dating

    Very cute! I love the apple with the pink mustache <3 <3
  9. You won't memorize the entire method of how to do something on just one walkthrough with a tutorial anyway, so it's normal to have forgotten stuff.   Instead of immediately jumping for a tutorial, try at least coming up with an idea on your own. Programming isn't so much typing code and memorizing languages and engines as it is problem solving and creating solutions. The language and engine are just tools that assist you with that. But the actual solutions you come up with in your head are the real 'program' :)   It may seem intimidating, but it's good to fail. You can't get better without failing first. Just try to come up with the idea, and then use the Unity manuals and documentation to try to find a way to do it. Until you get really used to Unity and have a lot of experience with it, you might not really know where to look, so it will be really hard at first.   If you think you've found something that works, go ahead and put it in your project! If you can't come up with a solution, or you think yours is really messy and probably shouldn't go into your game, try looking up a tutorial. Also, think of tutorials more like examples rather than actual lessons on how to do things. What you should be taking from them is the general concepts. You can apply them to all kinds of situations!   And, don't feel bad that you have to look something up. Even the most experienced programmers still look up stuff in the documentation for languages and engines. The more you do it, the more you'll memorize, but no one expects you to memorize every sing keyword and function and monobehavior and etc. It's normal to have to look it up. So if your problem is that you don't remember the exact thing you're supposed to type, that's completely normal and not even a beginners' thing. A lot of people keep a reference list of the stuff they need to remember the most. Especially when you jump between languages with pretty different syntax, it's nice to know stuff like... how a for loop works or something. So just have a little notebook with the most common stuff like that, or whatever.   And you will need tons and tons of practice before you just come up with solutions with ease. In the beginning, you're going to have to think about it a lot, and will probably come up with plenty of crummy solutions along the way. It's totally fine!!   I guess what I'm saying is don't feel bad or feel like you're failing. You're right on track and you're doing exactly how you should. The best way to grow is to challenge yourself, so instead of immediately falling to a tutorial, try your own solution first, then go to the tutorial. This is normal! Even pro devs talk about their solutions with each other to get new ideas (that kind of thing is why forums like this exist!) so it's normally to learn from other people, whether it's a tutorial or whatever.
  10. nesseggman

    Learning Unity

    OK, sorry, this whole time I thought Unity used JavaScript (which I guess it does in the form of UnityScript, but I thought it was just regular ol JS)... I'm even using Unity right now and can see in my head options for JavaScript, but I guess I was wrong (I do it all in C#).   And when editing some stuff out of my post, I accidentally removed a critical part -- Codecademy doesn't have C#, but you can learn Java there, which has a similar syntax to C# (moreso than Python and stuff) which will make getting into C# easier. That's what I meant by that.
  11. nesseggman

    Learning Unity

    You can also use Java in Unity (doesn't have to be C#) I don't know a good resource, becuase I learned C++ first and then just picked up C# by using the documentation for it (since they're quite similar in context) and playing around with it and troubleshooting. Oh, I do love Microsoft's official tutorials (the ones with Bob Tabor).   Here, I went and looked it up:   http://channel9.msdn.com/Series/C-Sharp-Fundamentals-Development-for-Absolute-Beginners   I have no idea how good it is, but I used his tutorials to get into Windows Phone development and they were great. He's easy to listen to and usually explains things in enough detail to take in without having to repeat the video or anything.   Codecademy.com is a great for complete beginners to coding. Use the Java course if you're wanting to get into C# right away, but honestly I'd just stick to Java since you can use that in Unity instead of C#, and C# is Microsoft-focused and meant to be used on Windows. It's not really appropriate for programming an iOS game anyway. Someone correct me if I am mistaken on this, though, because I don't touch Apple products. However, I would strongly suggest just learning programming (in general) and game design and programming in quite a bit of detail before moving onto Unity. Make at least one graphical game without an engine, just using gaming libraries or something, before using an engine. I can't stress this enough! In the forums for popular engines like Unity and GMS, there are so many questions asked that show that people have no idea what the engine is even there for and how games work in general. So we pretty much have to explain a LOT more to them than really needed, and we're explaining concepts outside the scope of the engine. Which is fine, the forums are there for community help, but they will encounter more and more problems in the future until they understand these kinds of concepts. Things like object-oriented programming, game loops and updates, etc. Plus, if you're wanting to develop for a platform like iOS, you need to learn how iOS programming works. Each platform has its own structure that you'll need to understand that is different than programming for your home computer (which is probably what you'll be learning with at first!) Using a game engine like Unity is a lot like using professional music composition/notation software. You can learn how to use the software all you want, but if you don't know how to compose music, you won't get much out of it. Even if you learn how to notate music (which is kinda like simply learning basics of a programming language), actually making a musical composition will be difficult. You have to understand music theory and actual composition before you can use the software to help you actually compose a piece.   And depending on the type of game you want to make, you may consider other engines. Many engines are good for iOS games (as it's a very popular platform). Unity is great for physics-based action-focused games, and especially 3D games (though it now has 2D game structure built-in, too!). But other engines may be better for other things. I feel like turn-based/menu-based games or games that require no physics like SHMUPS are more easily constructed developed in something like GameMaker Studio (though it costs money, compared to Unity, which is free, and overall more fleshed-out), though GMS has a lot of other downsides. Of course, it's not impossible to make whatever you want in Unity, but it's not always the best engine for every project. Once you learn about coding and game programming, learn about many engines that are compatible with iOS and see which work best for whatever project you want to take on. Once you understand the basics, you'll be able to make a more educated decision on what engine you want to use. You may even decide you don't want to use an engine at all and can just use the toolkits provided by Apple to make your game in a more "from-scratch" format :)
  12. nesseggman

    adventure dungeon game

    I played this but I haven't looked at the source code. Here's some things I noticed, and some suggestions on where to go next if you'd like to improve it/fix it:   * If you go into the space with a sword repeatedly, you will continue to pick up the sword. Since there's no indiciation of inventory, I can't tell if I'm getting multiple swords, or if it's just giving me the notification for walking on the space. * When I fought the monster on the left, I got stuck. First I killed him, then he refought (like people have been saying) but no matter how many times I hit him, neither of us died. I pressed f like a million times. * The map doesn't display again after a battle, so I have no idea where I am if I've forgotten my location. Since it updates every move phase, I think it should update here, too.   Here's some things you could try adding, that I think would be a good challenge based on what it seems you can do so far:   * Have the room be a random size and shape (even if it's just differenlty proportioned rectangles), instead of the same square every time. * Have monsters and items appear at random locations. You don't have to have random amounts -- it could always be the same sword and two monsters, but in different places every time. * Have a victory and loss condition (run out of HP and die, defeat all monsters and win, for example) * Different weapons with different abilities, that they player can choose to replace with his current weapon.   Once you've done those, you can even try adding monsters that move and chase the player (or run, or do different things... they could have a simple AI). So you'll have to make an AI and turn-taking system.   Though to add these things, it might be good to look into object-oriented programming. I think that seems like a good next step after this. I haven't looked at the source code yet, but it doesn't seem like you're using classes based on the way it plays.   For example, if you wanted the monsters to be of random types and in random places, you could make a monster class, and when creating the initial map, create monster objects and assign them random coordinates (which are stored in the class in variables). Stuff like that. This will also make the program more expandable so you can add new things more easily.   OK, I decided to downlaod the source code. It's very difficult to read. Like said, use comments everywhere. Unless something would be glaringly obvious to someone looking at your code (imagine they've never even run the program and they're JUST looking at the code, figuring out what it does... they might not even know it's a game... pretend they'll never run the program and need to figure it out just from the code... comment all the time!)   Also, the formatting... like said, white space is important. You want to tab stuff. When your blocks are indented, they are a lot easier to read... especially when there are blocks within blocks. Just looking for braces nad trying to figure them in your head is a strain.   This will not only help others reading your code, but it will help you, too. If you leave to work on something else, then come back to this project later, you may find you have no idea what your code even does anymore... and without comments and nothing being indented or spaced well, you will have a lot of trouble trying to figure out how your program works anymore.
  13. (tl;dr: I was doing some BSP division of a parallelogram and getting undesired results, and since this was my first time really utilizing recursion in a meaningful way, I thought the problem was in my implementation... turns out it was just my RNG was giving the undesired results only when the program was run at normal speed, rather than stepped through. Declaring the System.Random object with program scope, rather than within the function using it, solved this... yay X_X)   I am attempting to cut a rectangle into two parts of random size at random direction (either horizontally or vertically). Then take each of those child rectangles and cut them... and keep doing this until the rectangles are "too small to cut."   I have a rectangle class that holds the minimum x and y in the rectangle, as well as its width and height (so all four corners can be calculated with this).   The plan is the create an array of something like x & y coordinates and "fill" each of the final children into it, to create "areas" to be used in random dungeon generation. Right now I'm just trying to get the array to fill up with numbers that will display as rectangles.   I'm pretty sure the rectangles are dividing properly, the problem is getting the final rectangles into the array. I've been storing all the rectangles in a list, and then checking through each rectangle in the list. If it has no children, it will then search through every 'node' in the array, and if it falls within the rectangle, it will assign it that rectangle's index number from the list (so that each rectangle now is uniquely numbered and "graphed" in the array).   I don't think I'm properly extracting the smallest of the children from the array... either that or my rectangles are not actually being created properly.   I've gone through step-by-step, and checked all the variables at the end. There are so many rectangles I'm not sure really what to look for. The final display also seems to always be cut horizontally or vertically, even though stepping through, there are cuts of both directions aplenty.   I've been at this for a couple days now, and this is the best I could come up with: class Program { public static int DUNGEONSIZE = 8; public static int MINSIZE = 5; static void Main(string[] args) { int borders = DUNGEONSIZE * MINSIZE; // create the dungeon's width and height int[,] dungeonSections = new int[borders, borders]; // create an array to store leafs int[,] dungeonMap = new int[borders, borders]; // create an array to store map (floor, wall, hall, etc.) List<Leaf> leafset = new List<Leaf>(); Leaf trouble = new Leaf(); MakeLeaf(trouble, 0, 0, borders, borders); Split(trouble, leafset); for (int i = 0; i < leafset.Count; i++) { if (leafset[i].firstChild == null && leafset[i].secondChild == null) /* if the leaf has no children, * label every point inside of it * with its index. */ { for (int ii = 0; ii < borders; ii++) { for (int jj = 0; jj < borders; jj++) { if (ii >= leafset[i].minx && jj >= leafset[i].miny && ii <= (leafset[i].minx + leafset[i].width) && jj <= (leafset[i].miny + leafset[i].height)) { dungeonMap[ii, jj] = i; } } } } } for (int i = 0; i < 41; i++) { Console.Write("."); } Console.WriteLine(); for (int i = 0; i < borders; i++) { Console.Write("."); for (int j = 0; j < borders; j++) { char x = (char)dungeonMap[i, j]; Console.Write(x); } Console.WriteLine(); } Console.ReadLine(); } //Split will take a leaf and continue to split it until no more splits can be made. It stores the children in a list. public static void Split(Leaf leaf, List<Leaf> list) { if (leaf.firstChild != null) { return; } // abort if already split if (leaf.height <= (MINSIZE * 2) || leaf.width <= (MINSIZE * 2)) { return; } // abort if too small Random rnd = new Random(); bool horiz = (rnd.Next(2) > 0) ? true : false; //decide if split is horiz or vert leaf.firstChild = new Leaf(); // initialize leaf children leaf.secondChild = new Leaf(); if (horiz) // split into children { int cut = rnd.Next(leaf.width / 3, leaf.width - leaf.width / 3); if (cut < MINSIZE) { cut = MINSIZE; } if (cut > leaf.width - MINSIZE) { cut = leaf.width - MINSIZE; } MakeLeaf(leaf.firstChild, leaf.minx, leaf.miny, cut, leaf.height); MakeLeaf(leaf.secondChild, leaf.minx + cut, leaf.miny, leaf.width - cut, leaf.height); } else { int cut = rnd.Next(leaf.height / 3, leaf.height - leaf.height / 3); if (cut < MINSIZE) { cut = MINSIZE; } if (cut > leaf.height - MINSIZE) { cut = leaf.height - MINSIZE; } MakeLeaf(leaf.firstChild, leaf.minx, leaf.miny, leaf.width, cut); MakeLeaf(leaf.secondChild, leaf.minx, leaf.miny + cut, leaf.width, leaf.height - cut); } list.Add(leaf.firstChild); // adds the children to the list list.Add(leaf.secondChild); Console.WriteLine("Children Made!!"); Split(leaf.firstChild, list); // attempt to split children, if possible Split(leaf.secondChild, list); } //MakeLeaf will set a leaf's variables. public static void MakeLeaf(Leaf leaf, int minx, int miny, int width, int height) { leaf.minx = minx; leaf.miny = miny; leaf.width = width; leaf.height = height; } } class Leaf { public int minx; public int miny; public int width; public int height; public Leaf firstChild; public Leaf secondChild; } Sorry if it's confusing... I am a noob.   I really don't know how to 'debug' this and figure out what is going wrong ._. I can't tell where exactly it is messing up. Going step-by-step, once I get to the for-for-for loop with the list and array, I don't even know what I'm looking for anymore.   EDIT1:   You get some weird chars if you use the char as is... I've been adding 65 to it to get roman letters. At least I'm always making a 40x40 square now. But it's always giving me either only horizontal splits or vertical splits in the visual representation.   I think it has something to do with the check for them being 'too small' (when it decides to split). I had it do the same check before saving the children to the list, so that it only saves the children who will fail the check... then I stopped the program at the array distribution and all the leafs in the list had a height of 40.   But I'm not sure what's wrong with it... I've tried changing it to other things and it either crashes or gives a similar result? I just want it so that it will refuse to split anything with a width or height less than 2(minsize).   EDIT2:   Okay, so I finally decided to pull out the big guns... I got couple sheets of paper out and mapped out the square it creates, as well as writting down every single leafs's four variables in a tree... marking the "too small to cut" ones on my graph.   Normally I woudl skip to certain parts of the code and check the variables... or step through to see if it was creating stuff right, then exit the program when it was working properly.   Well, I went step by step through the ENTIRE THING this time. It cut up the square perfectly into nice random areas, looked really good on my graph that I drew. Then I watched it go through the three embedded for loops to assign the leafs' index number to their contained coordinates. After it did leaf 4 and leaf 7 properly, skipping all the proper leafs, I skipped to the drawing part. I checked the array dungeonMap and compared it with my coordinates and graph I wrote. Everything was perfect! I started to think.... there's no way the drawing part is wrong... I watched it draw character by character... I realized it was doing it right.   I let the program run its course and lo and behold, it drew the right thing.   I was baffled. When I watched parts of the program, they responded perfectly and did what they were supposd to. When I watched the ENTIRE PROGRAM step-by-step, it worked perfectly and even gave the desired results.   But when I just run the build without pausing or anything, it doesn't give the desired results...   My head felt like it was going to explode.   Then I remember reading in the C# documentation on msdn about System.Random... and it said something about how if the numbers are generated too quickly/close to one another (since it's using the system clock), you can get predictable results.   So I thought... maybe when the program is running at "full speed," it's only generating all true or all false (different depending on run time of the program) for the "horiz" boolean in the Split function.   Every time I step through the program slowly, it creates everything perfeclty and provides desired results. It only gives the stupid results when I run the build normally.   This would also explain why even when I only stored 'baby' leafs in the list (that's what I call ones that can no longer be split) it was still only storing ones with 40 for width or height (because it was only cutting in one direciton, and eventually they'd all have the opposite edge be less than MINSIZE*2)...   I'm going to go try to research how to counter this (like I said, I'm a noob!) and add something to see if I can make it more random and see if it works. If anyone knows a solution, feel free to post it here, since this topic is already here and all. After I try it, I'll see if it works, and let everyone know.   Sorry to be such a pain!   EDIT3: I had it write the value of horiz to the console after every time it decided it... it was either always true or always false. I have a feeling this is the problem. MSDN's documentation for System.Random class is not helping... it just says to avoid this, only use one Random, which I'm already doing. EDIT4: Oh, now that I think about it, I guess I'm technically creating new Randoms every iteration/recursion....   EDIT5: Solved!! That was indeed the problem. I just declared the Random rnd outside of the function and now it works perfectly. Lesson learned, if you're going to be using a lot of RNG, try to make sure you're only creating one System.Random.   Wow. This took me days to figure out because I was looking it all the wrong places.   Well, I'll leave this here for anyone who might be able to learn from it.
  14. nesseggman

    throwing me for loops.

    Oh, man. I got it now. Where I was expecting the problem was not at all where the problem actually was.   I am not good at debugging, I forgot to try something like that. Thanks <3
  15. nesseggman

    throwing me for loops.

    Ignore some of the weird stuff... like the 180x180. It's a remnant from other stuff I was doing.   EDIT: Sorry for the double post. I'm used to another forum where double posting is OK. Can't figure out how to delete this post.
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!