Jump to content
  • Advertisement

Colin Jeanne

Member
  • Content Count

    5988
  • Joined

  • Last visited

Community Reputation

1115 Excellent

About Colin Jeanne

  • Rank
    Legend
  1. Colin Jeanne

    And more

    I suspect the tagging system might run into issues with synonyms. Suppose I start posting a lot of useful comments in OpenGL threads and people start tagging me. I would imagine a lot of people might tag me things like OpenGL Master OpenGL Guru Good at OGL Expert at OGL etc. All of these mean the same things to us but not to the tagging system. If their distribution is spread enough between all of them then none would appear publicly or perhaps multiple would. Another problem is that I dont see people applying tags too frequently, especially after someone has been tagged. If a user has to go and type in a tag that's begging for them not to use the feature (how many people tag their LiveJournal posts, as an example). If the user sees the person already tagged with what they want to tag them then I expect the user's thoughts to be "oh, they're already tagged, moving on!"
  2. Colin Jeanne

    4E6 PyGame

    Thank you very much for the music site!
  3. Colin Jeanne

    4E6 PyGame

    I've decided to try to use PyGame for my entry. I have some experience with Python and PyGame looks (and I hear is) easy to use so hopefully that will help speed up my development process.
  4. Colin Jeanne

    The 4e6 Adventure! (Help)

    I havent done much personal programming in a long time. Due to a number of reasons it's probably been about six months since I wrote any code for myself but inside I've been starving for a reason to code again. Maybe 4e6 will help me out with this? Here is my idea for a 4e6 game (I'm sort of fleshing this out as I go along): The elements seem distinctly Old West. The basic storyline I'm planning on fleshing out is that you are an accountant at a financially-strapped, possibly not optimally managed, bank. One day the stagecoach carrying a large amount crystals from a client's account is overtaken by outlaws and the crystals stolen. Since the bank cannot afford a proper bounty-hunter to find and take back the client's crystals and since the loss of this client would mean the end of the bank, your boss assigns you the task of retrieving them. If you are successful then you get to keep your job! The game will mostly be centered around looking for clues as to Who stole the crystals Where the crystals are being kept Retrieving them from their locations Searching for information will require the player to travel to different towns; talk to the various inhabitants; read newspapers, wanted posters, etc. Getting to different towns and hideouts will always be by pony since this is the Old West (Pony Express anyone?) and there will probably be gratuitous use of dynamite (again, Old West Bad Guys = Dynamite + Guns!). Retrieving the crystals will involve fighting or sneaking your way to the hideout and definitely defeating some sort of outlaw boss. Here's The Catch: I cant draw for the life of me. Not at all. Nada. My graphics skills are somewhere between nonexistent and laughable. Here's how I'm planning on working around that: First, I figure I can just make the game a bit comical by using stick figures. It works for Stick Soldiers, right? I can probably draw stick figures well enough to use them in a game. I can also apply this talent to draw stick homes, stick horses, sticks of dynamite, etc. This restricts the game to be a sidescroller since I cant draw stick figures from the top down. Second, since sticks arent very colorful I need a way to mitigate that. The game is an Old West game so I figure it would be fun to make the entire thing in shades of yellow and gray - like an Old West film. Since I'm going for the film look, I might want to add some of those film artifacts (those dots and lines and such that are due to either dirt or degradation of the film itself) for fun. Finally, another issue I had with past games that ultimately was a factor in the death of the project is sound. I need some background music for the game and some free sound effects. I've looked briefly at those Free Sound websites but have been largely disappointed at their selection. I'm hoping that since Old West is a little more attested than pirates, ninjas, and robots, that I could find some basic gunfire and explosion sound effects to suit my game. I'd also like to find some free ragtime. Even if it has the background fuzz of a poor recording - that might even work with the old film style that I'm going for. How you can help me Suggestions? Ideas about libraries to use (my primary language is C++)? Can you play some ragtime on the piano and would like to send me some sound files? Help!
  5. Colin Jeanne

    This is relevant to my interests

    Quote:Original post by superpig Maybe it shouldn't be exposed everywhere, but there are definitely situations where it would be necessary. For example, I'm considering allowing users to tag each other to indicate "proficiency," where a low weight indicates a beginner and a high weight indicates an expert. Why not allow both? The system can easily weight things on its own by effectively summing the weights set by the taggers. Say each weight is a float in the range [0..1], default 1 - instead of calculating "number of times a given tag is used / total tags applied," you calculate "sum of weights given to a tag / total tags applied" instead. If you can pull off floating weights without UI noise you definitely have my thumbs up. Quote:I'd say yes, because it's kinda equivalent to Joe User having posted it in the wrong forum originally (i.e. Game Programming instead of Math and Physics). Currently, a moderator would move it; under this system it would just implicitly move itself. I am aware that it's a problem, but there are two countermeasures: one, give some extra weight to the original poster's set of tags, and two, provide a better means for tracking your own topics and topics you've participated in (a pair of saved searches at the top of the forum listing page, I imagine). Currently, is there a "Post moved to" dummy/redirect thread when a post is moved? I havent seen one in a long time but that might be because I use the Active Topics page and not the actual forums. Such a thing, I think, could not be implemented in the tag-based system. However, if you did have a "My Recent Threads/Posts" saved-search then that would mitigate that, as you said,
  6. Colin Jeanne

    This is relevant to my interests

    All around, I really like the idea. It's also one of the reasons I really like Windows Vista. Some issues though: 1) To get people to use it the interface has to be not just simple but fast. Suggested tags, in my opinion, are needed to the point that the system shouldnt exist without them. When I'm done with a post, I dont want to go and tag it because then I need to think about what to tag it with. If you tell some and I can choose those and add others then I'm much more likely to tag something. This is the reason very very few of my LiveJournal posts are tagged. 2) I think tag weighting should not be done by the original author. That just adds another piece of UI noise and isnt likely to be used. Rather, weighting should be done by the system when it recognizes that a lot of people are tagging the item similarly. For example, MSDN blogs (and many others now) do weighting themselves and display the results using larger or bolder text (IE Blog as an example). I'm not saying that we should use a weighting for display but just to point out that it is possible and effective to have the system weight things on its own. 3) Let's say that Joe User makes a post and tags it 'Game Programming' but that most people actually view it as a very math-oriented post and not a game programming post and tag it 'Math'. If forums become just saved searches and there are two forums 'Game Programming' and 'Math' then Joe's post would originally show up in 'Game Programming'. As more and more people tag the post as 'Math' the relative weight between these two tags tips in favor of 'Math'. Obviously Joe's post will then show up in 'Math'. But does it stop showing up in 'Game Programming'? Saying yes would mean that during the beginning of a post's lifetime it's possible to switch around in the forums and that's just bad news. Saying no complicates saved searches since if the post is obviously no longer really about game programming, why should it be in that forum?
  7. Colin Jeanne

    Detailed explanation of GDNet's downtime

    I wanted to see footage of your driving! I do like how you finally pinned those criminals against the wall. Promit style Points++
  8. Colin Jeanne

    Some Experimentation

    Just a short bit of what I've been playing with recently. I still work on my CMS off and on and recently I've been experimenting with REST. In my old design each module had a function called GetContent() which would be passed an array of POST variables and an array of parameters coming from the URI. The problem with this design is that I needed to do all my form processing in some large and nasty function which basically left me unsatisfied with my entire system. I also ran into some chicken-vs.-egg problems when installing modules. This is my new system: I've gotten rid of the GetContent() function. Instead, during installation, modules can register handlers for specific HTTP methods on given URIs. For example, my administration module registers a handler for GET on /members/*, /modules/, PUT on /widgets/, and DELETE on /members/* (among other things). GET on /members/ will get a page listing the registered members on my site. You can be more specific and GET /members/Colin%20Jeanne/ and it will get my profile. PUT on /widgets/ will change the display order of the widgets. DELETE on /members/Colin%20Jeanne/ will delete my user account. Each URI/HTTP method pair is associated with a callback function which handles it and is passed the rest of the URI as extra parameters. For example, GET on /members/Colin%20Jeanne/ is handled by the function that handles all GETs on /members/* and "Colin Jeanne" is the parameter of the function. I like this system by there are some kinks to work out. Firstly, I like the use of PUT and DELETE but these seem difficult to use in HTML forms - PUT especially. I would like to have the content of a PUT message be an XML fragment but HTML forms dont really allow me to specify what is sent. I could easily set it up in javascript but I'd like my site to also work for users with javascript turned off. Hmmm... I'll definitely need to experiment more during winter break.
  9. Colin Jeanne

    4E5

    I'm going to try to create at least one game for 4E5. I think last year my project was too large artistically for my abilities and so this year I've greatly scaled back my plans for how much artwork is necessary. Hopefully this will allow me to focus on the part that I can actually do. I have two plans and have been thinking a lot about the gameplay. One of them is a war game and the other is a game where you build up a touring company. I'll try to post about my progress although if this journal disappears for another six months dont be disappointed [grin]
  10. Colin Jeanne

    Happy Yesterday!

    I almost completely forgot that yesterday was April Fools! The only reason I remembered was when I saw the Flipcode-style forums. In light of the celebration here is a very clever April Fools prank In other news, yesterday I bought a Dell E1505 with and upgraded it to have a DVD-burner. It has more gigahertz and more RAM than the sum of all the computers I have ever owned. Yay in 3 to 5 business days!
  11. Colin Jeanne

    Another Game

    I'm trying to work out the concept behind a small puzzle game. The general idea that I want to work with is this: It's a 2D game in which the user is presented with a row of bamboo shoots of varying height. There is a panda on the bottom which can eat the shoots, one section at a time. When a section of the shoot has been eaten the shoot is reduced in height. The thing I cant work out is where the puzzle part comes in [smile]. I know you'd have to eat the bamboo in such a way that it is configured to solve the puzzle but I'm not exactly sure what that means. Maybe I should just go for something simpler, like that skydiving game I thought of oh so long ago and never wrote.
  12. Colin Jeanne

    Merry Christmas!

    As a gift from me to you I updated a game that I originally wrote a couple of years ago. I present Herman and the Falling Rocks - now with physics!
  13. Colin Jeanne

    Hello There

    I've taken quite a break from my journal and programming in general [sad]. I'm going to try to get back into the game by working on my CMS some more (I've made quite a few changes since the last time you saw it) and possibly writing a small game and submitting it as a showcase entry. Maybe some other stuff, too.
  14. Colin Jeanne

    Creating A BBCode System

    I havent been coding too much lately. School just burns every desire I have to work on my own projects unfortunately. This piece of code is actually one of the last things I worked on, finishing it last month. Creating a BBCode System In PHP Earlier posts were about the creation of a CMS and blogging system using PHP. One of the original goals of the CMS was to output well-formed XHTML and one of the requirements for the blog was to allow user comments. Unfortunately these two ideals can come into opposition: on the one hand I want to give my visitors a way of expressing themselves in their posts by creating links, defining emphasis, etc. but on the other I need to make sure that the code that they input does not break my page's well-formedness. To rectify this problem I've decided to disable XHTML input entirely and have instead replaced it with a BBCode-like system which I have called Blog Code. Blog Code Syntax For the sake of familiarity I've decided that Blog Code syntax would be similar to HTML syntax. However, instead of delimiting tags with < and > I will use [ and ] to match other BBCode systems. Blog Code will comprise of different tags which all have zero or more attributes and some type of content. A sample tag to display an image might look like [img alt="This is my alt text"]http://www.example.com/img.png[/img] where 'alt' is an attribute with a value of "This is my alt text" and 'http://www.example.com/img.png' is the content of the tag. Further, because I would like to automatically encapsulate my paragraphs in XHTML's p tag I need to define which tags can exist in a paragraph. This gives me two types of tags: inline tags, which can exist in a paragraph, and block tags, which can not exist in a paragraph. Implementation In order to help me manage the different types of tags that exist I've created a class, BlogCode, which will allow me to register new tags, find paragraphs, and apply all or a subset of the registered tags. Tag Registration When a tag is registered I simply save the name of the tag and a callback function which will handle the tag to an array within the BlogCode class. class BlogCode { var $taginfo = array(); // Registers a tag name with a callback to handle this tag function RegisterCode($tagname, $callback, $display = 'inline') { // The tag name must be just alphanumeric if (preg_match('/^\w+$/', $tagname) == false) return false; $this->taginfo[$tagname] = array($callback, $display); } } I've restricted my tag names to be only composed of alphanumerics and before a tag can be registered its name must be validated to ensure no wacky tags make it through. Tag Application To actually apply the tags we must be able to search for them. I've come up with this regex to hunt down any tag /\[(\w+)( [^\]]*)?\](.*)\[\/\\1\]/sU This describes a tag which begins with a '[' and immediately after has one or more alphanumeric characters (the tag's name). Optionally afterward there may be a space followed by anything other than a ']' (the tag's attributes). Next there will be a ']' followed by anything and then finally ending in '[\' followed by the tag's name and ']'. The search is not greedy so it will end a tag at the first instance of its ending tag rather than the last instance of its ending tag. That is this [em]Test test test[/em] bla bla bla test test test[/em] Should be rendered as Test test test bla bla bla test test test[/em] and not as Test test test[/em] bla bla bla test test test In order to make a regex which will find only select tags we simply need to restrict the name of the tags. To do this I replace (\w+) with (tagname 1|tagname 2|...|). Handling The Attributes Notice from the above that we dont really care what is in the attributes section of each tag. However, it would be nice if we could take these attributes and convert them into a name/value pairing for easy handling. To do this we'll define a new syntax for the attributes. Each attribute will have a name composed of only alphanumerics. The values of the attributes must all be quoted to make parsing simpler and must not contain either '"' or ']', again to make parsing simpler. This is the regex I've come up with /(\w+)="([^"\]]+)"/ So, a valid attribute would look like name="value" Coding It In PHP This is the implementation I have for tag application and attribute parsing global $blog_code; class BlogCode { var $taginfo = array(); // Registers a tag name with a callback to handle this tag function RegisterCode($tagname, $callback, $display = 'inline') { // The tag name must be just alphanumeric if (preg_match('/^\w+$/', $tagname) == false) return false; $this->taginfo[$tagname] = array($callback, $display); } // Apply these tags on a body of text function ApplyCodes($str) { return preg_replace_callback("/\[(\w+)( [^\]]*)?\](.*)\[\/\\1\]/sU", 'BlogCodeCallback', $str); } // Applies only a select subset of the tags function ApplySelectCodes($str, $tags) { $namelist = array_shift($tags); foreach ($tags as $tag) $namelist .= "|$tag"; return preg_replace_callback("/\[($namelist)( [^\]]*)?\](.*)\[\/\\1\]/sU", 'BlogCodeCallback', $str); } // Breaks up the attribute list into an associative array where the // attribute names are the keys and the associated values are the values function ConvertToArray($attrs) { $attrarray = array(); preg_match_all('/(\w+)="([^"\]]+)"/', $attrs, $matches); $keys = $matches[1]; $vals = $matches[2]; for ($i = 0; $i < count($keys); $i++) $attrarray[$keys[$i]] = $vals[$i]; return $attrarray; } } $blog_code = new BlogCode; // Routes each match to the callback associated with it function BlogCodeCallback($matches) { global $blog_code; $tagname = $matches[1]; $attrs = $blog_code->ConvertToArray($matches[2]); $content = $matches[3]; if (isset($blog_code->taginfo[$tagname])) { $str = call_user_func($blog_code->taginfo[$tagname][0], $tagname, $attrs, $content); if ($str !== false) return $str; } return $matches[0]; } The new bits of code are the applicantion functions, the conversion of the attributes to an associative array, and the main tag callback. The application functions, ApplyCodes() and ApplySelectCodes() work exactly as I described above. They search for the tags or a subset of the tags within a string. When a tag is found preg_replace_callback() calls BlogCodeCallback which grabs the tagname, attributes, and content of the tag before sending those values to the callback associated with that tag. ConvertToArray() takes in an attribute string and searches for attribute/value pairs and turns them into an associative array. Finally, since BlogCode is the only entity that should manage the tags I've made a global, $blog_code, which will act as the one instance for this class. This was necessary as preg_replace_callback required that BlogCodeCallback be a non-member function. Finding Paragraphs By far, the most difficult part of this project was finding out where paragraphs being and end. After many different tries I came up with this: It's easy to see paragraphs being broken up by two newlines but that cannot account for block level tags. My solution was to first split the text along block level tags and then apply the simplistic view of what separates paragraphs. Finally, I paste the different sections of text back together using the block level tags that were originally between them. Add this member to BlogCode // Finds each paragraph and wraps it in tags function BlockParagraphs($str) { $blocktags = array(); foreach ($this->taginfo as $tagname => $value) { if ($value[1] != 'inline') array_push($blocktags, $tagname); } $namelist = array_shift($blocktags); foreach ($blocktags as $blocktag) $namelist .= "|$blocktag"; // Break up the text into array elements separated by block-level tags $pararray = preg_split("/\[($namelist)(?: [^\]]*)?\].*\[\/\\1\]/sU", $str); // Capture all of the block level tags (in order) preg_match_all("/\[($namelist)(?: [^\]]*)?\].*\[\/\\1\]/sU", $str, $delims); // Ignore the names of the tags $delims = $delims[0]; // Wrap each paragraph in the tags with p tags $paras = preg_replace("/(.+)(?:\n\n|\r\r|\r\n\r\n|$)/sU", "\\1 ", $pararray); // Remove empty p tags $paras = preg_replace("/\s*/U", '', $paras); $output = ''; // Interleave the block-level elements into the text foreach ($paras as $para) $output .= $para . array_shift($delims); // Put the rest of the block-level elements into the text $output .= implode('', $delims); return $output; } Using the above code it becomes necessary to call this member on a piece of text before applying any of the tags. The Final Code This is my final PHP file, with some sample tag definitions at the bottom
  15. Colin Jeanne

    Yay!

    Way back in June I applied for a web designer job at UC Berkeley. After more than a month without reply I figured that they had forgotten about me [sad] But about two weeks ago I got an email acknowledging my application and asking me for an interview! My interview was on Friday and they asked me to bring a portfolio but since I hadnt had any designer work in the past I could only show them personal websites. Oh well. I fixed up and old design to show along with my current website. I put them online and I also copied the necessary files to my trusty USB jump drive just in case. OH GOD! The scariest thing EVAR happened during my interview! It was time for me to show them my two designs and so I navigated Safari to my site and my host was having some weird problem. I couldnt get to my site to show my stuff! OHNO OHNO OHNO!! Lucky for me I thought about that just in case kind of time and copied everything I needed to that jump drive. USB drives are my savior. I found out today that I got the job [smile] Yay!
  • 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!