Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


Member Since 04 Jan 2013
Offline Last Active Private

Posts I've Made

In Topic: constructor for class that contains another class and constructor C++

Yesterday, 09:16 AM

I personally dont like having vector classes derive from each other in that way. A 4D vector is not a 3D vector, its more like the 3D vector is a special case of the 4D vector.
Its easy to add a conversion constructor for cases where you really want conversion without needing inheritance and prevents loosing w silently.
Additionally, the natural form of a vector is IMO an array, not a struct. This allows indexing and cuts down on repetition from having getX, getY, getZ, getW, getU, getV, getR, getG, getB, getA, ...

Btw., why dont you use a premade library like glm or others?

In Topic: C++: Easiest way to implement an in-game Time/Date system?...

14 December 2014 - 04:22 PM

As for converting to milliseconds etc...
I currently add the time difference to a boost::posix_time::ptime object in milliseconds, so my function for getting ticks looks like this:

	QueryPerformanceCounter( &count );

	QueryPerformanceFrequency( &freq );

	return ( LONGLONG( 1000 ) * count.QuadPart )/freq.QuadPart;
Then I add the result of the difference between 2 readings, multiplied by interpolation, to the displayed time. There's nothing wrong with that, is there?

That is so wrong. The multiplication could overflow and you are wasting precision by converting too early.
Always keep the ticks as long as possible, subtract 2 tick values to get the time difference, then only on last moment before using the value for drawing convert it to milliseconds.

In Topic: Wouldn't this cause a memory leak?

14 December 2014 - 04:15 PM

If you have any doubt its leaking memory you better use one from the standard library instead. That looks like a bad list implementation anyway, as its traversing the whole list each time its adding a node, when it could cache a pointer to the last node or, depending on use, could just add the new node to the head.

In Topic: 30k concurrent players on a (private) MMO server...is this possible ?

14 December 2014 - 04:57 AM

In Ragnarök Online ground, walls, houses, trees and such are actually made of 3D. There are many hills (which are a good reason to prefer 3D), its relatively low-poly and you can sometimes find cracks revealing it.
Just the camera is rather restrictively fixed and you can only be rotated around your character, zoom a bit and change its angle slightly (that is one of the many things I heared some cheaters have hex-edited away). This is to hide that the server only sends data for characters and skill effects inside a square for about 14 tiles distance from your character (which can be seen when tilting the camera and looking downhill or having a widescreen monitor).
Monster, NPC, Characters and their accessories are 2D sprites though.
I've seen fights of 2-3 allys of 2-4 guilds per ally of 30-56 people each guild, all squeezed into 2 or 3 screens of space. Problems start when all are spamming skills up to 4 times a second (they made the mistake of including a 2 minute area spell reducing cast times and skill delays for everyone inside), which are often area spells that get send per tile. Then the server is struggling, its discarding skill effects revealing holes, discarding skill commands, queuing move clicks for too long and ultimately disconnecting everyone lagged more than a minute, sometimes silently making the client hang, all while the monsters whack away at the player characters.
Additionally, rumours are going around the server is not optimized well.

Therefore more than 16-32 people per map should certainly be possible for your game if done carefully enough.

In Topic: Anyone using the Open Source "Brackets" Code Editor (By Adobe)?

13 December 2014 - 07:42 AM

Then I need to rightclick on the project name and choose Java 1.7, but it never remembers this setting. Any idea?

No idea, when I set the target runtime it sticks to whatever I set it to. IIRC, target runtime is stored in the Ant build script or some config file there, you might want to check that out. Are you sure your install isn't bugged somehow? I used Netbeans 8, SE release, although I'm on Debian, not Windows/OSX.

Well, I'm using build.xml and project.xml created by someone else. Netbeans is 8.0.2.
For compiling and running it uses the correct value from build.xml, but I found another setting in project.xml for the compatibility warnings generated by the editor. After changing it in netbeans project properties a "saving project" popup appears for a moment, but is not actually changing the value in the file.
I resorted to hand-editing the source-level tags in there from 1.5 to 1.7, but no luck, they must have forgotten to update something, as it then regards the project as invalid and in netbeans log file it shows a SAXParseError. I also tried 7 and 1.6 for the value, but they also dont work.