Advice sought - porting game engine to 64 bit.
- chaosavy
- Silver Sponsor
- Posts: 578
- Joined: Mon Jun 15, 2009 8:29 pm
- x 64
- Contact:
Advice sought - porting game engine to 64 bit.
Hey guys - I'm the dev behind Void Destroyer 1 and 2.
Link to VD2 -
It's been a amazing ride with game dev, and I couldn't have gotten here without Ogre and it's community. The reason I was able to get so far was there were amazing free and open source sources I could use to help me make a game. Without this I'd probably give up and Void Destroyer 1/2 wouldn't exist. To make a long story short - I'm very weak on the behind the scenes elements as I'm self taught and my goal has always been to make games versus to learn how to make games (if that makes sense - learning came with it, but it wasn't the primary goal). When I started - I went from very basic knowledge of programming to making a game, and only really learning what I needed to know as I hit my next obstacle.
So here I am years later with a outdated 32 bit game engine and components.
Anyway - since releasing Void Destroyer 2 - my goal for future projects is to get the game engine to 64 bit. I've ran into some issues which I believe to be due to running out of memory. In addition I want to take advantage of newer versions of Ogre for speed and improvements (though this is a secondary goal).
So I'm looking for advice -
I'm currently using -
Ogre 1.9
CEGUI 0.7.9
Bullet Physics 2.82 (using btOgre)
Open AL 1.1 (using OgreOggSound)
Particle Universe 1.6 (I think this might be a big issue...)
With my primary goal of getting to 64 bit - can you offer me some advice?
With my secondary goal of getting to newer versions - can you offer me some advice?
thanks
Paul
Link to VD2 -
It's been a amazing ride with game dev, and I couldn't have gotten here without Ogre and it's community. The reason I was able to get so far was there were amazing free and open source sources I could use to help me make a game. Without this I'd probably give up and Void Destroyer 1/2 wouldn't exist. To make a long story short - I'm very weak on the behind the scenes elements as I'm self taught and my goal has always been to make games versus to learn how to make games (if that makes sense - learning came with it, but it wasn't the primary goal). When I started - I went from very basic knowledge of programming to making a game, and only really learning what I needed to know as I hit my next obstacle.
So here I am years later with a outdated 32 bit game engine and components.
Anyway - since releasing Void Destroyer 2 - my goal for future projects is to get the game engine to 64 bit. I've ran into some issues which I believe to be due to running out of memory. In addition I want to take advantage of newer versions of Ogre for speed and improvements (though this is a secondary goal).
So I'm looking for advice -
I'm currently using -
Ogre 1.9
CEGUI 0.7.9
Bullet Physics 2.82 (using btOgre)
Open AL 1.1 (using OgreOggSound)
Particle Universe 1.6 (I think this might be a big issue...)
With my primary goal of getting to 64 bit - can you offer me some advice?
With my secondary goal of getting to newer versions - can you offer me some advice?
thanks
Paul
Visit http://www.VoidDestroyer.com to check out my space sim project - Void Destroyer
-
- OGRE Team Member
- Posts: 1995
- Joined: Sun Mar 30, 2014 2:51 pm
- x 1075
- Contact:
Re: Advice sought - porting game engine to 64 bit.
CEGUI was ported to Ogre 1.10+. See their "v0" branch. I also updated all the remaining plugins you mention for Ogre 1.12 and you can find them here
https://github.com/OGRECave
Also most Ogre applications are built as 64bit nowadays, so there should be no problem. Did you run into anything specific here?
I think the largest obstacle with upgrading will be going from CEGUI 0.7 to CEGUI 0.8 as they changed API and file format there.
https://github.com/OGRECave
Also most Ogre applications are built as 64bit nowadays, so there should be no problem. Did you run into anything specific here?
I think the largest obstacle with upgrading will be going from CEGUI 0.7 to CEGUI 0.8 as they changed API and file format there.
-
- Platinum Sponsor
- Posts: 290
- Joined: Tue Jan 17, 2012 5:18 am
- x 67
Re: Advice sought - porting game engine to 64 bit.
1. upgrade the 32 bit game to the latest 32 bit libraries before porting to 64 bit. (you're going to get a huge performance boost on ogre 1.12+). this way your game still runs as you upgrade each piece individually.
2. if you don't already have a feel for what's taking up memory, i'd at least spend a little time investigating. it may be that your game has a huge scope so you have a ton of assets. it's still worth looking into. are you using dds with texture compression? (if not this can waste a ton of memory)
3. once you're happy with the latest libraries, i don't think porting to 64 bit will be much trouble. most of your code should compile as-is from 32 to 64 bit. most basic types are the same (float, int, etc) but pointer sizes are 2x. so if you're using reinterpret_cast or making assumptions on pointer arithmetic (ex. that it's 4 bytes instead of 8 ) then you'll need to fix these. the compiler will help with some and the debugger the rest . porting to 64bit shouldn't be that bad.
2. if you don't already have a feel for what's taking up memory, i'd at least spend a little time investigating. it may be that your game has a huge scope so you have a ton of assets. it's still worth looking into. are you using dds with texture compression? (if not this can waste a ton of memory)
3. once you're happy with the latest libraries, i don't think porting to 64 bit will be much trouble. most of your code should compile as-is from 32 to 64 bit. most basic types are the same (float, int, etc) but pointer sizes are 2x. so if you're using reinterpret_cast or making assumptions on pointer arithmetic (ex. that it's 4 bytes instead of 8 ) then you'll need to fix these. the compiler will help with some and the debugger the rest . porting to 64bit shouldn't be that bad.
- EricB
- Bronze Sponsor
- Posts: 360
- Joined: Fri Apr 09, 2010 5:28 am
- Location: Florida
- x 213
- Contact:
Re: Advice sought - porting game engine to 64 bit.
I ported GearCity over to 64bit a couple of years ago in prep for OSX shitcanning 32-bit. I also did the hassle of bouncing my OSX carbon code to cocoa and moving to CEF from Berkelium. Most of those pains were Apple induced and had nothing to do with Ogre.
The move to 64-bit is quite easy for Windows and Linux. I suggest bouncing up to at least 1.11, (Possibly 1.12). There will be a couple of things you'll have to change, but your compiler will catch it, you'll look it up here or on google, and then copy and paste your fixes to API breaks.
I did run into a few issues with changes to the resource management system, but I just reverted the function to 1.7 code to get the behavior I expected.
I did not upgrade renderer systems. Since I am the only person in the world unfortunate enough to be using QuickGUI in a shipped product, I wasn't able to bounce it up to OpenGL3 within my timeframe. The lack of Fixed Function Shaders broke it, and I couldn't get the RTSS to generate emulated ones for OpenGL3. So I am still using OpenGL1/2 and DirectX9. So your mileage may vary changing rendering engines, I didn't test em.
I still maintain my 32-bit builds on older versions of Ogre. The repo works out of the box on all OSs and Arches. It does take a few defines though, but nothing crazy.
I do recommend keeping the 32-bit build around if you're using Visual Studios (which I imagine you are, since it's a requirement for SteamSDK). You're going to run into users with horrific system setups, and they're likely to get "The Application cannot be started correctly (0xc000007b)" error codes when their machine tries to use 32-bit VS redistributables instead of 64-bit ones. Sadly, most users can't figure out how to fix it, even with directions. In which case, you just point them to the 32-bit build in the Betas branch as an option.
I upgraded from customized (backported bug fixes I needed) Ogre 1.7.1 in Windows, 1.7.4 in Linux, and 1.8.1 in OSX.
Here are my libs and frameworks:
Ogre3d
QuickGUI
OgreOggSound
Berkelium/CEF
SQLite
OIS
SDL (Linux)
GLFW (OSX)
AdvanceOgreFramework
And then the standard libs Ogre requires. There isn't any API breakage from the ~2014 ones I use for the 32-bit build and the 2018 64-bit ones. Although, Freetype has change font hinting sizes, so fonts are 2px bigger in later versions...
P.S. One of these days I will buy and play your games. When I am done making my games... I still maintain, you need to bundle 1 & 2 and give a 10% discount. Dunno why you haven't.
The move to 64-bit is quite easy for Windows and Linux. I suggest bouncing up to at least 1.11, (Possibly 1.12). There will be a couple of things you'll have to change, but your compiler will catch it, you'll look it up here or on google, and then copy and paste your fixes to API breaks.
I did run into a few issues with changes to the resource management system, but I just reverted the function to 1.7 code to get the behavior I expected.
I did not upgrade renderer systems. Since I am the only person in the world unfortunate enough to be using QuickGUI in a shipped product, I wasn't able to bounce it up to OpenGL3 within my timeframe. The lack of Fixed Function Shaders broke it, and I couldn't get the RTSS to generate emulated ones for OpenGL3. So I am still using OpenGL1/2 and DirectX9. So your mileage may vary changing rendering engines, I didn't test em.
I still maintain my 32-bit builds on older versions of Ogre. The repo works out of the box on all OSs and Arches. It does take a few defines though, but nothing crazy.
I do recommend keeping the 32-bit build around if you're using Visual Studios (which I imagine you are, since it's a requirement for SteamSDK). You're going to run into users with horrific system setups, and they're likely to get "The Application cannot be started correctly (0xc000007b)" error codes when their machine tries to use 32-bit VS redistributables instead of 64-bit ones. Sadly, most users can't figure out how to fix it, even with directions. In which case, you just point them to the 32-bit build in the Betas branch as an option.
I upgraded from customized (backported bug fixes I needed) Ogre 1.7.1 in Windows, 1.7.4 in Linux, and 1.8.1 in OSX.
Here are my libs and frameworks:
Ogre3d
QuickGUI
OgreOggSound
Berkelium/CEF
SQLite
OIS
SDL (Linux)
GLFW (OSX)
AdvanceOgreFramework
And then the standard libs Ogre requires. There isn't any API breakage from the ~2014 ones I use for the 32-bit build and the 2018 64-bit ones. Although, Freetype has change font hinting sizes, so fonts are 2px bigger in later versions...
P.S. One of these days I will buy and play your games. When I am done making my games... I still maintain, you need to bundle 1 & 2 and give a 10% discount. Dunno why you haven't.
- dark_sylinc
- OGRE Team Member
- Posts: 5299
- Joined: Sat Jul 21, 2007 4:55 pm
- Location: Buenos Aires, Argentina
- x 1279
- Contact:
Re: Advice sought - porting game engine to 64 bit.
It's as everyone already described.
Porting effort is minimal, unless you depend on a particular library (usually without source code access) which doesn't have 64-bit libs (or for some reason it's full of bugs in 64-bit)
If you hardcoded some assumptions e.g. like assuming that sizeof(size_t) == 4 or sizeof(int) == whatever, then of course you're gonna have a bad time.
Aside from that, there may be the ocassional pointer truncation bug, for which you can use OS-level tools or simple tricks to help you force allocations to be always above 4GB, which will trigger pointer truncation bugs immediately.
Raymond Chen has two articles about it. MEM_TOP_DOWN is a sure way of testing, although it's a system-wide setting.
Application Verifier also has some settings about it.
I recall macOS having some similar tools, but I forgot exactly where.
Cheers
Porting effort is minimal, unless you depend on a particular library (usually without source code access) which doesn't have 64-bit libs (or for some reason it's full of bugs in 64-bit)
If you hardcoded some assumptions e.g. like assuming that sizeof(size_t) == 4 or sizeof(int) == whatever, then of course you're gonna have a bad time.
Aside from that, there may be the ocassional pointer truncation bug, for which you can use OS-level tools or simple tricks to help you force allocations to be always above 4GB, which will trigger pointer truncation bugs immediately.
Raymond Chen has two articles about it. MEM_TOP_DOWN is a sure way of testing, although it's a system-wide setting.
Application Verifier also has some settings about it.
I recall macOS having some similar tools, but I forgot exactly where.
Cheers
- chaosavy
- Silver Sponsor
- Posts: 578
- Joined: Mon Jun 15, 2009 8:29 pm
- x 64
- Contact:
Re: Advice sought - porting game engine to 64 bit.
Thanks guys. I missed many replies here somehow.
I went down the path of working on two DLCs for VD2 and that took a ton of time, then I took some time off, then baby #2 arrived and after 3 months of not working my goal is to focus on porting to 64 bit. I don't think I'll have any of the "assumptions of 32 bit" type issues as I'm not even aware of those.
It sounds like I should try to upgrade to 1.1+ first with 32bit then compile to 64 bit.
My big question is where do I start - with the small stuff like ParticleUniverse/OgreOggSound (using the link from OgreCave to get the latest) or the big stuff like Ogre itself? Would the "small stuff" like an updated ParticleUniverse work with my older Ogre version?
I'm such a noob with this that I don't even know where to begin.
I went down the path of working on two DLCs for VD2 and that took a ton of time, then I took some time off, then baby #2 arrived and after 3 months of not working my goal is to focus on porting to 64 bit. I don't think I'll have any of the "assumptions of 32 bit" type issues as I'm not even aware of those.
It sounds like I should try to upgrade to 1.1+ first with 32bit then compile to 64 bit.
My big question is where do I start - with the small stuff like ParticleUniverse/OgreOggSound (using the link from OgreCave to get the latest) or the big stuff like Ogre itself? Would the "small stuff" like an updated ParticleUniverse work with my older Ogre version?
I'm such a noob with this that I don't even know where to begin.
Visit http://www.VoidDestroyer.com to check out my space sim project - Void Destroyer
- EricB
- Bronze Sponsor
- Posts: 360
- Joined: Fri Apr 09, 2010 5:28 am
- Location: Florida
- x 213
- Contact:
Re: Advice sought - porting game engine to 64 bit.
You start out like you were building your project from scratch.chaosavy wrote: ↑Thu Dec 17, 2020 9:59 pm My big question is where do I start - with the small stuff like ParticleUniverse/OgreOggSound (using the link from OgreCave to get the latest) or the big stuff like Ogre itself? Would the "small stuff" like an updated ParticleUniverse work with my older Ogre version?
I'm such a noob with this that I don't even know where to begin.
First you build Ogre depends,
Then you build Ogre.
Then you build your depends that require Ogre.
Then you build your client.
The last step is when you'll have to get your hand dirty. Everything else is just playing with cmake.
When you build your client, you'll relink the libs and headers, and you'll get a lot of compiler errors. You just go through and fix them all.
Then you play test to make sure things are right, and fix any issues that popup.
- chaosavy
- Silver Sponsor
- Posts: 578
- Joined: Mon Jun 15, 2009 8:29 pm
- x 64
- Contact:
Re: Advice sought - porting game engine to 64 bit.
Thanks, that's extremely helpful.
But!
That's not how I got started - I downloaded the OgreSDK and it had dependencies/CEGUI already in it. Without that = I don't think I would have been able to learn and make progress enough to made 2 games somehow. So basically I never learned those first steps - since I skipped over them via the SDK/etc.
But!
That's not how I got started - I downloaded the OgreSDK and it had dependencies/CEGUI already in it. Without that = I don't think I would have been able to learn and make progress enough to made 2 games somehow. So basically I never learned those first steps - since I skipped over them via the SDK/etc.
Visit http://www.VoidDestroyer.com to check out my space sim project - Void Destroyer
- sercero
- Bronze Sponsor
- Posts: 450
- Joined: Sun Jan 18, 2015 4:20 pm
- Location: Buenos Aires, Argentina
- x 156
Re: Advice sought - porting game engine to 64 bit.
Nowadays @paroj has made great progress to simplify the build of OGRE.
In windows when you configure the CMake the dependencies are automatically built so it is easier now.
In windows when you configure the CMake the dependencies are automatically built so it is easier now.
- chaosavy
- Silver Sponsor
- Posts: 578
- Joined: Mon Jun 15, 2009 8:29 pm
- x 64
- Contact:
Re: Advice sought - porting game engine to 64 bit.
So I tried asking on the CEGUI discord but didn't get a reply yet -
Maybe you guys can confirm before I get started -
Will Ogre 1.12 and CEGUI v0 and they will work together?
thanks again for all the great advice/guidence
Maybe you guys can confirm before I get started -
Will Ogre 1.12 and CEGUI v0 and they will work together?
thanks again for all the great advice/guidence
Visit http://www.VoidDestroyer.com to check out my space sim project - Void Destroyer
- spacegaier
- OGRE Team Member
- Posts: 4304
- Joined: Mon Feb 04, 2008 2:02 pm
- Location: Germany
- x 135
- Contact:
Re: Advice sought - porting game engine to 64 bit.
Oh, so the little framework I made way back then is actually used in a Steam game . Never knew that. Nice!
Ogre Admin [Admin, Dev, PR, Finance, Wiki, etc.] | BasicOgreFramework | AdvancedOgreFramework
Don't know what to do in your spare time? Help the Ogre wiki grow! Or squash a bug...
Don't know what to do in your spare time? Help the Ogre wiki grow! Or squash a bug...
- chaosavy
- Silver Sponsor
- Posts: 578
- Joined: Mon Jun 15, 2009 8:29 pm
- x 64
- Contact:
Re: Advice sought - porting game engine to 64 bit.
Both VD1 and VD2 use your frame work as well
Helped me out when I wanted to add a menu state before actual game play.
thanks
Helped me out when I wanted to add a menu state before actual game play.
thanks
Visit http://www.VoidDestroyer.com to check out my space sim project - Void Destroyer
- sercero
- Bronze Sponsor
- Posts: 450
- Joined: Sun Jan 18, 2015 4:20 pm
- Location: Buenos Aires, Argentina
- x 156
Re: Advice sought - porting game engine to 64 bit.
@spacegaier, your Advanced Ogre Framework is great!Oh, so the little framework I made way back then is actually used in a Steam game . Never knew that. Nice!
I don't have a game published on Steam but I am using it and it has been very helpful to build upon.
- EricB
- Bronze Sponsor
- Posts: 360
- Joined: Fri Apr 09, 2010 5:28 am
- Location: Florida
- x 213
- Contact:
Re: Advice sought - porting game engine to 64 bit.
We actually talked about this in the past on my thread for my game. You must have forgotten.spacegaier wrote: ↑Sun Dec 20, 2020 1:39 amOh, so the little framework I made way back then is actually used in a Steam game . Never knew that. Nice!
Although I have altered it a bit specific to my game, It was a very very good starting point for my project. The states stack works great for the room design I made. So thank you a bunch!
Sadly, room based/turn based systems are not liked by modern gamers.
The only thing I regret, Ogre wise, is replacing CEGUI with QuickGUI. Although I think at the time I started, you hadn't included any GUI lib in your framework. (And if memory serves me, I sorta just merged my own setup into AOF. ) KungFoo going awol really screwed me with missing features, which I'm sad to say, I never had time to implement. That code is very OO and different from how I program, so bug fixes, little features like HiDPI support, and fixing logic errors is about all I've done to it.
But yeah, you could say most of the "client side" is touching AOF. (I never did put multiplayer in, but the logic stuff is separate from AOF. Maybe someday...)
Eventually it'll all be FOSS'd when I retire or go out of business.