Star Control Discussion Board

All About Star Control => Mods, Clones and other Fan Content => Topic started by: Guesst on September 07, 2008, 09:13:55 am

Title: A star control 1 remake that may actually get finished
Post by: Guesst on September 07, 2008, 09:13:55 am
For the RetroRemake contest the user Dragon has committed to remaking Star Control 1.

http://www.retroremakes.com/forum2/showthread.php?p=180694 (http://www.retroremakes.com/forum2/showthread.php?p=180694)

I couldn't be happier.
Title: Re: A star control 1 remake that may actually get finished
Post by: Bleeding Star on September 07, 2008, 10:36:13 am
Excellent! I loves some SC1. Any chance of persuading him that he desperately needs to include SC2 ships as well?
Title: Re: A star control 1 remake that may actually get finished
Post by: Dabir on September 07, 2008, 11:44:38 am
Yipee, excited!
Title: Re: A star control 1 remake that may actually get finished
Post by: Zeracles on September 08, 2008, 02:47:12 pm
Having only ever played it once and briefly at that, and a long long time ago, I'm quite interested to see what it's all about myself . . .
Title: Re: A star control 1 remake that may actually get finished
Post by: Scott_Irving on September 09, 2008, 05:06:14 pm
there it's in the news now  ;D
Title: Re: A star control 1 remake that may actually get finished
Post by: Guesst on September 10, 2008, 01:51:08 pm
Excellent! I loves some SC1. Any chance of persuading him that he desperately needs to include SC2 ships as well?
That would indeed be the sweet, but may only happen if he has time. At the moment the focus is recreating the original game.
Title: Re: A star control 1 remake that may actually get finished
Post by: Dragon on September 11, 2008, 05:08:48 am
Quote
At the moment the focus is recreating the original game.
Yup, the spirit of this project is a clean complete remake.  After the competition, well, the sky's the limit.  'till then though just trying to get one out is a bit frantic.

ps: Hi all :)
Title: Re: A star control 1 remake that may actually get finished
Post by: Zeracles on September 14, 2008, 02:18:10 am
ps: Hi all :)
We'd say hi too, and drag you into a long interminable discussion of how much we love what you're doing, but fortunately for you, we've decided not to, as this might stop you from finishing on time ;D
Title: Re: A star control 1 remake that may actually get finished
Post by: Dragon on September 18, 2008, 11:16:50 am
Good news!  I've finished all the graphics now although there's still some debate about how the planets should look.  From here on it should just be coding.  Yippee!  :)
Title: Re: A star control 1 remake that may actually get finished
Post by: Zeracles on September 18, 2008, 09:41:07 pm
The loud colours are fantastic. The background doesn't seem quite right to me, but I have next to no idea about the original and can't complain.
Title: Re: A star control 1 remake that may actually get finished
Post by: Dragon on September 19, 2008, 12:02:16 am
The background doesn't seem quite right to me

Yeah, they're all still place holders and far to noisy.  I wrote a sort of background generator but the SC1 just had points stars and I'll probably do the same.
[EDIT] ie: my background generator isn't quite doing what I want  :-\
Title: Re: A star control 1 remake that may actually get finished
Post by: Zeracles on September 25, 2008, 09:08:09 pm
Got back to the office after a day of tutoring and decided to do some lazy coding. I'd been wanting to do this as I am an astronomer after all. I made a background generator, and will post full details along with code on the ultronomicon later. Briefly, it smooths a random point distribution with a fixed width gaussian filter, and does it in all the colours of the rainbow. It's designed to go with the colourful style of the ships.

This was the first real result
(http://www.physics.usyd.edu.au/~asmith/files/bubblestellarbackground_noisy)

Stars are actually point sources, the sky turns them into gaussians, which is what I did here. The ``spokes" one sees on stars only happens when you look through a telescope (diffraction around supporting beams in the telescope).

Anyway, too noisy, so I decreased the gaussian width
(http://www.physics.usyd.edu.au/~asmith/files/bubblestellarbackground_unresolved.bmp)

At this point it was clear I'd have to increase the resolution, so I ran it again with 1000x1000 resolution
(http://www.physics.usyd.edu.au/~asmith/files/bubblestellarbackground.jpg)

I may have been subconsciously influenced by the rounds of bubble breaker I'd been playing whilst tutoring, or I've been eating too many M&Ms ;D

Now, who wouldn't want to play on that? 8)

One other thing, resolution, size of the stars, number of points for smoothing and the colours can be changed VERY easily, so if you don't like this I can improve on it.

Any questions?

EDIT: I'm not just addressing Dragon and I'm not, of course, insisting that this go in the SC1 remake, I just thought this would be a cool thing to try. Dragon may (and in all probability will) choose to ignore this for his remake. It might be usefully applied to something else SC-wise.
Title: Re: A star control 1 remake that may actually get finished
Post by: Dragon on September 27, 2008, 01:25:04 pm
Any questions?
Can we go a bit... less   8)

Actually even with my tame backgrounds it's proving hard to see the ships.  Looking at the final image I have a few suggestions: could you drop the number of stars to about a 1/4 and reduce the width of the Gaussian filter to about 2/3.  Then if instead of drawing point stars you use circles with a random sizes they'll give a bit more variance.  You could draw a couple of points, run the filter with a narrow width across them.  Put a few more points on and run the filter again etc...  Finally run the filter with the wider width to get a nicely varied image.

Of course if you're up for a challenge, see if you can reproduce the spokes. I figure there should be no atmospheric effects in space so it's just as valid to put telescopic artifacts in too ;)

Title: Re: A star control 1 remake that may actually get finished
Post by: Zeracles on September 28, 2008, 02:22:21 am
Can we go a bit... less   8)

Actually even with my tame backgrounds it's proving hard to see the ships.
Yeah, that's the main problem (or part of the in-game challenge :D).
Looking at the final image I have a few suggestions: could you drop the number of stars to about a 1/4 and reduce the width of the Gaussian filter to about 2/3.  Then if instead of drawing point stars you use circles with a random sizes they'll give a bit more variance.
These are good. I might also try variable brightness. Gaussian's not all there is, either . . .
Of course if you're up for a challenge, see if you can reproduce the spokes. I figure there should be no atmospheric effects in space so it's just as valid to put telescopic artifacts in too ;)
Absolutely, lots of little Xs like my avatar :P Not sure when I'll get to it though, I'm working from home for a bit and it's better for me to do this at work ;) because my monitor at home doesn't display blue :-\
Title: Re: A star control 1 remake that may actually get finished
Post by: Dragon on September 29, 2008, 11:14:55 am
I'm working from home for a bit and it's better for me to do this at work ;) because my monitor at home doesn't display blue :-\
Ah - I see how that could be a bit of a problem :s.  I had a similar monitor.  It got rained on.  I wasn't unhappy ;)
Title: Re: A star control 1 remake that may actually get finished
Post by: Zeracles on October 09, 2008, 03:27:26 pm
Absolutely, lots of little Xs like my avatar :P
To paraphrase a lost friend of ours, when I get the urge to follow up on a silly proposal to a ridiculous extreme, I usually can't resist it . . .

(http://www.physics.usyd.edu.au/~asmith/files/bubblestellarbackground_X.jpg)

Too much? Want plusses instead of Xs?

(http://www.physics.usyd.edu.au/~asmith/files/bubblestellarbackground_spokes.jpg)

So, what do we think? I can vary both size and brightness, after which it might be safe to increase the density a fair bit. There's also a number of parameters I can fiddle with for the prominence and length of the spokes, but I got to this after some experimenting. The number of spokes is a variable too.

EDIT: retro remakes thread moved (http://www.retroremakes.com/forum/viewtopic.php?f=120&t=11919&st=0&sk=t&sd=a)
Title: Re: A star control 1 remake that may actually get finished
Post by: chenjesuwizard on October 10, 2008, 11:46:32 am
Like It!
Title: Re: A star control 1 remake that may actually get finished
Post by: Dragon on October 16, 2008, 04:35:03 am
So, what do we think? I can vary both size and brightness, after which it might be safe to increase the density a fair bit.
Whoops, saw you posted, started posting and then got distracted.

Anyways, it's looking much better :).  I definitely prefer the x's to the +'s.  I'd really like to see a screenie where you've used only greys to see how the different intensities affect it - at the moment the sizes are bit uniform.

Ta for that!
Title: Re: A star control 1 remake that may actually get finished
Post by: Shiver on October 16, 2008, 08:56:40 am
Anyways, it's looking much better :).  I definitely prefer the x's to the +'s.

Couldn't Zeracles use random rotations so it's not just one or the other? That and varying star sizes would make it look quite impressive.
Title: Re: A star control 1 remake that may actually get finished
Post by: Zeracles on October 17, 2008, 04:19:13 pm
Couldn't Zeracles use random rotations so it's not just one or the other? That and varying star sizes would make it look quite impressive.
He can, but it's going to look very strange to him since it will make him think he's looking at the same field through about a thousand different telescopes at once ??? I'll have a look when I have time though.
I'd really like to see a screenie where you've used only greys to see how the different intensities affect it - at the moment the sizes are bit uniform.
Variable sizes and intensities will probably be the main thing. So far the sizes and intensities are all the same (except that white is brighter than say, blue, etc), but chance alignments inflate some of the stars (best example of this is centre bottom of the high density X image, if you zoom in on the bright white star you can tell it's three stars superposed).

Thanks fellas, I'll get back to you :)
Title: Re: A star control 1 remake that may actually get finished
Post by: Shiver on October 17, 2008, 06:39:15 pm
Couldn't Zeracles use random rotations so it's not just one or the other? That and varying star sizes would make it look quite impressive.
He can, but it's going to look very strange to him since it will make him think he's looking at the same field through about a thousand different telescopes at once ??? I'll have a look when I have time though.

Heh, foiled by basic physics. You have to admit that it would be more visually impressive. Well, there goes that idea.
Title: Re: A star control 1 remake that may actually get finished
Post by: Dragon on October 18, 2008, 04:22:38 am
I've posted a small tech demo over at remakes if anyone's interested.  I'd mostly just like to know if anyone has issues running it.

It can be found at the end of this topic (http://www.retroremakes.com/forum/viewtopic.php?f=120&t=11919&st=0&sk=t&sd=a).  I'd link it directly but that would be rude...

So things are coming along slowly...
Title: Re: A star control 1 remake that may actually get finished
Post by: Zeracles on October 23, 2008, 09:43:29 pm
(http://www.physics.usyd.edu.au/~asmith/files/bubblestellarbackground_X_varsizeintensity.jpg)

This has the same density as the last X one. The sizes vary from nothing to the same, and the intensity varies from nothing to twice as bright. I thought it looked messy at first, but it's grown on me. Up to Dragon what would look best in game.
Heh, foiled by basic physics. You have to admit that it would be more visually impressive. Well, there goes that idea.
I'll probably still try this at some point, not really fussed about looking too real, but real can be good too. Maybe for the next one I'll dispense with reality completely.
Title: Re: A star control 1 remake that may actually get finished
Post by: Dragon on October 24, 2008, 06:00:41 am
Ooh, I like!  :)

The colours are still a bit ... um... garish so I've desaturated them somewhat.  Also it'd look really awesome if you could cluster the stars before the filters been applied - I've added a few dark swathes in but as you can see it looks a bit silly (ie:  it looks like there's a black cloud in front of the stars).

(http://farm4.static.flickr.com/3137/2968650283_d7b398f362_o.jpg)

...
Title: Re: A star control 1 remake that may actually get finished
Post by: Zeracles on October 24, 2008, 04:04:07 pm
The colours are still a bit ... um... garish so I've desaturated them somewhat.
Heh, if you're happy to decide how much to tone the colours down, I'll keep doing garish / gaudy.
Also it'd look really awesome if you could cluster the stars before the filters been applied
I think I know how to do this - I'm on the case ;)
Title: Re: A star control 1 remake that may actually get finished
Post by: Dragon on October 26, 2008, 01:01:39 am
I think I know how to do this - I'm on the case ;)
Cool, I'm looking forward to this one :)
Title: Re: A star control 1 remake that may actually get finished
Post by: Zeracles on October 30, 2008, 11:56:40 pm
Now, anyone can make a clustered set of points by hand, but I don't muck around with these things so I implemented a proper algorithm for doing it, as described in this paper (http://adsabs.harvard.edu/abs/1994A%26A...282..353I) (correlation analysis is part of what I do). With this I can vary how clustered the points are, with any density we like of course.

(http://www.physics.usyd.edu.au/~asmith/files/correlatedstellarbackground_1.bmp)

Definitely my favourite so far . . . the really bright patch could be a problem though. It might go away after Dragon's desaturation but probably not. If it needs to be fixed, I could just repeat the clustering algorithm until I get something without such a concentration. Apart from that, is it the right amount of clusteriness? Any other tweaks?
Title: Re: A star control 1 remake that may actually get finished
Post by: Shiver on October 31, 2008, 06:19:58 am
They're all cluttered. Maybe set a small area around stars that prevents other stars from appearing right on top of each other? I'm not really sure. I'm only posting to get the next set of images onto another page.
Title: Re: A star control 1 remake that may actually get finished
Post by: Zeracles on October 31, 2008, 02:58:12 pm
They're all cluttered. Maybe set a small area around stars that prevents other stars from appearing right on top of each other?
Cluttered = hierarchically clustered :) That's by design, we have clusters within clusters here (a fractal distribution). The easiest fix for the highest density regions would probably be to remove the bottom level of the hierarchy in each of the superposed fractals, or bring the levels closer together. The L=1 separation lengths could be constrained to lie within a higher range, too.[/nerdspeak]
I'm only posting to get the next set of images onto another page.
Not a bad point, I just made all but the last one .jpgs.
Title: Re: A star control 1 remake that may actually get finished
Post by: chenjesuwizard on November 02, 2008, 07:57:34 am
They all merge together.
Like the toned down colours on Dragons.
Title: Re: A star control 1 remake that may actually get finished
Post by: Dragon on November 02, 2008, 11:26:29 am
Definitely my favourite so far . . .  Any other tweaks?
I've played with this image quite a bit and it's definitely my favourite also.  Can I suggest decreasing the number of bright stars and increasing the number of dim stars (a lot). 

I was wondering about the sort-of line structures (the S-shape at the bottom and the bar at the top) are the stars generally distributed like that or am I seeing patterns where there aren't any?  'fraid I skimmed your paper but haven't given it enough time to actually understand it :(

[EDIT]  I meant to add:  Instead of using BMPs have you tried using PNGs?  They're lossless and should compress down to about a sixth the size of a bmp.  Better yet they're fairly easy to write out from c++ if you use libpng  (http://www.libpng.org/pub/png/libpng.html)(which rocks!).
Title: Re: A star control 1 remake that may actually get finished
Post by: Zeracles on November 03, 2008, 09:41:53 am
I've played with this image quite a bit and it's definitely my favourite also.  Can I suggest decreasing the number of bright stars and increasing the number of dim stars (a lot). 
I'll try something similar with sizes, too.
I was wondering about the sort-of line structures (the S-shape at the bottom and the bar at the top) are the stars generally distributed like that or am I seeing patterns where there aren't any?  'fraid I skimmed your paper but haven't given it enough time to actually understand it :(
The code for the remake is all that matters, pay no attention to that paper! That's just me being my usual pompous self. I think those are chance alignments you're seeing (though, I did think that ``S" was pretty cool), but they're more likely to occur in a clustered set. In correlation analysis one can quantify the statistics of a set of points by looking at different ``moments" of the distribution. A uniform random set is special for being unclustered in all the moments at once, so in a sense it's not really random, there's sort of a higher randomness. This set is clustered in its second order moment - one has spherical structures. If we were to cluster it in its third order moment (I'm not aware of an algorithm for this) then one would be inserting lines (among other things) I think. It's really not important, though.
[EDIT]  I meant to add:  Instead of using BMPs have you tried using PNGs?  They're lossless and should compress down to about a sixth the size of a bmp.  Better yet they're fairly easy to write out from c++ if you use libpng  (http://www.libpng.org/pub/png/libpng.html)(which rocks!).
Okay. I've been doing this with the language of the lazy, matlab, which I think can do it.
Title: Re: A star control 1 remake that may actually get finished
Post by: Zeracles on November 07, 2008, 02:20:55 pm
Less big stars and more small stars.

With the same clustered set of points as before -
(http://www.physics.usyd.edu.au/~asmith/files/correlatedstellarbackground_1_smaller.png)

And with a different clustered set, one with less really high density regions -
(http://www.physics.usyd.edu.au/~asmith/files/correlatedstellarbackground_2_smaller.png)

I'm at home so with my monitor I don't know what these really look like.
Title: Re: A star control 1 remake that may actually get finished
Post by: Rider on November 09, 2008, 01:32:02 pm
They're starting to turn out a little... square...
Title: Re: A star control 1 remake that may actually get finished
Post by: Dragon on November 11, 2008, 11:10:31 pm
'fraid the last two weeks have been slightly ... disrupted.  Hopefully I can get back to Star Controlling now. 

I like the second picture best purely because the overlapping stars in the first picture are a bit saturated.  Hopefully I'll have a demo up shortly so you can see what I'm actually doing with them.  Well I say 'them' but I'm only using one picture at a time to generate a background though it should be trivial to feed all three into the generator at the same time.  I suspect it's going to look a little clipped if I do (which is why I haven't) but... we'll see ;)
Title: Re: A star control 1 remake that may actually get finished
Post by: Zeracles on November 13, 2008, 02:16:42 am
They're starting to turn out a little... square...
Their geometry is independent of size . . . when they are at maximum brightness (not the same as size) they start to look square because the areas between the four spokes are filled in. The effect may be more apparent when they're smaller. If it's a problem I think the solution would be to alter the brightness range.

Something else I'm wondering about is cover art. The original -
(http://starcontrol.classicgaming.gamespy.com/sc1/images/sc1_box.jpg)
- has stars in it, I could generate a cluster of stars like that.
Title: Re: A star control 1 remake that may actually get finished
Post by: Dragon on November 16, 2008, 04:55:34 am
Something else I'm wondering about is cover art.

I was thinking of redoing the title screen rather than the boxart just because it's a whole lot easier.

(http://farm4.static.flickr.com/3202/3034764858_831cd907cc_o.png)

Although if you feel like doing a fairly hires smattering of stars (say 1600x1200) that would be most appreciated :)


As an aside I always wanted to know whose hand that was anyway...
Title: Re: A star control 1 remake that may actually get finished
Post by: Zeracles on November 17, 2008, 03:26:32 am
I probably get around to it next week after I've given my talk for the year :-\

So if I do the stars on a black background as say 1200x1200 that would do (just add the image as RGB values to whatever background)? I'm thinking there will be a central concentration such that there's white saturation in the centre, and then it breaks up into a colourful mess at the edges. I can't draw so someone else would have to do the hand . . . maybe Eth could do something like that :D
Title: Re: A star control 1 remake that may actually get finished
Post by: Dragon on November 18, 2008, 12:51:38 am
I probably get around to it next week after I've given my talk for the year :-\

So if I do the stars on a black background as say 1200x1200 that would do (just add the image as RGB values to whatever background)? I'm thinking there will be a central concentration such that there's white saturation in the centre, and then it breaks up into a colourful mess at the edges. I can't draw so someone else would have to do the hand . . . maybe Eth could do something like that :D
Oops, I was actually thinking of stars for the title screen rather than the boxart.  Hopefully I should have a 'front-end' demo out so you can see what I'm aiming for.  The particle system (in general) is putting up a bit of a fight though.  Expect delays :(

Thanks for the help so far :)
Title: Re: A star control 1 remake that may actually get finished
Post by: Zeracles on November 27, 2008, 04:47:00 am
Here's 1600x1200 (squeezed to fit in the window). Now with more colours (every star is probably a different colour), before there were only 7 possible colours (8 if we count black ;D). The distribution isn't clustered, I thought that might be a bit dangerous since I don't know exactly what you're thinking of putting on it (the clusters might just happen to coincide with foreground objects, then we wouldn't see the stars). I could do it again with clusters of course.

(http://www.physics.usyd.edu.au/~asmith/files/titlescreen.png)

So I saw about the chances of entering being slim . . . could it be entered next year or something (I haven't read the rules)?
Title: Re: A star control 1 remake that may actually get finished
Post by: Dragon on November 28, 2008, 11:50:02 am
Ta, here's what I'm using it for:

(http://farm4.static.flickr.com/3206/3065697439_193ed683b7_b.jpg)

Rather obviously the explosions been edited in and the ship is a) the wrong one and b) not leaving a trail.  But that's the general idea.  I just noticed that I greyed out the stars too much and there are a tad too many of them.  Bar that I'm quite happy with it :)

So I saw about the chances of entering being slim . . . could it be entered next year or something (I haven't read the rules)?
If I don't make it into the compo I'll just carry on as a normal remake.  Unfortunately that means the release date becomes a bit ... fluid, but it should be either the end of December or April.

[EDIT] Urk, how do I size the image down?  It's a bit large...
[EDIT2] Sorted!
Title: Re: A star control 1 remake that may actually get finished
Post by: Zeracles on November 28, 2008, 01:47:32 pm
Nice, you'll probably change it but I for one prefer the Spathi :D
there are a tad too many of them.
There were 1000 stars in that one, I'll try 800. And another with clusters too.
If I don't make it into the compo I'll just carry on as a normal remake.  Unfortunately that means the release date becomes a bit ... fluid, but it should be either the end of December or April.
Spectacular work whenever it happens really, and you'll be able to say you did it while keeping the streets safe!
[EDIT] Urk, how do I size the image down?  It's a bit large...
Like in html, [img width=][/img] :)
Title: Re: A star control 1 remake that may actually get finished
Post by: Zeracles on December 04, 2008, 02:21:12 am
Now with 800 stars instead of 1000 -

(http://www.physics.usyd.edu.au/~asmith/files/titlescreen_800.png)

Tell me if it's still too dense. And now, clustered -

(http://www.physics.usyd.edu.au/~asmith/files/titlescreen_clustered.png)

Maybe try flipping it for optimal orientation with respect to foreground objects. I could also just keep trying until we get some distribution we like ;D, or do it manually . . . the clustering might not be best for this though.

Oh and what's that you say, Dune 2? Mighty fine game (I never played its remake though) but which lacked the stylistic charms of Dune, you'll have to say something about your plans for that at some point!
Title: Re: A star control 1 remake that may actually get finished
Post by: Dragon on December 04, 2008, 10:59:30 am
Here's the backgrounds in a mock up (gotta get my particle system working - which implies that I must actually work on it).  I prefer the clustered variety and also the coloured stars so I've not altered them this time.

(http://farm4.static.flickr.com/3069/3082233499_45f52edb79_o.png)
Hi-res (1600x1200) (http://3.bp.blogspot.com/_7gYqvPiuRnA/STgh8rW6p8I/AAAAAAAAALw/Nr1418am_fo/s1600-h/MockTitle2.png)

(http://farm4.static.flickr.com/3054/3083069492_9f028d8229_o.png)
Hi-res (1600x1200) (http://3.bp.blogspot.com/_7gYqvPiuRnA/STgh8anDdlI/AAAAAAAAALo/Q9_QwAkLOqs/s1600-h/MockTitle1.png)


Dune 2? Mighty fine game (I never played its remake though) but which lacked the stylistic charms of Dune, you'll have to say something about your plans for that at some point!

I actually gave Dune some serious consideration as a compo entry;  I had *lots* of saves made and screenshots taken before I realised quite what a huge project it is.  Dune 2 is much easier because the art resources are simpler (far far simpler) and all the grunt work of mapping stages and vehicle stats has already been done.

The game I'm *actually* remaking at the moment is Space Crusade (or at least a tribute that is different enough that I shouldn't get stomped on legally); Star Control is somewhat of a tangent for me.  Unfortunately my next project is going to have to follow that... probably sometime in 2010 ;)


Title: Re: A star control 1 remake that may actually get finished
Post by: Zeracles on December 05, 2008, 12:48:41 am
There's some maintenance going on since about two hours ago and running for most of the weekend which has knocked out my web page from which I was hosting everything . . . and I'm avatarless :-[

Anyway, those look good ahead of some touches to come, tell me if there's anything else I can help with . . . I'm too busy to do any serious coding unfortunately, but if there's any other little arty things like this, I should be up for it.

I actually gave Dune some serious consideration as a compo entry;  I had *lots* of saves made and screenshots taken before I realised quite what a huge project it is.  Dune 2 is much easier because the art resources are simpler (far far simpler) and all the grunt work of mapping stages and vehicle stats has already been done.
One of the strongest aspects of Dune is its fantastic music (http://www.grandgent.com/tom/dune/dunemp3s.htm), tough act to follow, interesting challenge. And the art could be a lot of fun too :D

Incidentally, I'm about to start reading the novel Dune, I'm pretty excited about it.

Oh yeah and for Dune 2, that nuke was seriously overpowered, a must-fix.
Title: Re: A star control 1 remake that may actually get finished
Post by: Dragon on December 07, 2008, 11:57:46 pm
Anyway, those look good ahead of some touches to come, tell me if there's anything else I can help with . . .

Weeellll...  If you're feeling up to it:  would it be possible to output the backgrounds as text?  ie:  Any column based format (like a CSV) with each row containing the Star X, Y, Z, Colour and intensity and/or any other information that's important.

Then if you could also write out as a PNG a white star of each intensity on a regular grid (you probably see where this is going now).  It'll probably just be a row of about 20 stars or so.  That really would be most appreciated because I'll be able to render the stars as particles which would make for a pretty parallax effect.  If you're not generating a Z co-ord during the distribution don't worry about it I'll slap in something random.

One of the strongest aspects of Dune is its fantastic music
Incidentally, I'm about to start reading the novel Dune, I'm pretty excited about it.

Yup, the music really was some of the best MIDI music I've ever heard although I still prefer the MOD music from Star Control II.  MIDI synths on PC's really were (and still are) their own strange world.

I really enjoyed the book and as Sci-fi it doesn't really date (you'll find out why when you read it - either an awesome idea on Herbert's part or sheer coincidence).  The other book in the series which left an impression on me was God Emperor of Dune - the others I'm afraid have been forgotten to the mists of time.
Title: Re: A star control 1 remake that may actually get finished
Post by: Zeracles on December 10, 2008, 05:35:14 am
Doing the second thing first . . .
Then if you could also write out as a PNG a white star of each intensity on a regular grid (you probably see where this is going now).  It'll probably just be a row of about 20 stars or so.  That really would be most appreciated because I'll be able to render the stars as particles which would make for a pretty parallax effect.
(http://www.physics.usyd.edu.au/~asmith/files/varintensity/varintensity_10.png)
(http://www.physics.usyd.edu.au/~asmith/files/varintensity/varintensity_20.png)
(http://www.physics.usyd.edu.au/~asmith/files/varintensity/varintensity_30.png)
(http://www.physics.usyd.edu.au/~asmith/files/varintensity/varintensity_40.png)
(http://www.physics.usyd.edu.au/~asmith/files/varintensity/varintensity_50.png)
(http://www.physics.usyd.edu.au/~asmith/files/varintensity/varintensity_60.png)
(http://www.physics.usyd.edu.au/~asmith/files/varintensity/varintensity_70.png)
(http://www.physics.usyd.edu.au/~asmith/files/varintensity/varintensity_80.png)
(http://www.physics.usyd.edu.au/~asmith/files/varintensity/varintensity_90.png)
(http://www.physics.usyd.edu.au/~asmith/files/varintensity/varintensity_100.png)
(http://www.physics.usyd.edu.au/~asmith/files/varintensity/varintensity_110.png)
(http://www.physics.usyd.edu.au/~asmith/files/varintensity/varintensity_120.png)
(http://www.physics.usyd.edu.au/~asmith/files/varintensity/varintensity_130.png)
(http://www.physics.usyd.edu.au/~asmith/files/varintensity/varintensity_140.png)
(http://www.physics.usyd.edu.au/~asmith/files/varintensity/varintensity_150.png)
(http://www.physics.usyd.edu.au/~asmith/files/varintensity/varintensity_160.png)
(http://www.physics.usyd.edu.au/~asmith/files/varintensity/varintensity_170.png)
(http://www.physics.usyd.edu.au/~asmith/files/varintensity/varintensity_180.png)
(http://www.physics.usyd.edu.au/~asmith/files/varintensity/varintensity_190.png)
(http://www.physics.usyd.edu.au/~asmith/files/varintensity/varintensity_200.png)
These are all separate images, the intensities vary from 0.1 to 2 in steps of 0.1, where 1 is what I thought was the nicest. 100x100, but I can always do higher resolution, and more intensities if it helps.

Weeellll...  If you're feeling up to it:  would it be possible to output the backgrounds as text?  ie:  Any column based format (like a CSV) with each row containing the Star X, Y, Z, Colour and intensity and/or any other information that's important.
Sure, but that information (apart from x, y in some cases) hasn't been saved for the backgrounds so far. I can save all that information for new maps though. Which one are you after? And are you still interested in an actual image (it's faster to just get the data, these high resolution images take time to make ;D)?

If you're not generating a Z co-ord during the distribution don't worry about it I'll slap in something random.
If you're after the clustered one, slapping in a random z will dilute the clusters I think, but I can make clusters in 3D too (for some reason I derive extreme amusement from rotating a box full of clusters interactively . . . I derive extreme amusement from all kinds of strange things though) :)

Before I forget, these stars have as many points as we like
(http://www.physics.usyd.edu.au/~asmith/files/varintensity/eightpointed.png)
Just mentioning it . . .

Yup, the music really was some of the best MIDI music I've ever heard although I still prefer the MOD music from Star Control II.  MIDI synths on PC's really were (and still are) their own strange world.
Ah, I remember wondering which I liked more, back in the day . . . I liked the Dune music perhaps a touch more than SC2's mods . . . the UQM remixes tip musical matters back in SC's favour for me though. One of the sietch themes, Morning Sunrise, is one my favourites from any genre, and so is ``Wake Up" from Spice Opera (http://en.wikipedia.org/wiki/Dune:_Spice_Opera#Audio), which is a remix of the Map/Sekvence theme. Spice Opera's great too (there's some kind of conflict between the composer, Stephane Picq, and the fellows who have the rights, or something).
I really enjoyed the book and as Sci-fi it doesn't really date (you'll find out why when you read it - either an awesome idea on Herbert's part or sheer coincidence).
Great, the sci-fi I like most tends not to date because I'm not really interested in gizmos, more the philosophical and sociological side of things.
Title: Re: A star control 1 remake that may actually get finished
Post by: Dragon on December 11, 2008, 11:29:49 am
These are all separate images, the intensities vary from 0.1 to 2 in steps of 0.1, where 1 is...
Perfect thanks, I'll try and have some sort of viewer posted by this weekend so you can see what I'm doing (and the file format).

Sure, but that information (apart from x, y in some cases) hasn't been saved for the backgrounds so far. I can save all that information for new maps though. Which one are you after? And are you still interested in an actual image (it's faster to just get the data, these high resolution images take time to make)?
I just realised I don't need the images at all (not even for the title) as I can render all the stars as particles (using additive blending) which will be both smaller and faster.  So I guess just the data ;D.
[EDIT]New maps will be fine - the actually star positions aren't that important.  It's just the overall appearance which is why I want to get a viewer out.

If you're after the clustered one, slapping in a random z will dilute the clusters I think
Yup, it'll look much better with proper z information - I can even put it in a box for you ;) (if I bastardise the star-map slightly... funny that the star-map actually had planets in it).

As an aside: having taken a listen to the Spice Opera tracks I prefer them to the Precursors remixes - which are very good but seem to lack the manic character of the original SC2 mods.

Title: Re: A star control 1 remake that may actually get finished
Post by: Zeracles on December 12, 2008, 09:05:56 am
Map as text. (http://www.physics.usyd.edu.au/~asmith/files/maptable)

Columns are separated by whitespace and from left to right are x, y, z, redness, greenness, blueness, intensity, radius. Tell me if there are any problems with the format. (x, y, z) for these 1105 points are all within a 1x1x1 cube. The colour components are just random numbers between 0 and 1 (when there were only eight colours they were binary), (1,1,1) = white. Intensity values are taken randomly from the 20 images I posted (but these were originally any number between 0 and 2).

The radius values are skewed to give more small numbers than large - for this I used ((exp(rand))*0.01-0.01)/2 (where rand is a random number between 0 and 1), which puts all of the radii between 0 and 0.9, more at the lower end. Actually, before I was doing (1-exp(-rand))*0.01 but I've only just realised that doesn't do what I thought it did ;D (even though it looked that way at the time). Anyway the distribution of radius values can be fiddled with by just multiplying by some constant or using a different base or changing one of the other constants. To relate these radius values to the individual star images I posted, those were 100x100 and the radii were all 12.5.

I'm guessing most tweaks you can now do without me (I could still do them though), but tell me about any changes to the clustered points, they're really quick to make. I'd send the code but it's written in matlab.
Title: Re: A star control 1 remake that may actually get finished
Post by: Dragon on December 13, 2008, 09:37:15 am
Map as text. (http://www.physics.usyd.edu.au/~asmith/files/maptable)
Thanks for that - it'll work perfectly.  Although as a funny co-incidence I only added the ability to parse floats in scientific notation about a week ago :o

I'm trying quite hard to post a viewer but the project is in a bad state compilation wise.  The viewer part works fine but depends on a scripting library which I'm rewriting from the ground up and is unlikely to compile within the next 3 or 4 days.  Aaagh!
Quote
I derive extreme amusement from all kinds of strange things though
Me too apparently ;D,  I'm not sure how I could possibly have thought that a rewrite now was a good idea.

I'm guessing most tweaks you can now do without me (I could still do them though), but tell me about any changes to the clustered points, they're really quick to make. I'd send the code but it's written in matlab.
'will do; I haven't seen what the density of stars is like in the battle map so I've no idea what tweaks are necessary yet (anther reason why I really want to get the engine going again).
Title: Re: A star control 1 remake that may actually get finished
Post by: Zeracles on December 13, 2008, 12:06:26 pm
Although as a funny co-incidence I only added the ability to parse floats in scientific notation about a week ago :o
I would have been looking into it now at worst, but an auspicious portent anyway I hope!

Less than 4 hours to go I see :-X, mood music (http://www.thealmightyguru.com/VGMPF/Music/DOOM2-DOS/02-RunningFromEvil.zip) <- music from the first level of Doom II

Whatever happens with the compo, we still love you :-*
Title: Re: A star control 1 remake that may actually get finished
Post by: Dragon on December 13, 2008, 02:37:11 pm
Whatever happens with the compo, we still love you :-*
I don't know if you've spotted my last (slightly deranged post) but I haven't managed to finish in time.  I know I'm going to look at it again tomorrow morning and think I've made a right prat of myself but at the moment I still think it's inordinately funny :P.  Usually a sure sign that I should go to bed... but... I'm still on a roll.
Title: Re: A star control 1 remake that may actually get finished
Post by: Zeracles on December 13, 2008, 03:11:24 pm
Oops, I thought you might still be going for that ``Hi-I'm-here" option ;D

Well, keep rolling (though I'd probably just chill for the next few days if I were you)!
Title: Re: A star control 1 remake that may actually get finished
Post by: Dragon on December 16, 2008, 10:35:23 am
I was going to enter something, even if it was just a two ship melee... but... I later realised that my last backed up build was really old and not representative of where the game is currently (ie: it was crap).  I should've backed *before* the grand rewrite but forgot.  Oh well, such is life.

On the brighter side I'm still beavering away like ... ... something that beavers away.  Looking at what's failing I think (though this might be premature) that things are almost back to where they were before I began.  I also think (though again this may be premature) that I've fixed the tiny little performance issue.  It was taking more then 5 hours to parse the full source.  I don't know how much more because I never actually let it finish :o
Title: Re: A star control 1 remake that may actually get finished
Post by: Dragon on January 04, 2009, 12:07:05 pm
Right so I finally got around to doing some coding again.  I've put Zeracles stars in (sorry it took so long :-[) and the updated executables can be found at Retro Remakes (http://www.retroremakes.com) in the usual place (http://www.retroremakes.com/forum/viewtopic.php?f=120&t=11919&start=160) (last message in the thread).

Ah well, I was full of good intentions to get this finished over the Christmas holidays but just somehow didn't manage to open an IDE  :P
Title: Re: A star control 1 remake that may actually get finished
Post by: Zeracles on January 05, 2009, 02:50:17 am
Oooh, starry night indeed!

Let me know if just a little help could bring out any other effects that take your fancy . . . maybe we can make 'em twinkle for the sky of Dune, or something more dramatic ;)
Ah well, I was full of good intentions to get this finished over the Christmas holidays but just somehow didn't manage to open an IDE  :P
We're used to SC projects dying within weeks of conception :)

That's taken my mind off the cricket for just a little bit ;D
Title: Re: A star control 1 remake that may actually get finished
Post by: Dragon on January 06, 2009, 01:06:26 pm
That's taken my mind off the cricket for just a little bit

He hehe hahaha Ahaa Mwahahahaha!
:P
Ahem... uh... sorry 'bout that. *wanders back into the world of Star Control*

We're used to SC projects dying within weeks of conception

Well at least if this one fails I'm going to really upset that curve then ;),  just realised that bits of the engine have been around since 2003(!).  SC was (and still is) supposed to be a thin layer ontop of it (the engine).  Of course if I could actually settle on a scripting language it would be layering a lot faster.  It's been Smalltalk all through SC's dev but I've variously considered GNU Smalltalk, SYX Smalltalk and now (as of compo end) seem to be implementing my own.  It's a lot easier than it sounds - it really is a simple (but well thought out) language.

Let me know if just a little help could bring out any other effects that take your fancy . . . maybe we can make 'em twinkle for the sky of Dune, or something more dramatic

If your nebula generation is any good that would be a nice touch but I think trying to generate anything that a structure that complex could be a very, very big project all on it's own.  If you can think of a cheatsie way of doing it that would be great but otherwise don't stress.

As an aside I was given 'Prelude to Dune' for christmas.  If you enjoyed Dune you might want to think long and hard before you read it.  Both authors have been around for a while before they wrote it but it still seems to be ... childish ... in places. :(

Further aside:  if you're feeling absolutely manic you could try writing a sand dune generator - I tried one as part of my honours thesis until I realised how ridiculously difficult it was(!)
Title: Re: A star control 1 remake that may actually get finished
Post by: Zeracles on January 07, 2009, 11:44:40 pm
He hehe hahaha Ahaa Mwahahahaha!
:P
But we're still number one! :P

I know that's hollow, but the return series will be telling, this isn't the first time we've been labelled ``over the hill", it happened after we lost the Ashes 2-1 (same scoreline!) in England in 2005. We won the return series 5-0. Ponting can be a vengeful character.
If your nebula generation is any good that would be a nice touch but I think trying to generate anything that a structure that complex could be a very, very big project all on it's own.  If you can think of a cheatsie way of doing it that would be great but otherwise don't stress.
I have a way (though I wouldn't call it cheatsie!) which should do the job, I'll see about it some time soon.
As an aside I was given 'Prelude to Dune' for christmas.  If you enjoyed Dune you might want to think long and hard before you read it.  Both authors have been around for a while before they wrote it but it still seems to be ... childish ... in places. :(
Heh, I've only read the first fifty pages of Dune so far, I'm really not the reader I used to be :( I think you've just killed Prelude for me, I only read those sorts of things if I hear really good things about them.

EDIT: Prelude to Foundation though, that was worth reading.

Further aside:  if you're feeling absolutely manic you could try writing a sand dune generator - I tried one as part of my honours thesis until I realised how ridiculously difficult it was(!)
Interesting.
Title: Re: A star control 1 remake that may actually get finished
Post by: Dragon on January 09, 2009, 12:12:17 pm
But we're still number one! :P
Yeah, yeah.  Actually that was one of the few series that's entertained me in a long while.  Sadly somewhere along the line I lost interest in cricket. :(

I have a way (though I wouldn't call it cheatsie!) which should do the job, I'll see about it some time soon.
Thanks, there's no rush as I'm taking a slightly more relaxed view towards dev at the moment - mostly because I'm off on my smalltalk tangent but also because it's just to sodding hot to do anything right now.

Prelude to Foundation though, that was worth reading.
Yup, Asimov produced some awesome sci-fi.  It really helps that he wrote the Prelude to Foundation himself; as opposed to having another author write it.
Title: Re: A star control 1 remake that may actually get finished
Post by: Zeracles on January 23, 2009, 02:16:00 am
To generate nebulae, I take a set of points and smooth them. Single-scale smoothing (like the gaussians I was doing earlier in this thread) won't do the job though, that way one ends up with circles around all the points which isn't very interesting. So I turned to a multi-scale smoothing algorithm . . . one which I invented (http://au.arxiv.org/abs/0804.3866/) 8) (we describe it in subsection 5.2 and figure 10 shows an application - looking for galaxy clusters).

Now, if only citations by computer games counted ;)

(http://www.physics.usyd.edu.au/~asmith/files/nebula_lowres_spread4_blue.jpg)

The hope is that this delivers blobby nebulae with wisps. When I have time I'll make more of these and with much higher resolution, they will just be arrays of numbers between zero and one, and if you think they could be useful, you can decide what colours to give them and how bright they should be (I'll probably have a go at that too). Actually, different colours for different values might be the way to go . . .

These can also be done in 3D.

Funny how these nerdy tools are finding such uses, but I guess they are quite general.

I'm confused by something in Dune . . . is there a reason why in the game, the Atreides occupy Carthag and not Arrakeen?

EDIT
it's just to sodding hot to do anything right now.
I should have realised this, but here I am in my office, I'd like to go home but am effectively stranded seeing as how it's forty degrees outside :(
Title: Re: A star control 1 remake that may actually get finished
Post by: Dragon on January 24, 2009, 02:28:43 pm
To generate nebulae, I take a set of points and smooth them. Single-scale smoothing (like the gaussians I was doing earlier in this thread) won't do the job though, that way one ends up with circles around all the points which isn't very interesting. So I turned to a multi-scale smoothing algorithm . . . one which I invented (we describe it in subsection 5.2 and figure 10 shows an application - looking for galaxy clusters).
I like!  I even sort of understood that (for values of understanding tending to not really :P)  It looks like a pretty useful... basically given a set of points you can get contours based on point density?  Actually I was going to say density map rather than contours but it started seeming a bit circular.

Now, if only citations by computer games counted.
I could get an in-game character to mention they use your paper.  That way as long as no one checks who Death 623 is you shoud be fine ;D.

The hope is that this delivers blobby nebulae with wisps. When I have time I'll make more of these and with much higher resolution, they will just be arrays of numbers between zero and one, and if you think they could be useful, you can decide what colours to give them and how bright they should be (I'll probably have a go at that too). Actually, different colours for different values might be the way to go . . .
Cool! I can see where that's going (I've never managed wisps before - I'm more of a ... blobist).  Different colours for values should work nicely.  I'll generate some sort of smooth gradient across a bunch of colours or something.  It should look like this piccy I've nicked from somewhere...
(http://www.allegro.cc/depot/screenshots/1761_large.jpg)
...except pretend it's not psychedelic and has black spaces ;)

These can also be done in 3D.
Now this interested me - and not just because one'd be able to fly through it.  If you do your point distribution on the surface of a sphere it should turn out looking like a planetary nebula (http://images.google.co.za/images?um=1&hl=en&safe=off&client=firefox-a&rls=org.mozilla:en-US:official&q=planetary+nebula&start=21&sa=N&ndsp=21).  What I'd do is distribute points in a box, culling those that don't fall within the sphere and then project those points onto the spheres surface.  This can be take a bit further:  if instead of projecting each point out to a radius of 1.0 you project - say - 80% of the points out to a radius of 1.0 to 0.95 and then next 10% between 0.95 and 0.8 and the last 10% between 0.8 and 0.5.  A smoother radial distribution would look better but hopefully you see where I'm going.  The sparse spread inside should give some nice wispy effects near the (2D) edge of the circle once it's blurred.

Another reason I like this approach is that it gives a definite natural boundary to the nebula - a completely random distribution of points would look weird amongst the stars (unless it covered the entire background).

I'm confused by something in Dune . . . is there a reason why in the game, the Atreides occupy Carthag and not Arrakeen?
I think that's an honest to goodness cock-up.  Can't see any other reason why...  It's like in Dune 2:  the Atreides are blue though their crest is red and the Harkonnens are red though their crest is blue ::).

ps:  *sigh* whilst the temperatures dropped (yay for 28) it's now raining so I feel like I'm sitting in a sauna (at midnight  :o).  Not good for coding... I thought this country was supposed to be a desert ...
Title: Re: A star control 1 remake that may actually get finished
Post by: Zeracles on January 26, 2009, 12:25:31 am
I even sort of understood that (for values of understanding tending to not really :P)  It looks like a pretty useful... basically given a set of points you can get contours based on point density?  Actually I was going to say density map rather than contours but it started seeming a bit circular.
That's basically it (and although I struggled to explain it succinctly in written medium, it's not complicated), we measure local densities as a preliminary step, and then we go just a bit further to get probabilities from these overdensities. We generate maps of what we call the probability of overdensity rather than density because probability is more statistically meaningful (so if we claim we've found something interesting, we can tell people how likely it is). Each of the pixels tells one the probability of the local density ``beating" a random set (think of, say, a thousand sets, what fraction of those would be beaten). Probabilities have properties which make them preferable to densities for other reasons, but that's not really relevant here . . .

I think the beauty of this is that although these nebulae can become quite complex, all the information for them is contained in the original set of points from which they were smoothed. The above example comes from smoothing a random set - there may be nice features which come out when different kinds of distributions are tried, like the clustery ones for example, and the one you mention here -

Now this interested me - and not just because one'd be able to fly through it.  If you do your point distribution on the surface of a sphere it should turn out looking like a planetary nebula (http://images.google.co.za/images?um=1&hl=en&safe=off&client=firefox-a&rls=org.mozilla:en-US:official&q=planetary+nebula&start=21&sa=N&ndsp=21).  What I'd do is distribute points in a box, culling those that don't fall within the sphere and then project those points onto the spheres surface.  This can be take a bit further:  if instead of projecting each point out to a radius of 1.0 you project - say - 80% of the points out to a radius of 1.0 to 0.95 and then next 10% between 0.95 and 0.8 and the last 10% between 0.8 and 0.5.  A smoother radial distribution would look better but hopefully you see where I'm going.  The sparse spread inside should give some nice wispy effects near the (2D) edge of the circle once it's blurred.
I like your thinking . . . some of these nebulae look to have different kinds of structure at different scales which we can have a go at, possibly by smoothing different sets in different colours, and putting them together for the final result.

Heh, but let's see about it after I make some high-res 2D examples . . . I'm in the middle of prepping some fairly massive runs with several computers at work, hopefully I can slip this in.

I'm still going to post all these codes together with ``documentation" on the ultronomicon at some point, this little number we aren't planning to make publicly available until I write my next paper though ;D

I think South Africa's about to win the one day series . . .
Title: Re: A star control 1 remake that may actually get finished
Post by: Cedric6014 on January 26, 2009, 07:35:48 pm
I think South Africa's about to win the one day series . . .

I think they just did
Title: Re: A star control 1 remake that may actually get finished
Post by: Dragon on January 26, 2009, 10:56:51 pm
I think South Africa's about to win the one day series . . .

I think they just did

 ;D
Title: Re: A star control 1 remake that may actually get finished
Post by: Dragon on January 27, 2009, 12:37:54 am
... some of these nebulae look to have different kinds of structure at different scales which we can have a go at, possibly by smoothing different sets in different colours, and putting them together for the final result.
I like!  That should be a reasonable approximation for the distribution of elements in real nebulae.

...after I make some high-res 2D examples . . . I'm in the middle of prepping some fairly massive runs with several computers at work, hopefully I can slip this in.
I can see how that goes:  Unsuspecting Prof at a computer: "Hey guys!  One of the post-grads just discovered a new nebula!".  Slip a spaceship into the image - that'll really freak 'em out ;D.
Looking forward to the hi-res versions.

I'm still going to post all these codes together with ``documentation" on the ultronomicon at some point, this little number we aren't planning to make publicly available until I write my next paper though
Cool, I'll be very interested to see that - I'll almost certainly do a C++ conversion at the point.  I'm a huge fan of procedurally generated anything (remember the sand dunes - fear the sand dunes).
Title: Re: A star control 1 remake that may actually get finished
Post by: Zeracles on January 28, 2009, 05:34:48 am
I think South Africa's about to win the one day series . . .

I think they just did
This South African side has quality in all departments - Kallis, Boucher, de Villiers, Steyn, Smith - it's difficult to see a comeback from the Aussies in the return series. I hope you fellas are enjoying the sight of Australia getting flogged :)

*looks ahead to New Zealand*

Cool, I'll be very interested to see that - I'll almost certainly do a C++ conversion at the point.  I'm a huge fan of procedurally generated anything
I think the matlab and C codes side by side could be quite useful for future projects.
Title: Re: A star control 1 remake that may actually get finished
Post by: daryy on February 02, 2009, 03:35:25 am
How about you meaning?
Title: Re: A star control 1 remake that may actually get finished
Post by: Dragon on February 12, 2009, 05:48:03 am
Still going... I've been off on a slight tangent but I'm back again.  Still in code land without anything pretty to show though :-\.

As an aside: the comment by darry is - pretty ineffective - spam.
Title: Re: A star control 1 remake that may actually get finished
Post by: Zeracles on February 28, 2009, 05:04:39 am
Higher resolution
(http://www.physics.usyd.edu.au/~asmith/files/nebula_spread1.png)

Raised all the pixel values to the power of four
(http://www.physics.usyd.edu.au/~asmith/files/nebula_spread4.png)

Raised all the pixel values to the power of 16
(http://www.physics.usyd.edu.au/~asmith/files/nebula_spread16.png)

There are some artifacts in there (the rings and crescents) that I didn't see coming ('coz I'm used to doing this at low-res for science, not art ;D), maybe I can fix it by changing some of the algorithm parameters or applying another step to remove them (somehow) (adding more points to the random set of points from which this is smoothed would also work but take forever to run). One thing I do like about these is the sort of graininess that fuzzes up some of the high density regions.

I'll play with it a bit more. Unfortunately I have to divide my meagre Star Controlling time between this and project 6014 now :(

I know that's hollow, but the return series will be telling, this isn't the first time we've been labelled ``over the hill", it happened after we lost the Ashes 2-1 (same scoreline!) in England in 2005. We won the return series 5-0. Ponting can be a vengeful character.
Time for revenge! (http://content-aus.cricinfo.com/rsavaus2009/engine/current/match/350472.html)
Title: Re: A star control 1 remake that may actually get finished
Post by: Dragon on March 01, 2009, 02:42:00 am
Looking good!  I took the liberty of mucking around with the different images and added some stars.  Not too any particular purpose but I got this :

(http://farm4.static.flickr.com/3301/3318102223_3066fcd5ce_o.png)
All I did was change the layer colours/brightness/contrast and then added them together with some stars.  Where 'added' is just mathematical addition - nothing fancy.

There are some artifacts in there (the rings and crescents) that I didn't see coming ('coz I'm used to doing this at low-res for science, not art ;D), maybe I can fix it by changing some of the algorithm parameters or applying another step to remove them...
I'd say leave them, they don't look out of place and I suspect that a fix which doesn't crank up the number of stars will lose other detail in the clouds.

I'll play with it a bit more. Unfortunately I have to divide my meagre Star Controlling time between this and project 6014 now
Heh, yeah I also got a bit sidetracked and kinda wrote a tile editor (http://retroremakes.com/forum/index.php?topic=294.0) which was supposed to be done two weeks ago but only finally seems to have stabalised on Friday.

Time for revenge!
I've had friends try and explain to me why Test series are so much more strategic than 1 days and how one doesn't really see true skill from short matches but I just can't seem to get excited by them.  Nevertheless I still went and had a small sulk when I saw you were 300-and-something for 7 ;)
Title: Re: A star control 1 remake that may actually get finished
Post by: Zeracles on March 02, 2009, 12:56:04 pm
Nice, to better facilitate mucking around, here's the points this thing was smoothed from (http://www.physics.usyd.edu.au/~asmith/files/nebulapoints_1), and here are the pixel values (http://www.physics.usyd.edu.au/~asmith/files/nebulamap_1). I was going to try putting stars at all the positions occupied by those points . . . the nebulae would need to not have white at the max colourmap value I think.

Heh, yeah I also got a bit sidetracked and kinda wrote a tile editor (http://retroremakes.com/forum/index.php?topic=294.0) which was supposed to be done two weeks ago but only finally seems to have stabalised on Friday.
You're such a gun, tearing into projects like that . . . good to see Remakes back on its feet, is there a thread about SC:Redux yet? Probably better to keep it here where there's less pressure (and less competition)!
Title: Re: A star control 1 remake that may actually get finished
Post by: Dragon on March 03, 2009, 12:01:14 pm
Nice, to better facilitate mucking around, here's the points this thing was smoothed from (http://www.physics.usyd.edu.au/~asmith/files/nebulapoints_1), and here are the pixel values (http://www.physics.usyd.edu.au/~asmith/files/nebulamap_1). I was going to try putting stars at all the positions occupied by those points . . . the nebulae would need to not have white at the max colourmap value I think.
Thanks, I was thinking of asking for pixel values but wasn't sure how easy it'd be to export.  I should be able to to whip-up something interactive-ish: adjusting powers and colour bands or some-such.  I was wondering though - and I should probably not wonder this - but how hard would it be to take your smoothing routines into 3D?  Although even adding a Z axis into your current 500x500 images would generate about 500MB of data...  I'll have to have a ponder about this.

You're such a gun, tearing into projects like that . . . good to see Remakes back on its feet, is there a thread about SC:Redux yet? Probably better to keep it here where there's less pressure (and less competition)!
Heh, yeah I decided I needed a bit of a rest (possibly not everybodies idea of a rest though :P).  Anyway I'm making progress on SC again - fixes and error reporting in the parser.  There is a thread lurking around remakes but I haven't posted about it in a while so it's dropped off the radar. 

As stuff happens I'll keep you all updated - but there's nothing else pretty happening at the moment.

ps: I really wouldn't worry too much about the 3D thing - it just an interesting problem.
Title: Re: A star control 1 remake that may actually get finished
Post by: Zeracles on March 05, 2009, 03:02:06 am
I'll try doing one four times larger.

I was wondering though - and I should probably not wonder this - but how hard would it be to take your smoothing routines into 3D?
You're right to wonder - it's easy to do it in 3D (I'm doing it right now with redshift as the third dimension) except that it would take years to do at that resolution (the actual work I do with this requires nothing like that resolution) with this matlab code. Maybe I should put it in C but it'd still be a while. Basically, this is a sophisticated tool that isn't designed with sexy images in mind. I'll come back to this tractability problem in a moment.

Although even adding a Z axis into your current 500x500 images would generate about 500MB of data...  I'll have to have a ponder about this.
I could just reduce the precision by rounding the values to 3 significant figures or something.

Back to making 3D more doable, if you like the general approach, generating the complexity of a nebula by smoothing point distributions (and modifying properties of the nebulae by fiddling with the properties of the distribution), there are other smoothing algorithms out there and you might be able to get hold of code for them. People do smoothing with raw densities (counts in cells), wavelets and gaussians too (to name just 3). I can give you code for the last - here (http://www.physics.usyd.edu.au/~asmith/files/background.m) is the code I used to make the stellar backgrounds, which is essentially gaussian smoothing with a bit tacked on to make the things look stellar. I give a brief description of the code here (http://wiki.uqm.stack.nl/User:Zeracles/Background#Code_Description), hopefully this makes it easy to translate to C. Googling matlab functions can tell one what they do.

The reason I bring this up is that this gaussian smoothing is faster than my algorithm. Now, smoothing with a single fixed scale just gives circles around all the points, but if instead, one smooths with different scales, and one makes the range of these scales large enough such that these circles overlap, they might make something like a nebula. I'm not really sure and don't have time to check right now. For this, I think one would have to change the way the pixel values are normalised. In that code I just posted, the pixel values stack on top of each other and aren't allowed to exceed one. One might like to change this so that the max colourmap value is not one but whatever the max pixel value after the gaussian smoothing happens to be.

Another possibility to make this flying through 3D more doable is to just do a series of 2D frames. First imagine that one is flying through the 3D distribution of points. Make a 2D image for what one sees as one passes through - each frame is a smoothed image of the distribution from the flyer's point of view. The individual frames mightn't need such high resolution.

Another possibility is to first smooth at low resolution, and then smooth the output to sort of guess what the image would have looked like if the sampling had been finer. I noticed something like this happen when I jpegged the first low-res 100x100 nebula.

Back to that code I posted - the thing apart from smoothing that it does is generate the stars, and there are parameters there for fiddling with aspects of their geometry like the length of the spokes, their rotation angle (+ or x) and the number of spokes on them. It's occurred to me that they could be made to twinkle by tweaking these things.

Heh, yeah I decided I needed a bit of a rest (possibly not everybodies idea of a rest though :P).
As well as making games, playing games can be quite fun too!
Title: Re: A star control 1 remake that may actually get finished
Post by: Dragon on March 08, 2009, 12:58:16 am
I can give you code for the last - here (http://www.physics.usyd.edu.au/~asmith/files/background.m) is the code I used to make the stellar backgrounds, which is essentially gaussian smoothing with a bit tacked on to make the things look stellar. I give a brief description of the code here (http://wiki.uqm.stack.nl/User:Zeracles/Background#Code_Description), hopefully this makes it easy to translate to C. Googling matlab functions can tell one what they do.
Thanks!  I think I understand it completely now.  Although seriously what kind of language does element look-ups with round brackets  ;).  Rewriting it in C++ should give a *huge* speed increase.  It should also make it completely unreadable - I'll send it back to you as soon as I'm done  ;D.

The reason I bring this up is that this gaussian smoothing is faster than my algorithm. Now, smoothing with a single fixed scale just gives circles around all the points, but if instead, one smooths with different scales, and one makes the range of these scales large enough such that these circles overlap, they might make something like a nebula. I'm not really sure and don't have time to check right now. For this, I think one would have to change the way the pixel values are normalised. In that code I just posted, the pixel values stack on top of each other and aren't allowed to exceed one. One might like to change this so that the max colourmap value is not one but whatever the max pixel value after the gaussian smoothing happens to be.
I was writing a fairly long piece on why I agreed that it should work... then I decided it would be faster to just try it so... here its:

(http://farm4.static.flickr.com/3603/3336795489_efdd11d805_o.png)
The initial points source.  Should be about 1/4 full white points the rest black.

(http://farm4.static.flickr.com/3600/3336795493_fd6a0a0510_o.png)
Gaussian smoothing with a radius of 2 on the source image.

(http://farm4.static.flickr.com/3389/3336795495_52a5d07d94_o.png)
Gaussian smoothing with a radius of 8 on the previous image.

(http://farm4.static.flickr.com/3313/3336795499_bf45252213_o.png)
Gaussian smoothing with a radius of 32 on the previous image.

To stop things smoothing out to a *really* dark grey I've normalised back to white and then scaled the the intensity (up or down) around middle grey to give it the black patches.  I may have over done it somewhat...  The nasty bright edge artifacts could be gotten rid of by 'looping' the smoothing ie:  bottom edge will spill back over into the top edge.  It'll also make the image tileable (which I don't need but always prefer).

Another possibility to make this flying through 3D more doable is to just do a series of 2D frames. First imagine that one is flying through the 3D distribution of points. Make a 2D image for what one sees as one passes through - each frame is a smoothed image of the distribution from the flyer's point of view. The individual frames mightn't need such high resolution.

Another possibility is to first smooth at low resolution, and then smooth the output to sort of guess what the image would have looked like if the sampling had been finer. I noticed something like this happen when I jpegged the first low-res 100x100 nebula.
Normally I think that any sort of full screen processing is just too slow.  Consider a resolution of 1600x1200 at 75 frames per second on a single 3GHz CPU.  Assuming single cycle instructions (Ha!) it'll only have the power to process about a 1/5 of the screen before it needs to start again. Throw in something complicated like Gaussian smoothing and the poor CPU is toast.

However, you second possibility gave me pause.  I was thinking that one would lose too much detail doing that but then realised: it's a cloud - there's bugger all detail to begin with.  So I gave it a try and used a 100x100 image (25 times less processing) and linearly scaled it up to 500x500 and this is what I got.

(http://farm4.static.flickr.com/3406/3337654658_2c36e4a430_o.png)
Unless you put them side by it's really difficult to tell the difference.  And graphics hardware is *really* good at scaling up images - it's basically free :).  So doing the Gaussian smoothing with SIMD instructions on multiple CPUs on a 320x200 image and then scaling it up to 1600x1200 could conceivably work.  Wow!  I'd never have thought it.

The way I'd have tried would have been to approximate the brightness with a 3D array of point sprites textured with a single smoothed point.  If that didn't make any sense ignore it.  It would have looked crap anyway.

Right to the coding-mobile I need to try this.

[EDIT] Oops, off by 4 error.  A CPU should be able to process about 4/5s of the screen in 1/75 of a second - which is way better than 1/5 of the screen.
Title: Re: A star control 1 remake that may actually get finished
Post by: Zeracles on March 11, 2009, 11:49:44 pm
I just realised the code for my algorithm was slowed by a lot of unnecessary work for this purpose (like creating error maps), but you seem to have things in hand with this :)

Rewriting it in C++ should give a *huge* speed increase.  It should also make it completely unreadable - I'll send it back to you as soon as I'm done  ;D.
I really want us to get the matlab compiler . . .

Another thing you might like to try is kind of averaging the images you get for the different smoothing scales, so you can have broad large scale things that still have a fair bit of detail to them. It might also be possible to recapture the dustiness my algorithm was giving by randomly pushing the values around somehow after the smoothing (multiplying pixels by a random number between 0.9 and 1.1, say) - it'd have to be done with at least 500x500 resolution I imagine.

Yet another idea is, if you want to animate the nebulae (well they may not be nebulae, they could be explosions, for instance), all one has to do is move the points and redo the smoothing for each new point distribution. This could be automated, giving the points trajectories and velocities which depend on position, etc. . . .
Title: Re: A star control 1 remake that may actually get finished
Post by: Dragon on March 12, 2009, 11:50:01 am
I just realised the code for my algorithm was slowed by a lot of unnecessary work for this purpose (like creating error maps), but you seem to have things in hand with this :)
I really want us to get the matlab compiler . . .
I don't know anything about the matlab compiler but I assume it must be pretty hardcore (given that matlabs been around for ages) so if you can persuade the torrent mobile powers that be to get a copy it'll provided quite a performance boost.  It's been a while since I last looked at interpreters but from my basic days I'd imagine you could get around hundred of times speed increase (without knowledge of the entire program an interpreter just can't make some optimisations and it still has to do the lexical analysis - ouch).

But I digress, the best optimisations aren't made by thowing better hardware or new technology at a problem but by doing less.  Which is to say by changing or refining the algorithm (I know, I'm lecturing but bear with me).  The change that'd give the biggest performance win to the star blurring code would be to only run the X and Y loops over the area around the star to which the Gaussian distribution contributes significantly. ie: where the computed brightness is greater than the cut off.

A different (and more complicated but much faster) optimisation is to pre-compute the gaussian for a single point.  Then plot the stars but instead of drawing a point draw the pre-computed gaussian image instead.

This can be extended to an image where the positions of the stars aren't known - where all that's available is the image with bright points plotted on it.  In this case loop X and Y and if the current point is black: do nothing but if the current point is bright then draw the pre-computed gaussian image.

This can be extended even further to an image with points of varied brightness by multiplying the pre-computed gaussian image by the brightness of the point.  This isn't a good approximation of the gaussian for a dim point but this can be 'fixed' by pre-computing a range of gaussian blurred images from points of different brightnesses.

Another thing you might like to try is kind of averaging the images you get for the different smoothing scales, so you can have broad large scale things that still have a fair bit of detail to them. It might also be possible to recapture the dustiness my algorithm was giving by randomly pushing the values around somehow after the smoothing (multiplying pixels by a random number between 0.9 and 1.1, say) - it'd have to be done with at least 500x500 resolution I imagine.
I'm really hoping that the test images I posted look crap (ie: not dusty) because I didn't include the star spoke generation code - I haven't checked but I strongly suspect that's it.  Unfortunately (and again this is just a suspicion) I think that multiplying pixels by a random number will make it look grainy rather than dusty.  I'll give it a bash though.  And on that subject I haven't got any further on implement your code in C++ because (for better or worse) I got sucked back into the actual code of SC Redux.  I was avoiding a couple of particularly nasty problems but I have them solved now so I'm on a roll again.

If you'd like the optimised C++ code (ie: if it'd be useful to your studies or some'at) I'll quite happily work on it sooner rather than later as I'm going to convert it at some point.
Title: Re: A star control 1 remake that may actually get finished
Post by: Lukipela on March 16, 2009, 11:43:32 am
I'm in awe of the stuff you guys can apparently create with Matlab and C++ This is going to be a fine looking game.
Title: Re: A star control 1 remake that may actually get finished
Post by: Dragon on March 28, 2009, 09:55:31 am
I've taken a break from the coding thing for a bit which has given me time to clean up some of my models.  Generally small things like the ventral cannon on the Arilou Skiff and the point defense system on the Earthling Cruiser.  I also remodeled the Shofixti Scout because I *really* didn't like how it looked.

And then - just for shits and giggles - I decided to draw the rest of the statistics screen.  As I don't really have a development home for SC any more I'm posting them here (what with my original Remakes thread being lost to the server defacement).  Hope you enjoy :)

First up is the Title Screen.  It's a complete mock-up and I'm still going to have to model a planet for the bottom.  I just can't be bothered at the moment.
(http://farm4.static.flickr.com/3559/3392078044_0bb1cfe0d7_o.png)

(ps: I'm going to be spamming the board for the next quarter hour or so).
Title: Re: A star control 1 remake that may actually get finished
Post by: Dragon on March 28, 2009, 09:58:07 am
Some of my original stats screens were rendered in-engine, these are all just mock-ups though...

Next up is the Androsynth Guardian.
(http://farm4.static.flickr.com/3620/3386012608_3ef797a6af_o.png)
Title: Re: A star control 1 remake that may actually get finished
Post by: Dragon on March 28, 2009, 09:59:22 am
The redone Ilwrath Avenger, there's a lot of new detail on the bottom now.
(http://farm4.static.flickr.com/3458/3391141163_9244ce77d7_o.png)
Title: Re: A star control 1 remake that may actually get finished
Post by: Dragon on March 28, 2009, 10:00:17 am
(http://farm4.static.flickr.com/3610/3386012614_0d29a270ed_o.png)
Title: Re: A star control 1 remake that may actually get finished
Post by: Dragon on March 28, 2009, 10:00:52 am
(http://farm4.static.flickr.com/3567/3386012628_9420b4ab15_o.png)
Title: Re: A star control 1 remake that may actually get finished
Post by: Dragon on March 28, 2009, 10:01:11 am
(http://farm4.static.flickr.com/3465/3385219519_ba7333b8fc_o.png)
Title: Re: A star control 1 remake that may actually get finished
Post by: Dragon on March 28, 2009, 10:01:39 am
(http://farm4.static.flickr.com/3589/3385219517_ce3c18c2b9_o.png)
Title: Re: A star control 1 remake that may actually get finished
Post by: Dragon on March 28, 2009, 10:01:59 am
(http://farm4.static.flickr.com/3644/3391141169_067e1d1066_o.png)
Title: Re: A star control 1 remake that may actually get finished
Post by: Dragon on March 28, 2009, 10:02:38 am
(http://farm4.static.flickr.com/3454/3388426114_3e5f642824_o.png)
Title: Re: A star control 1 remake that may actually get finished
Post by: Dragon on March 28, 2009, 10:02:59 am
(http://farm4.static.flickr.com/3614/3390970140_891098ea2c_o.png)
Title: Re: A star control 1 remake that may actually get finished
Post by: Dragon on March 28, 2009, 10:03:14 am
(http://farm4.static.flickr.com/3447/3390970144_9bb20f8c12_o.png)
Title: Re: A star control 1 remake that may actually get finished
Post by: Dragon on March 28, 2009, 10:03:35 am
(http://farm4.static.flickr.com/3567/3390970154_5234ebe3a0_o.png)
Title: Re: A star control 1 remake that may actually get finished
Post by: Dragon on March 28, 2009, 10:03:52 am
(http://farm4.static.flickr.com/3449/3390970454_0469f230dd_o.png)
Title: Re: A star control 1 remake that may actually get finished
Post by: Dragon on March 28, 2009, 10:04:23 am
(http://farm4.static.flickr.com/3197/3390970468_d2ec8c2d8c_o.png)
Title: Re: A star control 1 remake that may actually get finished
Post by: Dragon on March 28, 2009, 10:05:33 am
And finally the redone Scout, which I'm much happier with.
(http://farm4.static.flickr.com/3255/3392902364_063a12772a_o.png)

*phew*
Title: Re: A star control 1 remake that may actually get finished
Post by: Lukipela on March 28, 2009, 11:11:28 am
Wow. That's a lot of beautiful models. Just to check that I've understood it, those are all 3D, right? If so, that's an awesome contribution to the SC world. I'm going to have to make a news post about you next week ;)
Title: Re: A star control 1 remake that may actually get finished
Post by: Dragon on March 28, 2009, 12:09:21 pm
Wow. That's a lot of beautiful models. Just to check that I've understood it, those are all 3D, right? If so, that's an awesome contribution to the SC world.
Thanks for that :).  Yup everything SC related is modeled - ships obviously but also things like the shards, spores and bubbles etc...  The backgrounds I've nicked from various places on the net (google image search "stars" in fact).  Energy weapons and trails I've drawn in by hand but they'll be particles systems in-game.
Title: Re: A star control 1 remake that may actually get finished
Post by: Zeracles on March 29, 2009, 10:05:57 am
I don't know anything about the matlab compiler but I assume it must be pretty hardcore (given that matlabs been around for ages) so if you can persuade the torrent mobile powers that be to get a copy it'll provided quite a performance boost.
Also, I have 60 computers at my disposal (including my supervisor's 8x3GHz 8)) in our department, but we only have a handful of matlab licences. Get the compiler, turn it into machine code and I can actually use all that CPUage :D People do tell me I should use something else, but I have enough friends who spend months grappling with lower level languages. There are some tricks with matlab. If at all possible, do array operations - matlab beats fortran in this mode. But don't do this to the point where one has millions of elements in memory. And matlab functions are internally compiled, so use them to replace messy sections of code where possible.

But I digress, the best optimisations aren't made by thowing better hardware or new technology at a problem but by doing less.
Absolutely, to bring out an example from my work, identifying overdensities in galaxy positions (clusters, filaments, sheets and such) - using galaxy positions themselves as a kind of adaptive grid where we sample (instead of sampling everywhere), because galaxy clusters really are more likely to be found where there are galaxies (duh), has saved more time than getting the compiler or doing a conversion to C/fortran ever would have.

The change that'd give the biggest performance win to the star blurring code would be to only run the X and Y loops over the area around the star to which the Gaussian distribution contributes significantly. ie: where the computed brightness is greater than the cut off.
That's already there, this is what ``cutoffradiusfactor" is for.

A different (and more complicated but much faster) optimisation is to pre-compute the gaussian for a single point.  Then plot the stars but instead of drawing a point draw the pre-computed gaussian image instead.
I thought of that, but it seemed a little messy to me (especially with varying radii). Once I had it going fast enough I didn't bother optimising any further, fast computers make people sloppy, unfortunately :-\

Another thing you might like to try is kind of averaging the images you get for the different smoothing scales, so you can have broad large scale things that still have a fair bit of detail to them. It might also be possible to recapture the dustiness my algorithm was giving by randomly pushing the values around somehow after the smoothing (multiplying pixels by a random number between 0.9 and 1.1, say) - it'd have to be done with at least 500x500 resolution I imagine.
I'm really hoping that the test images I posted look crap (ie: not dusty) because I didn't include the star spoke generation code - I haven't checked but I strongly suspect that's it.  Unfortunately (and again this is just a suspicion) I think that multiplying pixels by a random number will make it look grainy rather than dusty.
Maybe the problem is that then it depends on pixel size. It might be better to try multiplying by a ``surface" of values, a surface with small scale undulations like the first gaussian smoothing you tried. The same effect might be achieved by averaging the nebula image with it, too.

If you'd like the optimised C++ code (ie: if it'd be useful to your studies or some'at) I'll quite happily work on it sooner rather than later as I'm going to convert it at some point.
Don't worry, I was probably only going to use it for some visualisation perhaps, maybe not even that.

I'm in awe of the stuff you guys can apparently create with Matlab and C++ This is going to be a fine looking game.
I'm not sure I can draw any other way ;D I trust you're suitably amazed I managed to stay focused for 7 pages? ;)

Wow. That's a lot of beautiful models.
Yeah, my favourite's the Arilou.
Title: Re: A star control 1 remake that may actually get finished
Post by: Lukipela on March 29, 2009, 10:28:28 am
I'm not sure I can draw any other way ;D

Combined with fossmans fractal art, this really widens the concept of art for me.
Title: Re: A star control 1 remake that may actually get finished
Post by: Dragon on April 04, 2009, 01:45:40 am
The change that'd give the biggest performance win to the star blurring code would be to only run the X and Y loops over the area around the star to which the Gaussian distribution contributes significantly. ie: where the computed brightness is greater than the cut off.
That's already there, this is what ``cutoffradiusfactor" is for.
I'd hoped to have more time this week to code up what I meant but we've a hectic deadline on the 1st May so free time is a bit scarce at the moment :(.  The gist of it is that instead of testing cutoffradiusfactor to determine whether or not a pixel should be processed the x, and y loops should only ever touch processable pixels.  With the spiky bits 'on' an approximate bounding square (around the point) would be needed and cutoffradiusfactor would still need to be tested.  Without the spiky bits (to use the technical term ;D) the Gaussian effect is spherical so the x and y loops need cover only a circle.  With a the circle calculated from r^2 = x^2 + y^2 or some'at.

I thought of that, but it seemed a little messy to me (especially with varying radii). Once I had it going fast enough I didn't bother optimising any further, fast computers make people sloppy, unfortunately :-\
The flip side is that fast computers can be more productive and can make for more readable code.  Much as I love doing low level optimisations it does take a *very* long time.

Maybe the problem is that then it depends on pixel size. It might be better to try multiplying by a ``surface" of values, a surface with small scale undulations like the first gaussian smoothing you tried. The same effect might be achieved by averaging the nebula image with it, too.
Whoops, I sort of seem to have missed/forgotten that you wrote this so I'm still going to have to have a think about it.  I'll give it a try (probably post April :() and let you know how it goes.

I'm not sure I can draw any other way ;D I trust you're suitably amazed I managed to stay focused for 7 pages? ;)
Truly :).  Much appreciated.

Wow. That's a lot of beautiful models.
Yeah, my favourite's the Arilou.
Mine too, it's the only ship which is ever seen close up so it's got a lot more detail than the others.
Title: Re: A star control 1 remake that may actually get finished
Post by: Zeracles on April 22, 2009, 02:21:01 am
Now this is bizarre. Shortly after whining about this on an online forum we get the matlab compiler. Maybe the tech support here has their eye on my online activities? Hmm, maybe I've been abusing their bandwidth for too many things that don't involve downloading papers, data and academic correspondence . . .

@tech support: the excecutables don't work - hurry up and correct the path to the shared C libraries in the files I don't have write permission to!

The backgrounds I've nicked from various places on the net (google image search "stars" in fact).
I recommend Hubble heritage (http://heritage.stsci.edu/) :D

I'm not sure I can draw any other way ;D
Combined with fossmans fractal art, this really widens the concept of art for me.
I was serious. I can't even remember when I last interactively manipulated an image except to touch it up a bit. It's like painting with a precise hand/brush. I could draw anything this way, with arbitrary precision and it'd be really easy to make changes which would be difficult to apply otherwise . . . however I suspect it'd still be a retarded way for an artist with some actual skill (unlike me) to operate ;D

Maybe we should go into business like fossa?

Also, when the stars were clustered, the distributions were fractal.

Maybe the problem is that then it depends on pixel size. It might be better to try multiplying by a ``surface" of values, a surface with small scale undulations like the first gaussian smoothing you tried. The same effect might be achieved by averaging the nebula image with it, too.
Whoops, I sort of seem to have missed/forgotten that you wrote this so I'm still going to have to have a think about it.  I'll give it a try (probably post April :() and let you know how it goes.
I had a look at multiplying by a surface (also the averaging thing, but I don't think it works too well).
(http://www.physics.usyd.edu.au/~asmith/files/multipliednebula/premultiplication.png)
In a 100x100 square, smoothed 100 points with a width of 10. All values normalised to have a maximum of one.
Let this image = a

(http://www.physics.usyd.edu.au/~asmith/files/multipliednebula/multiplier.png)
In that same square, smoothed 1000 points with a width of 1. Again, all values normalised to have a maximum of one.
Let this image = b

(http://www.physics.usyd.edu.au/~asmith/files/multipliednebula/multiplied_1.png)
This is a*(b+0.5)

(http://www.physics.usyd.edu.au/~asmith/files/multipliednebula/multiplied_2.png)
a*(0.5*b+0.75)

(http://www.physics.usyd.edu.au/~asmith/files/multipliednebula/multiplied_3.png)
a*(0.25*b+0.875) : more gradual variation

So, one can get small scale variations imposed on large scale blobs this way. It might be possible to make them dusty like this - the small scale variations would have to be smaller than this though (smaller in scale, not ntensity I mean), and so would have to come from the smoothing of a lot more points than used here.

Just a sampler :)
Title: Re: A star control 1 remake that may actually get finished
Post by: Dragon on April 25, 2009, 03:19:42 am
@tech support: the excecutables don't work - hurry up and correct the path to the shared C libraries in the files I don't have write permission to!
Here's hoping that gets noticed.  ;D

I had a look at multiplying by a surface (also the averaging thing, but I don't think it works too well)
...
Just a sampler :)
I tried 'screening' the two images instead. ie:
b *= 0.15 (Just to reduce the brightness)
result = (1-a)*b + a (assuming pixels values in the range 0..1)
and got:
(http://farm4.static.flickr.com/3350/3472427411_08ce79e4a7.jpg?v=0)
which avoids the high contrast variations that multiplying can give.

A disturbingly in-depth look at screening can be found here (http://www.digitalartform.com/screen.htm).

Unfortunately I'm still rolling up to my end of April deadline at work so I haven't had a chance to do much of anything else.  *Want deadline end now*

However I have got tiny bit of work done on the language side of things.  Mostly I just broke stuff though.  The image below is two sets of preprocessed C++ files.  The one on the left is naively but correctly preprocessed.  The one on the right is optimised to only preprocess text which would change but I kinda got something wrong.

(http://farm4.static.flickr.com/3567/3472427413_463f7daeda_o.png)

Incidentally the comparison program I'm using is CompareIt 4.0 which is the best text compare'er I've found.  Also the final preprocessed file won't compile - it's just a test case with the minimal amount of input for which I can reproduce that bug (the big chunk of missing text on the right should not be missing).

Title: Re: A star control 1 remake that may actually get finished
Post by: Dragon on May 13, 2009, 11:40:41 am
Alright I've managed a fairly major milestone, only there's a bit of a gotcha.  You have to really, really like C++ before you'll appreciate it.  So to keep it short I'll just mention that I can successfully preprocess the entire set of windows headers.  That's 46 000 lines of code per translation unit (a translation unit is a .cpp file).  Feeding the preprocessed source back to a compiler gives *no* errors so I can be fairly certain I haven't missed anything.

If you're asking WTF this has to do with Star Control I can explain.  I need the structures (classes and structs) and various function pointers (and calling conventions) so that I can call C++ methods directly from Smalltalk.  To do this I need to parse at least some of my own source files - which is easy'ish - but I decided I'd go big and just parse the whole damn lot.  And now if you're still wondering what this has to do with Star Control I can explain again.  I'm still using Smalltalk as the gameplay language except again I decided to go big and write my own implementation (I may have mentioned my reasons in a previous post - I forget).  I'm basically using Star Control Redux to drive the languages development which is why this is taking a little longer than at first anticipated.

For the really, really C++ guys (anyone?) here's the include tree for one of my .cpp source files.  Just read down to where you see windows.h and then give up.

Code: [Select]
     AdditionalTypes.cpp
         AdditionalTypes.h
             ArraySimple.h
                 stdlib.h
                     crtdefs.h
                         sal.h
                         vadefs.h
                     limits.h
                         crtdefs.h
                 string.h
                     crtdefs.h
                 Define.h
                     Shlwapi.h
                         ObjBase.h
                             Rpc.h
                                 Windows.h
                                     excpt.h
                                         crtdefs.h
                                     stdarg.h
                                         vadefs.h
                                     WinDef.h
                                         WinNT.h
                                             ctype.h
                                                 crtdefs.h
                                             specstrings.h
                                             BaseTsd.h
                                             Guiddef.h
                                                 string.h
                                             PshPack4.h
                                             PopPack.h
                                             PshPack4.h
                                             PshPack2.h
                                             PopPack.h
                                             PshPack2.h
                                             PshPack2.h
                                             PopPack.h
                                             PopPack.h
                                             PshPack8.h
                                             PopPack.h
                                             PopPack.h
                                             string.h
                                         specstrings.h
                                     winbase.h
                                         WinError.h
                                     WinGDI.h
                                         PshPack1.h
                                         PopPack.h
                                         PshPack2.h
                                         PopPack.h
                                         PshPack2.h
                                         PopPack.h
                                         PshPack4.h
                                         PopPack.h
                                     WinUser.h
                                         stdarg.h
                                         PshPack2.h
                                         PopPack.h
                                         Tvout.h
                                     WinNls.h
                                     WinCon.h
                                     WinVer.h
                                     WinReg.h
                                         Reason.h
                                     WinNetWk.h
                                     StrAlign.h
                                     WinSvc.h
                                     Mcx.h
                                     Imm.h
                                 BaseTsd.h
                                 RpcDce.h
                                     specstrings.h
                                     RpcDceP.h
                                 RpcNsi.h
                                 RpcNtErr.h
                                 excpt.h
                                 WinError.h
                                 RpcAsync.h
                             RpcNdr.h
                                 PshPack8.h
                                 BaseTsd.h
                                 RpcNsip.h
                                 PopPack.h
                             PshPack8.h
                             stdlib.h
                             WTypes.h
                                 Rpc.h
                                 RpcNdr.h
                                 BaseTsd.h
                                 Guiddef.h
                             Unknwn.h
                                 Rpc.h
                                 RpcNdr.h
                                 Windows.h
                                 Ole2.h
                                     PshPack8.h
                                     WinError.h
                                     ObjBase.h
                                     OleAuto.h
                                         PshPack8.h
                                         OAIdl.h
                                             Rpc.h
                                             RpcNdr.h
                                             Windows.h
                                             Ole2.h
                                             ObjIdl.h
                                                 Rpc.h
                                                 RpcNdr.h
                                                 Windows.h
                                                 Ole2.h
                                                 Unknwn.h
                                                     Rpc.h
                                                     RpcNdr.h
                                                     Windows.h
                                                     Ole2.h
                                                     WTypes.h
                                         PopPack.h
                                     OleIdl.h
                                         Rpc.h
                                         RpcNdr.h
                                         Windows.h
                                         Ole2.h
                                         ObjIdl.h
                                     PopPack.h
                             ObjIdl.h
                             Guiddef.h
                             CGuid.h
                             UrlMon.h
                                 Rpc.h
                                 RpcNdr.h
                                 Windows.h
                                 Ole2.h
                                 ObjIdl.h
                                 OleIdl.h
                                 ServProv.h
                                     Rpc.h
                                     RpcNdr.h
                                     Windows.h
                                     Ole2.h
                                     ObjIdl.h
                                 MsXml.h
                                     Rpc.h
                                     RpcNdr.h
                                     Unknwn.h
                                     ObjIdl.h
                                     OAIdl.h
                             PropIdl.h
                                 Rpc.h
                                 RpcNdr.h
                                 Windows.h
                                 Ole2.h
                                 ObjIdl.h
                                 OAIdl.h
                             PopPack.h
                         ShTypes.h
                             Rpc.h
                             RpcNdr.h
                             WTypes.h
                             PshPack1.h
                             PopPack.h
                             PshPack1.h
                             PopPack.h
                             PshPack8.h
                             PopPack.h
                             PshPack1.h
                             PopPack.h
                         PshPack8.h
                         PopPack.h
                 PointerRemapper.h
                     Define.h
                     PointerRemapper.inl
             ArrayTemplate.h
                 stdlib.h
                 string.h
                 FastMemset.h
                     string.h
                     FastMemset.inl
                 Define.h
                 PointerRemapper.h
                 FastMemcpy.h
                     string.h
                     FastMemcpy.inl
             ArrayInt.h
                 ArrayTemplate.h
             DataTypes.h
                 ErrorHandler.h
                     Define.h
                     string.h
                     ErrorTypes.h
                 Chars.h
                     stdlib.h
                     string.h
                     StringHelper.h
                         string.h
                         Define.h
                     ArrayChar.h
                         ArrayTemplate.h
                     DataTypes.h
                     ArrayTemplate.h
                     ArraySimple.h
                     ArrayInt.h
                 ArrayUnknown.h
                     stdlib.h
                     memory.h
                         crtdefs.h
                     string.h
                     DataTypes.h
                     ArrayTemplate.h
                 ArraySimple.h
                 math.h
                     crtdefs.h
             GeometricTypes.h
                 Define.h
                 ChunkFile.h
                     Define.h
                     ChunkFileNames.h
                     ChunkFileIndex.h
                         ArrayTemplate.h
                     FileExtended.h
                         FileBasic.h
                             stdio.h
                                 crtdefs.h
                                 swprintf.inl
                                     vadefs.h
                             Define.h
                             FileMode.h
                         ArrayTemplate.h
                         ArrayInt.h
                         ArrayUnknown.h
                         ArraySimple.h
                         LinkListTemplate.h
                             stdlib.h
                             DataTypes.h
                         LinkListUnknown.h
                             LinkListTemplate.h
                         TreeTemplate.h
                             stdlib.h
                             memory.h
                             DataTypes.h
                             FreeList.h
                                 stdlib.h
                                 memory.h
                                 IntegerHelper.h
                                     Define.h
                                     IntegerHelper.inl
                                 LinkListUnknown.h
                                 DataTypes.h
                         TreeUnknown.h
                             TreeTemplate.h
                         EnumeratorTemplate.h
                             Define.h
                             stdlib.h
                             DataTypes.h
                             ArrayInt.h
                             LinkListTemplate.h
                             Define.h
                             StringHelper.h
                         EnumeratorUnknown.h
                             EnumeratorTemplate.h
                         ErrorTypes.h
                     ArrayTemplate.h

Right, I'm off to spam UQMF too as I've sort of let that thread languish...
Title: Re: A star control 1 remake that may actually get finished
Post by: Lukipela on May 17, 2009, 10:59:16 am
This doesn't really tell me much of anything, but I'm glad to see the project moving forward. Any timetable on when we'll be able to regale each other with tall tales of our daring strategic battles?
Title: Re: A star control 1 remake that may actually get finished
Post by: Dragon on May 19, 2009, 09:55:41 am
*sigh* I just realised I did something exceptionally stupid code-wise and cost myself somewhat more than a months worth of work.  Added to this it's going to take me ages to unroll the mess I created so I'm re-planning and re-strategising.  I'm thinking of dropping Smalltalk for the interim and just writing everything in C++.  It's been ages since I last released something so I really want to get running code out again.  I can pickup with the language again later.

The gristly details can be found here (http://retroremakes.com/forum/index.php/topic,600.0.html).

ps: Cymon is guesst, got renamed after the forum hack.
Title: Re: A star control 1 remake that may actually get finished
Post by: Lukipela on May 19, 2009, 11:03:49 am
Sorry to hear about that. That's a lot of wasted effort. :( Hope it works out eventually. So are you going to keep trudging through it, or are you taking a break? Maybe a week or two without any coding in your spare time might be healthy? Oh, and say hi to guesst from us.
Title: Re: A star control 1 remake that may actually get finished
Post by: gihren on May 22, 2009, 09:00:47 am
That sucks.  We all do that with even minor things, you just picked a long problem to do it with this time.

Take a couple weeks, throw down a few beers, and come back.  You may even get a few ideas when you sit down.
Title: Re: A star control 1 remake that may actually get finished
Post by: Dragon on May 22, 2009, 10:53:13 am
Ta all, been a bit of a hectic week.  Anyways I got over it (and managed to rationalise out a - somewhat contrived - need for bits of the code).  One day someone else is going to look at it and go: WTF that's complete overkill.  Oh well.  *shrugs*

I'm going to take a break from implementing SmallTalk and rather write everything in C++.  This will give me a chance to finish the other two lose ends in the engine which are the particle animation system (the particle renderer already works).  And the user interface, written long ago it's now utterly broken - code rot an' all.  I'm including Zeracles star and nebulae generators under the particle system.

The up side is that I should have demoable something out sooner.
Title: Re: A star control 1 remake that may actually get finished
Post by: Lukipela on May 24, 2009, 10:43:24 am
The up side is that I should have demoable something out sooner.

Yay!
Title: Re: A star control 1 remake that may actually get finished
Post by: Dragon on May 30, 2009, 10:16:45 am
This is a fairly random post because I was trying to remember how to do video editing/capturing again.  Back in 2003 I entered a game into Big Remakes competition only I completely forgot about it up until today.  The reason this has any bearing on Star Control is that the engine it was using was a very early version of the engine that I'm using for this remake.

Here's a video (http://www.youtube.com/watch?v=ORAfn54albE) of me playing the first (and only) stage, the YouTube comment contains some more detail.  And here's the title screen for those who don't like being forced to watch videos.

(http://photos1.blogger.com/blogger/6073/3266/1600/SpaceCrusadeIOX.jpg)

See, I do sometimes actually release things :P.  It's all Lukipelas fault for reminding me about this.
Title: Re: A star control 1 remake that may actually get finished
Post by: Lukipela on May 30, 2009, 10:23:26 am
For those of us who don't know the first thing about coding, can you explain how this can be the same engine? I mean, that's a side scroller, whereas SC1 is a melee with a tactical map. To a layperson, those seem pretty different.
Title: Re: A star control 1 remake that may actually get finished
Post by: Dragon on May 30, 2009, 10:52:50 am
Good point, it's not that easy to see in the video but everything (bar the status panel) is 3D.  Watch the top and bottom of the stage as it scrolls past and you'll see the how things are transformed into the distance.

The difficult bit in writing a game lies in choosing (or writing) an engine.  I opted to write my own because there weren't any good free engines back then.  Ogre and Irrlicht exist now but they're both graphics heavy rather than general purpose and I'm too far down my own path to change.

It's the bits of the engine that the player never sees that are hard to write.  The game can almost be thought of as a thin layer on top of it (for example: IOx took 3 weeks to write because the engine already existed*).  Drawing a single triangle is easy but whilst everything is made of triangles; when an object gains different textures, colours, shading and effects it gets more and more complicated to hold together.  Now throw lots of objects into a scene and add a few full scene effects like depth of field or glowing and suddenly trying to draw everything from first principles is no longer trivial.  This is what an engine provides and why I can reuse the original engine from IOx for Star Control.

Then there's a lot of general functionality that an engine should provide; such as: file handling, collision detection, animations, memory management etc...  They're all things I would not want to write from scratch every time I wrote a game.

That's it really...

*For any who care the Remakes competitions allow the use of existing engine code.  Only gameplay and content must be created during the competition.
Title: Re: A star control 1 remake that may actually get finished
Post by: Lukipela on June 02, 2009, 03:30:22 am
I did notice the 3D, but not knowing anything about coding I assumed that the engine that moves things along in a shooter like that would be vastly different to the engine that handles melee, which would again be different from the engine that moves the tactical part. But now that you point it out, I suppose they are all just 3D objects being moved around.

So what you're saying is that you've essentially written a 3D engine that is very versatile and can be used for very different types of games?
Title: Re: A star control 1 remake that may actually get finished
Post by: Zeracles on June 02, 2009, 09:09:09 pm
@tech support: the excecutables don't work - hurry up and correct the path to the shared C libraries in the files I don't have write permission to!
Here's hoping that gets noticed.  ;D
They visited me the next day I remember ;), the version of the matlab compiler we have meant I had to move to Red Hat 5 and use gcc 4. I don't care enough to do time trials, but I'm guessing it makes matlab 10-50 times faster, depending on how it's written . . .

With all this talk about 3D -

(http://www.physics.usyd.edu.au/~asmith/files/backgroundmap_7.png)

I might replace this with a more glowy version later ;)

I just do some coordinate geometry to project a 3D set of points onto a viewing plane that includes the camera position, and put foreground objects in front of background objects by making these things a bit opaque (in the code, the only real change is that background positions get smoothed first, and then the image is modified by foreground layers). They're not rotatable, but I can generate new images with any camera position and angle. Is this actually useful for anything? Still wanna fly through a planetary nebula?

Quote from: Dragon (over at UQMF)
Regarding the stategic game: guesst has done a bit of digging for the original star generation algorithm but with no joy so I'll probably just have to make it up.
Are these the rotating starmaps you're talking about? I might be able to come up with some algorithms to help magic them up. There's also different ways of linking the stars up, if that's important.

Quote from: Dragon (over at UQMF)
If someone models the SC2 ships it's a lot more likely to happen.  Utterly unsubtle hint.
I wonder if this is a higher priority than generating those sand dunes ;D
Title: Re: A star control 1 remake that may actually get finished
Post by: Dragon on June 04, 2009, 04:35:20 am
So what you're saying is that you've essentially written a 3D engine that is very versatile and can be used for very different types of games?
Yup, that's it exactly.  It's actually a lot more geared towards skinned models (characters and such) than it is to rigid things like space ships.  The engine is still being written with a Space Crusade style game in mind.  Although that's been pushed far to the back of the queue.

They visited me the next day I remember ;), the version of the matlab compiler we have meant I had to move to Red Hat 5 and use gcc 4. I don't care enough to do time trials, but I'm guessing it makes matlab 10-50 times faster, depending on how it's written . . .

With all this talk about 3D -
So what you're saying is you can render star maps in realtime with Matlab now, I think I just found my new language ;).
The piccy looks good.  Tone the stars down, stick a few planets in, use a spherical volume and I don't have write the strategic part of the game any more.  Whooohooo!

I might replace this with a more glowy version later ;)
      8)      8)      8)      8)      8)      8)      8)      8)      8)      8)      8)      8)      8)      8)      8)      8)      8)      8)      8)      8)      8)      8)      8)      8)      8)      8)      8)      8)
Sorry, had to be done

Are these the rotating starmaps you're talking about? I might be able to come up with some algorithms to help magic them up. There're also different ways of linking the stars up, if that's important.
Yup, that's the ones.  If you can generate them (stars and links) it would be most helpful as it's going to become important soon but I haven't started thinking about it yet.  The original maps were (sometimes?) mirrored half hemispheres if I remember correctly.

I wonder if this is a higher priority than generating those sand dunes ;D
But I like sand dunes... 

What would be really cool is some sort of spaceship generator but that's a *hard* problem to solve.  I'm hoping (but not holding my breath) that an artist will contribute the SC2 ships and races.  Adding new ships is low cost (I estimate about a half day a ship) so in the event that I do aquire any I'll stick them in.
Title: Re: A star control 1 remake that may actually get finished
Post by: Zeracles on June 18, 2009, 04:20:50 am
So what you're saying is you can render star maps in realtime with Matlab now
It still takes hours because the edges of the cube there are actually just lots of little hard-edged circles and for each of them I've got the code going all over the image still ;D So I need to optimise it in the way you suggested. It should be as easy as updating individual pixels as soon as they're figured out rather than the entire image after every pixel's been tested. I'll update the code I posted when I do that, along with the geometry to project the points on the viewing plane.

The piccy looks good.  Tone the stars down, stick a few planets in, use a spherical volume and I don't have write the strategic part of the game any more.  Whooohooo!
What's the strategic part (wasn't it all strategic apart from the melee? Maybe I don't even remember what it looked like properly :-X), I don't remember it from playing SC1 for a few minutes at a friend's place 15 years ago ;D

EDIT: Oh, I think I get it now. Real time rotation, I wonder if it could be made to work that quickly, I'll have to look into it.

     8)      8)      8)      8)      8)      8)      8)      8)      8)      8)      8)      8)      8)      8)      8)      8)      8)      8)      8)      8)      8)      8)      8)      8)      8)      8)      8)      8)
LOL!

Yup, that's the ones.  If you can generate them (stars and links) it would be most helpful as it's going to become important soon but I haven't started thinking about it yet.  The original maps were (sometimes?) mirrored half hemispheres if I remember correctly.
Since I remember very little, what do we know about the distributions of stars? Were there clusters in it? What about ``filaments" and ``sheets"? And what about the links? Was each star linked to all others within an arbitrary radius, was it linked to the ``N" (arbitrary N) closest neighbours or was it something like a minimal spanning tree (http://en.wikipedia.org/wiki/Minimum_spanning_tree) (MST)? All the above? Maybe we can build a starmap generator into the game . . .

Can the fleets of different races take advantage of the stellar distribution in different ways?
Title: Re: A star control 1 remake that may actually get finished
Post by: Dragon on June 18, 2009, 01:41:13 pm
Maybe we can build a starmap generator into the game . . .
I'd really like that, I'll post a fuller reply this weekend* with some example maps from SC1 (I just need to draw in the links).  The links either are, or are very similar to, a mst.  The distribution of stars was sort of homogeneous but as only the links were important the distribution could be structured without affecting the gameplay much.

*May actually be a lie.  I kind of finally managed to work out how to play Dwarf Fortress.  If you don't see me again, send someone round to pry me away from my keyboard.
Title: Re: A star control 1 remake that may actually get finished
Post by: Death 999 on June 22, 2009, 11:03:11 am
I remember there was a thread on the UQM forum in which I suggested a starmap generation algorithm (http://forum.uqm.stack.nl/index.php?topic=1111.msg14758#msg14758).

Whether or not it comes out exactly the same, I think it would feel the same, and that's really the important part. You might need to experiment with different values for the 4 parameters to get maps that feel the same, or you might need to reweight the loop endpoint creation somehow.
Title: Re: A star control 1 remake that may actually get finished
Post by: Dragon on June 22, 2009, 11:20:43 am
Cool, I took a look but as I have quite a nasty bout of flu I may only think I understood it.  The good news is that I gave up on Dwarf Fortress, the bad news is that I gave up on it for the aforementioned flu  :-\.

When I'm feeling human again I'll try and have some more considered replies for you and Zeracles.  Sadly I don't seem to have made much progress this month at all.
Title: Re: A star control 1 remake that may actually get finished
Post by: Alen on June 22, 2009, 11:34:40 pm
Good work dragon. Im ecstatic about the release.
Title: Re: A star control 1 remake that may actually get finished
Post by: Zeracles on June 24, 2009, 02:30:20 pm
The links either are, or are very similar to, a mst.
Judging from D999's algorithm there are closed loops and MSTs don't have those. But the nice thing about an MST is that it guarantees all points are connected. So, if we go down the path of making the distribution before the graph, maybe start with an MST and then connect all pairs of points that are separated by less than some arbitrary distance to get the loops.
The distribution of stars was sort of homogeneous but as only the links were important the distribution could be structured without affecting the gameplay much.
I guess it depends on how much structure there is and how they're connected. Clusters could add an interesting strategic element, kind of like an anisotropic metric. Is there any structure in how the resources are distributed? Homogeneity is boring!
I remember there was a thread on the UQM forum in which I suggested a starmap generation algorithm (http://forum.uqm.stack.nl/index.php?topic=1111.msg14758#msg14758).
I read this algorithm - it's pretty neat, I can see that it only looks at links because that's all that matters. The only problem I can see with it is the potentially sensitive dependence on the four parameters there. Interesting to try though.

Putting structures in the abstract graph doesn't seem straightforward to me. But thinking about it now, it's a juicy problem to solve ;D

The good news is that I gave up on Dwarf Fortress
Excellent - now you can have a look at Stellar Empires (http://cd.textfiles.com/gameempire2/STRATEGY/STLEMP10/?M=A) and see if that spawns any ideas (this simple thing had me completely addicted about a decade ago ;D).
Title: Re: A star control 1 remake that may actually get finished
Post by: Death 999 on June 25, 2009, 08:22:54 am
There were loops in SC1, so a minimal spanning tree method is definitely not the way.

As for sensitivity of parameters... I don't see that as a problem.

If you say, 'give me 1 loop' and 'give me 2 loops', those are very different maps. They should be different. Unless the extra loop is tiny... So you might not effectively get what you asked for anyway.

What we need is some degree of control over the sizes of loops. Or...

Hmm. The more I think about it, we really need a map layout language. It can be very low-featured, but it would need to be able to control how long loops and dead ends are, where they go, what planet types they have, and such matters.

I'm thinking of something like...

get a new line of 6 stars ( 'get' sets the variable 'it' to this set of stars)
call it 'spine'
call one end 'base'  (by default, acts on 'it'. 'end' specifies a star with 1 neighbor; calls this endpoint base; 'it' is now the same as base)
call spine's star furthest from base 'center'
get spine
add loop 1+1 around it (creates a star which makes a triangle, somewhere along the spine. Neither Spine nor it includes this new loop.)
add loop 3+0 around it (creates a side-loop of 3 stars; both endpoints of the loop are on the same star along Spine)
get spine's star 2 from base
add a new line of 7 stars to it.
call it 'scenic'
call its star furthest from base 'backdoor'
get everything
add 1d6 deadend to it (it does include these 1d6 new deadends)
paint 10% water, 10% metal
call it 'sideA'
copy sideA to 'sideH'
connect sideA's scenic to sideH's scenic
overlap sideA's center with sideH's center (like connect, except there's only one center now)
place alliance starbase at sideA's base
place hierarchy starbase at sideH's base
paint center artifact
paint a scenic artifact (there are two scenics, picks one randomly)
paint spread 10% water (spreads some more water worlds around, trying to keep things spread out)
Title: Re: A star control 1 remake that may actually get finished
Post by: Dragon on June 25, 2009, 11:02:29 am
Since I remember very little, what do we know about the distributions of stars? Were there clusters in it? What about ``filaments" and ``sheets"? And what about the links? Was each star linked to all others within an arbitrary radius, was it linked to the ``N" (arbitrary N) closest neighbours or was it something like a

Taking a look at the originals maps all I can really tell is that no star has more than four connections and that the distances between stars is pretty uniform.

It looks like the maps are constrained to a cylinder rather than a box.  The top half and bottom half (belonging to the Hierarchy and Alliance respectively) can be wildly lopsided but the map is always centered about it's spin axis.

It looks a bit like the stars are repeatedly randomised onto a 3D grid until they connect and then the positions are nudged.  Not a very exciting algorithm if that's what it is.  The grid is roughly 8x8x8 which means that even on a fifty star map about 9/10s of it is still open space.

Here's a map with the connections drawn in (and that was a tedious task of note)

(http://farm4.static.flickr.com/3630/3660055069_0d5a81d89e_o.png)
[EDIT] Fixed two missing stars.  Oops.
'View image' for the larger version.

Oh, I think I get it now. Real time rotation, I wonder if it could be made to work that quickly, I'll have to look into it.
Nah, really I was being facetious.  That's what directX and friends are for  ;D

Hmm. The more I think about it, we really need a map layout language. It can be very low-featured, but it would need to be able to control how long loops and dead ends are, where they go, what planet types they have, and such matters.
At least to generate gameplay interesting maps higher level structures would be needed to create it.  eg:  LineOfStars could contain stars and the end points of other lines of stars.  Unfortunately we're wondering into realms I haven't thought about so I don't have anything valuable to add yet.  What I would like to do is keep the clusteryness of Zeracles' stars but I don't think that should be a problem if one generates fractal regions/volumes and then places lines of stars (etc..) within them.

Alas I'm still quite flu'd up and may not have made sense.  It's definitely sleeping time here.
Title: Re: A star control 1 remake that may actually get finished
Post by: Death 999 on June 26, 2009, 10:39:06 am
Not that it really changes much, but one of those stars has 5 neighbors.
Title: Re: A star control 1 remake that may actually get finished
Post by: Zeracles on June 26, 2009, 04:29:18 pm
There were loops in SC1, so a minimal spanning tree method is definitely not the way.
Which is why I said its main utility would be to ensure we don't get isolated clusters, with loops achieved by other means. MST is not the only way to do this of course, I'm going to mention another later in this post.

As for sensitivity of parameters... I don't see that as a problem.
It becomes a problem if a large fraction of one's parameter space gives undesirable results, such that it's just a narrow band one is aiming for. This was just my first impression, though, maybe the ``undesirables" I was thinking of are actually ``interesting".

Here's a map with the connections drawn in (and that was a tedious task of note)
Thanks for posting those linked stars, they are illuminating!

Hmm, that dead end with two stars near the plus sign is interesting, or maybe not if it's actually not so close in 3D to that other arm of stars.

Nah, really I was being facetious.  That's what directX and friends are for  ;D
I really need to branch out beyond my numerical box . . .

At least to generate gameplay interesting maps higher level structures would be needed to create it.  eg:  LineOfStars could contain stars and the end points of other lines of stars.  Unfortunately we're wondering into realms I haven't thought about so I don't have anything valuable to add yet.  What I would like to do is keep the clusteryness of Zeracles' stars but I don't think that should be a problem if one generates fractal regions/volumes and then places lines of stars (etc..) within them.
Ah, now this is interesting, fractal. A fractal set of points might be connected by a graph that isn't fractal. An MST should preserve the fractal nature of it but if that's followed up by connecting all points separated by less than some arbitrary distance, the self-similarity is broken.

I thought of a graph that should preserve the self-similarity, called the Delaunay Tesselation (http://en.wikipedia.org/wiki/Delaunay_triangulation). It's related to the Voronoi Tesselation (http://en.wikipedia.org/wiki/Voronoi_tesselation) and I think it has some nice properties. It makes closed loops on all scales, connects all the points and doesn't do crazy interconnectedness. It also removes any arbitrary choices in the assignment of links, leaving that choice to the structure in the distribution . . . which is where I would choose to put it; there should be a reasonable intuition between the distribution of points and the links in the end result, in my opinion.

The problem with DT is that it doesn't do dead ends - there are way too many triangles to emulate what was in SC1. Looking at the image Dragon posted, perhaps this problem could be solved by removing all links above some arbitrary length (retaining all MST links to ensure all stars remain linked). The user could then choose how much to reduce the interconnectedness - effectively, how many dead ends to substitute for the triangles, without fear of creating isolated clusters. Just another possibility thrown out there.

EDITed many times for clarity.
Title: Re: A star control 1 remake that may actually get finished
Post by: Dragon on June 27, 2009, 02:10:06 am
Not that it really changes much, but one of those stars has 5 neighbors.
Oops, that was my fault.  The central line in the quad shouldn't be there.  When I screenshotted that image the two stars connected by that line were almost ontop of each other so I moved the one and then got confused.  But as you said, it makes no real difference.

Hmm, that dead end with two stars near the plus sign is interesting, or maybe not if it's actually not so close in 3D to that other arm of stars.
No, they're not close in 3D so unfortunately not very interesting.  I've update the map with oranges stars which are significantly behind other stars in the local set.

(http://farm3.static.flickr.com/2459/3665036882_ec93d03506_o.png)

... called the Delaunay Tesselation. It's related to the Voronoi Tesselation ...
Aaaagh, both of those two did my head in when in 3D.  But, I think that Delaunay Triangulation could be a winner if links are removed randomly weighted to length.  Also a slightly more interesting graph would be created if the 4 connection maximum is enforced.

I have one question though: (in 2d) what does the Delaunay Triangulation of two separate clusters look like?  Does one end up with one convex hull around both clusters or does it create connections between the closest points in the clusters too each other and a dumbbell shape?

I dug up this link (http://www.geocomputation.org/2000/GC024/Gc024.htm) for it's examples but they always have spares points around the edges.

[EDIT] Bugger!  It'll produce the convex hull right?
Title: Re: A star control 1 remake that may actually get finished
Post by: Zeracles on June 29, 2009, 07:55:11 pm
... called the Delaunay Tesselation. It's related to the Voronoi Tesselation ...
Aaaagh, both of those two did my head in when in 3D.
Yeah, I always think of the Voronoi construction as bubbles expanding from each point, spreading along surfaces where they meet to create the edges of the cells. Then join any two points that share a cell surface for the Delaunay links (I don't even know how to define Delaunay independently of Voronoi ;D).

As an aside, this (http://au.arxiv.org/abs/0708.1441) is an interesting application of it. Chapter 6 does the full nerd treatment and there's a picture on page 32 of 3D voronoi, also a 3D DT on page 41. Not sure if they really help though.

But, I think that Delaunay Triangulation could be a winner if links are removed randomly weighted to length.
I agree, this is probably better than removing all links above some length . . . actually, randomly removing without the weighting could retain self-similarity such that clusters are connected in the same way as points within clusters.

I have one question though: (in 2d) what does the Delaunay Triangulation of two separate clusters look like?  Does one end up with one convex hull around both clusters or does it create connections between the closest points in the clusters too each other and a dumbbell shape?

I dug up this link (http://www.geocomputation.org/2000/GC024/Gc024.htm) for it's examples but they always have spares points around the edges.

[EDIT] Bugger!  It'll produce the convex hull right?
I think it depends a bit on how close together they are and how spherical they are. If they're sort of parallel lines one would get a convex hull. Maybe I should try plotting this up, I think matlab has inbuilt functions for these except I have work to do right now :(
Title: Re: A star control 1 remake that may actually get finished
Post by: Zeracles on June 30, 2009, 05:33:22 pm
[EDIT] Bugger!  It'll produce the convex hull right?
I haven't plotted this, just thought about it and I'm pretty sure you're right.
I agree, this is probably better than removing all links above some length . . . actually, randomly removing without the weighting could retain self-similarity such that clusters are connected in the same way as points within clusters.
I was also wrong when I said this, because clusters are likely to be connected by several links . . . if one wants the self-similarity, random removal weighted by length is looking good again, sorry.

I'm thinking MST is the minimal graph we'd have, and DT would give the max. The random removal weighted by length could be used to leave a graph that is somewhere in between. Haven't looked at how to actually do any of this though :-\
Title: Re: A star control 1 remake that may actually get finished
Post by: spinsane on July 01, 2009, 08:00:33 pm
Wait a sec (haven't read thread), is there a reason why you want your mapping algorithm to work in three dimensions? I know that SC1 used a pseudo-3D map, but honestly, that thing was annoying. You'd be doing a world of good just making it in 2D: simpler and more user-friendly, as well as slightly less troublesome to program.
Title: Re: A star control 1 remake that may actually get finished
Post by: Lukipela on July 01, 2009, 09:40:24 pm
It's a remake, so it needs to contain all the stuff the original contained. It might contain more than one mode or some other sort of clarification though.
Title: Re: A star control 1 remake that may actually get finished
Post by: Dragon on July 02, 2009, 08:34:33 am
As an aside, this (http://au.arxiv.org/abs/0708.1441) is an interesting application of it. Chapter 6 does the full nerd treatment and there's a picture on page 32 of 3D voronoi, also a 3D DT on page 41. Not sure if they really help though.
Oh, dear... that sent me off on another mad tangent (until my PC packed up).  I've always enjoyed generating surfaces for whatever strange and in-explicable reason.

I think it depends a bit on how close together they are and how spherical they are. If they're sort of parallel lines one would get a convex hull. Maybe I should try plotting this up, I think matlab has inbuilt functions for these except I have work to do right now :(
...
I haven't plotted this, just thought about it and I'm pretty sure you're right.
Looking at a few more examples I don't know if the shape will always be convex (which is good).  I also really have to try this but - likewise - I have a biggish deadline on Monday so free time this weekend looks absent.

I was also wrong when I said this, because clusters are likely to be connected by several links . . . if one wants the self-similarity, random removal weighted by length is looking good again, sorry.
No worries, I haven't had a chance to try and produce anything yet.  Although I'm really itching to.  See stupid deadline above.

I'm thinking MST is the minimal graph we'd have, and DT would give the max. The random removal weighted by length could be used to leave a graph that is somewhere in between. Haven't looked at how to actually do any of this though :-\
Hmm, if one generated the DT and then the MST from the DT and then removed - say - 80% of the edges but not touching any in the MST it should generate a pretty reasonable map with a few loops but mostly long paths.  Hope that made sense.

Is there a reason why you want your mapping algorithm to work in three dimensions?
Part of SC1 was trying to find (and protect) the best paths in 3D so (as Lukipela mentioned) that in itself is enough reason for me to keep it.  However the actual, unrationalised reason is that I think the 3D starmap looks pretty.  ;D

It no longer does the continuous rotation thing - unless you leave the controls alone.  That was annoying and difficult to see.  Now it's possibe to rotate with the mouse or the gamepad and it'll only start rotating in a 'screensaver' mode.
Title: Re: A star control 1 remake that may actually get finished
Post by: spinsane on July 02, 2009, 09:00:34 am
Right, I mean, in SC1 you still need to discover which astronomical bodies you can travel in between to determine chokes/find mining platforms/precursor stuff etc- but doing it in 2D doesn't necessarily detract from that- but I agree with the desire to keep things pure.

What is your storage/generation method for the maps? Or rather, do you have a prefered method of data storage/what lingual limitations are you operating under? It would be easy to work on an algorithm abstractly (all you need is position and pointers/references to the connecting stars, the rest is just your generation algorithm) and it may be fun for the rest of us to think about based upon what you've got already... *hint hint*

Also, the possibility of having random map scripts for particular types of maps would be very neat. One that situates Starbases close to each other, one that has a big loop, but all still randomized around a base algorithm for that type of map.
Title: Re: A star control 1 remake that may actually get finished
Post by: Death 999 on July 02, 2009, 10:10:10 am
One very simple way for fixing the starmaps would be to specify a random seed. You wouldn't get to PICK it except through the time-consuming method of trying seed candidates, but it would fix the result.
Title: Re: A star control 1 remake that may actually get finished
Post by: Dragon on July 02, 2009, 10:47:14 am
Seeing spinsanes post I was just thinking that a general import routine might be perfect for Death999.  I already import Zeracles starmaps, adding the connections between them and the types of stars/planets would not be difficult.  Neither would be adding ships/starbases/artifacts.

I like the idea of importing maps because I'm quite likely to try and implement the DT/MST first.  I already have most of the basis for it from when I generated convex hulls for collision.  I'd rather get something out sooner than implement different types of generation routines.  I don't dislike Deaths idea but it's different from anything I have already so I'm hoping if I provided the tools...

I think random seeded with parameters (eg: from the original map editor) shouldn't be too hard.

and vaguely related here's....
(http://farm4.static.flickr.com/3201/2949682153_644eeb92ff_o.png)
... an old convex hull generation piccy which got lost at some point.

Title: Re: A star control 1 remake that may actually get finished
Post by: spinsane on July 02, 2009, 11:11:08 am
Consider implementing concavity in your collision detection? IMO- it would be mighty cool to see a blazer get stuck in a Broodhome's grill...
Title: Re: A star control 1 remake that may actually get finished
Post by: Dragon on July 03, 2009, 12:45:22 am
Consider implementing concavity in your collision detection? IMO- it would be mighty cool to see a blazer get stuck in a Broodhome's grill...
It's already in :D.  Unfortunately doing concave (ie: per per-triangle) collision is orders of magnitude slower than using hulls.

However I'm not doing rigid body simulation (that's a huge project all on it's own).  Instead I'm approximating the ships with particles so even if I did use concave collision detection they'd just bounce apart again anyways.
Title: Re: A star control 1 remake that may actually get finished
Post by: spinsane on July 03, 2009, 09:57:17 am
It's already in :D.  Unfortunately doing concave (ie: per per-triangle) collision is orders of magnitude slower than using hulls.


With trimeshes in 3d, yes. Not in true 2d, especially since the ships are simple enough to hand draw your hit box to minimize the number of triangles... I mean, if you're into that ;).
Title: Re: A star control 1 remake that may actually get finished
Post by: Angelfish on July 03, 2009, 11:59:20 am
Just use whichever collision detection algorithm works best for you, I don't really mind :). Even rectangular hitboxes could easily work for almost all the ships, except the round ones (Melnorme and Mycon)
Title: Re: A star control 1 remake that may actually get finished
Post by: Dragon on July 03, 2009, 12:27:28 pm
Quote from: Death 999
I think Utwig ought to regenerate between combats naturally.

Here are my ideas for capabilities. Just throwing them around...

Kohr-Ah: can destroy colonies regardless of the presence of fortresses or defending ships OR 33% chance to destroy fortifications upon besieging, and successful besiege does not cost a move.
(
compare that to
Kzer-Za: 33% chance to destroy fortifications upon besieging; atuomatically destroy forts at end of turn.
So, both average 1 fortified system per turn, but Kohr-Ah's progress costs more moves, and it has the potential to rush ahead or stall
)
Chmmr: groups attacked by Chmmr engage in an order selected by attacking player; AND/OR groups attacking this arrive in random order
Druuge: can create a mine for 1 move if that's all it does this turn
Supox: can create a colony for 1 move if that's all it does this turn
Utwig: can create a fort for 1 move if that's all it does this turn
Melnorme: you can transfer precursor artifacts from a Melnorme trader
Slylandro: Can build Slylandro at the location of a Slylandro as if it were a Starbase; gain 1 RU for each kill of a ship, fortification, mine, or colony that it makes.
Thraddash: sustained afterburner: free move from friendly mines as if they were colonies
Pkunk: refill crew automatically if any of your colonies or other ships is destroyed
Zoq-Fot-Pik: can see planets from 1 hop away, including presence of but not type of precursor artifacts
Orz: capture mines rather than destroying

And since this is rather high density of features, I'd consider adding the following (optionally by scenario so you can have your 'pure' SC1 if you want)...

Shofixti: ground invasion: capture colonies rather than destroying
Earthling: Nuke launch: can attack unguarded map features (colonies, mines, starbases, forts) from 1 hop away as if it was there. Can't launch from inside enemy fortifications.
Mmrnmhrm: Cruising transformation: 2 Mmrnmhrm at the same location can move together, for 1 move point, into space not occupied by enemy ships or fortifications.
Yehat: can make extra fortifications on top of regular fortifications.
Chenjesu: DOGI  synergy with forts: If defending a fortification, the battle group has the option to wait behind the fortification rather than engage immediately

Umgah: free move after the first map feature it destroys on a turn, HAR HAR HAR
Ilwrath: Not visible on starmap until adjacent (now that it's not hotseat, we can do this!)
VUX: capture fortifications rather than destroying; only works on regular fortifications, not Yehat extra fortifications (I figure this is accomplished by limpeting them, coming alongside, boarding, and reprogramming)
Androsynth: extended blazer: if you move an Androsynth 3 hops in one turn, get 1 movement point (but Androsynth is still exhausted)
Spathi: if attacked, can make a move (spent against next turn's movement) to avoid combat


Also, I'd consider having energy stations which increase the total moves per turn of a side (each ship's max move is still 3). These would, like colonies, cost no move to leave. As a possible twist, they'd be totally automated, and so any ship can capture one for free rather than destroy it.
I like these ideas, I've put them here because I use this thread as my source of truths; or something.
Title: Re: A star control 1 remake that may actually get finished
Post by: spinsane on July 03, 2009, 12:43:49 pm
I think a cool thing for the Chenjesu would be long range detection, what with their natural affinity for detecting hyperwaves/hyperspace movement. If the entire map had fog of war, and a ship could only detect 1-2 stars away (ilwrath being undetectable at 0-1) then the Chenjesu could see 3-4 moves away. That's IF you want to do Fog of War.
Title: Re: A star control 1 remake that may actually get finished
Post by: Zeracles on July 03, 2009, 09:29:26 pm
Seeing spinsanes post I was just thinking that a general import routine might be perfect for Death999.  I already import Zeracles starmaps
When I have time I'll improve the points generating code with some extra touches and post it (it's pretty simple and shouldn't be difficult to do a C conversion), also I'll generate a whole pile of starmaps with varying properties.

adding the connections between them and the types of stars/planets would not be difficult.
Was the distribution of star/planet types structured in any way in the original? Another thing to try might be correlating this with local densities, to vary the risk or reward for entering dense clusters; could be a game mechanic.

I've always enjoyed generating surfaces for whatever strange and in-explicable reason.
Smoothing and surface generation is really interesting and I wish I had more time to play games with them :D
Title: Re: A star control 1 remake that may actually get finished
Post by: Death 999 on July 07, 2009, 06:17:18 am
As far as I know, the only settable parameter concerning the distribution of planet types was by 'closer to hierarchy' / 'closer to alliance'; and, as there wasn't much in the way of real density, I'm not sure what other criteria could be used.
Title: Re: A star control 1 remake that may actually get finished
Post by: Dragon on July 11, 2009, 12:40:39 pm
Seeing as SCDB has been boring of late I figured I'd add a boring update.    :D

I'm still progressing slowly, which is to say I'm still working on the UI.  It's tedious time-consuming and not challenging in any way.  In other words: pretty standard grunt work.  Did I mention that it's tedious?  And boring?  I did?  Well it is.

Um, yeah, that's it.  Once I'm done with the UI things get more exciting and I can actually start on the starmap.  Yay!
Title: Re: A star control 1 remake that may actually get finished
Post by: Angelfish on July 11, 2009, 01:54:32 pm
Hehe, that's why I usually leave UI design and coding for the last.. or the others ;)
Title: Re: A star control 1 remake that may actually get finished
Post by: Lukipela on July 12, 2009, 05:41:51 am
Seeing as SCDB has been boring of late I figured I'd add a boring update.    :D

Your updates are never boring.

Quote
Um, yeah, that's it.  Once I'm done with the UI things get more exciting and I can actually start on the starmap.  Yay!

This makes me excited for not just this project, but others :)
Title: Re: A star control 1 remake that may actually get finished
Post by: Dragon on July 12, 2009, 02:00:19 pm
Hi guys I'd like to ask a favour.  Could you please test this file (http://www.filefront.com/14027465/ViewerV7beta.rar) and let me know if it runs or not.

Hopefully you should find yourself in a small multi-coloured box.  That's the best outcome.  The worst outcome is that it runs but all you see is a pale blue window.

If it crashes and burns.  ie: a window *briefly* pops up and then goes away again you may need to install either the VC2005 runtime (http://www.microsoft.com/Downloads/details.aspx?FamilyID=32bc1bee-a3f9-4c13-9c99-220b62a191ee&displaylang=en) or the DirectX 2009 (March) runtime (http://www.microsoft.com/downloads/details.aspx?familyid=0CF368E5-5CE1-4032-A207-C693D210F616&displaylang=en).  If you know you've installed both of these and it still does nothing then can you please post the contents of the log.txt file here. 

The reason I'm asking is that I thought I'd ironed out most graphics card related bugs (remember the early Star Control tech demo) but it looks like I was mistaken.  I'm developing on an NVidia 7600 which runs fine but I tried running on an ATI 4890 which does the pale blue screen of death thing.  Not cool.

I'd like to know if anyone else running ATI cards has the same issue.  I sort of suspect that the card itself is broken rather than being an ATI driver bug but if it is a driver issue I suppose I'll have to fix it.  I'm utterly stumped as to what it could be though...

If it does run you can push 'c' to swap to a controllable camera.  Slightly more interesting stuff in the readme.txt file.

This makes me excited for not just this project, but others :)
Aye, that's one of the main reasons why I want to get the UI stuff done right first time.  I think it should be very reusable in 'other projects'.   ;)
Title: Re: A star control 1 remake that may actually get finished
Post by: Angelfish on July 12, 2009, 03:26:39 pm
Runs fine for me :), I see that multi-colored box and can play around with it.
Edit: Made it crash by pressing F4 and continuing the playing ;)
Title: Re: A star control 1 remake that may actually get finished
Post by: Lukipela on July 12, 2009, 10:41:23 pm
I downloaded it and tried to start it. I get a alert box saying (translayed so the terms may be a bit off):

Viewer.exe - Part not found

The Application could not be started,because d3dx9_41.dll was not found. Reinstallignthe application may fix the problem.

The box doesn't blink or disappear, it remains until I click OK. I have an ATI card called "Radeon X1300 series"
Title: Re: A star control 1 remake that may actually get finished
Post by: Sage on July 13, 2009, 05:44:36 am
You might want to make sure the current version of your OS's latest DirectX is installed on your machine. Barring that, if you have this done already, you might be able to get it to run by putting the specified file into the same directory as the executable.
Title: Re: A star control 1 remake that may actually get finished
Post by: Lukipela on July 13, 2009, 07:25:06 am
You might want to make sure the current version of your OS's latest DirectX is installed on your machine. Barring that, if you have this done already, you might be able to get it to run by putting the specified file into the same directory as the executable.

I'll have a look, but I just reinstalled the entire machine and it did download the latest drivers (I think). I think this happened with Dragons last tech demo as well, he had to send me a DLL to make it work...

EDIT: Woot, 4 people in one thread! this place is busy city all of a sudden!
Title: Re: A star control 1 remake that may actually get finished
Post by: Angelfish on July 13, 2009, 07:30:12 am
You might want to make sure the current version of your OS's latest DirectX is installed on your machine. Barring that, if you have this done already, you might be able to get it to run by putting the specified file into the same directory as the executable.

I'll have a look, but I just reinstalled the entire machine and it did download the latest drivers (I think). I think this happened with Dragons last tech demo as well, he had to send me a DLL to make it work...

EDIT: Woot, 4 people in one thread! this place is busy city all of a sudden!

Just download the latest DirectX package then, just to be sure :).
edit: This link: http://www.microsoft.com/downloads/details.aspx?FamilyID=2da43d38-db71-4c1b-bc6a-9b6652cd92a3&DisplayLang=en
Title: Re: A star control 1 remake that may actually get finished
Post by: mminasi on July 13, 2009, 10:39:32 am
Running from an Nvidea FX 570M, it ran as expected... but I DID have to reinstall DirectX.  (Ran on a 64 bit Vista box.)  Hope this helps.
Title: Re: A star control 1 remake that may actually get finished
Post by: Dragon on July 13, 2009, 11:46:51 am
Thanks everyone!  It's good to know nobody else is getting this wierd bug.  I suspect that it was a combination of ATI's flaky drivers and a system that hadn't been reinstalled in years (with who knows how many old drivers on it).

Anyway I put a clean install of windows on and everything works again - including a bunch of other games also.  So, uh, there you have it... if you can't get Star Control to run just reinstall windows or buy an NVidia card.  Simple really....  >:( <- frowny face.

It needs the latest version of DirectX because in desperation I upgraded from the August 2007 SDK to the March 2009 one.  I quite liked the old 2007 version because just about everyone (except apparently Lukipela :P) has it's runtime installed already.

Out of interest the viewer crashes on 'F4' because it switches into editor mode when pressed.  Editor mode uses a bunch of GUI code which I'm rewriting at the moment and is far from working again.

And again, Ta, much appreciated.  It really is surprising that any games work at all given all the different types of hardware and drivers that are out there.  Trying to get programs to work on *other* machines is probably one of the least fun parts of programming...
Title: Re: A star control 1 remake that may actually get finished
Post by: Death 999 on July 14, 2009, 07:43:45 am
That's why I program in java. Not good for everything, of course... but that's one headache you largely avoid.
Title: Re: A star control 1 remake that may actually get finished
Post by: Alen on July 14, 2009, 09:48:30 pm
its good for me (windows xp with nvidia ge-force 6800)
Title: Re: A star control 1 remake that may actually get finished
Post by: mminasi on July 19, 2009, 07:56:49 am
Say, Dragon -- I know you're a busy guy, but may I ask, are you re-implementing the original PC version or the Sega version (or some other one)?

I ask because I still play SC1 when I can and I really like being able to create my own custom missions -- for example, I've got to add a VUX or two to VUX Encounter or it's too easy.  Will that feature be there?

Many thanks for your hard work, let me add my voice to the grateful throng.  Best of luck on the rest of the coding!
Title: Re: A star control 1 remake that may actually get finished
Post by: Dragon on July 20, 2009, 05:37:54 am
Yup, a scenario editor is in - even if no one else needs it I still do.  I've never played the Sega version, only the DOS one and the very broken C64 one.  I'm remaking the DOS version but with tweaks and balancing of my own.

The bad news is that I'm too busy at the office to get much of anything done at the moment.  We had a deadline on the 1 May which has become somewhat... fluid.  And the amount of work is going the wrong way.  Ah well, eventually it'll all be done.  Eventually.
Title: Re: A star control 1 remake that may actually get finished
Post by: Dragon on August 14, 2009, 04:07:56 am
Quote from: Zeracles
remembers about the starmaps I'm meant to be making

No stress there.  I haven't had a decent block of time to get any more work on this done in ages.  I'm still pottering around with the UI but SC proper is basically paused until that's done.  *sad face*.
Title: Re: A star control 1 remake that may actually get finished
Post by: Alen on August 14, 2009, 07:54:50 am
Sounds like a load of fun Dragon, maybe you can use your new found ability's to convince your boss to let you program at work.  ;)
Title: Re: A star control 1 remake that may actually get finished
Post by: fluffy_banana on August 21, 2009, 10:15:54 am
This looks pretty awesome, I've got to say. I'm very impressed by the art direction (you've successfully managed to translate that 'colourful Star Control sprite' look into 3D). Not sure if you said somewhere, but were you planning on including networked multiplayer (for the full game and/or melee)?

Title: Re: A star control 1 remake that may actually get finished
Post by: Dragon on September 10, 2009, 09:57:41 am
Yay!  Back again.  Foreign parts are nice and all but it's good to have intertubes once more.

Thanks fluffy, to answer your question: I don't plan to add networking anytime soon. Not before release anyway, I've asked a friend to look into it but he hasn't had a chance yet.  Incidently, the release is still paused for the time-being but I have - at least - got some more work done on the code base.  Just general house cleaning stuff though.

Title: Re: A star control 1 remake that may actually get finished
Post by: Alen on September 10, 2009, 11:21:42 am
Well at least its still moving forward!  :D
Title: Re: A star control 1 remake that may actually get finished
Post by: Zeracles on September 16, 2009, 09:18:48 pm
Anyway, I was actually posting here because I didn't want to bump my thread.  There might possibly be another SC related project to get excited about.  Array!  It's a small part of the reason why SC:R has been crawling.  I'm also doing the coding on it although they share a common codebase which minimises my work.  Others are doing the real work with game design and graphics, I'm just the code monkey.  A tiny ray of hope is that things at the office have slowed down and I have (unintentionally) got quite a lot of SC related stuff done these past three days.

And that's enough teasing now.  *gives thread back*
Don't worry, we're now in the correct thread for teasing . . .

I decided that the fractal distributions aren't really the thing for these starmaps, though I'd still like to work them into this generator at some point. What I ended up doing instead was a tool for creating three-dimensional structures made of discrete points. The available structures are single points, gaussians, hard-edged spheres, sheets / discs and filaments. Their properties (density, scale size, position) are input via a text file (called ``structureproperties") with the format listed in the code (http://wiki.uqm.stack.nl/User:Zeracles/Background/Code/Structures).

With the different kinds of structures, there is actually a point to having three dimensions - a cluster and a disc are the same in two dimensions, but different in three.

Quick example

(http://www.physics.usyd.edu.au/~asmith/files/sc1/maps/example1/example1_topview.jpg)
From the top. The clusters are gaussian.

(http://www.physics.usyd.edu.au/~asmith/files/sc1/maps/example1/example1_sideview.jpg)
From the side one can see the disc through the centre. Its thickness, radius and orientation (normal vector direction) are all set by numbers in the input file. The line of points from top to bottom is a filament of points stretching between the starting points of the players.

(http://www.physics.usyd.edu.au/~asmith/files/sc1/maps/example1/example1_obliqueview_downsized.jpg)
This oblique view shows the arrangement of the eight clusters, four on either side of the disc.

There are 589 stars in this map - a zoom button on the UI would be handy ;D The point positions for this map are here (http://www.physics.usyd.edu.au/~asmith/files/sc1/maps/example1/structuredpoints_example1), and the contents of the input file containing its properties are here (http://www.physics.usyd.edu.au/~asmith/files/sc1/maps/example1/properties_example1).

And if that's any indication, it'll be . . . a while before I get to doing the DT/MST thing; I'm giving a seminar soon and need to scrape together some results :-X

EDIT: fixed image link after mucking with it to downsize it in the new forum
Title: Re: A star control 1 remake that may actually get finished
Post by: Alen on September 17, 2009, 08:12:15 am
Looks pretty cool Zeracles, good luck with your seminar.
Title: Re: A star control 1 remake that may actually get finished
Post by: Dragon on September 20, 2009, 07:47:46 am
Cool, thanks Zeracles.  It took a look at your code and I was wondering about matlab.  Does it have enumeration functionality?  If it does it would be nice to get rid of the magic numbers (if structuretype==2 etc...) because I found I kept forgetting which structure was which.  Also an idle question:  what does the . in front of a mathematical operator do (e.g. .* and .^)?  And.  Priorities.  Which is more important: presenting your results at a seminar or generating awesome Star Control maps?  Thought so :P

I've updated the Star Viewer (http://www.filefront.com/14567981/ViewerV7beta2009.9.20.rar) slightly.  It expects a CSV file (with headings now), you can find two examples in the Particles directory: Stars.csv and Structure.csv.  Structure.csv is the 589 stars Zeracles just posted.  Enjoy, it's not that big a change visually but there is a lot of code which has been updated for robustness and elegance (more on that later).

I've also thrown in Goober just for the hell of it.  And he looks, um, well like Goober striding through a field stars really.  You can disable him by deleting or renaming Goober.DRG.  He's an old character a friend modelled to test skinned animation and looks like this (with the home grid):

(http://imgur.com/1TNWC.png)

And here's an extract from the Readme.txt for those who wanted to know what the controls are.  I think of them as Descent style but I suspect not many people remember Descent anymore.
Code: [Select]
Controls
--------
Esc Quit
C cycles through cameras.  Only the last camera is controllable.
WASD for normal movement.
QE roll left and right.
Mouse for Pitch and Yaw.
I to invert/un-invert Pitch.
Space rise.
Right-mouse fall.
Left-mouse or left-shift can be held for turbo movement.
F3 toggles rendering.
F4 Editor Mode
-- The following only in editor mode --
N Toggle normals
L Toggle lines
V Toggle vertices
G Toggle home grid
F Toggle faces
[ Shorter normals
] Longer normals
O Larger verticies
P Smaller verticies

Config.txt
----------
Resolution = XXX.  Any valid resolution in the form 640x480 or DESKTOP to use the desktops resolution.
Windowed = XXX.  TRUE or FALSE.
AspectRatio = XXX.  Any valid aspect ratio in the form 4:3.
Mode = XXX.  DX_HAL for hardware, DX_REF for software, DX_SW if you have an alternate software renderer installed.
Particles = XXX.  A CSV file containing points.  File must have headings: X,Y and optionally: Z,R,G,B,Radius,Intensity.

example:
Resolution = 640x480
Windowed = TRUE
AspectRatio = 4:3
Mode = DX_REF
Particles = Particles/Stars.csv

And then on the programming front I've been gearing up again.  Thanks in part to things winding down at the office and also to the Barbarian: Anvil of Death (http://remix.kwed.org/index.php?search=anvil+of+death) remix which is awesome music to code to.  Make sure you have loud responsive speakers and that your neighbours live far away.  Also Auf Wiedersehen Monty: Nuclear Fallout Edit (http://remix.kwed.org/index.php?search=nuclear+fallout) if you can handle the bass.  I couldn't because my mouse starts sliding around my desk :-\.  I'm not really pimping remix kwed it's just that I haven't abused my sound system in ages so I'm happy.

Anyway, what I've actually done, code wise, is cleaned up my file routines.  Some of them have been untouched since 2002 and it was time they moved from C to C++.  Incidentally the oldest file in this project is from 1998 and handles window creation (in WindowsTM).  I was an idiot back then, it's awful.  I've also made a lot of progress on the GUI side, particularly with presenting text.  It would have gone faster if I'd been a little less ambitious but now it'll allow for some wicked in game effects.  It also, ah..., became a semantically sensitive code editor.  Oops, that wasn't in the original design.  The internal representation and interaction between 3D objects has also been overhauled and is much more useable now.

So things are still ticking over but I'm still in the world of frameworks.  This good because it's shared with that other SC project; but bad because I don't have anything playable to show yet.  Heh, I'm enjoying this  ;D.

Title: Re: A star control 1 remake that may actually get finished
Post by: Zeracles on September 20, 2009, 08:18:39 am
Does it have enumeration functionality?  If it does it would be nice to get rid of the magic numbers (if structuretype==2 etc...) because I found I kept forgetting which structure was which.
I don't know . . . at risk of sounding stupid, what does enumeration mean in this context?

Also an idle question:  what does the . in front of a mathematical operator do (e.g. .* and .^)?
Nothing really, it's just the difference between element-wise and matrix operation. ``*" by itself means matrix multiplication, which people hardly ever use.

And.  Priorities.  Which is more important: presenting your results at a seminar or generating awesome Star Control maps?  Thought so :P
Hmm, awesome Star Control maps might be an elegant backup if my results aren't looking flash . . . maybe I can turn them into convincing imitations of the galaxy distribution? ;D
Title: Re: A star control 1 remake that may actually get finished
Post by: Angelfish on September 22, 2009, 12:13:21 am
I'm glad to see this project is actually still moving forward :). Hopefully you'll have something playable out soon, I can't wait to play a better version of SC1!

Also, seeing all these starmaps generated, I can't help but wonder how the SC2 universe would be like, plotted in a 3D map. I don't think that's possible while keeping the original hyperspace distances, isn't it?
Title: Re: A star control 1 remake that may actually get finished
Post by: Dragon on September 22, 2009, 12:22:48 am
An enumeration in C is basically substituting a word for a number eg:

Code: [Select]
enum StructureType
{
  SinglePoint = 1,
  Gaussian = 2,
};

if (structureType == Gaussian)
{
 ...
}

Old style Java does it slighltly differently and needs one to define a bunch of static variables instead.

Code: [Select]
public static final int SinglePoint = 1,
public static final int Gaussian = 2,

[EDIT] What were the chances of posting ontop of Angelfish.  I mean it's not like this thread moves that fast  :-\.  I don't think it'd be possible either.  With some dedication it might be possible to approximate the gameplay but not with exact distances.
Title: Re: A star control 1 remake that may actually get finished
Post by: Angelfish on September 22, 2009, 01:06:23 am
Hehe, who knows, this board might come alive yet ;).
As to the starmap.. maybe it's possible to realign the starmap by starting with the 2d starmap with Z=0, and then displace a few stars or clusters on the Z-axis and then realign the other stars to keep these distances.
Title: Re: A star control 1 remake that may actually get finished
Post by: Zeracles on December 14, 2009, 05:59:23 am
In matlab one can sort of do that by saying something like
Code: [Select]
if variable==2
    StructureType='gaussian'
end
----
if StructureType=='gaussian'
    insert stuff here
end

Anyway, I wrote some MST code (http://www.physics.usyd.edu.au/~asmith/files/sc1/MST_JarnikPrim.m)* and it seems to do the job. I implemented Jarnik/Prim's algorithm.
(http://www.physics.usyd.edu.au/~asmith/files/sc1/MSTdemo.jpg)

The code and that image . . . actually, all the goodies I've posted in this thread, will disappear between christmas and new year because of a server migration.

The numerical result of the code is the array ``branches". Each row of this array corresponds to an MST branch, containing the length of the branch, the index of the first endpoint, and the index of the second endpoint. These indices are assigned to each of the points contained in the starting list ``inputpositions". It essentially says that the 4th point is connected to the 67th point, et cetera.

Some kind of optimisation might be possible for how it selects positions to test for possible branches, but I'm not sure. Maybe also seeding the MST from one of the corners would speed it up a bit.

So, that would guarantee that all stars are connected. To get the loops, I'm thinking there is probably an easier way than the delaunay tessellation, which seems tricky in three dimensions. A procedure for adding additional links, once one has the MST. For each node of the starmap, calculate the distances to neighbouring stars within some radius - possibly the length of the longest MST link already there. These are the stars that might get linked.

Modify each distance by multiplying it by a sum. There is a contribution to this sum corresponding to each point which is closer (and the corresponding potential links P). Each of these contributions is arbitrary factor*(pi/(angle)). Angle is the angle between two lines. One of these is a potential link, the other is the link to the point whose distance is being modified. This modified distance will be greatly increased if there are lots of stars that are closer and along the path where the link would be.

Using the modified distances, create links to stars within some radius. Basically a way of linking points such that connections get ``broken" by intervening stars.

Time for me to go to sleep, and time for you to stumble through my retarded explanation ;D Nice avatar Dragon, are we getting a spectacular remake for christmas?

EDITS
Optimisation is both necessary and possible via a number of ways. I'm on the case, but who knows when I'll get around to it.

*Also posted on ultronomicon. (http://wiki.uqm.stack.nl/User:Zeracles/Starmap/Minimal_Spanning_Tree)

Added comments to the code.
Title: Re: A star control 1 remake that may actually get finished
Post by: Dragon on December 18, 2009, 02:30:04 am
Firefox sucks - it just disappeared midway through typing this.  Anyway, here we go again.

I got your code thanks, although I see you've *just* also added it to the Ultronomicon.

On reflection it's all good that my original post got lost.  I had little misunderstanding on how I was going to detect links 'broken' by stars added to form loops.  I'll have to have a think about it again.

I still have a technical backlog before I get to working on Star Control specifics.  If you look at my last post (somewhere) - I mentioned I was working on the UI.  While doing that I realised I didn't have a good input library and while writing an input library I discovered a huge omission in my image editing routines (they both use the same code for bit fiddling).  I'm slowly pushing the stack back to Star Control but it'll be a long haul.

Once I get back to SC I still need to add your star generation routines and Gaussian blur for nebulae and then I can get to actually implementing an MST.  Phew.

Eventually I'll get to it but it'll take a while and, as luck would have it, life's been utterly chaotic here - every time I think things are calming down something else happens.  So, yes, eventually, eventually.  And now I must get back to working because - wait for it - there's been a stuff up.
Title: Re: A star control 1 remake that may actually get finished
Post by: Zeracles on December 18, 2009, 05:14:39 am
This thread is now the number one result in google for annigilate me! (http://www.google.com/search?hl=en&rls=com.microsoft%3Aen-us%3AIE-SearchBox&rlz=1I7GGLJ_en&q=annigilate+me%21&aq=f&oq=&aqi=)

With any luck, there'll be a flood of people registering to downvote me 8)

Firefox sucks - it just disappeared midway through typing this.  Anyway, here we go again.
IE sucks - whenever my X server hangs (which it did a few hours ago) I have to close it to start up cygwin again (and reopen all my terminals, remote logins and any other linux-y stuff I had up).

On reflection it's all good that my original post got lost.  I had little misunderstanding on how I was going to detect links 'broken' by stars added to form loops.  I'll have to have a think about it again.
Yeah, my explanation didn't cut it.

See here 3 stars
1      2      3

Do we make a link between 1 and 3? Looking at it from position 1's perspective, my suggestion is to consider all stars that are closer than 3. In this case, 2 is closer. Will it prevent the link between 1 and 3?

If 2 is the only star that's closer, it's the only one to consider. We compare the angle a 1->2 link would make with the 1->3 link in prospect. This angle is zero. This is the angle that goes into the little formula I mentioned involving pi/angle. Since it's zero, the result is infinity, which we then multiply with the distance between 1 and 3. No matter what distance has been set for two stars to be linked within, it'll be less than this modified distance, so 1 will not be linked to 3. Which is the sort of the linking behaviour we're after. Hope that makes it clearer.

I don't think it's necessarily better than the delaunay tessellation, but it should be really easy, hopefully meaning there's nothing difficult left with the starmap.

I need to get back to work too. Must be a conspiracy ;)
Title: Re: A star control 1 remake that may actually get finished
Post by: Dragon on December 18, 2009, 05:32:55 am
This thread is now the number one result in google for annigilate me! (http://www.google.com/search?hl=en&rls=com.microsoft%3Aen-us%3AIE-SearchBox&rlz=1I7GGLJ_en&q=annigilate+me%21&aq=f&oq=&aqi=)
With any luck, there'll be a flood of people registering to downvote me
Oh shit, I completely forgot about karma.  Here, let me annigilate you ;D.  Also another annigilation reference for the old Goo'g.  Ooo, and another...

IE sucks - whenever my X server hangs (which it did a few hours ago) I have to close it to start up cygwin again (and reopen all my terminals, remote logins and any other linux-y stuff I had up).
Wha...?  I don't even want to think about what IE's locked to stop cygwin starting.

I don't think it's necessarily better than the delaunay tessellation, but it should be really easy, hopefully meaning there's nothing difficult left with the starmap.
I think that sounds good, I haven't hit it with an example yet but I'll probably be internet'less until next year so prolly my last post 'til then.

Hmm... a spectacular christmas remake.  I'll see what I can ...  8) ... shine up.
Title: Re: A star control 1 remake that may actually get finished
Post by: mminasi on January 02, 2010, 03:02:50 pm
Just wanted to say that this looks better and better. Can NOT wait.  Thanks for the efforts!
Title: Re: A star control 1 remake that may actually get finished
Post by: Zeracles on February 14, 2010, 08:48:33 am
Gave my (45 minute) seminar and it all turned out pretty well :) It had some similarities with this thread (slides (http://www.physics.usyd.edu.au/~asmith/research/Xclusters_2010_seminar.ppt)), I used one of the stellar backgrounds from earlier in this thread as the slide background, talked about smoothing, MSTs and Delaunay Tessellation as part of the intro, the subject of the talk was an algorithm I developed and abortively tried to generate nebulae earlier and also used the 3D visualisation stuff (developed from the background code) a bit (slides 1 and 17).

That's an aside. Down to business -

I've found a use for MSTs in my work, so that's pushed this up my list which is also my excuse to Cedric for doing this instead of working on his mod.

Before, the MST code would take minutes to generate the MST over 50 input points. Now that I've done the necessary optimisation (http://wiki.uqm.stack.nl/User:Zeracles/Starmap/Minimal_Spanning_Tree), thousands of points can be linked in minutes. This involved coming up with a new algorithm for generating the MST. At the time, I was working at an internetless computer and couldn't find out if I was reinventing any wheels, but it turns out someone (http://en.wikipedia.org/wiki/Bor%c5%afvka's_algorithm) beat me to it >:(

If you follow the logic in this code rather than the one I posted before, it should go a lot faster. Actually, if you wait long enough I'll do the C conversion, but that could be a weighty wait indeed.

So now I can post some more impressive demos
(http://www.physics.usyd.edu.au/~asmith/files/sc1/MST_2D.jpg)
MST on 1000 random points in 2 dimensions.

(http://www.physics.usyd.edu.au/~asmith/files/sc1/MST_3D.jpg)
MST on 1000 random points in 3 dimensions. It takes a bit longer (something like 1.25 times as long) to do this in 3D.

(http://www.physics.usyd.edu.au/~asmith/files/sc1/MST_separated.jpg)
It may not have a use in this project, but there's an option I added to do a thing called ``separation" - remove all branches above some arbitrary length to leave behind islands. Uh, in case there's a race that can make long-distance travel difficult, or something.

(http://www.physics.usyd.edu.au/~asmith/files/sc1/MST_pruned.jpg)
Again, this may not have a use, but this is the result of ``pruning", removing long thin branches (after separation). For this purpose, branches are defined as the lines comprising nodes that only have 2 links at most coming from them. It's supposed to make the structure in the input points easier to see at a glance. As you can see there isn't much structure in a random field ;D It might have a use for displaying the starmap along with zoom and rotate tools, or something.

So next I need to test the procedure for adding links to get the closed loops. Should be easy compared with this, and if not, I guess there's always Death's idea to fall back on . . .
Title: Re: A star control 1 remake that may actually get finished
Post by: Dragon on February 15, 2010, 11:03:58 am
As luck would have it I got into the office all bright and shiny eyed to do a massive post here.  Then Zeracles beat me too it.  I haven't had a chance to understand it yet but it looks cool.

I don't have anything pretty to show but I came across an interesting problem this weekend so I thought I'd share.  Or maybe I should say the solution was interesting, the problem has been around for *ages*.

Basically something happens - a user presses a key, resizes the window or even blows up the enemy - and there are a number of other objects that want to know about it.  Yep.  It's eventing.  Now it's been solved time and time again and in probably every language ever invented.  So how can I possibly have anything to say about it?

Well, I hadn't yet found a solution that I was entirely happy with - certainly I've implemented any number of eventing systems but I've never liked any of them.  Mostly they've felt to complicated and that lead me to believe I didn't really understand what the problem space was.  So this weekend I had a long think about what it is I really wanted from an eventing system.  The solution - when I finally found it - proved to be ridiculously simple.

Something happens to an object and that object wants to tell any other interested objects: "Hey! This thing happened to me".  I could start using words like queues and stacks and guaranteed delivery at this point but, really, all I want to do is send those objects a message.  And a message - to the purists - is just a function call.  My problem is reduced to: how do I call a method on several objects at the same time.  Normally when sending a message (ie: calling a function) the object receiving the message most be known at compile time.  However I couldn't assume that I would know about every object that could ever possibly be interested in my message.  Someone else will - very likely - want to know about it after I'm done with my code.

The solution is - obvious to c++ programmers - a bit of virtual function magic.  But that's not enough I wanted the usage to be simple as well.  When I post my message (or send my event or whater you'd call it) I want to type one line saying: "This happened" - all those who wanted to know about it must magically hear me.  But even that's not enough.  If I'm listening for any message I want to type only one line to say I'm interested and only one more line to say I hear it.

The solution is in the blue block below (view the image to get a readable size).

(http://i.imgur.com/Z3nVw.png)

The class CEvent, it's a potential message; it isn't an actual message that is being sent right now.  It knows who's interested in it has a collection of listeners.  The function AddListener is all that's required to tell the event you're interested in it.  Actually that's not strictly true, the object that's interested has to inherit from CListener to force the compiler to provide the largest possible function pointers (multiple virtual inheritance) but CListener is an empty class so it's not too painful.

The function CallListeners actually sends the message.  It's the heart of the solution, everything else is just engineering to make it work.  And how it works is what makes this all so elegant - it's why I've posted this.  For instance let's say there is a missile object and an asteroid object.  The missile wants to know if the asteroid is destroyed so it can stop tracking it*.  When the asteroid is destroyed it runs this line of code (previously the missile must have added itself to the asteroids Event as a listener Asteroid.Event.AddListener but that's trivial).  Line of code:

Code: [Select]
Asteroid.Event.CallListeners(AsteroidListener::Destroyed, Asteroid);

C++ can deduce the template parameter - in this case AsteroidListener - automatically.  One doesn't have to specify the template parameter with <> like: CallListeners<AsteroidListener>(AsteroidListener::Destroyed, Asteroid).  But that's still not the real magic, that's just saving a bit of redundant typing.  No, if you look at the CallListeners function you will see a rather strange local variable declared as:

Code: [Select]
M cTemp
Where M is the template parameter: AsteroidListener.  It creates an actual instance of AsteroidListener on the stack.  We need this instance so that we have the virtual function table for AsteroidListener**.  We need the virtual function table so that we can call GetClassName on it.  Wait! what?  It looks like there's no such method but deeper in the system some preprocessor madness means that certain classes (including all CListeners and sub-classes) do have that method.  How that works is a tale for another time.  For the sake of this post just assume that GetClassName on AsteroidListener has been implemented and returns "AsteroidListener".

Given the name of our Listener we can now look through all the Listeners in the Event that are AsteroidListeners.  This guarantees that the function we are calling on the listeners exists: AsteroidListener::Destroyed.  The function is called using the rather strange and nasty ->* operator in

Code: [Select]
(pcListener->*ListenerFunc)(pcSource, pvContext)
ListenerFunc is the AsteroidListener::Destroyed parameter passed to CallListeners originally.  The brackets around "(pcListener->*ListenerFunc)" are necessary because of some retardation in the C++ spec regarding precedence of operators. 

And that, is how you call a method on any number of objects in one line.

Neat huh?

*Why?  I don't know.  It's a contrived example.  Deal with it.
**Only instances have virtual function tables, we can't call virtual functions statically.  Bugger.


@Zeracles: Expect another post shortly  ;)
Title: Re: A star control 1 remake that may actually get finished
Post by: Zeracles on February 19, 2010, 10:07:09 am
So that's how an asteroid will know to explode (and everything that follows) when I shoot it? What a beautiful story!

I was thinking about writing simulation code for things ranging from projectiles to galaxy clusters. Something like what you posted could be handy for handling events like, uh, asteroids blowing up.

Another Massive Post coming soon 8)
Title: Re: A star control 1 remake that may actually get finished
Post by: Dragon on February 19, 2010, 11:27:07 am
Another Massive Post coming soon 8)
Oh god no!!!  I'm still trying to understand the last one  ;D

I was thinking about writing simulation code for things ranging from projectiles to galaxy clusters. Something like what you posted could be handy for handling events like, uh, asteroids blowing up.
Well mostly I use it for mundane stuff like reading keystrokes etc... but, yeah, telling things to blow up is fun.
Title: Re: A star control 1 remake that may actually get finished
Post by: Zeracles on February 22, 2010, 11:45:03 pm
I've implemented my earlier idea about the addition of links to get the closed loops, and I think it does the job. I'm calling it the Minimally Connected Opaque Friend Graph feel free to call it a Zeracles graph if you prefer. I've posted the definition and code for it on the ultronomicon (http://wiki.uqm.stack.nl/User:Zeracles/Starmap/Minimal_Spanning_Tree). Anyone interested in the details should read that page.

(http://www.physics.usyd.edu.au/~asmith/files/sc1/MST_2D_MCOFG_f1.jpg)
This is the same two-dimensional MST as before, with links added to produce an MCOFG. There are two numbers that vary the connectedness of the graph. This has friendliness = locality factor = 1. The original MST had 999 links, this has 1078.

(http://www.physics.usyd.edu.au/~asmith/files/sc1/MST_2D_MCOFG_f1000.jpg)
Here I've increased the friendliness to 1000, which increases the number of links to 1402. There are links going through points here, which we don't really want. Friendliness increases the number of links each point makes to its neighbours, but doesn't change the length scale that defines its ``neighbourhood." This is what the locality factor is for.

(http://www.physics.usyd.edu.au/~asmith/files/sc1/MST_2D_MCOFG_l2.jpg)
Here I've reduced the friendliness back to 1 but increased the locality factor to 2, which gives 3195 links. This is reminiscent of the delaunay tessellation, which we considered earlier, but perhaps better for our purposes, since this doesn't necessarily make a convex hull, and is adaptable with the two parameters here. I think this is what we want, so annigilate it!

(http://www.physics.usyd.edu.au/~asmith/files/sc1/MST_3D_MCOFG_l2.jpg)
This is the same, but on the three-dimensional MST - 8585 links. Bit hard to tell what's going on, but this stuff should generalise very simply to any number of dimensions.

The one caveat with this is that all these examples are done with random point distributions, and trying this out with structured fields is an important test. Apart from that, the remaining (optional?) step is removal of links weighted by length, as mentioned earlier, which is trivial. Reducing the locality factor might give a similar result but not random. I'd also like to implement Death 999's idea in some way. I'll be leaving this stuff alone until I've done a few things for Cedric though.

Well mostly I use it for mundane stuff like reading keystrokes etc... but, yeah, telling things to blow up is fun.
I was thinking about the sort of event this might be good for in the simulation, and imagined a change to the laws of physics. Adding ``God" as a Listener should be pretty amusing ;)
Title: Re: A star control 1 remake that may actually get finished
Post by: Dragon on February 23, 2010, 02:36:55 am
(http://www.physics.usyd.edu.au/~asmith/files/sc1/MST_2D_MCOFG_l2.jpg)
Here I've reduced the friendliness back to 1 but increased the locality factor to 2, which gives 3195 links. This is reminiscent of the delaunay tessellation, which we considered earlier, but perhaps better for our purposes, since this doesn't necessarily make a convex hull, and is adaptable with the two parameters here. I think this is what we want, so annigilate it!
Sweet!  This one looks like WinnarTM.  I wouldn't worry about increasing the friendliness and getting lines passing through points because in 3D is unlikely a line will pass *exactly* through a point.

And now all that's left is for me to actually implement it - you know: the Zeracles graph.   I think that this weekend, I should stop mucking around with UI code and write something interesting.  :)
Title: Re: A star control 1 remake that may actually get finished
Post by: Angelfish on February 23, 2010, 10:56:43 am
Good idea dragon :). Go get this thing on the road!
Title: Re: A star control 1 remake that may actually get finished
Post by: Zeracles on February 24, 2010, 05:04:04 pm
Page 12 and we're still on the bike track? ;D

Thanks Dragon, if you're doing a conversion based on the code I posted, let me know if anything is confusing.

I wouldn't worry about increasing the friendliness and getting lines passing through points because in 3D is unlikely a line will pass *exactly* through a point.
Normally yes, but if one of the structures in the starmap is a thin ``wall" (like in an example I posted on the previous page), it becomes much more likely as then it's locally reduced to the planar case.
Title: Re: A star control 1 remake that may actually get finished
Post by: Dragon on February 25, 2010, 03:08:03 am
Page 12 and we're still on the bike track? ;D
Well, more of an animal path but...

Go get this thing on the road!
Yep! Time to get some actual Star Controlling done.

Which reminds me, I must take your code home on Friday or I'm going to be sitting there looking lost for the next four days (Yay for 2 days off!).  Should probably take a few PDFs on DTs and MSTs also...
Title: Re: A star control 1 remake that may actually get finished
Post by: Lukipela on February 25, 2010, 12:30:51 pm
Yep! Time to get some actual Star Controlling done.

Which reminds me, I must take your code home on Friday or I'm going to be sitting there looking lost for the next four days (Yay for 2 days off!).  Should probably take a few PDFs on DTs and MSTs also...

Oooh, that sounds promising.
Title: Re: A star control 1 remake that may actually get finished
Post by: Zeracles on February 26, 2010, 01:03:51 am
It might be worth noting that my approach to the MST is different to most others out there. Normally, one has a whole lot of ``weights" which in this context are the interpoint distances. There is a weight for every pair of points. So if one has 1000 points, the first step is often to calculate about half a million distances, and leave that array in memory while generating the MST.

I don't calculate all the weights first up because it isn't necessary, instead I search around each tree within a small radius for the closest points, and incrementally increase the search radius until it's sufficient to link all the points. I can't be sure it's faster than precomputing the weights to begin with, but the 1000 points in 3 dimensions takes about a minute on my computer, the way I've done it. Adding the links for the Zeracles graph is really cheap, possibly less than a second.
Title: Re: A star control 1 remake that may actually get finished
Post by: Dragon on March 02, 2010, 01:39:51 am
@Zeracles, a couple of questions about your code:

Code: [Select]
index=transpose(linspace(1,lengthinputpositions,lengthinputpositions));
Does linspace create an integer array of 1..lengthinputpositions of length lengthinputpositions?  And if so, what does transposing it do?  I'm assuming it's changing it from a vector Ai1 to A1i but I don't understand why.

Code: [Select]
remainingpositionxs=inputpositionxs(find(maskvector==0));What does this code do?  I gues the == is a check for equality but does that 'find' then filter out all the zeros from inputpositions?  I couldn't make head or tail of it.

Code: [Select]
numbertrees=length(unique(treenumber));Does unique imply that the array it returns is sorted in anyway or does it give the unique elements in the order that they're found?  Also does 'length' return the same result as numel?

K.  Gotta run.
Title: Re: A star control 1 remake that may actually get finished
Post by: Zeracles on March 02, 2010, 04:12:49 am
Sorry :'(

Does linspace create an integer array of 1..lengthinputpositions of length lengthinputpositions?
I think that's all I use it for here, but linspace is more general; linspace(a,b,n) creates a 1-by-n vector which contains values (not necessarily integers) linearly spaced between and including a and b. I think in the code I posted, I mostly do linspace(1,n,n), which just counts integers from 1 to n.

>> linspace(1,10,10)
ans =
     1     2     3     4     5     6     7     8     9    10

>> linspace(1,pi,4)
ans =
    1.0000    1.7139    2.4277    3.1416

In the instance you quote, I'm just numbering the trees, which to begin with are the input points themselves.

what does transposing it do?  I'm assuming it's changing it from a vector Ai1 to A1i but I don't understand why.
Yep, that's exactly what it does. Here, it's from an earlier version of the code in which it was necessary, but now it isn't so I've removed it. I think I transposed it to get a column vector I could attach as a column to one of the other arrays.

EDIT*: But I transpose elsewhere in the code, because to feed elements of a vector into a for loop,

for i=somevector
   ...
end

the vector needs to be a row vector. Otherwise, there will only be one i, and it'll be a column vector. So I only transpose to put a vector in the right shape for iterating. Partly because of this, I like the way C does loops, but anyway - I don't think you'll have to tranpose at all.

Code: [Select]
remainingpositionxs=inputpositionxs(find(maskvector==0));What does this code do?  I gues the == is a check for equality
Yes. == < <= > >= all return 1 if the relational condition is satisfied (and zero otherwise).

>> [-2,-1,0,1,2]==1
ans =
     0     0     0     1     0

>> [-2,-1,0,1,2]>=1
ans =
     0     0     0     1     1
     
does that 'find' then filter out all the zeros from inputpositions?
Right again - find returns the indices of all nonzero elements of a vector. If the vector was row or column, find(vector) will be row or column respectively.

>> find([-1,0,1])
ans =
     1     3

because only the second element is zero.

So find is handy for retrieving indices of elements that satisfy some condition.

Does unique imply that the array it returns is sorted in anyway or does it give the unique elements in the order that they're found?
It gives unique elements in ascending order.

>> unique([1,1,4,3])
ans =
     1     3     4

But as with the transpose thing, it's a redundant operation from an earlier version of the code, and I've removed this too.

Also does 'length' return the same result as numel?
For a vector (which is all I use it on here), yes.

Okay, now I'll see if I can spot anything else . . .

In a few places I manipulate arrays
[a,b,c] makes a row vector
[a;b;c] makes a column vector
[] is nothing - like declaring a 0-by-0 array that can have other arrays appended to it
array(:,2) returns the second column from the left of array (not the third like in C)
array(2,:) returns the second row from the top of array

Code: [Select]
xextent=eps;
eps is just a small number, 2.2204e-16, so that the area or volume (measure) can't be zero, which causes problems.

.* is element-wise multiplication, rather than matrix multiplication.

size(array) returns a vector which measures array (in numbers of rows and columns) - it's {number of rows, number of columns}, if array is only two-dimensional.

Sorry abut those (especially the bits that were redundant leftovers :(), hassle me about anything else I haven't made clear, by post or PM.

*EDIT: above, about the transpose.
Title: Re: A star control 1 remake that may actually get finished
Post by: Dragon on March 03, 2010, 09:30:58 am
I think that's all I use it for here, but linspace is more general; linspace(a,b,n) creates a 1-by-n vector

Just to be sure to be sure.  This creates a row right, not a column?  Would linspace(a;b,n) have create a column or am I trying to be clever?

Find returns the indices of all nonzero elements of a vector. If the vector was row or column, find(vector) will be row or column respectively.

Ah ha!  That makes a lot more sense knowing it returns the indices.  I really was stumped by what find was returning.

hassle me about anything else I haven't made clear, by post or PM.

Well... seeing as you asked...   :P

Code: [Select]
maskvector=treenumber==tree;
treeindices=find(maskvector);
lengthtreepositions=sum(maskvector);

remainingpositionxs=inputpositionxs(find(maskvector==0));
remainingpositionys=inputpositionys(find(maskvector==0));

Taking a look at this code here (and let's assume 5 points/trees to start with and that the tree we're dealing with is number 2).  Does this mean that:
maskvector equals [0,0,1,0,0].
treeindices equals 3 (the only non-zero in the vector
lengthtreepositions equals... wait a minute?  Does maskvector become something like:
Code: [Select]
0,0,1,0,0
0,0,1,  0
0,  1,  0
or is does it become an m by n matrix where all the rows and columns are the same length (with a bunch of ones down the center).
So first time around lenghtreepositions will equal 1 and later on more elements are added to the columns?
and finally remainingpositionxs and remainingpositionys both become [1,2,4,5]?

I'm sort of rubber ducking here/thinking aloud/whatever but I'm slowly starting to understand.  Please be patient, there's going to be a lot more questions yet...

Lasty, a general matlab question: Can an element in a matrix be a matrix itself?  I haven't worked out whether branches is using something like that or not.
Title: Re: A star control 1 remake that may actually get finished
Post by: Zeracles on March 05, 2010, 07:48:25 am
No-one should get the wrong idea here, Dragon is a much better coder than me. Matlab is a language that allows people like me with no real computing background (I haven't done any computer courses) to avoid a lot of low-level stuff.

I think that's all I use it for here, but linspace is more general; linspace(a,b,n) creates a 1-by-n vector
Just to be sure to be sure.  This creates a row right, not a column?
Yep, a row.

Would linspace(a;b,n) have create a column or am I trying to be clever?
That's a brilliant inference, but semicolons don't mean anything in matlab function arguments as far as I know, unless they're being used within [] to construct arrays.

Code: [Select]
maskvector=treenumber==tree;
treeindices=find(maskvector);
lengthtreepositions=sum(maskvector);

remainingpositionxs=inputpositionxs(find(maskvector==0));
remainingpositionys=inputpositionys(find(maskvector==0));
I'll start by explaining what this does - I think you've got it, but just to be sure.

It all works by joining together trees. Each tree grows and is joined to nearby ones. This involves looking around each tree for nodes from other trees that are nearby. The first step here is to isolate the nodes of one tree. treeindices does this. lengthtreepositions is the number of nodes in this one tree, and the for loop a few lines later is where the searching is done, it visits each node of the tree, so i counts to lengthtreepositions.

Taking a look at this code here (and let's assume 5 points/trees to start with and that the tree we're dealing with is number 2).  Does this mean that:
maskvector equals [0,0,1,0,0].
treeindices equals 3 (the only non-zero in the vector
That's right, assuming you meant tree number 3.

lengthtreepositions equals... wait a minute?  Does maskvector become something like:
Code: [Select]
0,0,1,0,0
0,0,1,  0
0,  1,  0
*kicks self* I should have explained - the sum function arithmetically adds together all the elements of a vector (I don't think I use it on a matrix anywhere here). maskvector remains a vector, and lengthtreepositions is a scalar equal to the number of nodes contained in the current tree.

So first time around lenghtreepositions will equal 1 and later on more elements are added to the columns?
lenghtreepositions starts at one and increases as the number of ones in maskvector grows.

and finally remainingpositionxs and remainingpositionys both become [1,2,4,5]?
They'll become the xs and ys corresponding to the indices [1,2,4,5], yes.

Lasty, a general matlab question: Can an element in a matrix be a matrix itself?  I haven't worked out whether branches is using something like that or not.
No, but I can totally see what you're thinking. Matrices can be put together in the same way as scalars to form larger matrices. The individual elements of the ``ingredient" matrices then become individual elements of the resultant matrix. If I make a 4-by-4 matrix a, and another 4-by-4 matrix b, c=[a,b] would be a 4-by-8 matrix.

I'll go through exactly how branches evolves. It does indeed do the sort of thing I just described.
Code: [Select]
branches=[];
At the beginning, initialised as a 0-by-0 array.

Code: [Select]
mindistancecandidates=[mindistancecandidates;mindistancecandidate];
mindistancecandidateindices=[mindistancecandidateindices;branchcandidateindex];
When searching around the nodes of a particular tree to find potential linkees, many distances are stored so they can be compared later (we want the minimum distance). These distances are mindistancecandidates, and their indices are mindistancecandidateindices. We get this pair for each node of the current tree.

Code: [Select]
mindistance=[min(mindistancecandidates),treeindex,mindistancecandidateindices(find(mindistancecandidates==min(mindistancecandidates)))]; % minimum distances carry the indices of the prospective link destination
mindistances=[mindistances;mindistance];
Once we have all the neighbouring distances, we find the minimum, which is mindistance. It's a row vector, at this point I get it to carry the 2 indices of the potential link nodes, treeindex and . . . the other one. mindistance is the minimum distance for a single node of the tree. mindistances stores the minimum distances for all nodes of the current tree.

Code: [Select]
branchdistance=min(mindistances(:,1));
branchindex=find(branchdistance==mindistances(:,1));
These are the precursors to branch. For the current tree, we want the minimum distance from any node of that tree to any node outside that tree. This means we want the minimum (branchdistance) of the minima (mindistances) found at each node.

Code: [Select]
branch=mindistances(branchindex,:);
Here, the appropriate row of mindistances is selected and then -

Code: [Select]
branches=[branches;branch];
This is where branch is added as a row to branches. The final result of the code is a matrix with as many rows as there are MST links, and 3 columns. Each row has the length of the link and the indices of the two endpoints.

I'm sort of rubber ducking here/thinking aloud/whatever but I'm slowly starting to understand.  Please be patient, there's going to be a lot more questions yet...
No worries :), I don't visit this place every day though, so I won't always be able to reply straight away.

In other news, this thread has broken into the forum's top 10!
Title: Re: A star control 1 remake that may actually get finished
Post by: Lukipela on March 05, 2010, 08:00:05 am
This is probably the most complicated top 10 thread as well.
Title: Re: A star control 1 remake that may actually get finished
Post by: Sage on March 06, 2010, 12:46:50 am
Really? I'm not having too much trouble following it myself! ;)
Title: Re: A star control 1 remake that may actually get finished
Post by: Zeracles on March 08, 2010, 11:25:48 pm
Digital art, 3D models, graph theory, Dragon's awesomeness, a dash of cricket, sand dun The thread gets longer, Dragon's karma goes up, and mine goes down. Simple ;)
Title: Re: A star control 1 remake that may actually get finished
Post by: Dragon on March 11, 2010, 08:55:05 am
Still digesting this, just got a bit distracted by The Real WorldTM

Matlab is a language that allows people like me with no real computing background (I haven't done any computer courses) to avoid a lot of low-level stuff.

In my not-so-humble opinion computer courses don't teach you how to program so it's no great loss if you haven't done any.  'Varsity courses tend to be theoretical and teach how compilers work or why network protocols are designed as they are; you should be a competent programmer before attending.  Technicon courses teach how to fill in the right check boxes in job interviews; they're mostly money spinners for whoever runs them.   Anyway, before I start ranting; I began with BASIC which is similar to Matlab in a number of aspects and goes to show that you don't need typed and compiled languages to achieve things.

I'll start by explaining what this does ... Matrices can be put together in the same way as scalars to form larger matrices.
Thanks, I think I understand this now.

I'll go through exactly how branches evolves. It does indeed do the sort of thing I just described ...
I still need to read this with understanding (as opposed to just skimming it).  I should have some time this weekend to go over it in detail.  Actually as the branch stuff was what I was really stuck on (I had no concept of what it was doing or even what was stored in the branches) I should make some good headway now.

And have an annigilation for your efforts 8).