Galcon 2: 37 players online!
:: Community ::
ForumsMessagesModsChat
 

Forums :: [ANCIENT] Desktop :: Mods :: Galcom API tweak?

You must sign in to post.

Page 1 / 1 1 

Galcon API tweak? :: May 9, 2007 @ 11:02am

Ensign SirGnip

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

Phil,

Small suggestion for the next iteration of the modding api.  In the Level.hit() method, could you add a reference to the fleet doing the "hitting"?

So, this:

def hit(self,user,ships,p):

would become this:

def hit(self,user,ships,p,fleet):

This way, as ships were hitting a planet, we could know what fleet those ships belonged to.  Looking at the sample mods, I see no way to determine this info from what is there.

The use case driving this is that I'm subclassing Fleet() and adding a few members of my own to it in Level.fleet().  So, when ships are hitting a planet, I'd like to be able to know what fleet the ships belong to so I can query my custom Fleet data members and take appropriate action.

Also, it may be just as easy to replace the "user" parameter with "fleet", since a reference to the user can easily be retrieved from the Fleet object.  So, having both "user" and "fleet" passed into the function would be redundant.  So, it would become:

def hit(self,fleet,ships,p):

Thoughts?

EDIT: (shesh, I did it again.  Can't believe I misspelled Galcon in the topic...)
post updated on May 9, 2007 @ 11:03am
Re: Galcom API tweak? :: May 9, 2007 @ 11:43am

Ensign philhassey

Clan: Galconicorn
Joined: Nov 30, 2006
Posts: 6034
Location: Zarcon

The Developer
def hit(self,fleet,ships,p):

Good idea that.  I'll see about making that change for the next release.  Will certainly open up some nice possibilities.

- Phil

p.s. if you have any other API change requests, *now* is the time :)  (In the future, when more people have written mods, etc, change won't be so readily available.)
post updated on May 9, 2007 @ 11:44am
Re: Galcom API tweak? :: May 9, 2007 @ 12:09pm

Ensign SirGnip

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

Nice!

How long is the mod beta going to last?  I'd love to hammer out a few more mods (I've got some more ambitious ideas) and get you more feedback before final release.  But, day job is a drag right now...

As long as we can subclass all existing classes (Planet, Fleet, Level, Bot, Player, Neutral) and have the construction of the above classes under mod control I'll be fine!  From my brief tinkerings, it looks like this is all there.

A bit more far reaching would be the ability to have a mod control the game's main states to allow a mod to be more than just one round of Galcon: (ex: mission info -> gameplay -> stats screen -> debriefing -> mission info -> gameplay , etc.).  It looks like this might be currently possible (galcon.State), but I haven't poked around to see how to transition between states, etc.

Oh, any way to expose ship-level control to mods?  Ex: ability to iterate over all ships in a fleet, destroy a ship while in flight, control ship flight speed, change destination of only a part of a fleect, change ownership of a ship in a fleet, etc.  Or, would this muck with the ship flocking code? (written in C, correct?)  I'd even settle for a mod-exposed way to know the visual center of a fleet (I now this exists game-side as when a fleet is selected mid-flight, there is a circle drawn around the fleet, centered at a point that looks like the center of a fleet.)

Ok, I've babbled far too long...  Oh, and GUI widgets for mod-definable options would be very nice!  I guess there is enough exposed for modders to do this themselves as well (ability to draw and catch mouse/keyboard events).

Thanks Phil... This is more fun right now than playing Galcon...
Re: Galcom API tweak? :: May 9, 2007 @ 1:41pm

Ensign SirGnip

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

Minor API tweak I just thought of.  Currently, the player and bots are assigned colors that their planets will display (the player is always the blue/green planets and the bots are various other colors).  Is there some way to get this color from the User class?  I'm looking for a way to query each player's color so I can draw visual indicators on the screen (beyond planets and ships) that are drawn in the color of each player.
Re: Galcom API tweak? :: May 9, 2007 @ 2:10pm

Ensign philhassey

Clan: Galconicorn
Joined: Nov 30, 2006
Posts: 6034
Location: Zarcon

The Developer
Minor API tweak I just thought of.  Currently, the player and bots are assigned colors that their planets will display (the player is always the blue/green planets and the bots are various other colors).  Is there some way to get this color from the User class?  I'm looking for a way to query each player's color so I can draw visual indicators on the screen (beyond planets and ships) that are drawn in the color of each player.


No problem - I've already added color support into the API for the next release :)  The game will (by default) use the 12 net colors, but you'll be able to change those if you want.
Re: Galcom API tweak? :: May 9, 2007 @ 2:27pm

Ensign philhassey

Clan: Galconicorn
Joined: Nov 30, 2006
Posts: 6034
Location: Zarcon

The Developer
How long is the mod beta going to last?  I'd love to hammer out a few more mods (I've got some more ambitious ideas) and get you more feedback before final release.  But, day job is a drag right now...


I'm not quite sure :)  This upcoming release will still be "beta" .. maybe another after that.

A bit more far reaching would be the ability to have a mod control the game's main states to allow a mod to be more than just one round of Galcon: (ex: mission info -> gameplay -> stats screen -> debriefing -> mission info -> gameplay , etc.).  It looks like this might be currently possible (galcon.State), but I haven't poked around to see how to transition between states, etc.


Yeah - you can do all that.  In fact, that's kind of my idea is that I'll be working on some "bigger" mods (eventually I plan to phase out the "Missions" part of the game in favor of the "Mods" part of the game :)

Oh, any way to expose ship-level control to mods?  Ex: ability to iterate over all ships in a fleet, destroy a ship while in flight, control ship flight speed, change destination of only a part of a fleect, change ownership of a ship in a fleet, etc.  Or, would this muck with the ship flocking code? (written in C, correct?)  I'd even settle for a mod-exposed way to know the visual center of a fleet (I now this exists game-side as when a fleet is selected mid-flight, there is a circle drawn around the fleet, centered at a point that looks like the center of a fleet.)


I'm going to say "no" to ship level control for now (maybe later though...)  But I will see about adding in a Fleet.get_pos() method, that would be quite useful for bots.

Ok, I've babbled far too long...  Oh, and GUI widgets for mod-definable options would be very nice!  I guess there is enough exposed for modders to do this themselves as well (ability to draw and catch mouse/keyboard events).


I'm mulling this over.  At the moment you could create your own gui toolkit with what Galcon offers ... 

Thanks Phil... This is more fun right now than playing Galcon...


:)

- Phil
post updated on May 9, 2007 @ 2:27pm
Re: Galcom API tweak? :: May 9, 2007 @ 7:11pm

Ensign SirGnip

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

I'm going to say "no" to ship level control for now (maybe later though...)  But I will see about adding in a Fleet.get_pos() method, that would be quite useful for bots.


No prob.  The ship level control is just dreaming.  But, get_pos() could be really helpful.  Also, is the Level.fleets list read only?  Or, can mod code delete fleets from the list so that they cease to exist in the game?

Another thought.  Could you expose these thru the mod API?  Would be really helpful if this info was avail to mod code:
* list of currently selected planets
* the focused target planet (the planet that is highlighted by mouse rollover after you select some of your own planets)
* list of currently selected fleets

This would really help in allowing mods to have a consistent input interface (at least being able to use the info avail from the standard interface) when we want to do things that require a selected planet(s).

And, how about exposing the audio API (both background tracks (.ogg) and one-shot sound effects (.wav)?  And, volume/mixer control?  And 3D spatial audio?  And joystick/gamepad support? And 3D rendering?  And VR goggles?  NES emulation?  haptic feedback?

Ok, just kiddin'.  But, the simple audio support (SFX and background music) would be nice. :)
post updated on May 9, 2007 @ 7:32pm
Re: Galcom API tweak? :: May 9, 2007 @ 7:44pm

Ensign philhassey

Clan: Galconicorn
Joined: Nov 30, 2006
Posts: 6034
Location: Zarcon

The Developer
Heheh...

Well, maybe not all that :)

But I decided to write up a gui.py for use, because I figured that would help non-dev adoption (no more "edit some file after you unzip my mod")

- Phil
Re: Galcom API tweak? :: May 10, 2007 @ 11:28am

Ensign SirGnip

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

Are you going for flexibility (just build a few widgets and let the modders have at it), or ease of use (just pass in a tuple like above to generate an auto-gui)?
post updated on May 10, 2007 @ 12:08pm
Re: Galcom API tweak? :: May 10, 2007 @ 12:08pm

Ensign philhassey

Clan: Galconicorn
Joined: Nov 30, 2006
Posts: 6034
Location: Zarcon

The Developer
Are you going for flexibility (just build a few widgets and let the modders have at it), or ease of use (just pass in a tuple like above to generate an auto-gui)?


I'm going for flexibility.  I basically put together a basic version of www.imitationpickles.org/pgu/ (gui part) ... It would take like 30 seconds for someone to write a function to take those tuples and return the gui object.

It has these objects: Theme, Form, Button, Input, Label, Checkbox, Radio, Slider, Spacer, Image, Container, Table, Box.  It's got a nice feature set.  Some things it doesn't have and likely won't ever have: Drop-down selects, pop-up dialogs, scrollable frames, and other more sophisticated and obscure gui features.  (Someone else can build those, if they really need them.)

- Phil

(p.s. - uh, sorry - I accidentally edited your post instead of replying!)

Page 1 / 1 1 

You must sign in to post.