Homesource Forums

Homeworld Source Editing Talk
It is currently Thu Sep 21, 2017 2:32 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 18 posts ] 
Author Message
 Post subject: Placating /SDL
PostPosted: Tue Mar 20, 2007 11:27 pm 
Offline
Site Admin
User avatar

Joined: Tue Dec 14, 2004 12:41 am
Posts: 326
This I'm more familiar with than the OpenGL stuff :)

Here's what I'm currently puttering around with (mostly holdovers from the "Deprecating RGL" thread.)

1. Device enumeration code will now be limited to two devices: OpenGL and Software... and software will just be OpenGL without the hardware.

2. Homeworld spent a lot of time worryng about about available graphics features... and I believe that all the features in the old game are available in any current OpenGL implrmentation regardless of hardware. Therefore I'll enumerate all required features, check them against the OpenGL list and if they're there then all the searching and "If-Thens" related to such can go out the airlock and join /rgl in the void ()

devstats.dat to go. The differing graphics cards features not covered by OpenGL can be listed by OpenGL.
If the hardware can do it OpenGL should automatically use it.

reg leftovers to be be folded into Homeworld.cfg.

...

What have I forgotten? :)


Top
 Profile  
 
 Post subject:
PostPosted: Sat Mar 24, 2007 7:36 pm 
Offline
Site Admin
User avatar

Joined: Tue Dec 14, 2004 12:41 am
Posts: 326
Getting back to this now. Will be trying to deprecate reg as the first stage and seeing if there are any unforseen timing issues with reading reg data straight from Homeworld.cfg.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 26, 2007 7:35 pm 
Offline
Site Admin
User avatar

Joined: Tue Dec 14, 2004 12:41 am
Posts: 326
zapkitty wrote:
... Will be trying to deprecate reg as the first stage...


commited. reg is dead. long live Homeworld.cfg

... but undoubtedly the codebase is littered with registry holdouts. stay alert. trust no functions. keep your laser handy. the computer is your friend.

devstats.dat... you're next. :twisted:


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 27, 2007 3:21 am 
Offline
coder

Joined: Tue Nov 07, 2006 4:40 am
Posts: 236
Cool.

I dig those lovely 640x480 stunning graphics, but I can run the game in a slightly better resolution normally. :)

Unfortunately the game really, really must love that resolution because it keeps reverting back to it. :)

I guess the resolution details held in reg haven't quite made it into [homeworld.cfg] yet, or is my setup causing strange problems? :)


Aunxx


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 27, 2007 4:20 am 
Offline
Site Admin
User avatar

Joined: Tue Dec 14, 2004 12:41 am
Posts: 326
aunxx wrote:
I guess the resolution details held in reg haven't quite made it into [homeworld.cfg] yet, or is my setup causing strange problems?


Graphics? Who said anything about graphics? :P

More seriously, I must have gone on too late again. I distinctly recall multiple tests wherein the game initialized, altered, saved and then read the saved config file correctly upon restart.

Now it doesn't.

Something got lost in the translation and I'll see if I can find it again after I get some rest.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 27, 2007 10:18 pm 
Offline
Site Admin
User avatar

Joined: Tue Dec 14, 2004 12:41 am
Posts: 326
ack... apparently the working copy of whatever mess it was that I'd stumbled into was deleted when I was juggling stuff.

As for what I actually commited... er... no... that can't work. (stupid, I know... :oops: ) I'll either hash it out tonight or revert it by morning.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 28, 2007 4:20 am 
Offline
Site Admin
User avatar

Joined: Tue Dec 14, 2004 12:41 am
Posts: 326
What I was doing was having the two different arrays read and append the other at each write. Recipe for disaster I'm sure... :?

Upon sane (sufficient sleep) reflection I'll just use libconfig instead as it will standardize all configs, including mod configs, and covers all three current platforms...
...
... that is, unless we're going to have Yet Another XML Rebellion?... ;)


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 28, 2007 9:02 am 
Offline
coder

Joined: Tue Nov 07, 2006 4:40 am
Posts: 236
Hi.

I've moved the data directory value out of reg and into Homeworld.cfg.
I hope that this isn't a conflict with what you've been doing, so apologies if it causes you any problems.

I'm entertained about the idea of an xml config file, but it's not really all that practical is it? :D

Aunxx


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 28, 2007 11:24 am 
Offline
Site Admin
User avatar

Joined: Tue Dec 14, 2004 12:41 am
Posts: 326
aunxx wrote:
Hi.


Not now, but apparently I was on something good when I coded the mess I found in a temp directory. And I still have no clue as to what it was I actually commited... aside from assault and battery on defenseless types...

aunxx wrote:
I've moved the data directory value out of reg and into Homeworld.cfg. I hope that this isn't a conflict with what you've been doing, so apologies if it causes you any problems.


What?! You did something intelligent and constructive while I was on a bender? Shame on you! ;)

aunxx wrote:
I'm entertained about the idea of an xml config file, but it's not really all that practical is it? :D


Well, I've not worked with it much, just the end results... I shouldn't have made what could have been perceived as smart remarks about folks who would actually want to do the configs in xml.

... In fact, now that I think about it, someone here did present a prototype ship config file in xml a while back...

Diplomacy, thy name != zapkitty...


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 28, 2007 9:06 pm 
Offline
Site Admin
User avatar

Joined: Tue Dec 14, 2004 12:41 am
Posts: 326
Strictly for conversation. It has both deprecated settings we know are on the way out and imaginary stuff not even coded yet....

Code:
//--------------------------------------------
// Homeworld SDL Notional Configuration File
//--------------------------------------------

application:
{
// former reg values
    init:
    {
      deviceIndex = 1
      deviceToSelect = "sw"
      glToSelect = "libGL.so"
      screenWidth = 800
      screenHeight = 600
      screenDepth = 32
//    HW_Language = "Nekoslovakian"
       }

    gamedata:
    {
      HomeworldDataPath = "/mnt/drive/hwsdl/"
      modsDataPath = "/usb/quark/mods/"
      hw_extramusic = "/mnt/mp3/weirdal/polka/"
    }

    graphics:
    {
      effectsLevel = 0
      noLOD = 0
      detailThreshold = 100
      enableSmoothing = 1
      showBackgrounds = 1
      texLinearFiltering = 1
      enableStipple = 0
      enableTrails = 1
      noPalMB = 20
      etgDamageEffectsEnabled = 1
      etgHitEffectsEnabled = 1
      etgFireEffectsEnabled = 1
      etgBulletEffectsEnabled = 1
      etgHistoryScalar = 256
      InfoOverlay = 1
      fuzzyBlobs = 1
      InstantTransition = 0
      brightnessVal = 28
    }

    audio:
    {
      MusicVolume = 75
      SpeechVolume = 60
      SFXVolume = 75
      Equalizer0 = 0
      Equalizer1 = 0
      Equalizer2 = 0
      Equalizer3 = 0
      Equalizer4 = 0
      Equalizer5 = 0
      Equalizer6 = 0
      Equalizer7 = 0
      Voice0 = 1
      Voice1 = 1
      Voice2 = 1
      VoiceCommands = 1
      VoiceStatus = 1
      VoiceChatter = 1
      speakerSetting = 1
      NumChannels = 8
      AutoChannel = 0
      SoundQuality = 0
      opBattleChatter = 50
    }

    keybinds:
// these should be set as key names instead
    {
      NEXT_FORMATION = 9
      BUILD_MANAGER = 98
      PREVIOUS_FOCUS = 99
      NEXT_FOCUS = 118
      DOCK = 100
      SELECT_ALL_VISIBLE = 101
      FOCUS = 102
      RESEARCH_MANAGER = 114
      HARVEST = 104
      MOVE = 109
      NEXT_TACTIC = 93
      PREVIOUS_TACTIC = 91
      SCUTTLE = 115
      SHIP_SPECIAL = 122
      TACTICAL_OVERLAY = 301
      MOTHERSHIP = 278
      KAMIKAZE = 107
      CANCEL_ORDERS = 96
      LAUNCH_MANAGER = 108
    }

    mouse:
    {
      opMouseSens = 50
      invertMouse = false
      mouseButton1 = "retreat"
      mouseButton2 = "kamikaze"
      mouseButton3 = "betray"
      mouseWheelup = "scuttle"
      mouseWheeldown = "sellMothership"
    }

    player:
    {
      language = 392
      PlayerBaseColor = 4288782222
      PlayerStripeColor = 4294967295
      ColorsPicked = 0
      PlayerRace = 0
      PrevColor0.base = 4278190080
      PrevColor0.stripe = 4278190080
      PrevColor1.base = 4278190080
      PrevColor1.stripe = 4278190080
      PrevColor2.base = 4278190080
      PrevColor2.stripe = 4278190080
      PrevColor3.base = 4278190080
      PrevColor3.stripe = 4278190080
      PrevColor4.base = 4278190080
      PrevColor4.stripe = 4278190080
      TutorialNeeded = 1
      PlayerName = "Unmaned_Player"
      PlayerPassword = "fubgh"
    }

    multiplayer:
    {
      MultiPlayerLastMapID = 0
      MultiPlayerGameFlags = 0
      MultiPlayerNumComputerPlayers = 0
      MultiPlayerComputerDifficulty = 0
      MultiPlayerComputerHatesHumans = 0
      ResourceInjectionInterval = 0
      ResourceInjectionAmount = 0
      ResourceLumpSumTime = 0
      ResourceLumpSumAmount = 0
    }

    network:
    {
      FirewallDetect = 0
      zombieBotnetserver = true
    }

    gameplay:
    {
      ShipRecoil = 0
      Pauseorders = 0
      N-LIPSoff = true
    }
}


libconfig is proving problematic as it flatly forbids settings from having a period in the name... ala "PrevColor2.base"...

The others I've looked at use c++, which doesn't matter much to me but technically breaks the "C Only" guideline.

Still, I'll be fooling with them... in between naps... :)


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 06, 2007 2:44 pm 
Offline
Site Admin
User avatar

Joined: Tue Dec 14, 2004 12:41 am
Posts: 326
(there is a rustling in the codebase, and the zapkitty pokes his nose out of avi.c...)

aunxx...
avi.c
Code:
extern int MAIN_WindowWidth;
extern int MAIN_WindowHeight;


Did these need to particularly be ints? (I haven't gone over the avi code itself yet. ) The type itself doesn't matter to me, it's just that, like so much else in the codebase, the assigned types of the various incarnations of the WindowWidth, -Height , and -Depth functions bounce around apparently at whim... or maybe depending on which way the wind was blowing when each module was last touched :)

But as I'm now calling them all into a unified configuration function gcc is demanding that I stop playing games and stick to a type where feasible. If you need int for avi's it can be int. Right now I've got them as udwords. Let me know...

(... the zapkitty disappears into utility.c...)


Top
 Profile  
 
 Post subject:
PostPosted: Sun Apr 08, 2007 11:43 am 
Offline
Site Admin
User avatar

Joined: Tue Dec 14, 2004 12:41 am
Posts: 326
As the notional ship Homeworld SDL cruises through the void() an airlock door opens and a file called 'reg' is propelled overboard... followed by 'devstats.dat'... and the RGL software modes... and a box with "Lua" stenciled on the side... and dozens of directdraw and d3d functions and their defines... afterwards the airlock door shuts, barely missing the fingertips of '/rgl' which is still clinging to the outer hull for dear life...
...
... ...
...
... the airlock door opens again and a long pole with a hook extends outwards, snags the box marked "Lua", and draws it back on board. The door closes....


Top
 Profile  
 
PostPosted: Sun Apr 08, 2007 12:30 pm 
Offline
Site Admin
User avatar

Joined: Tue Dec 14, 2004 12:41 am
Posts: 326
While the svn server is down... and everyone is on spring break :)... I've been working up the configuration file code and doing general housecleaning (as described somewhat fancifully above.)

And I've reached the point where we really should move forward. Stuffing extra parameters into 'Homeworld.cfg' as aunx and I have been doing is at best a stopgap solution. The code that reads and writes that file was intended for a very specific set of .ini-style keys and values aimed at the scripting engine and was not really meant for the extra stuff it's currently carrying.

The solution would be to set up a multiple array file with appropriate functions for all the types of keys we want in the file and implement a regular configuration parser...

... and then I remembered... wasn't something mentioned, somewhere, sometime, about something called Lua...? Wasn't Lua supoosed to be a configuration language?.... :)

Satori.

While I'd just as soon lmop set it up officially when he's ready, I'm going to put it in /SDL for now ...


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 09, 2007 8:30 am 
Offline
coder

Joined: Tue Nov 07, 2006 4:40 am
Posts: 236
Code:
extern int MAIN_WindowWidth;
extern int MAIN_WindowHeight;


Still very much AFK, but I can't think why they're set to int. Think they may of been copied from elsewhere but can be changed to whatever you want. I think I was looking at if I could expand the size of the movie and I needed those. I think I also needed them for where in the screen the movie needed to be. Anyhow, I'm rambling so just set them to whatever type you require and if it breaks something I'll fix it. :)

Very busy re-writing the file processing to allow 64-bit compile. :)

Aunxx.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 09, 2007 9:26 am 
Offline
Site Admin
User avatar

Joined: Tue Dec 14, 2004 12:41 am
Posts: 326
aunxx wrote:
Anyhow, I'm rambling so just set them to whatever type you require and if it breaks something I'll fix it.

No need, after my obligatory nap I realized you might need ints for such math work so I changed all the configuration calls for window dimensions to ints... everything still works on this end :P

...

(Actually, the scariest cast for those is as GLfloats in the gl code... Decimated dimensions? Partial pixels? Fractal frames? :shock: )

...

aunxx wrote:
Very busy re-writing the file processing to allow 64-bit compile.


Woot!


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 09, 2007 11:43 am 
Offline
coder

Joined: Tue Nov 07, 2006 4:40 am
Posts: 236
zapkitty wrote:
Woot!


It's quite horrid but I'm getting somewhere.

The file loads seem to either expect a non-aligned structure for loading data (Which I sorted to allow the align-double option in the compile -- seems to make a small speed increase for me, but might just be my wishful thinking! :) )

Or, included in the file structure are udword values which are offsets within the file to data chunks, which are adjusted to pointers in memory. Once everything is "nicely" in memory the game should run, I hope, without much more alteration.
#include <famous last words disclamer.h>

:)

Aunxx.


Oh. Happy easter all. :)


Top
 Profile  
 
 Post subject:
PostPosted: Sat Apr 28, 2007 11:00 pm 
Offline
Site Admin
User avatar

Joined: Tue Dec 14, 2004 12:41 am
Posts: 326
In the meanwhile I've been working along several mini-branches of my own during the server downtime...

But as most of my older .cfg experiments will be overidden by the addition of Lua to the engine I don't know if any or none of the work is relevant in the short term. They all fall under the umbrella of "unused Win98, directx, d3d, and RGL software holdouts"....

I guess it will depend on how soon until lmop officially adds Lua :)

In increasing order of changes they are:
"no reg" (a no-brainer given sufficient naps...)
"no devstats.dat" (an afternoon's snooze...)
"no directx" (40 winks...)
"no d3d" (a couple of catnaps...)

"no RGL sw" ( a nights rest...)

The last one needs to be noted as RGL had specific software functions without GL equivalents that are invoked with a hardware/software case switch. I commented out the sw cases but left them in place as references in case they held relevant data for the OpenGL software mode I hope to put in its place. So that's quite a few single-case switches left lying around :)

Since then I've been working up a proper configuration utility using Lua...

Just thought I'd ask if anyone wanted any of this committed at this time, or should we wait for Lua?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 16, 2007 3:18 pm 
Offline
User avatar

Joined: Wed Feb 02, 2005 12:25 pm
Posts: 24
Location: Florida, USA
Thought I would comment on this.

I never realized how much garbage code you guys would have to cleanout to remove ddraw and the like.

_________________
Kiith-sa - Naabal Brotherhood
www.hwaccess.net


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 18 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group