- Home /
Visualizing area of influence in a sci fi game
Hello there handsome folks,
I am trying to figure out how to display an area of influence around player/enemy owned objects in my 4x game.
So far i am using a line renderer to display the outer influence ring, but i have no idea how to display the inner ring. Plus i would like if the areas collide to share space and push each other depending on the power of each influence (similar to civ5), but that is for much later :)
This is an example of how things should look:
I would be very happy if any of you guys share an idea or two on how you would implement something like this. :)
EDIT:
http://canadianonlinegamers.com/wp-content/uploads/2012/07/Endless_Space_Galaxy_View_2.jpg - A similar implementation of what im trying to achieve. Look at the stars "Vorta, Horolium" as the one influence point and the "graffias, wordan" as the opposing influence point.
Do you want this to be seen in the Game View? or only in the Scene View?
Yes i thought of this option, but then changing shape based on the colliding borders is impossible to do. Also you're pretty much forced to look straight down with the camera.
@TpkQ91 its supposed to be a in game representation of the player/enemy influence in the galaxy. So yeah in the game view.
Why are you forced to look straight down? I'm not sure what you mean by "changing shape based on the colliding borders is impossible to do".
Answer by tanoshimi · Nov 15, 2013 at 10:52 AM
For visualisation purposes, this could be calculated in a custom shader by comparing the distance of each point to the centre of the planet in world space, as described at http://alastaira.wordpress.com/2013/09/07/super-mario-galaxy-reveal-hidden-platforms-cg-shader/.
I will try and see if i can use this, thanks for the suggestion :)
I'm jumping on a somewhat old thread but, by any chance, did you get it working? I've been playing with this also and I'm not getting the result.
I'm more inclined to think Endless space does not use shaders to accomplish this effect, but rather some mesh deformation technique.
I would love to get your input on this.
Thanks.
I had to jump to a different project so i could not actually finish this part, but from further research i think a "fog of war" approach is actually pretty viable. Basically each owned planet is a "fog of war" emitter.
On the actual realisation i am pretty sure this is going to be done with combining mesh points to create a huge mesh that envelops all of the players territory, then based on the ownership draw different fills (this is where i think shaders come in handy). I still have no idea on what to do with colliding AOIs from different players though :)
I've played a bit with the Proximity shader approach. Had to tweak the shader a bit, but got pretty good results.
Problem appears when one planet's influence has to be "eaten" by more than one influence of different ownership. At this stage, I'm not sure the shader approach might work.
I'm thinking of using masking shaders of some sort. I'll see if I have time to play a bit today with that.
Here are some pictures for reference. You can see the problem I mention on the third.
Damn, pretty good job. Way more "working" than what i had :) Now i really wanna get back to that project :)