New RTS Settings ^.~ (It's not 3D perty, but it's perty)

New RTS Settings ^.~ (It's not 3D perty, but it's perty)

Discuss the source code and development of Spring Engine in general from a technical point of view. Patches go here too.

Moderator: Moderators

Post Reply
User avatar
deadram
Posts: 37
Joined: 25 Jul 2005, 15:55

New RTS Settings ^.~ (It's not 3D perty, but it's perty)

Post by deadram »

I'm starting this new thread because that glList stuff is done... and the settings project is started XD

I've set-up a temporary anonymous ftp server at ftp://216.58.14.250

tass.jpg is a screenshot of what the new settings program looks like ^.^
rtssettingsproject.zip is the VS.NET project
rtssettingsbinary.zip is the current binary

Please note that the server is going down whenever I feel like it, and I'm logging ~EVERY~ read you do, no writing for you!

---------------------------------
I'm not up on bbcode... but this is a quote XD

Alantai Firestar wrote in "new glList code to implement ~scrolling~":
MFC??? no no no no no no no. It's in our interests to code the program so that it can be integrated into spring in pregame.

Although, if you created a second version of the program that acted like a wizard and walked you through and selected the best settings and let you change them, you know explain, it could be called once installer has finished or on first run...

----------------------------------

Well, settings in the pregame 3D interface shouldn't be a problem. Infact that be a nice place to start the interface. As for the "settings" project being coded in MFC... MFC is... CString and then a bunch of hwnd wraper objects. For the 3D interface I'll have to code my own wraper gl objects for the buttons and such, so using MFC's API as a starting point will give me less name making up to do, and tells me what kind of events and properties buttons need and such. Never the less, coding the pregame interface in MFC would be silly, since we want this to port to linux XD

Now for all you who arn't coders, I could still use some help coming up with tooltips for all the options. Just send me an e-mail to dead.anti.ram.spam@gmail.com (No dots in my e-mail address :D). Or you can post it here :P
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

methinks posting an email address in that form is a bad idea. This forum is cataloged by google and if that's so then spam harvesters or unsightly forum goers would use it. There's a thread by cheery on this.

Although, if you could code in some rudimentary AI difficulty settings and tie it into the GlobalAI callback and settings.exe. TAI currently has difficulty as a natural consequence of parsing TAI AI definitions but it's hardset to "hard"
User avatar
deadram
Posts: 37
Joined: 25 Jul 2005, 15:55

Post by deadram »

Meh, good point, but I've gotten to the point were the tool tip is the text header beside the window control... but gmail is my ~extra~ e-mail address...

Also, seems that I'm having trouble getting the FTP server working... I'll be posting a mini website at http://members.fortunecity.com/2069/

If you really want to help with the tool tips then donwload and unzip the project file, then open rtssettings.rc in notepad. in this section:

Code: Select all

STRINGTABLE 
BEGIN
    IDC_EDIT_SCREEN_RESX    "ResX\nType your desired custom screen width."
    IDC_EDIT_SCREEN_RESY    "ResY\nType your desired custom screen height."
    IDC_CHECK_SCREEN_FULLSCREEN 
                            "Fullscreen\nWhen checked, this will cause the game to take up the whole computer screen."
    IDC_EDIT_PLAYER_NAME    "Player Name\nType the name you would like to use while playing TA Spring."
    IDC_SCRL_VIDEOD_TREEVIEWDISTANCE 
                            "TreeViewDistance\nLower numbers are faster, higher numbers have more detailed graphics."
    IDC_SCRL_VIDEOD_TERRAINLOD 
                            "TerrainLOD\nLOD = Level of details. Lower numbers are faster, higher numbers have more detailed graphics."
    IDC_SCRL_VIDEOD_UNITLOD "UnitLOD\nLOD = level of details. Lower numbers are faster, higher numbers have more detailed graphics."
    IDC_SCRL_VIDEOD_GRASSDETAIL 
                            "GrassDetails\nLower numbers are faster, higher numbers have more detailed graphics."
    IDC_SCRL_VIDEOD_MAXPARTICLES 
                            "Max Particles\nLower numbers are faster, higher numbers have more detailed graphics."
    IDC_SCRL_VIDEOD_UNITTEXTUREQUALITY 
                            "UnitTextureQuality\nLower numbers are faster, higher numbers have more detailed graphics."
END
add in the tooltips...

the "IDC_SCRL_VIDEOD_UNITTEXTUREQUALITY" is the resource string ID, but you can just put in plain text in there

for example: Unit Texture Quality "The quality of the skin used to draw units"
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

You should seperate video details into unit and map details, you should add the new settings from 0.60b1 aka terrain decals too among other things. And maybe an example picture of with and without, or the extremes, lets say for grass, an example of what it looks like with the slider at max and min.

Also is it possible to change windows registry values using java?
User avatar
deadram
Posts: 37
Joined: 25 Jul 2005, 15:55

Post by deadram »

Alantai Firestar wrote:You should seperate video details into unit and map details, you should add the new settings from 0.60b1 aka terrain decals too among other things. And maybe an example picture of with and without, or the extremes, lets say for grass, an example of what it looks like with the slider at max and min.
Sure, a screen shot of the setting on low and high would be great... But I'm not making them :P If someone sends me picktures and labels them, I'll add it in. As far as the placement of values, I'm just guessing, so if you have a list of "this should go with that" I'll make sure to look at it :) Ohhh and were do I get CVS access to get the latest options? XD
Alantai Firestar wrote:Also is it possible to change windows registry values using java?
Ummm, why would you use java? to run java people have to download an API, an API that comes preloaded with ad ware, spy ware, etc... Your computers security drops by 100% the instant you install java... java is the devil...

Now I'll be the first to say MFC is just as evil, but the project was already coded in MFC. If your thinking "OS independancy" then there are other APIs simular to MFC that are OS independant, but only M$ has a registry. If your going towards the OS independant way for the settings project, then it better to start planing for a init.ini file, and build a parser for that file, and so on. Simular to the regHandler, infact, it could probably just fit inside regHandler, with a few added preprocessor lines to see what OS we're in, and if in Windows check for a "use registry" "use file" key.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

Perhaps you shouldnt download Java from questionable sources then. Java is not loaded with masses of spyware and adware, that's on websites etc..

As for CVS access, Fnordia added a cvs tutorial in the wiki on howto access the sourceforge CVS in WinCVS, and there's numerous references to Tortoise CVS across the forum, specifically look at the thread entitled somehtign CVS in this forum, it'll explain the necessary settigns in tortoise cvs
User avatar
deadram
Posts: 37
Joined: 25 Jul 2005, 15:55

Post by deadram »

lol, I'm just say java is pure evil, like bill gates, or michel jackson. And as far as I'm concerned that "start here" or whatever it is that sun's java puts on your desktop is ad ware ;p

I thought came to mind... I used to play with tcl/tk, it's an OS independant scripting language with support for text fields and pulldown menus and such... Much like writing a web page, but it has piping support. We could use it to write a nice OS independant GUI frontend, and pipe the data into an OS dependant binary. The catch is that tcl/tk does require a download, no windows system come with it, and not all nix boxes come with it be default. I'll try to look into OS independant GUI APIs for an actual C++ project. We can use C's file API to write to an ini file, and just update regHandler, without changing the regHandler function names to support writing to files. Either way, this current project would make for a good "wizard" in windows ^.~

-------------------- Edit update ----------------
Here's the page separation I'm going to use... Gimme tips, new pages, more one one page, splitting pages up, whatever...

Code: Select all

		// Set this to say "we're been run"
		regHandler.SetInt("bRtsSettings",		1);

		// General page
		regHandler.SetString("name",			s.GetString());
		regHandler.SetInt("Fullscreen",			Fullscreen.GetCheck());
		regHandler.SetInt("XResolution",		atoi(text));
		regHandler.SetInt("YResolution",		atoi(text));
		regHandler.SetInt("InvertMouse",		invertMouse.GetCheck());

		// Map page
		regHandler.SetInt("TreeRadius",			TreeDist.GetPos());
		regHandler.SetInt("GroundDetail",		TerrainLod.GetPos());
		regHandler.SetInt("GrassDetail",		GrassDetail.GetPos());
		regHandler.SetInt("GroundDecals",		GroundDecals.GetPos());
		regHandler.SetInt("MaxParticles",		Particles.GetPos());
		regHandler.SetInt("3DTrees",			AdvTree.GetCheck());

		// Environment Page
		regHandler.SetInt("AdvSky",				AdvCloud.GetCheck());
		regHandler.SetInt("DynamicSky",			DynCloud.GetCheck());
		regHandler.SetInt("ReflectiveWater",	RefWater.GetCheck());
		regHandler.SetInt("ColorElev",			ColorElev.GetCheck());
		regHandler.SetInt("ShadowMapSize",		shadowMapSize.GetPos()*1024);
		regHandler.SetInt("Shadows",			shadows.GetCheck());

		// Unit Page
		regHandler.SetInt("UnitTextureQuality",	TextureQuality.GetPos());
		regHandler.SetInt("UnitLodDist",		UnitLodDist.GetPos());

		// Sound Page
		regHandler.SetInt("MaxSounds",			maxSounds.GetPos());
User avatar
PauloMorfeo
Posts: 2004
Joined: 15 Dec 2004, 20:53

Post by PauloMorfeo »

deadram wrote:... I'll try to look into OS independant GUI APIs for an actual C++ project. ...
I can think of GTK and the QT libraries.
GTK is already on many Windows that have, for example, GAIM, like mine and, as far as i know, in virtually all linuxes.
QT, the base of the highly famous KDE windows manager in Linux, is now free for Windows also.

The game Supreme Commander seems that it will use wxWindows. They were (still are?) looking for an experienced programmer in that area. That's got to count for something.

You can also check out GTK# for the mono project. I don't know if you want to work in C# but you can find a nice designer for GTK# in mono in the program X-developer (comercial with a 20 day trial period. It is multiplatform and works with MS.Net and Mono.Net).
User avatar
deadram
Posts: 37
Joined: 25 Jul 2005, 15:55

Post by deadram »

I'll look into wxWindows and GTK. From what I remeber, wxWindows is an OS independant wraper for pre-existsing APIs, meaning no additional downloads. If not I'll probably use GTK, but I'd hate to have KDE users unable to run it. Anyone know if wxWindows works the way I think it does? and if not, does GTK apps run on KDE?

As for C#... it scores a -10 on my list of "lauguages". Just so you know, java scores a -5... nuff said XD

BTW: adding the "wizard" part of the settings program made me resort the code, so that website's version is now very old, lol. On the bright side, It looks like adding in more options later will be easy (all the variables are loaded and set from one cpp file). I'll update what I have on http://members.fortunecity.com/2069/, but keep in mind, it's not functional XD
User avatar
Ace07
Posts: 348
Joined: 21 Apr 2005, 20:46

Post by Ace07 »

deadram wrote:I'll look into wxWindows and GTK. From what I remeber, wxWindows is an OS independant wraper for pre-existsing APIs, meaning no additional downloads. If not I'll probably use GTK, but I'd hate to have KDE users unable to run it. Anyone know if wxWindows works the way I think it does? and if not, does GTK apps run on KDE?
If you do not have QT and GTK api's in linux, you will not be able to run everything. Let me assure you that almost every distribution installs both, because one or the other isn't good enough anymore. If you want to run every gui application that you download, you are going to need both. As such, I wouldn't worry about people not having GTK.

wxWindows does require additional libraries unfortunately, but they are fairly small, and the many built in functions are extremely useful for cross platform situations. Good luck to you with the design and construction of this utility. Currently in the works on the Linux porting effort is an entirely new lobby with a settings dialog built in. The only thing I am concerned about with mine, is that it copies the old program too much.

http://saahost.hostrocket.com/spring-cl ... gs.6-7.jpg

That is a screenshot of the recent one....and if you want to help me out with this, you can redesign it if you want. I just hate to see so many coders start up their own projects only to find out that other farther along projects are already started and well on their way to completion. Here is the main wiki for the Linux porting project if you are interested:

https://opensvn.csie.org/traccgi/taspri ... .cgi/wiki/
User avatar
deadram
Posts: 37
Joined: 25 Jul 2005, 15:55

Post by deadram »

Keul, I'll see what I can do to help out with that project. At the moment I'm going to finish the settings project. It's gotten to the "copy and paste and ohh, what was that tag again" stage, so it should be done by later tonight. At the very least, it's good enough to run windows users through a wizard...

On that note, someone, please send me a list of tool tips XD Else we're going to have tool tips like "asdasdsad" and "qwerxsvcgredfs" which arn't terribly useful ;p
User avatar
deadram
Posts: 37
Joined: 25 Jul 2005, 15:55

Post by deadram »

Ok, the (partly) fully functional version of the settings "wizard" is out.

http://members.fortunecity.com/2069/

Still needs a few tweaks, including...
- gimme them tool tips XD
- make that combo box for the "screen resolution" actually have stuff in it XD

If you use this program, try to see if you can break it, or if it set's variables incorrectly (ie: my value for max sound becomes my value for texture details). If you want to re-enter the wizard mode, delete the following reg key: "HKEY_CURRENT_USER\Software\SJ\spring\bRtsSettings" or you can just set it's value to 0.

I'll get all the tool tips showing "asdasdasd" and the screen res combo box working by tomorrow :)

Ohhh, and should I add this to the CVS? Do I have permissions (erm... not a persons permission, but computer permissions as anonymous) I could submit it, through the "Submit file", or wait for a dev to download it XD

--- EDIT ---
(Still have some coffee to get out of my system XD)

Done...
- make that combo box for the "screen resolution" actually have stuff in it XD
- fixed a "bug" were after wizard runs the last page is set to the startup page.
- Added at the very least "asdasdasd" to all things that can take tool tips... It's up to someone else to make it have inteligeble text
- fixed another "bug" were the current value of a slider bar wasn't shown in the tool tip.

To do:
- make RegHandler OS independant
- fix the "used a keyboard" on a slider bar bug (tool tips don't update)
User avatar
deadram
Posts: 37
Joined: 25 Jul 2005, 15:55

Post by deadram »

Ace07 wrote: http://saahost.hostrocket.com/spring-cl ... gs.6-7.jpg

That is a screenshot of the recent one....and if you want to help me out with this, you can redesign it if you want. I just hate to see so many coders start up their own projects only to find out that other farther along projects are already started and well on their way to completion. Here is the main wiki for the Linux porting project if you are interested:

https://opensvn.csie.org/traccgi/taspri ... .cgi/wiki/
I've taken a look at the source to the lobby, but unfortunatly don't know python. Most of it is inteligable though, but you must have a 51" screen with 2048x1536 resolution, and font size of 2 XD lol, don't worrie, I code the same way, about 1/4 of the line is seen, and 90% of it is big long names :D

Anyways, like I said, no python for me, but I'm planing to re-write "RegHandler" into "StickySettingsHandler" with perty much same interface but OS dependant sub classes and OS independant code in it...

Code: Select all

#pragma once

#include <string>

class StickySettingsHandler
{
public:
	StickySettingsHandler(void);
	virtual ~StickySettingsHandler(void);

	// Get's void virtual's
	string GetString(string name, string def)				= 0;
	unsigned int GetInt(string name, unsigned int def)		= 0;

	// Set's void virtual's
	virtual void SetInt(string name, unsigned int value)	= 0;
	virtual void SetString(string name, string value)		= 0;

protected:
	virtual void GetIniFileLocation(void)					= 0;

// This is OS independant code to load and unload values from an ini file
	virtual void LoadIniFileString(void);
	virtual void LoadIniFileInt(void);
	virtual void SaveIniFileString(void);
	virtual void SaveIniFileInt(void);

	string	strIniFileLocation;
};

// The instance of this class is OS dependant
extern StickySettingsHandler*	g_pStickySettingsHandler;

#ifdef WIN32

	#include "StickySettingsHandlerWIN32.h"
	// Backwards compatibility
	#define regHandler				(*g_pStickySettingsHandler)

#else //#elif defined (GCC)

	#include "StickySettingsHandlerGCC.h"

#endif
Be nice if you guys used it/helped code it, since...
https://opensvn.csie.org/traccgi/taspring_linux/trac.cgi/wiki/ExplanationOfFileLayout wrote: /NewSpringClient: The newer portable version of the SpringClient. Eventually whatever is needed by the new client will be merged into the /SpringClient trunk, and this trunk will be removed.
From what I've hurd, python can make calls to c/c++ methods, so you ~could~ use the StickySettingsHandler in your project.
coryrc
Posts: 81
Joined: 01 May 2005, 23:09

Post by coryrc »

deadram wrote:I've taken a look at the source to the lobby, but unfortunatly don't know python. Most of it is inteligable though, but you must have a 51" screen with 2048x1536 resolution, and font size of 2 XD lol, don't worrie, I code the same way, about 1/4 of the line is seen, and 90% of it is big long names :D
It's mostly auto-generated, which is the reason for that style
deadram wrote: Anyways, like I said, no python for me, but I'm planing to re-write "RegHandler" into "StickySettingsHandler" with perty much same interface but OS dependant sub classes and OS independant code in it...

Code: Select all

#pragma once
#else //#elif defined (GCC)

	#include "StickySettingsHandlerGCC.h"

#endif
Actually, better to use ! _WIN32, since GCC can compile windows code.
And, sheese, get rid of those #pragma once's!!!
deadram wrote: Be nice if you guys used it/helped code it, since...
https://opensvn.csie.org/traccgi/taspring_linux/trac.cgi/wiki/ExplanationOfFileLayout wrote: /NewSpringClient: The newer portable version of the SpringClient. Eventually whatever is needed by the new client will be merged into the /SpringClient trunk, and this trunk will be removed.
From what I've hurd, python can make calls to c/c++ methods, so you ~could~ use the StickySettingsHandler in your project.
If you get it working nicely, it would be trivial to use from Python. Thank you. All I ask are no pragma's!
User avatar
deadram
Posts: 37
Joined: 25 Jul 2005, 15:55

Post by deadram »

Kai for now just
#ifdef WIN32
// windows stuff
#else
// nix stuff
#endif

and

#ifndef <filenames>
#def <filename>
// stuff
#endif

Should get the file started tomorrow, but I'll be busy till the end of the week, so I dono when it'll be finished.
coryrc
Posts: 81
Joined: 01 May 2005, 23:09

Post by coryrc »

deadram wrote:Kai for now just
#ifdef WIN32
// windows stuff
#else
// nix stuff
#endif

and

#ifndef <filenames>
#def <filename>
// stuff
#endif

Should get the file started tomorrow, but I'll be busy till the end of the week, so I dono when it'll be finished.
Yay! Thank you.
User avatar
deadram
Posts: 37
Joined: 25 Jul 2005, 15:55

Post by deadram »

I've got it started, and it looks like it's coming along nicely. I don't know what to do for the *nix section though, so if you know C++ or if python can become a "subclass" of C++ objects and then become created from C++, for example.

Code: Select all

#include "StickySettingsHandlerGCC.h"

StickySettingsHandler* g_pStickySettingsHandler = new StickySettingsHandlerGCC();
I'll leave the *nix section to you ;p
SJ
Posts: 618
Joined: 13 Aug 2004, 17:13

Post by SJ »

I added this to the cvs server on sourceforge. If you want to continue improving on it it could be usefull if you added such stuff as scroll speeds in different camera modes and default camera mode to it, and the bindings in spring to read those.
Post Reply

Return to “Engine”