Jump to content
  • Advertisement
  • entries
    21
  • comments
    29
  • views
    4164

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

What is a Word worth?

G'day.... Well, I'm back, and I think the project has made some significant forward progress. To be honest I wish I spent more time trying to learn to programme before attempting something complicated like this project. I mean, it isn't really complicated relative to people that know what they are doing but it is a far cry from the questions in the book asking things of me like : "Write a program then prints out a Christmas tree of stars using for loops". I was just so keen to jump in and do something fun! I feel like the project has taught me a lot but I am unconvinced about the efficiency of this method of learning by "jumping in the deep end". The problem is that I am really not pushing my understanding of the larger things. As I am trying to produce actual results, I am simply working in the framework of my current understanding. For example, I haven't made any progress in learning INHERITANCE,  POLYMORPHISM, VIRTUAL METHODS and ABSTRACT CLASSES. Even though I am sure that some of these are how I should have done things. Also my understanding of the Stack and Heap and all that is still spotty at best! So I feel I am not actually learning at the same pace as when I started. What I am getting though is an understanding of how the stuff I know can be used. Over this learning project, I have done some pretty radical re-writes. Each time the code has been drastically simplified. For example, a snippet from my last push to GitHub. This old code reads data from a file into my area class...... private void ProcessData() { area.SetName(ReadDataFile.Read_RawSingleLine(areaKeys.areaName, fileData)); area.SetLook_Description(ReadDataFile.Read_RawSingleLine(areaKeys.areaLook_Description, fileData)); area.SetCinimatic(ReadDataFile.BetweenUniqueBrackets(areaKeys.areaCinamatic_Start, areaKeys.areaCinamatic_End)); ProcessAllItems(); ProcessAllExits(); } private void ProcessAllItems() { BracketCounts brackets = new BracketCounts(); brackets = ReadDataFile.Read_BracketCount(areaKeys.itemsStart, areaKeys.itemsEnd, fileData); for (int i = brackets.start[0] + 1; i < brackets.end[0]; i++) { DataRead_Items BuildItem = new DataRead_Items(fileData[i]); area.AddItem(BuildItem.GetItem()); } } private void ProcessAllExits() { BracketCounts brackets = new BracketCounts(); brackets = ReadDataFile.Read_BracketCount(areaKeys.exitStart, areaKeys.exitEnd, fileData); int exitAmount = brackets.bracketCount; List<int> bracketIndex_Start = brackets.start as List<int>; List<int> bracketIndex_End = brackets.end as List<int>; for (int i = 0; i < exitAmount; i++) { DataRead_Exits BuildExits = new DataRead_Exits(); area.AddExit(BuildExits.ProcessExits(bracketIndex_Start[i], bracketIndex_End[i], fileData)); } } By splitting my readData functions into separate and specific things, I have cut down what each individual file actually does. This makes it super easy to read, and also easy to find stuff as I do not need to dig through a gigantic and generic readAreaClass that may even have duplicate functions, with say readItemData, or whatever. I have split it all out and focused each class to take in and output small packets of data in what are effectively single functions. I mean a single class might have multiple methods in it, but the basically takes in something manipulates it so it outputs what I want and does nothing else but that. (for the most part) so I can reduce the code in a way that allows me to simply "read" it in a very clear way... and if I need to know HOW it works I can go deeper, by just following the program flow. The new code below does the exact same thing as the snippet above, but all the considribaly cleaned up "guts" are now behind vey neat and simple in/out class functions. So when reading the above code it is a mess, but reading below is super easy, even if you do not have any idea what is going on.... area.areaName = readLine.Get(KeyName, fileData); area.areaLook = readLine.Get(KeyLook, fileData); area.cinimatic = readCinematic.Get(CinimaStart, CinimaEnd, fileData); area.itemsList = readItems.Get(ItemStart, ItemEnd, fileData); area.exitsList = readExits.Get(ExitStart, ExitEnd, fileData); So you re-wrote it AGAIN.... Any actual progress? Yes actually. I have completely implemented the dynamic keyword generation system. My biggest fear with this project right now is that I never did a proper proof of concept to skeleton or whatever it is called. I basically have no idea if this keyword system I am doing is going to work as I envisioned it. I should have experimented with a simple project and some hardwired word lists and determined exactly how and if it all works. As I haven't done this, I am just trusting to the original plan. A big part of that was to simplify the commandphraser by limiting what it is actually looking for. If I give the app a series of keywords and key actions I only need to code the app to understand THOSE things. Say I have a box in the scene (and only a box) Any command phrase that the payer enters which does not contain the word Box can be ignored or throw and error or something. As the player moves around, the app looks at the items in the room and is able to construct from my word list files dynamically. So words that are active in one room would be inactive in another. Anyway, I am literally falling asleep as I type this! lol... can't be bothered checking.. bed now Thanks for reading --A4L  

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

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

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

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

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

No Comments == More Problems

G'Day.... So I spent most of the day re-acquainting myself with the code of my project, after my near 6 month break from computers. Not a break from the project but literally, I didn't have any computer or access to the internet beyond my phone.  This was a lot harder than I thought as I had completely forgotten the logic I was using for this program.  I mean the app worked, and I could keep going, but I wanted to know the exact specifics to be clear in my mind. I also needed to strip it back to the very skeleton, removing all the "testing" stuff, and then build it up from there for so I could start loading the engine with actual content. I only made it halfway through tracing the game loop through all the classes so far but I was kinda surprised at how far along I am. I mean I am literally at the point of just adding the command processing and the loop is pretty much closed.  This brought back to mind the big problem I was tackling at the time I sold my old house, moved and the project went into hibernation. A Functional Impass So the problem I had was being confused about how to have unique code in my project. So far everything is made with classes that are filled with data in a very general way. I wanted to be able to populate the gameworld during initialisation with simple instructions like gameworld[1,2].loadArea("bedroom"). For example, the "Layout" is a grid of "areas" and the "areas" contain "items" and "exists", and the areas, items and exits all contain unique text strings for names and descriptions and all that concerning their properties. These are all created by reading "area" data files. So during game initialisation, the code just phrases the area data file and this creates the game world. (See my blog post on data files) The command interpreter can determine what the player is trying to do and with what, like "get apple" or w/e... but the issue I was having was I didn't understand how to have unique code events on these objects. Everything is created from the same classes but how do I have unique functions in those classes and still have the be generic enough be filled in this nice neat way. I didn't want to have to write all these unique classes and then make all these complex checks and balances in the data importer. How do I say have "take apple" put the apple in the inventory, and have "take supporting block" cause a cave in and spawn new items and change the exits of the entire area? A Functional Impass - Advise me on how to proceed? (C#) @GameDev Beginner Forums (This is a forum post from February where I asked about this) A Solution? So I was pretty down while doing my project revision knowing that as soon as I got it back up to scratch I would again be stuck at this problem in the design but while I was having a shower I had an idea for a possible solution that seems simple and within my knowledge and abilities. To put simply I will make a new class called "Action" that will process the commands separately from the items and exits. In the same way, I do not just print the text outputs directly to the console, I send them to a textBuffer for processing first, I will not send the commands from the command interpreter directly to the items or other interactable objects and trigger action function in those classes. Instead, I will have an action class that has the command sent and using the player location to find the area as well as the item name I will be able to use if or switch or whatever to filter these action between generic actions or unique ones. So "get apple" is sent to the action class, it searches through to see if the apple has a unique get function... it sees no exception, so it falls through to to the generic "remove from area, add to inventory and print "get" text to screen". Meanwhile "take supporting block" searches through the action class and sees that there is a special case for "get" concerning the "supporting block" and it falls into that unique code block that dose w/e. I think this will work. The only issue I have is how exactly to get it to work. I may need to make action classes for every action type. Though I hope that this will not be the case. Either way, regardless I believe I have found (maybe a clunky way, but a way) to have unique action events for the generic item objects in the game without having tons of hard coded functions attached to every object. Times up! Let's do this. I have to say I was feeling pretty down as I was going through the old code and to be honest this "test project" while teaching me a lot is starting to feel like it is now holding me back fomr moving on in my hobby. Having this big "oh yeah, I never worked out how to get past that issue" wall at the end of my "revision" was a real bummer. Now though I feel energised and regardless of if it works out as I think or not, having something to bang on with has given me a feeling of momentum   Anyway.. thanks for reading! --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

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

I'm back baby!

G'Day.... So... it has been a long time form the last time I posted anything on this blog. Hell, it has been a long time since I even had a computer TO post anything on this blog. I recently moved house, well recently as in 4 months ago and the move was only part of a bunch of huge life changes that have been happening around me. It took until about 2 weeks ago to even get around to setting up my computer and the office! I mean, damn, I only got my bed sorted about a month ago! (Been sleeping in the recliner!) To tell the truth it was kind of liberating in some ways to not have a workstation and really unplug form the internet and computers in general. It has been pretty much the first time in my life I ever have, but all that is over now, as I have my workstation and office all set up and ready to go! So... "I'm back" and planning to get stuck into this project again. It may be a little slow to reboot as I'm a beginner to programming and it remains to be seen how much of the code I can still read. I am not exactly the best at using comments. I'm just a little unsure about how much coding methodology I have retained over what is basically a near 6 month break from computers. Worst comes to worst I will rebuild the project from scratch but I hope to be able to jump right in. Lucky I have a detailed blog to go through and be reminded on my ideas and evolving thoughts on the project itself! Anyway... that is about it for now.. hope for a proper update soon!

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

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

Just keep Swimming

G'Day.... So I have been working pretty steadily on the command phraser and discovered that it is an exponential problem. I get that "natural language processing" is a gigantic topic, so I shouldn't be surprised.. but I hoped to be able to fudge it to some degree using keywords.  The core idea was that by having the app have a very limited word count that it would understand, it would effectively make the command processor keyword based, rather than actually language processing.  Allowing me to discard large chunks of the input, distilling it down to very basic commands. So "Walk through the archway to the next room" would turn into "walk, north". The hope was that the player would "infer" that the app had a deeper understanding of what they were typing. Now, for the most part, it is working, yet there are some difficult issues that I have yet to resolve. These mainly revolve around words that have different meanings depending on how you use them. So "exit" can mean "leave the room via the exit" and it can also mean "the doorway is an exit". This is the current state of the project. (Download to Try it out) I have filled in the test level with junk areas. Each area has 2 items in it. A ball and a box. The very first area (the one you start in) has a load of text, so I can see a real example of how the prints function. Say when looking at something. The actual start room exit descriptions say they can not be used (as the game start room is not able to be left until you solve a puzzle) but for testing, you can just move from that start area. Only look and move actions have been implemented. Compound commands are yet to be done.. so "look" works "look ball" works but "look ball and look box" does not work.   Now this is all still a bit rough... but it looks like my original idea of how to actually process the keywords is not going to cut it.. it needs a ton of special case intervention to get it all working at the level I hope to run it. Still, it is working... you can walk about, look at things. I think that when I add more words to the lists, so there are more keywords, it will function close to how I wanted, but the act of adding more words increases the special conditions. What I need to do is strip the command phrase back and run it through some code that can quantify what the structure of the phrase is.  I am pretty sure that I can use simple English language rules for this. If I can identify what the parts of the phrase being entered are, then I can use that to direct the program to the correct command even when there is more than one meaning for a given keyword. As the structure of the sentence should inform me which key that keyword is supposed to be.  The querstion I have now is should I fix this.. or just keep going on as I have been. The demo project is small enough that I can get it functioning with the code I have, and then I could move to another moreexciting project.. or I could get this working perfectly and then move on. This text adventurer is a learnign thing.. so it might be time to start thinking of wrapping it up and moving to the next task?   Thanks for Reading! -A4L  

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

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

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

Ready for Action

G'Day.... So I have gone through all my code and got back up to scratch on everything. I am now confident in my methodologies and logic paths I was thinking of for the game loop. If this experience has taught me anything it is that I HAVE TO START USING COMMENTS MORE. There was a lot of tweaking as I went through as well. Turns out a lot of functions really could have been culled. Process_AllCommands and ProcessCommands for example (and the other Process Functions) could all be condensed into a single function by using internal variables being filled by function arguments. I feel that the code is more readable now that it ever has been by removing a lot of these nearly identical functions. State of the Project I now have gotten the game to go through most of the functions needed. I still have not worked on the rudimentary commandProcessor that I wrote just to get some testing done 6 months ago before my break.  This is the next phase of the project. I seem to have everything "in" now.. so now I just need to manipulate it and I think we are good to go! These are compleated! Text Utilities : to manipulate text and print it to screen in a number of ways. Like adding margins, a "typing" effect that prints a letter at a time, a "skip" function that will complete a given paragraph instead of waiting for it to type. This also handles all the stemming, and input collection and cleaning stuff for input strings from the user. DataFile Phraser :  that can load data from text files and use it to populate classes like Areas, Items, CommandLists, ObjectLists and more.  It can also process lists, where each item corresponds to a file name. This allows me to process a file like "ActionConstants" to batch load perma action commands in a single code block. For example, things like move, get, look and stuff are always active. This also allows me to load lists of items and actions and commands and stuff that is unique to the area as defined in the Area data file. There are other datafile applications fo the list functions as well. In short, it just allows me to dynamically control the loaded data by editing a list file rather than changing the code. So I can add or remove words, items or w/e from the game without the code. These data files "should" be able to be edited externally of all coding to populate the game world. GameWorld Class Chain : has been completed, assuming everything works. The "GameWorld", holds a grid of "Areas", which in turn contains "Items" and "Exits". These all contain word lists for "Actions" and "Objects". So, for example, if "ball" is an item in the area, this ball adds the object word list for "ball" and all its synonyms as well as valid player actions like "kick". The idea is that an "active action and object" list is created at the time an area is initialised by the player entering.  So the input phraser has a massively condensed list of "active words" to look out for instead of understanding the entire breadth of the English language. It is my hope that this will give the illusion of the app understanding English a lot better than it does but narrowly focusing what it is required to understand. Each of these classes all holds a variety of information. For example, the "Item" and "Area" holds all the text to be printed by commands like "get" and "look" and the GameWorld holds global switches like understanding if a player has already entered a location before. Player Class : has been completed for a while now. It mainly holds location data to move the player through the map and retrieve its location, set global area values and stuff like that, score, move counter etc etc. If all is working to plan.. only the variables in this class need to be saved to disk to facilitate "save" and "restore" What to do now? So with all that done, I am really getting close to getting up and running the full demo project. That consists of a small network of interconnected room, a narrative and a few puzzles. To get this into a playable demo I still need 3 major additions to be completed. One of them is 1/2 done already. Build the "Action" Class : I have (with help of some forum members) worked out a method I think will allow me to build the specific events needed to run an actual game. The class has basically 3 functions. Taking single commands like "look" that consists of only 1 word, taking multi-word single commands like "get the lamp on the desk" and taking multiple commands in a single line, like "take the lamp from the desk and throw it at the hideous beast". So the actual input system is done.. all that is left is the processing of those inputs to do things with the collected and cleaned data. Build the "inventory" : as no inventory means no Advent! This is going to basically be a specialised "area" that stores items and it carried around by the PlayerClass so it and all its wordlists are active anywhere the player is. It will also have its own unique print to display the items. I would like to use this same idea for an ingame map as well, which I consider as part of the inventory. Full in all the Data : as the game is currently just using place holder data to make debugging fast and easy. This means writing out and putting into the datafiles all the text descriptions, cinematic descriptions, and action response descriptions and of course all the word lists. This is a ton of work and will be the last thing I do. The app should be fully working before I start on this part of the project. Basically all the rest is building the "engine" and this is building the game itself.   Anyway.. thanks for reading! --A4L

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

Falling into place!!

G'Day.... Just a quick note today. There is not much new information to go through..I'm basically just implementing the things I spoke of in the last few posts.  At this time I have a small grid of areas loaded into the game and a number of items. This is a simple flowchart I use when playing adventure games to make maps. (Check out a map I made for Mage's Initiation recently) In addition to having the gameworld mapped and the "game" of what the player will be doing completed I have also finished the command phraser. At this time it only understands single work commands or "global" commands... things like "look", "north", "south", "east", "west". So all you can do at this stage is walk about and look at the area.. but the framework is there to do pretty much the entire project now. All I need to do is expand the command processor a little bit so it can recognise "look ball" for example. This should be the last big step before just having to enter all the actual game data into the data files. You can download the demo here: https://tinyurl.com/y242wx4t (PC) Well, that is that. Like I said not much to show here.. I just wanted to show that there is progress being made. It is pretty exciting right now. For the record, I didn't look up any methods or system to build my command phraser, beyond some actual text manipulation concepts like stemming. The way the app "understands" things and how the synonym lists work and all that is an idea I came up with myself months ago. All this time I have been working on trying to make that idea functional and been very worried that it probably will not work at all! It is gratifying that it spears to be functioning exactly as I expected it to. Thanks for Reading -AFL

A4L

A4L

Going in Circles.....

G'Day.... Quick progress report.. or lack thereof. I have not been putting the time into this recently due to extended family visiting and doing the host / tourist guide thing... but  I started working again today. All I need to do is add the dynamic word list building and the engine is basically ready for final command processing. The problem is I seem to be going in circles. You see the entire leevlinitilises through the reading of data files but the ACTIVE COMMANDS and TARGETS need to be dynamically initialised latter in the program flow as they need to dynamically build every time the player moves to a given area. The problem is that I have been trying to shoehorn in this dynamic code into what is essentially a bunch of code the creates constants for the entire life of the program.  I am half way through but I have this feeling that I am just creating an ever-expanding knot of ropes crossing every which way. There is just to much referencing other classes and going back and forth with data. The entire thing feels like a mess and it is confusing to me and I wrote it. I really think what I need to do is split the Area Initialisation and Area Activation into separate classes and then split all the word list stuff into separate classes. I originally thought the more I kept it together the better, it seemed a waste to have a class for what is essentially a single function, but during run time I am finding things are initialising more than once, as the constructor for the "large" file is going every time it loads a part of the data it is looking at .. stuff like that. This is super annoying as rebuilding the entire area phrase is basically rebuilding how the engine constructs the game world and is a significant re-write. I tried to get around this by removing class constructors and building sub set initialisation functions.. like CommandList.Init_Nouns();  So only parts of the class initialiser certain points in the program but this is where the spaghetti-figation started to really get bad. I can't see any alternative than rebuilding how my gameworld initialises. It shouldn't take to long as most of the grunt work with the actual data reading code and processing should be directly transferable.. it is more about when in the codes line it all occurs.  Thanks for Reading -A4L

A4L

A4L

Detor into MAGE KNIGHT and other Distractions!

G'Day.... So, I have gotten a lot sidetracked recently!! A number of things have been competing for my time! For starters when I started to learn to programme, I found the time by scaling back my model painting.  By model painting, I mean miniature painting. You know, little sci-fi armies and stuff. Yes, I am a geek! So what? What to fight about it?! I recently bought some fancy new paint. These are a cool new minimal paint line that focuses on colour mixing and produces a great mat finish. I have been spening a lot of time playing with them more than working on my project! What is so great about these paints is that instead of trying to sell you a shade designed for a single purpose from a paint line with 200 pots in it, this line is tiny. In fact, the entire line is in this image above. What they have done is work hard to make pure liquid pigments (so no grain) with a hyper mat finish that is designed specifically for you to mix your own colours on a pallet. So trying to bring traditional painting and colour theory to game art.  So yeah.. been painting a ton of stuff instead of sitting at my computer! Also, I decided to update, read "rebuild" one of my old mods for TableTop Simulator. For those of you that do not know, TTS is a "virtual tabletop" that runs in Unity. Basically, "game" made in unity that is designed specifically to be modded. All it really does is run a physics engine and provide a number of tools to allow you to assign bitmaps to things and move them around. It uses a lot of stuff to make it work, but the idea is that it creates a virtual environment to play boardgames online with your friends and provides tools to allow you to scan your board games into images and use them inside the engine. There is a lot of talk in the boardgame community on the legality of virtual tabletop apps (there are a huge number of them) but in general most boardgame companies do not seem to mind them, and even actively encourage them, sometimes even making their own. Only big companies that are building their own apps are asking for people to remove their mods. Anyway, my very first stumbling into programming was learning basic LUA, which is the scripting engine TTS uses to build my mods. I have been out of the TTS scene for a while as I wanted to learn more advanced programming and started to feel like I was putting so much effort into modding (I host a number of top mods in the community) that I was missing an opportunity to build my OWN projects, rather than just copying other persons.  Even so, I decided that I would do an update to one of my very first mods..MAGE KNIGHT. For those that do not know this is one of the truly great games of the "co-op era". It is one of the early ones, and is not a full cop-op, it, in fact, has a competitive and solo ruleset.. but it is still one of the truly great boardgames of recent times. It is to complex to go into but it is a hybrid adventure game and deck builder basically. Anyway It was my first ever TTS mod, and back then I didn't even code anything. I got help from another person. So this is a update with my new skills in programming to produce a more complex mod that is easier to play but still retains the feeling of playing a virtual tabletop.  Here is an overview of the mod.... Mage Knight (Tragically Scripted) - [2nd Edition] @SteamWorkshop If you are curious about Mage Knight, I have started a new playthrough on my chan as well if you would like to see it in action! Mage Knight (Scenario: Dungeon Lords) - 4 Handed Solo Lets Play @uTube)   Have Fun! -A4L  

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!