Sign in to follow this  
  • entries
    570
  • comments
    2427
  • views
    216043

About this blog

If you throw enough alcohol at the problem, a suitable solution is sure to arise. (NSFW).

Entries in this blog

Mushu

Untitled

lol, so I started moving the output of Rhubarb's PHP scripts from HTML (eww) to XML (*scream*). XML is, by nature, a bitch to work with. And my benchmarks show that there wasn't any performance gains from converting the forums, though the XML output is like 1/3 the size of the HTML output (which is really handy).

The only real good thing was that it really helped refactor the code, since the PHP only handles the raw data processing, and all the formatting is left to the XSL scripts on the client. Let's take a look at before-and-after (at the cost of breaking the margins of my journal):

BEFORE:

/* processing section culled, since its basically the same */ ?>

"login.php">Main Page | "discuss.php">Forum Index



"post">
class="forum_reply">
"hidden" name="post" value="">
"hidden" name="spam" value="pls">
"0" cellpadding="0" cellspacing="0">
Subject:"text" name="sub" size="18" class="txt">
Name:"text" name="nam" size="18" class="txt">
Email:"text" name="lnk" size="18" class="txt">



"submit" value="Post" class="btn">



"0" width="75%">

function output_post( $reply, $post_id, $post_time, $post_sub, $post_nam, $post_lnk, $post_msg ) {
?>


}

function output_topic_head( $post_id, $post_last, $post_sub, $post_nam, $post_cnt, $post_msg ) {
if ( $post_sub == "" ) $post_sub = "(No Subject)";
?>
class="forum_topic">




}

if ( $post_id == 0 ) {
// output thread table or something
$query = "SELECT * FROM forum WHERE thread=0 ORDER BY lastpost DESC LIMIT $FRONT_PAGE_POST_VIEW";
$result = mysql_query( $query, $link )
or $error .= "MySQL query failed - couldn't fetch page content. ($query)
"
;

while ( $line = mysql_fetch_array( $result ) ) {
output_topic_head( $line['id'], $line['lastpost'], $line['subject'], $line['name'],
$line['replycount'], $line['body'] );
}

mysql_free_result( $result );

} else {

mysql_free_result( $result );

$query = "SELECT * FROM forum WHERE thread=$post_id OR id=$post_id ORDER BY id";
$result = mysql_query( $query, $link )
or $error .= "MySQL error - couldn't fetch thread contents. ($query)
"
;

while ( $line = mysql_fetch_array( $result, MYSQL_ASSOC ) ) {
output_post( $reply, $line['id'], $line['time'], $line['subject'], $line['name'],
$line['link'], $line['body'] );
}

mysql_free_result( $result );
}
?>


"0" cellspacing="0" width="100%"class="forum_post">









echo( "$post_sub " );
if( $post_lnk != "" ) {
if ( substr($post_lnk,0,7) != "http://" ) $prefix="mailto:";
echo( "by $post_nam" );
}
else echo( " by $post_nam " ); ?>
"right">if( $reply ) { ?>"discuss.php?post=">Reply
"r", $post_time ); ?>
"3">



"discuss.php?post="> by replies


"FF0000">
"0000FF">



AFTER:

$FRONT_PAGE_POST_VIEW = 25;
$MAX_POST_LENGTH = 1024;

$link = get_connection();

$post_id = (int) $_GET['post'];

echo( '' );

if ( $post_id == 0 ) {
echo( "" );

// display topic list
$query = "SELECT * FROM forum WHERE thread=0 ORDER BY lastpost DESC LIMIT $FRONT_PAGE_POST_VIEW";
$result = mysql_query( $query, $link )
or die( "Query failed: $query: " . mysql_error() );

while ( $line = mysql_fetch_array( $result, MYSQL_ASSOC ) ) {
echo( "" );
echo( "" . $line['id'] . "" );
echo( "" . $line['name'] . "" );
echo( "" . $line['subject'] . "" );
echo( "" . $line['replycount'] . "" );
echo( "" );
}

mysql_free_result( $result );

echo( "" );

}
else {
// display thread.
echo( "" );
echo( "$post_id" );

$query = "SELECT * FROM forum WHERE thread=$post_id OR id=$post_id ORDER BY id";
$result = mysql_query( $query, $link )
or die( "Query failed: $query: " . mysql_error() );

while ( $line = mysql_fetch_array( $result, MYSQL_ASSOC ) ) {
echo( "" );
echo( "" . $line['id'] . "" );
echo( "" . $line['name'] . "" );
echo( "" . $line['subject'] . "" );
echo( "" . $line['time'] . "" );
echo( " . date( "r", $line['time'] ) . "" );
if ( $line['link'] ) {
if ( substr( $line['link'],0,7 ) != "http://" ) $prefix="mailto:";
else $prefix = "";
echo( "$prefix" . $line['link'] . "" );
} // don't output this node if there isn't a link.
echo( " . $line['body'] . "]]>" );
echo( "" );
}

mysql_free_result( $result );

echo( "" );
}

echo( '
' );

mysql_close( $link );
?>


Hurr. Time to figure out the XML layout for the rest of the stuff :3
Mushu

Untitled



1) its for the forced tutorial you go through when you start the game. includes explanations of the game mechanics and stuff, basically answers all the questions I've been asked before by other people etc.

2) no it can't be accessed yet lols. I need a day or two more (lol, discovered I didn't code the script wizard yet, and I needs it) before its all done. should be nice.

3) lol that picture is gonna break my margins [sad]
Mushu

Untitled

lol editors



Before I had to manually input the link points by hand, basically by manually grabbing them in MS Paint. That was such a shitty method, so I'm going back and re-doing my content creation stuff. To make links on the maps, you just... click on the map to set the x,y position and the size. Pretty nifty. I'm also working on some of the artwork, as shown in the picture. I hope I can find an artist next semester so I don't have to worry about drawing if I continue the project.

There's also a cool wizard for setting what scripts are executed when you click on the link which pops up in a small toolbox window. That was a nightmarish day wrestling with javascript, so the toolbox could interact with the main window (like, for links which move the player to a new map, the toolbox'll show a list of maps to move to, etc context sensitive).

I need to figure out the editors for monsters, items, and encounters, and then I think I'll have an editor for everything I've implemented thus far. At that point, I'll throw in some more content and start working on quests. Hooray!
Mushu

Untitled

Whee! Pouya wanted to try setting up a subdomain on his DreamHosters account, so I ended up getting rhubarb.lepouya.com. Sweet. 1GB of storage, 100GB bandwidth with PHP5 and MySQL. Basically, everything I need to host my current project.

Now, what I really need is a name. I can't bloody come up with _ANYTHING_, so any and all suggestions are welcome. Its currently playable; the most updated version is up on rhubarb.

Anyway, I'm going up to New York tommorrow, and not coming back until Thursday. Plenty of time to play on my DS and tinker with PvP gameplay mechanics in my notebook; there's only a couple more bare-bones things I need to implement on my checklist before I can get into the naughty extra bits.

I have to say, I fucking love this wonderful mud-ball. It may be coded like shit in a shit language/script, but its fun to work on most of the time. And that's what game programming's about, right? :3

Oh, don't forget to leave a name suggestion :D
Mushu

Untitled

Whoa, explosions! I wish I knew about that when I was doing not-PHP stuff. Its a pretty sweet procedural 2D explosion texture generator which outputs files like this:



In a nutshell: fucking awesome.
Mushu

Untitled

So I implemented item usage in (and out of) battles yesterday. There's a potion in the tavern (bottom floor of the inn) sitting on the small table in the front of the room which you can use to gain about 15HP from. You can use it from the inventory menu, or with the 'use item' command in battles.

Today I wrote up the code for experience tables, gaining experience from battles, levelling up, etc. I think the hardest part was figuring out the overly complex system for stat gains. lolol complications.

Basically, when you level up you're given access to the stat allocation page. You can difer the allocation indefinitely - if you level up multiple times without allocating stats it'll recognize that and let you allocate multiple times etc etc.



You choose 3 of the 6 stats to increase; you can choose any stat any number of times, it doesn't care (though its not really advantageous to do so due to a couple ceils, but I haven't really looked into that).

Basically, you're guarenteed that 7 stat points will be allocated between the 3 categories you select. The ternary stat will always get less than or equal to the secondary, which always is less than or equal to the primary.

$statinc3 = rand( 1, 2 );
$statinc2 = rand( $statinc3, 4 - $statinc3 );
$statinc1 = 7 - $statinc2 - $statinc3;


Makes a nice distribution, I think.

Anyway, there are 3 main secondary stats: maximum HP, maximum MP and dexterity. Each of the 6 core stats is combined with multipliers then summed to get the raw secondary stat gain, which is then scaled by a somewhat random factor. Each primary stat has weights that make logical sense with the different weapon classes, so a dagger-user ends up with the most dexterity, and the magic-user gets the highest max MP. That was a nightmare working out...

Anyway, that leaves us with luck, which is... randomly gained :3

$rawluk = rand(0,1)*rand(0,1) + rand(0,1)*rand(0,1) + rand(0,1)*rand(0,1);

And so on. This presents us with a nice little screen (using the stat choices from the above screen) like this -



Whee!

I'm going to finish up the weapon/armor code tommorrow, which involves the stats and such to determine overall power/defense/evasion/accuracy and such. Basically, the transformation between the numbers and the actual gameplay mechanic. Its all starting to come together...
Mushu

Untitled

Well, I've been busy. Kind of.

Last night I flashed my router (WRT54G) with DD-RT firmware. Its much nicer, and lets me telnet into it. Sweetness. The actual flashing procedure was really smooth and easy, but when I turned the router back on the internet no longer worked. I attributed this to my DSL modem, which is a piece of shit. Letting the setup sit for an hour (to watch Daily Show and Colbert) fixed the solution :tard:

And, yesterday, I decided to write me some forums. They're almost done, just need to add in a regular expression word filtering system for posts. Things like \n need to be replaced with
, etc.

Also, wordfilters are fun.

The forums look like shit, but meh. The key point is that most of the functionality I'd want is in place. You can see them here.

Yay! Regex wordfilters are implemented:

pwn => suck
penix => penix
fuck => shoop
shit => pants
wank => WANK FURIOUSLY


I'm open for suggestions :D
Mushu

Untitled

Whee! There are now (very basic) battles! There are two types of battles: random 'on-map' battles which can occur whenever you click on the map, and 'location-specific' battles which essentially is just a place where you can fight an endless series of monsters and stuff. Hooray!

More stuff to implement:
  • Items. There's basic item support (look for the hidden potion in the tavern!), but you can't use anything yet. Need to fix this.
  • Equipment. You're basically bare-handed right now; need to implement the sharp side of the items.
  • Experience. Right now, monsters aren't giving you any experience points. Which is good, because the level-up stuff isn't implemented yet.
  • Quests/NPCs. There's basic support for this stuff right now, but not enough really. (Potion can only be gotten once, warping, etc).
  • Skills. Haven't even thought about the design for 'em yet. Kind of important though.
  • General refactor. Things like adding in email verification, triple checking for SQL injections (I'm sure there's at least one), and switching over to a persistant SQL connection.
  • Expand the flavor text. Multiple 'on-hit' texts, in addition to some other things. Basically, more 'dynamic' content.
  • Re-tool content creation stuff. Right now its pretty shitty (good thing you can't see it), and I've got some ideas to make it, well, spiffy.


Anyway, progress!

Also, I cleared the user database a couple of times since the last post. Had to insert new tables and such for things relevant to my interests, so old accounts are gone. I'll probably end up doing it a couple more times before anything is ready, and not much has changed since last time, so don't bother making a new account. Unless you want to kill a couple Wild Suiseiseki's -



Oh, and if you get your ass kicked - resting in the bed on the 2nd floor of the Inn will restore your hitpoints. lawl.
Mushu

Untitled



(continued)

I'm highly influenced by Kingdom of Loathing, to the point it can be fairly claimed I'm making a clone. Anyway, in KoL, gameplay progresses by 'adventuring' (spending turns) in locations, where you essentially encounter a series of adventures, which are generally battles and such.

Anyway, I'm making it more complex. Instead of using a strict turn-based system, I'm making the turns, basically, continuous. Walking from one map to another in KoL is free, however, in tehmorpg it takes time to walk to any one place, and it takes time to do, well, anything.

As I discussed in some thread somewhere, each player has a UNIX timestamp representing where in time they are. They can perform actions as long as this timestamp is less than the current time. There is a maximum differential between the player's time and the current time (probably something like 3-7 days, I dunno yet).

Additionally, I want to move a little bit away from the 'explicit encounter zone' concept. Well, not move away. Add to it. In addition to said zones, you can also encounter an adventure just by walking around. This allows NetHack-esque evils, like tripping down a flight of stairs, or finding some gold on the ground. Since walking around in itself costs time, the game mechanic isn't broken (by allowing bots to walk around the same fountain indefinitely, farming free gold).

And, of course, there will be maps where there won't really be a map, just 100% encounters. Because sometimes, walking around is annoying and you just... need... to kill.

lolol.
Mushu

Untitled

So I was laying out the battle system for the PHP crap (instead of studying for my probability exam which... is in an hour LOL!), and I realized that, hey, I really have no idea how my battle system is going to work. lols.

I mean, I've got part of it: each character has 8 stats:

POW MAG TAL
CON WIS CHA
LUK DEX


The first 6 are ones that you choose to spend SP on each time you level up, the bottom two are composite stats - DEX is a weighted sum of POW, TAL, and CHA, and LUK is basically random.

There are also 6 weapon types, each one has a primary stat and two secondary stats, such that for each stat there is one weapon type which has it as a primary, and two that have it for a secondary (weapon type, primary, secondary, secondary):
Sword:     POW, MAG, CHA
Firearm: CON, TAL, CHA
Spears: WIS, POW, MAG
Magic: MAG, WIS, CON
Daggers: CHA, POW, TAL
Bows: TAL, CON, WIS

These stats also determine other composite stats, ie, maximum HP/MP, etc etc.

Equipment influences actual attack/defense power, which is modified by skills and effects to generate the actual damage outputs.

Each item of equipment has a set of scales which determine how its attack/defense values are affected by stats, in addition to parameters for a scaling function for the output. Example -

(some sword)
2.3 POW 0.0 MAG
1.2 TAL 0.1 CON
0.0 WIS 0.8 CHA
0.9 DEX 0.2 LUK


The unscaled output of the sword is simply the sum of each weight with the character's respective stat points. This value is then fed through a sigmoid-like function (actually, a scaled and clipped sine wave) to determine the actual output of the weapon/armor.

What this means, is that you can equip any weapon/armor at any time, however, the actual output of the equipment depends on your stats. (ie, if a mage attempts to wield a sword, he'll probably not have enough strength to wield it effectively, but will still be able to use it).

Skills, likewise, have a similar stat manipulation that I haven't worked out yet.

I'm not sure how I should do monsters yet... like, I don't want the monsters to just be things to hack away at, I want there to be some diversity other than "THIS MONSTER DOES 10 TIMES MORE DAMAGE THAN THE LAST ONE OMG CAN YOU HANDLE THE PAAIIINNNNN?!" because that's boring.

I want to implement a system whereby you have to work out how to kill the monster in an effective way, while still allowing the un-hardcore to plink away at them.

Or something, I guess I need to think about it more. Comments/Ideas/Spam?
Mushu

Untitled

Email to one of my CS professors this morning -

Quote:
Well, I woke up this morning and sent Demetri a message asking if he was ready to take the exam. He responded back to me saying he was sitting in the airport waiting for his plane to start boarding.

...

I thought he was joking, so I checked the site again, and found out the exam was yesterday. LOL! So I ran all my current grades through my calculator, and based on the current weightings I have approximately a 0.70.

Anyway, I know this is a lot to ask, but would it be possible to take the exam (or one like it) for half credit either today or tomorrow? I'm not really concerned about my GPA, but I officially need a 'C-' mark or higher to take the courses which have 216 as a pre-req.

Sorry for being such an idiot.


:tard:

EDIT: YES EVIL STEVE IT WAS ME OKAY ;_;

EDIT2: Situation resolved! She let me take the test today for full credit =^.^=
Mushu

Untitled

Quote:
Dear Mushu,

Greetings. Since yours was the second of three reports we have now received regarding students who are spoofing their MAC address in order to use up more bandwidth, I am writing to ask you to share how you knew you had the ability to do this.

I am concerned that in the future ITC may want to begin referring these incidents to the honor (for identity theft) or to the judiciary committee (for violation of computing policy) if they become more common.

My goal is to understand whether this is a new trend and, if so, perhaps put some effort into educating the E-school (all three cases have come in regarding e-school students) to prevent any disciplinary referrals.

Without expecting any names from you, I would appreciate any information you could share with me.

Feel free to call me in my office this week at ###-#### or reply to this email address.

Best wishes for a good ending to your semester,

Dean's Office
Mushu

Untitled

WHOOPS!!!

To everyone who tried to log-in yesterday - I switched the database server over from dwarfsoft's host (which was really ick) to one hosted at the university that I found. Unfortunately, I did this right after posting, and register.php (week-old legacy code) was still using the hard-coded connection settings (as opposed to the new centralized connection script) and was still connecting to the old server.

Thus, when you logged in, nothing happened. I'll throw in some feedback there for "LOL BAD USERNAME/PASSWORD COMBINATION" tommorrow after I finish up a paper.

Anyway, just to let you know (HOPEDAGGER) that I have more than just a register/login page. I actually have *stuff* up. And stuff. With worse graphics than the registration page. Much worse. Sorry I let you guys down yesterday - I guess that's inevitable for any game of the genre though.

(tehmorpg)
Mushu

Untitled

Okay, so I mentioned that I have to learn PHP and stuff so I have a better chance of getting a job, so I've been working on a web-based (MO)RPG project for about a week. It actually isn't that hard, once you get past the fact that PHP is a turd and debugging sucks, and other various issues.

Anyway, working on a proof-of-concept right now. Still need to write the battle engine, and some other very important parts (like, being able to interact with the environment in ways other than 'examine' lols).

teh morpg


Feel free to make an account and view my crappy artwork. Also, if you know any good artists who would be willing to work for free.... :3

Oh, and also - please feel free to try to hack it apart. I think I've got it all secured up, and would be grateful if you guys can find anything (SQL injection, etc) that I've missed. I've got everything backed up (I hope) so don't feel bad if you break something.

Also, there's no validation email like it says, just put in asd@asd.asd or something. I don't want your real emails.
Mushu

Untitled

Hur hur!

So I'm sitting here watching some anime (Fate/Stay Night), and my phone rings. I'm like 'lol ok phone' and pick it up. The person asks me if I'm Mushu, and I say yeah and they're like, well, we found out that you're spoofing your MAC address and sent you an email blah blah expulsion blah blah comply with the instructions blah.

Nutshell, apparently its becoming more common/problematic (I guess?) and they're starting to crack down on it. Or maybe I was just spoofing the wrong address. In any case, lolol back to 650MB/day for me. At least I'm not b&.

Also, I'll probably stop using some of the other methods of getting around bandwidth limits... because if they were able to track me down by my physical connection (ie, they knew the bandwidth was being used by whomever lives in my room) then they're probably going to find out in the end. And I think I'd rather live with 650MB/day for a semester (living off campus next year woot!) than not graduate/face criminal charges.

Now I just need to make sure they don't read TA logs. Because that... might be bad.
Mushu

Untitled

O_o

Also, I just got back from one of the gamedev meetings I probably mentioned earlier. It was given by one of the graphics professors here (actually, the only one left after they fired the other two...) about what makes a video game good or bad.

Too bad said professor swore off video games years ago. LOLOL?

edit: hi pouya.
Mushu

Untitled

Life's been busy recently and stuff. Been working on a crappy project in PHP to learn some of the language basics and stuff, and watching way too much anime for my own well being. Hopefully I'll have some gamedev-related stuff to show in about a week's time (maybe more) - having some browser issues right now. Stupid cunting Firefox vomits all over my XSL stylesheets.

Bloody Firefox.

Also -

Hello everyone,

Student Game Developers is pleased to present our first Game Development
Lecture Series, 2006. We have two fantasitic speakers giving talks this
week as classes end. The information is as follows...

MONDAY, DECEMBER 4th, 7:00PM, OLSSON 009
MYTHIC ENTERTAINMENT, Kristen Neal and Ben Cummings
A presentation on life in the game development industry, demos of Warhammer,
and a question an answer session afterwards.

TUESDAY, DECEMBER 5th, 8:00PM (may change!), OLSSON 120
PROFESSOR BLOOMFIELD
Giving a lecture on programming and game development.

Celebrate the end of classes and come join us!


Too bad I have class on Monday from 6-8PM... sucks hard for me I guess. Oh well.

Also, hi Mike.
Mushu

Untitled

"The rumors of my life have not been greatly exaggerated."

A week without internet is seriously killer. At least I had my Wii to play with. Har har, only had to camp outside in freezing weather with a camp chair and some blankets for 12 hours. Zelda dies. Oops .

At least its a quick, though ungracious death. I was just kind of sitting there thinking, "well, damn." She'll probably come back to life one way or another by the end of the game, but I don't want to spoil everything.

Wii Sports is awesome, Red Steel is great. My biggest gripe about Red Steel is that the weapons are completely unbalanced. The pistol is, by far, the most powerful weapon. Seriously. My brother and I did some tests in the multiplayer mode, and the pistol does far more damage per unit of time than all the other weapons. I think this is due to weapon 'accuracy' being added in - the bullets don't go exactly where you're pointing..... unless you use a pistol.

I was going to rant about how gdnet suxxors teh big !!111!500.13 these days but I figure, well, best not to talk about it especially since its to be expected from such hackish software but I guess I can't complain. I doubt I could write anything to best it, so hooray good job for getting it this far. *watches Paypal send more money*

Haven't gotten the job as sysadmin at uni yet because they don't have funding for it until next year (ie, 2 months) when a couple positions open up. Meanwhile, I think I'll learn me some PHP, something that I've been meaning to do for a while, and a job skill they asked if I had in the impromptu interview I managed to snag after saying I'd work for free. Long story.

Going to go continue reading Sword of Truth now, or play with my Wii some more... though its a little chafed from earlier today.

Also, hi Steve.
Mushu

Untitled

[x] Final Fantasy III
[x] Trauma Center: Under the Knife


Both of these games are fucking amazing. AMAZING!

You need to get copies if you haven't already.
Mushu

Untitled

FF3!!!

Okay, so I went into GameStop this morning when it opened, and was like "whuz up babe, gimme ff3 plox" and she was like "whut we dun hav ff3 it dun arrive until noon or one lolz" and I was like "shiizzzzz" so I bought a different game.

Then I came back around 2, after they had unpacked today's shipment and asked if FF3 had come in. The lady was like "Whoops, sorry, today may be the release day but it's apparently coming in tommorrow". I was like "..." but then she offered to let me pre-purchase a copy (because they only had 4 coming that hadn't already been reserved) so that made me happy.

Also, how the hell do they get semi-hot chicks to work at GameStop? Seriously.

Here's the game I bought - its fucking awesome -



THE HEALING TOUCH LOLOL.
(Trauma Center: Under the Knife)
Mushu

Untitled

Stuff to buy -

[ ] Children of Mana (DS, $40, Released)
[ ] Final Fantasy III (DS, $40, November 14)
[ ] Wii Console ($310, November 19)
[ ] Zelda: Phantom Hourglass (Wii, $50, November 19)
[ ] Metal Slug Anthology (Wii, $50, November 19)
[ ] Trauma Center: Second Opinion (Wii, $50, November 19)
[ ] Kirby: Squeak Squad (DS, $40, December 4)


November 14: $80
November 19: ~$500
December 4: $40
TOTAL: ~$650


*drrrooooooolllll*
Mushu

Untitled



blaaarrrgggg I have a test on wednesday that I'm completely unprepared for, and I discovered that I'm not going to be here for the 17-19th, which is UGHHHH so I'll just have to try my best to get a Wii at home. The Target (PLACE OF INFAMY) has 51 units to sell... hopefully I'll be able to get one.

Fucking hell.

Still need to draw some crenelations or something. And to look up how to spell 'crenelations'.
Sign in to follow this