How do I create StarMap?

Get help using Construct 2

Post » Sat Jun 17, 2017 12:18 am

I would like to make a starmap like the one shown in this video (3m 21s):

https://youtu.be/GTajTg2IQOE?t=3m21s

I have made simple maps that have nodes connected together, but nothing like what is shown in the video.

To sum up what I am having trouble wrapping my mind around:

-Spawning nodes and creating "connections" using lines
-Making the next set of nodes appear to be "far away" using a zooming effect
-Choosing which direction/lane to go in

I appreciate any help/guidance I can get.
B
16
S
4
G
4
Posts: 59
Reputation: 3,091

Post » Sat Jun 17, 2017 12:16 pm

The Q3D plugin is designed to do things like this directly. Just place some stars in 3D space, set the camera to "perspective" mode, and animate the motion of the camera to get the desired effect.
www.simbucket.com - HTML5 Science Simulations / https://www.airconsole.com/#!play=com.n ... obotrumble - Robot Rumble on AirConsole
B
48
S
14
G
21
Posts: 377
Reputation: 15,092

Post » Sat Jun 17, 2017 6:31 pm

You can do it with some minimal math. Basically you take 3d points x,y,z and project it to the screen with:
screenx=x/z
screeny=y/z
size=1/z

If the perspective is too severe you can scale it with:
screenx=scale*x/z
screeny=scale*y/z
size=scale/z

The camera is at 0,0,0 but if you want to move it around you can also do this:
screenx=scale*(x-camerax)/(z-cameraz)
screeny=scale*(y-cameray)/(z-cameraz)
size=scale/(z-cameraz)

you can also hide anything behind the camera by seeing if scale/(z-cameraz)<0 for each object.

lines are done by taking two points and using lerp to find the in between positions.


https://www.dropbox.com/s/5fser7xtmov44 ... .capx?dl=1
B
92
S
32
G
107
Posts: 5,274
Reputation: 69,959

Post » Sun Jun 18, 2017 1:38 am

R0J0hound wrote:You can do it with some minimal math. Basically you take 3d points x,y,z and project it to the screen with:
screenx=x/z
screeny=y/z
size=1/z

If the perspective is too severe you can scale it with:
screenx=scale*x/z
screeny=scale*y/z
size=scale/z

The camera is at 0,0,0 but if you want to move it around you can also do this:
screenx=scale*(x-camerax)/(z-cameraz)
screeny=scale*(y-cameray)/(z-cameraz)
size=scale/(z-cameraz)

you can also hide anything behind the camera by seeing if scale/(z-cameraz)<0 for each object.

lines are done by taking two points and using lerp to find the in between positions.


https://www.dropbox.com/s/5fser7xtmov44 ... .capx?dl=1


Thank you, this was very helpful.

I was able to make a very basic/linear node generator after figuring out how your example worked: https://www.dropbox.com/s/w5m8q3fyw97fg ... .capx?dl=0

The method I used to focus on the next node is not perfect but it works for now. My biggest concern now is how I will generate different paths and allow the player to choose which path to take.

The goal is to make it branch out like the sector map in FTL (shown below)

Image

I will experiment some more to try and find an efficient way to accomplish this.
B
16
S
4
G
4
Posts: 59
Reputation: 3,091


Return to How do I....?

Who is online

Users browsing this forum: brunopalermo, cb130felix, Kermad, Lancifer, nyuszi008 and 8 guests