rexor0717 Posted March 13, 2014 What I really like about this is quirky character animations - With the three on three battles it'll difficult to spot them out, see gaps and work your advantage. I'm a big fan of that! If the game is going to have 3v3, perhaps you should include a character with reversi powers? So when he/she gets hit, the other player are damaged, but if they hit the other players, they themselves are damaged. Have it so this character is constantly punching or attacking on a timer, rather than input by the players. It's a stupid as heck idea, but something. Thanks, I've been trying to infuse as much personality into the characters as I can. I don't really have the time to animate in great detail, so I have to make use of the simple designs as best as I can. Just in case there was any misunderstanding, when I say 3 v 3, I mean in the Marvel vs Capcom style of only 1 character for each player on screen at a time but 2 in the back ready to get tagged in. And yeah, I really want to make some strange character designs, I like those ideas. I'm trying to have the character roster be a mix of traditional fighting game character types and then some very strange ones that need specific team compositions to make them shine. That way drafting a team is more than trying to snatch up the "top tier" characters. Latest progress on Ghost Roguelike: https://vine.co/v/Mb5gJbUrLpV Next I need to figure out a win condition for each map. I'm thinking something like in 868-HACK where you can just exit the level at any time and the focus is more on your score which you can get from collecting something (TBD) and killing other ghosts. Maybe add in some kind of bonus based on how many turns you took before exiting. It's just throwing things at the wall at this point. I only have two more days (until midnight on Friday) for it to be a 7DRL, but I think I can get something that at least resembles a completable game. I like your mix of pixel art and 3D art. Share this post Link to post Share on other sites
mike Posted March 13, 2014 I like your mix of pixel art and 3D art. Thanks! The level drawing is just some squares. I'd like to make them textured but my pixelin' skills are not the best so it might stay that way forever. Also I really like your game! I haven't said anything because I'm a jerk I guess but it sounds neat and I really like the look of it. It almost reminds me of an Adult Swim show, stylistically. Even the main menu has a very hand-crafted look to it. Share this post Link to post Share on other sites
CEJ Posted March 13, 2014 False Idols looks cool and it's a great name to boot. And also Ghost Rougelike looks promising for sure. I love planting bombs in games, I think it's spelunkys fault. Here is some of my nonsense. I've done some unity tests with morph targets and I can report that exporting from Max to unity works great - no problems so far. Share this post Link to post Share on other sites
rexor0717 Posted March 14, 2014 They say to playtest early and often, this having the emphasis on the early part. So yalls can play it if you want, rough edges and all. http://trentonrex.com/FalseIdolsWeb/FalseIdolsWeb.htmlYou need a controller. I'll be sure to make keyboard controls soon. Share this post Link to post Share on other sites
lloydp Posted March 14, 2014 Hey guys, some super impressive stuff going on here that's inspired me. I've been thinking of making a 2D mystery game set in a small western town. I've made a handful of games but struggle to finish them due to my debilitating obsession with perfecting the art before the mechanics. So I need an art style where I can pump out 2D scenes relatively quickly (think Phoenix Wright-style backgrounds), but still looks good. I was messing around and thought maybe something like this: Obviously it'd be more refined, but I'm just not sure if this would cut it for an entire game? You'd have close-ups with a bit more detail, and I was thinking the characters could be in colour. Any feedback would be hugely appreciated. I'm open to suggestions. I love a bit of cartography so I'm thinking a nice map would be how you move around town -- clearly indicate your current location, "unlocked" areas, maybe a cool "trail of footsteps" animation from one area to the next -- that sort of thing. Share this post Link to post Share on other sites
clyde Posted March 14, 2014 I went to Target and raided the school supplies for graph paper, folders and colored pencils. I don't straight up write code on paper, maybe pseudocode, but its pretty nice to have that shit around to quickly scratch out ideas. also yeah I think you'll get a runtime error when the velocity.x is zero. also also you may want to use Time.deltaTime instead of Time.time, that way you can just set float countDown = 0, in Update() you can put countDown += time.deltaTime. This way instead "if (countdown + timer < Time.time)" you can just say "if(countDown >= timer)" then reset countDown to zero after getting input. If i'm reading things correctly and you just want the input have a timer seconds delay before accepting another input. This was actually very helpful. Once I took your advice, I was inspired to erase a few related lines and some of my problems disappeared. This allowed me to tweak the foundation and get the results I was going for! You rock. Here is the resulting code. I think I explain what is going on in the comments pretty well. Anyone who wants to use this code for a Track & Field style of horizontal moment is welcome to use it. I'd prefer if you leave the comments in (maybe add a few of your own), but I ain't gonna be mad if you don't. using UnityEngine; using System.Collections; public class PulseRun : MonoBehaviour { //How frequently valid input can be made public float timer = 1f; //Just a speed modifier for tweaking public float speedMultiplier=1; //How much speed can potentially be added to the current speed if input happens close to when the timer goes off public float potentialAcceleration=0.1f; //It's supposed to be a friction when valid input is not made. Lower values are a more sudden stop. public float gradualBrake = 25f; //speed float speed; //Which button can be pushed for valid input. It alternates between left and right. It is initialize as neither "left" or "right" so that either can be pressed first. //I said "either", but really it's neither because in the Update function, the script is checking to make sure that the current input is not the same as the previous input string validButton="either"; //A temporary variable of increasing value that is reset to zero after valid input. danimo on the Idle Thumbs forums recommended this change. Before I was making it way too complex. float timePassed = 0f; // Use this for initialization void Start () { } // Update is called once per frame void Update () { //Getting the current speed during each update for reference. speed = rigidbody.velocity.x; //Increase the value of timePassed as time passes. timePassed += Time.deltaTime; //If an amount of time equal to the timer has passed since the last input, and the alternate horizontal key is being pressed... if (timePassed >= timer) { if (((Input.GetAxis ("Horizontal") > 0) && validButton != "left") || ((Input.GetAxis ("Horizontal") < 0) && validButton != "right")) { //increase the horizontal velocity by the potentialAcceleration value divided by how much time has passed beyond the timer. I also allow the speed to be multiplied here. rigidbody.velocity = new Vector3 (speed + (potentialAcceleration /(timePassed-timer)) * speedMultiplier, 0f, 0f); //reset the time passed timePassed = 0f; //print the speed value in the console Debug.Log (speed); //If they used right, then make "left" the next valid input. if (Input.GetAxis ("Horizontal") > 0) { validButton = "left"; } //If they used left, then make "right" the next valid input. if (Input.GetAxis ("Horizontal") < 0) { validButton = "right"; } } //If the time passed isn't more than the timer or they aren't pressing a valid button, slow that shit down. else { if (speed > 0) { rigidbody.velocity = new Vector3(speed-(speed/gradualBrake), 0f, 0f); } //clyde is pretty much a technomage. } } } } Share this post Link to post Share on other sites
rexor0717 Posted March 14, 2014 Hey guys, some super impressive stuff going on here that's inspired me. I've been thinking of making a 2D mystery game set in a small western town. I've made a handful of games but struggle to finish them due to my debilitating obsession with perfecting the art before the mechanics. So I need an art style where I can pump out 2D scenes relatively quickly (think Phoenix Wright-style backgrounds), but still looks good. I was messing around and thought maybe something like this: Obviously it'd be more refined, but I'm just not sure if this would cut it for an entire game? You'd have close-ups with a bit more detail, and I was thinking the characters could be in colour. Any feedback would be hugely appreciated. I'm open to suggestions. I love a bit of cartography so I'm thinking a nice map would be how you move around town -- clearly indicate your current location, "unlocked" areas, maybe a cool "trail of footsteps" animation from one area to the next -- that sort of thing. I think for variety, you could change up the texture of the background material, and change the color of the shadows depending on where you are and what mood you're going for. I like the look of it so far though. Share this post Link to post Share on other sites
clyde Posted March 14, 2014 Hey guys, some super impressive stuff going on here that's inspired me. I've been thinking of making a 2D mystery game set in a small western town. I've made a handful of games but struggle to finish them due to my debilitating obsession with perfecting the art before the mechanics. So I need an art style where I can pump out 2D scenes relatively quickly (think Phoenix Wright-style backgrounds), but still looks good. I was messing around and thought maybe something like this: Obviously it'd be more refined, but I'm just not sure if this would cut it for an entire game? You'd have close-ups with a bit more detail, and I was thinking the characters could be in colour. Any feedback would be hugely appreciated. I'm open to suggestions. I love a bit of cartography so I'm thinking a nice map would be how you move around town -- clearly indicate your current location, "unlocked" areas, maybe a cool "trail of footsteps" animation from one area to the next -- that sort of thing. So will it be a visual-novel? I think that background looks awesome. As far as using the style for a whole game, I could see that color palette being satisfactory for outside areas. Maybe include colorful but sparse flora and fauna in some scenes. Then if you have any indoor scenes, you could have colorful decorations layered on top of the buildings structure that would have the color palette that you demonstrated here. That's my immediate thought. I get a dirt-desert vibe. I don't know if that is what you are going for, but I like it. What are you making this in? Share this post Link to post Share on other sites
lloydp Posted March 15, 2014 I think for variety, you could change up the texture of the background material, and change the color of the shadows depending on where you are and what mood you're going for. I like the look of it so far though. Thanks. That's a good idea -- I'll definitely change up the background texture so it's different from screen-to-screen. So will it be a visual-novel? I think that background looks awesome. As far as using the style for a whole game, I could see that color palette being satisfactory for outside areas. Maybe include colorful but sparse flora and fauna in some scenes. Then if you have any indoor scenes, you could have colorful decorations layered on top of the buildings structure that would have the color palette that you demonstrated here. That's my immediate thought. I get a dirt-desert vibe. I don't know if that is what you are going for, but I like it. What are you making this in? Thanks a lot. I guess the presentation will be closer to a visual novel, but it will play like an adventure game hybrid, with puzzles and an inventory but no item scavenging or combining. I'd like to avoid the "dating" side of visual novels, as well as the "rub everything on everything" side of adventure games. The coloured fauna is a good idea, like a washed out green. Adding a bit of colour to indoor areas also makes sense, to emphasise certain details. I'm definitely going for that desert town vibe -- a small place in the middle of nowhere; a gas station, general store, motel, maybe a trailer park. I was thinking of making it in Adventure Game Studio, the downsides being the limited resolution (1024x768 if you want to stick to the latest, stable build) and lack of multi-platform support. On the plus side, I'm quite familiar with it and it takes a lot of the grunt work out of making an adventure game. I hear Ren'py is great for visual novels, but I'm not sure how well it extends beyond that basic formula. Share this post Link to post Share on other sites
clyde Posted March 17, 2014 Progress-report for week #6 What were my goals? What are my goals for week #6?-I want Veronica to have an animation for standing. It hurts my back looking at her crouched down like that for too long.-I need to tie the animations to controller-input in mecanim.-I want to think up a process for me to continue to focus on learning, but also result in small finished products. I feel like everytime I learn how to do something, I move the goal-post for what I want in a game. I want to be putting very small games out regularly and I'm pretty sure that I now have the capability to do that. The cyberpunk idea I have is currently beyond my capability, but it provides a good impetus for learning about designing my own character-controllers, but I also want to frequently work on small games which are entirely within my ability. This week I plan to keep this on my mind so I can add something into my routine that will encourage this. Maybe I spend one week out of three making a game that I know how to make. I don't know, I'm thinking about it.What are the challenges I may face, and how can I prepare for them?-Titanfall. I think I'll be alright. I'm pretty much just planning on finishing Veronica. I don't expect to run into anything I can't solve in two hours. Which of my goals did I accomplish? -Veronica has a standing animation and I attached her body, so that's good. It's pretty no-nonsense (but that's weird because I've had multiple moments where I say "This is so fucking stupid" in an entertained way while testing it). Completed! -I did use the mecanim to tie the standing/hand-standing animation. The rocking legs are controlled with adding torque to the rigidbody. Completed! -I thought a lot about how to add something to my routine that would result in small but completed games. I have a few ideas, but the best one is that I'm just going to keep a library of scripts that work and art assets. Every once in a while, I plan to pull from them to make a game. I also have started to list things that I am sure I am reliably capable of. I'm not feeling the need to complete a game as strongly as I was last week, but I want to be prepared with a psuedo-plan if it strikes me again. The most useful portion of this thought-exercise was realizing that there should be a distinction between games I can make with what I know how to do reliably, and games that push me to learn more. I do want to make both, but I think that putting the two activities into separate categories may help my process. At the moment, I just want to learn more. Completed! What happened? I was mostly interested in getting that Track&Field style of controller input working. I have a game idea for it and I just thought it was interesting. When I didn't feel like doing that I tried out Blender. It's about as deep as Unity. I watched a few tutorials and figured out some stuff. I know enough to make some interesting 3d models that I can use as pre-fabs to play around with in Unity, but I haven't even figured out how to paint textures within Blender yet. I don't plan on touching animations for a while. I tried to do an animation where the scale of an object changes over time but I failed to have any success. Somewhere around Friday, I worked on the additional art asset for Veronica. It was much faster than last time, that's nice. Then over the weekend, I assembled Veronica and wrote the script that allows the dancing characters to change over time. That was much more difficult than I thought it would be. Then I found out about public static variables and it got much easier. I'd like to look into the similarities and differences between public static variables, GetComponent and SetBool. I've used them all once or twice, but I don't understand what is gong on as much as I would like. I'd really like to find a book that focuses on using stuff like dictionaries, singletons, GetComponent, enumerators, public static variables and arrays in C# for Unity. I was able to make a lot of progress when I was able to study at my job. I've looked on Amazon, but some are in javascript, others are either covering stuff I know or covering specialized stuff like AI, and the rest won't be available until August. Anyway, I did make a new build with Veronica in it: https://dl.dropboxusercontent.com/u/92741283/Dance%20game/DanceGameMarchBuild/DanceGameBuild.html What is my long-term goal? -Make the dance-game. What are my goals for week #7? -I really want to get my GUI script to a complete state. Now that I know about public static variables, I think I'll be able to at least finish up when I'm trying to do. I am organizing it so that all the lines and options are editable in the inspector. Each page is a separate gameObject. I was having a hard time creating the script that would pass values to a controller-gameObject that would act as a record of all the decisions. I think I can do that now. I'd also like to polish up that texture because it looks awful. -I feel tired right now, so I'm having a hard time coming up with more goals at the moment. I have plenty of stuff that I'm enjoying working on, maybe I'll just mention them: I want to make some art-assets for the Track&Field style game. That game also requires me to get some audio-samples into Unity and do some pitch shifts that are tied to Input.GetAxis I still want to work on the 3d Hanenbow game. I haven't touched it. -Oh, I have a good goal. I want to organize that library of scripts and art-assets I mentioned wanting earlier. That's a good goal for the week. What challenges might I face and how can I prepared for them? -Completing the GUI script is totally doable if I just finish what I intend for it now. The risk is that I will try to make it more scalable. I need to remember that this is my first GUI script, not my last. I'll write other later. I just want to have one now that I can use for small games. I'm a wordy guy, I need something that can deliver branching-dialogue now. -As far as organizing the library. I guess the challenge is similar. I need to just organize it and not obsess over how to optimize it for future-proofing. Share this post Link to post Share on other sites
clyde Posted March 18, 2014 I'm becoming fond of the // command. http://www.polygon.com/2014/3/17/5519536/finding-treasures-in-the-code-why-the-source-code-of-classic-games Share this post Link to post Share on other sites
lloydp Posted March 18, 2014 When I first started writing code I used to skimp on comments because what's the point if I understand it? Turns out that even if others aren't reading it, it's super easy to forget what you were trying to do months/years down the line. Your brain doesn't account for how badly you sucked X years ago. If other people are reading/editing it then it goes without saying. And my experience is pretty much exclusively in web dev. It's probably even more important in game dev. I still get my kicks from absurd class names. Share this post Link to post Share on other sites
anthonyRichard Posted March 18, 2014 Yeah, if I'm coding something I'm unfamiliar with, week-ago me is basically a different person and looking over his code is a baffling experience. Share this post Link to post Share on other sites
aperson Posted March 18, 2014 As I mentioned previously, I often use comments as pseudo-code to guide the actual code writing. And yes, they are also very useful to look back on. I also will leave comments if I had a better solution that I didn't have time to implement, some performance improvement I thought of that I could go back and make if needed, etc. It's a very bad idea to work on something and think you'll remember it when you revisit it later because you won't. This is especially true of code that looks very weird but is that way for a very good reason. You go back later and "simplify" it (or a co-worker "fixes" it) then realize you broke something because all the parts that looked weird were bug fixes. Share this post Link to post Share on other sites
Dewar Posted March 18, 2014 I've had to spend the last couple of weekends hunting for a new rental, but with that out of the way I can get back to programming. The last couple of times I've been on the Google Hangout has been deprecated in favor of the IRC channel, but the IRC channel hasn't really been talking much about game development. Is there some alternate version of game dev chat going on somewhere? Share this post Link to post Share on other sites
clyde Posted March 18, 2014 I went back into the Dancing game script to comment it clearly and ended up ripping one of three scripts out by just moving the public static variable that says "start dancing" to the script that chooses the dancers. It doesn't sound like a big improvement, but I was passing values all over the place in between these three scripts for no good reason. I like how nice and neat the new script looks. Now I have the GUI script for dialogue choices, and it changes a single bool in the script that determines who dances. Figuring out how I want everything organized takes some effort, but now I have the basic template for how this game is going to be organized. I included the code because I'm proud of it, feel free to take anything you want or whatever. If you do, I'd appreciate it if you leave the comments in and add your own, but I won't get mad or nothin' if you don't. using UnityEngine; using System.Collections; public class DanceTurns : MonoBehaviour { //This is an array that will include everything with the "Characters" tag public GameObject[] dancers; //This is the current dancer (which will change over time) GameObject currentDancer; //This is the bool that the dialogue choices in GraphicalUserInterface.cs will change to trigger the beginning of the dance. public static bool changeDancer = false; //This will be the randomly generated time between dancers float danceTimer; // Use this for initialization void Start () { //put everything with the tag "Characters" in the dancers array dancers = GameObject.FindGameObjectsWithTag ("Characters"); } //clyde is pretty much a technomancer. void Update () { //if the dialogue in GraphicalUserInterface.cs triggers the changeDancer bool, if (changeDancer == true) { //start the danceTimer (first one just goes off immediately) danceTimer -= Time.deltaTime; if (danceTimer <= 0) { //reset the dance timer to a random number between 10 and 40 danceTimer = Random.Range (10, 40); //if nothing has been assigned to the currentDancer variable, if (currentDancer == null) { //pick a random character from the dancers array currentDancer = dancers [Random.Range (0, dancers.Length)]; //put them in the center currentDancer.transform.position = new Vector3 (0, 0, 0); } //if something is assigner to currentDancer, else { //take the current dancer off the stage currentDancer.transform.position = new Vector3 (100, 0, 0); //choose a new dancer randomly from the dancers array currentDancer = dancers [Random.Range (0, dancers.Length)]; //put the new dancer in the center currentDancer.transform.position = new Vector3 (0, 0, 0); } } } } } Share this post Link to post Share on other sites
Twig Posted March 20, 2014 I've had to spend the last couple of weekends hunting for a new rental, but with that out of the way I can get back to programming. The last couple of times I've been on the Google Hangout has been deprecated in favor of the IRC channel, but the IRC channel hasn't really been talking much about game development. Is there some alternate version of game dev chat going on somewhere? Most people in the channel are more than willing to help if you ask for it. The only reason game dev chat isn't happening there is because no one initiates it, not because it's forbidden. Also if you want the Google Hangout to be a thing still, just promote it or something. I honestly thought it was dead long ago because no one ever even mentioned it after the first time it happened (beyond my putting a handy link in the IRC channel's topic). Share this post Link to post Share on other sites
clyde Posted March 21, 2014 Here's my routine: -Spend two hours trying to figure out how to do something with script. -Stop and browse the asset store for a solution for about 5 minutes. -Repeat. Share this post Link to post Share on other sites
danimo Posted March 21, 2014 Here's my routine: -Spend two hours trying to figure out how to do something with script. -Stop and browse the asset store for a solution for about 5 minutes. -Repeat. my routine is essentially the opposite: browse the asset store, convince myself its something I could do myself, then spend a day figuring out how to do it, invariably decide I don't need to do it or I can just halfass it, double click Hearthstone.exe Share this post Link to post Share on other sites
clyde Posted March 24, 2014 I just got my personal high-score in game-programming. I look forward to writing my progress report later today. It's probably small fish for some of you, but I can't believe I managed to do what I just did. I'm pretty much a technomancer now. Share this post Link to post Share on other sites
clyde Posted March 25, 2014 Progress report for Week #7 What were my goals? What are my goals for week #7? -I really want to get my GUI script to a complete state. Now that I know about public static variables, I think I'll be able to at least finish up when I'm trying to do. I am organizing it so that all the lines and options are editable in the inspector. Each page is a separate gameObject. I was having a hard time creating the script that would pass values to a controller-gameObject that would act as a record of all the decisions. I think I can do that now. I'd also like to polish up that texture because it looks awful. -I feel tired right now, so I'm having a hard time coming up with more goals at the moment. I have plenty of stuff that I'm enjoying working on, maybe I'll just mention them: I want to make some art-assets for the Track&Field style game. That game also requires me to get some audio-samples into Unity and do some pitch shifts that are tied to Input.GetAxis I still want to work on the 3d Hanenbow game. I haven't touched it. -Oh, I have a good goal. I want to organize that library of scripts and art-assets I mentioned wanting earlier. That's a good goal for the week. What challenges might I face and how can I prepared for them? -Completing the GUI script is totally doable if I just finish what I intend for it now. The risk is that I will try to make it more scalable. I need to remember that this is my first GUI script, not my last. I'll write other later. I just want to have one now that I can use for small games. I'm a wordy guy, I need something that can deliver branching-dialogue now. -As far as organizing the library. I guess the challenge is similar. I need to just organize it and not obsess over how to optimize it for future-proofing. Did I accomplish my goals? - Did I say "complete" the GUI script? Ha. Did I emphasize how I should stick with what I had ? More ha. I decided that I'll be able to write dialogue much faster in the script rather than in the inspector. I'm trying to design it so I can write the stuff very fast. Even though I have less operational than I had with the last GUI system, much of the process is automated once I drag a few sprites onto public GameObject spots and keep things organized. I'm taking a lot of inspiration about how it will look from Surviving Highschool and I want the process of writing the dialogue to be like my limited experience with Ren'Py. I still haven't made the choiceGUI, figured out what the conditional that changes narrative-variables will be like, or animated the textBox and its portrait. I'm really proud of the script I wrote today. I'll post it here. Feel free to use it, but I don't know if it will be easy to do. It depends on an organization of sprites with a GameObject anchor for the camera and a camera being children of the sprite. But feel free to take anything useful from it. using UnityEngine; using System.Collections; public class UnifiedGUI : MonoBehaviour { /// READ ME! /// Make sure to set all CharacterCameras (the cameras that are anchored to the sprites) to unenabled. /// So here is how it works. /// In the inspector, you should see a place to drag gameobjects. These are where you charactersprites go. /// Make sure to attach a CameraAnchor and a CharacterCamera to each sprite so that they will have something to put into the portrait. //TO DO: //I need to make the portrait move when the textbox moves. //I suspect that I need to do it in the Write() after it knows what the portrait camera is //maybe some conditional when the portrait changes. //Don't get stuck too long.A shutter effect or something would be fine. //Make the choice textboxes //Animate a transform or some sort of transition so that when speakers change, the GUI seems like something less physically implanted in the world. //Dimensions of text public float width= 570; public float height=300; public float yAnchorAdjustment=5870; float yAnchor; public float xAnchor=190; //This is a multiplier which allows me to change the yAnchor with the transform of the Textbox GameObject. //Without it, the yAnchor changes 1 pixel per unit in the opposite direction. float pixels2units=-55; //GUIStyle public GUIStyle defaultStyle; //Find the sprites public GameObject CharacterSprite1; public GameObject CharacterSprite2; //I've never made an ArrayList before. I'll be needing this page: //http://wiki.unity3d.com/index.php?title=Which_Kind_Of_Array_Or_Collection_Should_I_Use%3F#ArrayLists ArrayList book = new ArrayList (); int page = 0; //A public variable of who is speaking and when. This info will be used to tell which portrait camera is being used. ArrayList portraitSchedule= new ArrayList(); //Declaring portrait here so that I can use it in both Start() and OnGUI() GameObject portrait; //The camera of the sprite being protrayed at the time. Camera portraitCamera; //This method will allow me to just type in lines easily in the Start(). void Say(GameObject character, string whatTheySay){ //It accepts a GameObject for who is speaking and writes them down on a page of the next page of portraitSchedule[] portraitSchedule.Add (character); //It accepts a string and puts it on the next page of book[] book.Add (whatTheySay); } //This method makes a GUI.Button with the text from book and flips the page when clicked in OnGUI(); void Write (){ //a declaration of an item in an arrayList would be //type item = (type) myArray [i]; //I'm using that for the text portion of the button. (string)book if (GUI.Button (new Rect (xAnchor, yAnchor, width, height), (string)book , defaultStyle)) { //I'm going to make sure the page will be in range before adding to it, but eventually, this is where I should also put a conditional action that loads the new scene. if (page<book.Count-1){ //Turn the camera off of the current character portraitCamera.enabled=false; //flip the page page ++; //Which sprite represents the character who is speaking during this page? //So, I'll be honest, I don't know why it needs the (GameObject) part, but it does. portrait= (GameObject) portraitSchedule ; //portraitCamera is their camera portraitCamera = portrait.GetComponentInChildren<Camera>(); //Turn their camera on. portraitCamera.enabled=true; } } } void Start(){ //Some initialization for the GUIStyle settings //Indent when the sentence goes beyond the width of the box. defaultStyle.wordWrap = true; //Make the fontSize 32 defaultStyle.fontSize = 32; //******************************************************************************* //******************************************************************************* //Here is where I actually change things. //******************************************************************************** //********************************************************************************* //Declare abbreviations for character names. they don't have to be "a" and "b" GameObject cl = CharacterSprite1; GameObject ch = CharacterSprite2; //This is where I'm going to write all the lines. If I want to make actions happen on certain pages, then I need to either add another parameter to Say(), //Or use the text as a conditional in the Update with: //if ((string)book == "My homies call me Clyde"){pourOut40=true} //For now, the way to write the lines is //Say(characterAbbreviation, "Line of Dialogue"); Say (cl, "Well hello Charlene."); Say (ch, "Well if it isn't my favorite little greenish church-lady!"); Say (cl, "I can't believe you would leave the house looking like that."); Say (ch, "I think the same thing everytime I see you."); Say (ch, "I can't even find that type of stuff in the thrift-store anymore."); Say (ch, "You look like you're on the way to a Montgomery Bus Boycott re-enactment."); Say (cl, "Your dress is transparent."); Say (ch, "It shows off my hour-glass figure"); Say (cl, "There is something called \"modesty.\""); Say (ch, "Yeah, I've heard of it, but I'm much more familiar with \"sense-of-fashion.\""); //I need to figure out what the first portrait camera is. By running this once in the Start(), I can avoid running it every click. //Who is on first? //So, I'll be honest, I don't know why it needs the (GameObject) part, but it does. portrait= (GameObject) portraitSchedule ; //Make portraitCamera their camera. portraitCamera = portrait.GetComponentInChildren<Camera>(); //Turn their camera on. portraitCamera.enabled=true; } void OnGUI(){ //This moves the text with the TextBox on the Y axis. yAnchor = transform.position.y*pixels2units+yAnchorAdjustment; //This calls up all of the pages that Say() put the text and characters in Write (); } } using UnityEngine; using System.Collections; public class UnifiedGUI : MonoBehaviour { /// READ ME! /// Make sure to set all CharacterCameras (the cameras that are anchored to the sprites) to unenabled. /// So here is how it works. /// In the inspector, you should see a place to drag gameobjects. These are where you charactersprites go. /// Make sure to attach a CameraAnchor and a CharacterCamera to each sprite so that they will have something to put into the portrait. //TO DO: //I need to make the portrait move when the textbox moves. //I suspect that I need to do it in the Write() after it knows what the portrait camera is //maybe some conditional when the portrait changes. //Don't get stuck too long.A shutter effect or something would be fine. //Make the choice textboxes //Animate a transform or some sort of transition so that when speakers change, the GUI seems like something less physically implanted in the world. //Dimensions of text public float width= 570; public float height=300; public float yAnchorAdjustment=5870; float yAnchor; public float xAnchor=190; //This is a multiplier which allows me to change the yAnchor with the transform of the Textbox GameObject. //Without it, the yAnchor changes 1 pixel per unit in the opposite direction. float pixels2units=-55; //GUIStyle public GUIStyle defaultStyle; //Find the sprites public GameObject CharacterSprite1; public GameObject CharacterSprite2; //I've never made an ArrayList before. I'll be needing this page: //http://wiki.unity3d.com/index.php?title=Which_Kind_Of_Array_Or_Collection_Should_I_Use%3F#ArrayLists ArrayList book = new ArrayList (); int page = 0; //A public variable of who is speaking and when. This info will be used to tell which portrait camera is being used. ArrayList portraitSchedule= new ArrayList(); //Declaring portrait here so that I can use it in both Start() and OnGUI() GameObject portrait; //The camera of the sprite being protrayed at the time. Camera portraitCamera; //This method will allow me to just type in lines easily in the Start(). void Say(GameObject character, string whatTheySay){ //It accepts a GameObject for who is speaking and writes them down on a page of the next page of portraitSchedule[] portraitSchedule.Add (character); //It accepts a string and puts it on the next page of book[] book.Add (whatTheySay); } //This method makes a GUI.Button with the text from book and flips the page when clicked in OnGUI(); void Write (){ //a declaration of an item in an arrayList would be //type item = (type) myArray [i]; //I'm using that for the text portion of the button. (string)book if (GUI.Button (new Rect (xAnchor, yAnchor, width, height), (string)book , defaultStyle)) { //I'm going to make sure the page will be in range before adding to it, but eventually, this is where I should also put a conditional action that loads the new scene. if (page<book.Count-1){ //Turn the camera off of the current character portraitCamera.enabled=false; //flip the page page ++; //Which sprite represents the character who is speaking during this page? //So, I'll be honest, I don't know why it needs the (GameObject) part, but it does. portrait= (GameObject) portraitSchedule ; //portraitCamera is their camera portraitCamera = portrait.GetComponentInChildren<Camera>(); //Turn their camera on. portraitCamera.enabled=true; } } } void Start(){ //Some initialization for the GUIStyle settings //Indent when the sentence goes beyond the width of the box. defaultStyle.wordWrap = true; //Make the fontSize 32 defaultStyle.fontSize = 32; //******************************************************************************* //******************************************************************************* //Here is where I actually change things. //******************************************************************************** //********************************************************************************* //Declare abbreviations for character names. they don't have to be "a" and "b" GameObject cl = CharacterSprite1; GameObject ch = CharacterSprite2; //This is where I'm going to write all the lines. If I want to make actions happen on certain pages, then I need to either add another parameter to Say(), //Or use the text as a conditional in the Update with: //if ((string)book == "My homies call me Clyde"){pourOut40=true} //For now, the way to write the lines is //Say(characterAbbreviation, "Line of Dialogue"); Say (cl, "Well hello Charlene."); Say (ch, "Well if it isn't my favorite little greenish church-lady!"); Say (cl, "I can't believe you would leave the house looking like that."); Say (ch, "I think the same thing everytime I see you."); Say (ch, "I can't even find that type of stuff in the thrift-store anymore."); Say (ch, "You look like you're on the way to a Montgomery Bus Boycott re-enactment."); Say (cl, "Your dress is transparent."); Say (ch, "It shows off my hour-glass figure"); Say (cl, "There is something called \"modesty.\""); Say (ch, "Yeah, I've heard of it, but I'm much more familiar with \"sense-of-fashion.\""); //I need to figure out what the first portrait camera is. By running this once in the Start(), I can avoid running it every click. //Who is on first? //So, I'll be honest, I don't know why it needs the (GameObject) part, but it does. portrait= (GameObject) portraitSchedule ; //Make portraitCamera their camera. portraitCamera = portrait.GetComponentInChildren<Camera>(); //Turn their camera on. portraitCamera.enabled=true; } void OnGUI(){ //This moves the text with the TextBox on the Y axis. yAnchor = transform.position.y*pixels2units+yAnchorAdjustment; //This calls up all of the pages that Say() put the text and characters in Write (); } } using UnityEngine; using System.Collections; public class UnifiedGUI : MonoBehaviour { /// READ ME! /// Make sure to set all CharacterCameras (the cameras that are anchored to the sprites) to unenabled. /// So here is how it works. /// In the inspector, you should see a place to drag gameobjects. These are where you charactersprites go. /// Make sure to attach a CameraAnchor and a CharacterCamera to each sprite so that they will have something to put into the portrait. //TO DO: //I need to make the portrait move when the textbox moves. //I suspect that I need to do it in the Write() after it knows what the portrait camera is //maybe some conditional when the portrait changes. //Don't get stuck too long.A shutter effect or something would be fine. //Make the choice textboxes //Animate a transform or some sort of transition so that when speakers change, the GUI seems like something less physically implanted in the world. //Dimensions of text public float width= 570; public float height=300; public float yAnchorAdjustment=5870; float yAnchor; public float xAnchor=190; //This is a multiplier which allows me to change the yAnchor with the transform of the Textbox GameObject. //Without it, the yAnchor changes 1 pixel per unit in the opposite direction. float pixels2units=-55; //GUIStyle public GUIStyle defaultStyle; //Find the sprites public GameObject CharacterSprite1; public GameObject CharacterSprite2; //I've never made an ArrayList before. I'll be needing this page: //http://wiki.unity3d.com/index.php?title=Which_Kind_Of_Array_Or_Collection_Should_I_Use%3F#ArrayLists ArrayList book = new ArrayList (); int page = 0; //A public variable of who is speaking and when. This info will be used to tell which portrait camera is being used. ArrayList portraitSchedule= new ArrayList(); //Declaring portrait here so that I can use it in both Start() and OnGUI() GameObject portrait; //The camera of the sprite being protrayed at the time. Camera portraitCamera; //This method will allow me to just type in lines easily in the Start(). void Say(GameObject character, string whatTheySay){ //It accepts a GameObject for who is speaking and writes them down on a page of the next page of portraitSchedule[] portraitSchedule.Add (character); //It accepts a string and puts it on the next page of book[] book.Add (whatTheySay); } //This method makes a GUI.Button with the text from book and flips the page when clicked in OnGUI(); void Write (){ //a declaration of an item in an arrayList would be //type item = (type) myArray [i]; //I'm using that for the text portion of the button. (string)book if (GUI.Button (new Rect (xAnchor, yAnchor, width, height), (string)book , defaultStyle)) { //I'm going to make sure the page will be in range before adding to it, but eventually, this is where I should also put a conditional action that loads the new scene. if (page<book.Count-1){ //Turn the camera off of the current character portraitCamera.enabled=false; //flip the page page ++; //Which sprite represents the character who is speaking during this page? //So, I'll be honest, I don't know why it needs the (GameObject) part, but it does. portrait= (GameObject) portraitSchedule ; //portraitCamera is their camera portraitCamera = portrait.GetComponentInChildren<Camera>(); //Turn their camera on. portraitCamera.enabled=true; } } } void Start(){ //Some initialization for the GUIStyle settings //Indent when the sentence goes beyond the width of the box. defaultStyle.wordWrap = true; //Make the fontSize 32 defaultStyle.fontSize = 32; //******************************************************************************* //******************************************************************************* //Here is where I actually change things. //******************************************************************************** //********************************************************************************* //Declare abbreviations for character names. they don't have to be "a" and "b" GameObject cl = CharacterSprite1; GameObject ch = CharacterSprite2; //This is where I'm going to write all the lines. If I want to make actions happen on certain pages, then I need to either add another parameter to Say(), //Or use the text as a conditional in the Update with: //if ((string)book == "My homies call me Clyde"){pourOut40=true} //For now, the way to write the lines is //Say(characterAbbreviation, "Line of Dialogue"); Say (cl, "Well hello Charlene."); Say (ch, "Well if it isn't my favorite little greenish church-lady!"); Say (cl, "I can't believe you would leave the house looking like that."); Say (ch, "I think the same thing everytime I see you."); Say (ch, "I can't even find that type of stuff in the thrift-store anymore."); Say (ch, "You look like you're on the way to a Montgomery Bus Boycott re-enactment."); Say (cl, "Your dress is transparent."); Say (ch, "It shows off my hour-glass figure"); Say (cl, "There is something called \"modesty.\""); Say (ch, "Yeah, I've heard of it, but I'm much more familiar with \"sense-of-fashion.\""); //I need to figure out what the first portrait camera is. By running this once in the Start(), I can avoid running it every click. //Who is on first? //So, I'll be honest, I don't know why it needs the (GameObject) part, but it does. portrait= (GameObject) portraitSchedule ; //Make portraitCamera their camera. portraitCamera = portrait.GetComponentInChildren<Camera>(); //Turn their camera on. portraitCamera.enabled=true; } void OnGUI(){ //This moves the text with the TextBox on the Y axis. yAnchor = transform.position.y*pixels2units+yAnchorAdjustment; //This calls up all of the pages that Say() put the text and characters in Write (); } } Here is a Vine of what it looks like in action currently.https://mtc.cdn.vine.co/r/videos/C2B2DDE50C1060056176903557120_1b898058812.4.8.8057078508764083086.mp4?versionId=uuLgUb4B78799lsK.99s.QqgB_oKcLsN Not Accomplished -I did make an art-asset to test animating a running dude, but it was just to see if I could do it. I didn't do much with that or the 3d Hanenbow this week. I do like having a section to my goals that are just things that I can work on and not feel any pressure with though. That'll be a regular thing. -I didn't organize my library. I decided that I won't really know what I need until I spend a week making a game with what I have. Not Accomplished What happened? I actually did a lot of conceptual work and writing this week. After writing some awesome dialogue for the dance-game and deciding how I want that to go, I started looking at some of the cyberpunk-twine I had been writing before I decided to learn how to make games in Unity. I was surprised at how much I liked one of my earliest attempts, but I like my later attempts too. I decided on a narrative framework that would allow me to use both of those ideas. That got me interested in working on the GUI stuff again, because I really want a pleasing GUI for a dialogue-heavy game. Today I had the day off so I spent it reworking the GUI system with the needs I have now in mind. What is my long-term goal? -The Dance-game. What are my goals for week #8? -Work more on the GUI. I'd like to have some form of transitioning animation for the textBox and a choice-menu that is as automated as my regular dialogue. I mean... that's what I want to do. I'll write down some other stuff that I can work on optionally. *3d Hanenbow *More story for the dance-game. I gotta figure out if I'm going to try to make a 3d model of a flopping fish at some point. It's going to be too hard. I doubt I'll do that. *I do want to make a game within a week at some point, so I might look at my options again for next week. You know what? let's just make that a goal. -Prepare to make a a game on week #9. What challenges might I face and how can I prepare for them? -I don't think that implementing choices in the GUI will be very hard. The only thing I see having a problem with is getting the characterCamera to move with the textBox. I tried doing that earlier this evening and it was weird. To prepare, I'll brain-storm some tricks I could use that wouldn't require me to move the viewport (after I give it another go). -I'm making a game during week #9? That's a scary expectation. I guess I'll just look at what I can do reliably, see what parts I can use from the other games and then consider what I can do. I might have to write some amount of a plan that will make sure I finish something. There will need to be a point at which I just take everything that works and make it cool. I'm psyched. That'll be fun. Also, I need to remember that if I fail, I'll still gain a lot of experience from such an attempt. It'll be fun. Share this post Link to post Share on other sites
aperson Posted March 25, 2014 I suggest you figure out a way to get text out of the code entirely. Generally if something is purely data you don't want it in code - outside of code it's easier to edit, you don't have to recompile to run, if it's text having it separate makes it easier to spell check, to localize for different regions, etc. In Unity you can have a text file as an asset and load it like any asset / resource. It can be xml, json, plain old text or whatever. (Actually it can be anything...but don't worry about that) In the project I'm working on now I have something similar, where conversations have different speakers and such. I use a JSON format to specify each speaker, their position, their dialogue, etc. What you are doing is fine for now, but once you are somewhat happy with it it will probably become a pain in the ass to work with. Also, to answer your random thing about "I'll be honest, I don't know why it needs the (GameObject) part, but it does." Your ArrayList is untyped. It's a container of generic objects, and generic objects can't be assigned to non-generics without casting. For all your compiler knows your generic object might not GameObject or subclass, so you have to explicitly cast it. In C# however you can use typed data structures. I don't believe ArrayList can be typed but List can. So you can do something like: List<GameObject> myList = new List<GameObject>(); When you do this you are telling the compiler that your List is specifically a list of GameObjects rather than any ole C# object, which allows the compiler to do more type-checking, which is generally a good thing. It's good to use strong typing whenever you can. In a complex program you may have a lot of data structures (like...thousands or more) and if they are all generic it's up to your comments and memory to determine what they are supposed to hold. Whereas if they are all typed the code is self-documenting and the compiler can prevent you from making type errors. Anyway it seems like you are making good progress, these are just some suggestions to take into account eventually. Share this post Link to post Share on other sites
clyde Posted March 25, 2014 I suggest you figure out a way to get text out of the code entirely. Generally if something is purely data you don't want it in code - outside of code it's easier to edit, you don't have to recompile to run, if it's text having it separate makes it easier to spell check, to localize for different regions, etc. In Unity you can have a text file as an asset and load it like any asset / resource. It can be xml, json, plain old text or whatever. (Actually it can be anything...but don't worry about that) In the project I'm working on now I have something similar, where conversations have different speakers and such. I use a JSON format to specify each speaker, their position, their dialogue, etc. What you are doing is fine for now, but once you are somewhat happy with it it will probably become a pain in the ass to work with. Is this called "serialization"? Does it involve "StreamReader"? Share this post Link to post Share on other sites
aperson Posted March 25, 2014 Serialization just means reading and writing things to a disk or other medium for long-term storage. For example when you create a prefab in Unity that is serialized to disk. It's turning in-memory classes and things like that into a saveable form. You can use text to serialize stuff but I wouldn't consider text assets by themselves to be examples of serialization / deserialization. http://docs.unity3d.com/Documentation/Components/class-TextAsset.html With a text asset you can create a text file (or a binary file...it's weird) and load it very simply, then access either the text or the bytes. From there you can split the text on line breaks or if it's in a more formatted style like XML or JSON use some package to convert it. StreamReader is a c# thing for reading streams and files and such, TextAsset is a Unity thing that simplifies that. If I were you I would maybe decide on a text format like the speaker position, followed by a comma, followed by text, followed by a line break. (Basically a CSV format - you could even maintain the file in Excel and export it when needed) Then you type in all the conversation data into that file. And maybe have a different file per conversation to start off with, or something like that. Depending on the size and scope of your game it may not be worth it. It's something that is eventually worth doing if you have a decent amount of text, but if it never becomes an issue I wouldn't sweat it. If you were writing say a whole visual novel though I would definitely figure out a way to separate out the text. Share this post Link to post Share on other sites
Forbin Posted March 26, 2014 Look into i18n packages (internationalization/translation). You can double up on putting your files in text by preparing for translation. Share this post Link to post Share on other sites