Check out The Maze of MADNESS 2.0!! (Free Web Adventure Game!)

Forums :: Mods :: 1.2.1 Tech Update

You must sign in to post.

1.2.1 Tech Update :: May 10, 2007 @ 10:36pm

Ensign philhassey

Joined: Nov 30, 2006
Posts: 797
Location: Zarcon

- Mods can be dropped into your mods folder as zips and run directly :)
- Fixed classic.py of a few bugs
- Output is sent to data/log.txt for those who are interested in such things
- Added teams & colors support - see ex_teams
- Added fleet color & speed control - see ex_cloak, ex_speed
- Improved mapedit to support more users
- Added gui.py - so now users can choose their options without hacking in some obscure my_crazy_options.py file.  See ex_gui
- def hit(self,fleet,ships,p) - please note, your 1.2.0 mods won't work until you update to this.  They'll crash.
- User color available as user.color
- get_mouse_pos -> mouse_get_pos()
- get_key_mods -> key_get_mods()
- get_char -> key_get_char()
- fleet.get_rect() - returns the rough position of a fleet.     Might be a bit slow.  See ex_zones
- player.from_ and player.hover are readonly variables showing the user's current selections.  See ex_zones
- Licensing updated in various files.  Generally - template stuff is "public domain", libraries / toolkits are "LGPL".

There are 3 licenses which I'll rec. using in Galcon mods:
1. "public domain" - means you're surrendering the code to the general public to do as they see fit.
2. "LGPL" - means it's open source, but if people modify the file, their modifications must be reusable by anyone else.  You have to share updates to "LGPL" files.
3. "Copyright" - means it's shared source, and you aren't allowing others to base code off this.  I'd rec. against using this unless you plan on releasing a commercial Galcon mod (say you spend the next six months making something amazing.  In which case, contact me and we'll talk about distributing and selling it via the Galcon website :)

If you want to get your mod into an official Galcon release:
- Have all files be licensed as "public domain" or "LGPL"

Anyway, probably another release or two until we're out of beta with these mods.  Thanks eckels and SirGnip for all the great feedback and cool mods :)

- Phil
Re: 1.2.1 Tech Update :: May 11, 2007 @ 7:55am

Ensign eckels

Joined: Mar 4, 2007
Posts: 200

That's a whole lot of awesome, Phil. I'm sure I'll be asking you about everything on that list soon.

 --- EVERYONE ELSE READ THIS ---

Just an important note for anyone who's working on mods (at least on a mac, anyway) - if you've saved them in the resources/mods folder, and you install the new version of Galcon, you lose what was in there - even if it's in different folders than what is being written. 

MAKE SURE YOU BACKUP YOUR WORK OUTSIDE OF THE GALCON FOLDER BEFORE INSTALLING!
Re: 1.2.1 Tech Update :: May 12, 2007 @ 9:43am

Ensign SirGnip

Joined: Dec 27, 2006
Posts: 59
Location: Chi-town

Nice, Phil!  All of those additions above just continue to open things up.

Thanks for changing the signature of "hit(self,fleet,ships,p)"  Very helpful.  In the same vein, another suggestion.  Since fleets are currently one of the only objects in the game that have game-affecting dynamic lifetimes, can you add some kind of callback so that mods can tell when a fleet object is finished (finished fortifying own planet, exhausted after attempting to conquer an enemy planet)?  Either a callback on Level that is called when a fleet object is about to be removed:

Level.OnFleetFinished(self, fleet)

Or, a method on Fleet (OnFinished?) that galcon calls when a fleet is finished?  I would prefer a method on Fleet so that we can easily subclass Fleet and then catch that edge.  I'd stay away from the slightly more common function name "destroyed" as "destroyed" can be confused with fleets being conquered or something like that and the method may be mistaken as something that is called only when the fleet was unsuccessful, rather than a fleet "going away" regardless of its success.  Splitting hairs...

Another question.  If we release version rev 0.5 of a mod as LGPL, can we release rev 1.0 as "copyright"?  Basically, what freedom (I'm assuming not much) is there in taking code from one license to another?  I'm assuming once it is LGPL'ed or public domain-ed, that code is forever "tagged" as such and can not be used in a commercial product?  Forgive my absolute ignorance on the topic...
Re: 1.2.1 Tech Update :: May 12, 2007 @ 7:25pm

Ensign philhassey

Joined: Nov 30, 2006
Posts: 797
Location: Zarcon

Interesting idea about the fleets.  It could be done, but why?  If there's a really cool idea behind that, I'll be more tempted to bother.  (At the same time, you could track that yourself if I didn't bother...)

Regarding licensing - if you license something as LGPL and then later list it as just "Copyright (c) SirGnip" .. The older version is still "LGPL" but the newer stuff is yours.  People can still do open source stuff with your older version.  However, if people contribute patches to that file, it will pretty much be "stuck" as open source unless you get the contributors permission to change the license.

You'll have to do some reading on the internet about it, but the reason I like the LGPL license is that it encourages open source activities "hey, this is open source, contribute to it" but it doesn't require that your whole project is open source.  For example, pygame is LGPL, and I'm able to use it to build Galcon but Galcon doesn't have to be open source.  Similarily, my pgu library is LGPL, and I'm able to use it in Galcon.  ... Which goes to say, you can have a mix of LGPL stuff and newer non-open source stuff in the same project.  

(Your best bet to understanding the LGPL is again, the internet, not me.  I'm probably explaining this horribly.  If you also read up on the GPL license, it's a more forceful open source license, which makes it harder to transition to commercial, but still doesn't prevent it.)  

- Phil
post updated on May 12, 2007 @ 7:28pm
Re: 1.2.1 Tech Update :: May 12, 2007 @ 8:52pm

Ensign SirGnip

Joined: Dec 27, 2006
Posts: 59
Location: Chi-town

Interesting idea about the fleets.  It could be done, but why?  If there's a really cool idea behind that, I'll be more tempted to bother.  (At the same time, you could track that yourself if I didn't bother...)

Two reasons I brought this up.  #1 - I'm working on a mod where fleets can carry something.  If the fleet carrying the object fails in its attack of a planet, the object it is carrying is lost.  I have this working now by keeping a reference to the fleet and doing a "if myfleet not in self.fleets.values()" to see if the fleet is still around.  This works, but seems a bit hacky.  In addition to the mod I'm working on, I've also thought about doing a "capture the flag" mod using this same mechanic.  #2 - I'm just trying to help pound on the mod API and see what could be added/tweaked while things are still in Beta.

And, thanks for the reply on the licensing.  When I have a chance, I'll have to do a bit of reading...
Re: 1.2.1 Tech Update :: May 12, 2007 @ 9:54pm

Ensign philhassey

Joined: Nov 30, 2006
Posts: 797
Location: Zarcon

Those are interesting ideas ... I've made a note of your callback suggestion.  Not sure if I'll implement that one or not, but I'll think about it :)  Keep up the good ideas!

You must sign in to post.