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 04 May 2006
Offline Last Active Aug 01 2015 03:08 PM

Posts I've Made

In Topic: Trying to emulate "typical" internet conditions

29 June 2015 - 11:10 AM

Excellent explanation, thank you!

In Topic: Trying to emulate "typical" internet conditions

29 June 2015 - 04:05 AM

Yeah, the latency in SCE is one-way.



I don't think that's aggressive enough. I'd suggest upping packet loss to 10%, and round-trip latency to 250 milliseconds or more.


Well damn, seems I have my work cut out for me then.


Duplication and re-ordering are much less of a problem once a connection has been established...


Out of interest, why is this? Since I am using UDP there is no connection per sé from the network's point of view, right?


Thank you everyone!


EDIT: fixed typos

In Topic: Implementing multiplayer in MOBA-like game

28 June 2015 - 03:21 PM

There is nothing preventing you from writing the whole thing in Java if you want. There are OpenGL wrappers for Java that you can use for that.


However, if I understand correctly, you would like to have some sort of networking layer on the client, written in java, which would mediate between the server and the client front-end (written in C++ or something else)? Sure, that is possible but then you have three parties involved instead of two and that might not make it that much easier.


In fact, in my engine, the level editor front-end is written in C# and the main engine is C++, and I actually use the network to have the different parts talk to each other even though they both run on the same machine. I find this more elegant than marshalling memory back and forth, and while it makes everything asynchronous it has not been a problem for me.


If you just wrote your whole client in C++ and have it talk to the Java server you would be in the same situation where you just send bytes over the network and have the receiver do something with them, regardless of what language it happens to be written in. I don't really know what you mean by "C++ networking" since it is all about sending and receiving bytes, but there are a number of good networking libraries for C++ that can help you if you don't want to be writing pure socket code.

In Topic: Safe endian macro

06 April 2015 - 01:23 PM


This, of course, is going to break if (and when) a new architecture comes out that you haven't already accounted for.


How about just storing a number in a short or an int, then checking the value of it's bytes and converting if needed at runtime?  That's similar to the method used by e.g the Quake engine games and it will work irrespective of what future architectures might appear (https://github.com/id-Software/Quake/blob/master/WinQuake/common.c#L1127):

byte swaptest[2] = {1, 0};

if (*(short *) swaptest == 1)
	bigendien = false;
else bigendien = true;


Yeah, I vote for this as well. I just run the following at startup and leave it at that:

bool Endian::isSystemLittleEndian()
	short number = 0x1;
	char *numPtr = (char*)&number;
	return (numPtr[0] == 1);

In Topic: DirectX 11 UI Library

26 February 2015 - 01:03 PM


Some years ago I was in the same situation and I ended up writing my own system. That said, there are a few libs you can use. I have hade all of the following integrated into my engine at one point or other:


https://github.com/garrynewman/GWEN - GWEN is a very simple UI layer with nothing extra. I don't think there is a DX11 renderer, but it should be farily simple to implement.


http://cegui.org.uk/ - CEGUI has been around for a long time, it is mature and diverse, but perhaps a little old-fashioned. Also it tends to bloat your project quite a bit.


http://www.awesomium.com/ - Awesomium is really an offscreen HTML5 renderer rather than a UI library, but it can very well be used to do UI. In fact, that is exactly what I did and I enjoyed it quite a bit. However, I cannot use it anymore since they don't provide any 64-bit windows binaries. Also it is not open source.


Do you have any good links / resources you used when you built your own?



Well no, but it does not have to be that hard. For a basic UI system (my system is very basic) you have to be able to render screen space quads with alpha (preferably in a resolution independent manner) and text, you have to hook your input system to the UI somehow (how this is done depends on what kind of input device(s) you support, eg. mouse, keyboard, gamepad, touchscreen), and you have to be able to react to events happening in the UI somehow.


You can go the Unity route and make an immediate mode UI system where you mix your event handling code with the actual UI code or you can create a retained mode system where you hook up event handlers as callbacks. I did the latter and I recommend using fast delegates for that sort of thing if you are on C++: http://www.codeproject.com/Articles/7150/Member-Function-Pointers-and-the-Fastest-Possible


Of course, things get more complicated if you want animation support, transitions, auto-layouting etc. but you can go a long way with just quads and text, and you can always further develop the system later.