Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 16 Jan 2012
Offline Last Active Oct 02 2015 09:51 AM

Posts I've Made

In Topic: Terrain Normals : Quick questions about calculating on the fly...

20 August 2015 - 09:37 AM

Games like Magic Carpet or Populous the Beginning come to mind for me


As far as I know those games didn't use normals or anything similar. They just used a predrawn tileset. There just isn't any algorithm that could be used 20 years ago that could do that realtime so they faked it by using predrawn images.

In Topic: OpenGL ES 2: Scale texture on creation?

24 July 2015 - 08:18 AM

Why do you want to scale it during creation. What is wrong with letting opengl scale it for you during drawing? Unless you want to implement your own scaling algorithm or use a library to get slow but better quality scaling you are betteroff just letting opengl do it during drawing.

In Topic: How to display all explored nodes with A*?

22 July 2015 - 06:34 AM

There is no such thing as a discarded node in A*. There are only open and closed nodes. You always close the node that has the lowest heuristic value and make new open nodes around it. You can't discard any unused open nodes or you break the whole idea. Looking at the code it seems to be doing the right thing so I assume you are just using different terminology because of a language barrier or something. If you want to display rest of the nodes you need to save the opennodes and closed nodes into the AStar2.Path2.

In Topic: Need help creating procedural rivers

11 July 2015 - 09:40 AM

A 1024x1024 for A* is a really simple problem if you are running it on a processor faster than a handheld calculator. Especially when you only need to run it during worldgen. Also what I would do is just repeat three steps after a swawnpoint has been found.

1. You find the steepest downward slope around the current point and go there.

2. If there isn't a downward slope you floodfill towards directions that are even with current position until you find a downward slope and then you A* a path to that location and go back to 1.

3. If you cant find a downward slope with the floodfille you make a lake that fills the whole floodfill area and go back one step of the river and go back to 1. where you handle the lake as if the height of the terrain was one level higher(as there is now a lake there). You should also allow multiple lakes to be on top of each other to form a deeper and bigger lake.


If you continue this the river will eventually reach the ocean and it will generate nice and realistic lakes as well.


Also if you reach the spawnpoint when going backwards in step 3 then you can stop the river there and you have a nice lake there. Not all lakes have a river that leads to the ocean.

In Topic: Multithreaded mesh loading and 0xcc returned from glGenVertexArrays

29 March 2015 - 09:25 AM

You can't use the same context in multiple threads at the same time. You can "release" a context and "bind" it to another thread but that obviously makes you unable to use it in the original thread. You can however use multiple contexts and have them share resources with each other wich is propably what you want.