PorkScript on GitHub

Hello everyone,

Recently I’ve decided that I alone will not be able to make PorkScript what I dream it to be. I have decided to open source PorkScript on GitHub, so that the project may accelerate, and also grow in potential. On GitHub, PorkScript will be able to soar to heights I can not supply at the moment (such as a 3D engine and other extensions). So now, if enough contribute, this project shall finish quicker, and come out on all platforms faster.

— Andy Brennan

Another Update n’ Stuff

Hello everyone, here’s another “little more than half-a-year” update. For those of you who are still following this project, thank you! I appreciate your eagerness to see a new version of Pork. Also, I’m taking Bitcoin donations at 1LzNjrkkrZ7PjsqanT79Xqx6wJq2AjCxKF now. Feel free to drop some BTC cents in! I appreciate every single micro-BTC. 🙂

Now then, the state of the Engine:

Since the last update I’ve made a good deal of progress. That is, a good deal considering the other projects I must undertake aside from this one as well as school. In order to make  the custom command scripting side as flexible, powerful, and reliable as possible, the custom commands will be made with Python. My PMF definition script language will stay as-is, since it works well for its purpose. But, Python is already a wonderful, fast, powerful, and extensible scripting language, so I will use it instead of the custom command script language I had in mind because it would be no where as good as Python already is. Not to mention that by supporting Python it can also support any pure-python libraries, which opens up all kinds of interesting things that could be done in a custom command. Trust me, Python shall do much better for this operation.

To elaborate on how PorkScript works, the definition script (PMF) defines all items, maps, and map states that will be in one game. All the properties for every item, map, and map state is set within PMF, and custom properties may be created on the Python side along with custom commands for extension. The custom command script (previously called PPF) defines all custom commands and custom properties used in a game. These Python scripts are modular, so you can easily add a new custom command with properties to your own game simply by obtaining their script! And do not worry, Python is an easy language to use, and I’ve made it as easy as I can to write custom command scripts with custom properties. Still not sure? That’s okay! PMF is still very easy to write, and you can instead rely on other people’s Python modules for custom commands and properties.

I hope that whetted somebody’s appetite for a new version. 😛 Also, some more good news (hopefully): I am planning on getting an entire period of my school day devoted to working on PorkV2 and PorkScript. I am sure that I will be able to score this deal, but if I cannot I shall notify all of you. But, with this deal, I would most certainly be able to finish Pork by the end of the school year, if not much sooner!

Thanks for reading this, and thanks for continually checking up on this site! I can’t promise more frequent updates, but if progress goes faster during school, I may increase the update frequency. Until next time, seeya!

— Andy Brennan

Happy New Year!

Happy New Year! I hope everyone has had a good holiday season! Steadily I’ve been making progress on the new version of Pork and PorkScript. After much planning and work, I am almost 2/3 done with the entire project. Much work is still to be made on the PorkScript parser (parsers/lexers for high-level languages are complex!), but eventually I shall have it finished along with version 2 of Pork (a complete re-write of the game).

The new version of PorkScript is far more powerful than the old, archaic PorkScript used for the current version. It resembles a true high-level language, and has syntax comparable to that of Python and BASIC. With the new version, users will be able to create text-based adventure games with custom commands, custom properties, states for maps, and so much more! All the glaring issues in the current version of Pork are theoretically fixed with the new version.

Creating the parser for such a language has been a challenge (given that I have no experience with these types of programs, and have had no direction in how to build the parser). I also apologize for the lack of posts over the months, but I have been busy with school and the new version of Pork. I do give my thanks to all those who have downloaded this game! I’ve also seen the game talked about in some forums and people seem to genuinely enjoy it! I thank all of you for your interest in this project and I hope that the new version of Pork will knock your socks off!

Also, according to the report WordPress gave me, the UK has viewed our site more than any other country. So thank you, United Kingdom, you’re awesome! (And I’ve been to London and I have to say, the weather there is lovely! It’s my favorite city, right next to the Czech Republic’s Prague!)

— Andy Brennan

From the Programmer’s Den — Pt. 2

Hello again everyone! I think it’s time for another installment of  “From the Programmer’s Den.” Remember that as you’re playing Pork please send all your thoughts, suggestions, constructive criticisms, and bugs to porkadventures@gmail.com! Pork may be crude as hell now, but with time and work it can become far better! Now on to the story…

PART TWO — The Game Engine

Before I could begin building the code that ran the engine, I had to set up some classes to represent significant things in the game (e.g. maps, items). I started with maps and decided to give each one possible directions that could be traveled to from the map and of course its name and description. At first I wanted to create a flag system that would tell the program what directions could and couldn’t be traveled in, but I soon figured out that it would not work. With little pieces being put in at a time to test the classes themselves I finally pieced together how I wanted the Pork Definition Format (.pmf files) structured. It was here that I devised the most integral part of Pork, the ID’s given to maps and items. With these IDs I could much more easily manipulate specific items and maps with a single function for each. I also solved my directionals problem with my maps: each direction would have a number and that number would specify the map ID that was in that direction, and 0 meaning that direction could not be traveled.

The engine was more or less pretty easy to design (although the file-parsing bits are arduous sometimes). I was putting in more and more commands that could be used to interact with the game and it was coming along nicely. There is not much to really talk about with the game engine aside from a few caveats that consistently annoy me (which I will now detail).

One of the most annoying aspects of my game engine is textual input. Currently, Pork uses the std::cin buffer to take all text. With std::cin extraction (std::cin >> blah;), spaces separate parts of the command with no exceptions. std::cin extraction is by far the easiest to manage; however, it causes glaring issues with things like multi-word item names (red rock, gray stone, dead elvis, rotten potato). Users must currently put in item names as such: DeadElvis, RedRock. To me, this is absolutely unacceptable and annoying. I would prefer that the game not have to rely on std::cin extraction like this and I’m trying to come up with alternatives.

The second thing that irks me about my engine is the Pork Definition Format. The PDF is extremely finicky and requires everything to be exact or there will be poor parsing results. It is also very difficult for me to add in new features. Everything must be in an exact order and it is very easy to screw things up. I have no doubt that it confuses anyone who attempts to mod the game. It is not the worst thing in the world, but it is pretty bad. What I think would be really cool is a scripting format. Some sort of code that can be in any order, doesn’t care about whitespace, easy to manage, and easy to add on to. Creating a structure for this is easy, but creating a parser is not. I would like to make it my next project in order to open up what can be done with Pork. The PDF limits Pork’s abilities and needs to be improved. For example, if I wanted to make an ‘eat’ command, I would have to create some sort of line that would be added on to the PDF (and at this point it would have to be optional, giving more work to the parser). The more commands I would want to add, the more the parser has to do, the more convoluted my C++ code gets, the more convoluted the PDF gets, and it all spirals down from there. Currently, I’m thinking of a new parser and scripting format that would work far better. If we want Pork to become infinitely versatile, the PDF MUST GO.

Well, I know that kind of just completely spun in a different direction, but there isn’t much in Pork to detail, as it’s quite cut and dry (except for the glaring issues)! I apologize for that, by the way. 😛 But now you know my pain and how I want to fix it. And hey, it could have been worse. I had half a mind to discuss how (with examples) I wanted my new scripting format to work! So, until next time (if there’s going to be one 😛 ), have a good [place time of day here]!

From the Programmer’s Den — Pt. 1

Hello all you peoples on the interwebz. “From the Programmer’s Den” is going to be a string of posts by me (Andy Brennan) in which I will detail the work done in Pork and other related things. Remember that as you’re playing Pork please send all your thoughts, suggestions, constructive criticisms, and bugs to porkadventures@gmail.com! Pork may be crude as hell now, but with time and work it can become far better! Now let us begin…

PART ONE — Ideas

I have to thank the creation of Pork to my being bored one day in a computer class I take at my high school. Since much of the work done in that class is easy to do (if you actually put in just a little effort), some friends and I have always been far ahead of the rest of the class. Looking for something to do, I decided to download a portable version of DevC++ (which is one trashy program, btw) onto the school computer so I could do a little C++ programming to pass the time. It took me a while to think of a minuscule, pointless program to make, but eventually I decided upon an atrocious text-based game where you enter in a number to see if you can guess a number the game chooses. It was called CannonGame and it was terrible (but gave my friends and I a good laugh at trying to guess the numbers since the guess was multiplied by 3, incremented 2, divided by 6 and whatnot before it was compared with the game’s chosen number).

Once I was nice and bored with that piece of work I thought of a project more constructive than the previous one. A text-based adventure game (built to be a parody of Zork). I spent some time developing a simple framework that was based on commands (separated by spaces since I was using the std::cin stream object to handle input). I also made it so ‘maps’ and items were classes and eventually created it where the game was defined outside the source code (in the .pmf files). At first my take on this program was nowhere near serious and I would only work on it during class. Very soon, however, the game started growing and the project looked more promising. It wasn’t until an assignment from English class, though, that I had decided to take on the project at home as well, allocating time to it rather than another project currently (and still) in the works.

The assignment I had received from my English class was something I had never dealt with before. We had to do something for our community then do a speech on what we did about a month later. Since I had Pork coming along I thought of what my project could be right away: finish a first iteration of Pork and sell it on USB flash drives and then give all money made to charity. At the time of this post, I am still selling these flash drives and the speech is this coming week (on my birthday, no less 😛 ). If it weren’t for the English assignment I probably wouldn’t have taken Pork seriously enough to continue it (although I’m not sure whether that matters or not at this point 😛 ).

So that was pretty much the whole story of Pork’s inception. Seemed a lot longer while I was typing it… Anyway, tune in next [place unit of time here] for Part 2 of “From the Programmer’s Den!”

— Andy Brennan