Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - silnarm

Pages: 1 ... 4 5 6 7 [8] 9 10 11 12 ... 55
176
General discussion / Re: Making the AI constantly Attack?...
« on: 15 April 2011, 06:50:02 »
another crash fix was required, and it was using an evil M$ extension to std::map<>  :|

Ai::evaluateEnemies() now looks like this:
Code: [Select]
void Ai::evaluateEnemies() {

// 1. maintain knownEnemyLocations
// remove if enemy building is dead and visible, null Unit pointers if dead and not visible
const int teamIndex = aiInterface->getFaction()->getTeam();
UnitPositions::iterator it = m_knownEnemyLocations.begin();
UnitPositions::iterator itEnd = m_knownEnemyLocations.end();
vector<Vec2i> remList;
while (it != itEnd) {
const Vec2i tPos = Map::toTileCoords(it->first);
bool canSee = g_map.getTile(tPos)->isVisible(teamIndex);
bool dead = it->second == 0;
if (canSee) {
if (dead || it->second->isDead()) {
remList.push_back(it->first);
}
} else {
if (!dead) {
if (it->second->isDead()) {
it->second = 0;
}
}
}
++it;
}
foreach (vector<Vec2i>, it, remList) {
m_knownEnemyLocations.erase(*it);
}

// 2. refresh visibleEnemies and closestEnemy
m_visibleEnemies.clear();
aiInterface->findEnemies(m_visibleEnemies, m_closestEnemy);

// 3. update knownEnemyLocations with any previously unseen enemy buildings
foreach_const (ConstUnitVector, it, m_visibleEnemies) {
const Unit &enemy = **it;
if (enemy.isBuilding()) {
Vec2i bPos = enemy.getCenteredPos();
if (m_knownEnemyLocations.find(bPos) == m_knownEnemyLocations.end()) {
m_knownEnemyLocations[bPos] = &enemy;
}
}
}
}

177
General discussion / Re: Building a release version
« on: 15 April 2011, 06:41:47 »
Hi Matt,

  With each freshly generated exe, there will also be a glestadv.pdb, this needs to be with the executable if you 'relocate' it.

Cheers.

178
General discussion / Re: Cannot build secondary Mage Tower
« on: 15 April 2011, 06:38:54 »
I was so close. Silnarm reverted the changes when he merged widget_invert to master so it should work now.

Yeah, sorry about that, we'd modified the same functions fairly heavily... got messy.

Feel free to re-tidy, the translated Vec2i as ref param you had for the bounds check was nice, my slightly less clean version was to add Widget::isInsideBorders() ... maybe modify it as such.


179
Bug reports / Re: widget_invert branch won't build
« on: 15 April 2011, 06:32:11 »
I'm currently having this build error on the widget_invert branch:
Code: [Select]
[ 33%] Building CXX object source/game/CMakeFiles/glestadv.dir/test_pane.cpp.o
[ 34%] In file included from /home/tomreyn/SCM/glestae/source/game/menu/main_menu.h:18:0,
                 from /home/tomreyn/SCM/glestae/source/game/test_pane.cpp:13:
/home/tomreyn/SCM/glestae/source/game/world/world.h:172:6: error: declaration of 'Glest::Sim::Map Glest::Sim::World::map'
/usr/include/c++/4.5/bits/stl_map.h:87:5: error: changes meaning of 'map' from 'class std::map<int, std::basic_string<char> >'

Thanks, there was another nastier one after that too, I thought I could just erase from a map<> and get back an iterator to the next element, like with a vector<>. This is not the case, but I didn't know that because someone in Redmond thought that made sense too... Ooops.

btw, widget_invert is merged to master now.

180
should be fixed now that widget_invert is merged into master, though we've lost the custom cursors . . .

182
General discussion / Re: questions thread
« on: 10 April 2011, 03:50:23 »
see also, load and unload commands on the wiki.

183
Hi guys, quick tip... Use,

Code: [Select]
gluErrorString()
  on those error codes for potentially meaningful info  :)

184
Any idea what may be wrong?

GL balked while were copying (or attempting to) texture data to it... unsure why, but I've replaced that not so informative error message with a much nicer one, so if you are on the widget branch, could you pull the latest changes and try again, if just for a more informative error message?

I noticed your MG topic (having the same issue) in the info their error message supplied I did notice the texture dimensions were 750x750... not powers of two... might be an issue with those drivers?

Anyway, try the latest and see what it says, should provide more info, I'm asking through glu what that error number MG reported means, so it should be a little nicer ;)

185
General discussion / Re: Making the AI constantly Attack?...
« on: 8 April 2011, 11:44:23 »
Yes i'm using the version downloaded from git svn, so how can I easily put this in AND not destroy the code I have already added/edited?

That depends, svn and git are two different version control systems, we switched from svn to git not so long ago. If you've been modifying a clone of the git repository then things can be updated easily enough, by committing your changes then doing a 'git pull', although these AI changes I made are actually in a branch, which complicates things... hmm, maybe the process is not entirely trivial (in fact, with all the logging changes I made there would probably be lots of conflicts git couldn't resolve itself, so this would be a bit of a pain).

Maybe just copy and paste from those diffs ;)

Quote
Although I think i'll keep the new code you've done seperate from the 'normal' AI when I downloaded it so that only the aggressive AI works off this code (just a couple of if statements should sort that).

Just one should do it, I'm not sure whether this will be enabled for the forthcoming release, in that patch you will find (in AiRuleMassiveAttack::test()) the following, if (true != false) { :)

186
General discussion / Re: Making the AI constantly Attack?...
« on: 8 April 2011, 09:43:55 »
I've been trying to use the MassiveAttack function to force the AI to attack more often with a particular AI, which isn't working too well at the moment.

Hi Ildiz,
 I've been cleaning in the AI code recently, and after I first saw this thread couldn't help tweaking...

There was a member of Ai 'knownEnemyLocations' (except with a typo), that was unused, I changed its type(def) to a map<Vec2i,const Unit*>, the 'massive attack' rule is called every second (at normal speed), so I 'maintain the list' then (err... map), adding newly visible enemy buildings and have it refresh the map<>, removing entries for buildings that are dead and visible, and nulling the unit ptr if they are dead but not visible.

The rule test proceeds as normal, but if baseIsStable() && !beingAttacked() then it will blindAttack() to a known enemy building location.

initial commit.

unfortunately I messed it up of course, so see also this one line fix.

If you have them harvesting and producing like mad, adding this will surely make them very aggressive  :-\

I also fixed up the AI logging lots very recently, are you running from git?

187
General discussion / Re: Bug with object names translations?
« on: 1 April 2011, 14:10:49 »
...next part: what is the "official" (correct? usual?) way to send my translated files in order to be included into version of Glest tested by the community?

errr... we don't have one! But it will be nice to come up with one and ship with some proper translations :thumbup:

Probably the best bet is to open a ticket, make the 'summary' something like 'Italian translation for 0.4' and set the Milestone to 0.4, (type = 'patch' is perhaps most appropriate). And then attach the files to the ticket.

I like tickets ;), a ticket with milestone 0.4 can't be forgotten, because we can't release without closing that ticket (in this case, adding your lang files).

188
General discussion / Re: GAE Crash Report
« on: 1 April 2011, 14:03:41 »
Quote
Are you running the latest version? The commit hash is from 40 or 50 commits ago.
Nope I'm running that version you see there.

Presumably a snapshot I dumped in the Constellus drop-box a month or so ago... try the one hailstone posted...

Quote
Quote
Do you have mouse.png in data/core/misc_textures/ ?
Nope.

You do. Its in the gae-new-data-xxx.zip in your addons.


189
General discussion / Re: glestadv.ini documentation?
« on: 1 April 2011, 13:54:29 »
Hi folks,

I was looking into tweaking my configuration a little so that GAE would run a bit faster on my Intel GMA. Is there any documentation of glestadv.ini available?

Hey tomreyn, apart from what hailstone has already said there is little I can add in regards to ini settings, starting the game with '-test tr2' will get you the new terrain renderer, which is much faster, and known to be stable... on small-to-medium sized maps ;)

The fact that assert()s are being compiled in on 'release with debug' on linux is probably the biggest problem, we/I assert like crazy (RelWithDebInfo on windoze does not compile in asserts), so a lot of the newer code is probably running quiet slowly on such builds.  Obviously a 'full blown' release build (-DCMAKE_BUILD_TYPE=Release) gets around this, but that is not ideal atm.

I need to fix build for linux in the widget branch, while I'm at it I'll look at tweaking CMake files so those asserts don't get included in release with debug builds.

190
Bug report / Re: Worker animation doesn't match the resource
« on: 16 March 2011, 22:38:20 »
I'm (almost) certain I fixed this.

This was done in GAE when an exploit that -Archmage- hinted at was fixed. The exploit fix made it into MG and I think I added comments stating where the animation selection is wrong, but didn't add the code as it was/is a bit clumsy.

relevant clumsy code (from cmd_types_worker.cpp, belong in unit_updater.cpp for MG):
Code: [Select]
// hacky helper for !HarvestCommandType::canHarvest(u->getLoadType()) animation issue
const MoveSkillType* getMoveLoadedSkill(Unit *u) {
const MoveSkillType *mst = 0;
for (int i=0; i < u->getType()->getCommandTypeCount<HarvestCommandType>(); ++i) {
const HarvestCommandType *t = u->getType()->getCommandType<HarvestCommandType>(i);
if (t->canHarvest(u->getLoadType())) {
mst = t->getMoveLoadedSkillType();
break;
}
}
return mst;
}

// hacky helper for !HarvestCommandType::canHarvest(u->getLoadType()) animation issue
const StopSkillType* getStopLoadedSkill(Unit *u) {
const StopSkillType *sst = 0;
for (int i=0; i < u->getType()->getCommandTypeCount<HarvestCommandType>(); ++i) {
const HarvestCommandType *t = u->getType()->getCommandType<HarvestCommandType>(i);
if (t->canHarvest(u->getLoadType())) {
sst = t->getStopLoadedSkillType();
break;
}
}
return sst;
}

191
General discussion / Re: Future file format support
« on: 15 March 2011, 07:08:40 »
I think perhaps we just look for a .dds of the same name as any given texture (sans extension) and use if present, else load the g3d specified one as a Pixmap (or always load the 'original' into a Pixmap first, depending on quality settings, as Will suggested).

So there is always a tga/png and the modder can include their own dds as well, the dds would be used if appropriate, or if not present we automagic it through GL, as MG is doing already.

2. S3TC is a patent protected way! I think you will never see an opensource driver which will support this ( like the Ati one ).
Not to nit pick or anything, but the patent in question was filed in 1997, so in this case never == 6 years :P Too long to make a difference to us now, but its not never.

192
General discussion / Re: Glest XML - attack strength speed
« on: 15 March 2011, 06:47:36 »
http://glestguide.co.cc/sandbox/damage.html

Nice one :thumbup:

The damage calculation has its fractional part truncated though, so change your round() calls to floor().

And a small correction for the skill cycle length calc, if (speed / 4000) divides 1 evenly then the formula I gave reports one less than it should, use this instead,
floor(1 / (speed / 4000) + 1)

Edit: You can make it work easily enough in any browser by using something like this
Code: [Select]
// get DOM Object by id
function getObjById( id ) {
   var res = null;
   if (document.getElementById) {
      res = document.getElementById(id);
   } else if (document.all) {
      res = document.all[id];
   } else if (document.layers) {
      res = document.layers[id];
   } else {
      alert("no way to get DOM Elements :~(");
   }
   return res;
}
instead of just document.getElementById().

But history.go(-1); appears to be not Chrome friendly  :look:

193
Feature requests / Re: Main Menu: PNG or XML Defined Graphics
« on: 15 March 2011, 06:17:05 »
Can they be altered per faction as I could design some very nice borders and use different fonts for each faction. I would use a standard font for resources, unit descriptions and stats but a different font for unit titles in popup boxes, etc would be nice.

I was wondering whether or not to put this in now, or post merge. Because it's loaded from Lua it would be fairly trivial to do, so I probably will add support for faction specific widget.cfg files. This is not a promise ;), if I encounter any unforeseen problems I will probably just revert and forget about it for the time being, but I think it will probably make it.

194
Feature requests / Re: Main Menu: PNG or XML Defined Graphics
« on: 14 March 2011, 06:36:58 »
So that menu widget's file is dynamically modifiable?

If by 'dynamic' you mean changeable in game, no. If by 'dynamic' you mean not compiled into the game, yes.

Its actually a Lua file, you pre-load textures and fonts and specify colours, which are then referenced by name...

Here's the whole file from the widget branch,
Code: [Select]
--[[==========================================================

   1. specify any colours and load textures & fonts

  ==========================================================]]
 
-- colours by name
addColour( "red",              "0xFF0000FF" );
addColour( "pink",             "0xFF7F7FFF" );
addColour( "pink-tint",        "0xFF7F7F7F" );
addColour( "dark-red",         "0x8F2020FF" );
addColour( "red-tint",         "0xFF20207F" );
addColour( "dark-red-tint",    "0xAF20207F" );
addColour( "border-light",     "0xFFFFFF66" );
addColour( "border-norm",      "0x7F7F7F66" );
addColour( "border-dark",      "0x00000066" );
addColour( "background-light", "0xFFFFFF3F" );
addColour( "background-norm",  "0x7F7F7F6F" );
addColour( "background-dark",  "0x3F3F3F9F" );
addColour( "white",            "0xFFFFFFFF" );
addColour( "black",            "0x000000FF" );
addColour( "grey",             "0x7F7F7FFF" );

-- textures by name
-- background and borders...
local dir = "/data/gui/textures/";
loadTexture( "button-bg",             dir.."button_bg.png"             );
loadTexture( "button-small-bg",       dir.."button_small_bg.png"       );
loadTexture( "button-trim",           dir.."button_trim.png"           );
loadTexture( "button-bg-grey",        dir.."button_bg_grey.png"        );
loadTexture( "button-small-bg-grey",  dir.."button_small_bg_grey.png"  );

-- overlays
loadTexture( "close-button-norm",     dir.."close_button_norm.png"     );
loadTexture( "close-button-hover",    dir.."close_button_hover.png"    );
loadTexture( "down-arrow-norm",       dir.."down_arrow_norm.png"       );
loadTexture( "down-arrow-hover",      dir.."down_arrow_hover.png"      );
loadTexture( "up-arrow-norm",         dir.."up_arrow_norm.png"         );
loadTexture( "up-arrow-hover",        dir.."up_arrow_hover.png"        );
loadTexture( "left-arrow-norm",       dir.."left_arrow_norm.png"       );
loadTexture( "left-arrow-hover",      dir.."left_arrow_hover.png"      );
loadTexture( "right-arrow-norm",      dir.."right_arrow_norm.png"      );
loadTexture( "right-arrow-hover",     dir.."right_arrow_hover.png"     );
loadTexture( "roll-up-norm",          dir.."roll_up_norm.png"          );
loadTexture( "roll-up-hover",         dir.."roll_up_hover.png"         );
loadTexture( "roll-down-norm",        dir.."roll_down_norm.png"        );
loadTexture( "roll-down-hover",       dir.."roll_down_hover.png"       );
loadTexture( "expand-norm",           dir.."expand_norm.png"           );
loadTexture( "expand-hover",          dir.."expand_hover.png"          );
loadTexture( "shrink-norm",           dir.."shrink_norm.png"           );
loadTexture( "shrink-hover",          dir.."shrink_hover.png"          );

-- yes/no/maybe overlays
loadTexture( "green-tick",            dir.."green_tick.png"            );
loadTexture( "red-cross",             dir.."red_cross.png"             );
loadTexture( "orange-question",       dir.."orange_question.png"       );

-- mouse cursors
loadTexture( "mouse-set",             dir.."mouse.png"                 );

-- set 'special' textures
-- mouse
setMouseTexture("mouse-set");
-- overlays
setOverlayTexture( "tick",      "green-tick"       );
setOverlayTexture( "cross",     "red-cross"        );
setOverlayTexture( "question",  "orange-question"  );

-- load fonts
dir = "/data/gui/fonts/";
--loadFont( "tin-dog",    dir.."TinDog.ttf", 18 );
loadFont( "sans-big",   dir.."LiberationSans-Regular.ttf",  18 );
loadFont( "sans",       dir.."LiberationSans-Regular.ttf",  10 );
loadFont( "dumbledore", dir.."dum1.ttf",   28 );

-- set default fonts
setDefaultFont( "menu",   "sans-big"     );
setDefaultFont( "fancy",  "dumbledore"  );
setDefaultFont( "game",   "sans"        );

--[[==========================================================

   2. Styles for widgets

  ==========================================================]]

-- some predefined ones (potentially common to many types...)
Bare = {
Default = {
Borders = { Type = "none" },
Background = { Type = "none" },
Font = { "sans-big", "normal" }
}
}

Embedded = {
Default = {
Borders = {
Type = "embed",
Sizes = { 2, 2, 2, 2 },
Colours = { "border-light", "border-dark" }
},
Background = {
Type = "colour",
Colours = { "background-dark" }
},
Font = { "sans-big", "normal" }
}
}

Raised = {
Default = {
Borders = {
Type = "raise",
Sizes = { 2, 2, 2, 2 },
Colours = { "border-light", "border-dark" }
},
Background = {
Type = "colour",
Colours = { "background-dark" }
},
Font = { "sans-big", "normal" }
}
}

SolidOutline = {
Default = {
Borders = {
Type = "solid",
Sizes = { 2, 2, 2, 2 },
Colours = { "border-dark" }
},
Background = { Type = "none" },
Font = { "sans-big", "normal" }
}
}

Solid = {
Default = {
Borders = {
Type = "solid",
Sizes = { 2, 2, 2, 2 },
Colours = { "border-dark" }
},
Background = {
Type = "colour",
Colours = { "background-norm" }
},
Font = { "sans-big", "normal" }
}
}

-- common borders and backgrounds for buttons

buttonBorders = {
Type = "texture",
Texture = "button-trim",
Sizes = { 3, 6 } -- border, corner
}

buttonBackground = {
Type = "texture",
Texture = "button-bg"
}

smallButtonBackground = {
Type = "texture",
Texture = "button-small-bg"
}

smallButtonBackgroundGrey = {
Type = "texture",
Texture = "button-small-bg-grey"
}

-- default font

defaultFont = {
Name = "sans-big",
Size = "normal",
Colour = "white",
Shadow = false
}

-- oscillating white high-light

whiteOscillatingHighLight = {
Type = "oscillate",
Colour = "white"
}

-- StaticWidgets [StaticText ('Labels') and StaticImage]
-----------------
StaticWidget = Bare;

StaticWidget.Borders = {
Type = "solid",
Sizes = { 1, 1, 1, 1 },
Colours = { "red" }
}

-- Buttons
-----------
Button = {
Default = {
Borders = buttonBorders,
Background = buttonBackground,
Font = defaultFont
},
States = {
Disabled = {
Background = {
Type = "texture",
Texture = "button-bg-grey"
},
Font = { Colour = "grey" }
},
Hover = {
HighLight = {
Type = "oscillate",
Colour = "white"
}
}
}
}

CheckBox = {}

CheckBox.UnChecked = {
Default = { -- default state #1 (Un-Checked)
Borders = buttonBorders,
Background = smallButtonBackground,
Overlay = "red-cross"
},

States = {
Disabled = {
Background = smallButtonBackgroundGrey,
overlay = ""
},
Hover = { -- hover state, add 'high-light'
HighLight = whiteOscillatingHighLight
}
}
}

CheckBox.Checked = {
Default = { -- default state #2 (Checked)
Borders = buttonBorders,
Background = smallButtonBackground,
Overlay = "green-tick"
},

States = {
Disabled = {
Background = smallButtonBackgroundGrey,
overlay = ""
},
Hover = { -- hover state, add 'high-light'
HighLight = whiteOscillatingHighLight
}
}
}

TextBox = {
Default = {
Borders = {
Type = "solid",
Sizes = { 2, 2, 2, 2 },
Colours = { "border-dark" }
},
Background = {
Type = "colour",
Colours = { "background-dark" }
},
Font = { "sans-big", "normal" }
},

States = {
Focused = {
Borders = {
Colours = { "border-light" }
}
},

Hover = {
Borders = {
Colours = { "border-norm" }
}
}
}
}

ListItem = {
Default = {
Borders = {
Type = "solid",
Sizes = { 2, 2, 2, 2 },
Colours = { "dark-red" }
},
Background = {
Type = "colour",
Colours = { "background-dark" }
},
Font = { "sans-big", "normal" }
},

States = {
Selected = {
Borders = {
Colours = { "pink" }
},
HighLight = {
Type = "fixed",
Colour = "pink-tint"
}
},
Focus = {
Borders = {
Colours = { "red" }
},
HighLight = {
Type = "fixed",
Colour = "white"
}
},
Hover = {
Borders = {
Colours = { "pink" }
},
HighLight = whiteOscillatingHighLight
}
}
}

ListBox = Embedded;

DropList = {
Default = SolidOutline.Default,
States = {
Hover = {
Borders = {
Colours = { "pink" }
}
}
}
}

ScrollBar = Embedded;

Slider = Bare;

TitleBar = Embedded;

MessageBox = Raised;

ToolTip = Solid;

ScrollBarButtonUp = {
Default = { -- default borders and background (for all states)
Borders = buttonBorders,
Background = smallButtonBackground,
Overlay = "up-arrow-norm"
},
States = {
Disabled = {
Background = smallButtonBackgroundGrey
},
Hover = {
HighLight = whiteOscillatingHighLight,
Overlay = "up-arrow-hover"
}
}
}

ScrollBarButtonDown = {
Default = { -- default borders and background (for all states)
Borders = buttonBorders,
Background = smallButtonBackground,
Overlay = "down-arrow-norm"
},
States = {
Disabled = {
Background = smallButtonBackgroundGrey
},
Hover = {
HighLight = whiteOscillatingHighLight,
Overlay = "down-arrow-hover"
}
}
}

ScrollBarButtonLeft = {
Default = { -- default borders and background (for all states)
Borders = buttonBorders,
Background = smallButtonBackground,
Overlay = "left-arrow-norm"
},
States = {
Disabled = {
Background = smallButtonBackgroundGrey
},
Hover = {
HighLight = whiteOscillatingHighLight,
Overlay = "left-arrow-hover"
}
}
}

ScrollBarButtonRight = {
Default = { -- default borders and background (for all states)
Borders = buttonBorders,
Background = smallButtonBackground,
Overlay = "right-arrow-norm"
},
States = {
Disabled = {
Background = smallButtonBackgroundGrey
},
Hover = {
HighLight = whiteOscillatingHighLight,
Overlay = "right-arrow-hover"
}
}
}

sbEmbed = {
Default = {
Borders = {
Type = "embed",
Sizes = { 2, 2, 2, 2 },
Colours = { "pink-tint", "darl-red-tint" }
},
Background = {
Type = "colour",
Colours = { "red-tint" }
},
Font = { "sans-big", "normal" }
}
}

ScrollBarVerticalShaft = Embedded;

ScrollBarVerticalThumb = Raised;

ScrollBarHorizontalShaft = Embedded;

ScrollBarHorizontalThumb = Raised;

SliderThumb = {
Default = { -- default borders and background (for all states)
Borders = buttonBorders,
Background = smallButtonBackground
},
States = {
Disabled = {
Background = smallButtonBackgroundGrey
},
Hover = {
HighLight = whiteOscillatingHighLight
}
}
}

SliderVerticalThumb = SliderThumb;

SliderVerticalShaft = Embedded;

SliderHorizontalThumb = SliderThumb;

SliderHorizontalShaft = Embedded;

TitleBarCloseButton = {
Default = { -- default borders and background (for all states)
Borders = buttonBorders,
Background = smallButtonBackground,
Overlay = "close-button-norm"
},
States = {
Disabled = {
Background = smallButtonBackgroundGrey
},
Hover = {
HighLight = whiteOscillatingHighLight,
Overlay = "close-button-hover"
}
}
}

TitleBarRollUpButton = {
Default = { -- default borders and background (for all states)
Borders = buttonBorders,
Background = smallButtonBackground,
Overlay = "roll-up-norm"
},
States = {
Disabled = {
Background = smallButtonBackgroundGrey
},
Hover = {
HighLight = whiteOscillatingHighLight,
Overlay = "roll-up-hover"
}
}
}

TitleBarRollDownButton = {
Default = { -- default borders and background (for all states)
Borders = buttonBorders,
Background = smallButtonBackground,
Overlay = "roll-down-norm"
},
States = {
Hover = {
HighLight = whiteOscillatingHighLight,
Overlay = "roll-down-hover"
}
}
}

TitleBarExpandButton = {
Default = { -- default borders and background (for all states)
Borders = buttonBorders,
Background = smallButtonBackground,
Overlay = "expand-norm"
},
States = {
Disabled = {
Background = smallButtonBackgroundGrey
},
Hover = {
HighLight = whiteOscillatingHighLight,
Overlay = "expand-hover"
}
}
}

TitleBarShrinkButton = {
Default = { -- default borders and background (for all states)
Borders = buttonBorders,
Background = smallButtonBackground,
Overlay = "shrink-norm"
},
States = {
Disabled = {
Background = smallButtonBackgroundGrey
},
Hover = {
HighLight = whiteOscillatingHighLight,
Overlay = "shrink-hover"
}
}
}

ColourButton = {
Default = {
Borders = {
Type = "solid",
Sizes = { 4, 4, 4, 4 },
Colours = { "border-norm" }
},
Background = {
Type = "colour",
Colours = { "background-dark" }
}
},

States = {
Hover = {
HighLight = whiteOscillatingHighLight,
}
}
}

TickerTape = SolidOutline;

Which (atm), produces a GUI that looks like this, which also shows off the pixel perfect borders for buttons regardless of button size (the button borders will stay, ignore all the red & pink ;) ).




195
General discussion / Re: G3D model conversion
« on: 14 March 2011, 02:51:36 »
Microsoft is evil?  The children of last century want their meme back!
:O

..Since most of what I like in MegaGlest wont be in the merger...

You seem to have been misinformed.

196
General discussion / Re: Glest forks to join forces?
« on: 14 March 2011, 02:48:35 »
Re Selection Circles: Indeed zoy is correct, in GAE it is green for your units, blue for allies, red for enemies, and orange for resources...

Re AI: The AI in MG has been worked on much more than in GAE. In any case you all seem to be missing the point... we are merging code, taking the best of both, we are not abandoning one code base in favour of the other.

197
Feature requests / Re: Main Menu: PNG or XML Defined Graphics
« on: 14 March 2011, 02:36:59 »
You'll be able to use whatever images you wish... Glest::Widgets evolution 2 is very nearly complete now, this is how buttons are currently 'styled',
Code: [Select]
-- Buttons
-----------
Button = {
Default = {
Borders = {
Type = "texture",
Texture = "button-trim",
Sizes = { 3, 6 } -- border, corner
},
Background = {
Type = "texture",
Texture = "button-bg"
},
Font = {
Name = "sans-big",
Size = "normal",
Colour = "white",
Shadow = false
}
},
States = {
Disabled = {
Background = {
Type = "texture",
Texture = "button-bg-grey"
},
Font = { Colour = "grey" }
},
Hover = {
HighLight = {
Type = "oscillate",
Colour = "white"
}
}
}
}

In a nutshell, each widget type has a 'Default' state (which must be specified) and then other special states which can completely change everything, or just those parts that make sense (the special states all 'inherit' the Default state styles for anything they don't specify themselves).

A 'highlight' based on an image is a great idea, but its too late now, you should have mentioned it earlier :P

For 0.4, best you can do is turn the highlight off all together, and use a different tex for the hover state (or put an 'Overlay' over the default background tex).

Also of interest to other TCs that use rectangular buttons (so, not MRise) is that borders can be specified from a texture, separate to the background, and can thus be kept 'pixel perfect' ... will post some screenies later.

198
General discussion / Re: Disable Intro?
« on: 14 March 2011, 02:18:41 »
Re: Video.

If we were to add the ability to play vids for the intro, campaigns, etc. then it would be theora.  Not sure how that compares with propriety formats but that is about the only option I think is available/attractive to us.

Re: Intro.
Code: [Select]
if (g_config.getMiscFirstTime()) {
setState(new Intro(*this));
} else {
setState(new MainMenu(*this));
}

Not sure how you have the music transitioning atm, and this could mess that up, but this is how would should aim to do it.

199
General discussion / Re: Glest XML - attack strength speed
« on: 12 March 2011, 08:11:25 »
Skill Speed:
frames per skill cycle = ceiling( 1 / (speed / 4000) )

Attack A cycle length = ceil(1 / (90 / 4000)) = 45 frames.
Attack B cycle length = ceil(1 / (50 / 4000)) = 80 frames.


Damage:
Damage dealt = (attack_strength + rand(-var, +var) - armour) * damage_multiplier
Assuming attack variance = 0 and damge multiplier = 1 and target has armour = 0 then,
Damage dealt = (attack_strength + rand(-0, +0) - 0) * 1 = attack_strength

Therefore:
Attack A does 400 points damage per 45 frames, for an average of 8.888... hp / frame.
Attack B does 150 points damage per 80 frames, for an average of 1.875... hp / frame.


Attack A is 4.74 times more powerful than Attack B.

200
General discussion / Re: Rendering G3D using OpenGL
« on: 9 March 2011, 19:48:47 »
Any status or stats on the migration to VBOs and shaders?

...

You might divide it up so you have a set of blocks for each tile or batch of tile textures, or you might do as I found fastest for my globes by having all the vertices in a single VBO and using range-elements drawing.  But the fundemental thing is to move from drawing each tile individually to drawing big blocks of map in a single call.  The GPU is very good at skipping those fringes around the meshes that fall outside the screen area.  You can go further by putting these blocks of tile vertices into a single VBO and using glMultiDrawElements to draw all those blocks.

Doubtless you're all way ahead of me on this line of thinking, and I'm just stating the obvious

TerrainRenderer2 (-test tr2) puts all of the vertex attribs for the entire map in a single VBO, the indices are collected in a vector and sent through as a vertex array.

from terrain_renderer.cpp [TerrainRenderer2::render()]
Code: [Select]
// build index array
m_indexArray.clear();
int tileCount = 0;
SceneCuller::iterator it = culler.tile_begin();
for ( ; it != culler.tile_end(); ++it) {
Vec2i pos = *it;
if (!mapBounds.isInside(pos)) {
continue;
}
int ndx = 4 * pos.y * (m_size.w - 1) + 4 * pos.x;
m_indexArray.push_back(ndx + 0);
m_indexArray.push_back(ndx + 1);
m_indexArray.push_back(ndx + 2);
m_indexArray.push_back(ndx + 3);
++tileCount;
}

then after all the gl state/array/texture setup, its one call,
Code: [Select]
// zap
glDrawElements(GL_QUADS, tileCount * 4, GL_UNSIGNED_INT, &m_indexArray[0]);

In order to do it this way, all the textures are splatted as normal, and then copied onto one master texture (SurfaceAtlas2). So it chokes on big maps (master tex would need to be too big, gl implementation dependant), so big maps are going to need to be split into multiple 'blocks'.

It also currently wastes lots of memory... the 'old' splatted textures aren't even deleted atm :look:

This will be cleaned up sometime soon, for a possible 'tr3' doing the splat in a shader is the 'obvious' way forward - so we would then only need the base textures and save a bunch of texture memory, but at the cost of more vertex attribute memory & much more fragment processing...

Pages: 1 ... 4 5 6 7 [8] 9 10 11 12 ... 55
anything