What is a Word worth?

posted in A4L
Published June 19, 2019
Advertisement

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

 
Previous Entry Going in Circles.....
Next Entry Just keep Swimming
0 likes 4 comments

Comments

GildedOctopusStudios

It may not seem like it now but the theory is honestly a lot easier to understand and implement once you have some programming experience. This project you're working on will teach you things about programming that you don't even realize. When you get to the point where you have some time to work on learning the theory and the next set of skills you will understand it so much better. One resource I like to check my progress with every so often is the programmer competency matrix https://sijinjoseph.com/programmer-competency-matrix/. It gives you a great road map for what other things you can focus on learning and what things you are starting to have a handle on. 

June 19, 2019 03:31 PM
A4L
9 hours ago, GildedOctopusStudios said:

It may not seem like it now but the theory is honestly a lot easier to understand and implement once you have some programming experience. This project you're working on will teach you things about programming that you don't even realize. When you get to the point where you have some time to work on learning the theory and the next set of skills you will understand it so much better.

This is kinda exactly what I wanted to hear and if you read my very early posts was kinda my thinking when I started this project.

9 hours ago, GildedOctopusStudios said:

One resource I like to check my progress with every so often is the programmer competency matrix https://sijinjoseph.com/programmer-competency-matrix/. It gives you a great road map for what other things you can focus on learning and what things you are starting to have a handle on. 

Very interesting. Thank you for that link. I will check it out!

EDIT - I appear to be mainly level 0 and level 1. Though I am not even attempting some of those categories, or at least do not think I will be. Maybe that entire list needs to be learnt.

June 20, 2019 01:19 AM
JB3DG

The best way to become fluent in any language (programming languages are no exception) is to use it.

June 20, 2019 10:50 AM
GildedOctopusStudios
14 hours ago, A4L said:

This is kinda exactly what I wanted to hear and if you read my very early posts was kinda my thinking when I started this project.

Very interesting. Thank you for that link. I will check it out!

EDIT - I appear to be mainly level 0 and level 1. Though I am not even attempting some of those categories, or at least do not think I will be. Maybe that entire list needs to be learnt.

It's geared towards professional programmers and it is very comprehensive so if that is your goal the more things on that list you can learn the better but I don't think that's your goal. I think your goal is to become good enough to make games in which case take the categories that you think you need for the type of game you are making. For the record I'm mostly at 2-3 but there are some that I'm at 0-1 and I've worked as a professional programmer before on some mega expensive projects. I even had a coding internship at a fortune 500 company. So don't feel bad that you're just starting out.

June 20, 2019 03:59 PM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Profile
Author
Advertisement
Advertisement