Jump to content
  • Advertisement
  • entries
    13
  • comments
    22
  • views
    2350

About this blog

I have wanted to, for many years now, get into interactive fiction, or  Adventure Games as we used to call them in the 80s. I'm a grown man now with and while I have never really wanted to enter the game development business, I still have always dreamt of making a Adventure Game of my own. Many years ago now I started a uTibe chan where I reviewed old classic games and this stoked the desire for me to do a C++ Programming course, but life got in the way. Still, now that things have settled down I wish to revive this dream. I'm keeping it on a "hobby" level though. I figure if I just stop my miniature painting I'll gain many hours for this new hobby.

So long story short. I'm a total noob at gamedev.. with nearly zero experience in all aspects of it, apart from some rudimentary C++.

I hope to use this blog will chart my progress as I learn C# and Unity in the goal to produce a 1/2 decent adventure game.

Entries in this blog

Is project is still ALIVE??!

G'Day.... So if anyone has been following this project, you may have noticed a massive drop in progress, as in literally zero progress. I just wanted to make a quick post to say that this project is still very much on and at the forefront of my goals. I am currently moving house and have been spending all my "hobby" time on that. painting, ripping up carpet and laying wood floors, moving, arranging and so forth, digging up and rebuilding the path in the garden... etc etc. I just have no time to work on anything outside of my other time commitments. This is and will most likely always be a "hobby" and at this time I just have not had any time to work on it. That being said I should be finalising my move in the coming weeks. So I expect to get back into this project towards the end of February. So there is nothing to really report here, I just know a lot of hobby projects die out completely after a initial burst and wanted to say that this is not the case this time. See ya some when! --A4L  

A4L

A4L

Everything is in the Wrong Order!! - Test Adventure Dev 05

G'Day.... This is a quick post as I wanted to get something "shown". So this is just a quick demonstration of the application running. It is showing the start screen and then playing the Cinimatic_Enter for the 1st room you find yourself in. There are a few features you can see in action here. The game engine initialises. This dose a lot of stuff like reading in text files for rooms and items and word lists. It also resizes the console to a non-default shape. This is as I wanted more vertical room to allow for long text strings. I also elongated it as well. It shoul fit comfortably into a 1280x720 screen so I doubt the resize will be an issue. Unfortunately there dose not appear to be a way to "lock" the user from resizing the screen. It is just up to them to not do it I guess as resizing the console will destroy the screen formatting. Then it prints the "start screen" this is the big Adventure Text and my message under it. These are actually two different print functions. One is a "frame print" that is a instant display, well really just a super fast display if lines) and the other is a "type written" effect that types out each character at a time. You might also note that there is a dynamic wordwrap that makes sure the text has a nice margin on both sides and no spit words across lines. The cool thing is that the user can use any key to "skip" the text output to the end. After pausing for an Anykey it then starts the actual game. We are now in the main game loop that takes input then returns to a point that takes input. Then it prints out what I am calling a "Cinematic". In this case the cinematic is the "entered the room for the first time" List<string>. All this data is read from external text data files and can be changed by simply editing the files in a notePad. These Cinematic only play if certain switches in the room are triggered. So every input loop the room.Activates().. but the switches determine what automatic information is displayed before accepting input. This way I can add any story text or events or scene changes, and then after that, no matter how may times you re-enter you do not see them again. So in this case the CinematicEnter plays the very first time the player enters the room.   Aren't I supposed to be working on the CommandPhraser? YES! yes, I am. A good mate of mine who is a programmer recently got over sickness and rebooted his online presence. After I was telling him of my project and how it has been going and he kinda gave me a bit of a scolding. Apparently, I have done one the cardinal sins. I have been focusing on the wrong stuff. Almost on polish rather than the meat of the application. Meaning that I have done a lot of work here and have really failed to make anything but minor inroads into the command phraser. Which is really the entire focus of the application and the main "chunk" of it I plan to be carrying lessons form into other more complex projects for the stage 2 "2D" projects. Without a command phraser there simply is no game. So why have I not prototyped that first in a clean simple environment? I dunno man.. I dunno. I probably should have haha! You see I was trying to build what I have now.. an environment that I can easily test commands. So I have a player sitting in a room, with items and in a level. While I was building the DataReader I found I was working on phrasing data I had no real idea on how to use. So during the rewrite I redid the code to be generic. It now reads raw individual lines into strings or reads raw individual lines between brackets into List<strings>. So I am not longer restricted with pre-planning the entire data file. It is trivial to add more read data types as I need them. So now I had the data reader, it seemed logical to me to work though in a forward,s tep by step kind of way. So I add and use in a "real" manner the data. Rather than having all this junk data. So when I am coding the command processor I am also coding how the read inputs can be used in a scene and at the same time build the exact data it needs to do those commands. Without having to pre-plan everything. Well that is my reasoning.. I still think I probably should have made sure my command processing concept was workable before hand... oh well. Regardless I am pretty happy with were the project is right now. Everything seems to be working as I wanted, and I am now in the exact position I planned to be.. as in a area free to experiment wit the command phraser and it's action implementation in a hands on kind of way. See ya next time! --A4L  

A4L

A4L

Ok... Now What? - Test Adventure Dev 04

G'Day.... So after rebuilding the project I think I have condensed things into a much easier format for me to move through. Basically I split some classes, and removed a lot of the jumping around. So once data is "sent" to a class, it just stays there. My old system I was passing variables all over the place and was having a hard time tracking where everything was going when I ran into an issue. Now all the code for any giving thing is basically contained in that one .cs file. I think I could improve on this even more by building a "interface" for the DataReader. As all the data reading stuff is nearly identical, apart form some method logic, so reading the actual data text file is the same for Areas or Items or w/e, but how that data is used is different. I think this is exactly what interfaces are for, but I played a little bit with interfaces and inheritance and felt it would be a lot easier to just move on with how I already know to do things. I got an interface working, but it felt a little confusing to me. I was just sure that I was not fully grasping what was going on here. I really should have completed my basics stuff before trying this project.. but I just wanted to get started! So I chose to have a DataReader class that each individual "reader" class can call. It basically works out kinda the same. I split all the readers into there own classes but the data reading itself is all handled by a single function externally, so modding that will update all the readers. This basically brings me back to where I was on Monday's Blog Post before chose to rebuild the project form scratch. The player can exist in a level, inside an Area, that contains items. The Project Now Has A functioning game loop that can take user input string. A full functioning Tokenizer and Stemmer to process that string for feeding into the Command Processes A full functioning DataImport system for reading formatted text files. Fledgling Data File formats for Areas and Items and stuff which the readers process. An entire area including it's items and other objects are all added in a single command to add that area to the LevelMap. [ Layout[0, 0] = ReadData.ImportAreaData("TestArea"); ] The Area DataFile contains a list of item names. These names are read and in turn fed into the itemData processer to construct the items and add them to the Area. These DataFiles will most likely have more data added to it as the project continues, if needed. It is a simple matter now with the DataImporter and various DataReaders separated it is fairly dynamic and should allow easy changing of the kind of data I pull form the files. As I go through the Command Processing changes may need to be made in these files and the final objects they represent. A Smattering of other Text Utilities and Buffer stuff and Print Functions to handle the console. (I'll not list all these but 2 of interest may be) Printing to console large text streams with proper word wrap. Printing in a visual way (like a type writer one letter at a time) and space to instantly display final string. Ok... So... How exactly do I make a Command Processor? Idea 1 - Dynamic Action / Command Lists This is the next big stage of the project. I now have an easy way to "build" a scene. Basically my original short term goal was to get the project into a state where I can experiment and build the command processor, which I hope will be the main focus and most interesting part of this project. Basically I now need to work out how to "kick ball" and "move north" and all that. With my main project goals of having it accept much more complex commands than hard coded two word inputs. The problem here is that I do not really know how to do this. I have some ideas I want to try, but the skeleton system took a lot longer than I thought as I screwed around making the DataReaders, rather than just building some dummy data to work on inside the project. I really should have done it that way, as when I have the command processor, it would be a simple matter of converting the dummy datafiles to actual data files. Still... it seems to me that I need only two things worked out for the command processor to function. A single command input string needs to be boiled down into 2 things. (conjunction inputs with multiple commands can be dealt with after all this is working.) Object - The object the player wants to interact with. Action - What the player wants to do with that object. Synonyms : Each Object and Action requires a list of synonyms so the player gets a false sense of the application having an organic understanding  of things. Fetch, Pick Up, Take, Grab, Steal, Pickpocket etc etc ... all boil down to a single Command : "get". It is the command "Get" that the processor recognises. Now obviously I don't want to have gigantic dictionaries and connected synonym lists for every word in the English Language. I can limit the list of active words by building a word list of actions and objects at the moment the player enters a given area. So if I do not put a chair in the room, a command that says "get chair" can report back a standard error message like "There is no {object} in sight" or w/e. What this means is that specific Actions which are unique to any given object can be part of the Item itself. So as the player enters the room, it builds an action list, and one or more of those actions are added by scanning the area for action and object keywords. So if I have a ball item, then suddenly the processor understands the word "kick" and the word "ball". (as an example) Still, there are also needs to be a set of global actions that the player should be able to attempt at any point in the game on any object, regardless of the scene. Things like "move", "get", "look", or whatever. Even "kick". (I know I used that example before) These can be attached permanently to the player. So... on entering a area these things happen. A list of Actions keywords that are always available to the player is appended with any actions keywords specific to that area, or items in that area or w/e. A list of Objects keywords specific to that area or items in that area or w/e is also created. Now.. the processor distils the user input command by finding Actions and Objects in that input string. If found, it dose something. If not it returns an error type. Will this even work? I dunno. But going to try it. This is the basic idea for how I plan to handle command inputs. My biggest concern is that I am not 100% sure how to handle NOT finding keywords. I am pretty certain I can find keywords and then action upon them... but the player will be producing a lot of commands that are wrong in the context of the game but I want the application to take those failed commands and produce meaningful results. Basically at its core this idea is a "white list"... but some how I need to now work out how to handle all the failures. If there is no ball in the scene how do I handle Get Ball... or if there is a ball in the scene how do I handle and recognise invalid actions. Like say "kiss ball". Something possible but is still technically an error. For now though. I plan to get the input distillation and keyword list creation and matching functionality. Assuming it even works. See 'ya Next Time!  

A4L

A4L

Project.GoToStart() - Test Adventure Dev 03

G'Day.... I've been a little slack and not spent a lot of time on the project the last few days but after an extended session last night and today I think it may be time to strip the entire project back and have another whack at it by building fresh code with a clearer idea of what I want to do. I have a lot of stuff in the project that is wrong, or needs re-jigging and I am starting to feel that if I just restarted with all the learned lessons I could make a much better version of the application without having to constantly "work around" my old junk code and systems. So basically I am going back to the drawing board.. but I also wanted to go through my command system idea in a way that I hope will spell it out to others, so they could give me input, and myself so it can act as notes for my rebuild. The Main Goal of this Project The real focus of this project is not to make a working game, but to learn programming and get an idea of what it takes to realise an application. Obviously I want to make a working game but what it is really about was setting myself a challenge and following it through. To do this I chose a "Text Adventure Game" written in C# using the console but I wanted a way to build it that was more interactive than a simple two point phraser that only accepts "get hat" or "look room", "move north" or w/e. I wanted it to be able to understand commands like "Pick up the hat and put it on" or "Smash the lock with the pickaxe and look inside" stuff like that. So while, yes, I plan to finish this as a game, restarting is not an issue for me as it is the "path" to get to the end result that matters, the learning and experimenting, not so much the game itself. Tokenise Code The first part of the new build is going to focus on the user input. I wanted to rebuild what I have done but in a cleaner way. This game will take lines of user input and phrase them into commands. To do that we are going to be using this tokeniser code. public static List<string> TokenizeStringList (string input) { List<string> cleanedInputList = new List<string>(); string[] raw_cleanedInputString = input.ToLower().Trim().Split(null); foreach (string word in raw_cleanedInputString) { if (word != "") { string s = CleanedWord(word); if (s != "") cleanedInputList.Add(s); } } return cleanedInputList; } So this code simply takes in a input string and spits out a List<string> with one word from the string in each element. It also sets the string to lower case and trims off any leading or trailing spaces before testing the token to see if it is an empty string. This is to avoid turning (space)(space) into a token that is just a single (space), which would be trimmed into a empty string anyway. Long story short by the time we are inside the If statement we are working with a single word all set to lower case with no leading or trailing spaces and never a blank string. Once we have that word we do some quick cleaning of unwanted characters. public static string CleanedWord(string word) { char[] whiteList = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'".ToArray(); char[] rawChars = word.ToArray(); List<char> cleanedChars = new List<char>(); for (int i = 0; i < rawChars.Length; i++) { foreach (char c in whiteList) { if (rawChars[i] == c) { cleanedChars.Add(c); } } } if (cleanedChars.Count == 0) { return ""; } else { char[] c = cleanedChars.ToArray(); string s = new string(c); return s; } } My original code as you can see was a lot more verbose than what I ended up using  but worked fine. I had some issue latter on with reference vs copying of List<strings> and during the time I was trying to fix that problem I found a neat simple couple of a few lines on the internet that basically do the same thing. public static string CleanedWord(string word) { var banList = "~`!@#$%^&*()_+{}|[]\\:;\",<.>/?".ToCharArray(); return string.Join("", word.Where(s => !banList.Contains(s))); } What both these code blocs are doing with CleanedWord(string) is removing all alpha numeric chars from the word, except the ' (apostrophe). So I needed to get rid of brackets, dollar signs, exclamation points and all that, but keep the apostrophe any letters and numbers. So after all that we end up with a List<string> with a cleaned word in each element. Stemming the Words What I am trying to do is distil a unknown list of words imputed by the user into usable keywords I can match to my words lists. One of the problems is that words have a great many forms. I believe it is called morphology. So... Looks Looking Looked Are all extensions of the word look. So in a "real" NLP system you need to understand these different versions of the word look, but in my little application I can get away with reducing these words down to its base version. It really makes no difference in a practical way if the user types "Give the deer her freedom" or "free deer". By stemming the word Freedom to Free, I reduce the keyword search and understanding requirements. But here is the crux. It is my belief that if they type "Give the deer her freedom" and the game only understands that as "free deer" due to my keyword system they will get the impression that the application is understanding more than it really dose. The important thing here is to have the program respond in a predictable way. Now stemming words is a lot harder than it seems. I originally was just removing things like "ing" form any words I found.. but there was a lot of words that came out wrong. I did end up having a pretty decent code block for it though. It ignored words of a certain length , wouldn't remove a "s" from the back of a word if "s" was the previous letter stuff like that. I felt the stemming was working very well, but occasionally in my testing I would find a problem and have to add a exception for that problem. What I ended up with was a very rough bit of code I called RoughStem(string)... still during my googling I found out about some super duper "algorithm" that is professionally made that dose exactly what I am looking for. Called "Porter2". I found it immensely satisfying that the Porter 2 algorithm was basically doing everything exactly like I was, but well, better and in a more robust way. It uses sub-string lists to find conmen suffixes, then uses logic to determine if that part of the word is normally removed or not. What it did really different to my experiments was to split the word before stemming and then stitch them back together. I was happy I was on the right track at least. You can read all about the algorithm <here> I got about 1/2 through building this algorithm in my noobish ways when I found some code on GitHub with the MIT licence, written in C# that I could just plug directly into my application which implemented the Porter2 Algorithm. . You can see the GitHub Page <here> After some back and forth I decided to abandon my "mostly" working RoughStem(string) method and my out of my depth attempts to build the algorithm myself and just use this GitHub code by "Nemec_" So I added a function that simply called the Porter2 code and stems all the words in a List<string> public static List<string> StemWordList (List<string> wordlist) { for (int i = 0; i < wordlist.Count; i++) { string StemValue = StemWord.Stem(wordlist[i]).Value; wordlist[i] = StemValue; } return wordlist; } Results So after all that I think my Tokenisation Code is complete and finalised it takes any string input form the user and builds 2 variables form it that is stored until a new string input is entered. string rawString - Single String that contains the entire line entered with no modifications. List<string> cleanedInputTokens - This is a List<string> that has a cleaned word at every line. List<string> stemmedInputTokens - This is a List<string> that has all the cleaned words stemmed and ready to be sent tp Processing. I may produce a 4th list that contains all the words in a list but not cleaned or stemmed but I think for now I have teh default input string and the cleaned but not stemmed strings. I can use both of these or just the cleaned list to build response lines to feed back to the player and use the stemmed list to actually process the command. The only other modification I may make before I continue is to dump the List<strings> completely. As in once I have built them return them as string[] arrays. This would make them a little easier to work with I think. Well that's that! Ok.. so that is the tokeniser!! It seems to be working very well, and I am glad I am rebuilding the project. It is a slow way to go but it really seems to be helping me get everything back into action.      

A4L

A4L

Oh, the Little Things - Test Adventure Dev 02

G'day.... So the new year is upon us and after taking a few days off to do family things over the holidays I managed to get some time into my Test Adventure Game Project. As mentioned in the last DevDiary I wanted to build a base skeleton for the game so I could work on the meat of the project, which is the Command Interrupter. My goal for this phase was simply to implement classes for Player, Level, Room, Exits and Items. That way I could sit in a test room, with a few items lying about so I can build an test my command processing code by interacting with that room and those items. That is all up and running now. So the game loop is running, and I get to enter commands and stuff, and there is a room to look at and items to interact with, but at this moment there is no logic to "understand" anything or "do" anything. To do this though I also had to build my DataReader class, as I have always wanted the meat of the "game design" to be done externally form the coding. The goal here was to build data files for rooms and items that the game reads from. Allowing me to quickly edit descriptions and even set boolean flags without ever having to touch the code. In addition my plan for the command processor will be using dynamically built word lists and the DataReader will be used for this as well to construct those lists from files. (more on the actual command interpreter when I get around it it) Building the DataReader was a little more fiddly than I thought. I went through a few iterations of methods and towards the end of the coding phase (a phase is what I am calling a short term project goal) decided that "bracketed" data is probably the best way to do it. Unfortunately I was so deep into using line by line reading that I didn't want to redo everything. I may still redo things, but as I said the testing environment is up, so I will probably just move onto the command interpreter. Examples of DataFiles Room DataFile Example @PasteBin Name Room_Description Default room description that always prints on on any given "Look-Room" command. The idea is for this text to have appended onto it any other "Look-Room" information that may be required by cycling through the objects in the scene. Exit Brackets These are two text lines that can be searched for to find the given index number for the start and end of a individual item information. Exit-Name Contains the name for the individual Exit.. like North... or "Road into Forest". Open This is a Boolean value that tells me if the exit is closed or not at initialisation. Look-Room-Closed text description that is to be appended to the default "Look-Room" result. If the exit is CLOSED. Look-Room-Open text description that is to be appended to the default "Look-Room" result. If the exit is OPEN. Look-Exit-Open This is the description of the "Look-Exit". So when you actually examine the exit itself. If the exit is currently OPENED. Look-Exit-Closed This is the description of the "Look-Exit". So when you actually examine the exit itself. If the exit is currently CLOSED. Use-Open Text response if the "Open-Exit" command is successful. Use-Closed Text response if the "Open-Exit" command is a failure. Item List Brackets List as many items here to fill room. Each item name corresponds to a physical item data file to be read and imported into the room object. Item DataFile Example @PasteBin Name Get-able a booleen value to determine if the object is able to have the "Get-Inventory" command run on it. Description_Room Text description that is to be appended to the default "Look-Room" result. If the object is in the scene and not picked up. Description_Dropped Text description that is to be appended to the default "Look-Room" result. If the object has been placed in the room by the player. Description_Gone Text description that is to be appended to the default "Look-Room" result. If the object has been removed from the room. Get-Item-Success Text to be printed when "Get-Item" is SUCCESSFUL. Get-Item-Never Text to be printed when "Get-Item" is done on an object that is never allowed to be gotten. This is what the data files look basically look like. I use NotePad++ and set up some custom colouring so it is a lot easier to read while editing. ReadData-Room At this time I have 2 Data Files in the project. ROOMS and ITEMS. Each individual room or item is a separate file in either the room or item folder Each DataFile is read into a List<string> using File.ReadLines(). I then read those lines looking for keywords at the start of each line using .StartsWith() or I read a section of the file into lines between two brackets Those found lines are then cleaned and added to the room's object as data. Also the room DataFiles contains a names of items, which match the file names item data files. These datafiles are in turn processed to build the items that are then added into the Room. This entire process of adding a room to the level map is boiled down to a single command "LevelMap[x, y] = DataReader.ImportRoomData(string name);" I am reading the DataLine by line, as you can see in the text files each line has its own "keyword" at the start of the line. Even if it is a long string. The entire text file is read into the application, ignoring any empty lines. It then processes each line looking for the keywords at the start of the line. If the keyword is found, it removes that keyword and then uses the rest of the line as data by plugging it into various variables for objects in the game. This is all working pretty well. Though I came to a issue with adding multiple exits. I wanted to be able to add as many exits as I liked and I didn't want to have to code each exit keyword to be unique. This lead me to working out that the Line by Line reading is probably not the best. As you can see I now have a EXIT_START and EXIT_END keyword, with the data for that unique exit inside. What the code dose now is look for EXIT STARTs and tally the total exists in the file. At the same time is it tallying and recording the indexVale in the List<string> for those "start and end" bracket lines. I can then feed those into a method and do the keyword search to extract the data on a targeted "section" of the file instead of the entire file. It can even loop by the total found count to automatically add things as I edit the text file. I think this idea is a far better way to handle line reading when trying to extract data. I will be using "brackets" from now on until I work out something better. Forward Ho! Right.... so the test environment is up. I may have to look at adding more or changing the actual data being extracted but I think the extractor is robust enough for my needs as well. So now the fun part starts! Building my Command Interpret. See Ya Next Time --A4L Test Print of a testRoom with Three exits and 4 Items (I have not printed out all the item properties)

A4L

A4L

The Beginnings of a Plan - Test Adventure Dev 01

G'Day.... It is time to really get my teeth into my new project. I'll be using posts on this blog called "dev diaries" (original huh?) for this project as a way to take notes and organise my thoughts. Also with luck I may get some practical input form more experienced people. I started on the general outline yesterday, so this morning I want to take a few moments to collect my thoughts on the project and consider what to do next. Project: Test Adventure The goal of this project is to learn C# in a practical environment by creating a text adventure game. If the timing allows I would also like to look at adding some features to make the project valid for the "Dungeon Crawler Challenge" @GameDev.net. This will require the additional inclusion of Sound and Combat which are not in my original plans for the project. Game Design Goals : The game will run in the Console The game will be programmed in C# The game will have a pseudo-Natural Language Processor. This is the main goal of the project and its main focus. The project will contain: Rooms, Items and a Inventory. It will use TxT Data Files to read content into the game so I can edit the game data in a easier way rather than directly in the code blocks. This will require the development of a txt file phraser and some kind of formatting for it to read. I would like to have a SAVE and LOAD system. Lower Priority Design Goals : A Map System for the player - as an expansion to the inventory system. Sound, Music Lowest Priority Design Goals : Adding features to bring project inline with the minimum requirements of the GameDev.net "Dungeon Crawler Challenge". Monsters / Combat / Loot Dev 01: Test Adventure The biggest issue I am having at the moment is trying to work out how to structure the application. As I have literally only ever made a single application (see my Tick Tack Toe Game a few weeks ago) the organisation of the classes and how the object interact seem to me to be the most complex part of this project so far. Actually fooling around in the logic to make the code do stuff is not that difficult (or so it seems at this stage) but working out an efficient and easy to implement / edit structure for the game is rather hard. I originally planned to get it all out on paper making flow diagrams and stuff.. but a very experienced programmer mate of mine said that I really should just get in there and get my hands dirty. In his experience redesign is a big part of development. The more you work on a project, in a practical way the better you understand its needs for the design. His attitude is that you simply can not predict everything.. so why try. All it dose is slow you down in very boring clerical work. This made a lot of sense to me. Skeleton Classes (completed and functional) Program - This is the main game loop. I want this to be nearly empty.. with just a initialisation start screen and then a game loop that runs until exit and then the exit messages. Engine - This is a system I made up for the Tick Tack Toe Game, I liked out it worked so want to continue it. The Engine will handle all application function calls to other parts of the program including initialisation. The "Program" class itself should only consist of Engine Calls. GameState - Again I used this in my Tick Tack Toe Game this class will simply track gamestates like end game and stuff and feed that to the Engine. ConsoleBuffer - In Tick Tack Toe Game I had all the console printouts compiled into string lists of lines before being printed. This worked well I thought and I'll try and do it this way again. PrintConsoleBuffer - This will contain some code to print out the buffer to the screen itself in various ways. DataFiles - This will handles the reading of data files, and the save and load stuff for the game. TextUltils - This is part of the main point for this project. It will handle all the string manipulation. Including the tokenisation for the pheudo-NLP code, input clean up and console word wraps. CommandProcessor - This is part of the main point for this project. This will take the processed strings from TextUtils and use them to do things. What Next? So all the above classes are completed skeletons. This means I can now test the project as I add code to it. They are far from complete and some code is temporary to get the app up and running for testing. What I need to look at now is the items, rooms, level and player classes, with a mind for how I plan to do the various word lists. More on that in a future post. For now I need to get the skeleton completed to a point where I can test commands. Once I can start testing the command processor properly the entire project should start to take form. Items will contain as a base : Description, Inspect (inventory description), Get Text, and a Name The Rooms will be one of the main classed in the game. They will contain as a base : Descriptions, Items, Exits, Player Advancement Blocks, and a Name The Level will simply be [ ][ ] array that contains Rooms. All the location code like getting player position and stuff will be stored in here as well. The Player Class will be very barren at this stage. All I really need for the next phase is to be able to place the player in a given location inside the level. Inventory Items, Location in level (posX, posY) Once I have these done I should be able to place the player in a test room, with some objects. Then I can work on the meat of the project the CommandProcessor and all its parts. Which I will detail when I get to that phase.   Anyway.. thanks for reading! --A4L   Project: Test Adventure

A4L

A4L

Text Adventure - 3Dbuzz Tutorial (C# Starter)

G'day.... Despite advice from a friend to jump into the deep end and get my teeth into a "real world project" I was still interested in doing some guided exercises to get my brain into gear. To that end after some duck'n (duck-duck-go 4dawin yo!) I found an old tutorial from a website called 3DBuzz. The tutorial was free on uTube and it's subject was the very game type I wished to do for my learning project. A "Text Adventure Game". I get that a text adventure game isn't exactly ground breaking as an idea for a project to learn on, but it actually aligns with my main short term goals. My nick isn't "Adventure4Life" for nothing! C# Starter - Hyperion Text Adventure Tutorial - (3Dbuzz) @uTube My Version of the Hyperion Project @GitHub While I much prefer working from a text book I found the tutorial to be pretty interesting. Videos just take so much longer to get to the point. A single paragraph you could read in 10 seconds is like 10 minuets in a video!... anyway. It really covered the exact same ground as my previous introductory books I have been going through so there was little new information. Still it was cool to see a realised project in the planning stages. I only ran the tutorial series until the 1/2 way mark. Once you get there it is really just a matter of data entry to fill in the requirements to make it an actual "game" the functioning "engine" part so to speak was all done in the earlier stages of the tutorial. I did complete watching the tutorial but felt that I didn't need to go and write everything out to completion in VS with this one. So, What now? Well, now it is time to try and produce my own game project. The goal is to make a Text Adventure Game, though I am keeping the Current GameDev Challenge (Dungeon Crawler) in mind. If I get my framework up quickly enough I may be able to add additional features to the game to make it valid for submission to that competition. As I think a text adventure games and a text dungeon crawlers share many design elements. Mazes, Inventories, Objects, Rooms, Players, NPCs, Dialogue, Weight Limits, etc, etc. The 3D Buzz Project while interesting as an exercise that is well presented and informative, was of little use to me for my own goals and desirers. As I said much of the tutorial was going over ground I have recently covered, so for me, the most interesting part was the project planning videos. The game itself is also far to simplistic, as an example for me to build off. Particularly in the command interface. My long term goal (far beyond this project) is to learn natural language processing and I would love my text adventure to have a much more robust command phrasing system. Now it will not have anything like a NLP, but I believe due to the confines of context in the project, I will be able to build a phrasing system that gives an illusion of a NLP system, to some limited extent. I do not want people to type "Get Sword", "Exit North", etc, etc, though they could if they chose but I'd also like the user to be able to enter commands like "go pick up the ball and throw it into the basketball hoop" and have the game understand them. This is the "challenge" I have set myself. I will go into more detail on my actual project, which I am calling "Test Adventure" (shout out to Granddaddy Advent y'all!!) and it's other goals in a later Blog Post. Thanks for reading! --A4L Happy Holidays!!

A4L

A4L

Dungeon Crawler Challenge - Wink Eye, Won't I?

G'Day So GameDev.net seems to run these "community challenge projects". The next one is called "Survive, Loot, and Discover! It's Time for the Dungeon Crawler Challenge". I'm not sure this early into my learning process it is a good idea to try something so complex.. but I was talking to a mate of mine and he said the mnemonics created by working on a "real" project would help teach me in a way that is a little more fun than reading through text books and doing exercises. I mean in a way this is a big exercise right? The issue I have is that this has a tight timeline. I strongly believe that setting time restrictions on your goals is the ONLY way to do things, least you find out it is 6 months latter and you have done exactly jack all but memorized all the words to Babylon 5 Season 1. Been there, done that! lol. The problem is that the project runs over Xmas and New Year. Which is a historically super busy time for my family. I come form a ginormous extended family and it is traveling and eating and playing with kids well into late January. Still, that being said a "Challenge Project" satisfies a few things that I think could be really cool for a terminally lazy hobby guy. It gives me needed focus, as in a task to attempt which would use my fledgling knowledge in a practical way. It also gives me an arbitrary deadline to work to. As I said above, I think deadlines are crucial for effective task management and goal achievement, at least for myself. Probably most importantly though is that these project are probably going to get genuine feedback. As a solo, self-educating, hobbyist it is all to easy to loose motivation if there is no feedback of any kind. This is the main reason for my blog. It may be narcissistic I suppose, but seeing the blog getting likes and the view count going up translates as a motivational force for me. Putting my project into a public group with much more skilled people commenting and possibly advising is very appealing. Yeah, but not so much  : ( This is a list of the requirements, and it just seems to be so much. There is a lot of stuff here that I have not ever tried.. like sound and music. I have been thinking over the course of the day exactly what I would like to do and how I could use the project to advance my own needs. As I said in my 1st Blog Entry my initial short term goal is to produce a text adventure game. I'm a big adventure game fan. Now a text adventure and a text dungeon crawler have a lot in common. A maze is pretty much just a set of interconnected rooms, inventories, items, currency... there is a lot of overlap between these projects. In fact the engine I develop for a text adventure could look nearly identical to a dungeon crawler for most of it's systems. How it handles maps, items, inventories, object tests, console printing and stuff. Even direct combat is not out of sight for a adventure game. Though it was not something I planned on. The thing is even if I was able to get this project done, and I think I would be able to, eventually. It would probably not have all of the required aspects. Particularly the music and Sound Effects part. I wouldn't even know where to start on that, well I guess I could google it.. there is probably some console command in c# that can just play a wav file or something. The Decision! There is a lot going on at the moment for me hobby wise. I have a paid run through for a new BoardGame called HeroPath on my uTube Chan that is starting on Wednesday, and a scheduled play through of Arkham Horror (3rdEd) that my subs have been bugging me about for months, this on top of the Xmas and New Year stuff, plus I need to continue with my "studies" by working through the books... PLUS all my regular social stuff and actual work that pays my mortgage. I just do not think I have the time, or the present skills to do this project. Yet there is always no time to do anything. People always have excuses for not doing something. I think you just need to go for it... there is never a perfect time to start.. you just gotta START!! So what I will be doing is in the same time frame as the challenge I'll be working on my Adventure Game Project. Basically I am setting my own Challenge Project. The main goal of which is to produce the language processor. Text Adventure Challenge Project Produce a language processor that can phase commands from user input. The processor has to behave either by being a natural language processor or giving the impressions that it's natural language processor I can not use any external NPL libraries. The processor should be able to understand combined commands form the user. "Pick up the ball and throw it at the target". "Walk to the chair and sit down". Stuff like that. Produce a program that allows the player to test the parser on objects in a scene. Well, that's it.. Have fun -A4L    

A4L

A4L

My First Game : Tic Tak Toe

G'Day... so I am about a week into trying to learn C# and have been enjoying it so far. I am learning from a book called "The C# Players Guide" and in it around Chapter 20 is what the author calls a "mid term project". To make my first actual application. A TicTacToe game. This is obviously something very simple but I felt it was a good excuse to try out things and see how it all went. The Brief Even though it said to only take 20 minuets I took a lot longer. I wanted to try out things with my short term goals in mind. One of those short term goals is to make a multi-room adventure game as part of my learning process. So I took a lot longer than 20 mins .. in comming up with a FrameBuffer and FramePrinting system that felt modular to me. I had some real issues working out how to control the game flow through the main loop. The original plan was to have a class that checked the game state and sit out a false when the game was over. This lead to issues with choosing new games and stuff. I ended up adding a "state" variable for each game state that was check in the loop. I think this is not the best way and in my next project I want to try and produce these states as a natural output from the game engine itself. All in all I am pretty happy with it... Source Code + Binary I have started a GITHUB account. I was having problems uploading everything to pasteBin... You can see my code here.. and I know it will be messy nad bad.. but I fell I made a good start. You can also use the download link to download the actual binary to run. I compiled this on Windows 10.. so I guess it has to work in a windows environment. gitHub Source Code .exe Binary Download How to Play This is kinda redundant for something so simple, but I want to get a "format" working for this blog. Q / ESC == Quit at any time N == New Game (At Results Screen or During the Game Itself) 1-9 / Num1 - Num9 == Place a Player Token. 1st Player will be randomly set to X or O.

See ya next time! --A4L    

A4L

A4L

Ascii Table and some Links

G'day. So I have been doing a lot of work in the console as I try and learn the basics of C#. I got sick of going all over the place for ASCII symbols to use as "graphics" in my console apps so thought I would simply list them all here In addition, I found this cool "Ascii Font Generator" Ascii Font Generator (link) Finally some other cool links I found useful... http://www.asciiworld.com/ https://www.asciiart.eu/ https://manytools.org/hacker-tools/convert-images-to-ascii-art/ https://asciiart.website/ If you know of any other cool ones.. let me know!

A4L

A4L

PSD Template for GameDev.net Blog Banner / Thumbnails

Hello!! I like blogging and generally assuming people are listening to me... but I also like things to look cool. I wanted a quick and easy way to make Banner Images for my new GameDev.Net Blog... so I created a PSD Template for that. Basically there are two safe frames... One is for Thumbnail and the other is for Banner. Just make sure your final image looks good with both those layers turned on and you are fine!. There is also a hidden layer called "copy". This is just a simple way to save a selection set. Ctrl+Click on it to select the actual area you need to save an upload. Load up PSD Paste in your Art under the BANNER SAFE and THUMBNAIL SAFE layer.... then scale and arrange it to look cool Turn on the THUMBNAIL SAFE layer to see how it looks as a thumbnail. Turn off the THUMBNAIL SAFE layer Hold Ctrl+Click on the COPY layer tp set the correct selection. CTRL+SHIFT+C (copy all) CTRL+N (New Document) CTRL+S (Save) Hope you like it! --A4L   Download the PSD from my Google Drive  

A4L

A4L

C# Players Guide : Classes (Balls Exercise)

Hello... This is my version of the Chapter 18 CLASS exercise about throwing and popping a bunch of balls. : NOTES :  Random() For the most part as I worked through the exercise things became clear but I am still confused about "scope" or w/e it is called that determines when a variable is available to be read by other sections of the code. I wanted to use Random(); to build random numbers on the fly, but it seemed that I was either calling the random very quickly in succession, so all the results were identical, or I wasn't able to access the random object I created when I wanted to. I got around this problem by creating a custom random class called RAN. This initiated Random() during the creation of the class in the main program.. so that only happened once. Then it had functions to produce the random numbers I wanted, in the type I wanted. Also I found the code to be really ugly and hard to read if I just used Random(). I was using Bytes for my 0-255 colour codes.. and as far as I know Random() is returning only floats.. so every time I had to use Random() object I had to use Convert()... this lead to it being a mess. So I build into the RAN class in a way to choose the types for me to clean this up a little. This is only using Random() to for loop 5-50 times and make a list of balls with a size of 1-25 Random rand = new Random(); List<Ball> balls = new List<Ball>(); for (int i = 0; i < Convert.ToInt32(rand.Next(5, 50)); i++) { balls.Add(new Ball(Convert.ToInt32(rand.Next(1, 25)))); } The Colour class that was using bytes was even worse. balls[1].colour.red = Convert.ToByte(rand.Next(1, 255)); balls[1].colour.green = Convert.ToByte(rand.Next(1, 255)); balls[1].colour.blue = Convert.ToByte(rand.Next(1, 255)); And the BALL class was every worse worse!! Ball ball = new Ball(Convert.ToByte(rand.Next(1, 255)), Convert.ToByte(rand.Next(1, 255)), Convert.ToByte(rand.Next(1, 255)), Convert.ToInt32(rand.Next(1, 25)); I found it really strange that using Random() to get specific types would cause such ugly and bloated looking code. So I ended up making my own Random Class called Ran(). This would change the above code to.... Ran Ran = new Ran(); List<Ball> balls = new List<Ball>(); for (int i = 0; i < Ran.Int(5, 50); i++) { balls.Add(new Ball(Ran.Int(1, 25))); } balls[1].colour.red = Ran.Byte(); balls[1].colour.green = Ran.Byte(); balls[1].colour.blue = Ran.Byte(); Ball ball = new Ball(Ran.Byte(), Ran.Byte(), Ran.Byte(), Ran.Int(1, 25)); Which seems to me to be a zillion times easier to read. I has occurred to me now, while writing these notes on the lesson that I probably should have put the conversions into the BALL and COLOUR class themselves.. so it always takes a float in the constructor but stores it as a Byte.. or something like that.. but even doing that would change all the stuff like so.... Ran.Byte() -> random.Next(0,255) Ran.Int(1,25) -> ranomd.Next(1,25) I dunno.. even this looks worse than my custom thing I guess... it seems that there is something I may be missing here... as it seems ugly and hard to write. Maybe there is a better way to handle conversions instead of Convert.ToInt32 or w/e : NOTES :  Code Comments I really need to start looking into making proper notes into my code. There should be a way using the ///sumemry type stuff to add ways to have VS use intense to show me what the members are expecting as I go. I will make a effort to comment more in my next one, but thought I would level this entire project with no comments.. just to see how little I understand it when I next look at it. C# Players Guide dose cover comments but after reading it a few times it is still confusing.. I need to source google page on this before next time. - THING TO DO. : NOTES :  Possible Error I think there is a error in the main program, not a fatal one.. but I believe now I am going though it for my notes that I should have used <= instead of < for the for loops. As I am counting from 1 and not from 0. I will not bother fixing this.. but it is something to keep in mind. The 0 start in the Arrays and Lists is a little hard to remember. I think it is not an error though as I am using +1 in the readouts... but I am done for now and will not be checking or changing anything lol. It is time to move on. : CODE : Ball Class Colour Class Program Custom Random Class Exit Program Class : EXAMPLE OUTPUT : Well, see ya next time!

A4L

A4L

And so it begins.....

Well.. the place to start is at the beginning, yet I have started this blog about a week into my new hobby. So unfortunately this blog will be missing the initial steps of my own personal development. Yet I guess it is close enough. I have mapped my short term goals into a few early milestones. Learn the Basics of C# Create a console text adventure game to practice what I learned Learn the Basics of Unity Rebuild my text adventure into a Unity Project. These are my initial milestones. not exactly mold breaking in originality but I am a relatively pragmatic type of person and feel small steps is the way to go. For me, I think the best way to learn something complex is to learn by doing smaller, less complex things inside the same topic. To that end I have purchased a book called The C# Players Guide. My time over the next few weeks will working though this book and then taking what I know into my first "real world" project. A Text Adventure Game. I am finding the book to be pretty interesting and easy to read. Though sometimes it feels like it is giving only a very cursory overview of things, leaving the reader to use google or a website like GameDev.net to gain further insight. I may look towards a more complicated book after this. I have read that C# In Depth is a good book to follow up from the Players Guide. Anyway, Up, up, up the ziggurat, lickety-split! -- A4F As I said I have already started on The C# Players Guide . Here are the previous exercises I have worked through. Chapter - 01 - Hello World Chapter - 05 - Variables Chapter - 07 - User Input Chapter - 09 - More Math Chapter - 10 - Switch State Chapter - 12 - FizzBuzz Chapter - 12 - Looping Chapter - 13 - Arrays Chapter - 13 - forEach Chapter - 14 - Enumeration Chapter - 15 - Methods (1) Chapter - 15 - Methods (2) Recursion - Fibonacci (Hard! This one hurt my brain a little!) Chapter - 15 - Methods (3) - TryItOut Chapter - 17 - RandomDie  

A4L

A4L

  • 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!