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.


Topics - silnarm

Pages: [1] 2
1
General discussion / Re: alternative ways to show teamcolor
« on: 13 July 2011, 13:28:31 »
I personally thought the outline idea seemed best, how does that circle look with selection circles as well?

I did outlines (could use some tweaking yet),
(click to show/hide)

A 'tint' (suggested after a bug in a shader that was doing basically this to some people randomly),
(click to show/hide)

and will allow both as an option,
(click to show/hide)

Commit:a05e3904

2
General discussion / 0.4 beta2 (windows installer)
« on: 16 June 2011, 16:00:30 »
0.4 Beta 2

Windows Installer (~70MiB)

Important: If you have gae-0.4-beta1-data.zip in your  addons folder, delete it!

3
Bug reports / [Fixed] Heap corruption.
« on: 2 June 2011, 22:14:54 »
Just a heads up to anyone running from git, I discovered this morning we have another heap corruption problem. It seems that our leak dumper was hindering the mscrt checks somehow, and I have had leak dumping turned on for a long time now (until this morning...), so it may not necessarily be something very new.

This could be causing weirdness or crashing depending on the build, I don't have the time to investigate properly just now, but hopefully will get a chance to track it down tonight.


4
Tools / G3dHack - alpha9
« on: 7 May 2011, 13:20:08 »
Greetings.

  In light of the fact that exported animations export the same number of key-frames for every mesh in a model, including completely static ones; most meshes have lots of duplicate vertices; and, perhaps worst of all, all meshes are marked as two-sided, this new tool may be of interest to modders.

G3dHack & G3dScan - Alpha9

This is a .NET app, windows folks should be able to run it 'out of the box' (if not, make sure .NET is up to date). People on linux need mono and mono.winforms, it runs fine on linux, and should also do so on mac, but does suffer some GUI issues.

5
General discussion / 0.4 beta1
« on: 30 April 2011, 05:12:44 »
As always, it took us longer than we might've wished, but finally a beta for 0.4 has arrived.

0.4 beta1 Windows binaries with data addon.
 * requires that gae-0.3.2 be installed.
 * does not include shibboleth

Edit:
glew32.dll, if needed, extract and place beside the exe.

Double Edit:
Important
Looks like I set the default data path to '../share/glestae' rather than the correct './share/glestae' This means the shortcuts are broken and the beta1 exe needs to be double clicked to find the data, else you get the missing back.tga problem.

Ooops...


6
Feature requests / Re: MG Features
« on: 7 February 2011, 12:09:28 »
There is no such policy,but code changes and stuff becomes incompatible, but you know this,
again, it all depends on how you do it.

There is absolutely no reason for certain incompatibilities that have been introduced. If they don't want to use our code, fine.  But they introduce 'new' features that are identical to GAE features, and give them a completely different XML setup, or in the case of Lua different function names, even command queuing is different (Shift Vs Ctrl)!

The only reason I can see for this is either ignorance or arrogance.

7
General discussion / GAE 0.3.2
« on: 12 December 2010, 07:49:32 »
Glest Advanced Engine 0.3.2

Generic Linux - Source package (with data) ~73 MiB

Debian Based Linux - debs for 32bit & 64bit ~77 MiB
64bit Deb package is coming soon.

Windows - Installer ~63 MiB

Please replace the exe and pdb with these ones ~8.5MiB.

And by special request, Omega's upgrade pack ~7.5 MiB



This is another bug-fix release, with the usual sprinkling of small extras.

Change Log:

Data Changes:
  • faction logos for magitech were added.
  • attack-notice sounds for magitech were added.
  • attack-stopped commands were removed from melee units
  • Archer, Swordsman & Guard require Training Field upgrade to use patrol & guard commands

Minor enhancements:
  • Tool-tips
  • HP & EP 'boosts' in Enhancements
  • cast-spell command, only supports target='self' atm
  • faction logos in display panel when nothing selected
  • 7zip addons are now supported (but the archives must not be 'solid')

Bugs fixed:
  • G3D viewer segfaulting at startup on 32bit linux.
  • Map editor's 'show map' option had various path paroblems.
  • An 'unsupported resolution' on a fresh install would not write the ini
  • the mouse cursor was jumping up and down when using the scroll wheel
  • text in the display panel wasn't wrapping
  • resource refunds were ignoring the don't reserve resources flag (easy cheat)
  • particle system on buildings weren't rotating
  • the new load command shouldn't cause crashes anymore ;)
  • sub-faction advancement checks for defective
  • load capacity for load command was not enforced properly
  • G3D viewer crashed if a model's texture was not found
  • Transports couldn't be ordered to attack properly
  • numerous text formatting fixes
  • in-game chat didn't do anything on non-network games (why do you people want to talk to yourselves?!?)
  • unit particles on starting units weren't starting
  • particle systems on die skill only played for one skill cycle
  • multiple consumable resources with different intervals would cause all to be evaluated on any one of their intervals
  • random faction selection was restored
  • last game-settings weren't sanitised before use, crashing the new game menu if you removed the last map you played on (for example)
  • Various behavioural fixes were made to transports
  • Various crashes in the new GUI were fixed
  • attack-stopped command was not setting custom stop skills
  • patrol command was broken for patrolling to a target unit
  • the droplists for map/tileset/tech-tree were too small
  • scroll-wheel now functions on drop-lists (changes selection if un-expanded, scrolls list if expanded)
  • the lua function setCameraMotion() always rotated the same way, which was some times the 'long way' around.
  • team colour in particle systems wasn't working


8
General discussion / Cast-Spell Command
« on: 6 December 2010, 10:45:43 »
An initial implementation of the cast-spell command is available, is can currently only apply an Effect to the 'caster'.

A test addon is available, attached to the ticket.

This addon makes use of another new (and as yet) undocumented feature, enhancements (levels, upgrades, effects...) can include a new section <point-boosts> to boost the current hp and ep points. They add the hp/ep to any existing units affectd, and to any new units of those types. Obviously a hp-boost on a freshly constructed unit is not going to do a lot, but I'm sure you guys can think of a million ways to use ep-boost.

So, the addon adds to tech an upgrade, 'spinach' (research at castle),
Code: [Select]
<upgrade>
  <image path="spinach.bmp"/>
  <!-- other boring stuff omitted -->
  <effects>
    <unit name="swordman"/>
    <unit name="guard"/>
  </effects>
  <point-boosts>
    <ep-boost value="100" />
  </point-boosts>
</upgrade>

This gives swordsmen 5 doses of spinach, which when eaten gives him 150% attack speed and doubles his attack-strength for 30 seconds,

Code: [Select]
...
   <skill>
      <type value="cast-spell" />
      <name value="eat_spinach_skill" />
      <ep-cost value="20" />
      <speed value="20" />
      <anim-speed value="200" />
      <animation path="models/swordman_standing.g3d" />
      <sound enabled="false" />
      <effects>
         <effect name="popeye_strength" bias="beneficial" stacking="overwrite" duration="30">
            <multipliers>
               <attack-strength value="2.0" />
               <attack-speed value="1.5" />
            </multipliers>
         </effect>
      </effects>
   </skill>
...
   <command>
      <type value="cast-spell"/>
      <name value="eat_spinach"/>
      <image path="../../upgrades/spinach/spinach.bmp"/>
      <unit-requirements/>
      <upgrade-requirements/>
      <affect value="self" />
      <cast-spell-skill value="eat_spinach_skill"/>
   </command>

9
General discussion / Cloaking
« on: 6 December 2010, 08:29:26 »
The new cloaking unit ability is now complete, and ready for some more extensive testing.

Windows people can get the latest snapshot (rev 1004)
Linux people all know how to compile programs themselves, so they'll be fine  :P

You may experience graphical issues related to the new experimental shader code, if so, please open glestadv.ini and set RenderUseShaders=false

The trac ticket has three addons attached, these are mutually exclusive, only put one at a time in your addons.

The first addon makes daemons invisible with a 'permanent' cloak, which is deactivated while the daemon is attacking, the XML looks like this,
Code: [Select]
   <cloak type="permanent">
      <de-cloak skill-class="attack" />
   </cloak>

de-cloak nodes can specify an entire 'skill-class' or a specific 'skill-name', <de-cloak> nodes are valid for all cloak types and multiple de-cloak nodes can be used.

The second addon, invisible_daemons_v2, gives daemons an 'energy' cloak,
Code: [Select]
   <cloak type="energy" cost='20'>
      <image path="images/daemon_cloaked.png" />
      <cloak-sound path="sounds/cloak.wav" />
      <de-cloak-sound path="sounds/decloak.wav" />
   </cloak>

The 'cost' is specified for the same interval as regeneration (once per second at normal game speed). <cloak-sound> and <de-cloak-sound> are supported for all cloak types, <image> is only needed for energy cloaks, and is the command button used to toggle the cloak on/off.

v2 also makes summoners 'detectors',
Code: [Select]
   <detector value='true'/>

invisible_daemons_v3, gives daemons an 'effect' cloak,
Code: [Select]
   <cloak type="effect">
      <cloak-sound path="sounds/cloak.wav" />
      <de-cloak-sound path="sounds/decloak.wav" />
   </cloak>
   <tags>
      <tag value="daemon"/>
   </tags>

The new <tags> in the unit parameters node allow you tag unit types, this feature will allow numerous things in the future, and was addded early to restrict the targets of an effect.

You should still set target='ally' in the effect/emanation tag, you can then use tags to further refine the potential targets.

The summoner in v3 has an emanation which cloaks nearby daemons,
Code: [Select]
   <emanations>
      <emanation name="hide_daemons" bias="beneficial" stacking="overwrite"
            target="ally" chance="100.0" duration="2" radius="7">
         <affect value="daemon" />
         <flags>
            <causes-cloak/>
         </flags>
      </emanation>
   </emanations>

The new <affect> node is used to restrict this Effect to units tagged as 'daemon', in this case, just daemons.
The new flag <causes-cloak/> will trigger an 'effect' cloak on the target, if the target does not have an effect cloak, it will do nothing.

The new cast-spell command can also be used to make an 'invisibility' spell to make the caster invisible, spells to target other units or areas are due to be implemented sometime in the not to distant future.

Note: Units can have only one cloak type.

Enjoy, and please feel free to post questions and/or feedback here.

10
General discussion / GAE 0.3.1
« on: 5 October 2010, 01:21:57 »
Glest Advanced Engine 0.3.1

Generic Linux - Source package (with data)
Debian Based Linux - debs for 32bit & 64bit
Windows - Installer


Modders using Windows: Some of the new commands may be crashing the program, please use this new exe and pdb.  This exe is less optimised and may run slightly slower, but along with the pdb will give a nice stack trace if it crashes, which will help us greatly in figuring out what is going wrong.
Extract to the program install dir, and run the program from a desktop/start-menu shortcut (to ensure it can find the pdb). Delete the old pdb that was incorrectly installed in the bin/ dir.


This is a bug-fix release, with some small goodies thrown in.

Minor enhancements:
  • PNG loader from MG
  • Housed units can use projectile attacks (configured in Load command)
  • The 'shuffle' option I forgot to add for multiple music tracks
  • Player defeated messages, thanks Zoythrus for providing a long list to sort through
  • Maximum selection size increased to 24.
  • Select & Deselect from display panel

Bugs fixed:
  • unmountable dataDir crashes ungracefully
  • non visible particle systems eating memory and cpu cycles
  • attack zones in the display panel were not being loaded from the lang file
  • free upgrades
  • die animations not processed correctly
  • move skills modified by strong effects can lead to strange results
  • the "don't reserve resources" flag wasn't being set properly when multiple units get the build command
  • non-resource tileset objects were clickable
  • the lua function unfogMap() didn't reveal tileset objects
  • maps in a scenario's directory were not being located
  • particle systems weren't pausing
  • generate command was not multiplayer safe
  • transports were not handled in savegames
  • the buttons on the scenario menu were partially unclickable at low res
  • having no gbm maps was considered an error
  • savegames were broken due to physfs related path problems
  • no change was made to the mouse cursor when a command was selected
  • random projectile path was not very random...
  • particle systems attached to die skills were not going away
  • there was no confirmation request for quit game / program
  • more physfs related path problems meant Lua couldn't read external files properly
  • several memory leaks were plugged
  • there was an error in the path finder causing crashes with large movable units
  • no selection circle highlight on clicked targets
  • sounds attached to move skills were not playing
  • Some AI problems with new resource types were fixed
  • Unit particle systems were always using a default radius (0.5)
  • savegames with dead units in them were not loading correctly

11
Closed bug reports / [fixed] Phantom cancel button
« on: 24 September 2010, 04:57:42 »
This is fixed, but I was trying to explain what it was to titi on IRC, and failed, a picture says a thousand words ;)



12
General discussion / GAE 0.3
« on: 12 September 2010, 06:34:08 »
Glest Advanced Engine 0.3

Note: Things have changed a bit, the configuration files and logs are located at ~/.glestadv (on linux) or ~/glestadv (on windows)

Windows
There is an installer available for Windows (~55 MiB)
For modders, there is also the Developer edition (binary only, requires installed version)

Ubuntu
Ok, I couldn't get the deps thing working properly, so you'll have to ensure you have the dependencies yourselves for now, the only new thing is PhysFS, so if you can run original Glest, all you will likely need is to grab libphysfs through synaptic.
32bit Deb (built on Ubuntu 10.04) (~72 MiB)
64bit Deb (built on Ubuntu 9.10) (~72 MiB)

Linux - Source package (with data)
Source tarball (~67 MiB)

[Mac bundle due sometime ?]

[Binary and data upgrade packages to follow.]

New Features:
 * PhysFS (virtual file system)
   * data in ~/glestadv/addons is merged with the base data
   * files in addons/ with identical paths will override base data
   * mods can be loaded from zip files
 * FreeType fonts
   * Nicer looking fonts, and completely platform neutral
 * New Command: Generate - a 'Produce' command for non-units
   * see https://docs.megaglest.org/GAE/Command_XML#generate
 * New Commands: Load and Unload, for housing units in transports/towers/etc
   * see https://docs.megaglest.org/GAE/Skill_XML#load
   * & https://docs.megaglest.org/GAE/Command_XML#load
 * Skill / Effect / Emanation Particle systems
 * Resources are selectable
 * Player colours are selectable from the new game menu
 * 8 player support
 * LAN game announcer
 * Buildings can be rotated before placement (90 degree increments only)
 * Support for multiple music tracks per faction
   * see https://forum.megaglest.org/index.php?topic=5800.msg58079#msg58079
 * Improved performance of model interpolation
 * Multi-tier selection support for Produce and Morph commands
   * see https://docs.megaglest.org/GAE/Command_XML#produce
 * Command complete sounds for Morph, Produce and Upgrade
 * Dedicated Lua console with command history (single player only)
 * Complete GUI overhaul, droplists, check-boxes, and all (or most) the stuff you would expect in a modern GUI
 * default textures and models are used if errors occur loading data
 * New Lua functions
   * setCameraMotion() - for cinematics
   * giveUpgrade() - gift an upgrade
   * destroyUnit() - 'kill' a unit
   * damageUnit() - deal some damage to a unit
   * Dialogue Sequences
     * addActor() - registers an 'actor' name, and associates a colour with it
     * addDialog() - adds some dialog from an actor
 * Some new menu.xml options were added for total conversions

Some Bugs Fixed:
 * daytime cycle stops after loading saved game
 * meeting points not persisted in saved games
 * Some bugs in the Lua interface were fixed, which were preventing tables from being passed properly

Things that didn't make it:
 * Only 8 player support was added, this will be increased to 12 soon, but we need to rework the New Game Menu and find four new colours that don't clash
 * Glestimals - some support exists in the code, but a little more is required, the models are still in need of animation, so loading of them was disabled.

13
General discussion / 0.3 teaser topic
« on: 14 August 2010, 12:38:33 »
There was a lull in development for a while, but much work had been done, and things are moving rapidly again now, so with 0.3 not far off, I thought I'd start a teaser topic to show off some of the things complete or in-the-works.

Multiple music tracks has oft been requested, and is in, it works like so:
Code: [Select]
  <music value="true" play-list="true">
    <music-file path="music/blew.ogg"/>
    <music-file path="music/floyd_the_barber.ogg"/>
    <music-file path="music/about_a_girl.ogg"/>
  </music>

The GUI has undergone are rather massive overhaul,

Same screenies of the New Game and Options menus:

Obviously this will look a bit different in the release, the player count hasn't been increased yet.



and the new-look Minimap and Display:


Command finished sounds for Upgrade, Produce & Morph are in, they work much like built-sounds:
Code: [Select]
<finished-sound enabled="true">
<sound-file path="sounds/initiate_morphed1.wav"/>
<sound-file path="sounds/initiate_morphed2.wav"/>
</finished-sound>

Resources are clickable:


I finally remembered to implement a few new Lua functions Omega has been after for a while,
Code: [Select]
  giveUpgrade(faction, upgrade);
  destroyUnit(unitId, clean);

Unit particle systems are in, and they can be used for effects:


Hopefully should be ready for a release within a couple of weeks.

14
Closed bug reports / [fixed] AI worker bug
« on: 28 May 2010, 11:40:02 »
fix for long known AI worker bug, a simple oversight in the end, jda's recent revelations made it rather easy to track down.

unit_type.cpp : 550
Code: [Select]
case ucWorker:
  return hasSkillClass(scBuild) || hasSkillClass(scRepair);

change to,
Code: [Select]
case ucWorker:
  return hasSkillClass(scBuild) || hasSkillClass(scRepair) || hasSkillClass(scHarvest);

15
General discussion / SimulationInterface
« on: 19 April 2010, 12:42:44 »
This is essentially a 'follow up' of the issues discussed in this topic: https://forum.megaglest.org/index.php?topic=4696.0

I've come to the point where I felt I needed to get this resolved, Daniel never got the tmp_refactor branch building, so I blazed my own path, and came up with a somewhat different solution.

This probably better belongs on the dev mailing list, but I can post pretty pictures here :)

The problem in a nutshell is the Network <-> Game/World interface. The NetworkInterface is created by MenuStates before the Game and World exist, but needs ultimately to interact very closely with them, this is achieved through a static object (a singleton) called NetworkManager, which creates and destroys the Interfaces as required, and provides queries for the game to determine if this is a network game, and provide pointers to the interface.

The old model:


With lots of additions to the networking code (admittedly much of it only there for debugging atm) this slightly messy approach became very messy. I've added an abstract, but highly functional, class called SimulationInterface, it's owned by the Program, and represents the Interface to a, potentially non-existent, World and Game (renamed GameState for now, pending a better name coming up...)

There is always one and only one, the three concrete types are LocalInterface (very thin), ClientInterface & ServerInterface. Initially the Program creates a LocalInterface, in MenuStateJoinGame it is told to change into ClientInterface, MenuStateNewGame might or might not change it to Server, SimulationInterface::changeRole() by default copies the GameSettings and Stats from the previous Interface to the new.

The new model:


Much of the stuff in Game that related more or less directly to the World (game speed, the Commander, etc) now lives in the SimulationInterface, along with the GameSettings and Stats, which previously has to be very carefully handed around when ProgramStates were changed.

The NetworkManager is gone, what was the old NetworkInterface and been renamed NetworkConnection, a NetworkInterface is now what used to be GameNetworkInterface (or GameInterface in very recent GAE code). 

The SimulationInterface contains some code from the Game (GameState) and some from the old NetworkGameInterface, and some from the UnitUpdater which was eliminated last week.  Anything which effects the game world goes through the SimulationInterface, so the client/server specific stuff is all handled through virtuals, the only 'network role' checks left atm are in the chat manager, and they will be coming into the SimulationInterface too.

All fairly much done and (importantly) working, I just need to go through and clean up some more, and will commit direct to trunk this week some time.


16
General discussion / 0.2.13a
« on: 18 April 2010, 07:58:06 »
0.2.13 is finally out, including 'debug' editions, probably mostly of interest to people developing scenarios.

0.2.13a
Windows
Debug Edition for Windows

0.2.13 - no binaries for 0.2.13a on 32 bit linux yet, please build from source
Linux (32 bit)
Debug Edition for Linux (32 bit)

0.2.13a
Linux (64 bit)

Source Tarball (0.2.13a)

Features:
+ Hierarchical path finding.
+ Lots of new Lua goodies, http://sourceforge.net/apps/trac/glestae/wiki/LuaReference
   + All commands can be given from scripts now
   + Timers
   + Triggers
+ Titi's new AIs (easy & mega)
+ Multiplayer code was reverted to Glest 3.2.2

and other small items, see http://sourceforge.net/apps/trac/glestae/query?group=status&milestone=0.2.13 for the full list.

17
General discussion / Multi-player Multi-platform
« on: 11 March 2010, 20:57:33 »
So I've been very busy unravelling the unit & projectile update process, I had thought I could deliver this without having to convert much of the code to fixed point arithmetic.  Indeed I had it mostly working this way, with the client becoming a kind of 'puppet', the results of command updates were sent by the server.  Despite packing these down to 1-4 bytes (depending on the resultant skill) this was using a bit of bandwidth, and then I found more problems.  Radius of splash effects is floating point (not a particularly big problem) and all damage calculations are floating point (big problem). Sending all these results as well was going to be too much information...

So, I bit the bullet. I've converted the vast majority of the floating point calculations (the stuff that effects the 'game state' that is) to fixed point. While the framework for sending updates I developed is now not needed, the 'hooks' have proved useful, at the moment I'm using them to checksum every update, and that is sent with keyframes (for debugging obviously, this means the client will throw an exception on the very command/projectile update that evaluated differently to the server, which will make tracking down problems rather a lot easier).

There is still some more fixed point conversion to do, and the small issue of the how to deal with the pathfinder (uses lots of floating point, not sure I want to change it), so I may just use the original idea of sending an explicit update from the server for the move skill. In any case, this should all be wrapped up on the weekend...

Multi-player Multi-platform, coming soon to a glest advanced engine near you  ;)

18
Maps, tilesets and scenarios / Map editor development
« on: 1 March 2010, 08:46:17 »
For discussion of and testing improvements to the map editor.

The 'mega-zombiepirate' map editor can be downloaded here,

https://sourceforge.net/projects/glestae/files/map_editor/1.5/map_editor.7z/download

Has,
 * titi's changes to make 8 player maps,
 * zombiepirate's gradient brush
 * Keyboard commands (see 'cheat sheet' below)
 * undo/redo
 * from 1.5-beta3 includes a toolbar (with buttons on it!) thanks andy0101.

Want to make an 8 player map ?
When starting a new map, the player count defaults to 4, you also need to 'Reset Players' if you want to make an eight player map.

Cheat Sheet:
Code: [Select]
Ctrl + O : Open File
Ctrl + S : Save File
Shft + Ctrl + S : Save as
Ctrl + Z : Undo
Ctrl + Y : Redo

H : Switch to Height Brush
G : Switch to Gradient Brush
S : Switch to Surface Brush
O : Switch to Object Brush
R : Switch to Resource Brush
L : Switch to StartLocation Brush

Alt + [1-9] : Sets the Brush Radius

With Height or Gradient Brush activated,
[0-5] : Sets Brush height
Ctrl + [1-5] : Sets brush height (negative)

With Surface Brush activated,
[1-5] : Sets Surface Selected

With Object Brush active,
[1-0] : Sets Object Number (from 1-10)
- : Sets Object = 0 (erase)

With Resource Brush active,
[1-5] : Sets Resource Number
0 : Sets Resource = 0 (erase)

With Start Location Brush active,
[1-8] : Sets Start Location index.

19
General discussion / 0.2.13 Release Candidate
« on: 24 February 2010, 08:18:43 »
A beta of 0.2.13 is now available.

release candidate for 0.2.13 is ready for testing,

for windows,
https://sourceforge.net/projects/glestae/files/0.2.13-rc/gae0.2.13_rc4_win32.7z/download
[extract in glest directory]

(linux version are release candidate 1, new versions coming soon.)
for linux - 64 bit only atm  :-\
http://sourceforge.net/projects/glestae/files/0.2.13-rc/gae0.2.13_rc1_linux_x86_64.tar.gz/download

and for anyone so inclined, (or the only option for the moment for 32bit linux) the source tarball,
https://sourceforge.net/projects/glestae/files/0.2.13-rc/glestae-source-0.2.13_rc3.tar.bz2/download

It sports,

 * A shiny new pathfinder (yes, again), hierarchical this time, no node limit, so no more bad paths.

 * Lots of new Lua goodies, http://sourceforge.net/apps/trac/glestae/wiki/LuaReference

 * Titi's new AIs (easy & mega)

 * (Hopefully) working multiplayer

Feedback on any of the above would be most appreciated (in particular multiplayer, there may be lingering synchronisation issues, but if I'm not told, I aint gonna go looking for 'em).

Cheers.

20
General discussion / Tools: C++ || Java || C#
« on: 4 January 2010, 12:58:18 »
I've been thinking about modding tools a bit.  In hacking the G3d viewer a bit I got somewhat familiar with wxWidgets, it wasn't long before I started looking for alternatives...

The contenders:

C++ with wxWidgets
Pro: Is what the existing tools were written with.
Pro: No need to port any code to a new language.
Con: Looks suspiciously like a multi-platform version of MFC.
Con: system for specifying callbacks is really clumsy.

Java
Pro: Top of the class for platform neutrality, and a very popular programming language in general.
Con?: Unsure of the status of OpenGL bindings (and have no intention of supporting a second 3D api)
Con: No delegates

C# with OpenTK and Winforms
Pro: The Visual Studio forms designer (don't underestimate this!).
Con: mono.winforms has some quirks

C# with OpenTK and Gtk# + Glade
Pro: Top notch platform neutrality.
Con: Gtk (noun): world's largest collection of deprecated and obsolete functions

C++ with FLTK2 + FLUID
Pro: Is C++, no porting of the shared lib would be needed
Pro/Con?: Contains a very simple and interesting looking system for callbacks, maybe somewhat limiting, or maybe a stroke a genius.
Con: ?? Haven't actually played with this yet, it looks ok, but there are bound to be an issue or two.

So, those are my thoughts on the contenders thus far.  I'm leaning toward C# with OpenTK & Gtk#, I like C# as a programming language, and OpenTK gives gives us access to OpenGL + OpenAL, and seems to work well.  I've already converted a fair portion of what is needed from the shared lib into C# with OpenTK while playing with OpenTK.

Gtk I have only started messing with a couple of days ago.  Using online references if incredibly painful, there seems to be more deprecated functions than not, and the proper way to do things now is to use Pango for the layout and rendering of text, and Cairo for drawing.  This leads to weird and ugly kludges to pass information around, ie, your Gtk widget's area is given in a Gdk.Rectangle (all ints), but when drawing you need to know this as a Cairo.Rectangle (all doubles).  Colours are similarly cumbersome (Gdk.Color has byte components 0-255, Cairo.Color uses doubles with values from 0 - 1).

So, I'm somewhat torn... hopefully Gtk will seem less like a kludgey pile of crap with time...

Anyway, enough of that little digression, if anyone would like to suggest other contenders, or add pros/cons to existing contenders, or just argue with some of the pros/cons I listed... fire away!

21
General discussion / repository clean-up
« on: 28 November 2009, 02:07:28 »
Just a heads up, as discussed with Daniel on IRC, I've done some housekeeping on the repo. So the lua_ext, openglui, tinyxml, refactor, & 0.2.12 branches are all gone, and 0.2.13 has been renamed 0.2.x

If you had any of those checked out, you'll want to switch or delete your working copies, and if you had 0.2.13 out, you will need to switch it (to 0.2.x).

22
General discussion / 'Expiremental' GAE, with new stuff!
« on: 27 November 2009, 08:36:54 »
An experimental version of GAE is now available, consider it a sneak peak at 0.2.13, the functionality added will probably be the last for 0.2.

For people wishing to get a head start with the new Lua additions or to play with the options for particles systems that Daniel introduced...
Win-32
linux-x86

I'm assuming this wont have a large audience, so I'm supplying a windows binary only atm, if anyone wants a linux binary, make some noise.


The download is just the executable, please ensure you can run 0.2.12b first.

I still haven't documented all the new Lua function yet, some of them were quite literally just added...

but here they are, in a nutshell...

setTimer(name, type, interval, periodic)
stopTimer(name)
registerRegion(name, area) -- a 'rectangle', specified as { x, y, w, h }
registerEvent(name)
setUnitTrigger(unitId, condition, event)
setUnitTriggerX(unitId, condition, event, userData)
setFactionTrigger(factionIndex, condition, event, userData)
lockInput()
unlockInput()
unfogMap(area)
giveTargetCommand(unitId, command, targetId)
giveStopCommand(unitId, command)
playerName(factionIndex)
scenarioDir()

-- and some debugging aids...
debugLog(msg)
consoleMsg(msg)
hilightCell(pos)
hilightRegion(region) -- region == name of registered region
clearHilights()


I'll be documenting them asap and will post a link, some decent examples might take a bit longer... you don't want to see the Lua I've been writing in the last few days ;)

Edit: Ooops...

I forgot to mention one other thing... while a proper 'console' for Lua is 'in the pipeline' it probably isn't 'just around the corner', so for the time being a chat message beginning with '~' is not a chat message at all, the tilde is discarded and the rest sent to the Lua interpreter.

Also, I started a new topic and didn't post a pretty picutre ;) here we go... hilightRegion() activated (numerous times) in game through a 'chat' message.


23
General discussion / 'How to' guide: speeding up rendering
« on: 23 September 2009, 06:08:01 »
OPEN TASKS

1. rewrite Renderer::renderWater() and Renderer::renderSurface() using Vertex Arrays.

2. More sophisticated state management

3. Sort objects/units before rendering, to minimise calls to glBindTexture()

4. Smarter texture management

5. Use all available texture units

1. Renderer::renderWater() and Renderer::renderSurface()

These functions are currently implemented with immediate mode OpenGL. Immediate mode makes lots of function calls and is very inefficient, the more tiles you render (the further back you zoom) the more pronounced this inefficiency. I'll be reorganising the map data soon to remove duplication of information between Map and Pathfinder, at this time I will also split out the data that the renderer is interested in, and put it all in neat compact video card friendly arrays.

The immediate mode code then needs to be gutted. Instead of drawing the quads in the while loop, we build a vector of indices to the vertex array instead, then when our array (err, vector) is built, we set up our vertex, normal, colour & texture arrays and call,
glDrawElements( GL_QUADS, 4 * numTiles, GL_UNSIGNED_SHORT, ourIndices.c_ptr() );
Thus replacing hundreds of function calls (potentially thousands) with one.

Note that this task may require elements of task 4, specifically to do with the tileset textures... but I'm not too sure at this stage what the current TextureManager does do for us.

This is what I would be doing with my level of knowledge of, and experience with, OpenGL.  If any OpenGL Gurus happen to wander through this way and would like to rewrite this using even fancier VBOs or whatever new fandangled things are available, please do so!

2. What's your state?

State management in OpenGL is important, in particular, changing state variables on the 'server' can be expensive. We need to minimise state changes if possible, or at the very least keep track of the state ourselves, and not change it to the same thing.  I'm not sure if modern implementations are smart enough to do this for you, but I know this has historically been an issue, so we should do it ourselves in either case.

An assessment of the use of glPushAttrib()/glPopAttrib() should be performed here too, with the aim of minimising if possible.
Ordering our rendering so we push and pop as little as possible would be the goal, and if only a couple of states are changed for something, apparently its better to just change them individually and restore them when you're done, 'by hand'.

Trying to group renderables that need the same state would be desirable, but this would conflict with the aims of task 3.

3. Form on orderly queue! By team colour and then unit type please.

Renderer::renderObjects() was where this all started, I was doing some profiling and noticed it was eating up a rather sizeable chunk of the 3D rendering time (about 40% on my system). A attempted quick-fix and some more investigating revealed the problem, glBindTexture().  Some of the default tileset textures are using 5 meshes, all with different textures, object rendering uses one texture unit, causing 5 calls to glBendTexture() for each one rendered.

Before I discovered that some of the objects have so many textures, I tried to fix it by sorting the objects, and then rendering them in order...

So the old while loop that plucked out objects and rendered them becomes a preprocessing loop:
Code: [Select]
vector<Vec2i> toRender;
PosQuadIterator pqi(visibleQuad, Map::cellScale);
// find all renderable objects...
while(pqi.next()){
const Vec2i &pos= pqi.getPos();
if(map->isInside(pos)){
Tile *t= map->getTile(Map::toTileCoords(pos));
Object *o= t->getObject();
if(o && t->isExplored(thisTeamIndex)){
toRender.push_back ( pos );
}
}
}
// sort them by model
std::map<const void*, vector<Vec2i>> renderTable;
for ( vector<Vec2i>::const_iterator it = toRender.begin(); it != toRender.end(); ++it ) {
Object *o = map->getTile( Map::toTileCoords( *it ) )->getObject();
assert( o && o->getModel() );
renderTable[o->getModel()].push_back( *it );
}

then the rendering iterates over the renderTable map, each element is a vector of positions of objects with the same model.  This was meant to reduce the calls to glBindTexture() because the code does actually check if the currently bound texture is the same as the new one, and doesn't bind if it is (but it only does this for the base texture unit... more on that in a minute...)

It didn't reduce the calls to glBindTexture(), because some of the models were changing the texture up to five times each...
The possible solutions for objects all involve tasks 4 & 5.

Units we probably can speed up using this method.  And by not always binding the team texture, as it currently is. So renderable units need to be sorted first by team colour, then by unit type. Some units do use more than one texture, though 2 seems to be a typical max, and most models seem to use only one, so this should give a noticeable improvement (if there's lots of the same unit type on screen that is!)
We will need to add a 'lastTeamTexture' to MeshCallbackTeamColor, and check before binding textures, much like the model renderer currently does with the base texture unit and 'lastTexture' [see ModelRendererGl::renderMesh()].

4. Texture Management

I shouldn't say too much here, I'm not that familiar with what our current TextureManager does for us, but I have noticed a few things it doesn't do :)

It's not grouping small textures into bigger textures, this is a must for tileset textures in order to complete task 1.
SurfaceAtlas seems to provide an interface to do just this, via addSurface(), but then it just creates a new texture for each needed tile texture, rather than grouping them all in one big texture, and setting the texture coordinates for each accordingly.

The same might be possible to overcome the object/unit with multiple textures problem, or...

5. Texture Units

We're using one texture unit for all our model rendering... one for the fog of war, and one for shadow mapping (team colour uses the fog of war unit).

That's 3.  I'm willing to wager most of the games of Glest played today are on OpenGl implementations offering more than 3 texture units.  We should check how many there are, and use them ALL!

Indeed, if sufficient texture units are available, the tileset objects with 5 textures problem is solved, use a texture unit for each, and then my ugly sorting code from above might actually be beneficial.

24
General discussion / One A*, to rule them all
« on: 19 September 2009, 04:12:35 »
I'm at it again... A* can be very addictive.

I've been reading some books on game AI, and picked up a few ideas for interesting use of the A* algorithm, for things other than finding paths.  So we need a more generic A*, not something I was all that keen on, because I'm not willing to use polymorphism in the path finder.  So I've resorted to templates, everything can be inlined, there'll still be code bloat in the generated code, but not in the source ;)







So the ultimate idea is that there will be "One A*, to rule them all".  We get our desired search by calling the appropriately templated 'aStar'.

So, the PathFinder class is on the way out, there will be a PathManager in it's place, which will serve as a 'smart interface' to the SearchEngine.  The PathManager will take requests for paths from individual units, and groups of units with the same destination. The 'groups of units with the same destination' is they key here, the path finder is only a problem when it gets swamped with requests, when deos this happen? When lots of units need paths at the same time. When does this happen? When the player commands a large group of units (which is to a single destination) or when an AI launches a 'massive attack' (which again, is to a single destination).

Single search requests will be processed with a node limited A* using the shared NodePool and team's annotated map.  If the search completes, all good and well.  If the node limit is reached, the best heuristic node is plucked from the closed set, and a 'partial' path is provided (this is essentially what happens  currently), the PathManager then queues the search to be performed 'in full' using one of the NodeMaps. As a partial path was returned, this search is not high priority, when the PathManager deems it can spare one of the NodeMaps and has some cycles to kill, it runs the search in full (possibly over multiple frames) and
provides the complete path to the unit.

In David Silver's paper on Cooperative A*, he describes a 'Reverse Resumable A*', he uses it for searches in the abstract space, but I think we can use the same idea at the 'low level', slightly modified.

So when we get a group of units all going to the same place, we grab a NodeMap, and run the first search, in reverse! One unit, one path. Next. We now have a NodeMap full of data, we DO NOT 'clear' it for the next search, the data is still good! Normally, when we close a node in A*, we have found the shortest path from the start location to that node.  This is of no use to us if we run the search in the forward direction, but by swapping the start/destination, we now have a NodePool with closed nodes that all point their way back to the actual destination.

For the next search, we do this: check if the start location is in the closed set, if so we already have the path, we just need to pull it out of the closed set.  If not, we run over the open set, recalculating the heuristics to the new 'goal' location (the 'actual' start :) ) and re-sort it, and then resume running the A* algoirthm.  This will 'branch' off at the most appropriate location from the open set (the previous search's frontier) until it gets the best path to the new unit, adding more nodes to the closed set (full of good data). Next!

The open set will grow too unfortunately, depending on how spread out the units are, but the heuristic function is small and fast, and inlined thanks to the templating, so recalculating them shouldn't prove too time consuming, fingers crossed ;)

We'll keep one annotated map per team, these are small and cheap to update anyway, so we can update them based on what that team knows, giving us a proper fog-of-war effect, (ie, you wont see new buildings in fogged area, until you 're-sight' the area). This also prevents us from inadvertently exploiting information not know by that team, which would be a concern if these searches were performed on the 'master' annotated map.

The NodePool is a limited array of nodes, used for the 'bread and butter' searches, a NodeMap is an array of nodes the same size as the map, and its nodes therefore 'map' directly to cells on the map.  These take a bit of memory, but we will need more than one, probably not one per player like I suggest in those pictures though...  These arrays are for the hard case searches that couldn't be resolved with the node limited version, and for the group searches.  There is no node limit, the search will find a path or fail, indicating there is no path.  Thus it must be 'interruptable' and run over multiple frames if needs be, and hence the need to have a few lying about.

Ok, that's a lot of explanation, and I'm not sure how good it is! Any questions, fire away!

25
Mods / The GAM. 0.3 Available now.
« on: 15 August 2009, 12:56:23 »
The Glest Asset Manager is now beta testing.

It is at this stage an editor. It can't 'add' new units/factions, nor unit skills/commands to an existing unit, but it can edit anything already there.

Beta means almost certainly broken, I've tested it somewhat, and simple changes are working. Complex changes are bound to break things, please let me know!

System Requirements
Windows: .Net 2.0: Just download, unzip and run.

Linux: Mono 2.0 + mono.winforms: You'll likely have Mono 2.0, mono.winforms you will need to acquire through your package manager of choice. I have noticed some problems with controls not resizing properly on mono, but haven't had time to look into that much.

0.3 now available:
https://sourceforge.net/projects/glestmm/files/GAM_0.3.zip/download



Pages: [1] 2