Jump to content

  • Log In with Google      Sign In   
  • Create Account


J03_b

Member Since 15 Sep 2011
Offline Last Active Jun 07 2014 02:13 AM
-----

Topics I've Started

Java Networking impossible and erratic errors

09 July 2013 - 06:53 AM

I'm pretty much at a total loss here.  I tried all day yesterday and all night last night to figure out what the hell is wrong with my code but now I'm thinking there's actually a little gremlin in my computer nibbling on the CPU.  I was following along with this tutorial series: 

 

http://www.youtube.com/watch?v=l1p21JWa_8s&list=ELp5mgUw5g9EY

 

until I decided to pause it and make my own custom Packet class.  It was working fine for a while but then some really weird stuff started to happen.  Basically what's happening is the data sent between client and server is getting jumbled up somehow when it is received (I confirmed that the data was correct before it was sent).  This happens at seemingly random points and now I'm baffled

 

For example I had the line:

 

System.out.println( m_Game.m_aConnectedPlayers[ intPlayerID ].GetUserName( ) + " has joined." );

 

and changed it to

 

System.out.println( m_Game.m_aConnectedPlayers[ intPlayerID ].GetUserName( ) + "(" + intPlayerID + ") has joined." );

 

to include the player ID, and then the packet data was getting scrambled up when I connected to the server with a third client.  Also even as I typed this I decided to go back and test it again and the error stopped happening.  I'll grant +100 internet points to whoever can somehow figure this out.  I've attached my entire project (excuse my messy code)


Java - Optimizing efficiency/performance

05 July 2013 - 12:57 AM

So I'm writing my first game in Java, and I'm following a tutorial series on Youtube.  I've come to a point where I'm going to start cleaning up the code before I move on.  One thing the tutorial says to do that doesn't seem very wise is to declare new variables in the tick( ) and render( ) methods that run dozens of times per second.  Wouldn't using class level variables in the tick and render functions be faster because the program can skip the creation and deletion of said variables.

 

 

Another thing that I was going to do was encapsulate all of my class level variables.  My college professor said it is a good practice and he actually made us do it.  Eventually I learned to like the consistency of only using get/set methods when accessing class level variables.  However, in game programming, I've had lots of variables so far that are never accessed outside the class.  Should I only make get/set methods for variables accessed outside the class?  Do get/set methods hurt performance at all?

 

Thanks


Hello where do I find a team

22 April 2013 - 01:26 PM

Hi, I'm Joe.  I'm 19 years old, studying software engineering in college and getting into game development as a hobby.  Planning on doing it as a career someday too.  I made a few games in game maker in high school and I have a couple websites up that I just made in my free time for fun. I enjoy video games and staying up all night watching movies and long walks on the bea- wait

 

Anyway I was just posting here to introduce myself and inquire about what forum I should post in to look for team members.  I'm starting out in unity3d but idk what platform I'll be doing yet.  Just need a few artists, preferably one or more of the following: someone who can do 3D models, some kind of landscape artist, and a musician

 

Thanks a lot


Where would you rather live?

27 April 2012 - 04:34 PM

Silent Hill or Racoon City? Where would you rather live and why? You have no chance of escaping, nor contact with the outside world in either. You also have unlimited basic supplies in both (food, water, and weapons from shops)



Edit:

Also Racoon City has ALL the viruses, and Silent Hill has most of the enemies.

Silent Hill Dungeon Crawler Style

24 April 2012 - 07:47 AM

What do you guys think of the new Silent Hill game




I totally can't see this being scary, which is the biggest thing that attracts me to the other games. Hopefully this isn't the start of a genre change like resident evil

Edit:
On a side note, how did you interpret the bad ending of the first game where
Spoiler
. I took it to mean he was actually
Spoiler

PARTNERS