76
If you are a developer, please build MegaGlest on your own and get in touch to contribute (or post your patches on the forums).
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.
if(boost->allowMultipleBoosts == false) {
// Check if we already have this boost from this unit type and multiples
// are not allowed
bool alreadyHasAttackBoost = this->unitHasAttackBoost(boost, source);
if(alreadyHasAttackBoost == true) {
shouldApplyAttackBoost = false;
}
}The complication here is, if a registered user plays against a guest, how should the registered user's score be tabulated if it's based on opponent skill?The simplest thing to do is treat unregistered accounts as rank 1.
How force? If the method like "registration, or fuck off" then I strongly disagree.By force, I mean that when they try and play multiplayer on a master server (and just that) they'll encounter a screen asking for them to either login or register.
| Player | Rank | Team | Game score |
|---|---|---|---|
| Alice | 2 | 1 | 10,000 |
| Bob | 3 | 1 | 12,000 |
| Carol | 4 | 2 | 20,000 |
| AI (0.5 multiplier) | N/A | 2 | Doesn't matter |
For games I plan to get the CSV file format from play.mg (which for the moment I can't find)I wasn't aware that there was one. The desktop notifications feature that I wrote for play.mg uses JSON. Use this URL: http://play.mg/showServersJson.php. For parsing JSON with Python, see here.
I hope I don’t break git when I pull omega’s commits for this.My documentation changes are in the master, now. I recommend that you follow the same style of documentation (Javadoc style with Doxygen). It's fairly readable in the source code and produces useful documentation when combined with the Doxygen tool.
For refactoring methods I would use tools like ack to find out where this method gets called and fix them.As an aside, an IDE's "call hierarchy" feature will usually do a better job at this (as it actually parsed the files rather than blindly searching). With Eclipse, the call hierarchy is very fast due to how Eclipse indexes the files. Most IDEs should have a feature like this (although some, such as MSVS 2010, are incredibly slow and possibly inaccurate).
I also used many pointers in my editor’s classes, but mainly because I did not understand how to get a new instance of a class without a pointer. But will do better in future code.If you're interested, here's a relevant SO question and here's a portion of Stroustrup's C++ book that deal with RAII and its benefits.
For formatting I would suggest:I would disagree slightly. I'd like to suggest:
4 spaces indentation
80 characters
trying to split methods if they exceed 80 lines
/**
·*·Does·some·cool·thing.·More·details.·Yet·more·details.
·*·@param·foo·Some·foo.·Details...
·*·@param·bar·Some·bar.·Details...
·*·@return·Some·non-sense·because·I·wanted·to·demonstrate·all·the·formatting·points.·Oh,·and·this
·*·line·is·approx·100·characters·long.
·*/
int·someFunction(Foo·foo,·Bar·bar)·{
--->if·(foo·==·bar)·{
--->--->std::cout·<<·foo.getName()·<<·"·equals·"·<<·bar.getName();
--->}
--->else·if·(foo.thisLineIsVeryLong()·<·bar.toShowLineWrapping()·&&·foo.hasTehCodez·&&
--->--->--->!bar.shouldDefinitelyBeFalse())·{
--->--->//·...
--->}
--->return·foo.shimShimmyShoo(bar);
}
//·Stuff·that's·aligned·--·I·actually·dislike·aligning,·though
int·getMeaningOfLife()···················{·return·meaningOfLife;·}
void·setMeaningOfLife(int·meaningOfLife)·{·this->meaningOfLife·=·meaningOfLife;·}
const string World::getUnitName(int unitId) {
Unit* unit= findUnitById(unitId);
if(unit == NULL) {
throw megaglest_runtime_error("Can not find Faction unit to get position unitId = " + intToStr(unitId),true);
}
return unit->getFullName(game->showTranslatedTechTree());
}const string World::getUnitName(int unitId) {
Unit* unit= findUnitById(unitId);
if(unit == NULL) {
throw megaglest_runtime_error("Can not find Faction unit to get position unitId = " + intToStr(unitId),true);
}
return unit->getFullName();
}https://github.com/MegaGlest/megaglest-source/graphs/contributors 37 commits on develop since 23rd MarchIf you count the pull requests that aren't yet in the repo, there's another 28 commits.
In such a case, why even have commands on that unit?Have you played the storming scenario? I'm pretty sure that it's in all engines, since it was one of the last additions to vanilla Glest before development stopped. In that scenario, you have to accompany a summoner around the map. If the summoner dies, game over. In order to make things difficult, the summoner moves on her own and you must guard her. But that would be too easy if you could control the summoner (just make her sit in a safe place).
How does saving work in MegaGlest? I spent a lot of time modifying GAE's save and I wonder if GAE and MG do it in the same way.It dumps pretty much everything you'd need to know about the game state (eg, list of all units, stats that they have at a given time, etc) into an XML. When loading the game, that XML is read to determine what to load (eg, what units to load, their stats, etc). It largely works in a hierarchy, having factions call load methods of units, units call load methods of attack boosts, etc. The code is very messy, though. There's a great deal of commented out code. I think that's mostly because who ever implemented the save/load feature realized they don't have to save everything. Upgrade types aren't saved or loaded, for example, since they can't be changed in game, so can be loaded from the faction (although the upgrade manager and its list of in-progress/completed upgrades is saved/loaded).
For example with negative speed + spherical shape you can make very nice effects.