How should i do this?

Sooo… A Long time ago. I came up with a game idea, where you basically explore space.
The Idea seems simple but how i come about this is difficult. ??? ???
I’ve been using Java (Eclipse) for a while now.
I’m pretty good at it. However I’m new to Game Development.

I would like to make a finite randomly generated Map, (Kinda like an RPG style).
This would be probably like an image or a black screen to represent space.
This part is simple. And i think i can do this.

The Hard part is making squares (Represents stars) in the map. They should be big, probably 60X60.
These would be randomly generated and scattered throughout the map.

I Should also be able to interact with these stars. (Simulate gravity, click for information, etc.)

From there on. I can (Probably) tackle the rest by my self.

If you could just guide me toward the right tutorial or whatever, It would be most Helpful. Thx…

Do you mean something like this?

I used this


	void IrregularGalaxyPositions(StarSystem[] systemTypes) {
		Log.write(Log.DEBUG, GalaxyFactory.LOG, "Galaxy Type Irregular");
		// make a list from the types of systems so each system can only be selected once
		List<StarSystem> sysList = new ArrayList<StarSystem>(Arrays.asList(systemTypes));

		int systemsPlaced = 0;
		for (int i = 0; i < numSystems; i++) {
			Point p = new Point();
			int attempts = 0;

			while (attempts < MAX_ATTEMPTS_PLACE_SYSTEM) {
				attempts++;
				int x = (int)(width * rand.nextDouble());
				int y = (int)(height * rand.nextDouble());

				//possibly round systems down to nearest 10
				Log.write(Log.DEBUG, GalaxyFactory.LOG, "... potential position: (" + x + ", " + y + ")");

				// convert to point
				p = new Point(x,y);

				// See if new star is too close to any existing star.
				double lowest_dist = distanceToNearestSystem(p, systemsPlaced);
				Log.write(Log.DEBUG, GalaxyFactory.LOG, "...... squared distance: " + String.valueOf(lowest_dist));

				
				// If so, we try again or give up.
				if (lowest_dist > MIN_SYSTEM_SEPARATION_SQ) {
					break;
				}
			}

			// Select star system from list to place
			int index = rand.nextInt(sysList.size());
			StarSystem s = sysList.remove(index);

			s.clearLanes();
			s.setLoc(p);
			systems.put(p, s);
			if( systems.containsKey(p) ) {
				Log.write( Log.INFO, GalaxyFactory.LOG, "... added system at (" + p.getX() + ", " + p.getY() + ") after " + attempts + " attempts");
			} else {
				Log.write( Log.DEBUG, GalaxyFactory.LOG, "... missing system" );
			}
			systemsPlaced++;

		}
		Log.write( Log.INFO, GalaxyFactory.LOG, "... placed " + systemsPlaced + " systems");
	}

Just eyeballing it there seems to be a logic error where a system will be placed even if it’s too close after attempts are exhausted.

I think I got my code ideas from Free Orion
you could also check out Rementants of the Precursors since they use java and hang around the boards occasionally, but I’m not sure if that project is open source.

Thank You So Much!!! That will get me moving. :slight_smile:

I’ve Posted on Reddit and Some other forums but no one seems to get my Concept. :clue:
Be Happy… You are the First one to understand me! THX! ;D :wink: :slight_smile: