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 - Omega

Pages: [1] 2 3 4 5 ... 10
1
Off topic / What are y'all up to these days?
« on: 22 July 2019, 09:43:37 »
Haven't had a lot of off topic discussion in a while (and I know, I've been mostly just monitoring the forum myself), so figured I'd kick up an icebreaker topic: what kinds of things are you guys doing these days? Work, hobbies, personally projects, etc.

To kick it off, I've mostly been very busy with my job. I've basically got my dream dev job and work with cloud computing (cluster management, namely). I moved across the country for that and love my work. I'm very, very good at what I do! I get lots of responsibility, get to lead designs, get to travel for work, and get to work on interesting things that people actually want. I don't do much personal projects these days because I find the 8+ hours a day tends to leave me all "coded out" (and I have a bad habit of working late because I get very into what I'm doing). Every now and then I can contribute to open source through my work, which is a perk I really love. Hoping to get to do more OSS contributing in the future (but my todo list at work is an ever growing one :P).

I do have a bajillion side projects I want to do, though. I've learned the hard way that game dev doesn't really interest me. I think mostly because I have no artistic talent and it's hard to make much without that. And also I loooove my automated tests and games are notoriously difficult to test. My real passion project is programming languages. My last job, one of my final big tasks was extending their parser for multiple other languages. We parsed circuit simulation languages; which are truly horrendous, BTW (I could rant for ages on how poorly they're designed). That was actually a C++ thing since our parser was performance critical. I'm kinda glad to not work with C++ anymore, though. Core dumps are nice, but god the language is like juggling chainsaws. These days I'm mostly Go and Python. I did start writing an interpreter in Scala for a novel language I was designing, but like many of my projects, I kinda just stopped working on it after a while, haha.

My partner got me into Pokemon Go and Wizards Unite, so been playing that a ton lately. I love it. It's great to get out and take loooong walks and explore areas I haven't before. Walks are suddenly fun even solo. Fellow players feel free to add me in PoGo if you want. I usually have excess gifts to send anyway :P. Friend code 6926 5429 2450.

Oh, and I got married... and soon to be divorced (oops). Married an American and kinda rushed that marriage so we could live together. Though currently in a long distance relationship with an amazing person.

Okay, let's stop there. What have y'all been up to?

2
So, this off topic board has been kinda dead for a long time. And I feel like this forum has really strictly focused on MegaGlest related stuff. There hasn't really been much personality or expressions of individuality going on. So let's use this topic to talk about more personal stuff. What are you doing with your life (school, work, etc)? Work on any interesting projects lately (not necessarily programming or gaming related)?

To start it off, I'm close to finishing my final year of school. Hoping to try and find work somewhere in Vancouver or Toronto. Something related to full stack web dev, likely. Recently I've been finishing up my research project on semi-automatic image segmentation, for which info and the repo can be found here. I've recently also been working on a minimalist Android app for budget tracking.

What about the rest of you?

3
Maps, tilesets and scenarios / License discussion (NC and not NC )
« on: 4 December 2015, 23:45:38 »
If someone builds a new mod using one of your models he cannot use a model from MG iitself or another mod because this results in a license conflict.
So making a new tileset using tree models from your mod and tree models from original MG will not be allowed.
This is not true. You can license specific things under different licenses. So you can have some models under CC-BY-SA and others under CC-BY-NC-SA. You simply have to specify this somewhere (eg, in a "LICENSE" file). What you can't do is just claim the whole mod is one license when there's actually mixed assets. Although you can do that if the licenses are compatible, but judging compatibility is difficult. For example, the GPL is a CC-BY-SA compatible license. But to make things even more confusing, CC-BY-SA is NOT a GPL compatible license (ie, it's one way). So best to never try and relicense. Just keep track of the individual licenses and ensure that modifications to the media follow the license.

4
Feature requests / Rename attack boosts
« on: 22 July 2014, 01:44:11 »
I'd like to suggest that attack boosts be renamed. The name is inaccurate and very misleading. Until you read the documentation, it's not clear that it can boost stats besides attacks or be associated with skills other than attacks. If I recall correctly, the name is a hold-over from older times.

So I propose that we depreciate the `attack-boost` element (in the same way that `attack-strenhgt` (or however they spelled it) is depreciated). We can support both `attack-boost` and some new name (the XML parser has simple means of doing this, which are already used for `attack-strength`.

I think we should use the name `emanation` to describe attack boosts. This is the term that GAE used. MG's attack boosts and GAE's emanations are roughly the same thing. Dictionary-wise, emanation is also more accurate: "an abstract but perceptible thing that issues or originates from a source". Alternatives include "aura", "automatic-effect", or simply "boost" (using one of these would allow our terminology to be distinct from GAE -- I can think of pros and cons to this). "Boost" is what the English transformation is already using in-game.

If we do rename attack boosts, we should consider doing so in the source code, too (very easy to do with a bit of find and replace).

5
Feature requests / [Please Test] Tags
« on: 22 July 2014, 01:22:13 »
I intend to re-implement a feature of GAE that I believe was useful: tags.

Tags are just a label (or multiple labels) that can be given to a unit type. Then we can make changes that only apply to units that have certain tags. For example, instead of listing all the units that an upgrade is applied to, we could instead use tags to assign some custom property (eg, "warrior" or "mage") and then apply the upgrade to all units with that property. These are more useful with attack boosts, since attack boosts can affect multiple factions.

Tags are most effective if they are used consistently throughout the entire techtree. They make it easy to apply attack boosts to a group of units based on some property (such as whether they're a building, a sword user, etc).

Tags also have future potential in being used with other features. For example, looting could be improved by assigning a list of tags for units that can loot (perhaps normal units can loot, but buildings (like the defense tower) cannot). In fact, I intend to extend looting in this way after tags are implemented.

I intend to use the same syntax as GAE did. As an aside, the feature does seem redundant when first using it, but it's actually quite a please to use (speaking from experience) when used consistently throughout the techtree. It works best for mods that use attack-boosts (emanations in GAE) heavily. It's a pain in the ass to keep adding units to the various affects lists of attack-boosts every time you create a unit. Easier to add a tag in one spot.

For a real example of how a tag is useful, consider some zombie warrior that inflicts a disease (using an attack boost) on nearby units (in GAE, this would be better done with an effect, which is essentially an attack boost that is applied to the target of an attack). Anyway, it doesn't make sense to apply a disease to a building, so naturally we're going to limit this attack boost to only effect humanoid units. How do we do this? Do we keep an affects-list of every humanoid unit in this attack boost (and bear in mind we have to manage all these affects-lists)? Tags provide an alternative by simply saying that the attack boost affects "humanoids", and then each humanoid can be given a "humanoid" tag. Thus, we localize the unit properties (being humanoid) to the location that they are relevant.

It's going to be a few days (or perhaps until the weekend) until I can get started with this, so feel free to discuss this idea.

6
MegaGlest / Managing MegaGlest's code
« on: 20 July 2014, 05:51:43 »
Now that I've actually tried to implement things, I've found that MegaGlest's code base is a mess.

In particular, there doesn't seem to be much for code conventions.

  • There's tons of commented out code
  • Formatting is very inconsistent. In the same method, I've seen `foo=1`, `foo= 1`, and `foo = 1`.
  • Documentation is virtually non-existent. This creates a huge learning curve to try and figure out what the software is doing. Not to mention you'll never understand the code you wrote six months later.
  • Use of outdated C++ conventions. There's a complete overuse of pointers, for example. RAII, a common programming idiom in C++ for writing safe code, is rarely used. And new code pretty much has to be written pointer heavy, or it ends up being inconsistent with the rest of the code.
  • There's a number of code clones. Some which can be eliminated by extracting common code into a method.
  • Code is thrown into a handful of gigantic files instead of being appropriately split up. Smaller files are typically more manageable and less cumbersome to work with.
  • Lines are pretty much never wrapped. I haven't even seen the majority of files, but I've already seen plenty of lines excess of 500 characters!
  • Unit tests pretty much don't exist. MegaGlest would be difficult to test because (1) it was never written with testing in mind and (2) being a game, there's a number of things that only show up graphically (difficult to write automated tests for)

My point being that there's a lot we could do to make the code more manageable. Have some of these points already been considered?

Some of these can be addressed quickly. A formatter ("pretty printer") can make short work of inconsistencies in formatting. A great deal of commented out code can be removed quickly with appropriate regex (commented out code adds nothing; there's no way to know if the code works, if it is still applicable, if it has bugs, etc). Of course, the problem with these large, automated changes is that they pretty much cut off easy access to old revisions and make merging hell (tons of minor inconsistencies). It can be manageable if done when there's no major feature branches on a stable release, though.

Unfortunately, the more useful fixes, particularly documentation and use of modern C++ idioms, would be time consuming and require manual work. It's very possible, though (in fact, my current job is mostly refactoring, documenting, and creating tests for a Java project that did none of these).

7
I could have sworn that we used to do a better job at handling run time errors (although I may be thinking of GAE; it's been a while).

By run time error, I'm referring particularly to errors in validating tech trees. Right now, they crash the program and don't print to the log. The error log has not been touched. The regular log just cuts off at the unit where the error was thrown. In order to retrieve the error message, you must run the game from the console (so that the console won't close when the program closes).

And even then, the error messages are heavily overcomplicated (for whatever reason) and the simple message is concealed within two dozen lines of "stack traces" (and I put this in quotes because it's not a stack trace I've seen before and doesn't seem to be useful in any way). This may be related to the other issues that I pointed out today, namely that Windows won't compile unless an exception handling line is commented out and that the debugging files are output in the wrong name.

Below is the error of the simple mistake of using an invalid armor type on a single unit.

Code: [Select]
$ megaglest.exe
megaglest.exe v3.10.0-dev
Compiled using: VC++: 1600 [DEBUG] on: Jul 19 2014 07:40:38 platform: Windows endianness: little
GIT: [$Rev$] - using STREFLOP [SSE] - [no-denormals]
*ERROR* [2014-07-19 10:06:38] In [unit_type.cpp::Glest::Game::UnitType::loaddd Line: 727] Error [Arm
or Type not found: asd
Stack Trace:
00000000 00000000 00000000 c8099fdd NtGetContextThread!ntdll (null)(0) +18
00000000 00000000 00000000 c8099fdd NtGetContextThread!ntdll (null)(0) +18
]
*ERROR* [2014-07-19 10:06:38] In [faction_type.cpp::Glest::Game::FactionType::load Line: 185] Error
[Error loading UnitType: f:\Documents\Projects\MegaGlest\megaglest-source\data\glest_game\techs/mega
pack/factions/indian/units/stickfighter/stickfighter.xml
Message: Armor Type not found: asd
Stack Trace:
00000000 00000000 00000000 c8099fdd NtGetContextThread!ntdll (null)(0) +18
00000000 00000000 00000000 c8099fdd NtGetContextThread!ntdll (null)(0) +18

Stack Trace:
00000000 00000000 00000000 c809a7e5 NtGetContextThread!ntdll (null)(0) +18
00000000 00000000 00000000 c809a7e5 NtGetContextThread!ntdll (null)(0) +18
]
*ERROR* [2014-07-19 10:06:38] In [tech_tree.cpp::Glest::Game::TechTree::load Line: 357] Error [Error
 loading units: f:\Documents\Projects\MegaGlest\megaglest-source\data\glest_game\techs/megapack/fact
ions/indian/
Message: Error loading UnitType: f:\Documents\Projects\MegaGlest\megaglest-source\data\glest_game\te
chs/megapack/factions/indian/units/stickfighter/stickfighter.xml
Message: Armor Type not found: asd
Stack Trace:
00000000 00000000 00000000 c8099fdd NtGetContextThread!ntdll (null)(0) +18
00000000 00000000 00000000 c8099fdd NtGetContextThread!ntdll (null)(0) +18

Stack Trace:
00000000 00000000 00000000 c809a7e5 NtGetContextThread!ntdll (null)(0) +18
00000000 00000000 00000000 c809a7e5 NtGetContextThread!ntdll (null)(0) +18

Stack Trace:
00000000 00000000 00000000 c809ae0d NtGetContextThread!ntdll (null)(0) +18
00000000 00000000 00000000 c809ae0d NtGetContextThread!ntdll (null)(0) +18
]
*ERROR* [2014-07-19 10:06:39] In [program.cpp::Glest::Game::Program::setState Line: 683]
Error [Error loading Faction Types: f:\Documents\Projects\MegaGlest\megaglest-source\data\glest_game
\techs/megapack/
Message: Error loading units: f:\Documents\Projects\MegaGlest\megaglest-source\data\glest_game\techs
/megapack/factions/indian/
Message: Error loading UnitType: f:\Documents\Projects\MegaGlest\megaglest-source\data\glest_game\te
chs/megapack/factions/indian/units/stickfighter/stickfighter.xml
Message: Armor Type not found: asd
Stack Trace:
00000000 00000000 00000000 c8099fdd NtGetContextThread!ntdll (null)(0) +18
00000000 00000000 00000000 c8099fdd NtGetContextThread!ntdll (null)(0) +18

Stack Trace:
00000000 00000000 00000000 c809a7e5 NtGetContextThread!ntdll (null)(0) +18
00000000 00000000 00000000 c809a7e5 NtGetContextThread!ntdll (null)(0) +18

Stack Trace:
00000000 00000000 00000000 c809ae0d NtGetContextThread!ntdll (null)(0) +18
00000000 00000000 00000000 c809ae0d NtGetContextThread!ntdll (null)(0) +18

Stack Trace:
00000000 00000000 00000000 c809b615 NtGetContextThread!ntdll (null)(0) +18
00000000 00000000 00000000 c809b615 NtGetContextThread!ntdll (null)(0) +18
]
AL lib: ReleaseALC: 1 device not closed

8
The project files create a megaglest.exe, but for whatever reason, the expected output is glest_game.exe (presumably the original binary as created for vanilla Glest). The various debugging files are also named glest_game.*.

The project file should be updated to use the correct names. With the wrong name, MSVS is not able to run the binary. I'm not entirely sure how the debug files are used, but I imagine that having the wrong name affects them, too.

This is as of rev 31def0dc1ae.

9
It appears that the script located in mk/windoze/CopyWindowsRuntimeDlls_2010.bat (which the readme describes as necessary for running the program) is outdated.

First of all, either the readme is missing crucial information about how to run this script or all the paths are wrong. It should be copying files to the data/glest_game directory, but instead copies to the current directory. Strangely enough, there's commented out lines (for obviously outdated DLLs) that have the right path. It's the active lines that have the wrong paths.

Anyway, even after manually copying over all the files, the program doesn't run. It appears that not all libraries are included. I think it was just the 7zip stuff that was missing (although I actually copied all the DLLs and the plugins and lua folder from my install of 3.9.0).

As an aside, I also have two related observations:
  • The error messages when the program was started with missing libraries is very bad. It basically says "MegaGlest encountered an error and must close, send us this dmp that you can't read" instead of a more ideal notification about the exact libraries that are missing. It seems that *some* libraries do have better error messages (I initially forgot to copy DLLs and received an error about missing libvlc).
  • In mk/windoze/CopyWindowsRuntimeDlls_2010.bat, there's some copy operations that are only performed if a file does not already exist. IMO, this is not an ideal approach. What if the libraries need to be updated in the future? Not overwriting the files would fail to update them properly.
  • The commented out lines (that start with rem) should probably be removed. They hold no current value and made me originally question if these files were supposed to be copied too (ie, they're confusing to the reader). All those files aren't used anymore, and most don't even exist in the windows deps package.

This is relevant as per the develop branch at rev 31def0dc1a.

10
ExceptionHandler::handle(LPEXCEPTION_POINTERS) in main.cpp references stackdumper(), which is only visible if _DEBUG is not defined. As a result, there's compile time errors when compiling in debug mode.

This is on branch develop (I presume that's the active development branch; couldn't find any info about how the project uses branches) as of rev 31def0dc1a. This is applicable to MSVS 2010 (should affect all MSVS versions).

EDIT: Actually, it turns out that the code inside the #IFDEFs doesn't compile, anyway. It uses non-existent variables. It's not clear why.

11
Feature requests / Ability to easily take screenshots without HUD
« on: 26 November 2013, 05:42:43 »
We can currently take screenshots without HUD by switching to photo mode and then taking the screenshot. However, in the heat of the battle, you don't want to remove the HUD, but you still might want to take a photo of your all out assault. It would be beneficial, in my opinion, if we could somehow take an ingame screenshot that contains no HUD with a single button. Since the 'e' key is the regular screenshot key, I propose that either shift + 'e' or ctrl + 'e' would take a screenshot without the HUD. ctrl + 'e' is probably preferable, since then we could perhaps allow screenshots while in the chat dialog (or not, if the implementation of the chat dialog doesn't make that easy).

To elaborate, "taking a screenshot without the HUD" should take a screenshot as though we had enabled photo mode, but it should not hide the HUD in the game window (only the screenshot is affected).

12
Forum discussion / New posts icons
« on: 6 October 2013, 01:44:36 »
We recently changed the icons that show whether or not a board has new, unread posts. Previously, the icons were the "G" of the Glest logo for new posts and a greyed out version of the same for no new posts.

As you can probably see from the main page, the icons have been changed to a swordman's attack icon (the sword) for new posts and the hold position icon (the shield) for no new posts. Is it better? Or is it too unclear of the icons meanings? Should we use a different set of icons (such as the hold position icon; a flag)?

Let us know what you think!

13
When closing the map editor, it prompts to save the file, which is great. However, it also prompts if you have no changed the default map in any way. This is akin to a text editor prompting you to save when you haven't typed any text (and most modern text editors will not prompt for an empty file).

The method of detecting if the file has been changed varies. One method would be to compare the file to an empty map. If it's a match, the map cannot have been edited. Another method would be to set a flag the moment the user makes a change to the map. The latter would be faster, but if the user undos their change, the map is still recognized as changed, so the former method would be more accurate (if you type in a text editor, then remove the text, it won't prompt you to save, since saving an empty file is rarely desirable).

14
I believe it would be beneficial for map editing and scenario creation if the map editor displayed the coordinates for the tile the mouse is currently hovering over in the status bar in the window. This feature is seen in most modern image editors.

15
One problem I have with maps is that everything is a large square tile. It makes curved roads and cliffs look terrible. It's difficult to make a change without impacting a huge amount of the engine, though. Thus, I propose that we allow the square tiles to be subdivided into triangles as per the picture below (which illustrates the issue with the square tiles and how triangles help):



To prevent this change from messing with too much of the engine (path finder, object placement, etc), it should apply only to surfaces and heights. The surfaces is obvious enough: we can create paths that are not straight and don't look like crap (as the above image illustrates). In the map editor, when you zoom in enough, the editor should subdivide the tiles into triangles, which can be "painted" in the same manner as we currently select the square tiles. It may also be ideal to implement a "show grid" option, which would show a grid overlay with the triangles when zoomed in sufficiently.

This, of course, requires a change to the map format.

The effects are similar for changing the heights. We raise or lower the height of a triangle instead of a whole tile. Objects placed on the tile will be placed at the height of the lowest triangle (to prevent floating objects). This allows us to create rivers, islands, etc that don't have horridly jagged edges.

I believe this change will make the maps look more realistic for dedicated map makers. If the map editor is further tweaked to automatically paint with triangles based on the brush size, it may be easy to make maps with smooth edges without a large amount of editing. This change is purely for aesthetic reasons and does not impact gameplay.

16
Feature requests / Lua scripting on maps (or "Maps are scenarios")
« on: 24 August 2013, 04:23:42 »
In this massive feature request, I propose a method of making the game's maps more interactive by combining features of maps and scenarios. This will make the game more dynamic and make a larger portion of the game modable (and modding is the lifeline of MegaGlest).

Maps are scenarios


As it stands, we can currently play scenarios, which have set factions and goals. Meh, good for one play through and they lose their thrill. Now consider a volcanic level where the center of the map has a large volcano with lava pouring out of the ground in various locations. Units that touch the lava are hurt. Prowling the level are creatures that thrive on the hellish landscape. They don't belong to any faction, and are wild beasts who attack on sight.

This image is a lot different than the games we currently play. We can't add these models to a map. Tilesets are too limited. We can't have damaging lava. We can't add faction-less enemies. Traps? Ha! Dynamic landscapes? No way. This proposal seeks to change that by adding a lua script to maps. This is *like* scenarios, but only a subset of the commands in scenarios are useful in maps, so a large variety of other commands are necessary to make these maps dynamic. The map format also changes, as we need to "attach" models to maps, which are independent of tilesets.

The focus is making maps versatile. I believe maps are the area which would allow the biggest change to MegaGlest at the moment.

The remainder of this document is highly technical and assumes experience in Lua scripting in MegaGlest.

Maps are more than just tileset objects


As it stands, our maps are really quite simple. A grid of heights with textures and objects placed. Water and cliffs are just dependent on the height. The tileset is the life of the map. This proposal does not change that. The tileset is still being used.

However, we also add the ability to position independent models on the map. To do this, we specify the position that the geometric center of the model is placed. The center is the natural choice, since it allows models to hang off edges easily. We then specify the size (diameter) of the model, in tiles. So if I place a model at {100, 100} and specify the size as "1", it is expected that the model will take up just the tile at {100, 100}. However if the size is 2, then the model will be placed so that it is 2 * 2. Models are thus assumed to be a perfect square. Since we're specifying the center, it is necessary for models to be shifted for even numbers, and will always shift right and down. So for a 2 * 2 model, the model will take up {100,100}, {100, 101}, {101, 100}, and {101, 101}.

It is necessary that we can specify the walkability of models. This will be done with cellmaps in the same way as a unit.

There can be any number of models, and models can overlap. Most importantly, models can be placed on top of one another. Thus, I can have two different models on {100, 100}. When the walkability of models overlaps, we treat the walkability like a logical OR. The final cell is only "walkable" (a zero in the cellmap) if both overlapping cells are walkable (0 OR 0 = 0). Models can also be placed over top of tileset objects. The base height of the model is assumed to be the *highest* height tile in the model's square. This is for ease of positioning on non-flat surfaces. The highest tile is a better choice than the lowest, as it would make models such as bridges significantly easier.

For animated models, the size is relative to the first frame only.

Syntactically, maps are formatted with an XML similar to that of scenarios. Here's what the model placement portion would look like:

Code: [Select]
<map>
<models>
<model name="modelName" file="model.g3d" x="100" y="100" size="2" active="true">
<cellmap value="true">
<row value="01" />
<row value="10" />
</cellmap>
</model>
</models>
</map>

  • name is an identifier for that model. This will be used later to toggle the active and inactive state of models.
  • file is the path to the G3D model to use.
  • x and y are the x and y coordinates of the model's geometric center. In other words, where the object will be placed.
  • size specifies the diameter of the model in tiles.
  • active is used to toggle whether the model is displayed. This is used later, where we can enabled or disable a model. Enabled models are visible. You can see them and are impacted by the cellmap. Disabled models are pretty much not there at all. Later code will allow them to be toggled as enabled. This allows models to appear and disappear. Disabled models do not apply their cellmap. This attribute is optional and defaults to "true".
  • cellmap works the same way as for units. If value is "false", it is assumed that the entire model grid is not walkable.
Thus, all models are listed in the map XML, and can be preloaded with the game.

Maps can be split into regions


The concept of regions exist in scenarios, but maps demand precision. A region is simply a zone on the map. A group of tiles that can do *something* when units enter it. A region exists as a group of selections. For example, a region might be the rectangular selection from {100, 100} to {105, 105} (that is, a 5 * 5 square). A more complicated region would be a combination of two rectangular selections, such as the the rectangular selection from {95, 100} to {105, 100} and the rectangular selection from {100, 95} to {100, 105} (a cross). By combining selections, we can select any set of tiles.

Like models, regions are declared statically in the XML file, giving a name and a collection of selections:

Code: [Select]
<map>
<regions>
<region name="regionName">
<rectangle-selection x1="100" y1="100" x2="105" y2="105" />
<single-selection x="100" y="100" />
</region>
</regions>
</map>

There may be any number of regions with any number of selections. Tiles can belong to multiple regions. The region name is a unique identifier, which is used so that Lua can modify regions and capture activity within them. rectangle-selection is straight forward enough. x1 and y1 refer to the coordinates of the top left corner, while x2 and y2 refer to the coordinates of the bottom left corner. single-selection is purely a syntactical convenience, and means the same thing as a rectangular selection where x1 = x2 and y1=y2 (a single tile rectangle).

Dynamic, baby!


First of all, we need to discuss how Lua code is triggered. Like scenarios, the map XML has a startup tag, where Lua code is executed once when the map is loaded.

Beyond that, all Lua code is triggers, just like scenarios. I expect one of the most useful triggers will be the existing timer triggers, which should function exactly the same way in maps as they would in scenarios. Timers can be used to make models move, to trigger damage in regions, etc.

Further, the <regionTrigger value="regionName"> is called when a unit enters "regionName". This trigger is only useful for events that occur upon entering a region. For repetitive damage inside a region, a timer trigger is best used, combined with functions that return units inside of a given region (more on these functions later).

Models


Models are dynamic in how they can modify their coordinates ("move"), toggle their active state ("appear" and "disappear"), and modify their cellmap (create walkability). Note there is no way to change a model to use a different animation, since all models are pre-loaded. To use a different animation, you'd want to disable a model and enable another model (with the desired animation) in its place.

void setModelPosition(string modelName, int[] coords, float damage)

Moves a model instantaneously to the given coordinates (in the format of {x, y}). The damage is used to determine how to deal with units that are in the way of the movement. If damage is -1, units in walkable cells in which the model appears in will be instantly killed. Otherwise, units are pushed out of the way and delivered the damage. If the damage is a floating point value between zero and one (damage > 0 && damage < 1), then the damage dealt is a percentage. If there is absolutely no way to push the unit aside, the unit is instantly killed.

void moveModelPosition(string modelName, int[] coords, int damage, int animSpeed)

The same as above, but moves the model gradually instead of instantaneously. The animSpeed is used to determine how many world cycles it takes to move the model (recall that by default, 40 cycles = 1 second). Note that the animation is purely aesthetical. The model is considered to have instantly moved (so damage works the same way as the previous function). When moving a damaging model multiple tiles, it would be best to move it one tile at a time (using a timer). This would ensure that damage is dealt on every tile the object passes over.

int[] getModelPosition(string modelName)

Returns an array of the model's position. Works like unitPosition(). First index contains both the x and y coordinate, second index just the x coordinate, and third index just the y coordinate.

int getModelSize(string modelName)

Returns the size of the model.

void setModelActiveState(string modelName, bool activeState)

Sets the specified model to enabled (true) or disabled (false).

bool getModelActiveState(string modelName)

Returns whether or not the model is enabled.

void setModelCellmap(string modelName, bool[] cellmap)

Sets the cellmap of a specified model. The cellmap is simply an array of boolean values. So for a 2 * 2 object, a cell map might look like {1, 1, 0, 0}, which is the same as the first row being all ones (unwalkable) and the second row being all zeroes (walkable).

bool[] getModelCellmap(string modelName)

Returns the cellmap in the format specified in the previous function.

Regions


The latter two functions listed here are not directly related to regions, but are a necessity to make regions useful.

int[] getUnitsInRegion(string regionName)

Returns an array of unit IDs for units inside the specified region.

void changeUnitStats(int unitID, string statName, float relativeChange, int duration)

This allows stats of a specified unit to be changed. The modifiable stats are "hp" (current), "maxHp", "ep" (current), "maxEp", "sight", "attackStrength", "attackRange", "armour", "moveSpeed", "productionSpeed", "hpRegen", and "epRegen". That is, all the stats that can be modified by an update as well as the current HP/EP and regeneration. This allows maps to provide mini-upgrades (or downgrades) for units as well as damaging/healing units.

All values are relative to the current stats (just like in upgrades). For values inbetween zero and one (non-exclusive), treat the change as a multiplier.

The effects last for duration seconds. If the duration is -1, the stat change lasts indefinitely.

void applyAttackBoost(int unitID, ???)

It is currently unclear how to proceed with this function. Attack boosts have a very large number of parameters, so applying one purely with a function would create a function from hell. Alternatives include passing an array with the attack boost parameters or defining the attack boost in the map XML with an identifier. Regardless of the Lua implementation, attack boosts provide powerful ways to modify units. A unit could emerge from a cave as a hero which boosts the combat skills of those who fight by his side.

Particles


You didn't really think I forgot about particles, did you? Particles can be applied to a model or region. Thus, we could have a planes region with a windy appearance or a volcano model that smokes real good. To facilitate loading of particle effects, all particle files are loaded in at startup just like models and regions:

Code: [Select]
<map>
<particle-files>
<particle-file name="particleName" file="particleSystem.xml" />
</particle-files>
</map>

Thus, particles also have unique identifiers. We can then apply particle systems to models and regions by default with an additional tag:

Code: [Select]
<map>
<models>
<model name="modelName" file="model.g3d" x="100" y="100" size="2" active="true">
<particle value="particleName" />
</model>
</models>
<regions>
<region name="regionName">
<single-selection x="100" y="100" />
<particle value="particleName" />
</region>
</regions>
</map>

Finally, we can apply particles dynamically, allowing us to change the particles on a model or region. A volcano can explode or a field can catch ablaze!

void setModelParticleSystem(string modelName, string particleName)

Sets the particle system for a model.

void setRegionParticleSystem(string regionName, string particleName)

Sets the particle system for a region.

It should be noted that models are always perfect squares, which means that their particles are too. Thus, it may often be beneficial to use regions for setting models on a particle system. Thus, we can have a large volcano model where only the top of the volcano billows smoke (the area of the top would be a region with a particle system).

Neutral factions


Neutral factions are already supported by scenarios. In maps, neutral factions are more versatile. In particular, there may be up to eight different neutral factions. Teams are assigned to them the same way as they are assigned to players (which means there may be up to 16 teams in total; 8 player teams and 8 neutral faction teams). This allows neutral factions to war with each other or ally with a player. Neutral factions are assigned a level of aggressiveness ranging from zero to four.

  • 0: The faction is benevolent to everyone, and never attacks. In the future, they could use beneficial abilities on players.
  • 1: The faction is non-aggressive and will not attack unless attacked first. They will never attack allies.
  • 2: The faction is semi-aggressive and will not attack unless threatened (get too close) or attacked first. They will counter-attack allies.
  • 3: The faction is aggressive and will attack on sight. They will counter-attack allies.
  • 4: The faction is very aggressive and will attack on sight. They will also go out of their way to attack enemies (for example, they will traverse the entire map to attack an enemy base)

Neutral factions are not meant to be large or very powerful, and are meant to be produced entirely through Lua commands. Neutral factions may range from nomads to animals to magical auras. If capturing buildings becomes a possibility in the future, neutral factions consisting solely of abandoned buildings may be very interesting.

The XML code is very similar to that of in scenarios:

Code: [Select]
<map>
<players>
<player faction="civilians" aggressiveness="1" team="9"/>
<player faction="glestimals" aggressiveness="3" team="10"/>
</players>
</map>

To allow factions that are unique to maps (and not part of the player's tech tree), it should be possible to load "external" factions. Presumably we could just create a faction folder in the map folder and dump factions in there. If the game cannot find the faction in the techtree, it checks this folder.

Other functions


There's also a few other miscellaneous functions that would be highly beneficial for this.

void changeTileWalkability(int[] coords, bool walkable)

Overrides the walkability of a tile specified by the coordinates (in the form of {x, y}). If walkable is true, the tile is walkable. Otherwise, the tile becomes non-walkable. This overrides any model or object that may be on this tile. This would be useful for making bridges over water.

void resetTileWalkability(int[] coords)

Removes an override of the specified tile's walkability. The walkability is recalculated from the objects and models that overlap that tile. This would be useful for blowing up said bridges.

void regionAIHint(string regionName, int hint)

Many regions are either beneficial or harmful for players. For example, a pit of lava is harmful while a healing aura might be beneficial. Thus, it's a good idea to give the AI hints over how they should treat regions. The hint is a number from 10 to -10, where -10 is most harmful and +10 is most beneficial. The default is zero (neutral). Thus, an AI may go out of its way to enter beneficial areas, and should avoid harmful areas unless absolutely necessary. For example, the pathfinder should treat harmful areas as unwalkable unless there's no alternative. Minor harmful areas might be worth the risk.

This command is optional and intended to prevent the AI from being *too* retarded.

It is not intended to be a long term solution. Ideally, the AI would start out oblivious and learn for itself if a region is good or bad. However, the AI has more pressing concerns, so for the mean time, such a command forms a nice AI hint.

<suggested-tileset value="tilesetName" />

This XML element is completely optional and goes under the top level map element. It suggests a tileset to use. This is a good idea, since maps with custom models are likely meant for specific tilesets and may look out of place with others. Heck, you could even use suggested tilesets on a vanilla map. This is just a suggestion, and would make the tileset in the game's set-up default to the value. If the tileset does not exist here and does exist in the download center, the game could suggest downloading the tileset.

Grand "we're-at-the-end-of-the-freaking-post" summary


Yes, that was very long. For modders, it's not as complex as you'd think. Rather, I am extremely verbose and this is very complete. Many maps would not need to know everything here. In fact, if you just want to put a big mountain model in your map, that's very easy. You just have to know the model XML in the second section, no Lua necessary. It's the developers who have the hard job. However, I believe this can be heavily compartmentalized. It is possible to implement features in baby steps while maintaining a working game. For example, we could implement the model XML first. That alone is highly useful, in my opinion. Once that's working correctly, we could add particles, then regions, and finally the Lua functions are all modular and can be added one by one. However, in order for the features to be truly useful, most of the features must be implemented.

In my opinion, the model functions are fairly low priority. Moving models can allow for things like spike traps, avalanches, moving boulders, and collapsing buildings. However, getting models displayed is more important, and regions would be much easier to use than the model funtions.

Regions are almost useless without the getUnitsInRegion() function, which is necessary to loop through units to damage. changeUnitStats() is much more useful than applyAttackBoost() (which needs additional input on how to implement the feature).

The particles are particularly useful and thankfully very simple. The most difficult aspect of the particles is that regions are not a circle or square. The engine will probably require changes to be able to spread particles over an arbitrary shape.

Neutral factions are particularly useful. In early stages, we can make all the factions aggressive and simply not give attack commands to units that are supposed to be non-aggressive (the AI runs away from attackers if there is no attack command).

The regionAIHint() can also be saved for later. The AI would likely be fairly dumb without it (depending on the map's design), but it's not a priority.

Why do we want/need this?


This change has two main benefits:

  • You now have to play the map. We have a large number of maps, but for the most part, they're very similar. Players are usually on the corners or edges, generally surrounded by trees and stones and the bases are connected by paths. With dynamic maps, you have to play against the map as well as the enemy players. You can't go waltzing off into lava. Going out of your way to explore can be beneficial. Scouting is more important. Maps can hold surprises that aren't just "yay, more resources".

    Maps also look better. All our maps are different combinations of trees, water, stones, and textures. The tileset does more than the map could. This reverses that. You can have glorious mountains, true cliffs, towering buildings, massive ruins, giant trees, portals to another world, animal dens, and more. This removes the limitations of tilesets and creates endless possibilities.
  • Modding forever. Endless possibilities is great for gamers, and even better for modders. Those ideas you imagined are no longer "technically impossible". You can create the map exactly as you wish, with the only limitation being your modeling skills (and it's easy to find static models for maps under free licenses).

Comments? Suggestions? Post below!

I hope you weren't waiting up for me, Ishmaru. 20k characters takes a while.

17
Forum discussion / [Please read] Changes to Password Security
« on: 28 July 2013, 16:12:07 »

Security changes



What we're doing


The MegaGlest forum respects the security of its users. In an attempt to further improve the security of your account, we are changing the way passwords currently work. The main reason we are doing this is because previous password requirements used very basic validation. We've since applied our own validation, ensuring that passwords meet a specific complexity. This helps ensure the password is more resistant to brute force attempts and prevent password reuse.

However, in order for this change to be of any use, it has to be applied to all accounts. To do that, we had to reset all passwords. This means that you cannot login until you change your password. You can change your password on this page, where you must enter either your username or email address and a password reset will be sent to your email address. If you encounter any difficulties, please contact us at forum-migration-2013[at] megaglest.org.

There is a three month deadline (28 October 2013) to update your account, after which time inactive accounts will be removed.

Why did you do this?


A secure password is important not only to keep malicious users from accessing your account, but also because a large number of users are reusing passwords on more valuable accounts, such as for their email or paypal. By reusing passwords, even an inconsequential site becomes a security risk, and with access to your email, a malicious user can generally access any other account you've created online, spam your address book, or uncover personal information.

Can I opt out?


Yes. If you are not happy with the forum migration, our changes to account security, or no longer desire an account on the MegaGlest Forum, you can request to delete your account on your profile page (this requires you to login first, to confirm you own the account).

What kind of password should I be using?


The new password requirements don't measure a specific length, but rather a specific complexity. In other words, instead of a long password, you could use a mixture of different character types. A six character lowercase password has 308,915,776 different combinations. But with lowercase and uppercase characters, there are 19,770,609,600 different combinations, an increase of nearly 64 times! As you can expect, adding symbols, numbers, and unicode characters increase the number of combinations even further.

So in addition to a long password, consider using a mixture of character types. Alternatively, you could use passwords that are extremely long, as demonstrated in this comic. The technique doesn't matter, the end goal is the same: preventing your password from being brute forced in a reasonable time. So in summation: long passwords or a mixture of character types are the way to go.

We recommend using a password manager such as KeePass or LastPass. Password managers allow you to use strong, unique passwords on all sites while only needing to remember a single master password.

If you have JavaScript enabled, the change password screen will have a bar at the bottom which will estimate the strength of your password.

FAQ


What's stopping people from changing their password to the same password they were using before?


Nothing. If you were using a secure password previously, you're welcome to continue doing so. There's no way to find out how secure everyone's passwords' are, so it was necessary that we reset everyone's. The only requirement is that your password is at least reasonably secure.

This doesn't stop people from reusing passwords!


No, it does not, and we have no way to enforce that. The best we can do is bring it to people's attention. At least they can't say we didn't try.

Can I use unicode in my password?


Yes, our password system supports unicode characters. In fact, a unicode password of a reasonable length (excluding ASCII characters) is nearly impossible to brute force, due to the massive number of characters. However, typing unicode characters can be difficult. We recommend you do not use characters which you cannot easily type.

What's stopping us from using a password like "aaaaaaaaaaaaaaaaaaaaaa"?


Such a password would be a terrible choice, since it's not necessarily any easier to remember than a chain of four words (since you have to remember the number of "a"s). Irregardless, our improved system catches repeated characters and will not allow such a password. Similarly, series of characters (like 1234567890) are prohibited by the password system.

I don't like this!


We're sorry you feel that way. This change is not intended to be an inconvenience to our users, but rather a measure of making sure that your accounts (both here and on other websites) are as secure as possible.

18
Nowadays, at least with Firefox and Chromium/Chrome, there's another option (which others may adopt, yet): The HTML5 desktop notifications standard makes it technically feasible to have the play.mg website (i.e. the masterserver code) notify when a server becomes available (someone would yet need to implement this - patches welcome!), so it would only take a running web browser to know when new servers are available. However, this doesn't allow you to connect to a server on the click of a button, yet. This would take a bit more (mostly) platform specific client code. I actually started writing some quick and dirty server side code for this (which is already live), but the client side handlers are missing as of yet. Once done, such code could be added to the MegaGlest installers, though, so it would become universal.

I'm happy to discuss this in more detail if anyone is interested in spending time on this.
I might be interested in taking a look at this. Feel free to go on in more depth, including what the notification should say and how (when) it should be fired.

19
Feature requests / In-game Lua Console
« on: 16 July 2013, 20:15:35 »
One little known feature of GAE that I found useful was the Lua console that it had. Pushing the ~ key would open a small window in the bottom right corner of the screen, in which you could type in Lua commands, which would be executed. This made testing of mods and scenarios very easy, as you could quickly generate units and such. I'd like to propose that a similar feature is added in MegaGlest, for the purpose of making it easy to test the game (and it would also satisfy the desires of those who want "cheat codes").

The console would be single line for simplicity. Every time the enter key is pressed, the contents of the current line would be parsed. If possible, it should be able to interact with Lua scripted scenarios as well, meaning you could change the value of a variable in a scenario (great for testing and debugging scenarios). The console should be disabled in multiplayer.

20
Feature requests / Water Improvements
« on: 4 June 2013, 00:09:43 »
It's been mentioned before that the water could use improvements. Water's obviously really hard to do. Even professional games that have a heavy emphasis on water don't have flawless water (yet). This post is made with the long term in mind. Presumably if better water is implemented, such a thing would be far in the future and would take some work. In the mean time, I'd like to brainstorm ways we could improve the water.

Actual fluid dynamics seem like serious overkill, given the camera angle of the game, not to mention they're computationally intensive. That means we're going to need to fake the water, which is fine. Most games do that and it still looks great. There's two things great water would need: refraction and reflection.

These are mostly ideas, not necessarily a proposal at the time.

Refraction


If computationally feasible, objects that protrude below the surface of water should be refracted (the view should be bent). Refraction is this. The angle of refraction is pretty easy to calculate with some basic physics (Snell's law), although I'm not sure how one would draw the underwater portions of the model. Thankfully, the angle of MG's camera allows refraction to be largely skipped, if desired.

Reflection


This is the important one. In particular, we would need to reflect light. That's with the intent of creating this kind of effect. This will require a water shader, which needs to be variable with the time of day (the colour of the reflected light should change with the day/night colour and sun/moon position). The water itself would be created from a normal map (aka, a bump map). The current tileset method of creating animation frames from still images would become obsolete. An image could still be used to colour the water, however (and control opacity). The lighting should also differ when there is rain (tileset specified?).

But more than just light, water needs to reflect the sky. MegaGlest's problem is that there is no sky. Thankfully, this is one is easy to fix. Fog of war and the camera angle makes it useless to show the sky from the side, so the sky would end up being a single texture stretched over a large area. This sky texture should be specified in the tileset, but for ease of use, we could provide a default sky texture to fall back on (since I'd imagine many tilesets wouldn't need to change the sky texture). The texture would be specified as an image to show over a certain in game clock. For example, we might have one texture for 5am to 9am, then a different one from 9am to 6pm and so on (at the simplest, you'd need a day texture and a night texture). These textures should slowly fade into each other (say, over the course of one in-game hour). I also think the fog of war should change colour by time of day, going from silvery-grey at day to the current black at night.

Blur and depth perception


Currently, you can see through water really easily. A faded cutoff distance could look more realistic. Perhaps this could also be specified in the tileset, so we can have tilesets with crystal clear water and others with dirty, nearly opaque water. Alternatively, we could blur things under water, increasing the blur as we go deeper. Or both.

Again, I'm aware some of these ideas are really ambitious, and others might be impractical. I just wanted to start a discussion as to what we could look at for water improvements in the future.

21
I tried out rev 4260. Attempting to close the window while in the "internet game" screen crashed the program with an error. It looped an infinite number of dump files, and I've uploaded the first one here. I was able to reproduce this issue each time. Program was customly compiled with Microsoft Visual Studio 2010 using the included batch files. Noteworthy that despite the fact I was using the most recent version of the SVN trunk, there may have been files out of date, since I had a language string warning about an unset username when entering the internet game screen.

I also got this error, which was not written to any logs:



Because the dump files were continuously created, I had to kill the process from the task manager.

I'm not sure if this part is any use, but here's the output from --verbose as a 154 KB pastebin: http://pastebin.com/raw.php?i=Rvj6jVgt

EDIT: I didn't post this as a new topic because it was meant to follow up a feature implementation (or bug fix?). Since it has now been moved, additional details are required: this bug is likely caused by the changes in rev 4259, as it was not reproduceable in prior versions and only occurs when exiting the internet game screen, which formerly hung for several seconds before closing. As mentioned by Carolinus, this does not affect closing the game window from other screens. Closing the game window is defined as clicking the "x" in windowed mode.

22
OS: Ubuntu 12.04

As found by Wciow in the IRC earlier, getUnitsForFaction(int index, string command, int field) isn't treating the field (an integer where 0 = land and 1 = air) as optional (or at least it's not when a command has been entered). This also means there's no way to get all the units in the faction (besides two function calls), as you have to specify a field.

23
Forum discussion / [Forum] The next step
« on: 21 March 2013, 11:23:15 »
As you've all probably noticed, the board has been moved to the MegaGlest site. I'd like to raise the question: what next? Do we want to further convert the board to be the MegaGlest board, or leave it as it is?

The first thing that could change is the logo. Glest is a good catch-all, but the title of the forum clearly read "MegaGlest forum" (I liked "board" better, though). We could replace the Glest logo with the MegaGlest logo. However, either the logo would have to be shrunk or the header will have to be expanded. Personally, the shrunk logo looks kind of strange to me. The other alternative would be a modified logo that's adapted to look best as a horizontal shape. However, I don't know how the logo was created.

But with that being said, we could even go a step further and redesign the theme so-as to make the forum fit in better with the site. Although I have no ideas for that, and it's a very large change. The current board theme also facilitates readability well.

Anyway, the next potential change would be the categories and boards. We could move MegaGlest down from being a separate board and encompass general discussion with it. Put GAE and mandate in a separate category. I'm not sure if the former will ever be developed. Developer interest is non-existent.

And... that's really about it. Unless anyone wants to bring up old, failed proposals like karma systems or posting limitations. So, Glest community, what are your thoughts?

On a side note, I think we should look at a new favicon for the site, as the current one doesn't look very good, in my personal opinion. It also scales poorly to favicon size (usually 16x16). With that being said, though, I also have no ideas as to what a successor could look like (although the same style as the Glest favicon but with an M instead of a G could be cool). Such an icon could also be used for the executable.

24
Feature requests / Remove the stupid linux hint
« on: 20 February 2013, 08:04:17 »
I think we should remove hint 42, which reads Linux is the best operating system.. ever.. period :). Why? Because it's stupid and childish. Never mind the incorrect ellipses or the childish smiley face, MegaGlest is cross-platform. Obviously there's a big Linux following here, and that's great. Free and open source software is also great. But this is just ridiculous.

Why don't we also add a hint that says "White, German, blonde-haired, blue eyed humans are the best people.. ever.. period :)"?

25
Off topic / Steam on Linux
« on: 15 February 2013, 03:53:45 »
There's a big linux community here, so I thought I'd let everyone know that Steam is now available on Linux and there's currently a sale on all Linux compatible games (valid until 21 February 2013).

If you're not already familiar with Steam, it's basically a large store and management application for games (and perhaps other types of programs in the future). While technically a mode of DRM, I could argue that it's the most versatile DRM. Buy the game once, play on any system it supports and install it on any number of computers. Of course, you can only have one person logged into a Steam account at once, which is very reasonable (we can't have all games free). Steam tends to be a lot more reasonable with its prices than most other sources. Sales are common, with games often being discounted massively (myself, I have so many games I haven't even started to play half of my Steam library).

Anyway, long story short, I'm not really trying to sell Steam to you, just giving everyone a heads up that a number of Linux titles are now available on Steam. The selection is currently very small (it's being expanded and Valve is planning to release a console that will utilize Linux as an operating system), but there's some gems out there such as Team Fortress 2 (free), Faster Than Light ($4.99), Trine 2 ($3.74), Anomaly ($4.99), World of Goo ($2.49), Amnesia: The Dark Descent ($5.00), and CounterStrike: Source ($4.99). Mostly indie titles, but it's expected to see more big names soon. All the listed games score 80 or higher on Metacritic.

Steam's also the most common medium for purchasing games on sites like Amazon or directly from developers, since all they need to do is give you a Steam key and Steam handles the rest. As a side note, Steam does have regional pricing. The prices I listed are the North American prices. The European site, for example, uses the Euro while the Australian site uses the Australian dollar. Sadly, the regional prices sometimes don't match up. Australian gamers, for example, are better off on a site like GOG, which ironically sells Steam keys and sometimes at better prices. Of course, at the moment, the linux Steam library is heavily discounted on the Steam store.

Purchasing a game on Steam will work on all operating systems it supports. So if you were to buy Faster than Light for your linux system, it would also work on Windows or Mac (just download Steam on the appropriate OS and log into your account).

Steam Linux Sale
(valid until 21 February 2013; 10:00 am PST)

Pages: [1] 2 3 4 5 ... 10