endless-sky
endless-sky copied to clipboard
Unrealistic Asteroid Behavior
Problem Description
Two things; one, asteroids are kinda boring in thier layout, all of them being exactly the same size. I'll keep this short and simple, It'd be nice to have asteroids have at least a little size variation.
Two, if you are in a thick asteroid field and you are small it's really easy to not get hit by projectiles. Right now the only asteroids you can destroy are ones that produce materials. this to me feels kinda unrealistic in a sense that you can only destroy rocks with metal inside.
Related Issue Links
https://github.com/endless-sky/endless-sky/issues/6048 speaks a little about size variarion but was never addressed by anyone else.
Desired Solution
It'd be nice to see a little size variation in asteroids, especially some big ones.
Also would be cool to have every asteroid destroyable.
Alternative Approaches
I'm not sure what a different approch would be in this case.
Additional Context
No response
I agree that it'd be nice to have more variation in asteroid size, especially some bigger ones, and likewise have more destroyable asteroids.
You might be interested in the following page in the wiki, if you haven't already found it, which details how the asteroids in ES (and EV) work: https://github.com/endless-sky/endless-sky/wiki/TiledAsteroids
To add the larger asteroids meanst that someone would have to make new renders of higher res ones. correct?
Yes. Or even better, just make new bigger asteroid images.
Ok, I made an astroid and animation in blender, then rendered it out for a "large asteroid"
Example:
couldn't upload compressed full animation because it is 4MBs too large.
Oh neat, this is nice. Are you willing to create a PR for the asteroid? Or should someone else do it on your behalf?
I would like to, but I have not delved enough into the base data files and images to count myself proficiant.
If you are interested in learning, we can walk you through the process. You're already on github, so that's a good start.
I know how to use git somewhat proficiantly, and github. I've been a member developing for an openscource game for a while on a Gitea platform, so my skill in that area is alright.
It's just that I have not been into the enless sky enough to know how to implement these as a regular asteroid sprite. If you would like to help me than I'd be most greatful.
I figured out how you load sprite animations and reference them, and I tested this asteroid by replacing the sprite animation of every asteroid with the large one I made. However, I do not know how I would make it it's own asteroid and then call it to spawn in certain areas.
Also, after testing my creation I think that I probably should make a few more of different materials and sizes (medium_dark, large_light_red) or something like so.
thoughts? instructions?
Thanks.
Alright, you sound fairly knowledgeable, so just asking a few questions to make sure we're on the same page.
- You know how to make a fork of Endless Sky?
- Are you familiar with making branches?
- Are you familiar with doing pull requests?
I gather you've already found the steroid images folder :)
yes, yes, and yes.
I gather you've already found the steroid images folder :) I have yes.
ok, I have made a fork and cloned it to my pc. what should I do now?
OK, at this point you need to make a new branch. The name isn't too important, just avoid punctuation and slashes. I'm starting to use the https://www.conventionalcommits.org/en/v1.0.0/ as a pattern for naming my branches, so something like feat(art)-bigger-asteroids
or something.
Ok, I've done that now.
Now, two parts: First getting the images in place:
- Create a new folder in the
images/asteroid
named for your asteroid. I'll use "huge rock" for the purposes of this. One folder per asteroid. - Put all the animations for the asteroid into that folder. ~~I generally advocate for proper names for images, but many of our older ones are, as you saw, just generically named
spin-##
The important part is that the numbers are properly in sequence.~~ It appears that they should be just plainspin-##
for non-mineable asteroids. - Go back to the root level (the main
endless-sky
folder) and find thecopyright
file, and open it. (any text editor should work. Notepad++ is my preference, but regular notepad, vim, or whatever else works too.) - Scroll down to about two-thirds of the way down when you get to the end of the listings and start with the general legal text. (this is line 1754 on my branch, should be somewhere close to that).
- Add in a new files section for yourself. Should match the same formatting as the other ones: I've included the comment about being derived from MZ's works as an example, and because that's quite common. Omit that if it isn't the case, attribute someone else if appropriate, or whatever other comments. (for example, some people have helped with art by doing some post processing and had their mention go in here)
Files:
images/asteroid/huge?rock*
Copyright: Your name here (optional, your contact info here, such as an email or porfolio website or something)
License: CC-BY-SA-4.0
Comment: Derived from works by Michael Zahniser (under the same license).
edit: I think they do actually need to be named spin-##
for non-mineable asteroids. Sorry about that.
The second part is putting them to use.
A. Find the system that you would like the asteroids to appear in. (I'll use Sol in this case because it is easy to find to test)
system Sol
pos -400 100
government Republic
attributes "near earth"
arrival 1080
habitable 1080
belt 1529
haze _menu/haze-67
link "Alpha Centauri"
link Altair
link Caph
link Denebola
link Sirius
link Vega
asteroids "small rock" 30 2.691
asteroids "large rock" 50 5.0508
asteroids "medium metal" 4 2.8566
asteroids "large metal" 1 2.2356
minables iron 8 4.64499
trade Clothing 282
... (it goes on for much more, but this is the important part for this discussion
B. Add in a new line amongst those asteroids. In terms of line order, we do different types of asteroids (so rock and metal) separately, and then in order of size. So small, then medium, then large. So using the "huge rock" as the example name, it'd look something like this:
system Sol
...
asteroids "small rock" 30 2.691
asteroids "large rock" 50 5.0508
asteroids "huge rock" 10 2
asteroids "medium metal" 4 2.8566
asteroids "large metal" 1 2.2356
minables iron 8 4.64499
trade Clothing 282
...
The two numbers after "huge rock" are the count and the energy. The former controls the frequency that they appear, and the latter is how fast they move. It'll be a matter of experimentation to figure out exactly how many you need and how fast you'd like them to move.
Oh, an addendum to this. The git-repository that you are working in is the raw source, rather than the working game. If you copy the endless sky application/.exe from your normal installation (along with the .dll files) into this development folder, you should be able to just launch the game, navigate to your chosen system, and see the asteroids flying around there. (Don't worry about git. The default git setup for endless sky has been set to ignore executables and dll files, so it won't try to upload those).
If the asteroids appear as you want them to, then this is a good point to use git to commit your changes and push the branch to github.
Hey, in case anyone was unaware, the asteroid-heavy systems actually have unreasonable numbers of asteroids. Shaula, (my go-to system because it's the system that MZ put his all-content plugin into,) has 1 "small rock", 2 "medium rock"s, 2 "large rock"s, 47 "small metal"s, 208 "medium metal"s, and 45 "large metal"s. This is a total of 305 asteroids per tiling section, most of them being "small metal".
This is too many asteroids!! I, personally, reduced those metal asteroids to 17, 38, and 15 respectively (down from 47, 208, and 45) and then the system felt "decently packed" without being unreasonably dense.
I am excited to see larger (and maybe smaller?) asteroids added to make empty space a bit more unique, But also I'd like to keep empty space mostly empty, with most asteroids focused into belts (whether they can be broken when there or not) so that there is tactical play between staying put in open space or heading to the asteroid belt to make long-ranged weapons less useful
Once you've got the asteroids working where you want them to work, and you've committed your changes and pushed them to GitHub, you can make a pull request. There are a variety of ways to get to the pull request page, but might be easiest to just go there directly. https://github.com/endless-sky/endless-sky/pulls and then click on the new pull request button. If you just committed recently, github might have a helpful yellow banner on the top of the page that is something to the effect of "You recently made changes to this branch, make a pull request?" You can click on that button, it'll save you a step or two.
At this point, you should have a template to fill out. It's got three sections: One for bug fixing, one for adding content, and one for features (typically code / game engine stuff).
Having asteroids actually all moving in orbits is visually and tactically appealing. I definitely like it; although if they are moving in orbits, they definitely need many more than the normal amount. I suspect this may have resource costs in what it takes to handle them all. In the meantime, having some larger asteroids that are slow enough to actually use as cover could be a very interesting addition to the universe.
Yes, simulating many many non-tiling asteroids following orbits is much more intensive than the tiling solution we have now. If you put one asteroid into a system, and then count the number of asteroids you actually come across, you'll be able to see how much mileage the game gets out of "1" tiling asteroid. But if it's non-tiling, following an orbit, you not only have to keep track of many things rather than just one, but also for each one you have to calculate its distance from the system center and modify its velocity
Thank you @Zitchas. I will do this today.
Just to clear it up though, I said I use a pc, I didn't mean by that I use windows. At the moment I am using linux.