Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!

1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


Member Since 06 Apr 2010
Offline Last Active Dec 09 2013 07:13 PM

Posts I've Made

In Topic: Warcraft 3 cliff and ramp rendering

19 May 2013 - 05:45 AM

Well, that's a good idea. I got a good idea to implement it now. But instead of stitch the terrain heightmap, I'll place a "parametrical model", which replace regular tiles. They will draw themselves based on the 4 corner values. Can't wait to implement it next week!!

In Topic: the cost of loop in glsl

06 April 2013 - 10:00 PM

to all, thx for the suggestion. I tried to gove +1 to all your comments, but I'm on mobile :(
anyway, I plan to use gl 2.0 to support a lil bit older hardwarr, and I heard the number of uniform is limited to 256*vec4. so I plan to pass quaternion as vec4 and position as vec3. I havent written the shader loader yet, no access to pc. I'm basically imprisoned in this barrack for the next 3 weeks. I'm curious if my quaternion multiplication will be faster than the built in mattix multiplication. I hope it would be.

In Topic: Recovering lost skills

28 February 2013 - 05:01 AM

thx for all the suggestions, seems I just need to warm up again with some simple projects. I kinda get the hang of this now. Btw what is the up to date library that people use for handling input, windowing, setting up opengl? I used sdl back then. I heard its development was stopped in some way.

In Topic: communicating between C++ server and Java client app

10 November 2012 - 10:03 PM

Firstly, I never code anything in Java and compile it in linux. And I'm mostly comfortable with C++.

Presumably you'll be getting fluent in Java as part of or before undertaking this project, in order to be able to write the client.

Plus I heard java is quite unsuitable for resource hogging, low-level task that most server do.

That depends on the nature of your game. I expect that for most games that are going to be completed by a single developer or a small team, Java will suffice.

Will all the clients in your game be connecting to one server instance / cluster, or do players create their own servers?

Yes, I'm learning Java right now, which is quite weird for some friends since the learning process seems to be "reversed" (they learn java first)

On my app, all clients connect to single authoritative server.

I don't think you'll run into perfomance problems by writing your server in Java (unless your server logic is filled with a lot of number-crushing stuff). Actually the newer JVM are high-optimized with server side in mind. Take a look at apache MINA, it's a framework to write scalable server software.

But if choose to write your server in C++ (which is a logical decision, as you're familiar with it), just write a low-level protocol (not using boost::serializable or any other fancy seralization library, using primitve datatypes always minding types size mismacht and using network endian order (big endian)) and you'll be fine.

this is what I'm planning too. I'll be serializing data and not just send the struct/class as "it is". Plus I'll be using htonl() and htons() etc to ensure byte order consistency.

What just happened right there? The client environment has nothing to do with the language the server is written in. IP derived protocols are platform agnostic. As long as you take control of your byte ordering and serialization you should be fine.

well thanks mate. You've just cleared some doubt here.

Btw, it turns out that java is a lil bit different in that it has no "globals". Gotta wrap the main function within a class, but I guess that's fine. I'm considering writing the server in java too. The curve might get a little steeper, but I'm willing to learn. Besides, this project is not too time critical. I do it in my free time only. I've seen several pros and cons of it. And I decided to stick with it. Anyway, thanks guys. I'll be reading a lot of stuffs tonight, and I'll be back here when things are getting too hard to grasp
Posted Image

In Topic: communicating between C++ server and Java client app

10 November 2012 - 08:21 AM

Have you considered writing the server in Java? This might simplify some things.

As for your questions:

  • 1. What experience do you have writing portable code?
  • 2. C++ does only gives minimum data type sizes, and does not guarantee byte order. You'd have the same issue writing a portable C++ client talking to a portable C++ server. The solution here is to define what the data should look like on the wire, and then ensure that each peer will correctly pack and unpack the data from this format. You can base the wire format on one that is convenient for one of the implementations (e.g. it might map directly to a big endian C++ unpadded structure written in terms of explicitly sized types).
  • 3. Java has various Socket classes. They are essentially an object oriented version of a berkley-esque API, so will not be dissimilar to WinSock. Probably easier, if anything.
  • 4. I have no specific suggestions, but I would say that if you're experienced in network programming then you probably don't need a book. There are lots of good examples on the internet that will get you up and running quickly.

Firstly, I never code anything in Java and compile it in linux. And I'm mostly comfortable with C++. Plus I heard java is quite unsuitable for resource hogging, low-level task that most server do. Correct me if I'm wrong Posted Image

1. I've written a simple platformer game using SDL and C++ and also a simple chat program, and port them to Linux (do they count as portable?)
2. The data would consist of header (id and size), and a stream of bytes following it. I'm mostly worried of endianness between platform/language
3. Hmm now that you've mentioned it, I've yet to see if it's supported in Android. I hope it is.
4. Posted Image