Jump to content
MakeWebGames

Spudinski

Members
  • Posts

    1,731
  • Joined

  • Last visited

  • Days Won

    5

Everything posted by Spudinski

  1. Actually, I would disagree with video tutorials. Video tutorials only show you how to get to point A to point B, and that's it. Most of them doesn't even explain why, or how they achieved what they did. A programmer should be able to look at technologies at hand, and be able to do anything with it, and vid's won't teach you that. Online certification courses are worth less then the paper used to print them on, because they do basically the same. For one I like the PHP manual. Although sometimes confusing to most, it does document the PHP programming language quite well. All that tutorials nowadays do, is take an example and teach how you to achieve the example. Ingenuity dies this way. Books on the other hand actually takes the whole PHP manual and sums up the most modern and popular techniques used in dynamic web development today. Even books dated to < 5.3 still contain a bunch of useful information. I'm going to compare two exactly the same things surrounding PHP: "What is PHP?". Let's take a simple tutorial for example: - PHP Introduction, Tizag And now a relatively good book: - PHP The Good Parts, O'Reilly They both provide you with what PHP is, but which would you like to know? How to quote a manual, or a hands on definition by someone who has been working with PHP for ~20 years.
  2. We'd be as the old English say, screwed. Quite difficult though. What if aliens invaded us tomorrow? Starting from the North, moving South so I'm last. :)
  3. Spudinski

    New game

    Registration page: Javascript alert saying "password must be at least 4 characters", "1234" is four characters, but doesn't validate. Also, within the alert the last few characters "Ion...", I don't think it fits?
  4. It would explain a whole lot of things. Hah... :D What if we all lived underwater?
  5. Assuming you are with a web host, please consult them about this error. You are paying them, they should assist you with any configuration of your scripts if you are an a shared hosting package. A bit of technical info' if you want to fix it yourself: "root" is the default mysql superuser account, most hosting companies do not allow you to connect with this user. You should have your own mySQL username/password combination, the username would most likely be eight letter word, in your case "grandmal". Along with that, you use your password, this would also most likely be the password you use for logging into your control panel. Additionally, you need to create a database, this can be found under the "Databases" tab on most control panels. After you have everything; your username, password and database name, you should enter those when the installer prompts for them. Good luck.   That file merely contains a copied mySQL class MCCodes ships with V2.x.
  6. Well, firstly, welcome to the forums. :) The background you have in creating a financial system will be a massive benefit while creating a online game, because, it's all just clever maths. As for "marketing campaign", no, not at all. It's just the way most of those game owners think: if they "appear" to have more users, they will gain more. They simply run a quick script with fake asl's to populate a database, that's all. It's kind of guaranteed that one in every 100 user will stay, no matter how bad the site is. On to your question; Is there a still a market? Indeed, there's a massive market. One have to remember that most people(like you), even though aged, still want to play those classic games we all love or at least something similar. Remember GTA 1, still 2D RPG type where you look from above? Those are coming back strong, but now it's web-based and accessible to anyone, anywhere. Loyal players will come, and stay - if you give them a reason of course. The market have changed, yes, but that's not because of MCCodes being so affordable and easily accessible. You have to remember that people have preferences, and search for different things in a game. Take me for instance: I love TribalWars, and still spend 5USD every month for their premium features even though I can do without it. Why? Because I love the game: it's complex yet entertaining, I have acquaintances there, and it's persistent. That's something I can't say for most MCCodes or even most other MMOGs out there these days. They make everything so "I want money" like, that you have to purchase this or that to even let the game be playable. Although corporate companies do this as well, the main culprit are these teens that buy a engine and simply modify a line of CSS or two, and call it "FREE! Unique TOP Gangster MASSIVE Multiplayer Online GAME" (I've actually seen a title like that, it's very sad and degrading). Originality is key when making a game, that is if you want loyal and decent players. Sure, not many people would like it, but that will mostly be these young teens that only want to play an online FPS with woman instead of men soldiers. It doesn't matter anyways, because they are normally the ones who make a game unplayable in the first place. You want to build a community in- and around your game, that will make people want to come back. Another key aspect of a game should actually be play-ability and the longevity of your game in general. It's basically how long a player can play without becoming bored, and leave. Granted you can't have someone stay forever, but you should aim for eternity when designing the game. Let's take MafiaWars for example: why can one play so long before becoming bored? For me it was a month, then everything just became a routine and there was nothing exciting left to do. But the reason I didn't leave within say, a week, is because it's a social game. Ok, it does not feature a live chat feature or anything, but that was never the point of playing, I simply wanted to see if I can get a higher level than my friends. Plus, I played it on Facebook, so being able to chat with a friend while playing was an awesome thing indeed. That is something to keep in mind when designing a game, especially if you want to attract a younger audience(18-30): how social can you make it? Just adding a simple chat feature can be a sure-fire way to have the players stay on longer, and if you implement abilities for the players to brag about their achievements, you will keep them even longer. When it comes down to it, you just need to plan very carefully. Firstly and foremost: what you want it to be, and what you want out of it. Also think of why you would play it, what would you do to the game if you were playing it and not going building it. And after all of that, when you have what you want out of it planned to the last detail, then you start asking people what they would like to see. Using a few beta testers of different ages and marginally the same preference for the type of game the like will get you the best results. After you have that input, you adapt the game, but while still keeping it to your liking. After that it would be time for a public trail, where everyone can give input. After everything is done, and everything is exactly how you wanted it to be, then you can start the clock on the game, sit back, and enjoy your creation. People will come, any many will stay and become very loyal players, it's just gonna take some time. Wishing you the best with your future(or not) road to creating a game.
  7. The reason I believe this to be, is because they don't actually know how to use it. For instance, I use debugging ever-single-day, and it's become a vital part of my development. But for that, you will need to know how the stack variables are assigned and utilized, and that's something I don't believe all novices know. I use a combination of Netbeans and Zend Sutdio, and what I like about them: - inspect future of ZDE, showing me all my functions within the scope of a project, as well as all PHP possible functions in my defined ini dir, and the manual is an F1 away from that. - SQL view - although not used a lot, it's always nice to have. - snippets As for Netbeans: - plugins, deff'o - fullscreen view - subversion - tasks - CSS view, even though, it is outdated and doesn't fully support all browsers. - find AND replace in project scope Of both: - live debugging - code formatter - regex search
  8. I'd suggest you use something with more documentation. Try "PHP Cron", found at: http://www.phpclasses.org/package/2392-PHP-Parse-cron-schedules-to-find-when-cron-job-ran.html
  9. Please post the file "header.php". And PS. MCCodes uses CSS, not inline-style rules.
  10. Also, previous experience, expertise, and references. I would ask for all of those from someone who beta tests one of my sites.
  11. I would be willing to do a live tut, or w/e on IRC.
  12. I do get what you're trying to do, something like SMF's "total time online". It's rather difficult if you have to do it with only timestamps, usually it is done per session, or by use of cronjob. This code doesn't make use of any array specific functions, as it's a prototype, but from what I guess(logic), it will work.   <?php error_reporting(E_ERROR); $data = array(); // random data, ignore, again. for($i=0;$i<=19;$i++) { $data['user-' . $i] = array(); for($x=0;$x<=49;$x++) $data['user-' . $i][] = strtotime('2 January 2011 ' . rand(0, 23) . ':' . rand(0, 59) . ':' . rand(0, 59)); asort($data['user-' . $i], SORT_ASC); } // 20c;50r error_reporting(E_ALL); // we need to define a new array, for the specific time users are online. $userdata = array(); // loop through to split up the users foreach($data as $user => $timestamp) { $userdata[$user] = 1; // the reason why the above is 1, instead of 0, is purely argumentable. // the last timestamp in the timestamp array wont be counted. foreach($timestamp as $t) { // loop through the timestamp array if (empty($last)) $last = $t; // if there is no last entry, it has to be the first, so set it so else { if (($t - $last) >= (60*15)) $last = $t; // if the user hasn't visited the site for 15 minutes, we asume the // new value presented, which would be the current time else { // if the timestamp is recorder within 15 minutes since // the last one, we subtract the current timestamp with // that from the last, and add it to our current "activity meter" $userdata[$user] += $t - $last; $last = $t; // again, just set the current time as previous } } } $last = 0; // we're done looping through the timestamps of one user, so set it back to null } arsort($userdata, SORT_ASC); // we sort the values of the array, while preserving the keys $new_data = array_slice($userdata, 0, 10, true); // only get top items from the array $c = 0; // counter, whoo. :| foreach($new_data as $user => $time) { // loop through a 2D array $c++; // increment the counter by 1 echo '#' . $c . "\t" . $user . "\t" . round($time / 60) . " minutes active.\n"; // echo the results, round() function used to convert to minutes, hence "/ 60". // \t = tab \n = newline } ?>   It's not point accurate, but it's the basic concept most activity counters work.
  13. After some research, and some logic, I found the problem with your code. Time only reaches 7 digits at exactly "2 January 1970 05:46:40", so anything before that, would amount in what you see. This median finding technique is based on exactly 7 digits, but the result you see is valid, though: user-b, has a timestamp further in time than user-a. Please increment the date to anything above the minimum of "2 January 1970 05:46:40" to see desired result. EDIT An activity indicator is a bit more difficult than this. It works by collecting timestamps, and measuring time in between them, and subtracting the timeout(the amount of time that passes with no activity from a user, until they are presumed offline) at each "visit". One would end up with "sets" of timestamps. I'll give you an example of this later, if needed.
  14. As soon as I log out, the blocked image appears.
  15. True, then a median approach would be more applicable if you were to use it. Example(no documentation beyond alterations: <?php $arr_usertimestamp = array(); for($i=0;$i<=50;$i++) { $arr_usertimestamp['user' . $i] = array(); for($v=0;$v<=10;$v++) $arr_usertimestamp['user' . $i][] = rand(time()-999, time()+999); } foreach($arr_usertimestamp as $user => $timestamps) { $median = array_sum($timestamps) / count($timestamps); // here we still find the sum of all the timestamps, but then // divide it by the total number of timestamps there is // giving us a median $arr_usertimestamp[$user] = intval($median); // the likelihood for a float is greater, so we still round to an integer } array_flip($arr_usertimestamp); asort($arr_usertimestamp, SORT_DESC); $arr_topten = array_slice($arr_usertimestamp, 0, 10, true); echo implode('<br>', array_keys($arr_topten)); ?> This should suffice to the scenario of your most recent post.
  16. I'd be worried working for/with this guy...
  17. Well, there are three basic methods to get the highest ranking user here; 1. sum up all the timestamps in the array, or 2. find the median of all the timestamps, or 3. just simply use "count()" to count the values in the array. To keep it at an intermediate level, I had chosen to sum up all the timestamps, which in return gives me a integer, or float. The reason why I do this, is because I depend on the array's structure being array(string username <= int timestamp), as can be seen in the script's later stages of execution.   Indeed it does. But a good script has to be able to deal with the odds. The chances are more than likely(spare me the math, please) that it will return an integer. Oh my, and I have to apologize, it shouldn't return a float with the values presented, as they are all integers. It's probably something that went wrong in testing, and I probably patched it. There are actually no excuses, sorry, I should have double checked the code before posting. Should I elaborate more, or do you get what I'm doing in the loop?
  18. Please don't use ImageShack, not everyone is logged in at ImageShack, or even has an account there. Thus the images do not appear.
  19. I'm already using PEAR's DB class, so it won't affect me. But I do think this is gibberish, if something's not broken, don't fix it.
  20. I have better documented my code, please see if you can better understand it now.
  21. I for one like, no love, music. I also like the diversity you get around the world. So I though maybe making a topic where we all can hear each other's local bands. Simply post a link, and a description, and of course why you like the musician, or band. Have fun. ----------------------- Chromium - My Perfection, or really any other song of them. They are from my city actually, and why I like them so much is because live, they kick rock. But it's also that they go on about things that actually make sense, something I don't normally see in the likes of a metal band, like say Norther. Link: http://www.reverbnation.com/artist/song_details/6816396
  22. Whenever I post any code, wrapped in a [ code ] container, it doesn't display. It works in all other browsers on my system. How to replicate: <?php echo 'This is supposed to display, but doesn\'t'; ?> Just did it. Technical: Browser: Chrome 13.0.782.112 m OS: WinXP Home SP3
  23. Arrays 101 (PHP 5) Level: Intermediate Most people learn by practice, right? Well, so it may be, and I created this tutorial by using scenario-solution examples. I hope most people will take part in this if they want to learn more about using arrays to their full potential. Just to make it clear, I will not be explaining how to define arrays as you should already know the basics of using arrays and defining them. This is just a article to help you find out the different ways of handeling arrays in a script. Arrays is personally for me one of the best things within any programming language. An array is a set of variables, or rather defined data. There are many ways to handle arrays and like with many other things in the PHP, there are a lot of functions that can be used to manipulate arrays. I would like to help everyone better their skills with arrays, but I will require scenario's from you guys and then I will make a script explaning the functions I used. Here is an example bellow: Scenario 1: You want to make a script to show the most active users, but you currently only have timestamps of their visits within the last month. First you have decided collect all the user timestamps from a database, and you have put them in an array(wether via mySQL or a flat DB - not explaining) with the following structure: Array ( username => Array( timestamp, timestamp, etc.. ) ) Solution 1: <?php // sample population data, ignore this, please. $arr_usertimestamp = array(); for($i=0;$i<=50;$i++) { $arr_usertimestamp['user' . $i] = array(); for($v=0;$v<=10;$v++) $arr_usertimestamp['user' . $i][] = rand(time()-999, time()+999); } // here we loop through the first dimension of the array, containing the usernames. // it will loop through the usernames, by order that the array was assign at foreach($arr_usertimestamp as $user => $timestamps) { $arr_usertimestamp[$user] = intval(array_sum($timestamps)); // Here, we sum up all the values contained within the second dimension of the original array // but because we are now in a foreach loop, that is able to work within two dimensions, hence the “>=”, that defines the array’s key, and then, the value to be used, which is normally an array. // the main thing to remember, is that the original array, is split into piecies when run by a foreach loop. The original structure of array(username <= array(t,t,t)), has now become username <= array(t,t,t). // you can think of it as if we are within the array, sequentially running down it. // PS. array_sum returns COULD POTENTIALLY, THOUGH NOT LIKELY a float, so I use the intval() function, which converts/rounds the decimal value, into a whole integer. } array_flip($arr_usertimestamp); // here I flip the keys and values, basically turning the order in direct opposite to what it was // take for instance array(a,b,c,d), using array_flip(), it will become array(d,c,b,a) // the function doesn’t return a value, instead it directly works on the variable containing // the array, which makes that the return value of array_flip() is not needed to be stored asort($arr_usertimestamp, SORT_DESC); // and here I sort the array keys ONLY, which is sorted descendingly, from high to low. // the second argument, SORT_DESC, does that. // the function doesn’t return a value, instead it directly works on the variable containing // the array, which makes that the return value of asort() is not needed to be stored $arr_topten = array_slice($arr_usertimestamp, 0, 10, true); // the function array_slice() does exactly what it says, it slices the array at a given point, keeps one part, and discards of the other. // the first argument is the variable(array assigned to it), the second is where to start keeping // the array, and the third, where to cut it off, fourt, and last argument, is wether to preserve the // order of the array, we set it to “true” to keep the order of the array the same. // we only want to get the first 10 entries from array. // for an example of this: take array(0,1,2,3,4,5,6,7,8,9), we only want values 4 to 8, so we will // use array_slice($var, 3, 7, true), which will return array(4,5,6,7,8) echo implode('<br>', array_keys($arr_topten)); // implode can be used to glue arrays together, and return it as a string // the first argument is what the “glue” should be, or what to place between the arrays. // now with the second argument, we make use of the function array_keys() // the reason for this, is because we have a two-dimensional array at had, being // array(username <= sum of all t). We only need to retrive the first part(or referred to as “key”) // of the array. So, we now have an array of only usernames, like array(peter, jane, john). // the function still returns an array, but because we defined it as the argument array for implode // it will be converted into a string, and separated by the first argument of the function implode() ?>   So, setup a scenario and I'll show you a solution. Also a kind of test of my abilities. :P
  24. From what I've heard, it's not for novices. That's pretty much all I know, sorry.
  25. - Tomorrow, I'll do that. If it is actually as you say it is, I'd be more than willing to port to Debian permanently. - Depending on the purpose, my Ubuntu 11.04 VPS, with Apache, PHP, MySQL, OpenSSH and FTP, averages at about 90-150MB, and 10% processing 2.8GHz 1 core when in moderate use, 0-2% idle 25-50% throttled. - True.
×
×
  • Create New...