Ruby galaxy generator

28 views
Skip to first unread message

Patrick Copeland

unread,
Oct 10, 2017, 10:23:27 PM10/10/17
to
I've been writing a Ruby system that will allow the user, mainly, to find wormholes between any two given stars (and also decide which stocks to trade between them). Its main drawbacks at the moment, though, are that (1) those stars have to be manually entered in a database, and (2) the distances between them are just slightly off what the game calculates them as (especially since it's REALLY hard to estimate the Z co-ordinate of a system).

To this end, I've been looking at Jongware's [galaxy generation code](http://www.jongware.com/galaxy1.html) and trying to translate it to Ruby, which would give me all the stars and their accurate positions. I know it's extremely old in internet terms - in fact it was posted closer to my teenage gaming years than to today - but I've been getting some very weird results, and I can't really understand the generation algorithm or find any other versions.

Can anyone - especially Jongware himself if he's still around - help with this?

Patrick Copeland

unread,
Oct 11, 2017, 6:04:53 PM10/11/17
to
I've fixed it.

Jongware's code is Java, so all the variables are typed - if any variable gets bigger than its container, it gets truncated. Ruby, on the other hand, is *not* typed, so those truncations have to be coded in manually.

Michael Wilcox

unread,
Oct 14, 2017, 6:04:10 PM10/14/17
to
On Wednesday, 11 October 2017 23:04:53 UTC+1, Patrick Copeland wrote:
> I've fixed it.
>
> Jongware's code is Java, so all the variables are typed - if any variable gets bigger than its container, it gets truncated. Ruby, on the other hand, is *not* typed, so those truncations have to be coded in manually.

Awesome!
Do you have a link to the fixed version?
Reply all
Reply to author
Forward
0 new messages