Walk around an empty map!

edited January 2011 in Games
So I thought I'd try my hand at making an online game, using the browser-based grid-mapped system popularised by Urban Dead. I've only been working on it since yesterday so there's not much to it at the moment, but I've managed to create a map (with tiles named using a (fairly shitty) random language generator I cooked up) and let you walk around on it by clicking buttons.

You can try it here if you want to, but be warned that this is being hosted on my home computer and will only be accessible when it's on and booted into Linux. I also don't intend to leave my port 80 open indefinitely so it'll probably become inaccessible in a few days.

Comments

  • edited August 2009
    I remember Urban Dead. I liked the map system. This looks good, except that the names are a little weird.

    Post more when you make more progress, I could always use a quick game to pass moments of free time at work.
  • edited August 2009
    Yeah, the name generator doesn't have too much to it. It basically consists of a function that'll pick random vowels and consonants weighted according to how often they appear in the English language, which is used by another function that generated random syllables (either cv, vc or cvc, with "th", "sh" and "ch" treated as consonants,) then one more function to make a word out of a random number of syllables.

    The final game will most likely not use random gibberish for its tile names, although there are a few other aspects of the game where a random name generator will come in handy. I'm still looking for a decent one that I can easily integrate into my PHP scripts.
  • edited August 2009
    UPDATE: You can now create accounts and have your character's position on the map remain consistent (rather than it being chosen randomly each session.) You can also see other users on the map, but as of yet you can't interact with them (that's a job for tomorrow.)

    Right now I've got a character standing at 49,46 and a test user at 50,44.
  • edited August 2009
    ANOTHER UPDATE: You can now talk in-game and interact in other ways.

    This'll probably be the last of my rapid-fire updates. Now that I've got the basics of the engine working I've got to properly hash out the mechanics for the actual game.
  • edited August 2009
    46, 29. Hat Fit for life, yo!
  • edited August 2009
    Just so you know, I'm going to be blocking my outgoing web port again on Friday, so if anyone else wants to try this out you should get in while you can.
  • edited August 2009
    It is looking neat. Hat Fit was a bit of a hike.
  • edited October 2009
    I've been tinkering with this a bit more and now have a new version available to the masses.

    First of all, the URL for this game has changed. It's now located at http://jwadden.homelinux.net/obgame. I've edited my opening post with the new link and the old URL will no longer work. I did this because when I was working on the game during the last test session I kept accidentally making changes to the live version instead of my own version. Hopefully this will mitigate that problem somewhat.

    As for changes in this version, the first thing you'll probably notice is the map: It's a bit more colourful now due to the fact that there are different types of tiles which are assigned different colours. They're pretty much all the same right now except for one special tile which you'll have to find.

    Also, when you use the "Talk" command the things you say can now be heard by everyone visible on the map, rather than just people on your tile. The "Talk" command will also only appear when there's someone nearby to talk to.

    There are several other changes implemented in this version as well, but I'll leave it up to you to discover what they are. Hint: The aforementioned special tile is the key to everything, and it's in a well-known location.

    EDIT: Also, this version of the game uses a new database, so you'll have to re-create your characters. The process is the same as before.
  • edited October 2009
    After a bit of walking around I got this error.

    "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'LIMIT 1' at line 1"

    I tried re-logging in and a new web browser, but its still not working for me.
  • edited October 2009
    That's odd. Somehow you managed to leave the map. I've reset your coordinates to a valid location so you should be fine now. Do you remember what you were doing when you got the error?

    EDIT: I think I found the problem. I wasn't checking to make sure that a movement destination was a valid location when I processed the input. I did when I showed the movement options, but if you hit a movement button multiple times before the page can load it can still send you over the edge of the map. Anyway, I've fixed that problem now, although I think I might have to change the way movement input is handled to prevent cheating when the "real" game is up.
  • edited October 2009
    I was at space 99,99 and received the error when tried to move to space 100,100.

    Edit: I see you have placed me on space 50,50, when I try to move I get
    "Fatal error: Call to undefined function isValidLocation() in /home/diguana/Websites/html/obgame/map.php on line 111"
    But I am able to reload the map and I am still at 50,50 and unable to move with out getting that message

    Edit2: This is no longer a problem and I can now move, when I reloaded it I was still logged in, and when I tried to move I would get that error. So I logged out and back in and it seams to be working
  • edited October 2009
    Yeah, that "isvalidlocation()" error was because you were playing the game at the same time that I was making changes. It shouldn't come up again.
  • edited October 2009
    Ok, I guess that was my bad then.

    Still able to double click jump out of the map, but I found out that I can go back a page and use the directions there to jump back into the map. So lets say I'm 1 tile north of the border, I double click the south direction, I get the off map error, but then I can go back a page and it will show my 1 north of the border tile position, from there I can click north and end up in the map on the border tile.

    Edit: I can also go back a page and click the south button again to keep going farther off them map, and I can still go back a page and go up north, it just takes more moves to get out, So basically I can walk off the map and keep going.

    Edit2: It seams this only works on the south border, but not the north, east, or west borders
  • edited October 2009
    Is that still happening? That shouldn't be possible with the current code. Can you try to go off the map again and leave your character there so that I can check a few things?

    EDIT: Regarding the "special tile", if you re-read some of the earlier posts in this thread you should get a vital hint.
  • edited October 2009
    He should be off the map now

    Edit: Not sure if you fixed the typo but I'm still able to jump off map and back into map

    Edit2: Seams you fixed it, I can no longer jump off the map on the south border
  • edited October 2009
    I think I found the problem. It was a typo. Hate those kinds of errors.

    EDIT: Gah! Fixed the wrong letter. Now it should work.
  • edited October 2009
    Seems to work fine for me. I messed around near the borders and didn't have any issues. I couldn't find anyone, so I never got to use the talk command.

    Besides that, every place seemed boring and depressing as I marvel at the vast expanse of nothingness that lies before me. I'm certain I've seen less memorable sights than these, but I can't recall what they were. Really, the only remarkable thing about each place is its unremarkability. There's not much there.
  • edited October 2009
    Special Tile for life, yo!

    Edit: Other tiles I like:
    44, 47 Ow Mecic
    88, 52 Neat Ew
  • edited October 2009
    Slight update: I changed the way movement is input and processed. You shouldn't notice any real difference in-game, but the new method is far more elegant (I was able to replace two full pages of code with a couple of lines,) more secure (players can't cheat by using fabricated POST data with the new method) and more flexible (I can now arbitrarily determine which tiles can be moved to at which times, which will be important in the final game when there might be obstacles preventing you from moving a certain way.)

    The only difference you might notice on your end is that if you click a tile twice before the page gets a chance to reload you'll still only move one space, but still let me know if you encounter any weird behaviour.

    EDIT: Also changed some of the CSS around so that inventory items are listed beside each other instead of having one on each line. This should make things a bit more convenient when you've got lots of items.
  • edited October 2009
    hehe I smacked socks :p
  • edited October 2009
    what is this i don't even
  • edited January 2011
    I had to scrap the previous version of this game due to some code design mistakes causing the thing to become too unwieldy to make any progress on. I've recently restarted development with what will hopefully prove to be a more robust framework.

    Basically, I'm separating the program into two parts. Firstly there's going to be a front-end component written in PHP that will handle the output of the map and interface. It will communicate via XML packets with another app (written in Python, since I want to learn Python) that will handle the processing of user actions and basically do all the heavy lifting for maintaining the game state.

    Splitting this off into two pieces means that once the basic game is done I'll be able to relatively easily create other front-ends (such as an AJAX-based interface or an Android app) that will be able to communicate with the same back-end. It also means that the part of the program that does the heavy lifting doesn't have to be a web app, which should make things a lot easier since it can run persistently and keep the game data in memory instead of being a bunch of stateless scripts that need to go to the database every time something happens.

    The new version of the game isn't in a state where I can really demonstrate anything yet, but I just managed to get the front end to grab the (currently static) XML from the back-end and draw a map based on it, so I'm starting to make some progress at last.

    Unfortunately, since I'm working full-time these days I don't have as many chances to work on this project as I'd like, but hopefully I'll have something playable again in the not-too-distant future.
  • edited January 2011
    Now this is all fine and good, but I think what we all really want to know is... will Hat Fit survive the overhaul?
  • edited January 2011
    Hat Fit is eternal.
  • edited January 2011
    I'll rest easy tonight.