Pages

Pretensions of objectivity must be left at the door, clothing is optional...

My Poems - My Music - My Paintings - My Serialized Novels

The Wholy Order of The MEEK
An Atheist Pagan Hymn
My first book of Atheist Spirituality
What Canada REALLY NEEDS !!
SG Atlantis and their Unethical BS
Ring of Corruption

"All that is valuable in human society depends upon the opportunity for development accorded the individual."-A. Einstein

"Ain't it funny how the factory doors close, around the time that the school doors close,
around the time that a hundred thousand jail cells open up to greet you, like a Reaper...." -Zack de la Rocha

They say "Sing while you slave!", but I just get bored... -Dylan

"It's NOT a 'War on Drugs'. It's a war on Personal Freedom.Keep that in mind at ALL times" - Bill Hicks

"Opinions are like assholes, everybody has one" - Anon

"I'd get pretty bunged up without my asshole" - C. Taylor

"If you're going to tell people the truth, make them laugh, otherwise they'll kill you" - O. Wilde

"It is likely to excite dissatisfaction against government and incite people to non co-operation..."

Sunday, May 22, 2016

Low end game design - The Mac OSX version!

So I just got a used mac laptop that is actually about as fast as my desktop but doesn’t have quite as good of a video card for games.
But, it works.
Macs are a variant of Unix, and they use OpenGL.
Which is why I chose the Idtech 4 Doom 3 GPL engine in the first place.
It can be compiled on linux, windows, mac and ios in both 32 and 64 bit and uses OpenGL instead of the horrendously bloated and proprietary microshit directX.
So my mission at the moment was to set up the mac laptop so I could work in the development environment for the doom 3 engine, which, from this point forward I will call Shadow, because I will be using an open source fork built executeable which has no cdkey or original game assets.
That’s the project I’m working on, stripping off the commercial assets from the game and making a base set that is useable and runs on win/lin/osx with the right binary/exe/app. After I get a base set of simple menus, including the options menu which is my current snag, and a base hud, pair of player hands, player model that can be seen by another player or in a mirror, and a basic room and perhaps a couple of basic items like flashlight and pda I will then endeavor to get a map editor to run on each platform for it, and finally create a simple modular structure for people to add objects where all assets for a monster/moving object/npc/gui are in one single pk4 instead of spread out in different folders.
Whew.
Simple project definition synopsis eh?

So, can I do a big chunk of work on the much more portable mac instead of my faster but monstrous desktop?
 
First I had to test the commercial game on the mac.
I’m not using the steam version because I dev offline, so I basically have a Doom 3 folder that works wherever I put it in a windows environment.
I also managed to snag a dvd version of the ppc mac app of D3. Which was interesting, because I learned that the “Base” folder that holds the textures/models/maps/etc. is the same between all 3 platforms with just a single dll change between them, so every asset works with each platform. The menus, models, intros, maps, etc. stay the same and there is a single program file or app for each 32/64 win/lin/osx/osx ppc/ios you want it to run on. The game engine never really changes, just all of the other assets you build around it.

I knew I wanted to run a windows .exe on my mac so I installed crossover. Wine is just as good though. Using a win7 crossover “bottle” I dropped in my Doom 3 and tested it, then made a second editor shortcut and tested that.
The editor is run by going {“c:/doom3/doom3.exe” -editor }in the shortcut.
Everything ran smoothly with some minor tweaking of the .cfg to get a better display mode. I had to make a file called autoexec.cfg in the base folder and add these lines:

seta r_fullscreen "1"
seta r_customHeight "800"
seta r_customWidth "1280"
seta r_aspectRatio "1"
seta r_mode "-1"
set com_allowConsole "1"
bind "DEL" "quit"

This sets the width and height for the mac screen, sets the aspect to 16:9, enables custom mode and puts the  “allowconsole” in that gives us a command line access from in the game using the tilde (~) key to use development commands and load maps.
The editor runs fine and so does the game for me on a macbook core 2 duo 4g-ram with an intel x3100 vidcard. Options tweaking was necessary but everything runs.
Except the GUI editor.
Erg.
The GUI’s in the engine are a strange beautiful ugly thing. Designed by programmers who like to type coordinate systems to define everything. I am a wysiwyg person, so I am instead going to work with simple menus at first until I can convince someone to help me get an html import library hooked into the binary. Then we can rock.
Until then I apparently have to get something called “QT Designer” which is a linux window manager widget toolkit. Say that while eating peanut butter.
Apparently you can draw out your gui elements and import gui images and create a gui within this “QT Designer” that will work in the Shadow engine, with minor modifications.
This is good.
Unlike the UDK or ValveSource, there is very little documentation and no “wizard” tools, the GUI editor being broken.
And GUI materials make up your Intro to the game, your Main Menu, your Options screen, your game loading screen, your personal in-game HUD, and things like PDA or Objective/Quest/Inventory screens, so a tool to import and place art assets with controls and timing mechanisms is crucial. Flash works, but I am avoiding proprietary formats and tools as I am making a GPL package of this base Shadow engine so all assets in it will be free to use and the basic tools as well.

I try out the PPC version of Doom3 as well and it works, until I need to upgrade into lion in order to get the right Xcode working. Then it doesn’t work, but in the time it was working I managed to see that it was ok, I could work on all menus/huds/etc. and everything else using the base win32 engine that runs in wine/crossover, and later I can get the new final binaries for the other platforms, but I can continue to develop it.

Once I got Snow Leopard up to Lion, I could install Xcode 4.3 which was necessary to compile an Intel OSX version of the “app”. I got the source for OSX intel which was modified and fixed by a programmer named Fabian for xcode 4.3.
He also helped me in an email, with a simple fix:

It should be:                     return [self cglContext];

at the single critical error point, and that simple thing worked. I was able to compile the doom 3 osx source into an app, it didn’t run but it compiles, and that is a very fine start.

I would eventually like to move away from xcode because it is very large and bloated, not as much as visual studio with direct x sdk, but still.

I have Codeblocks running and I believe I can build a set of crosscompiling toolchains (I have them installed but not fully configured)that will allow me to cross compile the binary application (which is about 20 megs for each platform binary)on the mac osx machine.
For now though, I am in contact with different people who can supply me with compiled binaries for each platform and I will continue to build the core asset set.
Before I could really work though, I found I needed a better text editor. “Textedit” on a mac is a putrid thing.
Putrid.

On win I use Notepad++
On mac, for free, I settled on Brackets and Bluefish for editing source or other text files, and Seamonkey for pure HTML.
Brackets is simple and doesn’t have any extras. You can view 2 docs at once and browse the file folder tree on the left, which is what I needed to look at dozens of docs one at a time. Some UTF encodings or file would open funny and that’s why I kept the Bluefish, it’s an html editor, but it opens other text and code files regardless of their extension, while brackets would argue about opening some things.

While getting around and looking at files I found early on that I needed to see the hidden files on the mac, hidden in the finder. A bit sluggish, but otherwise perfect for the job is the free version of MacExplorer. This allowed me to look in Users/CDT(me)/Library/Application Support/crossover/bottles/ which is where the game files have to be in order to run in the wine “bottle” as if in windows.
Once in there you can make an “alias” to the base game folder so you can pop into it and look/mod etc.

I needed a good file browser, and again the mac gives us the disturbingly useless “preview”. Do yourself a favor if you are a mac head or know one. Switch to XnviewMP where I guess the MP stands for “multiplatform”. I have been using this one on windows for years, it has a great browser thumbnail view that’s customizeable and it will do a quick slideshow of a folder. Even better for our purposes with the Shadow game engine is thae fact that it will view and COVERT to and from the .DDS format, which can significantly lower the filesize of your in-game textures, especially the normal maps. And its free.

Of course, being stuck on the mac, I needed to listen to some music. I find ITunes bloated and the new interface sux. I use winamp when I want to get away from it. You can find an OSX version on CNET.
If you work with game design, you will want 3D coat, and maybe Zbrush, Silo and Lightwave, and even Maya are all stable on OSX. Blender OSX works great and the io_scene.py md5 exporter works perfectly.

I had to do a lot of FTP (file transfer protocol) to get stuff off my mac and onto storage on the PC, and of course I used Filezilla like always, I find it easier than filesharing setups, running SimpleFTP on the PC and filezilla to connect from the mac. It’s a lot faster. Utorrent is the king for torrenting.
I have some problems with Safari as well, so I settled on Opera, as firefox is a bit clunky these days, but I keep all 3 on hand, I just pretty much use opera tho.
CCleaner is available for the mac and manages to clean a couple of gigs of cache for me once a month, gimp and openoffice work fine on osx.

A tool I found indispensible for trimming down the core assets of the game was Disk Inventory X. It gives you a visual scan of the files in a folder so you can see what is taking up the most space, and you can delete big chunks from within the app.

The best utility tho, is this Butler thing. It’s a bit tough to figure out at first how to customize it, but it is absolutely great.it lets you use the top finder menubar empty space to put drop down lists of your favorite files and folders. Completely custom drop down lists. You can also assign shortcut keys to any programs or files/folders, so I have two versions of the game engine that I can each load with a two finger keystroke, and I can do the same with brackets and xnview, etc. It is such a time saver, I spent a lot of time setting it up and it really saves me a lot of headaches.
If you use a mac, you can change your icons. I do it fanatically. I browse my downloaded icon packs with xnview and copy – paste into the little icon on a folder or file and suddenly it looks how I decide. It’s such a small thing but it really matters.

I was even able to boot up to Linux Mint live disk off a USB key using a tool called Mac USB Loader. Make sure you format your key to “GUID” in disk util partition options first! It works great.

Of course, I need to test things for each platform, and if you have the cpu power and ram you can run windows and linux build/test environments in Virtualbox (also free).

So using these tools I started to study the layout of the game files and strip it down to a core set of assets necessary to go through an intro screen, a menu and options screen, the standard save/load typre screens, a new game intro, a loading splash for maps, and a basic room with the hands and the player.

The games assets are 4+ gigs. Quickly stripping down the maps/models/textures/etc. I managed to get it down to 102 megs uncompressed, 27 megs compressed for the core “base” folder. That took 5 days. I am in the process of stripping it down more and studying the core assets and guis. I was able to find another guy’s work where he stripped everything out, but he actually went a bit too far I think, and I am trying to make sure people have something that will work out of the box for people. So I am still working on it with a month or two to go at a more cautious pace since I am at the stage where small changes break everything and I have to hack and slash about within the gui scripts.

So.
That’s what I’ve been doing.
With my  “Time”


 

No comments: