Advertisement Jump to content
  • Advertisement

A4L

Member
  • Content Count

    53
  • Joined

  • Last visited

  • Days Won

    2

A4L last won the day on January 15

A4L had the most liked content!

Community Reputation

36 Neutral

About A4L

  • Rank
    Member

Personal Information

Social

  • Twitter
    NA
  • Github
    NA
  • Twitch
    NA
  • Steam
    NA

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Maybe talking about the specifics of my program was confusing the question... I may edit the OP. What I am asking is how do you insert unique code into a gameloop that uses generic classes... like at what point do you start using unique classes and how do these get incorporated. I'm just having a hard time working out a way to put unique checks and events into scenes.
  2. G'Day.... I have been working on a text adventure game. You can follow my progress on my Blog (link in signature at bottom of post) Anyway, I have been chugging through the, frankly, tedious work of building my word lists and stuff as well as competing the 1st step in the phraser.. which is single command recognition and execution. The problem I am running into is how do I go about implementing area specific code and conditions, in my very generic and general purpose classes. Class Structure As it is Now (Obviously I have striped this list to make my problem clearer) Level Class - Contains a variable List<Area> Level [][]. This is a 2 dimensional array creating a X/Y reference values for any given spot on the array. Player Class - Contains a variable PosX and PosY... these are modified by movement and on .getPosition() returns the value of List<Area>[][]. This is how I am acessing the correct place in my game world based on the player position. Area Class - This contains a given area. These are placed inside the List<Area>[][]. Item Class - This contains individual items sitting in the level to be interacted with. So a Level -> Area -> Items. The Problem The problem I have having is I can not work out how to go about having unique things inside these Areas and Items. Like for example a Ball can not be opened but a box can. So they need a different variable. I can not use the same class for both Box and Sphere. An area might have nothing in it, but it also may have a table that needs a ball put on it and then something is activated. What I am getting at here is that the structure is basically working using these generic classes but I am not sure how I can code exciting and interesting unique things in these areas or on these items with out fundamentally changing things, or adding a mass of variables to the cases that are only used in some cases. Say I have a Box in the scene. I want the players to see it, and then try to pick it up.. but they can't. So the examine it more closely and find that it is actually got a button on it. The press it and something happens. The questions is where are the methods to do these unique things and edit the item parameters going to be put. If I put them in the Item or Area sections I need to basically have a unique class for everyone .. maybe that is what I am supposed to do. Thing is I wrote a really handy data txt file importer for areas and files that I do not want to scrap. That only really works on these generic ideas. To get really interesting events and natural language responses there needs to be a ton of unique things going on ... but I have kinda designed everything to be very generic. Possible Solution I know that a List<type> can contain classes as long as all the classes in the list are inherited form the same base class. So I was thinking of a new class that populates a simular kind of list to Level<area>[][]. This will be something like List<gameLogic>[][]. In here I put a all the methods for the individual areas. The Key values like the other list is pulled form the player positions. So if I need a unique method I could call it from Player.GetPostions().gameLogic.SetOpen();... this then would trigger bools and change description text and stuff in the more generic objects. The problem with this is I still need a series of generic method calls. So far example area.item[9] might be a Hat... if I type GETHAT it trigges a generic get() method on the hat, that ALL items have.. but it then actually dose a unique bit of logic in the logic class for that specific room.. so item.get(prams) triggers gameLogic.get(prams).. and those prams allow me to do specific "gets" per-object.. Is that making any sense? So yeah.. I'm kinda stuck Yeah.. so I am kinda stuck here about what to do. The crux of my issue is that I have a game loop and a series of objects.. level, areas in the level and items in the area. These are all generic so the I can be easily build the level during initiation of the game with out tons of unique code making editing and changes hard. So the exact way to continue these simple loops, but access unique code is confusing me. I mean as long as everything was very simple I could get wawya with it. but as I wanted to add more complex stuff I was finding the need for additional variables and checks. Any thoughts? (sorry if I am not clear) Quick demo of you... this shows the start screen and the first room. (pressing spacebar skips the text printout to finished) So the very first time the game loops and finds you in a area it tests a variable in that area to see if you have ever been there before.. if not it prints a "cinematic".. witch is a long story focused text description, that you only see once. (it is also added to a log for reading latter). Then if you type the look command... it finds the area look description and adds it to the print buffer, then finds all the items (there are only two at the moment) and appends their descriptions and then prints out that look. All pretty cool and I ma happy with it. This is just to show something in the thread.. I seem to have noticed anything with a youtube video in it gets way more comments hahaah
  3. A4L

    OOP is dead, long live OOP

    Just a comment / question from a noob that all of this is over my head.. but in the article you talk a lot about "in the wild" and trends "everyone does" and all that. I just wanted to ask... If something has a correct way of being done and it works well... but no one ever dose it correctly... dose it matter if it works well considering only a tiny fraction of people do it correctly to experience its befits anyway? Like Relativity is more "correct" than the Newtonian descriptions of gravity, but the Newtonian one is easier to calculate and still produces very good results (to a point)... so is it wrong that we use Newtonian equations ... or should we all try and use the Einstein ones that only a tiny fraction of people truly understand properly and are more complex so people make more errors .(this is just a metaphor , it may not work under strict scrutiny, but I think it shows my question)
  4. the jump thing isn't so much an issue as a personal reaction. If people have fun it becomes part of the challenge. I mean if people can 100% Neon Drive on the hardest mode... people can 100% anything... they just have to like it.
  5. A4L

    "Every single pixel is simulated"

    pity it is a "rouge-like" : (
  6. I enjoyed this demo.... I found it a little hard though, mainly due to the camera. It took me a while to work out I could rotate it. I enjoyed it more on controller, but felt that maybe it would be best if there was some kind of auto camera follow rather than the manual camera. Platforming in my experience is about timing and jumping and speed, the addition of the camera detracts from the actual fundamental aspects that make a platformer a platformer. I also though that the "long jump" was a little counter intuitive. I like the idea of the long jump, but this leads to "trial and error" gameplay loop becoming the main way to progress as you can not "react" to the environment. You need to decide to jump high, before you jump basically. By the time you can see you are to low it is to late.. so you need to restart and jump higher form memory of the level. My personal enjoyment of this game would be greatly improved if you could double jump... so I could react to being to low by jumping again to get more height. Even so I liked it this demo. Cool stuff.
  7. Are the "Project" pages at GameDev "How to use GameDev's "https://www.gamedev.net/projects/" suposed to be used for finished projects.. or projects in progress? Looking at the listed projects they seem to be at least at a version 1 or beat phase... or something I am just not sure exactly how these things are supposed to be used. They are only a single page as far as I can tell and do not appear to have versions of histories or a place to discuss the project... Is it basically just a link list of completed things? Thanks!
  8. I do not know how to use structs and stuff. I have only been programming for 2 weeks or something before I started and had only done about 2/3rds of a book called "The C# Players Guide". So, I have not used Interfaces, Structs and Inheritance at all in this project yet. Once I finish this project I want to find a new book to work though.
  9. Sorry.. I wish I could take some kind of credit. I just uploaded a video without sound and then used uTubes royalty free music to overlay onto it. I just sorta randomly listened to a few things and picked one I liked the sound of. I do not know anything about the music apart form the fact it sounds cool. thanks! Now that the outline is fully function I should be able to have nice short video demos and stuff to show it coming together in the coming days.
  10. 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
  11. A4L

    Dev Log #4

    I've been reading all your entries. I just do not comment really as I have no questions or anything to add. I"m just a beginner at all this. I do enjoy seeing a more experienced person going through things. I know that blogging motivation is directly proportional to how connected you feel to people reading (at least for me) ... so I thought I would drop in and say hi!
  12. A4L

    Bug Fixes 1

    don't really have anything constructive to say.. but wanted to tell you that I enjoyed reading this post.
  13. https://github.com/AlexPoint/OpenNlp/blob/master/LICENSE https://opennlp.apache.org/faq.html
  14. So as I understand it the MiT license is basically the "free" one.. were you can just do whatever you want with it .... but the GPL has various caveats like releasing the source code for example... I found this C# GitHub of a implementation of OpenNLP but the githib is saying it is a MIT license but OpenNLP is Apache license? So how dose that work license wise?
  15. 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!
  • 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!