Progress

General discussion for players of Oolite.

Moderators: winston, another_commander

User avatar
Cmd. Cheyd
---- E L I T E ----
---- E L I T E ----
Posts: 934
Joined: Tue Dec 16, 2008 2:52 pm
Location: Deep Horizon Industries Manufacturing & Research Site somewhere in G8...

Post by Cmd. Cheyd »

Commander McLane wrote:
I guess in the final stage they won't be treated as ships, though? :wink:
I hope not, since I just blew away an entire planet with a single strike from a Mil Laser... :twisted:
User avatar
Griff
Oolite 2 Art Director
Oolite 2 Art Director
Posts: 2483
Joined: Fri Jul 14, 2006 12:29 pm
Location: Probably hugging his Air Fryer

Post by Griff »

if you manage to pull off this planet code rewrite Ahruman, does it mean shaders for planets? i'm only asking because i think i promised everyone i'd do a backflip if shaderified planets became a reality and i'm starting to worry for my spine and vertebrae!
User avatar
Cmd. Cheyd
---- E L I T E ----
---- E L I T E ----
Posts: 934
Joined: Tue Dec 16, 2008 2:52 pm
Location: Deep Horizon Industries Manufacturing & Research Site somewhere in G8...

Post by Cmd. Cheyd »

I've already specifically asked this, so I'll answer if you don't mind...

(Yoda Voice) Be afraid, Griff... Be very afraid...(/Yoda Voice) :twisted:
User avatar
pagroove
---- E L I T E ----
---- E L I T E ----
Posts: 3035
Joined: Wed Feb 21, 2007 11:52 pm
Location: On a famous planet

Post by pagroove »

I'il look at it tonight. Looks promising though. 8)
For P.A. Groove's music check
https://soundcloud.com/p-a-groove
Famous Planets v 2.7. (for Povray)
Image
https://bb.oolite.space/viewtopic.php?f=4&t=13709
User avatar
Cody
Sharp Shooter Spam Assassin
Sharp Shooter Spam Assassin
Posts: 16081
Joined: Sat Jul 04, 2009 9:31 pm
Location: The Lizard's Claw
Contact:

Post by Cody »

Griff wrote:
i promised everyone i'd do a backflip if shaderified planets became a reality and i'm starting to worry for my spine and vertebrae!
I'll settle for the Griff WTF icon doing a back-flip.
I would advise stilts for the quagmires, and camels for the snowy hills
And any survivors, their debts I will certainly pay. There's always a way!
User avatar
DaddyHoggy
Intergalactic Spam Assassin
Intergalactic Spam Assassin
Posts: 8515
Joined: Tue Dec 05, 2006 9:43 pm
Location: Newbury, UK
Contact:

Post by DaddyHoggy »

Cmd. Cheyd wrote:
I've already specifically asked this, so I'll answer if you don't mind...

(Yoda Voice) Be afraid, Griff... Be very afraid...(/Yoda Voice) :twisted:
No - surely : <Yoda_voice>Afraid be yes? HmHmm, Griff, afraid yes, be</Yoda_Voice>
Selezen wrote:
Apparently I was having a DaddyHoggy moment.
Oolite Life is now revealed here
User avatar
Commander McLane
---- E L I T E ----
---- E L I T E ----
Posts: 9520
Joined: Thu Dec 14, 2006 9:08 am
Location: a Hacker Outpost in a moderately remote area
Contact:

Post by Commander McLane »

Ahruman wrote:
I’m working on a complete rewrite of planets. There’s lots of boring drudgery to go, but here’s a preview of sorts: a collection of planet meshes with correct texture coordinates.
planet-tester.oxp.zip (750 KiB)

Usage:
  • Install OXP
  • Name your planet texture of choice “world.png” and stick it in your AddOns folder
  • Summon a “planet-tester-l3”.
The L3 is a medium-detail planet with 1280 polygons. There are six levels, from L0 (20 faces – an icosahedron) to L5 (20480 faces, can take half a minute or more to load). The planets have a 500 m radius, about the size of a Coriolis station.

There are some problems. Each model has a few invisible triangles. I believe this is a problem in Oolite’s data loading rather than the planet generator itself. (In wireframe mode, it can be seen that these triangles are actually inside out, but a winding error in the generator would appear as a repeated pattern). There’s a visible edge running up the “back” of the planets due to a limitation in Oolite’s smoothing. Neither of these problems will affect the final version.

There’s no trivial way to smoothly spin a ship around its Y axis, but Commander McLane will be glad to hear that the poles do in fact line up with the Y axis.

Textures are still pinched at the poles. This problem is fundamentally unavoidable with latitude/longitude texture maps, although it could be made arbitrarily small by throwing twenty more triangles at it. I intend to support cube map textures for planets in future, which will make this problem disappear entirely.
By the way:

Code: Select all

  [shipData.merge.failed]: ***** ERROR: one or more shipdata.plist entries have like_ship references that cannot be resolved: planet-tester-l2
This is because planet-tester-l2 is like_shipped to itself, instead of to planet-tester-l0 like all the others.
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post by JensAyton »

Thanks. I’d fixed that locally, but decided to leave it as an exercise to the reader. :-)
User avatar
Commander McLane
---- E L I T E ----
---- E L I T E ----
Posts: 9520
Joined: Thu Dec 14, 2006 9:08 am
Location: a Hacker Outpost in a moderately remote area
Contact:

Post by Commander McLane »

Ahruman wrote:
Thanks. I’d fixed that locally, but decided to leave it as an exercise to the reader. :-)
Ah! That explains everything, of course. 8)

(Note to self: Learn this by heart as a handy explanation for my own bugs.)
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post by JensAyton »

That wasn’t so much an excuse for the bug as an excuse for not posting the fix.
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post by JensAyton »

Numerous times while using the debug console, I’ve wished I could use the last returned value in an expression without writing the previous line again, or copying and pasting. (Laziness is the core of programming.) Then I remembered that it was my code, so I fixed it: as of r2810, the last (non-null, non-undefined) value is stored in $. Example:
Image

Since the console’s behaviour is implemented in JavaScript, this can easily be backported. Open Debug.oxp/Scripts/oolite-debug-console.js, find the line this.evaluate = function (command, type, PARAM), and change the function definition to:

Code: Select all

this.evaluate = function (command, type, PARAM)
{
    let result = eval(command);
    if (result !== undefined)
    {
        if (result === null)  result = "null";
        else  this.$ = result;
        consoleMessage("command-result", result.toString());
    }
}

this.$ = null; // initial value
User avatar
Commander McLane
---- E L I T E ----
---- E L I T E ----
Posts: 9520
Joined: Thu Dec 14, 2006 9:08 am
Location: a Hacker Outpost in a moderately remote area
Contact:

Post by Commander McLane »

Handy. :)
User avatar
drew
---- E L I T E ----
---- E L I T E ----
Posts: 2190
Joined: Fri May 19, 2006 9:29 am
Location: In front of a laptop writing a book.
Contact:

Post by drew »

Cmd. Cheyd wrote:
Commander McLane wrote:
I guess in the final stage they won't be treated as ships, though? :wink:
I hope not, since I just blew away an entire planet with a single strike from a Mil Laser... :twisted:
<evil laugh>Now witness the firepower of this fully armed and operational battle-station!</evil laugh>
I've already specifically asked this, so I'll answer if you don't mind...

(Yoda Voice) Be afraid, Griff... Be very afraid...(/Yoda Voice)
Shouldn't that be:

Griff, very afraid, you must be...

?

Cheers,

Drew.
Drew is an author of SF and Fantasy Novels
WebsiteFacebookTwitter
User avatar
Kaks
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 3009
Joined: Mon Jan 21, 2008 11:41 pm
Location: The Big Smoke

Post by Kaks »

Some more javascript stuff:

As reported elsewhere, the compass is now exposed to javascript via two new read-only properties

player.ship.compassTarget and player.ship.compassMode
compassMode can be any one of the following:

Code: Select all

'COMPASS_MODE_BASIC'
'COMPASS_MODE_PLANET'
'COMPASS_MODE_STATION'
'COMPASS_MODE_SUN'
'COMPASS_MODE_TARGET'
'COMPASS_MODE_BEACONS'
Whenever the compass target changes, a new event is generated:
compassTargetChanged (compass target, compass mode)

We also have some changes to NPC missile handling:

the key max_missile inside shipdata.plist now also applies to all ships, not just players. Players are still limited to 16 missiles, while NPCs can have up to 32 missiles on board at any given time.

the new missile_load_time shipdata.plist key can now be used to determine the minimum delay in seconds between launching missiles. This applies to both player and NPC ships. If not specified, the ship's delay between missile launches is 0 seconds.

The following equipment related javascript commands now work with NPC ships too: awardEquipment(), removeEquipment(), equipmentStatus(), setEquipmentStatus() as well as hasEquipment()

NPC missile management is now possible: player.ship.target.awardEquipment('EQ_REMOVE_MISSILES') will remove all missiles from the targeted ship, while player.ship.target.awardEquipment('EQ_HARDENED_MISSILE') will add an ecm resistant missile to that ship, if there's any free pylon.

two new NPC & missile specific javascript commands have been added: ship.fireMissile() and ship.selectNewMissile()

fireMissile() will try and fire the first available missile, will return the missile fired, or null if no missiles can be fired at this time. It can take the optional missile identifier parameter, to allow for a specific missile to be fired. Missiles cannot be fired if the NPC ship hasn't got a valid target, or if the previous missile was launched less than missile_load_time seconds before. If a missile type was specified, and not found on the ship, fireMissile will return null as well.

selectNewMissile() will automatically select a missile for a specific ship. It uses the missile_role shipdata.plist key to find out which missiles to select. As with the system populator, there's a small chance that missiles other than the missile_role specified in shipdata will be selected.

Code: Select all

player.ship.target.awardEquipment(player.ship.target.selectNewMissile()); 
will automatically add the 'right type' of missile to a ship, i.e. one that its captain would normally choose.

Finally, there's a new clock.addSeconds(seconds:number) function. It adds the specified number of seconds to the in-game clock. The time range is between 1 second and 2592000 seconds (30 days) (in the latter case, the on-board clock will be adjusting for a considerable time) - returns true on success.
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
Screet
---- E L I T E ----
---- E L I T E ----
Posts: 1883
Joined: Wed Dec 10, 2008 3:02 am
Location: Bremen, Germany

Post by Screet »

Kaks wrote:
hasEquipment()
...which reminds me to ask whether there is something like the C++ type map in Objective C. It could enhance the access speed for equipment very well.

Adding these options for equipment is great - just what I would have been looking for in the next days anyway as I would like to make my missile defense system available to NPCs and one possible solution could be that specific ships simply are awarded with a NPC version of it ;)

Screet
Post Reply