Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

 
Advanced search

1338367 Posts in 61027 Topics- by 52503 Members - Latest Member: perfectroll

May 21, 2018, 06:08:55 pm

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsCommunityDevLogsCyberpunk CityBuilder 1
Pages: [1]
Print
Author Topic: Cyberpunk CityBuilder 1  (Read 448 times)
indominator
Level 1
*


?????


View Profile
« on: May 11, 2018, 10:10:16 am »

My latest project will be a cyberpunk city builder

This is the first gif showing prospect road and intersection building.



and this is how i am going to render the streets. by painting the texture



this is a link to the code.

https://github.com/indieindie7/codes/blob/master/games/city_builders/FirstPass

one intersecion has a list to all connected intersectios.

i have a code to check if one intersection is near another, than on the middle of new roads, or vice versa, then i check if theres collsion between roads. its a bit confusing even for myself. this was my first time using goto on C#

Right now i am using basic trigonometry.

http://www.sunshine2k.de/coding/java/PointOnLine/PointOnLine.html

https://en.wikipedia.org/wiki/Distance_from_a_point_to_a_line

https://en.wikipedia.org/wiki/Line–line_intersection

Im gointo change the codes into a mesh deform to make the roads just for some test. intersections wont work properly but i dont really care
« Last Edit: May 11, 2018, 10:30:31 am by indominator » Logged

Zireael
Level 3
***


View Profile
« Reply #1 on: May 11, 2018, 11:00:20 am »

Your FirstPass file has no extension on Github, so syntax highlighting doesn't work.

I like the way you're placing intersections!

What are the cyberpunk features gonna be?
Logged
indominator
Level 1
*


?????


View Profile
« Reply #2 on: May 11, 2018, 05:24:35 pm »

Your FirstPass file has no extension on Github, so syntax highlighting doesn't work.

I like the way you're placing intersections!

What are the cyberpunk features gonna be?

Thx for the love ;p . I plan on revising that code later when i make the roads into cubic beziers.

The game will have one key feature, huge buildings. Vertical paintable zones like the ground will be. I really dont know where to go from there, i am doing this project with a friend of mine, and we are very terrible at setting our goals, we just wanted to make a cyberpunk city builder and have very large buildins and cool visuals. Besides that we have nothing, but getting to that point will already be an achievement for us.

it has been a tough journey so far, i learned a lot. Right now i am trying so mesh distortion for the roads and it has been....  weird



i will try solving this and probably post the code when i finish it
« Last Edit: May 11, 2018, 05:31:28 pm by indominator » Logged

Tusky
Level 0
***



View Profile WWW
« Reply #3 on: May 11, 2018, 09:57:18 pm »

Wow. Good candidate for the beautiful fails thread!!!
Logged
indominator
Level 1
*


?????


View Profile
« Reply #4 on: May 12, 2018, 07:20:01 am »





i am using this video for ma code. its using first derivate for tangent. its still not properly working





POWERPOINT WITH THE CODES AND FORMULAS


Logged

indominator
Level 1
*


?????


View Profile
« Reply #5 on: May 13, 2018, 07:26:08 am »

My result




imma check the code and release it later. i wish i could do some mesh deformation instead of all of this
Logged

indominator
Level 1
*


?????


View Profile
« Reply #6 on: May 13, 2018, 12:19:53 pm »

https://github.com/indieindie7/codes/blob/master/games/city_builders/RoadDeform.cs

this is my MESH GENERATOR ON A SPLINE. i am gonna implement this later into the game. the only problem will be calculating when roads collide. BECAUSE there is no point - bezier smallest distance or projection. you would need to lerp each point in a bezier, than go and do the same thing for the other curve.

basically a for inside a for, inside another for and even another for

foreach curve in curves
 foreach curve2 in curves
  if(curve != curve2)
   foreach point in curve
     foreach point2 in curve2
      if(distance < x) COLLISION!!!!



something like. trully a terrible system. which i must optimize


Logged

indominator
Level 1
*


?????


View Profile
« Reply #7 on: May 16, 2018, 07:49:16 am »




and its finished. imma now work on road road collision, i really dont want to. but i got do that. #SADFACE.

and after that, imma upload the codes so yall will be able to check later the complete thing.
Logged

Zireael
Level 3
***


View Profile
« Reply #8 on: May 17, 2018, 05:15:42 am »

To optimize the collision detection, maybe something like an octree? Or some other way of knowing that curve A and B are neighbors but D and A won't collide EVER.

Logged
indominator
Level 1
*


?????


View Profile
« Reply #9 on: May 18, 2018, 10:48:33 am »

To optimize the collision detection, maybe something like an octree? Or some other way of knowing that curve A and B are neighbors but D and A won't collide EVER.


i couldnt use octree because i had some trouble understanding. so i used a code i did for voronoy diagram. i just get the smallest distance from all points. it works



These are the codes: https://github.com/indieindie7/codes/tree/master/games/city_builders/Roadsv2
Logged

Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic