Thread: PixelScape Project Idea -( Programmers/Pixel Artist Needed)

Page 2 of 2 FirstFirst 12
Results 11 to 19 of 19
  1. #11  
    Registered Member

    Join Date
    Jul 2013
    Posts
    119
    Thanks given
    12
    Thanks received
    50
    Rep Power
    83
    Quote Originally Posted by mrexiled View Post
    lol you tripped after i said no to watching something i could google and that code (if to be used) was for the launcher anyway, (not the game rendering/loop) just needed to draw a simple frame with animated loading sprites... check the class that had the simple jpanel method in it..., launcher/game are different threads, i didn't need anything big for drawing the launcher, but i want my launcher to be more advanced so i've changed it to canvas's buffer strategies, (which is the same drawing method i use for the game).
    Got quite the imagination. I was stunned at your rejection for free code that was far better than what you had - "trip" would be an exaggeration of what actually happened.

    For the launcher? That's why you had a Game and Player type?

    You are nuts. I shall light a candle for those who decided to work with you.
    Reply With Quote  
     

  2. #12  
    Registered Member mrexiled's Avatar
    Join Date
    Feb 2016
    Posts
    274
    Thanks given
    144
    Thanks received
    32
    Rep Power
    29
    Quote Originally Posted by Serious ipwxy View Post
    Got quite the imagination. I was stunned at your rejection for free code that was far better than what you had - "trip" would be an exaggeration of what actually happened.

    For the launcher? That's why you had a Game and Player type?

    You are nuts. I shall light a candle for those who decided to work with you.
    you never even seen the Game thread lmao.

    we are doing exceptionally well, we already have a working game lol, we just need sprites and find a way to convert all 3d kodels to 2d sprites and start on things like npcs and items.
    Reply With Quote  
     

  3. #13  
    pride, love, happiness
    .alycia's Avatar
    Join Date
    Jun 2010
    Age
    28
    Posts
    4,106
    Thanks given
    1,714
    Thanks received
    2,062
    Rep Power
    5000
    Code:
    public void render() {
    		panel = new JPanel() {
    			@Override
    			protected void paintComponent(Graphics g) {
    				gfx = g;
    				
    			}
    		};
    	}
    That's not how you build a new JPanel...
    Reply With Quote  
     

  4. #14  
    Registered Member mrexiled's Avatar
    Join Date
    Feb 2016
    Posts
    274
    Thanks given
    144
    Thanks received
    32
    Rep Power
    29
    Quote Originally Posted by chaflie View Post
    Code:
    public void render() {
    		panel = new JPanel() {
    			@Override
    			protected void paintComponent(Graphics g) {
    				gfx = g;
    				
    			}
    		};
    	}
    That's not how you build a new JPanel...

    lol....

    I
    Am
    Not
    Using
    JPanel


    also we've decided to not make rs3-2D, we've decided to work on our own rpg, will make a thread with updates soon.
    expect beta release within the next few months.


    but here is tiny example of how our GAME's rendering works (this is not the full rendering system), we're still working on it and any improvements would be nice.

    if you have a completely different rendering idea, that would be cool, but we have a few other ideas we are trying too.


    Spoiler for Game Rendering:

    Code:
    //PIXELSCAPE RENDERING SYSTEM EXPLAINED IN JAVA AND WITH ONLY ONE CLASS.
    //DOES NOT INCLUDE TICKING JUST RENDERING, TICKING IS A DIFFERENT THREAD.(so they can run on different frames per second)
    //main() method is at the very bottom.
    
    /*
     * @Author
     *	CodyOrr4
     */
    
    import javax.swing.*;
    import java.awt.*;
    import java.awt.image.*;
    
    
    public class Main implements Runnable {
    	
    	public static Cache cache;
    	public static JFrame frame;
    	public static JPanel panel;
    	public static JViewport camera;
    	public static Canvas canvas;
    	public static BufferStrategy bufferStrategy;
    	public static Graphics graphics;
    	public static boolean rendering = false;
    	public static Thread renderingThread;
    	
    	//turns this runnable into an object.
    	public Main() {
    		frame = new JFrame("Rendering System Example");
    		frame.setSize(new Dimension(800, 600));
    		frame.setDefaultCloseOperation(1);
    		frame.setVisible(true);
    		
    		panel = new JPanel();
    		panel.setBackground(Color.DARK_GRAY);
    		
    		canvas = new Canvas();
    		canvas.setBackground(Color.BLACK);
    		canvas.setPreferredSize(new Dimension(800, 600));
    		canvas.setMinimumSize(new Dimension(800, 600));
    		canvas.setMaximumSize(new Dimension(2000, 2000));
    		
    		cache = new Cache();
    		
    		panel.add(canvas);
    		frame.getContentPane().add(panel);
    	}
    	
    	//used to run things that are not meant to be run in a loop;
    	private void init() {
    		cache.initCache(); //can now grab sprites (including names/ids) and other types within cache.
    	}
    	
    	//renders everything (this method is used in a while() loop based on a boolean, within the run() method);
    	private void render(Graphics g) {
    		
    		g.drawImage(cache.getSprite(0), 400, 300, 25, 25, null);
    		
    	}
    	
    	//runs the runnable
    	public void run() {
    		init();
    		while(rendering) {
    			setFps(16);//simply set fps now - iJustin   *codys note on the setFps(fps); method* = not sure if its the same thing lol, 
    														//but since ticking and rendering are separate threads in the main source (and contain separate init() methods) it seems like it would be good.
    				
    			if(bufferStrategy == null) {
    				canvas.createBufferStrategy(3);//should only need a max of 3.
    				bufferStrategy = canvas.getBufferStrategy();
    				graphics = bufferStrategy.getDrawGraphics();
    				System.out.println("creating canvas components...");
    			}
    			
    			//drawing with methods
    			render(graphics);
    			
    			//drawing without methods
    			graphics.drawImage(cache.getSprite(0), 0, 0, 50, 50, null);
    			
    			
    			
    			bufferStrategy.show();
    			graphics.dispose();
    		}
    	}
    	
    	//starts the run method and creates a thread for this 
    	public synchronized void start() {
    		renderingThread = new Thread(this);
    		renderingThread.setName("Game Rendering Thread");
    		renderingThread.start();
    		rendering = true;
    	}
    	
    	//stops the while loop by setting the boolean to false and the thread is now null
    	public synchronized void stop() {
    		renderingThread = null;
    		rendering = false;
    	}
    	
    	//@Author iJustin - sets fps of the rendering loop (while() loop within run() method)
    	@SuppressWarnings("static-access")
    	public void setFps(long fps) {
    		try {
    			renderingThread.sleep(fps);
    		}
    		catch(InterruptedException e) {
    			
    		}
    	}
    	
    	//main method obv.
    	public static void main(String[] args) {
    		Main gameExample = new Main();
    		gameExample.start();
    	}
    }





    My main issue with this right now is the "setFps(long fps)" method, it just makes the thread sleep for a period of time, i was wanting to use System.nanotime(), because all images take different times to load, and using nanotime we could see how long it took to run code, and set fps that way.
    but since ticking and rendering are different threads the sleep() method could work i guess, just not sure how efficient that is.
    Reply With Quote  
     

  5. #15  
    Registered Member
    Join Date
    Apr 2016
    Posts
    124
    Thanks given
    14
    Thanks received
    21
    Rep Power
    37
    the docs on that example killed me...

    Code:
            //used to run things that are not meant to be run in a loop;
    	private void init() {
    
            //runs the runnable
    	public void run() {
    Reply With Quote  
     

  6. #16  
    Registered Member

    Join Date
    Jul 2013
    Posts
    119
    Thanks given
    12
    Thanks received
    50
    Rep Power
    83
    Quote Originally Posted by mrexiled View Post
    lol....

    I
    Am
    Not
    Using
    JPanel


    also we've decided to not make rs3-2D, we've decided to work on our own rpg, will make a thread with updates soon.
    expect beta release within the next few months.


    but here is tiny example of how our GAME's rendering works (this is not the full rendering system), we're still working on it and any improvements would be nice.

    if you have a completely different rendering idea, that would be cool, but we have a few other ideas we are trying too.


    Spoiler for Game Rendering:

    Code:
    //PIXELSCAPE RENDERING SYSTEM EXPLAINED IN JAVA AND WITH ONLY ONE CLASS.
    //DOES NOT INCLUDE TICKING JUST RENDERING, TICKING IS A DIFFERENT THREAD.(so they can run on different frames per second)
    //main() method is at the very bottom.
    
    /*
     * @Author
     *	CodyOrr4
     */
    
    import javax.swing.*;
    import java.awt.*;
    import java.awt.image.*;
    
    
    public class Main implements Runnable {
    	
    	public static Cache cache;
    	public static JFrame frame;
    	public static JPanel panel;
    	public static JViewport camera;
    	public static Canvas canvas;
    	public static BufferStrategy bufferStrategy;
    	public static Graphics graphics;
    	public static boolean rendering = false;
    	public static Thread renderingThread;
    	
    	//turns this runnable into an object.
    	public Main() {
    		frame = new JFrame("Rendering System Example");
    		frame.setSize(new Dimension(800, 600));
    		frame.setDefaultCloseOperation(1);
    		frame.setVisible(true);
    		
    		panel = new JPanel();
    		panel.setBackground(Color.DARK_GRAY);
    		
    		canvas = new Canvas();
    		canvas.setBackground(Color.BLACK);
    		canvas.setPreferredSize(new Dimension(800, 600));
    		canvas.setMinimumSize(new Dimension(800, 600));
    		canvas.setMaximumSize(new Dimension(2000, 2000));
    		
    		cache = new Cache();
    		
    		panel.add(canvas);
    		frame.getContentPane().add(panel);
    	}
    	
    	//used to run things that are not meant to be run in a loop;
    	private void init() {
    		cache.initCache(); //can now grab sprites (including names/ids) and other types within cache.
    	}
    	
    	//renders everything (this method is used in a while() loop based on a boolean, within the run() method);
    	private void render(Graphics g) {
    		
    		g.drawImage(cache.getSprite(0), 400, 300, 25, 25, null);
    		
    	}
    	
    	//runs the runnable
    	public void run() {
    		init();
    		while(rendering) {
    			setFps(16);//simply set fps now - iJustin   *codys note on the setFps(fps); method* = not sure if its the same thing lol, 
    														//but since ticking and rendering are separate threads in the main source (and contain separate init() methods) it seems like it would be good.
    				
    			if(bufferStrategy == null) {
    				canvas.createBufferStrategy(3);//should only need a max of 3.
    				bufferStrategy = canvas.getBufferStrategy();
    				graphics = bufferStrategy.getDrawGraphics();
    				System.out.println("creating canvas components...");
    			}
    			
    			//drawing with methods
    			render(graphics);
    			
    			//drawing without methods
    			graphics.drawImage(cache.getSprite(0), 0, 0, 50, 50, null);
    			
    			
    			
    			bufferStrategy.show();
    			graphics.dispose();
    		}
    	}
    	
    	//starts the run method and creates a thread for this 
    	public synchronized void start() {
    		renderingThread = new Thread(this);
    		renderingThread.setName("Game Rendering Thread");
    		renderingThread.start();
    		rendering = true;
    	}
    	
    	//stops the while loop by setting the boolean to false and the thread is now null
    	public synchronized void stop() {
    		renderingThread = null;
    		rendering = false;
    	}
    	
    	//@Author iJustin - sets fps of the rendering loop (while() loop within run() method)
    	@SuppressWarnings("static-access")
    	public void setFps(long fps) {
    		try {
    			renderingThread.sleep(fps);
    		}
    		catch(InterruptedException e) {
    			
    		}
    	}
    	
    	//main method obv.
    	public static void main(String[] args) {
    		Main gameExample = new Main();
    		gameExample.start();
    	}
    }





    My main issue with this right now is the "setFps(long fps)" method, it just makes the thread sleep for a period of time, i was wanting to use System.nanotime(), because all images take different times to load, and using nanotime we could see how long it took to run code, and set fps that way.
    but since ticking and rendering are different threads the sleep() method could work i guess, just not sure how efficient that is.
    Congratz! You ripped poorly written code! May wanna check out the documentation for BufferStrategy buddy.

    Code:
    public static boolean rendering = false;
    ^ and the basics of Java..
    Reply With Quote  
     

  7. #17  
    Registered Member mrexiled's Avatar
    Join Date
    Feb 2016
    Posts
    274
    Thanks given
    144
    Thanks received
    32
    Rep Power
    29
    Quote Originally Posted by NeedDump View Post
    the docs on that example killed me...

    Code:
            //used to run things that are not meant to be run in a loop;
    	private void init() {
    
            //runs the runnable
    	public void run() {
    yeah lmao, should have looked at the main method.

    Quote Originally Posted by Serious ipwxy View Post
    Congratz! You ripped poorly written code! May wanna check out the documentation for BufferStrategy buddy.

    Code:
    public static boolean rendering = false;
    ^ and the basics of Java..
    lol, explain to me how its so bad and ill think about it.
    im just using a boolean to start the while loop lol? it turns to 'true' when the thread starts.

    its drawing my sprites just fine too.

    our current issue is with loading regions now, we want it to load a region once you enter said region.
    we do not want a region to have exits that you use to change region (fuck that)

    that being said we might have to start over on the whole rendering system.... Would it be best to make multiple running threads that handle everything separatly (player thread, npc thread, Object thread, World thead, tile/region thread, etc)
    Reply With Quote  
     

  8. #18  
    Registered Member

    Join Date
    Jul 2013
    Posts
    119
    Thanks given
    12
    Thanks received
    50
    Rep Power
    83
    Quote Originally Posted by mrexiled View Post
    yeah lmao, should have looked at the main method.



    lol, explain to me how its so bad and ill think about it.
    im just using a boolean to start the while loop lol? it turns to 'true' when the thread starts.

    its drawing my sprites just fine too.

    our current issue is with loading regions now, we want it to load a region once you enter said region.
    we do not want a region to have exits that you use to change region (fuck that)

    that being said we might have to start over on the whole rendering system.... Would it be best to make multiple running threads that handle everything separatly (player thread, npc thread, Object thread, World thead, tile/region thread, etc)
    Think about it? How about thinking about learning Java basics? If you're gonna talk shit, should at least be able to back it up.

    boolean fields are initialized to false by default. 0 reason to initialize to false on declaration for fields, other than not understanding the language.

    Also, your excessive use of static is against OOP, which Java strives on. But then again, how would you know? Oh wait....

    As for the buffer strategy, I have to tell you?? You can't just read the docs? C'mon... There's nothing accounting for potential of lost contents, seeing how buffers in the BufferStrategy are backed by VolatileImage. They literally have a code example right in the docs...

    As for your "I am not using JPanel", that doesn't explain why you showed me such nasty JPanel code.
    Reply With Quote  
     

  9. #19  
    Registered Member mrexiled's Avatar
    Join Date
    Feb 2016
    Posts
    274
    Thanks given
    144
    Thanks received
    32
    Rep Power
    29
    Quote Originally Posted by Serious ipwxy View Post
    Think about it? How about thinking about learning Java basics? If you're gonna talk shit, should at least be able to back it up.

    boolean fields are initialized to false by default. 0 reason to initialize to false on declaration for fields, other than not understanding the language.

    Also, your excessive use of static is against OOP, which Java strives on. But then again, how would you know? Oh wait....

    As for the buffer strategy, I have to tell you?? You can't just read the docs? C'mon... There's nothing accounting for potential of lost contents, seeing how buffers in the BufferStrategy are backed by VolatileImage. They literally have a code example right in the docs...

    As for your "I am not using JPanel", that doesn't explain why you showed me such nasty JPanel code.

    https://www.rune-server.ee/programmi...ment-team.html

    rendering is now more efficient.. i use Canvas/bufferstrategies to render tiles within camera view and i use JComponent for each game object (players,npcs, grounditems, objects, etc) and use paint method. works perfect and doesn't flicker upon repainting.
    after implementing that i was forced to restart once again on my engine as the rendering became more flexible.

    so fuck you and your ripped code. ill do it/learn it the the way i want too
    Reply With Quote  
     

Page 2 of 2 FirstFirst 12

Thread Information
Users Browsing this Thread

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


User Tag List

Similar Threads

  1. Creating an emersive 2d (hd) rpg, need pixel artist.
    By Shean in forum Application Development
    Replies: 5
    Last Post: 10-05-2017, 09:28 PM
  2. Need project Idea.
    By Essaint in forum Requests
    Replies: 3
    Last Post: 01-24-2017, 12:14 AM
  3. Rune-Source Project (staff/programmers needed)
    By Rune-Source in forum Website Development
    Replies: 21
    Last Post: 01-27-2012, 07:48 PM
  4. [PI] Need Project Ideas!
    By Skrillex21 in forum Requests
    Replies: 5
    Last Post: 10-28-2011, 05:00 AM
  5. Need Project Ideas For C++
    By syncro in forum Application Development
    Replies: 24
    Last Post: 07-07-2011, 02:33 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •