Jump to content

  • Log In with Google      Sign In   
  • Create Account


ferrous

Member Since 19 Nov 2013
Offline Last Active Today, 11:43 AM
-----

Posts I've Made

In Topic: How was GTA3 made in such a short time?

11 July 2014 - 02:06 PM

I haven't played the game in forever, but I'm guessing they heavily re-used assets, that and it's PS2, so low textures, low poly models, etc.  That kind of artist count in that era wasn't all that uncommon.


In Topic: (Super) Smart Pointer

11 July 2014 - 10:40 AM

 

 

As Buckeye says, make it the AI's job to work out if the target is still there.

Right, but that's what I'm saying, I'd rather not iterate every object on the other team to determine if my target is dead or not. In that case, each 20 marines is pointing to say the last object on the enemy team. If the enemy team has 1,000 objects, then

//Do this 20 times?
marine.ComputeAI() { // loop through to see if enemy exists in list........has to loop 1,000 objects}

 

 

^^^ Was this the original solution to the problem? I didn't get what the solution being suggested was. I think it was this. I guess if I finally partition my world objects, then I wouldn't have to search through that many objects and that would be ok.

 

 

Also as an aside to the whole pointer stuff.  You might want to use a hashmap instead of a loop.  If for example, the marine ai just hold a handle instead of a pointer, then they could just do a simple lookup, instead of iterating over a list.  (Or use an array and store the index)  No world partitioning required at that point.  (That's more for when you need to iterate first, to find out who is within X or whatever, so for an attack move ai, spatial partitioning would be helpful)

 

The other option is to have an event system, and have a "Building X has been destroyed" event go out, and all the AI can go and look and act on that event, possibly setting their targets to null if it was the building.


In Topic: Unit Movement on 2d Grid

11 July 2014 - 09:54 AM

So, if I am interpreting this correctly, you have each unit moving  some distance, but sometimes the distance is greater than the distance between two waypoints?  It sounds like the client needs to know the path, so that when it gets information back from the server it can interpolate the unit along the path.  It probably needs to know that anyway, as many games benefit from showing the path to the user.

 

(or you need to drastically reduce your step size, or cull waypoints that are smaller than the stepsize, though that might have units moving through blocked tiles.)


In Topic: 2D Platformer Technique?

09 July 2014 - 05:13 PM

It looks like, for the first method, it might work if you just expanded the possible move set for the character to check, and perhaps widen the search a little.  It gets a little specific, but it reminds me of games like Dawn of War \ Company of heroes, which basically have a set of moves that vehicles can make, like three point turns, and tries to overlay those over the tiles, and see which ones are valid to use or blocked, and then use the end position of the valid ones to continue the next search from.

 

EDIT:  To expand further, for example, knowing all the methods of getting to a tile that is 2 tiles to the right, and 2 tiles up, just cycle through all the possible methods.  So you end up with basically an array of moves for traveling from one tile to another, for each of the X tiles surrounding the jumper.  Something like the surrounding 24 tiles.  sort of vaguely similar to marco pinters 24 or 48 square directional search.


In Topic: 2D Platformer Technique?

09 July 2014 - 04:23 PM

The first method you had really didn't look that bad.  Sure some cases it didn't handle well, but do other people notice?  As long as the AI can handle most of the cases, you might just shrug and say, "good enough".  You could also cheat, and ensure that all levels work with the AI, ie, just get rid of the cases the AI can't do.  

 

(I realize neither of those might be acceptable to you, but I think it's worthwhile to at least consider them, even if only briefly)


PARTNERS