Sign in to follow this  
venatiodecorus

Unity 2D Space Map

Recommended Posts

venatiodecorus    105
Hello Game Dev community! This is my first post., but I have lurked for a while here. I'm a solo indie planning my next game.

I searched the forum and the web and wasn't able to find any great sources for this topic, so I was hoping you could help me! My apologies beforehand if I missed something.

I'm trying to build a space exploration game, with a ship mode and a player mode. As in, the player can either be piloting their ship in a top down twin-stick kind of mode, or a more traditional RPG mode where the player can walk around and interact with other characters. This will all be in 2D, top down. My current plan involves XNA.

I'm running into a problem figuring out how to best handle my space-mode maps. The player-mode will be relatively painless, a tilemap. But I'm at a loss as to the best way to create a galaxy. I'm currently thinking that I will break up space into solar systems and there will be a travel mechanic to go between these sytems. So the maps will actually be individual solar systems, not all of space. I have a few ideas on how to store this, but I was hoping to get some feedback before I really started rolling.

I was thinking of a XML file defining a point, an asset to use for the planet's graphics, and a scale. And then I'd read that file. At first I would manually edit it and maybe eventually put together an editor. I want to support asteroid belts as well so being able to define a path to draw along would also be useful.

So, anyways, I have a few ideas, but I'd love to hear from some other programmers before moving forward. Thanks for any help.

Share this post


Link to post
Share on other sites
freeworld    341
If your solar system aren't too big, you could stick to the grid based mapping. You could also move onto an oc/quad tree design, instead of having everything on a fixed grid. Using an xml file is perfectly doable... though editing it by hand is going to become a huge pain the more you have to add to it. But along with an editor, it's a decent way to store information, not the fastest but it is friendly to the end user if you allow modding.

Share this post


Link to post
Share on other sites
venatiodecorus    105
Since I want exploration to be a big part of the game, I'd like to make the map fairly large. Larger than I see my tile maps being. For the player-mode I plan on using Mappy to generate tile map files, and designing a galaxy to the scale I'm thinking in Mappy would not be easy.

EDIT: Also, the solar systems will not have too many objects in them, so I think hand-editing would not be so bad.

Share this post


Link to post
Share on other sites
Zeraan    317
This sounds very similar to [url="http://en.wikipedia.org/wiki/Planet%27s_Edge"]Planet's Edge[/url]. In it, you can be on a planet, interacting with characters, or flying around in your space ship. There are stars in the galaxy map, and when you hit a star with your ship, it takes you to the star's system where you can see planets orbiting the star. If you travel outside the boundaries of the solar system, you go back to galaxy map, exiting from the star that you hit, in the same direction that you left the solar system.

For star placement in the galaxy, I had a similar [url="http://www.gamedev.net/topic/586462-algorithm-for-placing-stars-on-a-grid-to-form-a-galaxy/page__p__586462__fromsearch__1#entry586462"]problem[/url], the proposed solutions may help you. For solar system, do you want it to be real-time or static? If static, you can get away with randomly generating points for planets to be on (random radius * random angle) -> convert to x,y position. If realtime, you can generate random radius for each planet, assign orbit speed, and update the angle of the planet in relative to the star in middle, then convert to x,y position again.

Share this post


Link to post
Share on other sites
venatiodecorus    105
Hmm, I actually hadn't considered yet having the planets move, yet that makes so much sense :D Your navigation sounds nice and smooth, similar to Mass Effect 2's as well which I really enjoyed. I haven't decided between that and actually warping between systems through a navigation menu or something. I'm kind of a Trekkie so I like the idea of warping around...

Thank you for the link Zeraan I'll check it out.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this