Things in the real world have settled down a little bit sooner than I expected. I will continue to help with this as time permits. Let's not let the project die.
@No Time to Code
Continue working on the pathfinding. Hopefully Obese87 will work with you, if not, just keep going. He'll catch up when he has time. For the house I attached a few posts ago, I'll attach here a grid with the downstairs floor plan. The areas marked in yellow are doorways that can be pasted through. The dark gray open areas are all passable. The black lines (except where yellow in between) are walls. The goal would be to adapt your pathfinding aglorithm to be able to navigate between any two points on the grid while moving around walls and moving through doors. Ideally, we would end up with a function that could be adjusted to any floor plan just by using the grid squares. Do you think you would be able to tackle this?
The line of sight thing is stil a possibility, but let's square away the pathfinding so we can check it off the list as a tested method that will work or won't work for our needs. At the very least, you'll have a function that can be used for any similar situation, and/or it could be modified into a DLL for any number of other projects.
Quote: "Quote: "Oooh, I don't like the sound of "native DBC commands for collision". We are going to use sparky's, aren't we?"
I don't see why we'd need to, for the most part we can just compare the X and Z coords of each object at large distances, use dear old Pythagoras for near locations and DBC collision if we need the object to use sliding collision!"
The use of the DBC native collision commands is taken out of context here. I used the native collision to get the ground height of the terrain model I posted. As far as the collisions between moving or static objects, it makes sense to use distance checks, but colliding with walls inside of the house (particularly the player) is going to require something besides distance checks for the detail and intracacy of the environment. This would be one area where collision may need to be implemented, and I don't see a problem with native DBC commands.
I can see sparky's being used for shooting weapons, but I would still like to see this project programmed with as much native DBC as possible and use outside means (besides media) only when we can't get the necessary or passable results using DBC code.
@Robert The Robot
Quote: "The waypoint editor is still in progress, I think I know exactly what to do and writing the code should be a technical formality (famous last words...). Could I just check a couple of things about the arrays I'll be using:
PathXZ#(n, 1) = the X/Z coords of each waypoint
PathLink(n) = stores the next waypoint an enemy is to walk to from a given point
PathObjects(n,2): 0 = the ID of the entity object, 1 = Target waypoint, 2 = true/false, is the object walking along a pathway at this point"
you may be able to approach it with fewer arrays though I think the result is the same:
dim pathxz#(totalpaths,maxwaypoints,2)
ex: dim pathxz#(100,1000,2)
pathxz#(p,0,0)=the total number of waypoints in this path
pathxz#(p,waypt,1)=x position of current waypoint
pathxz#(p,waypt,2)=z position of current waypoint
dim objpath(max entities,1)
ex: objpath(50,1)
objpath(obj,0)=path number
objpath(obj,1)=current waypoint
usage:
if object position is with a certain distance of current waypoint
inc nextpt
if nextpt <= pathxz#(objpath(objpath(obj,0),0,0)
nextx#=pathxz#(objpath(obj,0),obpath(obj,1),1)
nextz#=pathxz#(objpath(obj,0),obpath(obj,1),2)
etc.
Enjoy your day.