Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 03 Jul 2003
Offline Last Active Yesterday, 05:25 PM

#5312711 hiding a library's dependencies from users of the library

Posted by on 26 September 2016 - 01:12 PM

I'm not big on hiding this sort of thing from your customers. The code aspects aren't so great, but where you are really letting yourself in for a world of pain, is in needing to provide perfectly working development/release toolchains for every platform under the sun (i.e. you need to provide out-of-box toolchains for Android and iOS, since your customers can't get at the dependencies to do it themselves).

#5311130 Leveling up through mini-quests?

Posted by on 16 September 2016 - 03:32 PM

Ok, I see. To my mind that actually *reduces* the quest variety.


Instead of being able to take any quest that interests me, I'm going to need to reject all quests that don't contribute to a stat that further complements my chosen build.

#5311101 Mutexes and the render thread

Posted by on 16 September 2016 - 12:07 PM

In general, if you are working on the level of mutexes, you are approaching multiprocessing at too low a level.


What you almost certainly need here is one or more asynchronous queues. One queue to feed work orders for new chunks, and one queue feeding back the resulting chunks.


That queue may be implemented using mutexes, of course, but the important part is that they only lock accesses to the queue (not its contents), and work on the items in the queue never involves locks.

#5311098 Leveling up through mini-quests?

Posted by on 16 September 2016 - 12:03 PM

I'm not sure I understand the distinction. What's the difference between 'Quest: kill 10 Slimes' versus 'Quest: move 10 rocks', or 'Quest: wrestle 10 bears'?

#5308957 For casual multiplayer mobile game which protocol to chose UDP , WEBSOCKETS ,...

Posted by on 01 September 2016 - 12:30 AM

TCP and not much Efficient comparing to UDP

On a reliable network, the difference in efficiency between UDP and TCP is generally negligible.

If you expect severe packet loss, TCP can end up in a situation where it isn't making much forward progress. Which is where UDP can be preferable. But, whatever reliable UDP layer you build is going to run into similar problems delivering your control messages (even though many game packets can be sent in unreliable mode, some will still require acknowledgement) - UDP protocol design is a pretty advanced topic.

To obtain the best performance from TCP, make sure you disable Nagle's algorithm (the TCP_NODELAY socket option). This one setting is usually to blame for most of the apparent performance difference between TCP and UDP.

#5301809 Why didn't somebody tell me?

Posted by on 21 July 2016 - 01:21 PM

Are you symbolically linking 'bin' to "Program Files", or were you just explaining what 'bin' is, for conformist Windows-using lemmings like myself?

It would seem more useful to create a C:\bin directory, and then symlink every executable in C:\Program Files into that directory...

Then you set PATH=C:\bin, and you are cooking with (some sort of) fire

#5300200 When you realize how dumb a bug is...

Posted by on 11 July 2016 - 09:41 AM

Why would you leave your PC on for weeks continously anyway? ^^

I restart mine maybe once every couple of months (i.e. when an update forces me to restart). Otherwise it is just placed in sleep mode.

#5297610 Is there any reason to prefer procedural programming over OOP

Posted by on 22 June 2016 - 12:18 PM

And let's be very clear that 'implementation inheritance' (the 'extends' keyword in Java) is a very different beast than 'interface inheritance' (the 'implements' keyword in Java), with separate advantages and pitfalls.

In particular, most folks you will meet who are very anti-OOP are talking about implementation inheritance, and have no particular problem with interface inheritance...

#5297136 Planetary cloud rendering

Posted by on 18 June 2016 - 02:04 PM

BTW: I have been looking at volumetric clouds, but it looks like I wouldn't be able to use it planet-wide.....

You typically want to combine at least two methods. Flat textured cloud maps at extreme distances (standing on ground looking up, looking down from orbit), with volumetric clouds for closeups (i.e. flying through the cloud layer). For performance and visual fidelity, you might also need an in-between level of detail, using billboarded impostors of volumetric clouds.

#5297098 Why didn't somebody tell me?

Posted by on 17 June 2016 - 11:35 PM

C++ doesn't allow function-local classes with static members or template member functions.

I'm a little worried that anyone ever tried to do that...

#5296825 Dependency Management in a Cross Platform, Multi Developer Environment

Posted by on 16 June 2016 - 09:10 AM

As for the submodule approach, how do you handle dependencies that don't have their own CMakeLists.txt (to pick a well-known example, Lua), do you find a fork with a CMakeLists.txt (e.g. LuaDist/lua) or is there a way I can get CMake to figure out how to use their makefile (even as I'm typing this it sounds insane)?

For the most part, I just write the CMake file for them. It's rarely more than a handful of lines for something tiny like Lua, and most larger libraries seem to use CMake already.

EDIT: Further to that, how do you handle all of the set calls that need to be made to turn off features in your dependencies builds (e.g. building tests), doing it in the CMakeLists.txt is fine, but messy, is that just something you have to live with doing it this way?

The option() command is your friend:
option(BUILD_EXAMPLES off)
option(BUILD_CPU_DEMOS off)
option(BUILD_BULLET3 off)
option(BUILD_EXTRAS off)
option(BUILD_UNIT_TESTS off)


option(GLFW_BUILD_TESTS off)
option(GLFW_BUILD_DOCS off)
option(GLFW_INSTALL off)




#5296756 Dependency Management in a Cross Platform, Multi Developer Environment

Posted by on 15 June 2016 - 07:34 PM

These days I use the git submodule approach, with CMake wired up to build all the submodules too. It's a bit of a pain to setup, but it honestly works extremely well, provided you don't have source code licensing issues, or dependencies that need to be distributed as binaries...

On previous projects I have maintained pre-compiled libraries for each platform on a central server, and have each developer rsync them to their devbox on a nightly basis. Its not pretty, but it is very flexible and easy.

Ultimately, I feel like the answer may just be to use a better build system with dependency management built in. Java has Gradle, Rust has Cargo... for some reason C++ still limps along without anything.

#5296033 are vidgames disrespectful of player's time vs tabletop RPG's?

Posted by on 10 June 2016 - 06:14 PM

you're mining the dungeon for loot, and you've reached max encumbrance - time to go to the store and sell it all off.

I feel like this issue is just as easily solved by getting rid of encumbrance as a game mechanic.

One of the most frustrating elements of playing Diablo is town-portaling back every 10 minutes to sell off your loot. Or sorting your inventory at similar intervals to manually sift out the junk. Torchlight worked on this by introducing a pet you could send back to sell your stuff, but the travel time took longer the deeper you journeyed, to the point where you could refill your inventory before the pet returned.

Either automatically convert all items below my current level into gold, or provide me with a portable treasure smelter / pet furnace...

#5293386 how much PC do you need to build a given game?

Posted by on 25 May 2016 - 10:00 AM

but it seems there are more fundamental questions to be resolved first. such as does a given title even require an "average PC".  not all games are skyrim.

Why does it really matter, so long as your development PC is sufficient for the specific game *you* are building?

Last I checked, the actual "average PC" has a dual core CPU, 2 GB of RAM, and an Intel Integrated GPU. Steam survey represents a set of people who regularly play games on Steam, which pretty much guarantees a skewed picture of the world (most gamers, by the numbers, play browser and mobile games exclusively).

#5292831 how much PC do you need to build a given game?

Posted by on 22 May 2016 - 01:32 AM

one really needs the survey results from 2 to 4 years from now, not from right now

I'm not really sure that the average moves that much in 2-4 years. For GPUs the high end moves quite a bit in that time, but I think you'll find the low end doesn't move much if at all, and the midrange also moves pretty slowly.

CPUs barely move at all these days, my current CPU is a quad-core i5 from 4 years ago, and it's still running today's games on ultra settings. Storage has only changed in price/quantity since SSDs became mainstream. RAM gets faster and bigger over time, but realistically enthusiasts have had 8-16GB of whatever RAM their motherboard supports for at least the last 6 years.