Tag Info

New answers tagged

2

First you need to know what is an ellipsoid and why we use them. The earth is spherical and to be exact it can be approximated using an ellipsoid. Location Service and all GPS system that work world wide, must use an ellipsoid that fits the best way the earth, Why we need an ellipsoid? because we need a mathematical model to do the computations. for ...


1

There are simple ways to generate cities, depending on your needs. Some time ago, I wanted to generate cities for a fantasy setting, so I started playing with a generator. Like I said in another SE post: "rough on the edges" is an understatement. But it suits my needs (it may meet your needs too). This is what it looks like: Some terms I use internally: ...


1

You should do some research about l-systems, they allow you to specify some basic rules and then procedurally generate the map. You could for example specify that every building must be surrounded by roads, and every road must continue in a straight line or eventually end, and every road is surrounded by buildings or empty space. Then, the algorithm will ...


1

Like stated by Shiro in a comment , it's difficult to give a precise answer. I can suggest a possible starting point. Use random voronoi generation where , given a set of random points P , each point in space is weighted relative to the distance from the nearest p in P. Now , instead of considering euclidean distance use Manhattan distance and you get ...


3

Like @Anko suggested, you should use a graph as data structure for your game map. If you use the this implementation of a graph in Java as a starting point you can represent your map as follows: Graph<Zone> gameMap = new Graph<>(); Zone zone1 = new Zone("Zone1"); Zone zone2 = new Zone("Zone2"); Zone zone3 = new Zone("Zone3"); Zone zone4 = new ...


0

I think you would have to manually define which zones are neighbouring each other - unless you can programmatically parse your map to figure this out automatically. For example with a class attribute like int neighbouringZonesIds[]; that you have to fill.


2

A simple solution would be to assign the doors IDs, where the matching pairs would share an ID, and have them send the player to the other door with the same ID. Or, if for whatever reason you find the need to make such IDs unique, you could assign door pairs matching IDs where one is negative and one is positive but the same absolute value, and when ...



Top 50 recent answers are included