SJA random projects - Page 14

User Tag List

Page 14 of 24 FirstFirst ... 41213141516 ... LastLast
Results 131 to 140 of 236
  1. #131
    Whicked Sick UT-Sniper-SJA94's Avatar
    Join Date
    Oct 2011
    Location
    What was England
    Posts
    4,427
    Country:

  2. #132
    Dominating uranus's Avatar
    Join Date
    Jul 2011
    Posts
    646
    Country:
    hilarious!

  3. #133
    Whicked Sick UT-Sniper-SJA94's Avatar
    Join Date
    Oct 2011
    Location
    What was England
    Posts
    4,427
    Country:
    I've added cookies to the game, it saves:

    Username,
    Game Difficulty,
    Game Type,
    Bot Count,
    Graphic Settings,
    Audio Settings.

    I'm going to add the option to skip the create match page if you have already played a game, instead of clicking play -> play.

    I've added the graphic settings so people who are experiencing performance problems, or don't like a certain feature can disable them when ever they want. I can also add more graphical detail doing this if I wanted as well, without worrying about people with older computers not being able to run the game.

    I haven't done the Audio settings yet, all it will be is volume up/down, disable announcer sounds, announcer volume. The Q key is volume down, the W key is volume up(InGame).




    The games source is currently at 3658 Lines long(will be quite a lot less when I've optimized the game, and removed uneeded stuff), and 120kb in size (not including the start of the backend), the game uses 20 Images, and 15 audio files.

    Spawn Killer 2(old game) source is 2390 Lines long, and 75kb in size (not including the backend), the game uses 10 Images, and up to 12 audio files at one time(depends on the settings the user uses).








    ----------------------------------edit---------------------------



    - - - Updated - - -


  4. #134
    Whicked Sick UT-Sniper-SJA94's Avatar
    Join Date
    Oct 2011
    Location
    What was England
    Posts
    4,427
    Country:

  5. #135
    Whicked Sick UT-Sniper-SJA94's Avatar
    Join Date
    Oct 2011
    Location
    What was England
    Posts
    4,427
    Country:
    The game now collects the player's data every second of the game, which will then be turned into data graphs for the stats website:
    {"kills":[0,1,2,3,5,6,7,8,9,10,13,14,16,17,19,21,23,24,26,27 ,28,28,31,33,36,37,39,41,43,44,47,48,49,51,53,55,5 7,60,61,62,65,67,69,71,72,73,74,75,76,78,81,83,85, 87,88,90,92,93,95,97],"headshots":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,2, 2,2,2,2,2,2,2,2,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4, 4,4,4,4,4,5,5,5,5,5],"deaths":[0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,3,3,3,3,3,3,4,4,5,6, 6,6,6,6,6,7,7,8,8,8,8,8,8,8,8,9,10,10,10,10,10,10, 11,11,11,11,11,11,11,12,12,12,12,12,12],"currentSpree":[0,1,2,3,5,6,7,8,9,10,13,0,2,3,5,1,3,4,6,7,8,0,3,1, 2,3,5,7,9,10,1,2,1,3,5,7,9,12,13,14,2,2,4,6,7,8,9, 0,1,3,6,8,10,12,1,3,5,6,8,10],"currentMulti":[0,1,2,3,5,6,1,1,2,3,6,0,2,3,5,1,3,4,6,7,8,0,3,1,2, 3,5,7,9,10,1,2,1,3,5,7,9,12,13,14,2,2,4,6,7,8,1,0, 1,3,6,8,10,12,1,3,5,6,8,10],"sprees":[[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0]],"multis":[[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,1],[0,0,0,0,1],[0,0,0,0,1],[0,0,0,0,1],[0,0,0,1,1],[0,0,0,1,1],[0,0,0,1,1],[0,0,0,1,1],[0,0,0,1,1],[0,0,0,1,1],[0,0,0,1,2],[0,0,0,1,2],[0,0,1,1,2],[1,0,1,1,2],[1,0,1,1,2],[1,0,1,1,2],[1,0,1,1,2],[1,0,1,1,2],[1,0,1,1,2],[1,0,1,1,3],[1,0,1,1,3],[2,0,1,1,3],[2,0,1,1,3],[2,0,1,1,3],[2,0,1,1,3],[2,0,1,1,3],[2,0,1,1,3],[2,0,1,1,3],[2,0,1,1,3],[2,0,1,1,4],[3,0,1,1,4],[3,0,1,1,4],[3,0,1,1,4],[3,0,1,1,4],[3,0,1,1,4],[3,0,1,1,4],[4,0,1,1,4],[4,0,1,1,4],[4,0,1,1,4],[4,0,1,1,4],[4,0,1,1,4],[4,0,1,1,4],[4,0,1,1,4],[4,0,1,1,5],[4,0,1,1,5],[4,0,1,1,5],[4,0,1,1,5],[4,0,1,1,5],[4,0,1,1,5]]}


    -------------------edit-----------------------------


  6. #136
    Whicked Sick UT-Sniper-SJA94's Avatar
    Join Date
    Oct 2011
    Location
    What was England
    Posts
    4,427
    Country:
    Spent a stupid amount of time on this chart for the gametracker, mostly being stupid, bad even by my standards, I really need to start planning, and think what I want to do before I just start coding, by being impatient, something that should of took ~ 30 seconds took hours... The problem was the data in the final array was always in the wrong position, and in the end it was something really simple and stupid...




    The chart displays the most players(player + bot) in a match for each quarter hour of the last 24 hours.


    Code:
    public function getGameTrackerData (){
    		
    		$time = time();
    		$limit = $time - (60 * 60 * 24);
    		$max = 24 * 4;
    
    		$query = "SELECT `name`,`date`,`players` FROM `potato_horse_fish` WHERE `date` >= $limit ORDER BY `id` DESC";
    
    		$data = array();
    
    		//create array for every quater hour in 24 hours
    		for($i = 0; $i < 24 * 4; $i++){
    			$data[] = 0;
    		}
    
    		// 15 minutes
    		$quarter = 900;
    
    		$results = array();
    		
    		if($stmt = $this->db->query($query)){
    
    			while($d = $stmt->fetch_object()){
    				$results[] = array($d->date,$d->players,$d->name);
    			}
    			$stmt->close();
    		}
    
    
    
    		$range = array();
                    
    		// create time ranges
    		for($i = 0; $i < $max; $i++){
    			$range[] = array($time - ($quarter * $i),$time - ($quarter * ($i + 1)));
    		}
                     This is where i fucked up big time
    		// loop though the database results
    		for($i = 0; $i < count($results); $i++){
    
    			//loop through all the ranges
    			for($a = 0; $a < count($range); $a++){
    				
    				//find what quarter the data belongs to
    				if($results[$i][0] <= $range[$a][0] && $results[$i][0] > $range[$a][1]){
    
    					//if there is more players in the match set the max to the current value
    					if($results[$i][1] > $data[$a]){
    						$data[$a] = $results[$i][1];
    					}
    				}
    
    			}
    		}
    	
    		return json_encode($data);
    
    	}

  7. #137
    Dominating LordRixuel's Avatar
    Join Date
    Feb 2016
    Location
    Earth
    Posts
    556
    Country:
    damm, you are a maniac programmer O_o

    i cant even imagine me to write codes like you x_x
    █████████ Loading Hax 99%
    C:\Users\name\AppData\Local\VirtualStore\

  8. #138
    Whicked Sick UT-Sniper-SJA94's Avatar
    Join Date
    Oct 2011
    Location
    What was England
    Posts
    4,427
    Country:
    A professional programmer would probably throw up looking at all my different projects source code. I dont feel that i am a good programmer

  9. #139
    Killing Spree DontWorryBeHappy's Avatar
    Join Date
    Feb 2013
    Posts
    144
    Country:
    What helps me is thinking and writing in pseudo-code first. You probably do that already but it makes things really easier to understand, especially nested loops, lol.

  10. #140
    Whicked Sick UT-Sniper-SJA94's Avatar
    Join Date
    Oct 2011
    Location
    What was England
    Posts
    4,427
    Country:
    I have about 100 pocket sized notepads, 7 for $1, or 5 for $1 for the slightly bigger ones i normally use one for mapping or programming.

    The problem is i just write what i want to make so i dont forget about it, i dont think ive ever written pseudo code before 95% of the time i manage to do what i targeted to, but when i do make a mistake i waste a lot more time than i should by not planning. When i move house im planning on getting a big whiteboard and writting stuff for the project before hand, so i can quickly look up at it and see what i need to do., or just get a decent desk where there is room for everything.

    For example, for the gametracker i wrote "make gametracker"

Thread Information

Users Browsing this Thread

There are currently 3 users browsing this thread. (0 members and 3 guests)

Similar Threads

  1. Another random game
    By UT-Sniper-SJA94 in forum Spam Section
    Replies: 79
    Last Post: 06-29-2015, 07:59 PM
  2. Random siege gif.
    By Chamberly in forum Screenshots
    Replies: 8
    Last Post: 01-05-2015, 04:17 AM
  3. Ben10 / Random / random Anime names
    By uenz in forum Reports/Complaints & Appeals
    Replies: 7
    Last Post: 08-30-2014, 02:43 PM
  4. Random bug
    By UT-Sniper-SJA94 in forum Spam Section
    Replies: 7
    Last Post: 03-13-2014, 11:22 AM
  5. Everybody random guy
    By |uK|B|aZe//. in forum Bans
    Replies: 0
    Last Post: 12-23-2011, 10:31 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •