Author Topic: Differences in same-functions between the engines  (Read 1738 times)

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Differences in same-functions between the engines
« on: 1 October 2011, 21:28:46 »
There aren't many, and some steps have been taken to point out the MegaGlest and Glest Advanced Engine both have some functions that do the same thing, but using different code. This topic was inspired by John's post here, and hopes to list these functions that perform the same way, but using different syntax, purely in hopes that one engine (or both) will compromise. It will NOT be about deciding which is better, despite strong opinions, as that will not lead to any progress.

The way I see it, having functions that do the same thing but must be different for the modders makes it more complex (more to learn), requires more work when porting a mod from one engine to another, and is simply redundant. However, I don't think that the first to do so must necessarily be the way the engine's should implement same-features, as it's possible for one engine to have an inferior way of doing something, even if it was done first, and the later implementation on the other engine might be a better way to go. In such cases, the programmers should consider getting together and deciding what exactly to do, taking into account existing mods which may already use one system.

Finally, if implementing a new feature that an existing engine has, it should actually be a goal of the programmers to try and maintain compatibility by having the syntax the same as the other engine, unless you have some groundbreaking new idea that improves it greatly (simply a perceived "better" term to describe an XML value isn't enough). I don't expect programmers of one engine to necessarily know if the other engine has such a feature already; especially since they may not play that engine (much/at all), but if someone in the community points out "oh, the other engine has this feature and it works like...", it should be taken into consideration, even if yours was written from the ground up.



And now for the list of features that are shared in GAE and MegaGlest with different syntax. Please post below if any are missing and they will be added to the table.
Feature
GAE Syntax
MegaGlest Syntax
Loading screen images
<loading-screen>
   <background-image path="loading-screen.png" />
</loading-screen>

No XML tag; depends on an image named loading_screen.* to be present.
Regions, events, and triggers
registerRegion(name, area)
registerEvent(name)
setUnitTrigger(unitId, condition, event)
setUnitTriggerX(unitId, condition, event, userData)
setFactionTrigger(factionIndex, condition, event, userData)
registerCellTriggerEventForUnitToUnit(sourceUnitId, destUnitId )
registerCellTriggerEventForUnitToLocation(sourceUnitId, Vec2i pos )
registerCellTriggerEventForFactionToUnit(sourceFactionId, destUnitId )
registerCellTriggerEventForFactionToLocation(sourceFactionId,Vec2i pos)
getCellTriggerEventCount(eventId)
unregisterCellTriggerEvent(eventId)
triggeredCellEventId()
Timers and related functions in scenarios
setTimer(name, type, interval, periodic)
stopTimer(name)
<timer name="name"> </timer>

startTimerEvent()
resetTimerEvent(eventId)
stopTimerEvent(eventId)
timerEventSecondsElapsed(eventId)
triggeredTimerEventId()
Command queuing
Shift + Click
Control + Click
« Last Edit: 17 November 2011, 06:08:13 by Omega »
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

ultifd

  • Airship
  • ********
  • Posts: 4,443
  • The Glest Video Guy :) The one and only. :P
    • View Profile
    • My Youtube Channel
Re: Differences in same-functions between the engines
« Reply #1 on: 1 October 2011, 22:43:16 »
Good thread. Fixed your first three words...it's aren't, not isn't. :P

Psychedelic_hands

  • Guest
Re: Differences in same-functions between the engines
« Reply #2 on: 1 October 2011, 23:52:13 »
Awesome :) Thanks Omega for making this.  ;D

Hopefully the devs will see this and work together to try and fix them.... For both the modders and the players sake.  :look:

daniel.santos

  • Guest
Re: Differences in same-functions between the engines
« Reply #3 on: 16 November 2011, 22:29:51 »
Converted emission rate for all particle systems to float (commit)

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: Differences in same-functions between the engines
« Reply #4 on: 17 November 2011, 06:08:52 »
Converted emission rate for all particle systems to float (commit)
And updated. Nice job, dan!
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

 

anything