Just when I thought I was out...
Moderators: winston, another_commander
Roberto, I was thinking that if you're updating the Taranis Corp OXP it might do well to have a couple Frigates. It only makes sense that the Navy would allow their contractor to keep a few in a private defense fleet. If you're interested, and want to send me an image baring the Taranis Logo (no background just the logo) I could put one together for you in short order.
Heh - "ease myself back in" indeed! I've spent much of this evening running up against my own limitations Still, I guess the only way from here is up...
On the texturing front...
I've tried tinkering with the main texture - even installing a new graphics program, GIMP, to see if that would help me - but only succeeded in making it worse I think the problem (aside from my woeful lack of knowledge when it comes to computer-arty stuff) is that the sheer size of the model relative to the dimensions of the texture (512 x 512) means it ends up being pretty lo-res. I deliberately held back on the texture size to prevent the thing from crippling performance on lower-spec machines - do you guys think this was the right decision, or would it be safe to go higher? For now I've just made a very subtle change and moved on to the docking bay...
Well, I say moved on - mostly what I've done is (attempt to) read up on this whole materials/shaders malarkey, while uttering such exclamations as "Oh, Jesus Christ!" and "But... but... how?!" and wishing I had more liquor to hand My goal is to emulate the "glow" of the docking bay on the Navy Station (with Sung's textures). My best hope would appear to be borrowing from Griff's Illumimated Docking Bay OXP (assuming he would be OK with this).
Now then... The Shaders dictionary in shipdata makes sense to me. The shaders themselves... Would I be right in thinking that ahruman-generic.vertex is an all-purpose vertex shader that'll give reasonable results with anything? Similarly, will griff_dockingbay.fragment work with my textures? Looking at the code for this scares me, quite frankly - I can see how to adjust the "glossiness" and the glow colour, I assume I can lose the two "uniform float" lines near the top, but I'm stumped by just about everything else! My fear is that some of this stuff is linked to coordinates on Griff's textures - if this is the case, then I'm probably screwed.
And then we come to the textures themselves, which is where I'm going to sound really stupid Clearly I need three textures - my standard one (the equivalent of Griff's unshaded_diffuse texture), the standard one simply renamed (for the shaders to use) and a third one containing red- and blue-channel information. Now, I can see how to select each channel of an image separately in GIMP. But, uh, what do I actually do? In what channel(s) should I draw, and with what colour/type of tool, to end up with my nice blue-, red-and-black texture, with red denoting "constant light", blue "ambient light" and black "shadow"?
On the AI front...
@Eric Walsh
The HQ successfully launches defence ships despite not having the station role. I'm assuming that increaseAlertLevel is working too, though that's not so observable. Here is the DEFENSE_MODE part of the AI, so you can see the full picture:
setTargetToPrimaryAggressor - yes, I spotted the new info on this on the Wiki. Will setTargetToFoundTarget work as a response to ATTACKED and "INCOMING_MISSILE"? Or does it require a scanFor...?
@matt634
The HQ is already ridiculously well defended, but it might be nice to have a random chance of encountering a Frigate undergoing a final test flight in the system, prior to being handed over to the Navy. I could even have it perform a weapons test on a stationary target! Let me know what you think - at the moment I've got more than enough on my plate, but it would make a nice finishing touch to the package
On the texturing front...
I've tried tinkering with the main texture - even installing a new graphics program, GIMP, to see if that would help me - but only succeeded in making it worse I think the problem (aside from my woeful lack of knowledge when it comes to computer-arty stuff) is that the sheer size of the model relative to the dimensions of the texture (512 x 512) means it ends up being pretty lo-res. I deliberately held back on the texture size to prevent the thing from crippling performance on lower-spec machines - do you guys think this was the right decision, or would it be safe to go higher? For now I've just made a very subtle change and moved on to the docking bay...
Well, I say moved on - mostly what I've done is (attempt to) read up on this whole materials/shaders malarkey, while uttering such exclamations as "Oh, Jesus Christ!" and "But... but... how?!" and wishing I had more liquor to hand My goal is to emulate the "glow" of the docking bay on the Navy Station (with Sung's textures). My best hope would appear to be borrowing from Griff's Illumimated Docking Bay OXP (assuming he would be OK with this).
Now then... The Shaders dictionary in shipdata makes sense to me. The shaders themselves... Would I be right in thinking that ahruman-generic.vertex is an all-purpose vertex shader that'll give reasonable results with anything? Similarly, will griff_dockingbay.fragment work with my textures? Looking at the code for this scares me, quite frankly - I can see how to adjust the "glossiness" and the glow colour, I assume I can lose the two "uniform float" lines near the top, but I'm stumped by just about everything else! My fear is that some of this stuff is linked to coordinates on Griff's textures - if this is the case, then I'm probably screwed.
And then we come to the textures themselves, which is where I'm going to sound really stupid Clearly I need three textures - my standard one (the equivalent of Griff's unshaded_diffuse texture), the standard one simply renamed (for the shaders to use) and a third one containing red- and blue-channel information. Now, I can see how to select each channel of an image separately in GIMP. But, uh, what do I actually do? In what channel(s) should I draw, and with what colour/type of tool, to end up with my nice blue-, red-and-black texture, with red denoting "constant light", blue "ambient light" and black "shadow"?
On the AI front...
@Eric Walsh
The HQ successfully launches defence ships despite not having the station role. I'm assuming that increaseAlertLevel is working too, though that's not so observable. Here is the DEFENSE_MODE part of the AI, so you can see the full picture:
Code: Select all
"DEFENSE_MODE" = {
ATTACKED = (setTargetToPrimaryAggressor, increaseAlertLevel, launchDefenseShip);
ENTER = (checkTargetLegalStatus);
EXIT = ();
"RED_ALERT" = (launchDefenseShip);
"YELLOW_ALERT" = ("setStateTo: IDLE");
"CONDITION_YELLOW" = ("setStateTo: IDLE");
"CONDITION_GREEN" = ("setStateTo: IDLE");
"INCOMING_MISSILE" = (fireECM, increaseAlertLevel, setTargetToPrimaryAggressor, launchDefenseShip);
"TARGET_OFFENDER" = (increaseAlertLevel);
"TARGET_FUGITIVE" = (increaseAlertLevel);
"ENERGY_FULL" = ("pauseAI: 1800.0", "setStateTo: IDLE");
"OFFENCE_COMMITTED" = (setTargetToFoundTarget, "markTargetForOffence: 15", launchDefenseShip, increaseAlertLevel);
"TARGET_DESTROYED" = ("pauseAI: 1800.0", "setStateTo: IDLE");
"TARGET_LOST" = ("pauseAI: 1800.0", "setStateTo: IDLE");
"NO_TARGET" = ("pauseAI: 1800.0", "setStateTo: IDLE");
UPDATE = ();
};
Forgive my ignorance - I'm feeling very stupid tonight. So in Oolite, I press (shift?) H, then close the program and look... where? It's been too long since I did any of this stuff.Ah Ahruman put a very powerful debugging tool in for this. "Target_key_dump". Select the target, press capital "H" and look inside Oolites logfile.
setTargetToPrimaryAggressor - yes, I spotted the new info on this on the Wiki. Will setTargetToFoundTarget work as a response to ATTACKED and "INCOMING_MISSILE"? Or does it require a scanFor...?
@matt634
The HQ is already ridiculously well defended, but it might be nice to have a random chance of encountering a Frigate undergoing a final test flight in the system, prior to being handed over to the Navy. I could even have it perform a weapons test on a stationary target! Let me know what you think - at the moment I've got more than enough on my plate, but it would make a nice finishing touch to the package
- JensAyton
- Grand Admiral Emeritus
- Posts: 6657
- Joined: Sat Apr 02, 2005 2:43 pm
- Location: Sweden
- Contact:
Depends what OS you’re using. (Also, it’s only enabled by default in 1.70.)Roberto wrote:Forgive my ignorance - I'm feeling very stupid tonight. So in Oolite, I press (shift?) H, then close the program and look... where? :oops: It's been too long since I did any of this stuff.
E-mail: [email protected]
- Eric Walch
- Slightly Grand Rear Admiral
- Posts: 5536
- Joined: Sat Jun 16, 2007 3:48 pm
- Location: Netherlands
Somewere deep in the aplicationfolder of OX 10 there is buried a program called "console". Search it and start it. It lets you see all logfiles. Oolite is one of them.Mac OS X 10.4, version 1.70 (I believe - am at work atm).
Alternatively you can (must as mac developer) download the 1.70 "debug menu OXP". This one has also the option to open this log file directly over the menu bar.
-----
You are right, I looked inside the OXP and saw you have set "isCarrier = true". This key also will make it act like a station and the role station is not necessary.The HQ successfully launches defence ships despite not having the station role. I'm assuming that increaseAlertLevel is working too, though that's not so observable.
----
setTargetToPrimaryAggressor - yes, I spotted the new info on this on the Wiki. Will setTargetToFoundTarget work as a response to ATTACKED and "INCOMING_MISSILE"? Or does it require a scanFor...?
I changed it recently on the wiki, but it is still not complete. Problem it that Oolite uses at least three targets.
Code: Select all
- FOUND_TARGET is what you get as result of a search,
- PRIMARY_TARGET is what the player would see in his cross-hairs,
- PRIMARY_AGGRESSOR is a latent target that the system sets as response of a missile or a laser beam.
When you are attacked and get a ATTACKED or "INCOMING_MISSILE" message the system has also put the attacker ID in PRIMARY_AGGRESSOR and with ATTACKED also in FOUND_TARGET.
It my intention to put all/some commands that change targets in a list so one can see at a glance what gets changed by what command.
- JensAyton
- Grand Admiral Emeritus
- Posts: 6657
- Joined: Sat Apr 02, 2005 2:43 pm
- Location: Sweden
- Contact:
In that case, logs live in ~/Library/Logs/Oolite/ (~ being your home folder). As Eric says, the Debug OXP provides a Show Log command.Roberto wrote:Mac OS X 10.4, version 1.70 (I believe - am at work atm).
E-mail: [email protected]
Thanks, chaps - that Debug OXP is very handy!
@Eric Walch
The HQ's AI does seem to be behaving sensibly after all - I think you were right about the "launching queue". Things are now nice and simple: both the IDLE and "CLEARANCE_GRANTED" (renamed from TRAFFIC) states are dice-rolling with no pause, but a very low probability of launching a ship. I'll fine-tune this so there's just the right amount of traffic in the system as a whole (I'm hoping to have ships launching from the system station to fly to the HQ, and ships flying to the HQ from the witchpoint).
Reading your explanation of how Oolite handles targeting, it would appear that my use of setTargetToPrimaryAggressor is OK. I've not yet witnessed the effect of an NPC ship attacking the station, but based on what you've said, I'm fairly confident it would respond correctly. Though players could still get caught in the (considerable) crossfire!
@matt634
I've added a small chance of encountering a Navy Frigate in the system (I'll sort out its AI and give it a target later). Would it be OK to include the model, texture and shipdata info within the OXP (in case someone downloads it without having downloaded yours as well)?
@Shader experts
In the absence of any feedback (so far) on my shading questions, I've incorporated the shaders from Griff's Illuminated Docking Bay OXP into mine (obviously this is subject to his approval). This hasn't caused any problems - but it's not doing anything yet either, undoubtedly because my third texture (for red- and blue-channel info) is just another copy of the standard diffuse texture! I seriously don't know what I'm supposed to do on the "channels" front, so if anyone could enlighten me, I'd be very grateful
@Eric Walch
The HQ's AI does seem to be behaving sensibly after all - I think you were right about the "launching queue". Things are now nice and simple: both the IDLE and "CLEARANCE_GRANTED" (renamed from TRAFFIC) states are dice-rolling with no pause, but a very low probability of launching a ship. I'll fine-tune this so there's just the right amount of traffic in the system as a whole (I'm hoping to have ships launching from the system station to fly to the HQ, and ships flying to the HQ from the witchpoint).
Reading your explanation of how Oolite handles targeting, it would appear that my use of setTargetToPrimaryAggressor is OK. I've not yet witnessed the effect of an NPC ship attacking the station, but based on what you've said, I'm fairly confident it would respond correctly. Though players could still get caught in the (considerable) crossfire!
@matt634
I've added a small chance of encountering a Navy Frigate in the system (I'll sort out its AI and give it a target later). Would it be OK to include the model, texture and shipdata info within the OXP (in case someone downloads it without having downloaded yours as well)?
@Shader experts
In the absence of any feedback (so far) on my shading questions, I've incorporated the shaders from Griff's Illuminated Docking Bay OXP into mine (obviously this is subject to his approval). This hasn't caused any problems - but it's not doing anything yet either, undoubtedly because my third texture (for red- and blue-channel info) is just another copy of the standard diffuse texture! I seriously don't know what I'm supposed to do on the "channels" front, so if anyone could enlighten me, I'd be very grateful
- Griff
- Oolite 2 Art Director
- Posts: 2483
- Joined: Fri Jul 14, 2006 12:29 pm
- Location: Probably hugging his Air Fryer
Hi Roberto
There's a much simpler illuminated docking bay shader in the spacebar which you can find in LittleBears Random Hits. oxp https://bb.oolite.space/viewtopic.php?t=3977 (download link on page 10 of that thread)
The relevant shader files to copy into your oxp are "griff_spacebar_dockingbay.vertex" and "griff_spacebar_dockingbay.fragment" - obviously rename them to anything you want, the griff bit isbecause i'm a massive ego-maniac just to keep my files from overwriting anybody elses accidentally! If you do rename them, make sure you update the entries in the shipdata.plist accordingly.
You'll just need to provide 1 texture map for this shader - just the usual type, no need for any colour channels or anything like that, just replace griff_spacebar_dockingbay.png in the code below with the name of your texture, notice it appears twice, the first instance is the name of the texture to use if shaders are switched off or not supported on the players computer, the second instance is the name of the texture to use if shaders are enabled - so you can provide different textures depending on wether shaders are on or off or just use the same texture for both as in this example. make sure your .dat file references the no shaders texture.
The shaders entry in the shipdata.plist looks like this:-
or in XML, it looks like this:-
There's a much simpler illuminated docking bay shader in the spacebar which you can find in LittleBears Random Hits. oxp https://bb.oolite.space/viewtopic.php?t=3977 (download link on page 10 of that thread)
The relevant shader files to copy into your oxp are "griff_spacebar_dockingbay.vertex" and "griff_spacebar_dockingbay.fragment" - obviously rename them to anything you want, the griff bit is
You'll just need to provide 1 texture map for this shader - just the usual type, no need for any colour channels or anything like that, just replace griff_spacebar_dockingbay.png in the code below with the name of your texture, notice it appears twice, the first instance is the name of the texture to use if shaders are switched off or not supported on the players computer, the second instance is the name of the texture to use if shaders are enabled - so you can provide different textures depending on wether shaders are on or off or just use the same texture for both as in this example. make sure your .dat file references the no shaders texture.
The shaders entry in the shipdata.plist looks like this:-
Code: Select all
shaders =
{
"griff_spacebar_dockingbay.png" =
{
vertex_shader = "griff_spacebar_dockingbay.vertex";
fragment_shader = "griff_spacebar_dockingbay.fragment";
textures = ("griff_spacebar_dockingbay.png");
};
};
Code: Select all
<key>shaders</key>
<dict>
<key>griff_spacebar_dockingbay.png</key>
<dict>
<key>textures</key>
<array>
<string>griff_spacebar_dockingbay.png</string>
</array>
<key>vertex_shader</key>
<string>griff_spacebar_dockingbay.vertex</string>
<key>fragment_shader</key>
<string>griff_spacebar_dockingbay.fragment</string>
</dict>
</dict>
Last edited by Griff on Sun Dec 09, 2007 11:29 am, edited 1 time in total.
Thanks guys.
@matt634
My thinking is that it's a ship that's undergoing final testing prior to being delivered to (or picked up by) the Navy, so it should probably be the same as a standard Frigate design-wise. Having said that, there's no reason why it couldn't have a "test" paint job (perhaps "painting" each ship in the Navy style is the last thing to be done), so I've done you a Taranis logo on a transparent background (it's really basic stuff - just a couple of custom shapes and some text in Photoshop). I've chosen a random light blue, but feel free to make it whatever colour you want. PM me your email address and I'll send it over to you. Looking forward to seeing what you come up with
@Griff
Cheers - I'll give that a try. I'm kind of curious about the use of colour channels, though - I'm assuming that would enable me to play around with areas of light and shadow, whereas the simpler shader is more of an overall-illumination thing? If I knew how you ended up with your red/blue/black image for the more complicated shader, I could give it a go. I'll try looking at GIMP's help info...
@matt634
My thinking is that it's a ship that's undergoing final testing prior to being delivered to (or picked up by) the Navy, so it should probably be the same as a standard Frigate design-wise. Having said that, there's no reason why it couldn't have a "test" paint job (perhaps "painting" each ship in the Navy style is the last thing to be done), so I've done you a Taranis logo on a transparent background (it's really basic stuff - just a couple of custom shapes and some text in Photoshop). I've chosen a random light blue, but feel free to make it whatever colour you want. PM me your email address and I'll send it over to you. Looking forward to seeing what you come up with
@Griff
Cheers - I'll give that a try. I'm kind of curious about the use of colour channels, though - I'm assuming that would enable me to play around with areas of light and shadow, whereas the simpler shader is more of an overall-illumination thing? If I knew how you ended up with your red/blue/black image for the more complicated shader, I could give it a go. I'll try looking at GIMP's help info...
Gah! I've been trying to get to grips with this for two hours now, and it's really starting to damage my calm...
It seems like I have two choices. I can either:
1. Draw directly onto the image in white, black or any shade of grey, with one colour channel selected. Drawing in white boosts that colour to 100% (in the area of the image where I'm drawing); black takes it down to zero.
2. Use "selection masks", which would appear to work like layers that I can edit separately and then apply to a channel.
The second option would appear to be the smart one - except that it's stubbornly refusing to behave. For some reason selecting black means it draws in white (why? why?!), and it keeps wanting to turn what I've drawn into a selection, which then prevents me from drawing anywhere else
I'll give it another go tomorrow, but if any graphically able person could tell me whether I'm at least on the right track, that would be great
It seems like I have two choices. I can either:
1. Draw directly onto the image in white, black or any shade of grey, with one colour channel selected. Drawing in white boosts that colour to 100% (in the area of the image where I'm drawing); black takes it down to zero.
2. Use "selection masks", which would appear to work like layers that I can edit separately and then apply to a channel.
The second option would appear to be the smart one - except that it's stubbornly refusing to behave. For some reason selecting black means it draws in white (why? why?!), and it keeps wanting to turn what I've drawn into a selection, which then prevents me from drawing anywhere else
I'll give it another go tomorrow, but if any graphically able person could tell me whether I'm at least on the right track, that would be great
- Griff
- Oolite 2 Art Director
- Posts: 2483
- Joined: Fri Jul 14, 2006 12:29 pm
- Location: Probably hugging his Air Fryer
Hi Roberto
Yeah, the spacebar illumination shader won't allow you to specify any variations in illumination or shadow, it basically works by simply not including any lighting calculations in the fragment shader so the illumination level is constant across the whole object.
I wrote out short pdf document talking a bit about the shaders used in the griff_boa. It mainly deals with getting models and maps into rendermonkey ( a free windows only shader development program) but there's a short tutorial using photoshop to split an images colour channels to drive some specularity shader effects.
You can download the pdf here http://www.box.net/shared/ig02aaj6e6 (about 950Kb), i think it's also included in the griff_boa oxp (along with the texture maps .obj format models and the rendermonkey .rfx files )
When you're working in seperate colour channels in an image they will appear as greyscale images, when you combine them all back together that's when you'll see then as mixtures of red, green and blue. the pdf above explains how to split and recombine colour channels.
Yeah, the spacebar illumination shader won't allow you to specify any variations in illumination or shadow, it basically works by simply not including any lighting calculations in the fragment shader so the illumination level is constant across the whole object.
I wrote out short pdf document talking a bit about the shaders used in the griff_boa. It mainly deals with getting models and maps into rendermonkey ( a free windows only shader development program) but there's a short tutorial using photoshop to split an images colour channels to drive some specularity shader effects.
You can download the pdf here http://www.box.net/shared/ig02aaj6e6 (about 950Kb), i think it's also included in the griff_boa oxp (along with the texture maps .obj format models and the rendermonkey .rfx files )
When you're working in seperate colour channels in an image they will appear as greyscale images, when you combine them all back together that's when you'll see then as mixtures of red, green and blue. the pdf above explains how to split and recombine colour channels.
Thanks - but I'm still stuck Unfortunately, my cut-down version of Photoshop doesn't seem to have a Channels menu option. And I can't work out how to get grayscale images of the channels in GIMP. This is what I'm trying to work with: http://docs.gimp.org/en/gimp-channel-dialog.html
I'll try and show you what I'm up against:
This is what a "selection mask" looks like when I create one. Which it seems like I have to do. I can draw on it, but I can't actually see what I'm drawing unless I make one (or more) of the channels visible too. Which is really handy.
Here I've been drawing in white on the selection mask, over one of the "arrows" on the image. You can see this because I've made the red channel visible too. What I don't know is how to "overwrite" the channel with the stuff I do on the selection mask once I've finished. I seem to have every kind of save option under the sun except for that one! And I've no idea how to edit a channel separately in greyscale, as you do in your Photoshop tutorial. Answers on a postcard, please!
This is what a "selection mask" looks like when I create one. Which it seems like I have to do. I can draw on it, but I can't actually see what I'm drawing unless I make one (or more) of the channels visible too. Which is really handy.
Here I've been drawing in white on the selection mask, over one of the "arrows" on the image. You can see this because I've made the red channel visible too. What I don't know is how to "overwrite" the channel with the stuff I do on the selection mask once I've finished. I seem to have every kind of save option under the sun except for that one! And I've no idea how to edit a channel separately in greyscale, as you do in your Photoshop tutorial. Answers on a postcard, please!
A thought has occurred to me, Griff - if no one knows how to solve my GIMP problems (as it were), would it be possible to email you my image for you to split into three channels and then email back to me? I could then send you the three images to be recombined when I've finished with them. Or wouldn't this work?