Re: WIP - Space Battles
Posted: Tue May 24, 2011 10:11 am
Yeah, just realized I messed up this release a bit I'll fix it up and do another one . . .maik wrote:If I may suggest some changes to the distribution:
For information and discussion about Oolite.
https://bb.oolite.space/
Yeah, just realized I messed up this release a bit I'll fix it up and do another one . . .maik wrote:If I may suggest some changes to the distribution:
script = "faction.js";
in each entry than to do it after spawning with shipList[i].setScript("faction.js");
.Yeah messed that one up, sorry everyone! Try version 1.1, debug switched off now . . .maik wrote:If I may suggest some changes to the distribution:
Right, I did all the key customization in javascript to keep the shipdata.plist short & simple (especially considering the choice of ships is meant to be modifiable), but of course constant stuff like that could be added to the shipdata instead.Commander McLane wrote:One suggestion for the OXP: it may be more efficient to attach the ship script in the shipdata withscript = "faction.js";
in each entry than to do it after spawning withshipList[i].setScript("faction.js");
.
The same applies to all other shipdata properties, like AI, bounty and scanner display colour.
I don't think it's a real trade-off, because the shipdata doesn't cost you anything. It also would allow anyone who is interested to poke around to understand quickly in which ways the ships are modified from their originals.m4r35n357 wrote:So in that case I'd end up with a much bigger shipdata, in which most of the data would be duplicated, is the trade-off really worth it? I don't really understand the efficiency issues . . . is there a simple explanation?
setScript
, and then the NPC-shields will be able to make its amendments. If the NPC-shields script runs first, it will make amendments to the default ship scripts of the factions ships, and then the Factions script will trash those scripts entirely and replace them with your script. In this second case the factions ships would not have shields. The same would apply for other OXPs that amend ship scripts on spawning.I hadn't really planned on that at this stage, and am not a particularly creative writer If the OXP gains wide usage that might change things . . . but I'd like to take care of the technical stuff first in case I suddenly find myself without enough spare time!maik wrote:Moved it from the WIP to the main section of the [wiki]OXP List[/wiki] and renamed it Factions. Are you planning to give it its own wiki page?
Yes, that's better.m4r35n357 wrote:Yeah messed that one up, sorry everyone! Try version 1.1, debug switched off now . . .maik wrote:If I may suggest some changes to the distribution:
http://www.box.net/shared/3rp8udhdff
I'm not a big fan of the declarative side, this was more of an exercise in learning JavaScript for me, as well as the Oolite js and AI APIs Also I really like conciseness, hence the one-liners in the js.Commander McLane wrote:I don't think it's a real trade-off, because the shipdata doesn't cost you anything. It also would allow anyone who is interested to poke around to understand quickly in which ways the ships are modified from their originals.
The ships are spawned half way down the lane, so timing is not an issue either. I'll watch out for the system entry delay next time I play.Commander McLane wrote:As for efficiency it's just a guess, but I think it should be faster to create the ships with their correct properties right away than to create them with their original properties and then modify them after the fact. The difference in processor time will be marginal, though. For me it's just cleaner.
I'll have to think about this one a bit more offline, but for now if it just means that there is uncertainty over the precise capabilities of the Faction ships, I'm not too bothered because they are only fighting each other; player bewareCommander McLane wrote:There is also the question of possible OXP-clashes. For instance, NPC-shields.oxp inserts a piece of script into each ship's ship-script after the ship is spawned. I think it's indeterminable which script will run first. If Factions runs first, the ships will get their custom script via thesetScript
, and then the NPC-shields will be able to make its amendments. If the NPC-shields script runs first, it will make amendments to the default ship scripts of the factions ships, and then the Factions script will trash those scripts entirely and replace them with your script. In this second case the factions ships would not have shields. The same would apply for other OXPs that amend ship scripts on spawning.
It is likely it gains wider usage if people can read more about it than just the one-liner in the OXP List. I can whip something up from the contents of your readme when I find the time.m4r35n357 wrote:I hadn't really planned on that at this stage, and am not a particularly creative writer If the OXP gains wide usage that might change things . . . but I'd like to take care of the technical stuff first in case I suddenly find myself without enough spare time!maik wrote:Moved it from the WIP to the main section of the [wiki]OXP List[/wiki] and renamed it Factions. Are you planning to give it its own wiki page?
That would be absolutely fantastic if you could do that! I'll have a think if there's anything else I can add to the README . . . .maik wrote:It is likely it gains wider usage if people can read more about it than just the one-liner in the OXP List. I can whip something up from the contents of your readme when I find the time.
OK, Version 1.2 . . . http://www.box.net/shared/k9yozhokpjCommander McLane wrote:However, it is still missing a license. So, strictly speaking, nobody may use it.
Alright, you can find it here.m4r35n357 wrote:That would be absolutely fantastic if you could do that! I'll have a think if there's anything else I can add to the README . . . .maik wrote:It is likely it gains wider usage if people can read more about it than just the one-liner in the OXP List. I can whip something up from the contents of your readme when I find the time.
Wow, that is absolutely brilliant - Thanks!maik wrote:Alright, you can find it here.
Code: Select all
// Each faction starts this fraction away from the site
this.$start = 0.3;