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

Login with username, password and session length

 
Advanced search

1344900 Posts in 61678 Topics- by 53241 Members - Latest Member: RoKo0

August 14, 2018, 11:34:12 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 987 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 4
****


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 1
*



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 4
****


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

indominator
Level 1
*


?????


View Profile
« Reply #10 on: May 31, 2018, 10:41:14 AM »

it has been such a long time since i have update this devlog. so far i have been doing lots of things, and i belive this game is more than i can handle, its been hard and i havent been able to properly make the core mechanics so far.



Logged

Zireael
Level 4
****


View Profile
« Reply #11 on: May 31, 2018, 11:34:53 PM »

Do I spy multiple vertical levels?!

That's awesome, don't undersell yourself mate!
Logged
indominator
Level 1
*


?????


View Profile
« Reply #12 on: June 02, 2018, 06:28:47 AM »

I tried using Delaunay, but as always it failed. i am going for another approach . this is the paper that i used to think my algorithm, but i didnt get some parts. i tried seeing other peoples approach like triangle.net and a unity implementation for sHull.

http://www.s-hull.org/paper/s_hull.pdf

what i found
https://github.com/eppz/Triangle.NET
https://github.com/Scrawk/Hull-Delaunay-Voronoi


My result :/


my terrible code:

https://github.com/indieindie7/codes/blob/master/tools/C_SHARP_/Delaunay.cs
Logged

indominator
Level 1
*


?????


View Profile
« Reply #13 on: June 26, 2018, 04:44:49 AM »

My latest try on road creation, not perfect, but still interesting




Logged

indominator
Level 1
*


?????


View Profile
« Reply #14 on: July 08, 2018, 12:48:03 PM »



getting near optimal design
Logged

Zireael
Level 4
****


View Profile
« Reply #15 on: July 13, 2018, 11:46:36 PM »

That's really nice design!
Logged
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic