Author Topic: Lunar Domination  (Read 7475 times)

Valen

  • Full Member
  • ***
  • Posts: 117
  • Karma: 5
    • View Profile
Lunar Domination
« on: January 09, 2008, 04:59:24 PM »
Lunar Domination is a turn-based financial strategy game that runs on Windows, Mac OS X, and Linux. It uses RakNet for multiplayer.


Rak'kar

  • Administrator
  • Hero Member
  • *****
  • Posts: 6895
  • Karma: 291
    • View Profile
    • RakNet
Re: Lunar Domination
« Reply #1 on: January 09, 2008, 06:29:04 PM »
Great job!

Valen

  • Full Member
  • ***
  • Posts: 117
  • Karma: 5
    • View Profile
Re: Lunar Domination
« Reply #2 on: January 11, 2008, 04:17:03 AM »
Thanks! This should also once and for all answer the question "does RakNet work on Linux/Mac OS X". :) I've tested multiplayer between the different operating systems, and the only thing I had to fix was turning on "improve floating point consistency" in Visual Studio project settings. Without that setting, the peers went out of sync (when one peer was running on Windows and the other on Mac/Linux). Also, I'm using RakNet for the matchmaking/chat lobby server (a mini battle.net as I call it) which runs on a Linux server.

OvermindDL1

  • Anti-Spam Moderator
  • Hero Member
  • ****
  • Posts: 855
  • Karma: 40
  • Programmer
    • View Profile
    • OvermindDL1's Site
Re: Lunar Domination
« Reply #3 on: January 11, 2008, 04:22:30 PM »
Oh, fair-warning for anyone who changes the floating point consistency, if you use Direct3D as your 3d renderer, and not OpenGL, then D3D will reset the floating point consistency back to standard anytime a rendering pass completes, just be sure to set it back afterward (and renderers like Ogre3D will automagically do that for you).

darthdespotism

  • Not-a-newbie
  • *
  • Posts: 9
  • Karma: 0
    • View Profile
Re: Lunar Domination
« Reply #4 on: January 13, 2008, 09:01:39 AM »
Does it set the consistency back after rendering or while? Does this at all affect other threads? (RakNet runs in it's own thread, right? So it should matter when DirectX resets it)

Valen

  • Full Member
  • ***
  • Posts: 117
  • Karma: 5
    • View Profile
Re: Lunar Domination
« Reply #5 on: January 14, 2008, 01:02:31 AM »
@Overmind: what do you mean Direct3D changes it? It's a compiler switch not a runtime setting.

@darthdespotism: I don't know if this would affect RakNet itself, but the game does a lot of float calculations and this caused slightly different results being calculated on Windows peer compared to peer on different OS. Also this is only an issue for synchronous P2P not asynchronous, and doesn't affect client/server based games either.

OvermindDL1

  • Anti-Spam Moderator
  • Hero Member
  • ****
  • Posts: 855
  • Karma: 40
  • Programmer
    • View Profile
    • OvermindDL1's Site
Re: Lunar Domination
« Reply #6 on: January 14, 2008, 01:36:15 AM »
The compiler switch just sets the default value, which you are free to change inside your program by calling the correct functions.  And regardless what you set it to then at certain times during a frame in certain D3D calls it will happily switch it so 'fast', regardless of if you had it on consistent or whatever, and will not change it back, unless (and I just found this flag by searching around), you have "D3DCREATE_FPU_PRESERVE" set as part of the flag when you create the adapter device from the LPDIRECT3D9 interface, so something like "pD3D->CreateDevice( adapterToUse, devType, mHWnd, D3DCREATE_FPU_PRESERVE | extraFlags, &md3dpp, &mpD3DDevice );" or whatnot.  You do not need to set this (as it will slow down the frame switch slightly) unless you are using consistent, if you are on fastest then do not set it.

syedhs

  • Not-a-newbie
  • *
  • Posts: 41
  • Karma: 1
    • View Profile
Re: Lunar Domination
« Reply #7 on: January 16, 2008, 01:21:59 PM »
As for Ogre, you can always pass option "Floating-point mode", "Consistent" for the purpose to maintain the FPU mode. So I dont understand what the fuss is all about.

OvermindDL1

  • Anti-Spam Moderator
  • Hero Member
  • ****
  • Posts: 855
  • Karma: 40
  • Programmer
    • View Profile
    • OvermindDL1's Site
Re: Lunar Domination
« Reply #8 on: January 16, 2008, 04:51:24 PM »
The only thing that option does in Ogre is pass that flag to D3D create() or not, it does nothing else that I could find in the source, the overall floating point mode is setup by your compiler options, that option just lets D3D sustain it correctly.