Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 26 Mar 2013
Offline Last Active Yesterday, 08:26 PM

Posts I've Made

In Topic: 3 Choices: Console.ReadKey(); Does Not Work?

26 November 2014 - 04:20 AM



I'll assume that your attempting to parse out the characters respecitively with some branching not shown in your provided code.

But seeing where you actually perform the branching with your reference to ConsoleKeyInfo is pivotal.


P.s. If at all possible, try utilizing source tags. Makes the code a bit more readable.



In Topic: MAKE A CHOICE engines

23 November 2014 - 06:19 AM

I'll assume you have some programming background since your probing around for engines.



i need wich one that can render millions voxel-like objects with out any problems.


That's subjective and ultimately depends on the system that will be executing the build and the overall complexity of the App.


Several factors also weigh into your previous request


-lighting (will your minecraft clone have lighting? If so it adds another layer of calculations for each cube or mesh. (I think, could be mistaken though; MC utilized lightmaps as opposed to the per-vertex lighting available in Fixed Function GL))


-Run-time world-gen (will your world dynamically be generated as the program runs as mineCraft is?)


-Networking (I would say this is a must if you looking to make MineCraft clone)


And that's the VERY tip of the ice-berg. All of these things MineCraft has (In some form or another). Pinpoint your needs and your projected end-goal, and try choosing an egine based upon that



In Topic: Problem with A*

08 November 2014 - 01:38 PM

Hey, Don't worry about it! It's a multi-step process. I had my own hurdles when I implemented A*. You've laid the foundation , just time to do some debugging.


I'll take a look over some of your other code once I sleep, that's if you and/or one of the other members find the little prolific bit-gremlin hiding out, before I do




How are you calculating your hurestic? Euclidean or Manhattan? Or maybe Something Else?




Good Job! What was it?



In Topic: Problem with A*

08 November 2014 - 11:42 AM

Mind If I see your calculateFValue Method?



if(*it == node)
    if((*it)->Gvalue < openList[0]->Gvalue)
        (*it)->Gvalue += openList[0]->Gvalue;
        std::sort(openList.begin(), openList.end(),sortByFValue);
    return true;



Would have used source tags, but the editor keeps inserting span tags within the source, but this should be sufficient


You loop through potentially all of the nodes in the open-list and when you find the one IN the open-List that is equivalent to the iterators pointer, you don't pay attention to it. You reference and compare to OpenList[0] (which is the one node in your openList, IF your keeping sorted based on FCost, that should have the lowest F-Cost but is probably not the node whom you have to recalculate). You know your code better then I, maybe I'm missing something?



In Topic: Problem with A*

08 November 2014 - 07:48 AM

Hmm, maybe it's just me not seeing it, but what happens when a node is re-encountered in the open-list during your 8-way directional sweep of the nodes?

It is at this time you should recalculate the G-Cost for the node in question to see if it is now a better path. I feel I'm doing a inadequate job of explaining but take a look at this (The third bullet point is what i'm getting at and I can't see it in any of your post's):


c) For each of the 8 squares adjacent to this current square …

  • If it is not walkable or if it is on the closed list, ignore it. Otherwise do the following.           

  • If it isn’t on the open list, add it to the open list. Make the current square the parent of this square. Record the F, G, and H costs of the square.

  • If it is on the open list already, check to see if this path to that square is better, using G cost as the measure. A lower G cost means that this is a better path. If so, change the parent of the square to the current square, and recalculate the G and F scores of the square. If you are keeping your open list sorted by F score, you may need to resort the list to account for the change.

This is of course just a portion of the entire algorithm. It's gone over in a pragmatic approach for the expert, and layman alike masterfully here: http://www.policyalmanac.org/games/aStarTutorial.htm